Function

TfrmODMeds.OutpatientSig

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Comments

Values changing

Visibility

Private

Owner

TfrmODMeds

Declaration

function OutpatientSig: string;

Calls Hierarchy


TfrmODMeds.OutpatientSig
 ├TfrmODMeds.ValueOf
 │ ├GetSingleDoseSchedule
 │ ├GetSingleDoseScheduleEX
 │ ├TfrmODMeds.FieldsForDose
 │ │ └TfrmODMeds.ConstructedDoseFields
 │ ├TfrmODMeds.FieldsForDrug
 │ ├GetComplexDoseSchedule
 │ │ └TfrmODMeds.ValFor
 │ └GetComplexDoseScheduleEX
 │   └TfrmODMeds.ValFor
 └TfrmODMeds.CheckDecimal
   └TfrmODMeds.TextDosage

Called-By Hierarchy


                TfrmODMeds.OutpatientSig
              TfrmODMeds.ControlChange┘ 
              TfrmODMeds.SetupDialog┤   
                 TfrmODMeds.Validate┤   
           TfrmODMeds.btnSelectClick┤   
           TfrmODMeds.UMDelayClick┘ │   
            TfrmODMeds.tabDoseChange┤   
            TfrmODMeds.FormKeyDown┘ │   
           TfrmODMeds.cboRouteChange┤   
         TfrmODMeds.SetOnMedSelect┘ │   
          TfrmODMeds.SetupDialog┤   │   
    TfrmODMeds.btnSelectClick...┤   │   
     TfrmODMeds.CheckFormAltDose┘   │   
     TfrmODMeds.cboDosageClick┘     │   
   TfrmODMeds.cboDosageKeyUp┘       │   
         TfrmODMeds.popDurationClick┤   
          TfrmODMeds.cboXRouteChange┤   
           TfrmODMeds.cboXRouteClick┤   
          TfrmODMeds.cboXRouteExit┘ │   
       TfrmODMeds.txtXDurationChange┤   
       TfrmODMeds.popDurationClick┘ │   
          TfrmODMeds.btnXRemoveClick┤   
        TfrmODMeds.grdDosesKeyDown┘ │   
     TfrmODMeds.timCheckChangesTimer┤   
          TfrmODMeds.UpdateRelated┘ │   
          TfrmODMeds.SetupDialog┤   │   
    TfrmODMeds.btnSelectClick...┤   │   
    TfrmODMeds.cboDosageClick...┤   │   
      TfrmODMeds.cboDosageChange┤   │   
        TfrmODMeds.cboDosageExit┤   │   
     TfrmODMeds.cboScheduleClick┤   │   
     TfrmODMeds.cmdAcceptClick┤ │   │   
        TfrmODMeds.chkPRNClick┤ │   │   
        TfrmODMeds.txtNSSClick┤ │   │   
   TfrmODMeds.cboScheduleEnter┤ │   │   
   TfrmODMeds.UMShowNSSBuilder┘ │   │   
    TfrmODMeds.cboScheduleChange┤   │   
      TfrmODMeds.txtSupplyChange┤   │   
    TfrmODMeds.txtQuantityChange┤   │   
         TfrmODMeds.grdDosesExit┤   │   
     TfrmODMeds.cboXDosageChange┤   │   
      TfrmODMeds.cboXDosageClick┤   │   
     TfrmODMeds.cboXDosageExit┤ │   │   
    TfrmODMeds.cboXDosageKeyUp┘ │   │   
       TfrmODMeds.cboXDosageExit┤   │   
   TfrmODMeds.cboXScheduleChange┤   │   
        TfrmODMeds.txtNSSClick┘ │   │   
    TfrmODMeds.cboXScheduleClick┤   │   
       TfrmODMeds.chkXPRNClick┤ │   │   
   TfrmODMeds.pnlXScheduleExit┘ │   │   
     TfrmODMeds.pnlXScheduleExit┤   │   
TfrmODMeds.txtXDurationChange...┤   │   
     TfrmODMeds.pnlXDurationExit┤   │   
          TfrmODMeds.chkPRNClick┤   │   
      TfrmODMeds.cboScheduleExit┤   │   
       TfrmODMeds.cboDosageKeyUp┤   │   
      TfrmODMeds.cboXDosageKeyUp┘   │   
       TfrmODMeds.chkPtInstructClick┤   
          TfrmODMeds.chkDoseNowClick┤   
        TfrmODMeds.SetOnQuickOrder┘ │   
          TfrmODMeds.SetupDialog┤   │   
    TfrmODMeds.btnSelectClick...┘   │   
              TfrmODMeds.chkPRNClick┤   
       TfrmODMeds.cboXSequenceChange┤   
         TfrmODMeds.txtRefillsChange┘   

Calls

Name Declaration Comments
TfrmODMeds.CheckDecimal procedure CheckDecimal(var AStr: string); -
TfrmODMeds.ValueOf function ValueOf(FieldID: Integer; ARow: Integer = -1): string; -

Called-By

Name Declaration Comments
TfrmODMeds.ControlChange procedure ControlChange(Sender: TObject); -


Source

2746  function TfrmODMeds.OutpatientSig: string;
2747  var
2748    Dose, Route, Schedule, Duration, x: string;
2749    i: Integer;
2750  begin
2751    case tabDose.TabIndex of
2752    TI_DOSE:
2753      begin
2754        if ValueOf(FLD_TOTALDOSE) = ''
2755          then Dose := ValueOf(FLD_LOCALDOSE)
2756          else Dose := ValueOf(FLD_UNITNOUN);
2757        CheckDecimal(Dose);
2758        Route := ValueOf(FLD_ROUTE_EX);
2759        if (Length(Route) > 0) and (Length(FSigPrep) > 0) then Route := FSigPrep + ' ' + Route;
2760        if Length(Route) = 0 then Route := ValueOf(FLD_ROUTE_NM);
2761        Schedule := ValueOf(FLD_SCHED_EX);
2762        (* Schedule := Piece(Temp,U,1);
2763        if Piece(Temp,U,3) = '1' then Schedule := Schedule + ' AS NEEDED';
2764        if UpperCase(Copy(Schedule, Length(Schedule) - 18, Length(Schedule))) = 'AS NEEDED AS NEEDED'
2765        then Schedule := Copy(Schedule, 1, Length(Schedule) - 10); *)
2766        if Length(Schedule) = 0 then
2767          begin
2768            Schedule := ValueOf(FLD_SCHEDULE);
2769            if RightStr(Schedule,3) = 'PRN' then
2770               begin
2771                 Schedule := Copy(Schedule,1,Length(Schedule)-3); //Remove the Trailing PRN
2772                 if (RightStr(Schedule,1) = ' ') or (RightStr(Schedule,1) = '-') then
2773                 Schedule := Copy(Schedule,1,Length(Schedule)-1);
2774                 Schedule := Schedule + ' AS NEEDED'
2775               end;
2776          end;
2777        Result := FSIGVerb + ' ' + Dose + ' ' + Route + ' ' + Schedule;
2778      end;
2779    TI_COMPLEX:
2780      begin
2781        with grdDoses do for i := 1 to Pred(RowCount) do
2782        begin
2783          if Length(ValueOf(FLD_LOCALDOSE, i)) = 0 then Continue;
2784          if FDrugID = '' then
2785          begin
2786           Dose := ValueOf(FLD_DOSETEXT, i);
2787           CheckDecimal(Dose);
2788          end
2789          else
2790          begin
2791            if ValueOf(FLD_TOTALDOSE, i) = ''
2792              then Dose := ValueOf(FLD_LOCALDOSE, i)
2793              else Dose := ValueOf(FLD_UNITNOUN, i);
2794            CheckDecimal(Dose);
2795          end;
2796          Route := ValueOf(FLD_ROUTE_EX, i);
2797          if (Length(Route) > 0) and (Length(FSigPrep) > 0) then Route := FSigPrep + ' ' + Route;
2798          if Length(Route) = 0 then Route := ValueOf(FLD_ROUTE_NM, i);
2799          Schedule := ValueOf(FLD_SCHED_EX, i);
2800          //if Length(Schedule) = 0 then Schedule := ValueOf(FLD_SCHEDULE, i);
2801          if Length(Schedule) = 0 then
2802          begin
2803            Schedule := ValueOf(FLD_SCHEDULE);
2804            if RightStr(Schedule,3) = 'PRN' then
2805               begin
2806                 Schedule := Copy(Schedule,1,Length(Schedule)-3); //Remove the Trailing PRN
2807                 if (RightStr(Schedule,1) = ' ') or (RightStr(Schedule,1) = '-') then
2808                 Schedule := Copy(Schedule,1,Length(Schedule)-1);
2809                 Schedule := Schedule + ' AS NEEDED'
2810               end;
2811          end;
2812          Duration := ValueOf(FLD_DURATION, i);
2813          if Length(Duration) > 0 then Duration := 'FOR ' + Duration;
2814          x := FSIGVerb + ' ' + Dose + ' ' + Route + ' ' + Schedule + ' ' + Duration;
2815          if i > 1
2816            then Result := Result + ' ' + ValueOf(FLD_SEQUENCE, i-1) + ' ' + x
2817            else Result := x;
2818        end; {with grdDoses}
2819      end; {TI__COMPLEX}
2820    end; {case}
2821  end;