Procedure

TfrmCover.DisplayPage

Directives

Override

Module

fCover

Last Modified

7/15/2014 3:26:36 PM

Comments

Loads the cover sheet lists if the patient has just been selected 
  procedure LoadList(const StsTxt: string; ListCtrl: TObject;
    ARpc: String; ACase, AInvert: Boolean; ADatePiece: integer; ADateFormat, AParam1, AID, ADetail: String; Reminders: boolean = FALSE);
  begin
    StatusText(StsTxt);
    if(ListCtrl is TORListBox) then
    begin
      ListGeneric((ListCtrl as TORListBox).Items, ARpc, ACase, AInvert, ADatePiece, ADateFormat, AParam1, ADetail, AID);
      if((ListCtrl as TORListBox).Items.Count = 0) then
        (ListCtrl as TORListBox).Items.Add(NoDataText(Reminders));
    end
    else
    begin
      ListGeneric(ListCtrl as TStrings, ARpc, ACase, AInvert, ADatePiece, ADateFormat, AParam1, ADetail, AID);
      if((ListCtrl as TStrings).Count = 0) then
        (ListCtrl as TStrings).Add(NoDataText(Reminders));
    end;
    StatusText('');
  end;

Visibility

Public

Overrides

TfrmPage.DisplayPage

Owner

TfrmCover

Declaration

procedure DisplayPage; override;

Calls Hierarchy


TfrmCover.DisplayPage
 ├TfrmPage.DisplayPage
 ├TfrmPage.GetInitPage
 ├TfrmPage.GetInitPatient
 ├InteractiveRemindersActive
 │ └GetRemindersActive
 ├NotifyWhenRemindersChange
 ├TfrmCover.RemindersChange
 │ ├RemindersEvaluatingInBackground
 │ └NoDataText
 ├RemoveNotifyRemindersChange
 ├StartCoverSheet
 ├LoadCoverSheetList
 ├TCoverSheetList.CVlbl
 ├TCoverSheetList.CVlst
 ├TfrmCover.LoadList
 │ ├ListGeneric
 │ │ ├InteractiveRemindersActive...
 │ │ └ExtractActiveMeds
 │ │   └MedStatusGroup
 │ └NoDataText
 ├WaitList
 ├ARTPatchInstalled
 │ └ServerHasPatch
 ├TCoverSheetList.CVpln
 ├TfrmCover.RemContextPopup
 ├RemindersEvaluated
 │ └ReminderEvaluated
 ├LoadReminderData
 │ ├BeginReminderUpdate
 │ ├GetCurrentReminders
 │ ├CheckReminders
 │ │ ├EvaluateReminders
 │ │ └ReminderEvaluated
 │ ├GetOtherReminders
 │ └EndReminderUpdate
 ├TfrmPage.FocusFirstControl
 │ └TimedOut
 ├TfrmCover.GetPatientFlag
 └SetReminderPopupCoverRoutine
   └ReminderTreePopupCover
     └ReminderMenuBuilder
       ├Add
       │ ├ReminderClinMaintClicked
       │ │ ├ReportBox
       │ │ │ └CreateReportBox
       │ │ │   └TfrmBase508Form.Create
       │ │ │     ├TfrmBase508Form.UpdateAccessibilityActions
       │ │ │     ├UnfocusableControlEnter
       │ │ │     └AdjustControls
       │ │ │       ├TfrmBase508Form.ModifyUnfocusableControl
       │ │ │       └..(rec)..
       │ │ ├DetailReminder
       │ │ │ └InteractiveRemindersActive...
       │ │ └ReminderName
       │ │   └TReminderDialog.GetPrintName
       │ ├ReminderEduClicked
       │ │ ├ReportBox...
       │ │ └EducationTopicDetail
       │ ├ReminderInqClicked
       │ │ ├ReportBox...
       │ │ ├ReminderInquiry
       │ │ └ReminderName...
       │ ├ReminderWebClicked
       │ │ ├GotoWebPage
       │ │ └GetWebPageAddress
       │ ├ReminderEvalClicked
       │ │ └EvalReminder
       │ │   ├EvaluateReminder
       │ │   │ └EvaluateReminders
       │ │   ├ReminderEvaluated
       │ │   └ReminderName...
       │ ├ReminderViewFolderClicked
       │ │ ├GetRemFolders
       │ │ │ └GetReminderFolders
       │ │ └SetRemFolders
       │ │   ├BeginReminderUpdate
       │ │   ├SetReminderFolders
       │ │   └EndReminderUpdate
       │ ├GetRemFolders...
       │ └ReminderIconLegendClicked
       │   └ShowIconLegend
       │     ├TfrmBase508Form.Create...
       │     ├TfrmFrame.TabExists
       │     ├TfrmIconLegend.ShowTab
       │     └TfrmIconLegend.SetFontSize
       │       └TfrmIconLegend.SnapLabels
       ├GetEducationTopics
       │ ├GetEducationTopicsForReminder
       │ └GetEducationSubtopics
       ├AddEducationTopics
       │ ├GetEducationTopics...
       │ ├Add...
       │ └..(rec)..
       ├GetWebPages
       │ └GetReminderWebPages
       └AddWebPages
         ├Add...
         └GetWebPageName

Called-By Hierarchy


     TfrmCover.DisplayPage
TfrmCover.CoverItemClick┘ 

Calls

Name Declaration Comments
ARTPatchInstalled function ARTPatchInstalled: boolean; -
TCoverSheetList.CVlbl function CVlbl(index: integer): TOROffsetLabel; -
TCoverSheetList.CVlst function CVlst(index: integer): TORListBox; -
TCoverSheetList.CVpln function CVpln(index: integer): TPanel; -
TfrmPage.DisplayPage procedure DisplayPage; virtual; -
TfrmPage.FocusFirstControl procedure FocusFirstControl; -
TfrmPage.GetInitPage function GetInitPage: Boolean; -
TfrmPage.GetInitPatient function GetInitPatient: Boolean; -
TfrmCover.GetPatientFlag procedure GetPatientFlag; -
InteractiveRemindersActive function InteractiveRemindersActive: boolean; -
LoadCoverSheetList procedure LoadCoverSheetList(Dest: TStrings); -
TfrmCover.LoadList procedure LoadList(const StsTxt: string; ListCtrl: TObject; ARpc: String; ACase, AInvert: Boolean; ADatePiece: integer; ADateFormat, AParam1, AID, ADetail: String; Reminders: boolean = FALSE); -
LoadReminderData procedure LoadReminderData(ProcessingInBackground: boolean = FALSE); -
NotifyWhenRemindersChange procedure NotifyWhenRemindersChange(Proc: TNotifyEvent); -
TfrmCover.RemContextPopup procedure RemContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); -
TfrmCover.RemindersChange procedure RemindersChange(Sender: TObject); -
RemindersEvaluated procedure RemindersEvaluated(List: TStringList); -
RemoveNotifyRemindersChange procedure RemoveNotifyRemindersChange(Proc: TNotifyEvent); -
SetReminderPopupCoverRoutine procedure SetReminderPopupCoverRoutine(Menu: TPopupMenu); -
StartCoverSheet function StartCoverSheet(const IPAddress: string; const AHandle: HWND; const DontDo: string; const NewReminders: boolean): string; -
WaitList procedure WaitList(ListCtrl: TORListBox); -

Called-By

Name Declaration Comments
TfrmCover.CoverItemClick procedure CoverItemClick(Sender: TObject); -


Source

198   procedure TfrmCover.DisplayPage;
199   { loads the cover sheet lists if the patient has just been selected }
200   var
201     DontDo, ForeGround: string;
202     WaitCount: Integer;
203     RemSL: TStringList;
204     uCoverSheetList: TStringList;
205     i, iRem: Integer;
206     aIFN, aRPC, aCase, aInvert, aDatePiece, aDateFormat, aTextColor, aStatus, aParam1, aID, aQualifier, aTabPos, aName, aPiece, aDetail, x: string;
207     bCase, bInvert: Boolean;
208     iDatePiece: Integer;
209   
210   (*  procedure LoadList(const StsTxt: string; ListCtrl: TObject;
211       ARpc: String; ACase, AInvert: Boolean; ADatePiece: integer; ADateFormat, AParam1, AID, ADetail: String; Reminders: boolean = FALSE);
212     begin
213       StatusText(StsTxt);
214       if(ListCtrl is TORListBox) then
215       begin
216         ListGeneric((ListCtrl as TORListBox).Items, ARpc, ACase, AInvert, ADatePiece, ADateFormat, AParam1, ADetail, AID);
217         if((ListCtrl as TORListBox).Items.Count = 0) then
218           (ListCtrl as TORListBox).Items.Add(NoDataText(Reminders));
219       end
220       else
221       begin
222         ListGeneric(ListCtrl as TStrings, ARpc, ACase, AInvert, ADatePiece, ADateFormat, AParam1, ADetail, AID);
223         if((ListCtrl as TStrings).Count = 0) then
224           (ListCtrl as TStrings).Add(NoDataText(Reminders));
225       end;
226       StatusText('');
227     end;*)
228   
229     procedure WaitList(ListCtrl: TORListBox);
230     begin
231       ListCtrl.Clear;
232       Inc(WaitCount);
233       ListCtrl.Items.Add('0^Retrieving in background...');
234       ListCtrl.Repaint;
235     end;
236   
237   begin
238     inherited DisplayPage;
239     iRem := -1;
240     frmFrame.mnuFilePrintSetup.Enabled := True;
241     if InitPage then
242       uIPAddress := DottedIPStr;
243     if InitPatient then
244       begin
245         WaitCount := 0;
246         if InteractiveRemindersActive then
247         begin
248           if(InitialRemindersLoaded) then
249           begin
250             DontDo := RemID+';';
251             NotifyWhenRemindersChange(RemindersChange);
252           end
253           else
254           begin
255             DontDo := '';
256             RemoveNotifyRemindersChange(RemindersChange);
257           end;
258         end;
259         ForeGround := StartCoverSheet(uIPAddress, frmFrame.Handle,
260                       DontDo, InteractiveRemindersActive);
261         uCoverSheetList := TStringList.Create;
262         LoadCoverSheetList(uCoverSheetList);
263         for i := 0 to uCoverSheetList.Count - 1 do
264           begin
265             x := uCoverSheetList[i];
266             aName := Piece(x,'^',2);
267             aRPC := Piece(x,'^',6);
268             aCase := Piece(x,'^',7);
269             aInvert := Piece(x,'^',8);
270             aDatePiece := Piece(x,'^',11);
271             aDateFormat := Piece(x,'^',10);
272             aTextColor := Piece(x,'^',9);
273             aStatus := 'Searching for ' + Piece(x,'^',2) + '...';
274             aParam1 := Piece(x,'^',12);
275             aID := Piece(x,'^',1);         //TAG_PROB, TAG_RMND, ETC.
276             aQualifier := Piece(x,'^',13);
277             aTabPos := Piece(x,'^',14);
278             aPiece := Piece(x,'^',15);
279             aDetail := Piece(x,'^',16);
280             aIFN := Piece(x,'^',17);
281             bCase := FALSE;
282             bInvert := FALSE;
283             iDatePiece := 0;
284             if aCase = '1' then bCase := TRUE;
285             if aInvert = '1' then bInvert := TRUE;
286             if Length(aDatePiece) > 0 then iDatePiece := StrToInt(aDatePiece);
287             if Length(aTextColor) > 0 then aTextColor := 'cl' + aTextColor;
288             // Assign properties to components
289             FCoverList.CVlbl(i).Caption := aName;
290             FCoverList.CVlst(i).Caption := aName;
291             if Length(aTabPos) > 0 then FCoverList.CVlst(i).TabPositions := aTabPos;
292             if Length(aTextColor) > 0 then FCoverList.CVlst(i).Font.Color :=
293                                               Get508CompliantColor(StringToColor(aTextColor));
294             if Length(aPiece) > 0 then FCoverList.CVlst(i).Pieces := aPiece;
295             FCoverList.CVlst(i).Tag := StrToInt(aID);
296             if(aID <> RemID) then
297             begin
298               if((aID = '20') or (Pos(aID + ';', ForeGround) > 0)) then
299                 LoadList(aStatus, FCoverList.CVlst(i), aRpc, bCase, bInvert, iDatePiece, aDateFormat, aParam1, aID, aDetail)
300               else
301                 Waitlist(FCoverList.CVlst(i));
302               if (aID = '20') and ARTPatchInstalled then with FCoverList.CVlst(i) do
303                 begin
304                   uARTCoverSheetParams := x;
305                   PopupMenu := popMenuAllergies;
306                   RightClickSelect := True;
307                   popMenuAllergies.PopupComponent := FCoverList.CVlst(i);
308                 end;
309             end;
310             FCoverList.CVpln(i).Visible := true;
311             if aID = RemID then
312               begin
313                 FCoverList.CVlst(i).OnContextPopup := RemContextPopup;
314                 FCoverList.CVlst(i).RightClickSelect := True;
315                 iRem := FCoverList.CVlst(i).ComponentIndex;
316                 if InteractiveRemindersActive then
317                   begin
318                     if(InitialRemindersLoaded) then
319                       CoverSheetRemindersInBackground := FALSE
320                     else
321                       begin
322                         InitialRemindersLoaded := TRUE;
323                         CoverSheetRemindersInBackground := (Pos(aID + ';', ForeGround) = 0);
324                         if(not CoverSheetRemindersInBackground) then
325                           begin
326                             //InitialRemindersLoaded := TRUE;
327                             RemSL := TStringList.Create;
328                             try
329                               LoadList(aStatus, RemSL, aRpc, bCase, bInvert, iDatePiece, aDateFormat, aParam1, aID, aDetail);
330                               RemindersEvaluated(RemSL);
331                             finally;
332                               RemSL.Free;
333                             end;
334                             NotifyWhenRemindersChange(RemindersChange);
335                           end
336                         else
337                             Waitlist(FCoverList.CVlst(i));
338                       end;
339                   end
340                 else
341                   if Pos(aID + ';', ForeGround) > 0 then
342                       LoadList(aStatus, FCoverList.CVlst(i), aRpc, bCase, bInvert, iDatePiece, aDateFormat, aParam1, aID, aDetail, TRUE)
343                   else
344                       Waitlist(FCoverList.CVlst(i));
345                 if WaitCount > 0 then
346                   begin
347                     FLoadingForDFN := Patient.DFN;
348                     timPoll.Enabled := True;
349                   end
350                 else FLoadingForDFN := '';  //*DFN*
351                 if InteractiveRemindersActive then
352                   begin
353                     RemindersStarted := TRUE;
354                     LoadReminderData(CoverSheetRemindersInBackground);
355                   end;
356               end;
357             if WaitCount > 0 then
358               begin
359                 FLoadingForDFN := Patient.DFN;
360                 timPoll.Enabled := True;
361               end
362             else FLoadingForDFN := '';  //*DFN*
363           end;
364         FocusFirstControl;
365         spt_2.Left := pnl_Not3.Left + pnl_Not3.Width;
366         spt_5.Left := pnl_Not8.Left + pnl_Not8.Width;
367         GetPatientFlag;
368       end;
369     if InitPage then
370       begin
371         popReminders := TORPopupMenu.Create(Self);
372         if InteractiveRemindersActive then
373           begin
374             SetReminderPopupCoverRoutine(popReminders);
375             if iRem > -1 then
376               (frmCover.Components[iRem] as TORListBox).PopupMenu := popReminders;
377           end
378         else
379           begin
380             if iRem > -1 then
381               begin
382                 (frmCover.Components[iRem] as TORListBox).RightClickSelect := FALSE;
383                 (frmCover.Components[iRem] as TORListBox).OnMouseUp := nil;
384               end;
385           end;
386       end;
387   end;