Function

SelectMedicineResult

Module

fConsMedRslt

Last Modified

7/15/2014 3:26:34 PM

Comments

Displays Medicine Result selection form and returns a record of the selection

Scope

Interfaced

Declaration

function SelectMedicineResult(ConsultIEN: integer; FormTitle: string; var MedResult: TMedResultRec): boolean ;

Calls Hierarchy


SelectMedicineResult
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 ├GetAssignableMedResults
 └GetRemovableMedResults

Called-By Hierarchy


                 SelectMedicineResult
     TfrmConsults.ProcessMedResults┘ 
TfrmConsults.mnuActAttachMedClick┤   
TfrmConsults.mnuActRemoveMedClick┘   

Calls

Name Declaration Comments
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
GetAssignableMedResults function GetAssignableMedResults(ConsultIEN: integer): TStrings; -
GetRemovableMedResults function GetRemovableMedResults(ConsultIEN: integer): TStrings; -

Called-By

Name Declaration Comments
TfrmConsults.ProcessMedResults procedure ProcessMedResults(ActionType: string); -


Source

66    function SelectMedicineResult(ConsultIEN: integer; FormTitle: string; var MedResult: TMedResultRec): boolean ;
67    { displays Medicine Result selection form and returns a record of the selection }
68    var
69      frmConsMedRslt: TfrmConsMedRslt;
70    begin
71      frmConsMedRslt := TfrmConsMedRslt.Create(Application);
72      try
73        with frmConsMedRslt do
74        begin
75          FChanged := False;
76          FillChar(RecipientList, SizeOf(RecipientList), 0);
77          FillChar(FMedResult, SizeOf(FMedResult), 0);
78          Caption := FormTitle;
79          cboPerson.InitLongList(User.Name);
80          cboPerson.SelectByIEN(User.DUZ);
81          ResizeFormToFont(TForm(frmConsMedRslt));
82    
83          if MedResult.Action = 'ATTACH' then
84            begin
85              FastAssign(GetAssignableMedResults(ConsultIEN), lstMedResults.Items);
86              ckAlert.Visible := True;
87            end
88          else if MedResult.Action = 'REMOVE' then
89            begin
90              FastAssign(GetRemovableMedResults(ConsultIEN), lstMedResults.Items);
91              ckAlert.Visible := False;
92            end;
93          if lstMedResults.Items.Count > 0 then
94            ShowModal
95          else
96            FChanged := True;
97          Result := FChanged;
98          MedResult := FMedResult;
99        end; {with frmODConsMedRslt}
100     finally
101       frmConsMedRslt.Release;
102     end;
103   end;