Procedure

TfrmODLab.DetermineCollectionDefaults

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Comments

I: integer;

Visibility

Public

Owner

TfrmODLab

Declaration

procedure DetermineCollectionDefaults(Responses: TResponses);

Calls Hierarchy


TfrmODLab.DetermineCollectionDefaults
 ├TResponses.FindResponseByName
 ├TLabTest.LabCanCollect
 │ └TLabTest.IndexOfCollSamp
 ├TfrmODLab.SetupCollTimes
 │ ├GetLastCollectionTime
 │ ├TfrmODLab.ValidCollTime
 │ │ └StrToFMDateTime
 │ ├StrToFMDateTime
 │ ├TCtrlInits.SetControl
 │ │ ├ClearControl
 │ │ └TCtrlInits.FindInitByName
 │ ├MakeRelativeDateTime
 │ │ └FMToday
 │ │   └FMNow
 │ └GetDefaultImmCollTime
 ├TCtrlInits.SetControl...
 ├StrToFMDateTime
 └TfrmODLab.LoadCollType
   ├TCtrlInits.SetControl...
   ├TLabTest.LabCanCollect...
   ├TfrmODBase.OrderForInpatient
   │ ├OrderEventTypeOnCreate
   │ └IsPassEvt1
   └TfrmODLab.SetupCollTimes...

Called-By Hierarchy


TfrmODLab.DetermineCollectionDefaults
              TfrmODLab.SetupDialog┤ 
       TfrmODLab.cboAvailTestSelect┘ 
            TfrmODLab.SetupDialog┤   
       TfrmODLab.cboAvailTestExit┘   

Calls

Name Declaration Comments
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TLabTest.LabCanCollect function LabCanCollect: Boolean; -
TfrmODLab.LoadCollType procedure LoadCollType(AComboBox:TORComboBox); -
TCtrlInits.SetControl procedure SetControl(AControl: TControl; const ASection: string); -
TfrmODLab.SetupCollTimes procedure SetupCollTimes(CollType: string); -
StrToFMDateTime function StrToFMDateTime(const AString: string): TFMDateTime; -

Called-By

Name Declaration Comments
TfrmODLab.cboAvailTestSelect procedure cboAvailTestSelect(Sender: TObject); -
TfrmODLab.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -


Source

2001  procedure TfrmODLab.DetermineCollectionDefaults(Responses: TResponses);
2002  var
2003    RespCollect, RespStart: TResponse;
2004    //i: integer;
2005  begin
2006    if ALabTest = nil then exit;
2007    calCollTime.Clear;
2008    cboCollTime.Clear;
2009    calCollTime.Enabled := True;
2010    lblCollTime.Enabled := True;
2011    cboColltime.Enabled := True;
2012    with Responses, ALabTest do
2013      begin
2014        RespCollect := FindResponseByName('COLLECT',1);
2015        RespStart   := FindResponseByName('START'  ,1);
2016        if (RespCollect <> nil) then with RespCollect do
2017          begin
2018            if IValue = 'LC' then
2019              begin
2020                if not LabCanCollect then
2021                  begin
2022                   cboCollType.SelectByID('WC');
2023                   SetupCollTimes('WC');
2024                  end
2025                else   //  if LabCanCollect
2026                  begin
2027                   cboCollType.SelectByID('LC');
2028                   SetupCollTimes('LC');
2029                   CtrlInits.SetControl(cboCollTime, 'Lab Collection Times') ;
2030                   if RespStart <> nil then
2031                     begin
2032                       cboCollTime.SelectByID('L' + RespStart.IValue);
2033                       if cboCollTime.ItemIndex < 0 then
2034                         cboCollTime.Text := RespStart.IValue;
2035                     end;
2036                  end;
2037              end
2038            else    //  if IValue <> 'LC'
2039              begin
2040                cboCollType.SelectByID(IValue) ;
2041                SetupCollTimes(IValue);
2042                if RespStart <> nil then
2043                  begin
2044                    if ContainsAlpha(RespStart.IValue) then
2045                      calColltime.Text := RespStart.IValue
2046                    else
2047                      calColltime.FMDateTime := StrToFMDateTime(RespStart.IValue);
2048                  end;
2049              end ;
2050            if IValue = 'I' then
2051              if not LabCanCollect then
2052                begin
2053                 cboCollType.SelectByID('WC');
2054                 SetupCollTimes('WC');
2055                end
2056              else
2057                begin
2058                  calCollTime.Enabled := False;
2059                  if RespStart <> nil then txtImmedColl.Text := RespStart.EValue;
2060                end;
2061          end
2062        else   // if (RespCollect = nil)
2063          LoadCollType(cbocollType);
2064      end;
2065  end;