Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedIV.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedIV.pas
r459 r460 9 9 type 10 10 TfrmODMedIV = class(TfrmODBase) 11 tabFluid: TTabControl;12 cboSolution: TORComboBox;13 11 lblInfusionRate: TLabel; 14 12 txtRate: TCaptionEdit; 15 lblPriority: TLabel;16 cboPriority: TORComboBox;17 13 lblComponent: TLabel; 18 14 lblAmount: TLabel; … … 21 17 lblComments: TLabel; 22 18 memComments: TCaptionMemo; 23 cboAdditive: TORComboBox;24 19 txtSelected: TCaptionEdit; 25 20 cboSelected: TCaptionComboBox; 26 Label1: TStaticText;27 21 popDuration: TPopupMenu; 28 22 popML: TMenuItem; … … 33 27 txtXDuration: TCaptionEdit; 34 28 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; 36 36 procedure FormCreate(Sender: TObject); 37 37 procedure tabFluidChange(Sender: TObject); … … 64 64 procedure pnlXDurationEnter(Sender: TObject); 65 65 procedure txtXDurationExit(Sender: TObject); 66 procedure txtRateExit(Sender: TObject); 66 67 private 67 68 FInpatient: Boolean; … … 84 85 {$R *.DFM} 85 86 86 uses ORFn, uConst, rODMeds, rODBase, uAccessibleStringGrid ;87 uses ORFn, uConst, rODMeds, rODBase, uAccessibleStringGrid, fFrame; 87 88 88 89 const … … 129 130 Restriction: string; 130 131 begin 132 frmFrame.pnlVisit.Enabled := false; 131 133 inherited; 132 134 AllowQuickOrder := True; … … 155 157 with grdSelected do for i := 0 to RowCount - 1 do TIVComponent(Objects[0, i]).Free; 156 158 inherited; 159 frmFrame.pnlVisit.Enabled := True; 157 160 end; 158 161 … … 454 457 end; 455 458 end; 459 Application.ProcessMessages; //CQ: 10157 456 460 ClickOnGridCell; 457 if cboAdditive.Visible then458 ActiveControl := cboAdditive;459 461 ControlChange(Sender); 460 462 end; … … 522 524 Col := 1; 523 525 end; 526 Application.ProcessMessages; //CQ: 10157 524 527 ClickOnGridCell; 525 528 ControlChange(Sender); … … 550 553 Show; 551 554 SetFocus; 555 if AControl is TComboBox then //CQ: 10157 556 TComboBox(AControl).DroppedDown := True; 552 557 end; 553 558 end; … … 855 860 procedure TfrmODMedIV.txtXDurationExit(Sender: TObject); 856 861 var 862 Len: Integer; 857 863 Code: double; 864 Digits, Warning: string; 858 865 begin 859 866 inherited; 860 867 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; 861 885 if (Pos('.', txtXDuration.Text)>0) and 862 886 ((btnXduration.Caption = 'days') or (btnXduration.Caption = 'hours')) then … … 897 921 end; 898 922 923 procedure TfrmODMedIV.txtRateExit(Sender: TObject); 924 var 925 ErrorText, LDec,RDec: string; 926 i: Integer; 927 Result: boolean; 928 begin 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; 952 end; 953 899 954 end.
Note:
See TracChangeset
for help on using the changeset viewer.