Procedure

TfrmODLab.cboAvailTestSelect

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODLab

Declaration

procedure cboAvailTestSelect(Sender: TObject);

Calls Hierarchy


TfrmODLab.cboAvailTestSelect
 ├TResponses.Clear
 ├TResponses.SetQuickOrder
 │ ├TResponses.Clear
 │ └LoadResponses
 │   └ExtractToResponses
 │     └ExpandOrderObjects
 │       ├TdmodShared.BoilerplateOK
 │       │ ├ErrCount
 │       │ ├AddErr
 │       │ └TdmodShared.LoadTIUObjects
 │       │   └GetObjectList
 │       └GetTemplateText
 │         └TEncounter.GetVisitStr
 │           └TEncounter.GetVisitCategory
 ├TResponses.SetControl
 │ ├TResponses.FindResponseByName
 │ └AssignBPText
 │   ├DisplayGroupToLinkType
 │   │ └DisplayGroupByName
 │   ├TResponses.EValueFor
 │   ├GetServiceIEN
 │   ├TResponses.IValueFor
 │   ├GetProcedureIEN
 │   ├ExpandOrderObjects...
 │   ├SetTemplateDialogCanceled
 │   ├CheckBoilerplate4Fields
 │   ├ExecuteTemplateOrBoilerPlate
 │   └WasTemplateDialogCanceled
 ├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
 │ │ │ ├ClearControl
 │ │ │ └TCtrlInits.FindInitByName
 │ │ ├TLabTest.LabCanCollect
 │ │ │ └TLabTest.IndexOfCollSamp
 │ │ ├TfrmODBase.OrderForInpatient
 │ │ │ ├OrderEventTypeOnCreate
 │ │ │ └IsPassEvt1
 │ │ └TfrmODLab.SetupCollTimes
 │ │   ├GetLastCollectionTime
 │ │   ├TfrmODLab.ValidCollTime
 │ │   │ └StrToFMDateTime
 │ │   ├StrToFMDateTime
 │ │   ├TCtrlInits.SetControl...
 │ │   ├MakeRelativeDateTime
 │ │   │ └FMToday
 │ │   │   └FMNow
 │ │   └GetDefaultImmCollTime
 │ ├TLabTest.LoadUrgency
 │ │ └TLabTest.ObtainUrgency
 │ ├TLabTest.ObtainSpecimen...
 │ ├TfrmODLab.setup508Label
 │ ├TLabTest.ObtainComment
 │ ├TfrmODLab.LoadRequiredComment
 │ │ └TfrmODLab.DisableCommentPanels
 │ ├TfrmODLab.DisableCommentPanels
 │ ├TLabTest.IndexOfCollSamp
 │ ├TfrmODBase.OrderMessage
 │ │ └TfrmODBase.ShowOrderMessage
 │ └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...
 ├TLabTest.LoadSpecimen...
 ├TLabTest.LoadUrgency...
 ├TResponses.FindResponseByName
 ├TLabTest.LoadAllSamples...
 ├TfrmODLab.DetermineCollectionDefaults
 │ ├TResponses.FindResponseByName
 │ ├TLabTest.LabCanCollect...
 │ ├TfrmODLab.SetupCollTimes...
 │ ├TCtrlInits.SetControl...
 │ ├StrToFMDateTime
 │ └TfrmODLab.LoadCollType...
 ├TfrmODLab.cboFrequencyChange
 │ ├TfrmODLab.setup508Label
 │ └TfrmODLab.ControlChange...
 ├TLabTest.ObtainCollSamp
 ├TfrmODLab.setup508Label
 ├TLabTest.IndexOfCollSamp
 ├TfrmODBase.OrderMessage...
 ├TLabTest.ObtainSpecimen...
 ├TLabTest.ObtainUrgency
 ├TLabTest.ObtainComment
 ├TfrmODLab.LoadRequiredComment...
 ├TfrmODLab.DisableCommentPanels
 └TfrmODLab.ControlChange...

Called-By Hierarchy


TfrmODLab.cboAvailTestSelect
     TfrmODLab.SetupDialog┤ 
TfrmODLab.cboAvailTestExit┘ 

Calls

Name Declaration Comments
TfrmODLab.cboCollSampChange procedure cboCollSampChange(Sender: TObject); -
TfrmODLab.cboFrequencyChange procedure cboFrequencyChange(Sender: TObject); -
TResponses.Clear procedure Clear; overload; -
TfrmODLab.ControlChange procedure ControlChange(Sender: TObject); -
TLabTest.Create constructor Create(const LabTestIEN: string; Responses: TResponses); -
TfrmODLab.DetermineCollectionDefaults procedure DetermineCollectionDefaults(Responses: TResponses); -
TfrmODLab.DisableCommentPanels procedure DisableCommentPanels; -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TLabTest.IndexOfCollSamp function IndexOfCollSamp(CollSampIEN: Integer): Integer; -
TLabTest.LoadAllSamples procedure LoadAllSamples; -
TLabTest.LoadCollSamp procedure LoadCollSamp(AComboBox: TORComboBox); -
TfrmODLab.LoadRequiredComment procedure LoadRequiredComment(CmtType: integer); -
TLabTest.LoadSpecimen procedure LoadSpecimen(AComboBox: TORComboBox); -
TLabTest.LoadUrgency procedure LoadUrgency(CollType: string; AComboBox:TORComboBox); -
TLabTest.ObtainCollSamp function ObtainCollSamp: Boolean; -
TLabTest.ObtainComment function ObtainComment: Boolean; -
TLabTest.ObtainSpecimen function ObtainSpecimen: Boolean; -
TLabTest.ObtainUrgency function ObtainUrgency: Boolean; -
TfrmODBase.OrderMessage procedure OrderMessage(const AMessage: string); -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TResponses.SetQuickOrder procedure SetQuickOrder(AnIEN: Integer); -
TfrmODLab.setup508Label procedure setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl; lbl2: string); -

Called-By

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


Source

1238  procedure TfrmODLab.cboAvailTestSelect(Sender: TObject);
1239  var
1240    x: string;
1241    i: integer;
1242    tmpResp: TResponse;
1243  begin
1244    with cboAvailTest do
1245      begin
1246        if (Length(ItemID) = 0) or (ItemID = '0') then Exit;
1247        FLastLabID := ItemID ;
1248        FLastItemID := ItemID;
1249        Changing := True;
1250        if Sender <> Self then
1251          Responses.Clear;       // Sender=Self when called from SetupDialog
1252        if CharAt(ItemID, 1) = 'Q' then
1253          with Responses do
1254            begin
1255              FLastItemID := ItemID;
1256              QuickOrder := ExtractInteger(ItemID);
1257              SetControl(cboAvailTest, 'ORDERABLE', 1);
1258              if (Length(ItemID) = 0) or (ItemID = '0') then Exit;
1259              FLastLabID := ItemID;
1260            end;
1261        ALabTest := TLabTest.Create(ItemID, Responses);
1262      end;
1263    with ALabTest do
1264    begin
1265      lblTestName.Caption := TestName;
1266      LoadCollSamp(cboCollSamp);
1267      cboCollSampChange(Self);
1268      LoadSpecimen(cboSpecimen);
1269      LoadUrgency(cboCollType.ItemID, cboUrgency);
1270      with Responses do if QuickOrder > 0 then
1271       begin
1272        StatusText('Initializing Quick Order');
1273        Changing := True;
1274        SetControl(cboAvailTest,       'ORDERABLE', 1);
1275        SetControl(cboFrequency,       'SCHEDULE', 1);
1276        SetControl(txtDays,            'DAYS', 1);
1277        tmpResp := FindResponseByName('SAMPLE'  ,1);
1278        if (tmpResp <> nil) and (tmpResp.IValue <> '') then with cboCollSamp do
1279          begin
1280            SelectByID(tmpResp.IValue);
1281            if ItemIndex < 0 then
1282              begin
1283                LoadAllSamples;
1284                Items.Insert(0, tmpResp.IValue + U + tmpResp.EValue);
1285                ItemIndex := 0  ;
1286              end;
1287          end
1288        else if LRFSAMP <> '' then
1289          cboCollSamp.SelectByID(LRFSAMP);
1290        if (cboCollSamp.ItemIndex < 0) and (cboCollSamp.Items.IndexOf('Other...') >= 0) then cboCollSamp.SelectByID('0');
1291        cboCollSampChange(Self);
1292        DetermineCollectionDefaults(Responses);
1293        LoadUrgency(cboCollType.ItemID, cboUrgency);
1294        SetControl(cboUrgency,         'URGENCY', 1);
1295        Urgency := cboUrgency.ItemIEN;
1296        if (Urgency = 0) and (cboUrgency.Items.Count = 1) then
1297          begin
1298            cboUrgency.ItemIndex := 0;
1299            Urgency := cboUrgency.ItemIEN;
1300          end;
1301        tmpResp := FindResponseByName('SPECIMEN'  ,1);
1302        if (tmpResp <> nil) and (tmpResp.IValue <> '') then with cboSpecimen do
1303          begin
1304            SelectByID(tmpResp.IValue);
1305            if ItemIndex < 0 then
1306              begin
1307                if ALabTest <> nil then
1308                  ALabTest.SpecimenList.Add(tmpResp.IValue + U + tmpResp.EValue);
1309                Items.Insert(0, tmpResp.IValue + U + tmpResp.EValue);
1310                ItemIndex := 0  ;
1311              end;
1312          end
1313        else if LRFSPEC <> '' then
1314          cboSpecimen.SelectByID(LRFSPEC);
1315        if (cboSpecimen.ItemIndex < 0) and (cboSpecimen.Items.IndexOf('Other...') >= 0) then cboSpecimen.SelectByID('0');
1316        Specimen := cboSpecimen.ItemIEN;
1317        i := 1 ;
1318        tmpResp := Responses.FindResponseByName('COMMENT',i);
1319        while tmpResp <> nil do
1320          begin
1321            Comment.Add(tmpResp.EValue);
1322            Inc(i);
1323            tmpResp := Responses.FindResponseByName('COMMENT',i);
1324          end ;
1325        with cboFrequency do
1326          if not Enabled then
1327            begin
1328              ItemIndex := Items.IndexOf('ONE TIME');
1329              if ItemIndex = -1 then ItemIndex := Items.IndexOf('ONCE');
1330            end;
1331        cboFrequencyChange(Self);
1332       end;  //  Quick Order
1333      if ObtainCollSamp then
1334        begin
1335          lblCollSamp.Enabled := True;
1336          cboCollSamp.Enabled := True;
1337          //TDP - CQ#19396 Added cboCollSamp 508 changes
1338          setup508Label(cboCollSamp.Text, collsamplbl508, cboCollSamp, lblCollSamp.Caption);
1339        end
1340      else
1341        begin
1342          with ALabTest do
1343            with TCollSamp(CollSampList.Items[IndexOfCollSamp(CollSamp)]) do
1344              begin
1345                x := '' ;
1346                for i := 0 to WardComment.Count-1 do
1347                  x := x + WardComment.strings[i]+#13#10 ;
1348                pnlMessage.TabOrder := cboAvailTest.TabOrder + 1;
1349                OrderMessage(x) ;
1350              end ;
1351          lblCollSamp.Enabled := False;
1352          cboCollSamp.Enabled := False;
1353          //TDP - CQ#19396 Added cboCollSamp 508 changes
1354          setup508Label(cboCollSamp.Text, collsamplbl508, cboCollSamp, lblCollSamp.Caption);
1355        end;
1356      if ObtainSpecimen then
1357      begin
1358        lblSpecimen.Enabled:= True;
1359        cboSpecimen.Enabled:= True;
1360        setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption);
1361      end else
1362      begin
1363        lblSpecimen.Enabled:= False;
1364        cboSpecimen.Enabled:= False;
1365        setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption);
1366      end;
1367      if ObtainUrgency then
1368      begin
1369        lblUrgency.Enabled := True;
1370        cboUrgency.Enabled := True;
1371      end else
1372      begin
1373        lblUrgency.Enabled := False;
1374        cboUrgency.Enabled := False;
1375      end;
1376      if ObtainComment then
1377        LoadRequiredComment(FCmtTypes.IndexOf(CurReqComment))
1378      else
1379        DisableCommentPanels;
1380      x := '' ;
1381      for i := 0 to CurWardComment.Count-1 do
1382        x := x + CurWardComment.strings[i]+#13#10 ;
1383      i :=  IndexOfCollSamp(CollSamp);
1384      if i > -1 then with TCollSamp(CollSampList.Items[IndexOfCollSamp(CollSamp)]) do
1385         for i := 0 to WardComment.Count-1 do
1386           x := x + WardComment.strings[i]+#13#10 ;
1387      pnlMessage.TabOrder := cboAvailTest.TabOrder + 1;
1388      OrderMessage(x) ;
1389     end; { with }
1390    StatusText('');
1391    Changing := False;
1392    if Sender <> Self then ControlChange(Self);
1393  end;