Procedure

TfrmODMeds.txtXDurationChange

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmODMeds

Declaration

procedure txtXDurationChange(Sender: TObject);

Calls Hierarchy


TfrmODMeds.txtXDurationChange
 ├TfrmODMeds.UpdateDurationControls
 ├TfrmODMeds.ValFor
 ├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...
 └TfrmODMeds.UpdateRelated
   └TfrmODMeds.timCheckChangesTimer
     ├TfrmODMeds.ControlChange...
     ├TResponses.NextInstance
     ├TfrmODMeds.ValueOfResponse
     │ └TResponses.IValueFor
     ├TfrmODMeds.ValueOf...
     ├TfrmODMeds.UpdateStartExpires
     │ ├TfrmODMeds.ValFor
     │ ├TfrmODMeds.lblAdminSchSetText
     │ ├TfrmODMeds.lblAdminSchGetText
     │ ├LoadAdminInfo
     │ ├FMToday
     │ │ └FMNow
     │ └TfrmODMeds.DisplayDoseNow
     ├IsClozapineOrder
     ├TfrmODMeds.UpdateDefaultSupply
     │ ├TResponses.IValueFor
     │ ├IsClozapineOrder
     │ ├DefaultDays
     │ └DaysToQty
     ├TfrmODMeds.UpdateSupplyQuantity
     │ ├TfrmODMeds.DurationToDays
     │ │ └TfrmODMeds.ValFor
     │ ├DaysToQty
     │ └QtyToDays
     └TfrmODMeds.UpdateRefills
       └CalcMaxRefills

Called-By Hierarchy


TfrmODMeds.txtXDurationChange
TfrmODMeds.popDurationClick┘ 

Calls

Name Declaration Comments
TfrmODMeds.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODMeds.UpdateDurationControls procedure UpdateDurationControls( FreeText: boolean); -
TfrmODMeds.UpdateRelated procedure UpdateRelated(DelayUpdate: Boolean = TRUE); -
TfrmODMeds.ValFor function ValFor(FieldID, ARow: Integer): string; -

Called-By

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


Source

3932  procedure TfrmODMeds.txtXDurationChange(Sender: TObject);
3933  var
3934    I, Code: Integer;
3935    OrgValue: string;
3936  begin
3937    inherited;
3938    if Changing then Exit;
3939    if (txtXDuration.Text <> '0') and (txtXDuration.Text <> '') then
3940    begin
3941      Val(txtXDuration.Text, I, Code);
3942      UpdateDurationControls(Code <> 0);
3943      //Commented out the "and" to resolve CQ: 7557
3944      if (Code <> 0) {and (I=0)} then
3945      begin
3946        ShowMsg('Please use numeric characters only.');
3947        with txtXDuration do
3948        begin
3949          Text := IntToStr(I);
3950          SelStart := Length(Text);
3951        end;
3952        Exit;
3953        btnXDuration.Width := 8;
3954        btnXDuration.Align := alRight;
3955        spnXDuration.Visible := False;
3956        txtXduration.Align := alClient;
3957        PopDuration.Items.Tag := 0;
3958        btnXDuration.Caption := '';
3959      end;
3960     {AGP change 26.19 for PSI-05-018 cq #7322
3961      else if PopDuration.Items.Tag = 0 then
3962      begin
3963        PopDuration.Items.Tag := 3;  //Days selection
3964        btnXDuration.Caption := 'days';
3965      end; }
3966      grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := txtXDuration.Text + ' ' + Uppercase(btnXDuration.Caption);
3967    end else   //AGP CHANGE ORDER
3968         begin
3969           if not(FInptDlg) then grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := '';
3970           OrgValue := ValFor(COL_DURATION, pnlxDuration.tag);
3971           //if ((txtXDuration.Text = '0') or (txtXDuration.Text = '')) and ((ValFor(COL_SEQUENCE, ARow1) = 'THEN') and (FInptDlg)) then //AGP CHANGE ORDER
3972           //AGP change 26.33 Then/And conjunction requiring a duration to include outpatient orders also
3973           if ((txtXDuration.Text = '0') or (txtXDuration.Text = '')) and (ValFor(COL_SEQUENCE, ARow1) = 'THEN') then //AGP CHANGE ORDER
3974               begin
3975                 if (InfoBox('A duration is required when using "Then" as a sequence.'+CRLF+'"Then" will be remove from the sequence field if you continue'+
3976                      CRLF+'Click "OK" to continue or click "Cancel"','Duration Warning', MB_OKCANCEL)=1) then
3977                      begin
3978                          grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := '';
3979                          cboXSequence.Tag := ARow1;
3980                          grdDoses.Cells[COL_SEQUENCE, cboXSequence.Tag] := '';
3981                          cboXSequence.Text := '';
3982                          cboXSequence.ItemIndex := -1;
3983                      end
3984                      else
3985                      grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := OrgValue;
3986                 end
3987               else grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := txtXDuration.Text;
3988         end;
3989     // end;
3990    ControlChange(Self);
3991    UpdateRelated;
3992  end;