Procedure

TfrmODLab.ControlChange

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Comments

End of TLabTest object

Visibility

Public/Published

Owner

TfrmODLab

Declaration

procedure ControlChange(Sender: TObject);

Calls Hierarchy


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...

Called-By Hierarchy


            TfrmODLab.ControlChange
            TfrmODLab.SetupDialog┤ 
               TfrmODLab.Validate┤ 
     TfrmODLab.cboAvailTestSelect┤ 
          TfrmODLab.SetupDialog┤ │ 
     TfrmODLab.cboAvailTestExit┘ │ 
      TfrmODLab.cboCollSampChange┤ 
          TfrmODLab.SetupDialog┤ │ 
TfrmODLab.cboAvailTestSelect...┘ │ 
       TfrmODLab.cboUrgencyChange┤ 
      TfrmODLab.cboSpecimenChange┤ 
      TfrmODLab.cboCollTimeChange┤ 
     TfrmODLab.cboFrequencyChange┤ 
          TfrmODLab.SetupDialog┤ │ 
TfrmODLab.cboAvailTestSelect...┘ │ 
      TfrmODLab.cboCollTypeChange┤ 
    TfrmODLab.txtOrderCommentExit┤ 
   TfrmODLab.txtAntiCoagulantExit┤ 
     TfrmODLab.txtUrineVolumeExit┤ 
     TfrmODLab.grpPeakTroughClick┤ 
   TfrmODLab.txtAddlCommentExit┘ │ 
        TfrmODLab.txtDoseTimeExit┤ 
        TfrmODLab.txtDrawTimeExit┤ 
    TfrmODLab.cboCollSampKeyPause┤ 
  TfrmODLab.cboCollSampMouseClick┤ 
        TfrmODLab.cboCollTimeExit┤ 
  TfrmODLab.cboSpecimenMouseClick┤ 
    TfrmODLab.cboSpecimenKeyPause┘ 

Calls

Name Declaration Comments
TResponses.Clear procedure Clear; overload; -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TResponses.GetOrderText function GetOrderText: string; -
TLabTest.NameOfCollSamp function NameOfCollSamp: string; -
TLabTest.NameOfSpecimen function NameOfSpecimen: string; -
TLabTest.NameOfUrgency function NameOfUrgency: string; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -
TfrmODLab.ValidCollTime function ValidCollTime(UserEntry: string): string; -

Called-By

Name Declaration Comments
TfrmODLab.cboAvailTestSelect procedure cboAvailTestSelect(Sender: TObject); -
TfrmODLab.cboCollSampChange procedure cboCollSampChange(Sender: TObject); -
TfrmODLab.cboCollSampKeyPause procedure cboCollSampKeyPause(Sender: TObject); -
TfrmODLab.cboCollSampMouseClick procedure cboCollSampMouseClick(Sender: TObject); -
TfrmODLab.cboCollTimeChange procedure cboCollTimeChange(Sender: TObject); -
TfrmODLab.cboCollTimeExit procedure cboCollTimeExit(Sender: TObject); -
TfrmODLab.cboCollTypeChange procedure cboCollTypeChange(Sender: TObject); -
TfrmODLab.cboFrequencyChange procedure cboFrequencyChange(Sender: TObject); -
TfrmODLab.cboSpecimenChange procedure cboSpecimenChange(Sender: TObject); -
TfrmODLab.cboSpecimenKeyPause procedure cboSpecimenKeyPause(Sender: TObject); -
TfrmODLab.cboSpecimenMouseClick procedure cboSpecimenMouseClick(Sender: TObject); -
TfrmODLab.cboUrgencyChange procedure cboUrgencyChange(Sender: TObject); -
TfrmODLab.grpPeakTroughClick procedure grpPeakTroughClick(Sender: TObject); -
TfrmODLab.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -
TfrmODLab.txtAntiCoagulantExit procedure txtAntiCoagulantExit(Sender: TObject); -
TfrmODLab.txtDoseTimeExit procedure txtDoseTimeExit(Sender: TObject); -
TfrmODLab.txtDrawTimeExit procedure txtDrawTimeExit(Sender: TObject); -
TfrmODLab.txtOrderCommentExit procedure txtOrderCommentExit(Sender: TObject); -
TfrmODLab.txtUrineVolumeExit procedure txtUrineVolumeExit(Sender: TObject); -
TfrmODLab.Validate procedure Validate(var AnErrMsg: string); override; -


Source

866   procedure TfrmODLab.ControlChange(Sender: TObject);
867   var
868     AResponse: TResponse;
869     AVisitStr: string;
870   begin
871     inherited;
872     if Changing or (ALabTest = nil) then Exit;
873     AResponse := Responses.FindResponseByName('VISITSTR', 1);
874     if AResponse <> nil then
875       AVisitStr := AResponse.EValue;
876     Responses.Clear;
877     with ALabTest do
878     begin
879       if TestID > 0 then Responses.Update('ORDERABLE', 1, IntToStr(TestID), TestName);
880       if CollSamp > 0 then Responses.Update('SAMPLE', 1, IntToStr(CollSamp), NameOfCollSamp)
881         else Responses.Update('SAMPLE', 1, '', '');
882       if Specimen > 0 then Responses.Update('SPECIMEN', 1, IntToStr(Specimen), NameOfSpecimen)
883         else Responses.Update('SPECIMEN', 1, '', '');
884       if Urgency > 0 then Responses.Update('URGENCY', 1, IntToStr(Urgency), NameOfUrgency);
885       if Length(Comment.Text) > 0 then Responses.Update('COMMENT', 1, TX_WPTYPE, Comment.Text);
886       with cboCollType do if Length(ItemID) > 0 then
887         begin
888           Responses.Update('COLLECT', 1, ItemID, ItemID) ;
889           FLastCollType := ItemID;
890         end;
891     end;
892     if cboCollType.ItemID = 'LC' then
893       begin
894         with cboCollTime do
895           if Length(ItemID) > 0 then
896             begin
897               Responses.Update('START', 1, Copy(ItemID, 2, 999), Copy(ItemID, 2, 999));
898               FLastLabCollTime := ItemID + U + Text;
899             end
900           else if Length(Text) > 0 then
901             begin
902               Responses.Update('START', 1, ValidCollTime(Text), Text) ;
903               FLastLabCollTime := ValidCollTime(Text);
904             end;
905       end
906     else
907       begin
908         with calCollTime do
909           if FMDateTime > 0 then
910             begin
911               Responses.Update('START', 1, ValidCollTime(Text), Text);
912               FLastColltime := ValidCollTime(Text);
913             end
914           else
915             begin
916               Responses.Update('START', 1, '', '') ;
917               FLastCollTime := '';
918             end;
919       end;
920     with cboFrequency do if Length(ItemID) > 0
921       then Responses.Update('SCHEDULE', 1, ItemID, Text);
922     with txtDays do if Enabled then Responses.Update('DAYS', 1, Text, Text);
923     { worry about stop date later }
924     if AVisitStr <> '' then Responses.Update('VISITSTR', 1, AVisitStr, AVisitStr);
925     memOrder.Text := Responses.OrderText;
926   end;