Procedure

TfrmODMeds.tabDoseChange

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Comments

Medication edit --------------------------------------------------------------------------- 

text,x, tmpsch: string;

Visibility

Public/Published

Owner

TfrmODMeds

Declaration

procedure tabDoseChange(Sender: TObject);

Calls Hierarchy


TfrmODMeds.tabDoseChange
 ├TfrmODMeds.ValFor
 ├TfrmODMeds.ShowControlsSimple
 ├TfrmODMeds.ResetOnTabChange
 │ ├TResponses.Clear
 │ └TfrmODMeds.lblAdminSchSetText
 ├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.lblAdminSchGetText
 ├TfrmODMeds.ShowControlsComplex
 │ ├TfrmODMeds.lblAdminSchSetText
 │ ├MoveCombo
 │ └TfrmODMeds.pnlFieldsResize
 │   └TfrmODMeds.ShowEditor
 │     ├TfrmODMeds.ValFor
 │     ├SynchCombo
 │     ├PlaceControl
 │     └TfrmODMeds.UpdateDurationControls
 └TfrmODMeds.UpdateStartExpires
   ├TfrmODMeds.ValFor
   ├TfrmODMeds.lblAdminSchSetText
   ├TfrmODMeds.lblAdminSchGetText
   ├LoadAdminInfo
   ├FMToday
   │ └FMNow
   └TfrmODMeds.DisplayDoseNow

Called-By Hierarchy


TfrmODMeds.tabDoseChange
TfrmODMeds.FormKeyDown┘ 

Calls

Name Declaration Comments
TfrmODMeds.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODMeds.lblAdminSchGetText function lblAdminSchGetText: string; -
TfrmODMeds.ResetOnTabChange procedure ResetOnTabChange; -
TfrmODMeds.ShowControlsComplex procedure ShowControlsComplex; -
TfrmODMeds.ShowControlsSimple procedure ShowControlsSimple; -
TfrmODMeds.UpdateStartExpires procedure UpdateStartExpires(const CurSchedule: string); -
TfrmODMeds.ValFor function ValFor(FieldID, ARow: Integer): string; -

Called-By

Name Declaration Comments
TfrmODMeds.FormKeyDown procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -


Source

2306  procedure TfrmODMeds.tabDoseChange(Sender: TObject);
2307  var
2308    //text,x, tmpsch: string;
2309    text, tmpAdmin, x: string;
2310    reset: integer;
2311  begin
2312    inherited;
2313    reset := 0;
2314    //AGP change for CQ 6521 added warning message
2315    //AGP Change for CQ 7508 added tab information
2316    //GE  Change warning message functionality show only   cq 7590
2317    //    when tab changes from complex to simple.
2318    //AGP Change for CQ 7834 and 7832 change text and added check to see if some values have been completed in row 1
2319    if (tabDose.TabIndex = 0) and ((ValFor(COL_DOSAGE, 1)<>'') or (ValFor(COL_SCHEDULE, 1)<>'') or (ValFor(COL_DURATION, 1)<>'') or
2320        (ValFor(COL_SEQUENCE, 1)<>''))  then
2321        begin
2322          text := 'By switching to the Dosage Tab, ' ;
2323           if (InfoBox(text +'you will lose all data on this screen. Click “OK” to continue or “Cancel”','Warning',MB_OKCANCEL)=IDCANCEL) then
2324              begin
2325               if tabDose.TabIndex = 1 then tabDose.TabIndex := 0
2326               else tabDose.TabIndex := 1;
2327               reset := 1;
2328              end;
2329        end;
2330    case tabDose.TabIndex of
2331    TI_DOSE:    begin
2332                  cboXSchedule.Clear;                       // Added to Fix CQ: 9603
2333                  cboXDosage.Clear;
2334                  // clean up responses?
2335                  FSuppressMsg := FOrigiMsgDisp;
2336                  ShowControlsSimple;
2337                  if reset = 0 then ResetOnTabChange;
2338                  txtNss.Left := lblSchedule.Left + lblSchedule.Width + 2;
2339                  if (FInptDlg) then txtNss.Visible := True
2340                  else txtNss.Visible := False;
2341                  cboXRoute.Hide;                           // Added to Fix CQ: 7640
2342                  ControlChange(Self);
2343                end;
2344    TI_RATE:    begin
2345                  // for future use...
2346                end;
2347    TI_COMPLEX: begin
2348                  FSuppressMsg := FOrigiMsgDisp;
2349                  if reset = 1 then exit;
2350                 (*  AGP Change admin wrap 27.73
2351                  tmpAdmin := Piece(self.lblAdminSch.text, ':', 2);
2352                  tmpAdmin := Copy(tmpAdmin,2,Length(tmpAdmin)); *)
2353                  tmpAdmin := lblAdminSchGetText;
2354                  if FAdminTimeText <> '' then
2355                    begin
2356                      tmpAdmin := FAdminTimeText;
2357                      if FAdminTimeText <> 'Not defined for Clinic Locations' then self.lblAdminSch.Visible := False;
2358                    end;               
2359                  ShowControlsComplex;
2360                  ResetOnTabChange;
2361                  txtNss.Left := grdDoses.Left + grdDoses.ColWidths[0] + grdDoses.ColWidths[1] + grdDoses.ColWidths[2] + 3;
2362                  txtNss.Visible := False;
2363                  x := cboXDosage.Text + TAB;
2364                  if LeftStr(x,1) = '.' then x := '';
2365                  with cboXDosage   do if ItemIndex > -1 then x := x + Items[ItemIndex];
2366                  grdDoses.Cells[COL_DOSAGE,   1] := x;
2367                  x := cboXRoute.Text + TAB;
2368                  with cboXRoute    do if ItemIndex > -1 then x := x + Items[ItemIndex];
2369                  grdDoses.Cells[COL_ROUTE,    1] := x;
2370                  x := cboXSchedule.Text + TAB;
2371                  with cboXSchedule do if ItemIndex > -1 then x := x + Items[ItemIndex];
2372                  grdDoses.Cells[COL_SCHEDULE, 1] := x;
2373                  //AGP Change 27.1 handle PRN not showing in schedule panel if a dose is not selected.
2374                  if FSmplPRNChkd then
2375                    begin
2376                      pnlXSchedule.Tag := 1;
2377                      self.chkXPRN.Checked := True;
2378                    end;
2379                  if FInptDLG then UpdateStartExpires(ValFor(VAL_SCHEDULE,1));
2380                  ControlChange(Self);
2381               end; {TI_COMPLEX}
2382    end; {case}
2383    if ScreenReaderSystemActive then
2384      GetScreenReader.Speak(tabDose.Tabs[tabDose.TabIndex] + ' tab');
2385  end;