Procedure

TfrmODRad.SetupDialog

Directives

Override

Module

fODRad

Last Modified

7/15/2014 3:26:42 PM

Comments

TfrmODBase common methods

Visibility

Public

Overrides

TfrmODBase.SetupDialog

Owner

TfrmODRad

Declaration

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

Calls Hierarchy


TfrmODRad.SetupDialog
 ├SubsetOfImagingTypes
 ├GetEventDiv1
 ├TCtrlInits.LoadDefaults
 │ └TCtrlInits.ExtractInits
 │   └TCtrlInit.Create
 ├ODForRad
 ├TfrmODRad.InitDialog
 │ ├ReasonForStudyCarryOn
 │ ├GetEventDiv1
 │ ├TCtrlInits.SetControl
 │ │ ├ClearControl
 │ │ └TCtrlInits.FindInitByName
 │ ├TfrmODBase.OrderForInpatient
 │ │ ├OrderEventTypeOnCreate
 │ │ └IsPassEvt1
 │ ├TfrmODRad.setup508Label
 │ ├PatientOnIsolationProcedures
 │ └TfrmODRad.ControlChange
 │   ├TResponses.Clear
 │   ├TResponses.Update
 │   │ ├TResponses.FindResponseByName
 │   │ └TResponses.IENForPrompt
 │   ├TEncounter.GetLocationName
 │   │ └TEncounter.UpdateText
 │   │   └GetEncounterText
 │   └TResponses.GetOrderText
 │     ├TResponses.NextInstance
 │     ├TResponses.FindResponseByName
 │     ├TResponses.FormatResponse
 │     │ └TResponses.FindResponseByIEN
 │     └TResponses.AppendChildren
 │       ├TResponses.FindPromptByIEN
 │       ├TResponses.FindResponseByIEN
 │       └TResponses.FormatResponse...
 ├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
 ├TfrmODRad.SetModifierList
 │ └TResponses.FindResponseByName
 ├TResponses.FindResponseByName
 ├StrToFMDateTime
 ├TfrmODBase.OrderMessage
 │ └TfrmODBase.ShowOrderMessage
 ├ImagingMessage
 └TfrmODRad.ControlChange...

Calls

Name Declaration Comments
TfrmODRad.ControlChange procedure ControlChange(Sender: TObject); -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
GetEventDiv1 function GetEventDiv1(const AnEvntID: string): string; -
ImagingMessage function ImagingMessage(AnIEN: Integer): string; -
TfrmODRad.InitDialog procedure InitDialog; override; -
TCtrlInits.LoadDefaults procedure LoadDefaults(Src: TStrings); -
ODForRad function ODForRad(const PatientDFN, AnEventDiv: string; ImagingType: integer): TStrings; -
TfrmODBase.OrderMessage procedure OrderMessage(const AMessage: string); -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODRad.SetModifierList procedure SetModifierList; -
StrToFMDateTime function StrToFMDateTime(const AString: string): TFMDateTime; -
SubsetOfImagingTypes function SubsetOfImagingTypes: TStrings; -


Source

135   procedure TfrmODRad.SetupDialog(OrderAction: Integer; const ID: string);
136   var
137     tmpResp: TResponse;
138     i: integer;
139   begin
140     inherited;
141     if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses do
142     begin
143       if (OrderAction = ORDER_QUICK) or (OrderAction = ORDER_EDIT) or (OrderAction = ORDER_COPY) then
144         FPredefineOrder := True;
145       FEditCopy := True;
146       Changing := True;
147       with cboImType do
148         begin
149           FastAssign(SubsetOfImagingTypes, cboImType.Items);
150           for i := 0 to Items.Count-1 do
151             if StrToIntDef(Piece(Items[i],U,4), 0) = DisplayGroup then ItemIndex := i;
152           if OrderAction = ORDER_EDIT then
153           begin
154             Enabled := False;
155             Color := clBtnFace;
156           end;
157        end;
158       if Self.EvtID>0 then
159         FEvtDelayDiv := GetEventDiv1(IntToStr(Self.EvtID));
160       CtrlInits.LoadDefaults(ODForRad(Patient.DFN, FEvtDelayDiv, DisplayGroup));   // ODForRad returns TStrings with defaults
161       InitDialog;
162       SetControl(cboProcedure,       'ORDERABLE', 1);
163       Changing := True;
164       SetModifierList;
165       SetControl(cboUrgency,         'URGENCY', 1);
166       SetControl(cboTransport,       'MODE', 1);
167       SetControl(cboSubmit,          'IMLOC', 1);
168       SetControl(cboCategory,        'CLASS', 1);
169       SetControl(txtReason,           'REASON', 1);
170       SetControl(memHistory,         'COMMENT', 1);
171       SetControl(chkIsolation,       'YN', 1);
172       SetControl(radPregnant,        'PREGNANT', 1);
173       SetControl(calPreOp,           'PREOP', 1);
174       tmpResp := FindResponseByName('START',1);
175       if tmpResp <> nil then
176         begin
177           if ContainsAlpha(tmpResp.IValue) then
178             calRequestDate.Text := tmpResp.IValue
179           else
180             calRequestDate.FMDateTime := StrToFMDateTime(tmpResp.IValue);
181         end;
182       tmpResp := FindResponseByName('PROVIDER',1);
183       if tmpResp <> nil then with tmpResp do if Length(EValue)>0 then Radiologist := IValue + '^' + EValue;
184       if (cboCategory.ItemID = 'C') or (cboCategory.ItemID = 'S') then
185         begin
186           tmpResp := FindResponseByName('CONTRACT',1);
187           if tmpResp <> nil then with tmpResp do
188            if Length(EValue)>0 then
189             begin
190               Contract := IValue + '^' + EValue;
191               Research := '';
192             end;
193         end;
194       if cboCategory.ItemID = 'R' then
195         begin
196           tmpResp := FindResponseByName('RESEARCH',1);
197           if tmpResp <> nil then with tmpResp do
198            if Length(EValue)>0 then
199             begin
200               Research := EValue;
201               Contract := '';
202             end;
203         end;
204       //hds00007460
205       tmpResp := FindResponseByName('PREGNANT',1);
206       if tmpResp <> nil then
207          if Length(tmpResp.EValue)>0 then
208          begin
209             IsPregnant := tmpResp.EValue;
210             if IsPregnant = 'YES' then
211                radPregnant.Checked := True
212             else
213             if IsPregnant = 'NO' then
214                radPregnantNo.Checked := True
215             else
216             if IsPregnant = 'UNKNOWN' then
217                radPregnantUnknown.Checked := True;
218          end;
219       //hds00007460
220       Changing := False;
221       FEditCopy := False;
222       OrderMessage(ImagingMessage(cboProcedure.ItemIEN)) ;
223       ControlChange(Self);
224       FPredefineOrder := False;
225     end;
226   end;