Procedure

TfrmODLab.cboCollTimeExit

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODLab

Declaration

procedure cboCollTimeExit(Sender: TObject);

Calls Hierarchy


TfrmODLab.cboCollTimeExit
 ├TLabTest.LabCanCollect
 │ └TLabTest.IndexOfCollSamp
 ├StrToFMDateTime
 ├IsLabCollectTime
 ├GetFutureLabTime
 │ └TfrmBase508Form.Create
 │   ├TfrmBase508Form.UpdateAccessibilityActions
 │   ├UnfocusableControlEnter
 │   └AdjustControls
 │     ├TfrmBase508Form.ModifyUnfocusableControl
 │     └..(rec)..
 ├TfrmODBase.OrderForInpatient
 │ ├OrderEventTypeOnCreate
 │ └IsPassEvt1
 └TfrmODLab.ControlChange
   ├TResponses.FindResponseByName
   ├TResponses.Clear
   ├TResponses.Update
   │ ├TResponses.FindResponseByName
   │ └TResponses.IENForPrompt
   ├TLabTest.NameOfCollSamp
   │ └TLabTest.IndexOfCollSamp
   ├TLabTest.NameOfSpecimen
   │ └TLabTest.IndexOfCollSamp
   ├TLabTest.NameOfUrgency
   ├TfrmODLab.ValidCollTime
   │ └StrToFMDateTime
   └TResponses.GetOrderText
     ├TResponses.NextInstance
     ├TResponses.FindResponseByName
     ├TResponses.FormatResponse
     │ └TResponses.FindResponseByIEN
     └TResponses.AppendChildren
       ├TResponses.FindPromptByIEN
       ├TResponses.FindResponseByIEN
       └TResponses.FormatResponse...

Calls

Name Declaration Comments
TfrmODLab.ControlChange procedure ControlChange(Sender: TObject); -
GetFutureLabTime function GetFutureLabTime(ACollDate: TFMDateTime): string; -
IsLabCollectTime function IsLabCollectTime(ADateTime: TFMDateTime; Location: integer): boolean; -
TLabTest.LabCanCollect function LabCanCollect: Boolean; -
TfrmODBase.OrderForInpatient function OrderForInpatient: Boolean; -
StrToFMDateTime function StrToFMDateTime(const AString: string): TFMDateTime; -


Source

1848  procedure TfrmODLab.cboCollTimeExit(Sender: TObject);
1849  var
1850    ADateTime: TFMDateTime;
1851    CollType: string;
1852    isTrue: boolean;
1853  const
1854    TX_BAD_TIME         = ' is not a routine lab collection time.' ;
1855    TX_BAD_TIME_CAP     = 'Invalid Time';
1856  begin
1857    inherited;
1858    if (ALabTest = nil) or (cboColltime.Text = '') then Exit;
1859    Changing := True;
1860    CollType := 'LC';
1861    with cboCollTime do if (ItemIndex < 0) or (ITEMID = 'LO') then
1862      if ALabTest.LabCanCollect then
1863        begin
1864          ADateTime := StrToFMDateTime(cboCollTime.Text);
1865          if EvtDelayLoc > 0 then
1866            isTrue := IsLabCollectTime(ADateTime, EvtDelayLoc)
1867          else
1868            isTrue := IsLabCollectTime(ADateTime, Encounter.Location);
1869          if isTrue then
1870            begin
1871              calCollTime.Clear;
1872              cboCollTime.Visible := True;
1873              calCollTime.Visible := False;
1874              calCollTime.Enabled := False;
1875            end {if IsLabCollectTime}
1876          else
1877            begin
1878              InfoBox(cboCollTime.Text + TX_BAD_TIME, TX_BAD_TIME_CAP, MB_OK or MB_ICONWARNING) ;
1879              ItemIndex := -1;
1880              Text := GetFutureLabTime(ADateTime);
1881            end ;
1882        end {if (LabCanCollect...}
1883      else
1884       begin
1885         if OrderForInpatient then CollType := 'WC' else CollType := 'SP';
1886         calCollTime.Text := cboCollTime.Text;
1887         cboCollTime.Clear;
1888         cboCollTime.Visible := False;
1889         calCollTime.Visible := True;
1890         calCollTime.Enabled := True;
1891       end;
1892    cboCollType.SelectByID(CollType);
1893    Changing := False;                                           //v16.3  RV
1894    ControlChange(Self);                                         //v16.3  RV
1895    //Responses.Update('COLLECT', 1, CollType, CollType) ;       //v16.3  RV
1896    //memOrder.Text := Responses.OrderText;                      //v16.3  RV
1897  end;