Procedure

TfrmODLab.SetupDialog

Directives

Override

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public

Overrides

TfrmODBase.SetupDialog

Owner

TfrmODLab

Declaration

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

Calls Hierarchy


TfrmODLab.SetupDialog
 ├TfrmODLab.ReadServerVariables
 │ └TfrmODBase.GetKeyVariable
 ├TfrmODLab.SetupCollTimes
 │ ├GetLastCollectionTime
 │ ├TfrmODLab.ValidCollTime
 │ │ └StrToFMDateTime
 │ ├StrToFMDateTime
 │ ├TCtrlInits.SetControl
 │ │ ├ClearControl
 │ │ └TCtrlInits.FindInitByName
 │ ├MakeRelativeDateTime
 │ │ └FMToday
 │ │   └FMNow
 │ └GetDefaultImmCollTime
 ├TfrmODLab.cboFrequencyChange
 │ ├TfrmODLab.setup508Label
 │ └TfrmODLab.ControlChange
 │   ├TResponses.FindResponseByName
 │   ├TResponses.Clear
 │   ├TResponses.Update
 │   │ ├TResponses.FindResponseByName
 │   │ └TResponses.IENForPrompt
 │   ├TLabTest.NameOfCollSamp
 │   │ └TLabTest.IndexOfCollSamp
 │   ├TLabTest.NameOfSpecimen
 │   │ └TLabTest.IndexOfCollSamp
 │   ├TLabTest.NameOfUrgency
 │   ├TfrmODLab.ValidCollTime...
 │   └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
 ├TfrmODLab.cboAvailTestSelect
 │ ├TResponses.Clear
 │ ├TResponses.SetQuickOrder
 │ │ ├TResponses.Clear
 │ │ └LoadResponses
 │ │   └ExtractToResponses
 │ │     └ExpandOrderObjects...
 │ ├TResponses.SetControl...
 │ ├TLabTest.Create
 │ │ ├LoadLabTestData
 │ │ ├GetOneSpecimen
 │ │ ├TLabTest.FillCollSampList
 │ │ ├TResponses.FindResponseByName
 │ │ ├TLabTest.IndexOfCollSamp
 │ │ ├GetOneCollSamp
 │ │ ├TLabTest.LoadAllSamples
 │ │ │ ├LoadSamples
 │ │ │ └TLabTest.FillCollSampList
 │ │ └TLabTest.SetCollSampDflts
 │ │   ├TResponses.FindResponseByName
 │ │   ├TLabTest.ChangeSpecimen
 │ │   └TLabTest.IndexOfCollSamp
 │ ├TLabTest.LoadCollSamp
 │ ├TfrmODLab.cboCollSampChange
 │ │ ├TLabTest.ChangeCollSamp
 │ │ │ └TLabTest.SetCollSampDflts...
 │ │ ├TLabTest.LoadSpecimen
 │ │ │ ├TLabTest.ObtainSpecimen
 │ │ │ │ └TLabTest.IndexOfCollSamp
 │ │ │ ├LoadSpecimens
 │ │ │ ├TResponses.FindResponseByName
 │ │ │ ├TLabTest.IndexOfCollSamp
 │ │ │ ├GetOneSpecimen
 │ │ │ └TLabTest.ChangeSpecimen
 │ │ ├TfrmODLab.LoadCollType
 │ │ │ ├TCtrlInits.SetControl...
 │ │ │ ├TLabTest.LabCanCollect
 │ │ │ │ └TLabTest.IndexOfCollSamp
 │ │ │ ├TfrmODBase.OrderForInpatient
 │ │ │ │ ├OrderEventTypeOnCreate
 │ │ │ │ └IsPassEvt1
 │ │ │ └TfrmODLab.SetupCollTimes...
 │ │ ├TLabTest.LoadUrgency
 │ │ │ └TLabTest.ObtainUrgency
 │ │ ├TLabTest.ObtainSpecimen...
 │ │ ├TfrmODLab.setup508Label
 │ │ ├TLabTest.ObtainComment
 │ │ ├TfrmODLab.LoadRequiredComment
 │ │ │ └TfrmODLab.DisableCommentPanels
 │ │ ├TfrmODLab.DisableCommentPanels
 │ │ ├TLabTest.IndexOfCollSamp
 │ │ ├TfrmODBase.OrderMessage
 │ │ │ └TfrmODBase.ShowOrderMessage
 │ │ └TfrmODLab.ControlChange...
 │ ├TLabTest.LoadSpecimen...
 │ ├TLabTest.LoadUrgency...
 │ ├TResponses.FindResponseByName
 │ ├TLabTest.LoadAllSamples...
 │ ├TfrmODLab.DetermineCollectionDefaults
 │ │ ├TResponses.FindResponseByName
 │ │ ├TLabTest.LabCanCollect...
 │ │ ├TfrmODLab.SetupCollTimes...
 │ │ ├TCtrlInits.SetControl...
 │ │ ├StrToFMDateTime
 │ │ └TfrmODLab.LoadCollType...
 │ ├TfrmODLab.cboFrequencyChange...
 │ ├TLabTest.ObtainCollSamp
 │ ├TfrmODLab.setup508Label
 │ ├TLabTest.IndexOfCollSamp
 │ ├TfrmODBase.OrderMessage...
 │ ├TLabTest.ObtainSpecimen...
 │ ├TLabTest.ObtainUrgency
 │ ├TLabTest.ObtainComment
 │ ├TfrmODLab.LoadRequiredComment...
 │ ├TfrmODLab.DisableCommentPanels
 │ └TfrmODLab.ControlChange...
 ├TResponses.FindResponseByName
 ├TLabTest.LoadAllSamples...
 ├TfrmODLab.cboCollSampChange...
 ├TfrmODLab.DetermineCollectionDefaults...
 ├TLabTest.LoadUrgency...
 └TfrmODLab.ControlChange...

Calls

Name Declaration Comments
TfrmODLab.cboAvailTestSelect procedure cboAvailTestSelect(Sender: TObject); -
TfrmODLab.cboCollSampChange procedure cboCollSampChange(Sender: TObject); -
TfrmODLab.cboFrequencyChange procedure cboFrequencyChange(Sender: TObject); -
TfrmODLab.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODLab.DetermineCollectionDefaults procedure DetermineCollectionDefaults(Responses: TResponses); -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TLabTest.LoadAllSamples procedure LoadAllSamples; -
TLabTest.LoadUrgency procedure LoadUrgency(CollType: string; AComboBox:TORComboBox); -
TfrmODLab.ReadServerVariables procedure ReadServerVariables; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODLab.SetupCollTimes procedure SetupCollTimes(CollType: string); -


Source

348   procedure TfrmODLab.SetupDialog(OrderAction: Integer; const ID: string);
349   var
350     tmpResp: TResponse;
351     i: integer;
352   begin
353     inherited;
354     ReadServerVariables;
355     if LRFZX <> '' then
356       begin
357         cboCollType.SelectByID(LRFZX);
358         if cboCollType.ItemIndex > -1 then SetupCollTimes(LRFZX);
359       end;
360     if (LRFSCH <> '') and (cboFrequency.Enabled) then
361       begin
362         cboFrequency.ItemIndex := cboFrequency.Items.IndexOf(LRFSCH);
363         cboFrequencyChange(Self);
364       end;
365     if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses, ALabTest do
366      begin
367         SetControl(cboAvailTest,       'ORDERABLE', 1);
368         cboAvailTestSelect(Self);
369         if ALabTest = nil then Exit;  // Causes access violation in FillCollSampleList
370         Changing := True;
371         SetControl(cboFrequency,       'SCHEDULE', 1);
372         SetControl(txtDays,            'DAYS', 1);
373         tmpResp := FindResponseByName('SAMPLE'  ,1);
374         if (tmpResp <> nil) and (tmpResp.IValue <> '') then with cboCollSamp do
375           begin
376             SelectByID(tmpResp.IValue);
377             if ItemIndex < 0 then
378               begin
379                 LoadAllSamples;
380                 Items.Insert(0, tmpResp.IValue + U + tmpResp.EValue);
381                 ItemIndex := 0  ;
382               end;
383           end;
384         cboCollSampChange(Self);
385         DetermineCollectionDefaults(Responses);
386         tmpResp := FindResponseByName('SPECIMEN'  ,1);
387         if (tmpResp <> nil) and (tmpResp.IValue <> '') then with cboSpecimen do
388           begin
389             SelectByID(tmpResp.IValue);
390             if ItemIndex < 0 then
391               begin
392                 if ALabTest <> nil then
393                   ALabTest.SpecimenList.Add(tmpResp.IValue + U + tmpResp.EValue);
394                 Items.Insert(0, tmpResp.IValue + U + tmpResp.EValue);
395                 ItemIndex := 0  ;
396               end;
397           end
398         else
399           if (LRFSPEC <> '') then cboSpecimen.SelectByID(LRFSPEC);
400         if ALabTest <> nil then Specimen := cboSpecimen.ItemIEN;
401         if ALabTest <> nil then AlabTest.LoadUrgency(cboCollType.ItemID, cboUrgency);
402         SetControl(cboUrgency,         'URGENCY', 1);
403         if cboUrgency.ItemIEN = 0 then
404           begin
405             if StrToIntDef(LRFURG, 0) > 0 then
406               cboUrgency.SelectByID(LRFURG)
407             else if (ALabTest <> nil) and (Urgency = 0) and (cboUrgency.Items.Count = 1) then
408               cboUrgency.ItemIndex := 0;
409           end;
410         if ALabTest <> nil then Urgency := cboUrgency.ItemIEN;
411         i := 1 ;
412         tmpResp := Responses.FindResponseByName('COMMENT',i);
413         while tmpResp <> nil do
414           begin
415             Comment.Add(tmpResp.EValue);
416             Inc(i);
417             tmpResp := Responses.FindResponseByName('COMMENT',i);
418           end ;
419         with cboFrequency do
420           if not Enabled then
421             begin
422               ItemIndex := Items.IndexOf('ONE TIME');
423               if ItemIndex = -1 then ItemIndex := Items.IndexOf('ONCE');
424             end;
425         cboFrequencyChange(Self);
426         Changing := False;
427         ControlChange(Self);
428      end;
429   end;