Procedure

TfrmODMedOut.SetupDialog

Directives

Override

Module

fODMedOut

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public

Overrides

TfrmODBase.SetupDialog

Owner

TfrmODMedOut

Declaration

procedure SetupDialog(OrderAction: Integer; const ID: string); override;

Calls Hierarchy


TfrmODMedOut.SetupDialog
 ├TResponses.Remove
 │ └TResponses.FindResponseByName
 ├TResponses.SetControl
 │ ├TResponses.FindResponseByName
 │ └AssignBPText
 │   ├DisplayGroupToLinkType
 │   │ └DisplayGroupByName
 │   ├TResponses.EValueFor
 │   ├GetServiceIEN
 │   ├TResponses.IValueFor
 │   ├GetProcedureIEN
 │   ├ExpandOrderObjects
 │   │ ├TdmodShared.BoilerplateOK
 │   │ │ ├ErrCount
 │   │ │ ├AddErr
 │   │ │ └TdmodShared.LoadTIUObjects
 │   │ │   └GetObjectList
 │   │ └GetTemplateText
 │   │   └TEncounter.GetVisitStr
 │   │     └TEncounter.GetVisitCategory
 │   ├SetTemplateDialogCanceled
 │   ├CheckBoilerplate4Fields
 │   ├ExecuteTemplateOrBoilerPlate
 │   └WasTemplateDialogCanceled
 ├TfrmODMedOut.ResetOnMedChange
 │ ├ClearControl
 │ └ResetControl
 ├TfrmODMedOut.SetOnOISelect
 │ ├TCtrlInits.LoadOrderItem
 │ │ ├TCtrlInits.ClearOI
 │ │ └TCtrlInits.ExtractInits
 │ │   └TCtrlInit.Create
 │ ├OIForMedOut
 │ ├TCtrlInits.SetControl
 │ │ ├ClearControl
 │ │ └TCtrlInits.FindInitByName
 │ ├TCtrlInits.DefaultText
 │ │ └TCtrlInits.FindInitByName
 │ ├TfrmODMedOut.SetupNouns
 │ │ ├TCtrlInits.SetPopupMenu
 │ │ │ └TCtrlInits.FindInitByName
 │ │ └TfrmODMedOut.UnitClick
 │ ├TfrmODBase.OrderMessage
 │ │ └TfrmODBase.ShowOrderMessage
 │ └TCtrlInits.TextOf
 │   └TCtrlInits.FindInitByName
 ├TfrmODMedOut.SetAltCombo
 │ └TCtrlInits.SetListOnly
 │   └TCtrlInits.FindInitByName
 ├TfrmODMedOut.SetInstructions
 │ ├TResponses.InstanceCount
 │ ├TResponses.EValueFor
 │ ├TResponses.SetControl...
 │ ├TfrmODMedOut.SetSimple
 │ ├TResponses.NextInstance
 │ ├TResponses.IValueFor
 │ ├TfrmODMedOut.SetComplex
 │ └TResponses.GetOrderText
 │   ├TResponses.NextInstance
 │   ├TResponses.FindResponseByName
 │   ├TResponses.FormatResponse
 │   │ └TResponses.FindResponseByIEN
 │   └TResponses.AppendChildren
 │     ├TResponses.FindPromptByIEN
 │     ├TResponses.FindResponseByIEN
 │     └TResponses.FormatResponse...
 ├TextForOrder
 ├TfrmODBase.OrderMessage...
 ├OrderIsReleased
 └TfrmODMedOut.ControlChange
   ├TResponses.Update
   │ ├TResponses.FindResponseByName
   │ └TResponses.IENForPrompt
   └TResponses.GetOrderText...

Calls

Name Declaration Comments
TfrmODMedOut.ControlChange procedure ControlChange(Sender: TObject); -
OrderIsReleased function OrderIsReleased(const ID: string): Boolean; -
TfrmODBase.OrderMessage procedure OrderMessage(const AMessage: string); -
TResponses.Remove procedure Remove(const APromptID: string; AnInstance: Integer); -
TfrmODMedOut.ResetOnMedChange procedure ResetOnMedChange; -
TfrmODMedOut.SetAltCombo procedure SetAltCombo; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODMedOut.SetInstructions procedure SetInstructions; -
TfrmODMedOut.SetOnOISelect procedure SetOnOISelect; -
TextForOrder function TextForOrder(const ID: string): string; -


Source

164   procedure TfrmODMedOut.SetupDialog(OrderAction: Integer; const ID: string);
165   var
166     AnInstr: string;
167   begin
168     inherited;
169     if OrderAction in [ORDER_COPY, ORDER_EDIT] then Responses.Remove('START', 1);
170     if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses do
171     begin
172       Changing := True;
173       SetControl(cboMedication, 'ORDERABLE', 1);
174       ResetOnMedChange;
175       SetOnOISelect;
176       SetAltCombo;
177       //cboMedicationSelect(Self);
178       SetControl(cboDispense,   'DRUG',      1);
179       SetInstructions;
180       SetControl(txtQuantity,   'QTY',       1);
181       SetControl(txtRefills,    'REFILLS',   1);
182       spnRefills.Position := StrToIntDef(txtRefills.Text, 0);
183       SetControl(cboPickup,     'PICKUP',    1);
184       SetControl(memComments,   'COMMENT',   1);
185       SetControl(cboPriority,   'URGENCY',   1);
186       { prevent the SIG from being part of the comments on pre-CPRS prescriptions }
187       if (OrderAction in [ORDER_COPY, ORDER_EDIT]) and (cboInstructions.Text = '') then
188       begin
189         AnInstr := TextForOrder(ID); //'SIG:  ' + memComments.Text;
190         OrderMessage(AnInstr);
191         lblSIG.Visible := True;
192         txtSIG.Visible := True;
193         txtSIG.Text := memComments.Text;
194         memComments.Clear;
195       end;
196       { can't edit the orderable item for a med order that has been released }
197       if (OrderAction = ORDER_EDIT) and OrderIsReleased(EditOrder)
198         then FMedCombo.Enabled := False;
199       Changing := False;
200       ControlChange(Self);
201     end;
202     if OrderAction <> ORDER_EDIT then SetFocusedControl(FMedCombo);
203   end;