Procedure

TfrmODMedNVA.SetOnQuickOrder

Module

fODMedNVA

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODMedNVA

Declaration

procedure SetOnQuickOrder;

Calls Hierarchy


TfrmODMedNVA.SetOnQuickOrder
 ├TResponses.InstanceCount
 ├TResponses.NextInstance
 ├TfrmODMedNVA.SetDosage
 ├TResponses.IValueFor
 ├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
 ├TfrmODMedNVA.SetSchedule
 ├TfrmODMedNVA.ValueOf
 │ ├GetSchedule
 │ └GetScheduleEX
 ├QuantityMessage
 ├TfrmODMedNVA.SetStartDate
 ├TResponses.EValueFor
 ├TfrmODMedNVA.SetStatements
 │ └TfrmODMedNVA.SearchStatements
 ├QOHasRouteDefined
 ├GetPickupForLocation
 ├TResponses.FindResponseByName
 ├NameOfDGroup
 │ └LoadDGroupMap
 ├TfrmODMedNVA.ValueOfResponse
 │ └TResponses.IValueFor
 └TfrmODMedNVA.UpdateStartExpires
   ├LoadAdminInfo
   └FMToday
     └FMNow

Called-By Hierarchy


 TfrmODMedNVA.SetOnQuickOrder
   TfrmODMedNVA.SetupDialog┤ 
TfrmODMedNVA.btnSelectClick┘ 
TfrmODMedNVA.UMDelayClick┘   

Calls

Name Declaration Comments
TResponses.EValueFor function EValueFor(const APromptID: string; AnInstance: Integer): string; -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
GetPickupForLocation function GetPickupForLocation(const Loc: string): string; -
TResponses.InstanceCount function InstanceCount(const APromptID: string): Integer; -
TResponses.IValueFor function IValueFor(const APromptID: string; AnInstance: Integer): string; -
NameOfDGroup function NameOfDGroup(IEN: Integer): string; -
TResponses.NextInstance function NextInstance(const APromptID: string; LastInstance: Integer): Integer; -
QOHasRouteDefined function QOHasRouteDefined(AQOID: integer): boolean; -
QuantityMessage function QuantityMessage(AnIEN: Integer): string; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODMedNVA.SetDosage procedure SetDosage(const x: string); -
TfrmODMedNVA.SetSchedule procedure SetSchedule(const x: string); -
TfrmODMedNVA.SetStartDate procedure SetStartDate(const x: string); -
TfrmODMedNVA.SetStatements procedure SetStatements(x: string); -
TfrmODMedNVA.UpdateStartExpires procedure UpdateStartExpires(const CurSchedule: string); -
TfrmODMedNVA.ValueOf function ValueOf(FieldID: Integer; ARow: Integer = -1): string; -
TfrmODMedNVA.ValueOfResponse function ValueOfResponse(FieldID: Integer; AnInstance: Integer = 1): string; -

Called-By

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


Source

1025  procedure TfrmODMedNVA.SetOnQuickOrder;
1026  var
1027    AResponse: TResponse;
1028    x,LocRoute,TempSch,DispGrp: string;
1029    i, DispDrug: Integer;
1030  begin
1031    // txtMed already set by SetOnMedSelect
1032    with Responses do
1033    begin
1034      if (InstanceCount('INSTR') > 1) or (InstanceCount('DAYS') > 0) then // complex dose
1035      begin
1036        i := Responses.NextInstance('INSTR', 0);
1037        while i > 0 do
1038        begin
1039          SetDosage(IValueFor('INSTR', i));
1040          with cboDosage do
1041            if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] else x := Text;
1042  
1043          SetControl(cboRoute,  'ROUTE', i);
1044          with cboRoute do
1045            if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] else x := Text;
1046          if FIsQuickOrder then TempSch := cboSchedule.Text;
1047          SetSchedule(IValueFor('SCHEDULE', i));
1048          if (cboSchedule.Text = '') and FIsQuickOrder then
1049          begin
1050            cboSchedule.SelectByID(TempSch);
1051            cboSchedule.Text := TempSch;
1052          end;
1053          x := cboSchedule.Text;
1054          if chkPRN.Checked then x := x + ' PRN';
1055          with cboSchedule do
1056            if ItemIndex > -1 then x := x + TAB + Items[ItemIndex];
1057          if      IValueFor('CONJ', i) = 'A' then x := 'AND'
1058          else if IValueFor('CONJ', i) = 'T' then x := 'THEN'
1059          else if IValueFor('CONJ', i) = 'X' then x := 'EXCEPT'
1060          else x := '';
1061          i := Responses.NextInstance('INSTR', i);
1062        end; {while}
1063      end else                                      // single dose
1064      begin
1065        if FIsQuickOrder then
1066        begin
1067          FQODosage := IValueFor('INSTR', 1);
1068          SetDosage(FQODosage);
1069          TempSch := cboSchedule.Text;
1070        end
1071        else
1072          SetDosage(IValueFor('INSTR', 1));
1073        SetControl(cboDosage, 'DOSAGE', 1); // CQ: HDS00007776
1074        SetControl(cboRoute,  'ROUTE',     1);  //AGP ADDED ROUTE FOR CQ 11252
1075        SetSchedule(IValueFor('SCHEDULE',  1));
1076        if (cboSchedule.Text = '') and FIsQuickOrder then
1077        begin
1078          cboSchedule.SelectByID(TempSch);
1079          cboSchedule.Text := TempSch;
1080        end;
1081        DispDrug := StrToIntDef(ValueOf(FLD_DRUG_ID), 0);
1082        if DispDrug > 0 then x := QuantityMessage(DispDrug) else x := '';
1083      SetControl(memComment ,  'COMMENT',  1);
1084      SetControl(calStart, 'START', 1);
1085      SetStartDate(EValueFor('START', 1));
1086      SetStatements(EValueFor('STATEMENTS', 1));
1087      if FIsQuickOrder then
1088        begin
1089          if not QOHasRouteDefined(Responses.QuickOrder) then
1090          begin
1091            LocRoute := GetPickupForLocation(IntToStr(Encounter.Location));
1092          end;
1093        end;
1094        AResponse := Responses.FindResponseByName('SC',     1);
1095        DispGrp := NameOfDGroup(Responses.DisplayGroup);
1096       if (AResponse = nil) or ((StrToIntDef(Piece(Responses.CopyOrder,';',1),0)>0) and AnsiSameText('Out. Meds',DispGrp)) then
1097        begin
1098          LocRoute := GetPickupForLocation(IntToStr(Encounter.Location));
1099        end;
1100  
1101      end;
1102    end; {with}
1103    if FInptDlg then
1104    begin
1105      x := ValueOfResponse(FLD_SCHEDULE, 1);
1106      if Length(x) > 0 then UpdateStartExpires(x);
1107    end;
1108  end;