Procedure

TfrmODMedOut.SetInstructions

Module

fODMedOut

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODMedOut

Declaration

procedure SetInstructions;

Calls Hierarchy


TfrmODMedOut.SetInstructions
 ├TResponses.InstanceCount
 ├TResponses.EValueFor
 ├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
 ├TfrmODMedOut.SetSimple
 ├TResponses.NextInstance
 ├TResponses.IValueFor
 ├TfrmODMedOut.SetComplex
 └TResponses.GetOrderText
   ├TResponses.NextInstance
   ├TResponses.FindResponseByName
   ├TResponses.FormatResponse
   │ └TResponses.FindResponseByIEN
   └TResponses.AppendChildren
     ├TResponses.FindPromptByIEN
     ├TResponses.FindResponseByIEN
     └TResponses.FormatResponse...

Called-By Hierarchy


               TfrmODMedOut.SetInstructions
                 TfrmODMedOut.SetupDialog┤ 
         TfrmODMedOut.cboMedicationSelect┤ 
              TfrmODMedOut.CheckFormAlt┘ │ 
         TfrmODMedOut.cboDispenseExit┤   │ 
   TfrmODMedOut.cboDispenseMouseClick┘   │ 
TfrmODMedOut.cboMedicationSelect...┘     │ 
             TfrmODMedOut.cmdComplexClick┘ 

Calls

Name Declaration Comments
TResponses.EValueFor function EValueFor(const APromptID: string; AnInstance: Integer): string; -
TResponses.GetOrderText function GetOrderText: string; -
TResponses.InstanceCount function InstanceCount(const APromptID: string): Integer; -
TResponses.IValueFor function IValueFor(const APromptID: string; AnInstance: Integer): string; -
TResponses.NextInstance function NextInstance(const APromptID: string; LastInstance: Integer): Integer; -
TfrmODMedOut.SetComplex procedure SetComplex; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODMedOut.SetSimple procedure SetSimple; -

Called-By

Name Declaration Comments
TfrmODMedOut.cboMedicationSelect procedure cboMedicationSelect(Sender: TObject); -
TfrmODMedOut.cmdComplexClick procedure cmdComplexClick(Sender: TObject); -
TfrmODMedOut.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -


Source

486   procedure TfrmODMedOut.SetInstructions;
487   var
488     x: string;
489     AnInstance: Integer;
490   begin
491     case Responses.InstanceCount('INSTR') of
492     0:   begin
493            cboInstructions.ItemIndex := -1;
494            // there may still be a route & schedule (for copied orders)
495            if Responses.EValueFor('MISC', 1) <> ''
496              then btnUnits.Caption := Responses.EValueFor('MISC', 1);
497            Responses.SetControl(cboRoute, 'ROUTE', 1);
498            with cboRoute do if ItemIndex > -1 then Text := DisplayText[ItemIndex];
499            Responses.SetControl(cboSchedule, 'SCHEDULE', 1);
500            SetSimple;
501          end;
502     1:   begin
503            AnInstance := Responses.NextInstance('INSTR', 0);
504            Responses.SetControl(cboInstructions, 'INSTR', AnInstance);
505            btnUnits.Caption := Responses.IValueFor('MISC', AnInstance);
506            Responses.SetControl(cboRoute, 'ROUTE', AnInstance);
507            with cboRoute do if ItemIndex > -1 then Text := DisplayText[ItemIndex];
508            Responses.SetControl(cboSchedule, 'SCHEDULE', AnInstance);
509            SetSimple;
510          end;
511     else begin
512            memComplex.Clear;
513            AnInstance := Responses.NextInstance('INSTR', 0);
514            while AnInstance > 0 do
515            begin
516              x := Responses.EValueFor('INSTR', AnInstance);
517              x := x + ' ' + Responses.EValueFor('MISC', AnInstance);
518              x := x + ' ' + Responses.EValueFor('ROUTE', AnInstance);
519              x := x + ' ' + Responses.EValueFor('SCHEDULE', AnInstance);
520              if Length(Responses.EValueFor('DAYS', AnInstance)) > 0
521                then x := x + ' ' + Responses.EValueFor('DAYS', AnInstance) + ' day(s)';
522              memComplex.Lines.Add(x);
523              AnInstance := Responses.NextInstance('INSTR', AnInstance);
524            end;
525            SetComplex;
526          end;
527     end; {case}
528     memOrder.Text := Responses.OrderText;
529   end; {if ExecuteComplexDose}