Procedure

TfrmODMeds.chkDoseNowClick

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODMeds

Declaration

procedure chkDoseNowClick(Sender: TObject);

Calls Hierarchy


TfrmODMeds.chkDoseNowClick
 └TfrmODMeds.ControlChange
   ├TResponses.Clear
   ├TResponses.Update
   │ ├TResponses.FindResponseByName
   │ └TResponses.IENForPrompt
   ├TfrmODMeds.FindCommonDrug
   │ ├TfrmODMeds.FindDoseFields
   │ ├SaveDrug
   │ └KillDrug
   ├TfrmODMeds.ConstructedDoseFields
   ├TfrmODMeds.ValueOf
   │ ├GetSingleDoseSchedule
   │ ├GetSingleDoseScheduleEX
   │ ├TfrmODMeds.FieldsForDose
   │ │ └TfrmODMeds.ConstructedDoseFields
   │ ├TfrmODMeds.FieldsForDrug
   │ ├GetComplexDoseSchedule
   │ │ └TfrmODMeds.ValFor
   │ └GetComplexDoseScheduleEX
   │   └TfrmODMeds.ValFor
   ├TfrmODMeds.lblAdminSchGetText
   ├TfrmODMeds.ValFor
   ├TfrmODMeds.InpatientSig
   │ ├TfrmODMeds.ValueOf...
   │ └TfrmODMeds.CheckDecimal
   │   └TfrmODMeds.TextDosage
   ├TfrmODMeds.OutpatientSig
   │ ├TfrmODMeds.ValueOf...
   │ └TfrmODMeds.CheckDecimal...
   └TResponses.GetOrderText
     ├TResponses.NextInstance
     ├TResponses.FindResponseByName
     ├TResponses.FormatResponse
     │ └TResponses.FindResponseByIEN
     └TResponses.AppendChildren
       ├TResponses.FindPromptByIEN
       ├TResponses.FindResponseByIEN
       └TResponses.FormatResponse...

Called-By Hierarchy


   TfrmODMeds.chkDoseNowClick
 TfrmODMeds.SetOnQuickOrder┘ 
   TfrmODMeds.SetupDialog┤   
TfrmODMeds.btnSelectClick┘   
TfrmODMeds.UMDelayClick┘     

Calls

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

Called-By

Name Declaration Comments
TfrmODMeds.SetOnQuickOrder procedure SetOnQuickOrder; -


Source

4874  procedure TfrmODMeds.chkDoseNowClick(Sender: TObject);
4875  const
4876    T  = '"';
4877    T1 = 'By checking the "Give additional dose now" box, you have actually entered two orders for the same medication "';
4878    T2 = #13#13'The "Give additional dose now" order has an administration schedule of "';
4879    T3 = #13'The "Ongoing" order has an administration schedule of "';
4880    T4 = #13#13'Do you want to continue?';
4881    T5 = '" and a priority of "';            
4882    T1A = 'By checking the "Give additional dose now" box, you have actually entered a new order with the schedule "NOW"';
4883    T2A = ' in addition to the one you are placing for the same medication "';
4884  var
4885    medNm: string;
4886    theSch: string;
4887    ordPriority: string;
4888  begin
4889    inherited;
4890    if (chkDoseNow.Checked) and (tabDose.TabIndex <> TI_COMPLEX) then
4891    begin
4892      medNm := txtMed.Text;
4893      theSch := cboSchedule.Text;
4894      ordPriority := cboPriority.SelText;
4895      if length(theSch)>0 then
4896      begin
4897        //if ( (ValueOf(FLD_SCHED_TYP) <> 'O') and (InfoBox(T1+medNm+T+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL) )then
4898        //if InfoBox(T1+medNm+T+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL then
4899        if InfoBox(T1+medNm+T+T2+'NOW'+T5+ordPriority+T+T3+theSch+T5+ordPriority+T+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL then
4900        begin
4901          chkDoseNow.Checked := False;
4902          Exit;
4903        end;
4904      end else
4905      begin
4906        if InfoBox(T1A+T2A+medNm+T+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL then
4907        begin
4908          chkDoseNow.Checked := False;
4909          Exit;
4910        end;
4911      end;
4912    end;
4913    lblAdminTime.Visible := not chkDoseNow.Checked;
4914    if (tabDose.TabIndex = TI_COMPLEX) and chkDoseNow.Checked  then
4915    begin
4916      if (InfoBox('Give Additional Dose Now is in addition to those listed in the table.' + CRLF +
4917                   'Please adjust the duration of the first row, if necessary.',
4918                   'Give Additional Dose Now for Complex Order', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL) then
4919      begin
4920        chkDoseNow.Checked := False;
4921        Exit;
4922      end;
4923    end;
4924    ControlChange(Self);
4925  end;