Procedure

TfrmMeds.RefreshMedLists

Module

fMeds

Last Modified

7/15/2014 3:26:38 PM

Comments

Listbox events ---------------------------------------------------------------------------

Visibility

Public

Owner

TfrmMeds

Declaration

procedure RefreshMedLists;

Calls Hierarchy


TfrmMeds.RefreshMedLists
 ├TfrmFrame.GetTimedOut
 │ └TimedOut
 ├LoadActiveMedLists
 │ ├ClearMedList
 │ └SetMedFields
 ├TfrmMeds.SetViewCaption
 └TfrmMeds.GetPlainText
   ├TfrmMeds.GetMedList
   ├TfrmMeds.GetHeader
   └TfrmMeds.GetListText
     ├TfrmMeds.GetActionText
     └TfrmMeds.GetInstructText

Called-By Hierarchy


                                                TfrmMeds.RefreshMedLists
                                                  TfrmMeds.DisplayPage┤ 
                                                  TfrmMeds.NotifyOrder┤ 
                                                TfrmFrame.UMNewOrder┘ │ 
                                                  TfrmMeds.SetFontSize┤ 
                                                TfrmFrame.ChangeFont┘ │ 
                                        TfrmFrame.LoadSizesForUser┤   │ 
                                   TfrmFrame.LoadUserPreferences┘ │   │ 
                                          TfrmFrame.UMInitiate┘   │   │ 
                                        TfrmFrame.mnuFontSizeClick┘   │ 
                               TfrmMeds.SortbyStatusthenLocation1Click┤ 
                TfrmMeds.SortbyClinicOrderthenStatusthenStopDate1Click┤ 
TfrmMeds.SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click┤ 
                                           TfrmOptionsOther.btnOKClick┘ 

Calls

Name Declaration Comments
TfrmMeds.GetPlainText function GetPlainText(Control: TWinControl; Index: integer): string; -
TfrmFrame.GetTimedOut function GetTimedOut: boolean; -
LoadActiveMedLists procedure LoadActiveMedLists(InPtMeds, OutPtMeds, NonVAMeds: TList; var view: integer; var DateRange: string); -
TfrmMeds.SetViewCaption procedure SetViewCaption(Caption : String); -

Called-By

Name Declaration Comments
TfrmOptionsOther.btnOKClick procedure btnOKClick(Sender: TObject); -
TfrmMeds.DisplayPage procedure DisplayPage; override; -
TfrmMeds.NotifyOrder procedure NotifyOrder(OrderAction: Integer; AnOrder: TOrder); override; -
TfrmMeds.SetFontSize procedure SetFontSize( FontSize: integer); override; -
TfrmMeds.SortbyClinicOrderthenStatusthenStopDate1Click procedure SortbyClinicOrderthenStatusthenStopDate1Click( Sender: TObject); -
TfrmMeds.SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click procedure SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click( Sender: TObject); -
TfrmMeds.SortbyStatusthenLocation1Click procedure SortbyStatusthenLocation1Click(Sender: TObject); -


Source

733   procedure TfrmMeds.RefreshMedLists;
734   var
735     i, view: Integer;
736     AMed: TMedListRec;
737     DateRange: string;
738   begin
739     if frmFrame.TimedOut then Exit;  
740     lstMedsIn.Clear;
741     lstMedsOut.Clear;
742     lstMedsNonVA.Clear;
743     DateRange := '';
744     StatusText('Retrieving active medications...');
745     view := self.FSortView;
746     //AGP Fix for CQ 10410 added view arguement to control Meds Tab sort criteria
747     LoadActiveMedLists(uMedListIn, uMedListOut, uMedListNonVA, view, DateRange);
748         self.FSortView := view;
749         if view = 1 then
750           begin
751             self.SortbyStatusthenLocation1.Checked := True;
752             SetViewCaption(SortbyStatusthenLocation1.Caption + ' ' + DateRange);
753             self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False;
754             self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.checked := false;
755           end
756         else if view = 2 then
757           begin
758             self.SortbyStatusthenLocation1.Checked := False;
759             self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True;
760             SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption + ' ' + DateRange);
761             self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false;
762           end
763         else if view = 3 then
764           begin
765             self.SortbyStatusthenLocation1.Checked := False;
766             self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false;
767             self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true;
768             SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption + ' ' + DateRange);
769           end;
770     uPharmacyOrdersIn.Clear;
771     uPharmacyOrdersOut.Clear;
772     uNonVAOrdersOut.Clear;
773     with uMedListIn do for i := 0 to Count - 1 do
774     begin
775       AMed := TMedListRec(Items[i]);
776       uPharmacyOrdersIn.Add(AMed.PharmID + U + AMed.OrderID);
777       lstMedsIn.Items.AddObject(GetPlainText(lstMedsIn, i), AMed);
778     end;
779   
780     with uMedListNonVA do for i := 0 to Count - 1 do
781     begin
782        AMed := TMedListRec(Items[i]);
783        uNonVAOrdersOut.Add(AMed.PharmID + U + AMed.OrderID);
784        lstMedsNonVA.Items.AddObject(GetPlainText(lstMedsNonVA, i), AMed);
785     end;
786   
787     with uMedListOut do for i := 0 to Count - 1 do
788     begin
789       AMed := TMedListRec(Items[i]);
790       uPharmacyOrdersOut.Add(AMed.PharmID + U + AMed.OrderID);
791       lstMedsOut.Items.AddObject(GetPlainText(lstMedsOut, i), AMed);
792     end;
793   
794           StatusText('');
795   end;