Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedIV.pas

    r459 r460  
    99type
    1010  TfrmODMedIV = class(TfrmODBase)
    11     tabFluid: TTabControl;
    12     cboSolution: TORComboBox;
    1311    lblInfusionRate: TLabel;
    1412    txtRate: TCaptionEdit;
    15     lblPriority: TLabel;
    16     cboPriority: TORComboBox;
    1713    lblComponent: TLabel;
    1814    lblAmount: TLabel;
     
    2117    lblComments: TLabel;
    2218    memComments: TCaptionMemo;
    23     cboAdditive: TORComboBox;
    2419    txtSelected: TCaptionEdit;
    2520    cboSelected: TCaptionComboBox;
    26     Label1: TStaticText;
    2721    popDuration: TPopupMenu;
    2822    popML: TMenuItem;
     
    3327    txtXDuration: TCaptionEdit;
    3428    lblLimit: TLabel;
    35     btnXDuration: TSpeedButton;
     29    btnXDuration: TBitBtn;
     30    pnlCombo: TPanel;
     31    cboAdditive: TORComboBox;
     32    tabFluid: TTabControl;
     33    cboSolution: TORComboBox;
     34    lblPriority: TLabel;
     35    cboPriority: TORComboBox;
    3636    procedure FormCreate(Sender: TObject);
    3737    procedure tabFluidChange(Sender: TObject);
     
    6464    procedure pnlXDurationEnter(Sender: TObject);
    6565    procedure txtXDurationExit(Sender: TObject);
     66    procedure txtRateExit(Sender: TObject);
    6667  private
    6768    FInpatient: Boolean;
     
    8485{$R *.DFM}
    8586
    86 uses ORFn, uConst, rODMeds, rODBase, uAccessibleStringGrid;
     87uses ORFn, uConst, rODMeds, rODBase, uAccessibleStringGrid, fFrame;
    8788
    8889const
     
    129130  Restriction: string;
    130131begin
     132  frmFrame.pnlVisit.Enabled := false;
    131133  inherited;
    132134  AllowQuickOrder := True;
     
    155157  with grdSelected do for i := 0 to RowCount - 1 do TIVComponent(Objects[0, i]).Free;
    156158  inherited;
     159  frmFrame.pnlVisit.Enabled := True;
    157160end;
    158161
     
    454457    end;
    455458  end;
     459  Application.ProcessMessages;         //CQ: 10157
    456460  ClickOnGridCell;
    457   if cboAdditive.Visible then
    458     ActiveControl := cboAdditive;
    459461  ControlChange(Sender);
    460462end;
     
    522524    Col := 1;
    523525  end;
     526  Application.ProcessMessages;         //CQ: 10157
    524527  ClickOnGridCell;
    525528  ControlChange(Sender);
     
    550553      Show;
    551554      SetFocus;
     555      if AControl is TComboBox then                    //CQ: 10157
     556        TComboBox(AControl).DroppedDown := True;
    552557    end;
    553558  end;
     
    855860procedure TfrmODMedIV.txtXDurationExit(Sender: TObject);
    856861var
     862  Len: Integer;
    857863  Code: double;
     864  Digits, Warning: string;
    858865begin
    859866  inherited;
    860867  if Changing then Exit;
     868  //AGP Change 26.15 HIN-1203-42283 Added additional check to make sure the user can only enter the correct duration
     869  Len := Length(txtXDuration.Text);
     870  if (Len > 0) and (Pos('.', txtXDuration.Text)=0) then
     871    begin
     872      Warning := '0';
     873      Digits := '2';
     874      if ((btnXDuration.Caption = 'days') or (btnXDuration.Caption = 'hours') or (btnXDuration.Caption = 'L')) and (Len > 2) then  Warning := '1';
     875      if (btnXDuration.Caption = 'ml') and (Len > 4) then  Warning := '1';
     876      if Warning = '1' then
     877          begin
     878             if btnXduration.Caption = 'ml' then Digits := '4';
     879             ShowMessage('Invalid Value.' + #13#10 + 'Reason: Duration for ' + btnXDuration.Caption + ' cannot be greater than ' + digits + ' digits.');
     880             txtXDuration.Text := '';
     881             txtXDuration.SetFocus;
     882             Exit;
     883          end;
     884      end;
    861885  if (Pos('.', txtXDuration.Text)>0) and
    862886     ((btnXduration.Caption = 'days') or (btnXduration.Caption = 'hours')) then
     
    897921end;
    898922
     923procedure TfrmODMedIV.txtRateExit(Sender: TObject);
     924var
     925ErrorText, LDec,RDec: string;
     926i: Integer;
     927Result: boolean;
     928begin
     929  inherited;
     930  //AGP Change 26.28 for CQ # 7598 add infusion rate check for valid value
     931  ErrorText := 'The Infusion Rate must be in one of the following formats:' + CRLF + CRLF + 'nnnn.nn ml/hr or text@per labels per day';
     932  Result := False;
     933  if pos('@',Self.txtRate.Text)>0 then exit;
     934  if pos('.',Self.txtRate.Text)>0 then
     935      begin
     936         LDec := Piece(Self.txtRate.Text,'.',1);
     937         RDec := Piece(Self.txtRate.Text,'.',2);
     938         if Length(LDec)>4 then Result := True;
     939         if Length(RDec)>2 then Result := True;
     940      end
     941  else if Length(Self.txtRate.Text)>4 then Result := True;
     942  if (Result = False) and (pos('.',Self.txtRate.Text)=0) then
     943    begin
     944    for i := 1 to Length(Self.txtRate.Text) do if not (Self.txtRate.Text[i] in ['0'..'9']) then Result := True
     945    end;
     946  if Result = True then
     947    begin
     948       InfoBox(ErrorText,'Warning - Invalid Infusion Rate', MB_OK);
     949       Self.txtRate.Text := '';
     950       Self.txtRate.SetFocus;
     951    end;
     952end;
     953
    899954end.
Note: See TracChangeset for help on using the changeset viewer.