Procedure

ListGeneric

Module

rCover

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

procedure ListGeneric(Dest: TStrings; ARpc: String; ACase, AInvert: Boolean;
  ADatePiece: integer; ADateFormat, AParam1, ADetail, AID: String);

Calls Hierarchy


ListGeneric
 ├InteractiveRemindersActive
 │ └GetRemindersActive
 └ExtractActiveMeds
   └MedStatusGroup

Called-By Hierarchy


                      ListGeneric
             TfrmCover.LoadList┘ 
        TfrmCover.DisplayPage┤   
   TfrmCover.CoverItemClick┘ │   
TfrmCover.UpdateAllergiesList┘   
      TfrmCover.NotifyOrder┤     
     TfrmFrame.UMNewOrder┘ │     
      TfrmCover.popNKAClick┤     
 TfrmARTAllergy.FormDestroy┘     

Calls

Name Declaration Comments
ExtractActiveMeds procedure ExtractActiveMeds(Dest: TStrings; Src: TStringList); -
InteractiveRemindersActive function InteractiveRemindersActive: boolean; -

Called-By

Name Declaration Comments
TfrmCover.LoadList procedure LoadList(const StsTxt: string; ListCtrl: TObject; ARpc: String; ACase, AInvert: Boolean; ADatePiece: integer; ADateFormat, AParam1, AID, ADetail: String; Reminders: boolean = FALSE); -


Source

181   procedure ListGeneric(Dest: TStrings; ARpc: String; ACase, AInvert: Boolean;
182     ADatePiece: integer; ADateFormat, AParam1, ADetail, AID: String);
183   var
184     Param: array[0..1] of string;
185     i: integer;
186     s, x0, x2: string;
187     tmplist: TStringList;
188   begin
189     Param[0] := Patient.DFN;
190     Param[1] := '';
191     if AID = '50' then
192       begin
193         if (InteractiveRemindersActive) then  //special path for Reminders
194             CallV('ORQQPXRM REMINDERS APPLICABLE', [Patient.DFN, Encounter.Location])
195         else
196           begin
197             CallV('ORQQPX REMINDERS LIST', [Patient.DFN]);
198             SetListFMDateTime('mmm dd,yy', TStringList(RPCBrokerV.Results), U, 3, TRUE);
199           end;
200           FastAssign(RPCBrokerV.Results, Dest);
201         exit;
202       end;
203     tmplist := TStringList.Create;
204     try
205       tmplist.Clear;
206       if Length(AParam1) > 0 then
207         begin
208           Param[1] := AParam1;
209           CallV(ARpc, [Param[0], Param[1]]);
210         end
211       else
212         CallV(ARpc, [Param[0]]);
213       if AID = '40' then
214         ExtractActiveMeds(TStringList(tmplist), TStringList(RPCBrokerV.Results))
215       else
216         FastAssign(RPCBrokerV.Results, tmpList);
217       if ACase = TRUE then MixedCaseList(tmplist);
218       if AID = '10' then for i := 0 to tmplist.Count - 1 do    // capitalize SC exposures for problems
219       begin
220         x0 := tmplist[i];
221         x2 := Piece(x0, U, 2);
222         if Pos('(', x2) > 0 then SetPiece(x2, '(', 2, UpperCase(Piece(x2, '(', 2)));
223         SetPiece(x0, U, 2, x2);
224         tmplist[i] := x0;
225       end;
226       if AInvert = TRUE then InvertStringList(TStringList(tmplist));
227       if ADatePiece > 0 then
228         begin
229           if ADateFormat = 'D' then
230             SetListFMDateTime('mmm dd,yyyy', TStringList(tmplist), U, ADatePiece, TRUE)
231           else
232             SetListFMDateTime('mmm dd,yyyy hh:nn', TStringList(tmplist), U, ADatePiece, TRUE);
233         end;
234       if Length(ADetail) > 0 then
235         begin
236           for i := 0 to tmplist.Count - 1 do
237             begin
238               s := tmplist[i];
239               SetPiece(s, U, 12, ADetail);
240               tmplist[i] := s
241             end;
242         end;
243       FastAssign(tmplist, Dest);
244     finally
245       tmplist.Free;
246     end;
247   end;