Function

TfrmODMeds.FieldsForDose

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODMeds

Declaration

function FieldsForDose(ARow: Integer): string;

Calls Hierarchy


TfrmODMeds.FieldsForDose
 └TfrmODMeds.ConstructedDoseFields

Called-By Hierarchy


                    TfrmODMeds.FieldsForDose
                        TfrmODMeds.ValueOf┘ 
                   TfrmODMeds.InitDialog┤   
                 TfrmODMeds.FormCreate┘ │   
               TfrmODMeds.SetOnMedSelect┤   
                TfrmODMeds.SetupDialog┤ │   
             TfrmODMeds.btnSelectClick┤ │   
             TfrmODMeds.UMDelayClick┘ │ │   
           TfrmODMeds.CheckFormAltDose┘ │   
           TfrmODMeds.cboDosageClick┘   │   
         TfrmODMeds.cboDosageKeyUp┘     │   
              TfrmODMeds.SetOnQuickOrder┤   
                TfrmODMeds.SetupDialog┤ │   
          TfrmODMeds.btnSelectClick...┘ │   
            TfrmODMeds.cboDosageClick...┤   
         TfrmODMeds.QuantityMessageCheck┤   
            TfrmODMeds.cboXDosageEnter┤ │   
    TfrmODMeds.pnlXDurationButtonEnter┤ │   
             TfrmODMeds.cboXRouteEnter┤ │   
          TfrmODMeds.cboXSequenceEnter┤ │   
          TfrmODMeds.cboXScheduleEnter┘ │   
                TfrmODMeds.OutpatientSig┤   
              TfrmODMeds.ControlChange┘ │   
              TfrmODMeds.SetupDialog┤   │   
                 TfrmODMeds.Validate┤   │   
        TfrmODMeds.btnSelectClick...┤   │   
            TfrmODMeds.tabDoseChange┤   │   
            TfrmODMeds.FormKeyDown┘ │   │   
           TfrmODMeds.cboRouteChange┤   │   
      TfrmODMeds.SetOnMedSelect...┘ │   │   
         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.chkPRNClick┤   │   
       TfrmODMeds.cboXSequenceChange┤   │   
         TfrmODMeds.txtRefillsChange┘   │   
                 TfrmODMeds.InpatientSig┤   
           TfrmODMeds.ControlChange...┘ │   
             TfrmODMeds.ControlChange...┤   
           TfrmODMeds.cboXDosageClick...┤   
      TfrmODMeds.timCheckChangesTimer...┘   

Calls

Name Declaration Comments
TfrmODMeds.ConstructedDoseFields function ConstructedDoseFields(const ADose: string; PrependName: Boolean = FALSE): string; -

Called-By

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


Source

2907  function TfrmODMeds.FieldsForDose(ARow: Integer): string;
2908  var
2909    i: Integer;
2910    DoseDrug: string;
2911  begin
2912    Result := Piece(Piece(grdDoses.Cells[COL_DOSAGE, ARow], TAB, 2), U, 4);
2913    //AGP CHANGE 26.33 change for Remedy ticket 87476 fix for quick orders for complex
2914    //inpatient orders not displaying the correct unit dose in Pharmacy
2915    //if (not FInptDlg) and (Length(FDrugID) > 0) then
2916    if Length(FDrugID) > 0 then
2917    begin
2918      Result := '';
2919      DoseDrug := Piece(Piece(grdDoses.Cells[COL_DOSAGE, ARow], TAB, 2), U, 5);
2920      if DoseDrug = '' then DoseDrug := Piece(grdDoses.Cells[COL_DOSAGE, ARow], TAB, 1);
2921      DoseDrug := DoseDrug + U + FDrugID;
2922      for i := 0 to Pred(FAllDoses.Count) do
2923      begin
2924         // CQ #16957 - Corrected code that would potentially mis-match drugs - JCS
2925        //if AnsiSameText(DoseDrug, Copy(FAllDoses[i], 1, Length(DoseDrug))) then
2926        if AnsiSameText(DoseDrug, Pieces(FAllDoses[i],U,1,2)) then
2927        begin
2928          Result := Piece(FAllDoses[i], U, 3);
2929          Break;
2930        end; {if AnsiSameText}
2931      end; {for i}
2932      if Result = '' then Result := ConstructedDoseFields(Piece(DoseDrug, U, 1));
2933    end;
2934  end;