Changeset 1693 for cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders
- Timestamp:
- May 8, 2015, 7:52:55 AM (10 years ago)
- Location:
- cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders
- Files:
-
- 1 added
- 57 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOCAccept.dfm
r829 r1693 4 4 BorderIcons = [] 5 5 Caption = 'Order Checking' 6 ClientHeight = 169 7 ClientWidth = 472 6 ClientHeight = 186 7 ClientWidth = 622 8 Constraints.MinHeight = 200 9 Constraints.MinWidth = 600 8 10 Position = poScreenCenter 9 ExplicitLeft = 305 10 ExplicitTop = 257 11 ExplicitWidth = 480 12 ExplicitHeight = 203 11 ExplicitWidth = 630 12 ExplicitHeight = 220 13 13 PixelsPerInch = 96 14 14 TextHeight = 13 … … 16 16 Left = 0 17 17 Top = 0 18 Width = 47219 Height = 1 3618 Width = 622 19 Height = 153 20 20 Align = alClient 21 Font.Charset = DEFAULT_CHARSET 22 Font.Color = clWindowText 23 Font.Height = -11 24 Font.Name = 'Courier New' 25 Font.Style = [] 26 ParentFont = False 21 27 ReadOnly = True 22 28 ScrollBars = ssVertical … … 26 32 object pnlBottom: TPanel [1] 27 33 Left = 0 28 Top = 1 3629 Width = 47234 Top = 153 35 Width = 622 30 36 Height = 33 31 37 Align = alBottom … … 34 40 object cmdAccept: TButton 35 41 Left = 148 36 Top = 742 Top = 6 37 43 Width = 80 38 44 Height = 21 … … 51 57 ModalResult = 7 52 58 TabOrder = 1 59 OnClick = cmdCancelClick 60 end 61 object Button1: TButton 62 Left = 384 63 Top = 6 64 Width = 145 65 Height = 21 66 Caption = 'Drug Interaction Monograph' 67 Enabled = False 68 TabOrder = 2 69 OnClick = Button1Click 53 70 end 54 71 end … … 69 86 ( 70 87 'Component = frmOCAccept' 88 'Status = stsDefault') 89 ( 90 'Component = Button1' 71 91 'Status = stsDefault')) 72 92 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOCAccept.pas
r829 r1693 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, StdCtrls, ComCtrls, ORFn, ExtCtrls, VA508AccessibilityManager ;7 fAutoSz, StdCtrls, ComCtrls, ORFn, ExtCtrls, VA508AccessibilityManager, rOrders, fOCMonograph; 8 8 9 9 type … … 13 13 cmdAccept: TButton; 14 14 cmdCancel: TButton; 15 Button1: TButton; 16 procedure Button1Click(Sender: TObject); 17 procedure cmdCancelClick(Sender: TObject); 18 procedure FormResize(Sender: TObject); 15 19 private 16 20 { Private declarations } … … 27 31 function AcceptOrderWithChecks(OCList: TStringList): Boolean; 28 32 var 29 i : Integer;33 i,j: Integer; 30 34 frmOCAccept: TfrmOCAccept; 31 begin 35 substring: String; 36 remOC: TStringList; 37 begin 38 remOC := TStringList.Create; 32 39 Result := True; 33 40 if OCList.Count > 0 then … … 36 43 try 37 44 ResizeFormToFont(TForm(frmOCAccept)); 45 frmOCAccept.Button1.Enabled := false; 46 if IsMonograph then frmOCAccept.Button1.Enabled := true; 47 38 48 for i := 0 to OCList.Count - 1 do 39 49 begin 40 frmOCAccept.memChecks.Lines.Add(Piece(OCList[i], U, 4)); 50 substring := Copy(Piece(OCList[i], U, 4),0,2); 51 if substring='||' then 52 begin 53 substring := Copy(Piece(OCList[i], U, 4),3,Length(Piece(OCList[i], U, 4))); 54 GetXtraTxt(remOC,Piece(substring,'&',1),Piece(substring,'&',2)); 55 frmOCAccept.memChecks.Lines.Add('('+inttostr(i+1)+' of '+inttostr(OCList.Count)+') ' + Piece(substring,'&',2)); 56 for j:= 0 to remOC.Count - 1 do frmOCAccept.memChecks.Lines.Add(' '+remOC[j]); 57 frmOCAccept.memChecks.Lines.Add(' '); 58 end 59 else 60 begin 61 frmOCAccept.memChecks.Lines.Add('('+inttostr(i+1)+' of '+inttostr(OCList.Count)+') ' + Piece(OCList[i], U, 4)); 62 end; 63 41 64 frmOCAccept.memChecks.Lines.Add(''); 42 65 end; … … 46 69 finally 47 70 frmOCAccept.Release; 71 remOC.Destroy; 48 72 end; 49 73 end; 50 74 end; 51 75 76 procedure TfrmOCAccept.Button1Click(Sender: TObject); 77 var 78 monoList: TStringList; 79 begin 80 inherited; 81 monoList := TStringList.Create; 82 GetMonographList(monoList); 83 ShowMonographs(monoList); 84 monoList.Free; 85 end; 86 87 procedure TfrmOCAccept.cmdCancelClick(Sender: TObject); 88 begin 89 inherited; 90 DeleteMonograph; 91 end; 92 93 procedure TfrmOCAccept.FormResize(Sender: TObject); 94 begin 95 inherited; 96 memChecks.Refresh; 97 end; 98 52 99 end. -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOCSession.dfm
r829 r1693 2 2 Left = 366 3 3 Top = 222 4 Width = 714 5 Height = 530 6 HorzScrollBar.Visible = True 7 VertScrollBar.Visible = True 8 AutoScroll = True 4 9 BorderIcons = [] 5 10 Caption = 'Order Checks' 6 ClientWidth = 494 11 Constraints.MinHeight = 500 12 Constraints.MinWidth = 500 7 13 Position = poScreenCenter 8 14 ShowHint = True 9 15 OnClose = FormClose 16 OnCreate = FormCreate 17 OnMouseWheelDown = FormMouseWheelDown 10 18 OnShow = FormShow 11 ExplicitWidth = 50212 ExplicitHeight = 24019 ExplicitWidth = 714 20 ExplicitHeight = 530 13 21 PixelsPerInch = 96 14 22 TextHeight = 13 15 object lstChecks: TCaptionListBox[0]23 object pnlBottom: TPanel [0] 16 24 Left = 0 17 Top = 0 18 Width = 494 19 Height = 162 20 Style = lbOwnerDrawVariable 21 Align = alClient 22 ItemHeight = 13 23 MultiSelect = True 24 ParentShowHint = False 25 ShowHint = True 26 TabOrder = 1 27 OnDrawItem = lstChecksDrawItem 28 OnMeasureItem = lstChecksMeasureItem 29 HintOnItem = True 30 end 31 object pnlBottom: TPanel [1] 32 Left = 0 33 Top = 162 34 Width = 494 35 Height = 111 36 Align = alBottom 25 Top = 352 26 Width = 706 27 Height = 146 28 Anchors = [akLeft, akTop, akBottom] 37 29 BevelOuter = bvNone 38 30 TabOrder = 0 39 31 DesignSize = ( 40 49441 1 11)32 706 33 146) 42 34 object lblJustify: TLabel 43 35 Left = 9 44 Top = 3445 Width = 2 4836 Top = 58 37 Width = 234 46 38 Height = 13 47 Anchors = [akLeft, akTop, akRight] 48 Caption = 'Enter justification for overriding critical order checks -' 49 end 50 object txtJustify: TCaptionEdit 51 Left = 8 52 Top = 50 53 Width = 478 54 Height = 21 55 Anchors = [akLeft, akTop, akRight] 56 MaxLength = 80 57 TabOrder = 0 58 OnKeyDown = txtJustifyKeyDown 59 Caption = 'Enter justification for overriding critical order checks -' 60 end 61 object cmdCancelOrder: TButton 62 Left = 356 63 Top = 5 64 Width = 131 65 Height = 21 66 Anchors = [akLeft, akTop, akRight] 67 Caption = 'Cancel Selected Order(s)' 68 TabOrder = 3 69 OnClick = cmdCancelOrderClick 70 end 71 object cmdContinue: TButton 72 Left = 157 73 Top = 82 74 Width = 70 75 Height = 21 76 Caption = 'Continue' 77 TabOrder = 4 78 OnClick = cmdContinueClick 79 end 80 object btnReturn: TButton 81 Left = 241 82 Top = 82 83 Width = 97 84 Height = 21 85 Cancel = True 86 Caption = 'Return to Orders' 87 TabOrder = 5 88 OnClick = btnReturnClick 39 Anchors = [akLeft] 40 Caption = 'Enter reason for overriding order checks:' 41 Font.Charset = DEFAULT_CHARSET 42 Font.Color = clWindowText 43 Font.Height = -11 44 Font.Name = 'MS Sans Serif' 45 Font.Style = [fsBold] 46 ParentFont = False 89 47 end 90 48 object memNote: TMemo 91 Left = 892 Top = 493 Width = 3 2994 Height = 2949 Left = 392 50 Top = 12 51 Width = 306 52 Height = 40 95 53 BorderStyle = bsNone 96 54 Color = clBtnFace 97 55 Lines.Strings = ( 98 'NOTE: The override justification is for tracking purposes and '56 'NOTE: The override reason is for tracking purposes and ' 99 57 'does not change or place new order(s).') 100 58 ReadOnly = True 59 TabOrder = 0 60 OnEnter = memNoteEnter 61 end 62 object txtJustify: TCaptionEdit 63 Left = 8 64 Top = 80 65 Width = 682 66 Height = 21 67 Anchors = [akLeft] 68 AutoSize = False 69 MaxLength = 80 70 TabOrder = 3 71 OnKeyDown = txtJustifyKeyDown 72 Caption = 'Enter justification for overriding critical order checks -' 73 end 74 object cmdCancelOrder: TButton 75 Left = 9 76 Top = 17 77 Width = 168 78 Height = 21 79 Caption = 'Cancel Checked Order(s)' 80 Font.Charset = DEFAULT_CHARSET 81 Font.Color = clWindowText 82 Font.Height = -11 83 Font.Name = 'MS Sans Serif' 84 Font.Style = [fsBold] 85 ParentFont = False 101 86 TabOrder = 1 102 OnEnter = memNoteEnter 87 OnClick = cmdCancelOrderClick 88 end 89 object cmdContinue: TButton 90 Left = 219 91 Top = 112 92 Width = 127 93 Height = 23 94 Anchors = [akLeft, akTop, akRight, akBottom] 95 Caption = 'Accept Order(s)' 96 Font.Charset = DEFAULT_CHARSET 97 Font.Color = clWindowText 98 Font.Height = -11 99 Font.Name = 'MS Sans Serif' 100 Font.Style = [fsBold] 101 ParentFont = False 102 TabOrder = 4 103 OnClick = cmdContinueClick 104 end 105 object btnReturn: TButton 106 Left = 352 107 Top = 112 108 Width = 122 109 Height = 23 110 Anchors = [akLeft, akTop, akRight, akBottom] 111 Cancel = True 112 Caption = 'Return to Orders' 113 Font.Charset = DEFAULT_CHARSET 114 Font.Color = clWindowText 115 Font.Height = -11 116 Font.Name = 'MS Sans Serif' 117 Font.Style = [fsBold] 118 ParentFont = False 119 TabOrder = 5 120 OnClick = btnReturnClick 121 end 122 object cmdMonograph: TButton 123 Left = 536 124 Top = 107 125 Width = 162 126 Height = 21 127 Anchors = [akRight, akBottom] 128 Caption = 'Drug Interaction Monograph' 129 TabOrder = 6 130 OnClick = cmdMonographClick 131 end 132 end 133 object pnlTop: TORAutoPanel [1] 134 Left = 0 135 Top = 0 136 Width = 706 137 Height = 346 138 Align = alTop 139 BevelEdges = [] 140 BevelOuter = bvNone 141 TabOrder = 1 142 DesignSize = ( 143 706 144 346) 145 object lblHover: TLabel 146 Left = 16 147 Top = 32 148 Width = 445 149 Height = 13 150 Caption = 151 'If the order check description is cut short, hover over the text' + 152 ' to view the complete description.' 153 end 154 object grdchecks: TCaptionStringGrid 155 Left = 16 156 Top = 64 157 Width = 682 158 Height = 279 159 Margins.Top = 0 160 Anchors = [akLeft, akBottom] 161 ColCount = 3 162 DefaultDrawing = False 163 FixedColor = clBtnShadow 164 FixedCols = 0 165 RowCount = 2 166 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goRowMoving, goTabs] 167 ScrollBars = ssVertical 168 TabOrder = 1 169 OnDrawCell = grdchecksDrawCell 170 OnEnter = grdchecksEnter 171 OnKeyDown = grdchecksKeyDown 172 OnMouseDown = grdchecksMouseDown 173 OnMouseMove = grdchecksMouseMove 174 OnMouseWheelDown = grdchecksMouseWheelDown 175 OnMouseWheelUp = grdchecksMouseWheelUp 176 OnSelectCell = grdchecksSelectCell 177 JustToTab = True 178 end 179 object lblInstr: TVA508StaticText 180 Name = 'lblInstr' 181 Left = 0 182 Top = 12 183 Width = 641 184 Height = 15 185 Margins.Bottom = 0 186 Alignment = taLeftJustify 187 AutoSize = True 188 Caption = 189 'To cancel an order select the order by checking the checkbox and' + 190 ' press the "Cancel Checked Order(s)" button.' 191 Font.Charset = DEFAULT_CHARSET 192 Font.Color = clWindowText 193 Font.Height = -11 194 Font.Name = 'MS Sans Serif' 195 Font.Style = [fsBold] 196 ParentFont = False 197 TabOrder = 0 198 TabStop = True 199 ShowAccelChar = True 103 200 end 104 201 end … … 106 203 Data = ( 107 204 ( 108 'Component = lstChecks'109 'Status = stsDefault')110 (111 205 'Component = pnlBottom' 112 206 'Status = stsDefault') … … 128 222 ( 129 223 'Component = frmOCSession' 224 'Status = stsDefault') 225 ( 226 'Component = cmdMonograph' 227 'Status = stsDefault') 228 ( 229 'Component = grdchecks' 230 'Status = stsDefault') 231 ( 232 'Component = pnlTop' 130 233 'Status = stsDefault')) 131 234 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOCSession.pas
r829 r1693 4 4 5 5 uses 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, StdCtrls, ORFn, uConst, ORCtrls, ExtCtrls, VA508AccessibilityManager; 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, fOCMonograph, 7 fAutoSz, StdCtrls, ORFn, uConst, ORCtrls, ExtCtrls, VA508AccessibilityManager, 8 Grids, strUtils, uDlgComponents, VAUtils, VA508AccessibilityRouter; 8 9 9 10 type 10 11 TfrmOCSession = class(TfrmAutoSz) 11 lstChecks: TCaptionListBox;12 12 pnlBottom: TPanel; 13 13 lblJustify: TLabel; … … 17 17 btnReturn: TButton; 18 18 memNote: TMemo; 19 cmdMonograph: TButton; 20 grdchecks: TCaptionStringGrid; 21 lblInstr: TVA508StaticText; 22 pnlTop: TORAutoPanel; 23 lblHover: TLabel; 19 24 procedure cmdCancelOrderClick(Sender: TObject); 20 25 procedure cmdContinueClick(Sender: TObject); 21 procedure lstChecksMeasureItem(Control: TWinControl; Index: Integer;22 var Height: Integer);23 procedure lstChecksDrawItem(Control: TWinControl; Index: Integer;24 Rect: TRect; State: TOwnerDrawState);25 26 procedure FormClose(Sender: TObject; var Action: TCloseAction); 26 27 procedure FormShow(Sender: TObject); … … 30 31 procedure btnReturnClick(Sender: TObject); 31 32 procedure memNoteEnter(Sender: TObject); 33 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 34 procedure cmdMonographClick(Sender: TObject); 35 procedure grdchecksDrawCell(Sender: TObject; ACol, ARow: Integer; 36 Rect: TRect; State: TGridDrawState); 37 function CheckBoxRect(poRect: TRect): TRect; 38 function GetCheckState(grid: TStringGrid; ACol, ARow: integer): boolean; 39 function InCheckBox(Grid: TStringGrid; X, Y, ACol, ARow: integer): boolean; 40 procedure SetCheckState(grid: TStringGrid; ACol, ARow: integer; State: boolean); 41 procedure grdchecksMouseDown(Sender: TObject; Button: TMouseButton; 42 Shift: TShiftState; X, Y: Integer); 43 procedure grdchecksSelectCell(Sender: TObject; ACol, ARow: Integer; 44 var CanSelect: Boolean); 45 procedure GridDeleteRow(RowNumber: Integer; Grid: TstringGrid); 46 procedure grdchecksEnter(Sender: TObject); 47 procedure FormCreate(Sender: TObject); 48 procedure grdchecksKeyDown(Sender: TObject; var Key: Word; 49 Shift: TShiftState); 50 procedure grdchecksMouseWheelDown(Sender: TObject; Shift: TShiftState; 51 MousePos: TPoint; var Handled: Boolean); 52 procedure grdchecksMouseWheelUp(Sender: TObject; Shift: TShiftState; 53 MousePos: TPoint; var Handled: Boolean); 54 procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState; 55 MousePos: TPoint; var Handled: Boolean); 56 procedure grdchecksMouseMove(Sender: TObject; Shift: TShiftState; X, 57 Y: Integer); 58 // procedure memNoteSetText(str: string); 32 59 private 33 60 FCritical: Boolean; … … 112 139 function ExecuteSessionOrderChecks(OrderList: TStringList) : Boolean; 113 140 var 114 i, j : Integer;115 LastID, NewID : string;116 CheckList : TStringList;141 i, j, k, l, m, rowcnt: Integer; 142 LastID, NewID, gridtext: string; 143 CheckList,remOC: TStringList; 117 144 OCRec: TOCRec; 118 //AChangeItem: TChangeItem;119 145 frmOCSession: TfrmOCSession; 120 x : string;146 x,substring: string; 121 147 begin 122 148 Result := True; … … 129 155 begin 130 156 frmOCSession := TfrmOCSession.Create(Application); 157 //frmOCSession.grdchecks.RowCount := frmOCSession.grdchecks.RowCount + 1; *) 158 //rowcnt := frmOCSession.grdchecks.RowCount; 159 //if RowCnt > frmOCSession.grdchecks.RowCount then frmOCSession.grdchecks.RowCount := RowCnt; 160 rowcnt := 1; 161 frmOCSession.grdchecks.canvas.Font.Name := 'Courier New'; 162 frmOCSession.grdchecks.Canvas.Font.Size := MainFontSize; 163 frmOCSession.cmdMonograph.Enabled := false; 164 if IsMonograph then frmOCSession.cmdMonograph.Enabled := true; 131 165 try 132 166 ResizeFormToFont(TForm(frmOCSession)); … … 148 182 x := TextForOrder(OCRec.OrderID); 149 183 OCRec.OrderText := x; 184 frmOCSession.grdchecks.Cells[2,rowcnt] := OCRec.OrderID + '^O^0^'; 185 frmOCSession.grdchecks.Cells[1,rowcnt] := OCRec.OrderText; 186 RowCnt := RowCnt + 1; 187 if RowCnt > frmOCSession.grdchecks.RowCount then frmOCSession.grdchecks.RowCount := RowCnt; 188 l := 0; 189 m := 0; 190 for j := 0 to CheckList.Count - 1 do 191 if Piece(CheckList[j], U, 1) = OCRec.OrderID then m := m+1; 192 150 193 for j := 0 to CheckList.Count - 1 do 151 194 if Piece(CheckList[j], U, 1) = OCRec.OrderID then 152 195 begin 153 OCRec.Checks.Add(Pieces(CheckList[j], U, 2, 4)); 154 x := x + CRLF + Piece(CheckList[j], U, 4); 196 l := l+1; 197 gridText := ''; 198 substring := Copy(Piece(CheckList[j], U, 4),0,2); 199 if substring='||' then 200 begin 201 remOC := TStringList.Create; 202 substring := Copy(Piece(CheckList[j], U, 4),3,Length(Piece(CheckList[j], U, 4))); 203 GetXtraTxt(remOC,Piece(substring,'&',1),Piece(substring,'&',2)); 204 for k := 0 to remOC.Count - 1 do 205 begin 206 //add each line to x and OCRec.Checks 207 if k=remOC.Count-1 then 208 begin 209 OCRec.Checks.Add(Pieces(CheckList[j], U, 2, 3)+'^'+' '+RemOC[k]); 210 x := x + CRLF + RemOC[k]; 211 if gridText = '' then gridText := RemOC[k] 212 else gridText := gridText + CRLF + ' ' +RemOC[k]; 213 end 214 else if k=0 then 215 begin 216 OCRec.Checks.Add(Pieces(CheckList[j], U, 2, 3)+'^'+RemOC[k]); 217 x := x + CRLF + '('+inttostr(l)+' of '+inttostr(m)+') ' + RemOC[k]; 218 if gridText = '' then gridText := '('+inttostr(l)+' of '+inttostr(m)+') ' + RemOC[k] 219 else gridText := gridText + CRLF + RemOC[k]; 220 end 221 else 222 begin 223 OCRec.Checks.Add(Pieces(CheckList[j], U, 2, 3)+'^'+' '+RemOC[k]); 224 x := x + CRLF + RemOC[k]; 225 if gridText = '' then gridText := RemOC[k] 226 else gridText := gridText + CRLF + ' ' + RemOC[k]; 227 end; 228 end; 229 x := x + CRLF + ' '; 230 if gridText = '' then gridText := ' ' 231 else gridText := gridText + CRLF + ' '; 232 remOC.free; 233 end 234 else 235 begin 236 OCRec.Checks.Add(Pieces(CheckList[j], U, 2, 4)); 237 x := x + CRLF + '('+inttostr(l)+' of '+inttostr(m)+') ' + Piece(CheckList[j], U, 4); 238 gridText := '('+inttostr(l)+' of '+inttostr(m)+') ' + Piece(CheckList[j], U, 4); 239 end; 240 if (Piece(CheckList[j], U, 3) = '1') then frmOCSession.grdchecks.Cells[1,rowcnt] := '*Order Check requires Reason for Override' + CRLF + gridText 241 else frmOCSession.grdchecks.Cells[1,rowcnt] := gridText; 242 frmOCSession.grdchecks.Cells[2,rowcnt] := OCRec.OrderID + '^I^'+Piece(CheckList[j], U, 3); 243 //frmOCSession.grdchecks.Objects[2, rowcnt] := OCRec; 244 rowcnt := rowcnt +1; 245 if RowCnt > frmOCSession.grdchecks.RowCount then frmOCSession.grdchecks.RowCount := RowCnt; 155 246 end; 156 //AChangeItem := Changes.Locate(CH_ORD, OCRec.OrderID);157 //if AChangeItem <> nil then OCRec.OrderText := AChangeItem.Text;158 frmOCSession.lstChecks.Items.Add(x);159 247 end; {with...for i} 160 248 frmOCSession.FOrderList := OrderList; … … 170 258 frmFrame.SetActiveTab(CT_ORDERS); 171 259 end; 260 if ScreenReaderActive = True then 261 begin 262 frmOCSession.lblInstr.TabStop := true; 263 frmOCSession.memNote.TabStop := true; 264 frmOCSession.memNote.TabOrder := 2; 265 end 266 else 267 begin 268 frmOCSession.lblInstr.TabStop := false; 269 frmOCSession.memNote.TabStop := false; 270 end; 172 271 finally 173 272 with uCheckedOrders do for i := 0 to Count - 1 do TOCRec(Items[i]).Free; … … 178 277 CheckList.Free; 179 278 end; 279 end; 280 281 282 procedure TfrmOCSession.SetCheckState(grid: TStringGrid; ACol, ARow: integer; 283 State: boolean); 284 var 285 temp: string; 286 begin 287 temp := grid.Cells[2, ARow]; 288 if State = True then SetPiece(temp, U, 3, '1') 289 else SetPiece(temp, U, 3, '0'); 290 grid.Cells[2, ARow] := temp; 291 grid.Repaint; 180 292 end; 181 293 … … 195 307 txtJustify.Visible := FCritical; 196 308 memNote.Visible := FCritical; 197 198 end; 199 200 procedure TfrmOCSession.lstChecksMeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); 201 var 202 i, AHt, TotalHt: Integer; 203 x: string; 204 ARect: TRect; 205 OCRec: TOCRec; 206 begin 207 inherited; 208 209 with lstChecks do 210 begin 211 if Index >= uCheckedOrders.Count then Exit; 212 OCRec := TOCRec(uCheckedOrders.Items[Index]); 213 ARect := ItemRect(Index); 214 ARect.Left := ARect.Left + 2; 215 AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect, DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING) + 2; //CQ7178: added DT_EXTERNALLEADING 216 TotalHt := AHt; 217 218 for i := 0 to OCRec.Checks.Count - 1 do 309 end; 310 311 function TfrmOCSession.CheckBoxRect(poRect: TRect): TRect; 312 const ciCheckBoxDim = 20; 313 begin 314 with poRect do begin 315 Result.Top := Top + FontHeightPixel(Font.Handle); 316 Result.Left := Left - (ciCheckBoxDim div 2) + (Right - Left) div 2; 317 Result.Right := Result.Left + ciCheckBoxDim; 318 Result.Bottom := Result.Top + ciCheckBoxDim; 319 end 320 end; 321 322 procedure TfrmOCSession.cmdCancelOrderClick(Sender: TObject); 323 var 324 cnt, i, j, already: Integer; 325 AnOrderID: string; 326 DeleteOrderList, DeleteRowList: TstringList; 327 StillCritical: boolean; 328 begin 329 inherited; 330 DeleteOrderList := TStringList.Create; 331 DeleteRowList := TStringList.Create; 332 for I := 0 to grdChecks.RowCount do 333 if (Piece(grdChecks.Cells[2, i], U, 3) = '1') and (Piece(grdChecks.Cells[2, i], U, 2) = 'O') then 334 begin 335 AnOrderID := Piece(grdChecks.Cells[2, i], U, 1); 336 already := DeleteOrderList.IndexOf(AnOrderID); 337 if (already>=0) or (DeleteCheckedOrder(AnOrderID)) then 219 338 begin 220 ARect := ItemRect(Index); 221 ARect.Left := ARect.Left + 10; 222 x := Piece(OCRec.Checks[i], U, 3); 223 AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING); //CQ7178: added DT_EXTERNALLEADING 224 TotalHt := TotalHt + AHt; 339 for j := FCheckList.Count - 1 downto 0 do 340 if Piece(FCheckList[j], U, 1) = AnOrderID then FCheckList.Delete(j); 341 DeleteOrderList.Add(AnOrderId); 342 for j := FOrderList.Count - 1 downto 0 do 343 if Piece(FOrderList[j], U, 1) = AnOrderID then FOrderList.Delete(j); 344 for j := uCheckedOrders.Count - 1 downto 0 do 345 if TOCRec(uCheckedOrders.Items[j]).OrderID = AnOrderId then 346 225 347 end; 226 end; 227 Height := TotalHt + 2; // add 2 for focus rectangle 228 if Height > 255 then Height := 255; //CQ7178 229 end; 230 231 procedure TfrmOCSession.lstChecksDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); 232 var 233 i, AHt: Integer; 234 x: string; 235 ARect: TRect; 236 OCRec: TOCRec; 237 begin 238 inherited; 239 240 with lstChecks do 241 begin 242 if Index >= uCheckedOrders.Count then Exit; 243 OCRec := TOCRec(uCheckedOrders.Items[Index]); 244 ARect := ItemRect(Index); 245 AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING) + 2; //CQ7178: added DT_EXTERNALLEADING 246 ARect.Left := ARect.Left + 10; 247 ARect.Top := ARect.Top + AHt; 248 for i := 0 to OCRec.Checks.Count - 1 do 348 end; 349 if DeleteOrderList.Count = 0 then 350 begin 351 infoBox('No orders are marked to cancel. Check the Cancel box by the orders to cancel. ', 'Error', MB_OK); 352 end; 353 354 for i := 0 to DeleteOrderList.Count - 1 do 355 begin 356 AnOrderId := DeleteORderList.Strings[i]; 357 for j := 0 to grdChecks.RowCount do 358 if Piece(grdChecks.Cells[2, j], u, 1) = AnOrderId then 359 begin 360 //grdChecks.Rows[j].Clear; 361 DeleteRowList.Add(InttoStr(j)); 362 end; 363 end; 364 if (grdChecks.RowCount - 1) = DeleteRowList.Count then Close; 365 cnt := 0; 366 for i := 0 to DeleteRowList.Count - 1 do 367 begin 368 GridDeleteRow(((StrtoInt(DeleteRowList.Strings[i])) - cnt), grdChecks); 369 cnt := cnt +1; 370 end; 371 //check if the remaining order checks are not high level and thus don't require justification 372 if FCritical then 373 begin 374 StillCritical := false; 375 for I := 0 to grdChecks.RowCount do 376 begin 377 if ((Piece(grdChecks.cells[2,I],U,3) = '1') and not(Piece(grdChecks.Cells[2, i], U, 2) = 'O')) then 249 378 begin 250 x := Piece(OCRec.Checks[i], U, 3); 251 if not (odSelected in State) then 252 begin 253 if (Piece(OCRec.Checks[i], U, 2) = '1') then 254 begin 255 Canvas.Font.Color := Get508CompliantColor(clBlue); 256 Canvas.Font.Style := [fsUnderline]; 257 end 258 else Canvas.Font.Color := clWindowText; 259 end; 260 AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING); //CQ7178: added DT_EXTERNALLEADING 261 ARect.Top := ARect.Top + AHt; 262 end; 263 end; 264 265 end; 266 267 procedure TfrmOCSession.cmdCancelOrderClick(Sender: TObject); 268 var 269 i, j: Integer; 270 AnOrderID: string; 271 OCRec: TOCRec; 272 begin 273 inherited; 274 for i := lstChecks.Items.Count - 1 downto 0 do if lstChecks.Selected[i] then 275 begin 276 OCRec := TOCRec(uCheckedOrders.Items[i]); 277 AnOrderID := OCRec.OrderID; 278 if DeleteCheckedOrder(AnOrderID) then 279 begin 280 for j := FCheckList.Count - 1 downto 0 do 281 if Piece(FCheckList[j], U, 1) = AnOrderID then FCheckList.Delete(j); 282 for j := FOrderList.Count - 1 downto 0 do 283 if Piece(FOrderList[j], U, 1) = AnOrderID then FOrderList.Delete(j); 284 OCRec.Free; 285 uCheckedOrders.Delete(i); 286 lstChecks.Items.Delete(i); 379 StillCritical := true; 380 break; 381 end; 382 end; 383 if StillCritical = false then 384 begin 385 FCritical := false; 386 lblJustify.Visible := FCritical; 387 txtJustify.Visible := FCritical; 388 memNote.Visible := FCritical; 389 end; 287 390 end; 288 end; 289 if uCheckedOrders.Count = 0 then Close; 391 grdChecks.Repaint; 290 392 end; 291 393 292 394 procedure TfrmOCSession.cmdContinueClick(Sender: TObject); 293 begin 294 inherited; 395 var 396 i: integer; 397 Cancel: boolean; 398 begin 399 inherited; 400 Cancel := False; 295 401 if FCritical and ((Length(txtJustify.Text) < 2) or not ContainsVisibleChar(txtJustify.Text)) then 296 402 begin … … 299 405 Exit; 300 406 end; 407 408 if FCritical and (ContainsUpCarretChar(txtJustify.Text)) then 409 begin 410 InfoBox('The justification may not contain the ^ character.', 411 'Justification Required', MB_OK); 412 Exit; 413 end; 414 415 for i := 0 to grdChecks.RowCount do 416 if (Piece(grdChecks.Cells[2, i], U, 3) = '1') and (Piece(grdChecks.Cells[2, i], U, 2) = 'O') then 417 begin 418 Cancel := True; 419 Break; 420 end; 421 if Cancel = True then 422 begin 423 InfoBox('One or more orders have been marked to cancel!' + CRLF + CRLF + 424 'To cancel these orders, click the "Cancel Checked Order(s)" button.' + CRLF + CRLF + 425 'To place these orders, uncheck the Cancel box beside the order you wish to keep and then click the "Accept Order(s)" button again.', 426 'Error', MB_OK); 427 Exit; 428 end; 429 301 430 StatusText('Saving Order Checks...'); 302 431 SaveOrderChecksForSession(txtJustify.Text, FCheckList); … … 305 434 end; 306 435 436 procedure TfrmOCSession.cmdMonographClick(Sender: TObject); 437 var 438 monoList: TStringList; 439 begin 440 inherited; 441 monoList := TStringList.Create; 442 GetMonographList(monoList); 443 ShowMonographs(monoList); 444 monoList.Free; 445 end; 446 447 307 448 procedure TfrmOCSession.FormClose(Sender: TObject; 308 449 var Action: TCloseAction); … … 310 451 inherited; 311 452 SaveUserBounds(Self); //Save Position & Size of Form 453 DeleteMonograph; 454 end; 455 456 procedure TfrmOCSession.FormCreate(Sender: TObject); 457 begin 458 inherited; 459 grdChecks.Cells[0, 0] := 'Cancel'; 460 grdChecks.Cells[1, 0] := 'Order/Order Check Text'; 461 //cmdMonograph.Font.Size := MainFontSize; 462 //cmdMonograph.Width := TextWidthByFont(cmdMonograph.Font.Handle, cmdMonograph.Caption); 312 463 end; 313 464 314 465 procedure TfrmOCSession.FormShow(Sender: TObject); 466 315 467 begin 316 468 inherited; 317 469 SetFormPosition(Self); //Get Saved Position & Size of Form 318 470 FCancelSignProcess := False; 319 end; 320 471 if ScreenReaderActive = True then lblInstr.SetFocus 472 else 473 begin 474 lblInstr.TabStop := false; 475 grdChecks.SetFocus; 476 end; 477 self.lblInstr.Font.Size := mainFontSize + 1; 478 //self.lblJustify.Height := self.lblJustify.Height + 20; 479 (*if self.lblJustify.Visible = true then 480 begin 481 self.lblJustify.top := self.txtJustify.Top + self.lblJustify.Height + 50; 482 end; *) 483 484 //if mainFontSize < 12 then inc := 90 485 //else if mainFontSize < 18 then inc := 130 486 //else inc := 155; 487 //self.constraints.MinWidth := self.lblInstr.Left + TextWidthByFont(self.lblInstr.Font.Handle, self.lblInstr.Caption) + inc; 488 end; 489 490 procedure TfrmOCSession.grdchecksDrawCell(Sender: TObject; ACol, ARow: Integer; 491 Rect: TRect; State: TGridDrawState); 492 var 493 Wrap: boolean; 494 format, str, cdl, temp, colorText: string; 495 IsBelowOrder, isSelected: boolean; 496 chkRect, DrawRect, colorRect: TRect; 497 ChkState: Cardinal; 498 begin 499 inherited; 500 temp := grdChecks.Cells[2, ARow]; 501 format := Piece(grdChecks.Cells[2, ARow], U, 2); 502 cdl := Piece(grdChecks.Cells[2, ARow], U, 3); 503 colorText := '*Order Check requires Reason for Override'; 504 grdChecks.Canvas.Brush.Color := Get508CompliantColor(clWhite); 505 grdChecks.Canvas.Font.Color := Get508CompliantColor(clBlack); 506 grdChecks.Canvas.Font.Style := []; 507 isSelected := false; 508 509 if ARow = 0 then 510 begin 511 grdChecks.Canvas.Brush.Color := Get508CompliantColor(clbtnFace); 512 grdChecks.Canvas.Font.Style := [fsBold]; 513 end; 514 515 //change commented out code to handle different font color this code may not be needed anymore 516 if (format = '') and (ARow > 0) then 517 grdchecks.Canvas.Font.Color := Get508CompliantColor(clBlue) 518 else 519 grdChecks.Canvas.Font.Color := Get508CompliantColor(clBlack); 520 if cdl = '1' then grdChecks.Canvas.Font.Color := Get508CompliantColor(clBlue); 521 522 //controls highlighting cell when focused in on the cell 523 if State = [gdSelected..gdFocused] then 524 begin 525 isSelected := true; //use to control colors for high order checks 526 grdChecks.Canvas.Font.Color := Get508CompliantColor(clWhite); 527 grdChecks.Canvas.Brush.Color := clHighlight; 528 grdChecks.Canvas.Font.Color := clHighlightText; 529 grdChecks.Canvas.Font.Style := [fsBold]; 530 grdChecks.Canvas.MoveTo(Rect.Left,Rect.top); 531 end 532 //if not an order than blanked out lines seperating the order check 533 else if (format = 'I') then 534 begin 535 if (Arow < grdChecks.RowCount) and (Piece(grdChecks.Cells[2, Arow + 1], U, 2) = 'O') then IsBelowOrder := True 536 else IsBelowOrder := False; 537 grdChecks.Canvas.MoveTo(Rect.Left,Rect.Bottom); 538 grdChecks.Canvas.Pen.Color := Get508CompliantColor(clwhite); 539 grdChecks.Canvas.LineTo(Rect.Left, Rect.Top); 540 grdChecks.Canvas.LineTo(Rect.Right, Rect.Top); 541 grdChecks.Canvas.LineTo(Rect.Right, Rect.Bottom); 542 if (isBelowOrder = False) or (ARow = (grdChecks.RowCount -1)) then grdChecks.Canvas.LineTo(Rect.left, Rect.Bottom); 543 end; 544 Str:= grdChecks.Cells[ACol, ARow]; 545 //determine if the cell needs to wrap 546 if ACol = 1 then Wrap := true 547 else wrap := false; 548 //Blank out existing Cell to prevent overlap after resize 549 grdChecks.Canvas.FillRect(Rect); 550 //get existing cell 551 DrawRect:= Rect; 552 if (ACol = 0) and (format = 'O') and (ARow > 0) then 553 begin 554 if Piece(grdChecks.Cells[2, ARow], U, 4) = '' then 555 begin 556 DrawRect.Bottom := DrawRect.Bottom + FontHeightPixel(Font.Handle) + 5; 557 setPiece(temp, U, 4, 'R'); 558 grdChecks.Cells[2, ARow] := temp; 559 end; 560 if GetCheckState(grdChecks, ACol, ARow) = True then chkState := DFCS_CHECKED 561 else chkState := DFCS_BUTTONCHECK; 562 chkRect := CheckBoxRect(DrawRect); 563 DrawFrameControl(grdChecks.Canvas.Handle, chkRect, DFC_BUTTON, chkState); 564 DrawText(grdChecks.Canvas.Handle, PChar('Cancel?'), length('Cancel?'), DrawRect, DT_SINGLELINE or DT_Top or DT_Center); 565 if ((DrawRect.Bottom - DrawRect.Top) > grdChecks.RowHeights[ARow]) or 566 ((DrawRect.Bottom - DrawRect.Top) < grdChecks.RowHeights[ARow]) then 567 begin 568 grdChecks.RowHeights[ARow]:= (DrawRect.Bottom - DrawRect.Top); 569 end; 570 end; 571 //If order check than indent the order check text 572 if (ACol = 1) and (format = 'I') then DrawRect.Left := DrawRect.Left + 10; 573 //colorRect use to create Rect for Order Check Label 574 colorRect := DrawRect; 575 if Wrap then 576 begin 577 if (cdl = '1') and (format = 'I') then 578 begin 579 if isSelected = false then 580 begin 581 grdChecks.Canvas.Font.Color := Get508CompliantColor(clRed); 582 grdChecks.Canvas.Font.Style := [fsBold]; 583 end; 584 //determine rect size for order check label 585 DrawText(grdChecks.Canvas.Handle, PChar(colorText), length(colorText), colorRect, dt_calcrect or dt_wordbreak); 586 DrawRect.Top := ColorRect.Bottom; 587 //determine rect size for order check text 588 DrawText(grdChecks.Canvas.Handle, PChar(str), length(str), DrawRect, dt_calcrect or dt_wordbreak); 589 str := copy(str, length(colorText + CRLF) + 1, length(str)); 590 if isSelected = false then 591 begin 592 grdChecks.Canvas.Font.Color := Get508CompliantColor(clblue); 593 grdChecks.Canvas.Font.Style := []; 594 end; 595 end 596 //determine size for non-high order check text 597 else DrawText(grdChecks.Canvas.Handle, PChar(str), length(str), DrawRect, dt_calcrect or dt_wordbreak); 598 DrawRect.Bottom := DrawRect.Bottom + 2; 599 //Resize the Cell height if the height does not match the Rect Height 600 if ((DrawRect.Bottom - DrawRect.Top) > grdChecks.RowHeights[ARow]) then 601 begin 602 grdChecks.RowHeights[ARow]:= (DrawRect.Bottom - DrawRect.Top); 603 end 604 else 605 begin 606 //if cell doesn't need to grow reset the cell 607 DrawRect.Right:= Rect.Right; 608 if (cdl = '1') and (format = 'I') then 609 begin 610 //DrawRect.Top := ColorRect.Bottom; 611 if isSelected = false then 612 begin 613 grdChecks.Canvas.Font.Color := Get508CompliantColor(clRed); 614 grdChecks.Canvas.Font.Style := [fsBold]; 615 end; 616 DrawText(grdChecks.Canvas.Handle, PChar(colorText), length(colorText), colorRect, dt_wordbreak); 617 if isSelected = false then 618 begin 619 grdChecks.Canvas.Font.Color := Get508CompliantColor(clBlue); 620 grdChecks.Canvas.Font.Style := []; 621 end; 622 end; 623 DrawText(grdChecks.Canvas.Handle, PChar(Str), length(Str), DrawRect, dt_wordbreak); 624 //reset height 625 if format = 'I' then grdChecks.RowHeights[ARow]:= (DrawRect.Bottom - DrawRect.Top); 626 end; 627 end 628 else 629 //if not wrap than grow just draw the cell 630 DrawText(grdChecks.Canvas.Handle, PChar(Str), length(Str), DrawRect, dt_wordbreak); 631 end; 632 633 procedure TfrmOCSession.grdchecksEnter(Sender: TObject); 634 begin 635 inherited; 636 if ScreenReaderActive then 637 begin 638 grdChecks.Row := 1; 639 grdChecks.Col := 0; 640 GetScreenReader.Speak('Navigate through the grid to reviews the orders and the order checks'); 641 if GetCheckState(grdchecks, 0, 1) = true then 642 GetScreenReader.Speak('Cancel checkbox is checked press spacebar to uncheck it') 643 else GetScreenReader.Speak('Cancel checkbox Not Checked press spacebar to check it to cancel the ' + grdChecks.Cells[1,1] + ' Order'); 644 end; 645 grdChecks.Row := 1; 646 grdChecks.Col := 0; 647 end; 648 649 procedure TfrmOCSession.grdchecksKeyDown(Sender: TObject; var Key: Word; 650 Shift: TShiftState); 651 begin 652 inherited; 653 if key = VK_TAB then 654 begin 655 if ssCtrl in Shift then 656 begin 657 if txtJustify.Visible = TRUE then ActiveControl := txtJustify 658 else ActiveControl := cmdContinue; 659 Key := 0; 660 Exit; 661 end; 662 end; 663 if grdchecks.Col = 0 then 664 begin 665 Case Key of 666 VK_Tab: 667 begin 668 if (ssShift in Shift) and (grdChecks.Row > 1) then 669 begin 670 grdChecks.Col := 1; 671 grdChecks.Row := grdChecks.Row - 1; 672 end; 673 end; 674 VK_Space: 675 begin 676 if Piece(grdChecks.Cells[2, grdChecks.Row], U, 2) = 'O' then 677 begin 678 if GetCheckState(grdChecks, 2, grdChecks.Row) = True then 679 SetCheckState(grdChecks, 2, grdChecks.Row, False) 680 else SetCheckState(grdChecks, 2, grdChecks.Row, True); 681 if ScreenReaderActive then 682 begin 683 if GetCheckState(grdchecks, 0, grdChecks.Row) = true then 684 GetScreenReader.Speak('Cancel checkbox checked') 685 else GetScreenReader.Speak('Cancel checkbox unChecked'); 686 end; 687 end; 688 end; 689 (* VK_Down: 690 begin 691 if (grdChecks.Row < grdChecks.RowCount) and (Piece(grdChecks.Cells[2, grdChecks.Row + 1], U, 2) <> 'O') then 692 begin 693 for I := grdChecks.Row + 1 to grdChecks.RowCount do 694 begin 695 if (Piece(grdChecks.Cells[2, i], U, 2) <> 'O') or (grdChecks.Cells[2, i] = '') then continue 696 else 697 begin 698 grdChecks.Row := i; 699 exit; 700 end; 701 702 end; 703 end; 704 end; 705 VK_Up: 706 Begin 707 if ((grdChecks.Row - 1) > 1) and (Piece(grdChecks.Cells[2, grdChecks.Row - 1], U, 2) <> 'O') then 708 begin 709 for i := grdChecks.Row - 1 downto 0 do 710 begin 711 if (Piece(grdChecks.Cells[2, i], U, 2) <> 'O') or (grdChecks.Cells[2, i] = '') then continue 712 else 713 begin 714 grdChecks.Row := i; 715 exit; 716 end; 717 end; 718 end; 719 End; *) 720 End; 721 end; 722 if grdChecks.Col = 1 then 723 begin 724 // needed to add control for tab key to handle the blank cells that should not have focus. 725 if key = VK_Tab then 726 begin 727 if ssShift in Shift then 728 begin 729 if Piece(grdChecks.Cells[2, grdChecks.Row], U, 2) = 'O' then grdChecks.Col := 0 730 else if grdChecks.Row > 1 then 731 begin 732 grdChecks.Col := 1; 733 grdChecks.Row := grdChecks.Row - 1; 734 end; 735 end 736 else 737 begin 738 if grdChecks.Row = (grdChecks.RowCount - 1) then 739 begin 740 if ScreenReaderActive = True then ActiveControl := memNote 741 else if txtJustify.Visible = TRUE then ActiveControl := txtJustify 742 else ActiveControl := cmdContinue; 743 Key := 0; 744 end 745 else 746 begin 747 grdChecks.Row := grdChecks.Row + 1; 748 if Piece(grdChecks.Cells[2, grdChecks.Row], U, 2) = 'O' then grdChecks.Col := 0 749 else grdChecks.Col := 2; 750 end; 751 end; 752 Key := 0; 753 end; 754 end; 755 end; 756 757 procedure TfrmOCSession.grdchecksMouseDown(Sender: TObject; 758 Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 759 var 760 Row, Col: integer; 761 begin 762 inherited; 763 grdChecks.MouseToCell(X, Y, Col, Row); 764 if Col <> 0 then exit; 765 if Piece(grdChecks.Cells[2,row], U, 2) <> 'O' then exit; 766 if InCheckBox(grdChecks, X, Y, Col, Row) = false then exit; 767 if GetCheckState(grdChecks, Col, Row) = True then SetCheckState(grdChecks, Col, Row, False) 768 else SetCheckState(grdChecks, Col, Row, True); 769 end; 770 771 772 773 procedure TfrmOCSession.grdchecksMouseMove(Sender: TObject; Shift: TShiftState; 774 X, Y: Integer); 775 var 776 acol , arow: integer; 777 //P : Tpoint; 778 //Rect: TRect; 779 begin 780 //Rect := grdChecks.CellRect(ACol, ARow); 781 //P.X := Rect.Left; 782 //P.Y := Rect.Top; 783 784 grdChecks.MouseToCell(X,y,acol , arow); 785 //check to see if hint should show 786 if ARow > grdChecks.RowCount then Exit; 787 if ACol <> 1 then exit; 788 if grdChecks.RowHeights[Arow] < grdChecks.Height then Exit; 789 790 791 792 grdChecks.Hint := grdChecks.Cells[ACol, ARow]; 793 Application.HintHidePause := 20000; //20 Sec 794 if grdChecks.Hint <> '' then grdCHecks.ShowHint := true; 795 796 //Application.HintColor := clYellow; 797 //Application.ActivateHint(P); 798 799 end; 800 801 procedure TfrmOCSession.grdchecksMouseWheelDown(Sender: TObject; 802 Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); 803 begin 804 inherited; 805 (* if grdChecks.Col = 0 then 806 begin 807 if (grdChecks.Row < grdChecks.RowCount) and (Piece(grdChecks.Cells[2, grdChecks.Row + 1], U, 2) <> 'O') then 808 begin 809 for I := grdChecks.Row + 1 to grdChecks.RowCount do 810 begin 811 if (Piece(grdChecks.Cells[2, i], U, 2) <> 'O') or (grdChecks.Cells[2, i] = '') then continue 812 else 813 begin 814 grdChecks.Row := i; 815 exit; 816 end; 817 end; 818 end; 819 end; *) 820 end; 821 822 procedure TfrmOCSession.grdchecksMouseWheelUp(Sender: TObject; 823 Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); 824 begin 825 inherited; 826 (* if grdChecks.Col = 0 then 827 begin 828 if ((grdChecks.Row - 1) > 1) and (Piece(grdChecks.Cells[2, grdChecks.Row - 1], U, 2) <> 'O') then 829 begin 830 for i := grdChecks.Row - 1 downto 0 do 831 begin 832 if (Piece(grdChecks.Cells[2, i], U, 2) <> 'O') or (grdChecks.Cells[2, i] = '') then continue 833 else 834 begin 835 grdChecks.Row := i; 836 exit; 837 end; 838 end; 839 end; 840 end; *) 841 end; 842 843 procedure TfrmOCSession.grdchecksSelectCell(Sender: TObject; ACol, 844 ARow: Integer; var CanSelect: Boolean); 845 begin 846 inherited; 847 CanSelect := True; 848 if ARow = 0 then CanSelect := false 849 else if (ACol = 2) then CanSelect := False 850 else if (ACol = 1) and (grdChecks.Cells[Acol, Arow] = '') then CanSelect := False; 851 //else if (ACol = 0) and (Piece(grdChecks.cells[2,ARow], U, 2) <> 'O') then CanSelect := false; 852 if (CanSelect = True) and (ACol = 0) and (Piece(grdChecks.cells[2,ARow], U, 2) = 'O') and (ScreenReaderActive) then 853 begin 854 if GetCheckState(grdchecks, ACol, ARow) = true then 855 GetScreenReader.Speak('Cancel checkbox is checked press spacebar to uncheck it') 856 else GetScreenReader.Speak('Cancel checkbox Not Checked press spacebar to check it to cancel the ' + grdChecks.Cells[1,Arow] + ' Order'); 857 end; 858 end; 859 860 procedure TfrmOCSession.GridDeleteRow(RowNumber: Integer; Grid: TstringGrid); 861 var 862 i: Integer; 863 begin 864 Grid.Row := RowNumber; 865 if (Grid.Row = Grid.RowCount - 1) then 866 { On the last row} 867 Grid.RowCount := Grid.RowCount - 1 868 else 869 begin 870 { Not the last row} 871 for i := RowNumber to Grid.RowCount - 1 do 872 Grid.Rows[i] := Grid.Rows[i + 1]; 873 Grid.RowCount := Grid.RowCount - 1; 874 end; 875 end; 876 877 function TfrmOCSession.InCheckBox(Grid: TStringGrid; X, Y, ACol, 878 ARow: integer): boolean; 879 var 880 Rect: TRect; 881 begin 882 Result := False; 883 Rect := CheckBoxRect(grid.CellRect(ACol, ARow)); 884 if Y < Rect.Top then Exit; 885 if Y > Rect.Bottom then Exit; 886 if X < Rect.Left then exit; 887 if X > Rect.Right then exit; 888 Result := True; 889 end; 890 891 function TfrmOCSession.GetCheckState(grid: TStringGrid; ACol, ARow: integer): boolean; 892 begin 893 if Piece(grid.Cells[2, ARow], U, 3) = '1' then Result := True 894 else Result := false; 895 end; 321 896 322 897 procedure TfrmOCSession.FormResize(Sender: TObject); … … 324 899 //TfrmAutoSz has defect must call inherited Resize for the resize to function. 325 900 inherited; 901 grdChecks.ColWidths[0] := round(grdChecks.Width * 0.08); 902 grdChecks.ColWidths[1] := round(grdChecks.Width * 0.88); //Order Text 903 grdChecks.ColWidths[2] := 0; //OrderID^Format^IsCheck 904 grdChecks.tabStops[2] := false; 905 if grdChecks.RowCount > 1 then grdChecks.Refresh; 906 self.pnlBottom.Top := self.pnlTop.Top + self.pnlTop.Height; 326 907 end; 327 908 … … 352 933 end; 353 934 935 936 procedure TfrmOCSession.FormKeyDown(Sender: TObject; var Key: Word; 937 Shift: TShiftState); 938 begin 939 inherited; 940 if (Key = VK_F4) and (ssAlt in Shift) then Key := 0; 941 end; 942 procedure TfrmOCSession.FormMouseWheelDown(Sender: TObject; Shift: TShiftState; 943 MousePos: TPoint; var Handled: Boolean); 944 begin 945 inherited; 946 if self.grdchecks.Focused = false then 947 begin 948 end; 949 end; 950 354 951 end. -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODAuto.pas
r829 r1693 61 61 CheckBoilerplate4Fields(tmp, cptn); 62 62 63 64 if WasTemplateDialogCanceled then AnErrMsg := 'The Auto-Accept Quick Order cannot be saved since the template was cancelled.'; 65 63 66 if tmp <> '' then 64 67 Responses.Update('COMMENT', 1, TX_WPTYPE, tmp) … … 87 90 IdentifyDialog(DialogNames, DialogIEN); 88 91 Responses.Dialog := DialogNames.BaseName; // loads formatting info 92 Responses.DialogDisplayName := DialogNames.Display; 89 93 StatusText(''); 90 94 end; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODBBank.dfm
r829 r1693 2 2 Left = 409 3 3 Top = 244 4 HorzScrollBar.Range = 0 5 VertScrollBar.Range = 0 4 Width = 700 5 Height = 626 6 AutoScroll = True 6 7 Caption = 'Blood Component and Diagnostic Test Order Form' 7 ClientHeight = 600 8 ClientWidth = 709 9 ExplicitWidth = 717 10 ExplicitHeight = 634 8 OnShow = FormShow 9 ExplicitWidth = 700 10 ExplicitHeight = 626 11 11 PixelsPerInch = 96 12 12 TextHeight = 13 13 object pnlComments: TPanel [0] 13 object Splitter1: TSplitter [0] 14 Left = 0 15 Top = 0 16 Width = 692 17 Height = 2 18 Cursor = crVSplit 19 Align = alTop 20 end 21 object pnlComments: TPanel [1] 14 22 Left = 12 15 23 Top = 25 … … 51 59 end 52 60 inherited memOrder: TCaptionMemo 53 Left = 054 Top = 39961 Left = 4 62 Top = 503 55 63 Width = 449 56 64 Height = 59 57 65 Visible = False 58 ExplicitLeft = 059 ExplicitTop = 39966 ExplicitLeft = 4 67 ExplicitTop = 503 60 68 ExplicitWidth = 449 61 69 ExplicitHeight = 59 62 70 end 63 object pgeProduct: TPageControl [ 2]71 object pgeProduct: TPageControl [3] 64 72 Left = 0 65 Top = 066 Width = 70967 Height = 39373 Top = 2 74 Width = 692 75 Height = 497 68 76 ActivePage = TabDiag 69 77 Align = alTop 70 TabOrder = 6 71 TabStop = False 78 TabOrder = 4 72 79 OnChange = pgeProductChange 73 80 object TabInfo: TTabSheet 74 81 Caption = 'Patient Information' 75 82 ImageIndex = 3 83 ExplicitLeft = 0 84 ExplicitTop = 0 85 ExplicitWidth = 0 86 ExplicitHeight = 0 76 87 object edtInfo: TCaptionRichEdit 77 88 Left = 0 78 Top = 879 Width = 55680 Height = 33781 TabStop = False89 Top = 0 90 Width = 684 91 Height = 469 92 Align = alClient 82 93 BevelInner = bvNone 83 94 BevelOuter = bvNone … … 91 102 ScrollBars = ssBoth 92 103 TabOrder = 0 104 WordWrap = False 93 105 Caption = 'Patient Info' 94 106 end … … 98 110 ImageIndex = 2 99 111 object lblReqComment: TOROffsetLabel 100 Left = 298112 Left = 300 101 113 Top = 25 102 114 Width = 108 … … 109 121 object pnlFields: TPanel 110 122 Left = 0 111 Top = 1 63112 Width = 701113 Height = 99123 Top = 145 124 Width = 684 125 Height = 210 114 126 Hint = 'Data entered into these fields apply to the entire order.' 115 127 Align = alTop … … 120 132 TabOrder = 2 121 133 object lblDiagComment: TOROffsetLabel 122 Left = 257123 Top = 35124 Width = 46134 Left = 0 135 Top = 128 136 Width = 62 125 137 Height = 15 126 138 Caption = 'Comment' … … 137 149 end 138 150 object lblUrgency: TLabel 139 Left = 8140 Top = - 2151 Left = 0 152 Top = -1 141 153 Width = 44 142 154 Height = 13 … … 150 162 end 151 163 object lblReason: TLabel 152 Left = 10153 Top = 35154 Width = 9 9164 Left = 0 165 Top = 40 166 Width = 95 155 167 Height = 13 156 Caption = 'Reason for Request *'168 Caption = 'Reason for Request' 157 169 Font.Charset = DEFAULT_CHARSET 158 170 Font.Color = clWindowText … … 163 175 end 164 176 object lblSurgery: TLabel 165 Left = 11 5166 Top = -2177 Left = 117 178 Top = 0 167 179 Width = 36 168 180 Height = 13 … … 171 183 'r.' 172 184 Caption = 'Surgery' 185 Enabled = False 173 186 Font.Charset = DEFAULT_CHARSET 174 187 Font.Color = clWindowText … … 179 192 end 180 193 object lblRequiredField: TLabel 181 Left = 10182 Top = 75194 Left = 398 195 Top = 38 183 196 Width = 122 184 197 Height = 13 185 198 Caption = '* Indicates a required field' 186 199 end 200 object lblTNS: TLabel 201 Left = 270 202 Top = 0 203 Width = 14 204 Height = 13 205 Caption = 'tns' 206 Color = clActiveBorder 207 Font.Charset = DEFAULT_CHARSET 208 Font.Color = clMaroon 209 Font.Height = -11 210 Font.Name = 'MS Sans Serif' 211 Font.Style = [] 212 ParentColor = False 213 ParentFont = False 214 Visible = False 215 end 216 object lblNoBloodReq: TLabel 217 Left = 341 218 Top = 21 219 Width = 176 220 Height = 13 221 Caption = 'No Blood Required for this Procedure' 222 Font.Charset = DEFAULT_CHARSET 223 Font.Color = clMaroon 224 Font.Height = -11 225 Font.Name = 'MS Sans Serif' 226 Font.Style = [] 227 ParentFont = False 228 Visible = False 229 end 187 230 object cboUrgency: TORComboBox 188 Left = 12189 Top = 1 2231 Left = 4 232 Top = 14 190 233 Width = 98 191 234 Height = 21 … … 217 260 end 218 261 object chkConsent: TCheckBox 219 Left = 351220 Top = 10262 Left = 529 263 Top = 92 221 264 Width = 112 222 265 Height = 17 … … 237 280 end 238 281 object cboSurgery: TORComboBox 239 Left = 11 5240 Top = 1 2282 Left = 117 283 Top = 14 241 284 Width = 218 242 285 Height = 21 … … 269 312 end 270 313 object cboReasons: TORComboBox 271 Left = 12272 Top = 5 1273 Width = 239274 Height = 21275 Style = orcs DropDown314 Left = 4 315 Top = 55 316 Width = 525 317 Height = 74 318 Style = orcsSimple 276 319 AutoSelect = True 277 320 Color = clWindow … … 293 336 end 294 337 object memDiagComment: TRichEdit 295 Left = 257296 Top = 51297 Width = 250298 Height = 48338 Left = 4 339 Top = 144 340 Width = 525 341 Height = 60 299 342 TabOrder = 4 300 343 OnChange = memDiagCommentChange … … 304 347 Left = 0 305 348 Top = 35 306 Width = 701307 Height = 1 28349 Width = 684 350 Height = 110 308 351 Align = alTop 309 352 BevelEdges = [] 310 353 BevelOuter = bvNone 311 354 TabOrder = 1 312 object lblTNS: TLabel313 Left = 298314 Top = 109315 Width = 14316 Height = 13317 Caption = 'tns'318 Color = clActiveBorder319 Font.Charset = DEFAULT_CHARSET320 Font.Color = clMaroon321 Font.Height = -11322 Font.Name = 'MS Sans Serif'323 Font.Style = []324 ParentColor = False325 ParentFont = False326 Visible = False327 end328 355 object pnlDiagnosticTests: TGroupBox 329 Left = 2 56356 Left = 266 330 357 Top = 0 331 Width = 2 67358 Width = 256 332 359 Height = 110 333 360 Caption = 'Diagnostic Tests' … … 339 366 ParentFont = False 340 367 TabOrder = 1 368 OnClick = pnlDiagnosticTestsClick 369 OnEnter = pnlDiagnosticTestsEnter 370 OnExit = pnlDiagnosticTestsExit 341 371 object lblCollType: TLabel 342 372 Left = 13 … … 355 385 Left = 12 356 386 Top = 70 357 Width = 10 4387 Width = 100 358 388 Height = 13 359 Caption = 'Collection Date/Time *'360 Font.Charset = DEFAULT_CHARSET 361 Font.Color = clWindowText 362 Font.Height = -11 363 Font.Name = 'MS Sans Serif' 364 Font.Style = [] 365 ParentFont = False 366 end 367 object cmdImmedColl: TSpeedButton368 Left = 1 48369 Top = 8 9389 Caption = 'Collection Date/Time' 390 Font.Charset = DEFAULT_CHARSET 391 Font.Color = clWindowText 392 Font.Height = -11 393 Font.Name = 'MS Sans Serif' 394 Font.Style = [] 395 ParentFont = False 396 end 397 object pnlCollTimeButton: TKeyClickPanel 398 Left = 178 399 Top = 82 370 400 Width = 21 371 Height = 11 372 Font.Charset = DEFAULT_CHARSET 373 Font.Color = clWindowText 374 Font.Height = -16 375 Font.Name = 'MS Sans Serif' 376 Font.Style = [fsBold] 377 Glyph.Data = { 378 D6000000424DD60000000000000076000000280000000C0000000C0000000100 379 0400000000006000000000000000000000001000000010000000000000000000 380 80000080000000808000800000008000800080800000C0C0C000808080000000 381 FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 382 0000333333333333000033333333333300003333333333330000300330033003 383 0000300330033003000033333333333300003333333333330000333333333333 384 0000333333333333000033333333333300003333333333330000} 385 ParentFont = False 386 ParentShowHint = False 387 ShowHint = False 388 OnClick = cmdImmedCollClick 389 end 390 object pnlCollTimeButton: TKeyClickPanel 391 Left = 85 392 Top = 89 393 Width = 20 394 Height = 13 401 Height = 21 395 402 BevelOuter = bvNone 396 403 Caption = 'Select collection time' 397 404 TabOrder = 5 398 405 TabStop = True 406 object cmdImmedColl: TSpeedButton 407 Left = 0 408 Top = 0 409 Width = 21 410 Height = 21 411 Align = alClient 412 Font.Charset = DEFAULT_CHARSET 413 Font.Color = clWindowText 414 Font.Height = -16 415 Font.Name = 'MS Sans Serif' 416 Font.Style = [fsBold] 417 Glyph.Data = { 418 D6000000424DD60000000000000076000000280000000C0000000C0000000100 419 0400000000006000000000000000000000001000000010000000000000000000 420 80000080000000808000800000008000800080800000C0C0C000808080000000 421 FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 422 0000333333333333000033333333333300003333333333330000300330033003 423 0000300330033003000033333333333300003333333333330000333333333333 424 0000333333333333000033333333333300003333333333330000} 425 ParentFont = False 426 ParentShowHint = False 427 ShowHint = False 428 OnClick = cmdImmedCollClick 429 end 430 end 431 object calCollTime: TORDateBox 432 Left = 12 433 Top = 82 434 Width = 165 435 Height = 21 436 Font.Charset = DEFAULT_CHARSET 437 Font.Color = clWindowText 438 Font.Height = -11 439 Font.Name = 'MS Sans Serif' 440 Font.Style = [] 441 ParentFont = False 442 TabOrder = 4 443 OnChange = calCollTimeChange 444 OnEnter = calCollTimeEnter 445 DateOnly = False 446 RequireTime = False 399 447 end 400 448 object cboAvailTest: TORComboBox … … 417 465 ItemTipEnable = True 418 466 ListItemsOnly = False 419 LongList = True467 LongList = False 420 468 LookupPiece = 0 421 469 MaxLength = 0 … … 426 474 TabOrder = 0 427 475 TabStop = True 476 OnClick = cboAvailTestSelect 477 OnEnter = cboAvailTestEnter 428 478 OnExit = cboAvailTestExit 429 OnMouseClick = cboAvailTestSelect430 479 OnNeedData = cboAvailTestNeedData 431 480 CharsNeedMatch = 1 … … 434 483 Left = 12 435 484 Top = 46 436 Width = 1 65485 Width = 197 437 486 Height = 21 438 487 Style = orcsDropDown … … 459 508 TabOrder = 1 460 509 OnChange = cboCollTypeChange 510 OnClick = cboCollTypeClick 511 OnEnter = cboCollTypeEnter 461 512 CharsNeedMatch = 1 462 513 end … … 489 540 TabOrder = 2 490 541 OnChange = cboCollTimeChange 542 OnEnter = cboCollTimeEnter 491 543 CharsNeedMatch = 1 492 end493 object calCollTime: TORDateBox494 Left = 12495 Top = 82496 Width = 165497 Height = 21498 Font.Charset = DEFAULT_CHARSET499 Font.Color = clWindowText500 Font.Height = -11501 Font.Name = 'MS Sans Serif'502 Font.Style = []503 ParentFont = False504 TabOrder = 3505 OnChange = calCollTimeChange506 DateOnly = False507 RequireTime = False508 544 end 509 545 object txtImmedColl: TCaptionEdit … … 514 550 Color = clBtnFace 515 551 ReadOnly = True 516 TabOrder = 4517 Text = 'txtImmedColl'552 TabOrder = 3 553 OnEnter = txtImmedCollEnter 518 554 end 519 555 end … … 521 557 Left = 4 522 558 Top = 0 523 Width = 2 46559 Width = 256 524 560 Height = 110 525 561 Caption = 'Blood Components' 562 Color = clBtnFace 526 563 Font.Charset = DEFAULT_CHARSET 527 564 Font.Color = clWindowText … … 529 566 Font.Name = 'MS Sans Serif' 530 567 Font.Style = [fsBold] 568 ParentColor = False 531 569 ParentFont = False 532 570 TabOrder = 0 571 OnClick = pnlBloodComponentsClick 572 OnEnter = pnlBloodComponentsEnter 573 OnExit = pnlBloodComponentsExit 533 574 object lblQuantity: TLabel 534 575 Left = 198 535 576 Top = 0 536 Width = 43577 Width = 39 537 578 Height = 13 538 Caption = 'Quantity *'579 Caption = 'Quantity' 539 580 Font.Charset = DEFAULT_CHARSET 540 581 Font.Color = clWindowText … … 560 601 Left = 7 561 602 Top = 70 562 Width = 9 6603 Width = 92 563 604 Height = 13 564 Caption = 'Date/Time Wanted *'605 Caption = 'Date/Time Wanted' 565 606 Font.Charset = DEFAULT_CHARSET 566 607 Font.Color = clWindowText … … 598 639 TabOrder = 0 599 640 TabStop = True 600 On Change = cboAvailCompChange641 OnEnter = cboAvailCompEnter 601 642 OnExit = cboAvailCompExit 602 643 OnMouseClick = cboAvailCompSelect … … 623 664 Left = 11 624 665 Top = 46 625 Width = 1 33666 Width = 181 626 667 Height = 21 627 668 Style = orcsDropDown … … 647 688 TabOrder = 2 648 689 OnChange = cboModifiersChange 690 OnEnter = cboModifiersEnter 649 691 CharsNeedMatch = 1 650 692 end … … 652 694 Left = 11 653 695 Top = 82 654 Width = 1 49696 Width = 181 655 697 Height = 21 656 698 Font.Charset = DEFAULT_CHARSET … … 662 704 TabOrder = 3 663 705 OnChange = calWantTimeChange 706 OnEnter = calWantTimeEnter 664 707 DateOnly = False 665 708 RequireTime = False … … 670 713 Left = 0 671 714 Top = 0 672 Width = 701715 Width = 684 673 716 Height = 35 674 717 Align = alTop … … 684 727 Left = 15 685 728 Top = 11 686 Width = 488729 Width = 508 687 730 Height = 21 688 731 Style = orcsDropDown … … 707 750 object pnlSelectedTests: TGroupBox 708 751 Left = 0 709 Top = 262710 Width = 701711 Height = 1 12752 Top = 355 753 Width = 684 754 Height = 109 712 755 Align = alTop 713 756 Caption = 'Selected Components and Tests' … … 722 765 object lvSelectionList: TCaptionListView 723 766 Left = 5 724 Top = 1 2725 Width = 4 17767 Top = 15 768 Width = 430 726 769 Height = 91 727 Color = clBtnFace728 770 Columns = < 729 771 item … … 751 793 Font.Height = -11 752 794 Font.Name = 'MS Sans Serif' 753 Font.Style = [ fsBold]795 Font.Style = [] 754 796 ReadOnly = True 755 797 RowSelect = True … … 762 804 end 763 805 object btnRemove: TButton 764 Left = 4 28806 Left = 450 765 807 Top = 37 766 808 Width = 75 … … 777 819 end 778 820 object btnRemoveAll: TButton 779 Left = 4 28821 Left = 450 780 822 Top = 64 781 823 Width = 75 … … 795 837 object TabResults: TTabSheet 796 838 Caption = 'Lab Results' 839 ExplicitLeft = 0 840 ExplicitTop = 0 841 ExplicitWidth = 0 842 ExplicitHeight = 0 797 843 object edtResults: TCaptionRichEdit 798 Left = -4 799 Top = 57 800 Width = 517 801 Height = 290 844 Left = 0 845 Top = 0 846 Width = 684 847 Height = 469 848 Align = alClient 802 849 Font.Charset = DEFAULT_CHARSET 803 850 Font.Color = clWindowText … … 812 859 inherited cmdAccept: TButton 813 860 Left = 455 814 Top = 399 861 Top = 503 862 Width = 75 815 863 TabOrder = 2 816 864 Visible = False 817 865 ExplicitLeft = 455 818 ExplicitTop = 399 866 ExplicitTop = 503 867 ExplicitWidth = 75 819 868 end 820 869 inherited cmdQuit: TButton 821 870 Left = 455 822 Top = 426871 Top = 541 823 872 Width = 52 824 873 TabOrder = 3 825 874 ExplicitLeft = 455 826 ExplicitTop = 426875 ExplicitTop = 541 827 876 ExplicitWidth = 52 828 877 end 829 878 inherited pnlMessage: TPanel 830 879 Left = 8 831 Top = 409880 Top = 513 832 881 Width = 409 833 882 Height = 49 834 883 TabOrder = 1 835 884 ExplicitLeft = 8 836 ExplicitTop = 409885 ExplicitTop = 513 837 886 ExplicitWidth = 409 838 887 ExplicitHeight = 49 … … 946 995 ( 947 996 'Component = cboReasons' 948 'Text = Applies to entire order' 949 'Status = stsOK') 997 'Status = stsDefault') 950 998 ( 951 999 'Component = memDiagComment' … … 958 1006 'Status = stsDefault') 959 1007 ( 1008 'Component = txtImmedColl' 1009 'Status = stsDefault') 1010 ( 1011 'Component = calCollTime' 1012 'Status = stsDefault') 1013 ( 1014 'Component = pnlCollTimeButton' 1015 'Status = stsDefault') 1016 ( 960 1017 'Component = calWantTime' 961 'Status = stsDefault')962 (963 'Component = calCollTime'964 'Status = stsDefault')965 (966 'Component = txtImmedColl'967 'Status = stsDefault')968 (969 'Component = pnlCollTimeButton'970 1018 'Status = stsDefault')) 971 1019 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODBBank.pas
r829 r1693 57 57 txtImmedColl: TCaptionEdit; 58 58 pnlCollTimeButton: TKeyClickPanel; 59 lblTNS: TLabel; 60 lblNoBloodReq: TLabel; 59 61 cmdImmedColl: TSpeedButton; 60 lblTNS: TLabel;62 Splitter1: TSplitter; 61 63 procedure FormCreate(Sender: TObject); 62 64 procedure cboAvailTestSelect(Sender: TObject); … … 97 99 procedure cboModifiersChange(Sender: TObject); 98 100 procedure lvSelectionListClick(Sender: TObject); 99 procedure cboAvailCompChange(Sender: TObject);100 101 procedure cboCollTimeChange(Sender: TObject); 101 102 procedure memDiagCommentChange(Sender: TObject); 102 103 procedure cboUrgencyExit(Sender: TObject); 104 procedure pnlBloodComponentsEnter(Sender: TObject); 105 procedure pnlDiagnosticTestsEnter(Sender: TObject); 106 procedure pnlDiagnosticTestsExit(Sender: TObject); 107 procedure pnlBloodComponentsExit(Sender: TObject); 108 procedure pnlBloodComponentsClick(Sender: TObject); 109 procedure pnlDiagnosticTestsClick(Sender: TObject); 110 procedure cboCollTypeClick(Sender: TObject); 111 procedure cboAvailTestEnter(Sender: TObject); 112 procedure cboCollTypeEnter(Sender: TObject); 113 procedure txtImmedCollEnter(Sender: TObject); 114 procedure calCollTimeEnter(Sender: TObject); 115 procedure cboCollTimeEnter(Sender: TObject); 116 procedure cboModifiersEnter(Sender: TObject); 117 procedure calWantTimeEnter(Sender: TObject); 118 procedure cboAvailCompEnter(Sender: TObject); 119 procedure FormShow(Sender: TObject); 103 120 protected 104 121 FCmtTypes: TStringList ; … … 244 261 ALabTest: TLabTest; 245 262 UserHasLRLABKey: boolean; 263 uChangingMSBOS: boolean; 246 264 LRFZX : string; //the default collection type (LC,WC,SP,I) 247 265 LRFSAMP : string; //the default sample (ptr) … … 293 311 uSelUrgency := ''; 294 312 uSelSurgery := 0; 313 uChangingMSBOS := false; 295 314 TabResults.Caption := 'Lab Results'; 296 315 edtResults.Lines.Clear; … … 314 333 UserHasLRLABKey := User.HasKey('LRLAB'); 315 334 AllowQuickOrder := True; 335 if GetDiagnosticPanelLocation then 336 begin 337 pnlDiagnosticTests.Left := 0; 338 pnlBloodComponents.Left := (pnlDiagnosticTests.Width + 10); 339 pnlDiagnosticTests.TabOrder := 0; 340 pnlBloodComponents.TabOrder := 1; 341 end 342 else 343 begin 344 pnlBloodComponents.Left := 0; 345 pnlDiagnosticTests.Left := (pnlBloodComponents.Width + 10); 346 pnlBloodComponents.TabOrder := 0; 347 pnlDiagnosticTests.TabOrder := 1; 348 end; 316 349 StatusText('Loading Dialog Definition'); 317 350 FCmtTypes := TStringList.Create; … … 342 375 else 343 376 cboCollType.SelectByID('SP'); 344 SetupCollTimes(cboCollType.ItemID); 345 StatusText('Initializing List of Tests'); 346 FVbecLookup := 'S.VBT'; 347 cboAvailTest.InitLongList(''); //Populates cboAvailTest control based on S.VBT xref 348 end; 377 //SetupCollTimes(cboCollType.ItemID); 378 end; 379 cboAvailTest.Clear; 380 aList.Clear; 381 GetDiagnosticTests(aList); //Get Tests in right order 382 for i := 0 to aList.Count - 1 do 383 cboAvailTest.Items.Add(aList[i]); 349 384 cboAvailComp.Clear; 350 385 aList.Clear; … … 365 400 AList.Clear; 366 401 ExtractUrgencies(uUrgencyList, uVBECList); 367 ExtractTNSOrders(uTNSOrders, uVBECList);402 if not(self.EvtID > 0) then ExtractTNSOrders(uTNSOrders, uVBECList); 368 403 LoadUrgencies(cboUrgency); 369 404 ExtractModifiers(uModifierList, uVBECList); … … 371 406 LoadModifiers(cboModifiers); 372 407 LoadReasons(cboReasons); 373 calWantTime.Text := 'NOW'; //FormatFMDateTime('mmm dd,yyyy@hh:nn',DateTimeToFMDateTime(Now));374 408 pgeProduct.TabIndex := TI_INFO; 375 409 lvSelectionList.Column[0].Width := 240; … … 378 412 DisableComponentControls; 379 413 DisableDiagTestControls; 414 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 380 415 pgeProduct.ActivePageIndex := TI_INFO; 381 416 StatusText(''); … … 425 460 AnInstance, CurAdd: Integer; 426 461 AResponse: TResponse; 427 i, j, k, aTNS, aTNSDays, getTest, TestAdded: integer;428 aStr, aTestYes, aName, aTypeScreen, aSpecimen, a Modifier, sub, sub1, x, aTNSString: string;462 i, j, k, aTNS, getTest, TestAdded, aMSBOSContinue: integer; 463 aStr, aTestYes, aName, aTypeScreen, aSpecimen, aSpecimenUID, aSpecimenReq, aModifier, sub, sub1, x, aTNSString, aUrgText: string; 429 464 ListItem: TListItem; 430 aList : TStringList;465 aList, cList: TStringList; 431 466 aTests: TStringList; 467 xLabTest: TLabTest; 468 aGotTNS : Boolean; 432 469 begin 433 470 inherited; 434 471 aList := TStringList.Create; 472 cList := TStringList.Create; 435 473 aTests:= TStringList.Create; 474 aGotTNS := false; 436 475 try 437 476 FOrderAction := OrderAction; … … 439 478 sub1 := ''; 440 479 aTypeScreen := ''; 441 aSpecimen := '^'; 480 aSpecimen := ''; 481 aSpecimenUID := ''; 482 aSpecimenReq := ''; 442 483 aModifier := ''; 443 484 if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses, ALabTest do 444 485 begin 486 pgeProduct.ActivePageIndex := TI_COMPONENT; 445 487 AnInstance := NextInstance('ORDERABLE', 0); 446 488 while AnInstance > 0 do … … 453 495 begin 454 496 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 455 ALabTest := TLabTest.Create(cboAvailTest.ItemID, Responses); 497 changing := true; 498 cboAvailTestSelect(Self); 499 changing := false; 456 500 end 457 501 else … … 468 512 SetControl(chkConsent, 'YN', AnInstance); 469 513 //DetermineCollectionDefaults(Responses); 470 SetControl(cboCollType, 'COLLECT', AnInstance); 471 SetControl(cboCollTime, 'START', AnInstance); 472 SetupCollTimes(cboCollType.ItemID); 514 SetControl(cboSurgery, 'MISC', AnInstance); 473 515 SetControl(cboUrgency, 'URGENCY', AnInstance); 474 SetControl(cboSurgery, 'MISC', AnInstance); 516 if cboUrgency.ItemIEN = 0 then 517 begin 518 if StrToIntDef(LRFURG, 0) > 0 then 519 cboUrgency.SelectByID(LRFURG) 520 else if (Urgency = 0) and (cboUrgency.Items.Count = 1) then 521 cboUrgency.ItemIndex := 0; 522 end; 475 523 Urgency := cboUrgency.ItemIEN; 476 524 if (Urgency = 0) and (cboUrgency.Items.Count = 1) then … … 487 535 AResponse := Responses.FindResponseByName('COMMENT',i); 488 536 end ; 537 cboUrgencyChange(self); 489 538 end; 490 539 if sub = 't' then with ALabTest do //DIAGNOSTIC TEST … … 494 543 EnableDiagTestControls; 495 544 LRORDERMODE := TORDER_MODE_DIAG; 545 //DetermineCollectionDefaults(Responses); 496 546 aList.Clear; 497 547 aTestYes := '1'; … … 499 549 if aList.Count > 0 then aTypeScreen := aList[0]; 500 550 aList.Clear; 501 with lvSelectionList do502 begin503 ListItem := Items.Add;504 ListItem.Caption := piece(cboAvailTest.Items[cboAvailTest.ItemIndex],'^',2);505 ListItem.SubItems.Add('');506 ListItem.SubItems.Add('');507 ListItem.SubItems.Add('');508 ListItem.SubItems.Add(piece(cboAvailTest.Items[cboAvailTest.ItemIndex],'^',1));509 if piece(cboAvailTest.Items[cboAvailTest.ItemIndex],'^',1) = aTypeScreen then510 begin511 lblTNS.Caption := '';512 lblTNS.Visible := false;513 memMessage.Text := '';514 pnlMessage.Visible := false;515 uGetTnS := 0;516 pnlDiagnosticTests.Caption := 'Diagnostic Tests';517 end;518 end;519 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests520 uSelectedItems.Add(aStr);521 551 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 522 {with cboCollType do if Length(ItemID) > 0 then 523 begin 524 Responses.Update('COLLECT', 1, ItemID, ItemID) ; 525 FLastCollType := ItemID; 526 end; } 527 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 552 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 553 else 554 begin 555 cboUrgency.ItemIndex := 2; 556 for i := 0 to cboUrgency.Items.Count - 1 do 557 begin 558 aUrgText := cboUrgency.Items[i]; 559 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 560 begin 561 cboUrgency.ItemIndex := i; 562 break; 563 end; 564 end; 565 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 566 cboUrgencyChange(self); 567 end; 528 568 if Length(memDiagComment.Text) > 0 then Responses.Update('COMMENT',1,memDiagComment.Text,memDiagComment.Text); 529 569 if Length(cboReasons.Text) > 0 then Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 530 LoadCollType(cboCollType);531 if (cboCollType.ItemID = 'LC') or (cboCollType.ItemID = 'I') then532 if not(ALabTest.LabCanCollect) and OrderForInpatient then533 cboCollType.SelectByID('WC')534 else if not(ALabTest.LabCanCollect) then535 cboCollType.SelectByID('SP');536 SetupCollTimes(cboCollType.ItemID);537 if cboCollType.ItemID = 'LC' then538 begin539 with cboCollTime do540 if Length(ItemID) > 0 then541 begin542 Responses.Update('START', 1, Copy(ItemID, 2, 999), Copy(ItemID, 2, 999));543 FLastLabCollTime := ItemID + U + Text;544 end545 else if Length(Text) > 0 then546 begin547 Responses.Update('START', 1, ValidCollTime(Text), Text) ;548 FLastLabCollTime := ValidCollTime(Text);549 end;550 end551 else552 begin553 with calCollTime do554 if FMDateTime > 0 then555 begin556 Responses.Update('START', 1, ValidCollTime(Text), Text);557 FLastColltime := ValidCollTime(Text);558 end559 else560 begin561 Responses.Update('START', 1, '', '') ;562 FLastCollTime := '';563 end;564 end;565 with cboCollType do if Length(ItemID) > 0 then566 begin567 Responses.Update('COLLECT', 1, ItemID, ItemID) ;568 FLastCollType := ItemID;569 end;570 //if Length(cboCollType.Text) > 0 then Responses.Update('COLLECT',1,cboCollType.ItemID,cboCollType.ItemID);571 570 memOrder.Text := Responses.OrderText; 572 571 Changing := False; … … 625 624 if TestAdded = 1 then 626 625 begin 627 edtResults.Clear;628 626 aTests.Clear; 629 627 GetPatientBloodResults(aTests, Patient.DFN, uTestsForResults); 630 QuickCopy(ATests,edtResults); 631 if edtResults.Lines.Count > 0 then TabResults.Caption := 'Lab Results Available'; //TabResults.ImageIndex := 1; 632 uRaw.Clear; 633 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 628 if aTests.Count > 0 then 629 begin 630 edtResults.Clear; 631 QuickCopy(ATests,edtResults); 632 TabResults.Caption := 'Lab Results Available'; 633 uRaw.Clear; 634 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 635 end; 634 636 end; 635 637 CurAdd := 1; … … 640 642 Inc(CurAdd); 641 643 end; 644 for i := lvSelectionList.Items.Count - 1 downto 0 do 645 begin 646 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 647 begin 648 aGotTNS := true; 649 break; 650 end; 651 end; 652 if (uTNSOrders.Count < 1) and (aGotTNS = false) and (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then //check to see if type and screen is needed CQ 17349 653 begin 654 uGetTnS := 1; 655 end; 656 if aList.Count > 0 then 657 begin 658 aSpecimen := piece(aList[0], '^',1); 659 aSpecimenUID := piece(aList[0], '^',2); 660 end; 661 aList.Clear; 662 ExtractSpecimens(aList, uVBECList); //Get specimen values to pass back to Server 663 for i := 0 to aList.Count - 1 do 664 begin 665 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 666 begin 667 aSpecimenReq := piece(aList[i],'^',2); 668 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 669 aSpecimenUID := ''; 670 break; 671 end; 672 end; 642 673 with lvSelectionList do 643 674 begin … … 657 688 ListItem.SubItems.Add(piece(cboAvailComp.Items[cboAvailComp.ItemIndex],'^',1)); 658 689 end; 659 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests690 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 660 691 uSelectedItems.Add(aStr); 661 692 memOrder.Text := Responses.OrderText; 662 693 Changing := False; 694 if (Length(cboSurgery.Text) > 0) then 695 begin 696 for i := 0 to cboSurgery.Items.Count - 1 do 697 if uppercase(cboSurgery.Text) = uppercase(piece(cboSurgery.Items[i],'^',2)) then 698 begin 699 cboSurgery.ItemIndex := i; 700 Break; 701 end; 702 cboSurgeryChange(self); 703 end; 663 704 end; 664 705 end; … … 669 710 DisableDiagTestControls; 670 711 end; 712 cList.Clear; 713 if (Length(cboSurgery.ItemID) > 0) then 714 begin 715 for j := 0 to uSelectedItems.Count - 1 do 716 begin 717 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 718 if (piece(uSelectedItems[j],'^',1) = '0') and (not(piece(uSelectedItems[j],'^',3)='')) and (StrToInt(piece(uSelectedItems[j],'^',3)) > 0) and (piece(cboSurgery.Items[cboSurgery.ItemIndex],'^',3) = '1') then 719 begin 720 cList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3)); 721 end; 722 xLabTest.Free; 723 end; 724 end; 725 if (uChangingMSBOS = false) and (cList.Count > 0) then 726 begin 727 lblNoBloodReq.Visible := true; 728 with Application do 729 begin 730 NormalizeTopMosts; 731 aMSBOSContinue := 732 MessageBox(PChar('No blood is required for the surgical procedure: ' + cboSurgery.text + 733 '.' + CRLF + 734 'If you still need to order any components, please enter a justification in the Comment box.' 735 + CRLF + CRLF + 'Do you want me to remove ALL the component orders you''ve just entered? '), 736 PChar('No Blood Required'),MB_YESNO); 737 RestoreTopMosts; 738 end; 739 if aMSBOSContinue = 6 then 740 begin 741 tQuantity.Text := ''; 742 for j := uSelectedItems.Count - 1 downto 0 do 743 begin 744 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 745 begin 746 lvSelectionList.Items[j].Delete; 747 uSelectedItems.Delete(j); 748 Responses.Update('ORDERABLE', (j+1) ,'', ''); 749 Responses.Update('MODIFIER', (j+1), '', ''); 750 Responses.Update('QTY', (j+1), '', ''); 751 end; 752 end; 753 cboAvailComp.Text := ''; 754 cboAvailComp.ItemIndex := -1; 755 cboModifiers.Text := ''; 756 cboModifiers.ItemIndex := -1; 757 lblNoBloodReq.Visible := false; 758 //if fODBBank. Active then cboAvailTest.SetFocus; 759 lblTNS.Caption := ''; 760 lblTNS.Visible := false; 761 DisableComponentControls; 762 end; 763 end; 764 for i := 0 to lvSelectionList.Items.Count - 1 do 765 begin 766 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 767 begin 768 uGetTnS := 0; 769 aGotTNS := true; 770 uDfltUrgency := cboUrgency.ItemID; 771 lblTNS.Caption := ''; 772 lblTNS.Visible := false; 773 memMessage.Text := ''; 774 pnlMessage.Visible := false; 775 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 776 if uTNSOrders.Count > 0 then 777 begin 778 for j := 0 to uTNSOrders.Count - 1 do 779 aTNSString := aTNSString + CRLF + uTNSOrders[j]; 780 with Application do 781 begin 782 NormalizeTopMosts; 783 aTNS := 784 MessageBox(PChar(aTNSString + CRLF + CRLF + 785 'Do you wish to cancel this request for Type & Screen?'), 786 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 787 MB_YESNO); 788 RestoreTopMosts; 789 if aTNS = 6 then 790 begin 791 lvSelectionList.ItemIndex := i; 792 lvSelectionListClick(self); 793 btnRemoveClick(self); 794 break; 795 end; 796 end; 797 end; 798 break; 799 end; 800 end; 801 if uSelectedItems.Count < 1 then uGetTNS := 0; 802 803 for i := uSelectedItems.Count - 1 downto 0 do 804 begin 805 if (aGotTNS = false) and not(piece(uSelectedItems[i],'^',1) = '1') and (uTNSOrders.Count < 1) and (piece(uSelectedItems[i],'^',5) = '1') then //CQ 17349 806 begin 807 uGetTnS := 1; 808 break; 809 end; 810 end; 811 671 812 CurAdd := 1; 672 813 for i := 0 to uSelectedItems.Count - 1 do … … 689 830 else 690 831 begin 691 cboUrgency.ItemIndex := 1; 832 cboUrgency.ItemIndex := 2; 833 for j := 0 to cboUrgency.Items.Count - 1 do 834 begin 835 aUrgText := cboUrgency.Items[j]; 836 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 837 begin 838 cboUrgency.ItemIndex := j; 839 break; 840 end; 841 end; 692 842 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 693 843 cboUrgencyChange(self); … … 696 846 Inc(CurAdd); 697 847 end; 698 for i := 0 to lvSelectionList.Items.Count - 1 do 699 begin 700 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 701 begin 702 if uTNSOrders.Count > 0 then 703 begin 704 for j := 0 to uTNSOrders.Count - 1 do 705 aTNSString := aTNSString + CRLF + uTNSOrders[j]; 706 with Application do 707 begin 708 NormalizeTopMosts; 709 aTNSDays := TNSDaysBack; 710 aTNS := 711 MessageBox(PChar(aTNSString + CRLF + CRLF + 712 'Do you wish to continue with this request for Type & Screen?'), 713 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 714 MB_YESNO); 715 RestoreTopMosts; 716 if aTNS = 7 then 717 begin 718 lvSelectionList.ItemIndex := i; 719 lvSelectionListClick(self); 720 btnRemoveClick(self); 721 break; 722 end; 723 end; 724 end; 725 break; 726 end; 727 end; 728 {if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses, ALabTest do 729 begin 730 if OrderAction in [ORDER_QUICK, ORDER_EDIT] then uQuickInProcess := 1; 731 AnInstance := NextInstance('ORDERABLE', 0); 732 while AnInstance > 0 do 733 begin 734 AResponse := FindResponseByName('ORDERABLE', AnInstance); 735 if AResponse <> nil then 736 begin 737 sub := GetSubtype(AResponse.EValue); 738 if sub = 't' then 739 begin 740 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 741 ALabTest := TLabTest.Create(cboAvailTest.ItemID, Responses); 742 end 743 else 744 begin 745 SetControl(cboAvailComp, 'ORDERABLE', AnInstance); 746 ALabTest := TLabTest.Create(cboAvailComp.ItemID, Responses); 747 end; 748 //SetControl(cboTests, 'ORDERABLE', AnInstance); 749 //ALabTest := TLabTest.Create(cboTests.ItemID, Responses); 750 if ALabTest = nil then Exit; // Causes access violation 751 //sub := GetSubtype(ALabTest.TestName); 752 if AnInstance = 1 then 753 begin 754 DetermineCollectionDefaults(Responses); 755 SetControl(cboReasons, 'REASON', AnInstance); 756 SetControl(chkConsent, 'YN', AnInstance); 757 SetControl(cboSurgery, 'MISC', AnInstance); 758 //SetControl(cboCollType, 'COLLECT', AnInstance); 759 //SetControl(cboCollTime, 'START', AnInstance); 760 SetControl(calWantTime, 'DATETIME', AnInstance); 761 //LoadUrgency(cboCollType.ItemID, cboUrgency); 762 SetControl(cboUrgency, 'URGENCY', AnInstance); 763 Urgency := cboUrgency.ItemIEN; 764 if (Urgency = 0) and (cboUrgency.Items.Count = AnInstance) then 765 begin 766 cboUrgency.ItemIndex := 0; 767 Urgency := cboUrgency.ItemIEN; 768 end; 769 i := 1 ; 770 AResponse := Responses.FindResponseByName('COMMENT',i); 771 while AResponse <> nil do 772 begin 773 if Length(AResponse.Evalue) > 0 then 774 Comment.Add(AResponse.EValue); 775 Inc(i); 776 AResponse := Responses.FindResponseByName('COMMENT',i); 777 end ; 778 end; 779 if sub = 't' then with ALabTest do //DIAGNOSTIC TEST 780 begin 781 Changing := True; 782 DisableComponentControls; 783 EnableDiagTestControls; 784 LRORDERMODE := TORDER_MODE_DIAG; 785 with Responses do 786 begin 787 StatusText('Initializing Order'); 788 AResponse := FindResponseByName('ORDERABLE', AnInstance); 789 if AResponse <> nil then 790 sub1 := GetSubtype(AResponse.EValue); 791 if sub1 = 't' then 792 begin 793 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 794 //SetControl(cboTests, 'ORDERABLE', AnInstance); 795 //DetermineCollectionDefaults(Responses); //cboCollType = COLLECT , calCollTime = START 796 cboAvailTestSelect(self); 797 end; 798 end; 799 Changing := False; 800 if ObtainCollSamp then 801 begin 802 //For BloodBank orders, this condition should never occur 803 end 804 else 805 begin 806 with ALabTest do 807 with TCollSamp(CollSampList.Items[IndexOfCollSamp(CollSamp)]) do 808 begin 809 x := '' ; 810 for i := 0 to WardComment.Count-1 do 811 x := x + WardComment.strings[i]+#13#10 ; 812 pnlMessage.TabOrder := cboAvailTest.TabOrder + 1; 813 OrderMessage(x) ; 814 end ; 815 end; 816 end; 817 if sub = 'c' then with ALabTest do //COMPONENT 818 begin 819 Changing := True; 820 DisableDiagTestControls; 821 EnableComponentControls; 822 LRORDERMODE := TORDER_MODE_COMP; 823 with Responses do 824 begin 825 StatusText('Initializing Order'); 826 AResponse := FindResponseByName('ORDERABLE', AnInstance); 827 if AResponse <> nil then 828 sub1 := GetSubtype(AResponse.EValue); 829 if sub1 = 'c' then 830 begin 831 SetControl(cboAvailComp, 'ORDERABLE', AnInstance); 832 //SetControl(cboTests, 'ORDERABLE', AnInstance); 833 SetControl(cboModifiers, 'MODIFIER', AnInstance); 834 SetControl(tQuantity, 'QTY', AnInstance); 835 //DetermineCollectionDefaults(Responses); 836 cboAvailCompSelect(self); 837 end; 838 end; 839 Changing := False; 840 end; 841 with ALabTest do 842 begin 843 if ObtainComment then 844 LoadRequiredComment(FCmtTypes.IndexOf(CurReqComment)) 845 else 846 DisableCommentPanels; 847 x := '' ; 848 for i := 0 to CurWardComment.Count-1 do 849 x := x + CurWardComment.strings[i]+#13#10 ; 850 i := IndexOfCollSamp(CollSamp); 851 if i > -1 then with TCollSamp(CollSampList.Items[IndexOfCollSamp(CollSamp)]) do 852 for i := 0 to WardComment.Count-1 do 853 x := x + WardComment.strings[i]+#13#10 ; 854 pnlMessage.TabOrder := cboAvailTest.TabOrder + 1; 855 if Length(x) > 0 then 856 begin 857 OrderMessage(x) ; 858 end; 859 end; 860 StatusText(''); 861 Changing := True; 862 //if not(FOrderAction = ORDER_EDIT) then DetermineCollectionDefaults(Responses); 863 Changing := False; 864 end; 865 AnInstance := NextInstance('ORDERABLE', AnInstance); 866 end; //while AnInstance - ORDERABLE 867 DisableComponentControls; 868 DisableDiagTestControls; 869 uQuickInProcess := 0; 870 end; } 848 if uGetTnS = 1 then 849 begin 850 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 851 lblTNS.Visible := true; 852 memMessage.Text := 'TYPE + SCREEN must be added to order'; 853 pnlMessage.Visible := true; 854 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 855 end 856 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 871 857 finally 872 858 aList.Free; 859 cList.Free; 873 860 aTests.Free; 874 861 end; 875 edtResults.Height := 247;876 edtInfo.Height := 247;877 862 if lvSelectionList.Items.Count > 0 then 878 863 begin … … 881 866 memOrder.Visible := True; 882 867 GroupBox1.Visible := False; 868 lvSelectionList.Items[0].Selected := true; 869 lvSelectionListClick(self); 883 870 end; 884 871 end; … … 890 877 i: integer; 891 878 x,sub,sub1,aTNSString: string; 892 aList : TStringList;893 aGotIt : boolean;879 aList, cList: TStringList; 880 aGotIt, aGotTNS: boolean; 894 881 aTests: TStringList; 895 882 ListItem: TListItem; 896 aName, aMsg, aStr, aModifier, aReason, aSurgery, aCollTime, aTestYes, aSpecimen, aTypeScreen: String; 897 CurAdd, j, k, getTest, TestAdded, aMSBOS, aMSBOSContinue, aTNS, aTNSDays: Integer; 883 xLabTest: TLabTest; 884 aName, aMsg, aStr, aModifier, aReason, aSurgery, aCollTime, aTestYes, aSpecimen, aSpecimenUID, aSpecimenReq, aTypeScreen, aUrgText: String; 885 CurAdd, j, k, getTest, TestAdded, aMSBOS, aMSBOSContinue, aTNS: Integer; 898 886 begin 899 887 inherited; 900 888 aList := TStringList.Create; 889 cList := TStringList.Create; 901 890 aTests := TStringList.Create; 891 pgeProduct.ActivePageIndex := TI_COMPONENT; 902 892 try 903 893 aModifier := ''; … … 908 898 aTypeScreen := ''; 909 899 aSpecimen := ''; 900 aSpecimenUID := ''; 901 aSpecimenReq := ''; 910 902 sub1 := ''; 903 aGotTNS := false; 911 904 ExtractTypeScreen(aList, uVBECList); 912 905 if aList.Count > 0 then aTypeScreen := aList[0]; 913 906 aList.Clear; 914 Extractspecimen(aList, uVBECList); 915 if aList.Count > 0 then aSpecimen := aList[0]; 907 ExtractSpecimen(aList, uVBECList); 908 if aList.Count > 0 then 909 begin 910 aSpecimen := piece(aList[0], '^',1); 911 aSpecimenUID := piece(aList[0], '^',2); 912 end; 916 913 with Responses, ALabTest do 917 914 begin … … 963 960 SetControl(chkConsent, 'YN', AnInstance); 964 961 //DetermineCollectionDefaults(Responses); 965 SetControl(cboCollType, 'COLLECT', AnInstance);966 SetupCollTimes(cboCollType.ItemID);967 //SetControl(cboCollTime, 'START', AnInstance);968 //LoadUrgency(cboCollType.ItemID, cboUrgency);969 962 SetControl(cboUrgency, 'URGENCY', AnInstance); 970 Urgency := cboUrgency.ItemIEN; 971 if (Urgency = 0) and (cboUrgency.Items.Count = AnInstance) then 963 if cboUrgency.ItemIEN = 0 then 972 964 begin 973 cboUrgency.ItemIndex := 0; 974 Urgency := cboUrgency.ItemIEN; 975 cboUrgencyChange(self); 965 if StrToIntDef(LRFURG, 0) > 0 then 966 cboUrgency.SelectByID(LRFURG) 967 else if (Urgency = 0) and (cboUrgency.Items.Count = 1) then 968 cboUrgency.ItemIndex := 0; 976 969 end; 977 970 SetControl(cboSurgery, 'MISC', AnInstance); 971 if Length(cboSurgery.Text) > 0 then 972 begin 973 for i := 0 to cboSurgery.Items.Count - 1 do 974 if uppercase(cboSurgery.Text) = uppercase(piece(cboSurgery.Items[i],'^',2)) then 975 begin 976 cboSurgery.ItemIndex := i; 977 Break; 978 end; 979 cboSurgeryChange(self); 980 end; 978 981 if not(ALabTest = nil) then 979 982 begin 980 Urgency := cboUrgency.ItemIEN;981 if (Urgency = 0) and (cboUrgency.Items.Count = 1) then982 begin983 cboUrgency.ItemIndex := 0;984 Urgency := cboUrgency.ItemIEN;985 end;986 983 i := 1 ; 987 984 AResponse := Responses.FindResponseByName('COMMENT',i); … … 992 989 AResponse := Responses.FindResponseByName('COMMENT',i); 993 990 end ; 994 end;995 if not(cboCollType.ItemID = 'LC') then996 begin997 if Length(cboCollTime.Text) > 0 then998 begin999 calCollTime.FMDateTime := StrToFMDateTime(cboCollTime.Text);1000 FLastCollTime := cboCollTime.Text;1001 end1002 else1003 begin1004 FLastCollTime := '';1005 end;1006 991 end; 1007 992 end; … … 1014 999 SetControl(cboModifiers, 'MODIFIER', AnInstance); 1015 1000 SetControl(tQuantity, 'QTY', AnInstance); 1016 //DetermineCollectionDefaults(Responses);1017 //Check for and display any associated Lab Results1018 1001 aList.Clear; 1019 1002 TestAdded := 0; … … 1043 1026 if TestAdded = 1 then 1044 1027 begin 1045 edtResults.Clear;1046 1028 aTests.Clear; 1047 1029 GetPatientBloodResults(aTests, Patient.DFN, uTestsForResults); 1048 QuickCopy(ATests,edtResults); 1049 if edtResults.Lines.Count > 0 then TabResults.Caption := 'Lab Results Available'; //TabResults.ImageIndex := 1; 1050 uRaw.Clear; 1051 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 1030 if aTests.Count > 0 then 1031 begin 1032 edtResults.Clear; 1033 QuickCopy(ATests,edtResults); 1034 TabResults.Caption := 'Lab Results Available'; 1035 uRaw.Clear; 1036 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 1037 end; 1052 1038 end; 1053 1039 CurAdd := 1; … … 1058 1044 Inc(CurAdd); 1059 1045 end; 1060 aSpecimen := '^'; 1046 aSpecimen := ''; 1047 aSpecimenUID := ''; 1048 aSpecimenReq := ''; 1061 1049 aTestYes := '0'; 1062 1050 aReason := ''; … … 1064 1052 aCollTime := ''; 1065 1053 ExtractSpecimen(aList, uVBECList); 1066 if aList.Count > 0 then aSpecimen := aList[0]; 1054 if aList.Count > 0 then 1055 begin 1056 aSpecimen := piece(aList[0], '^', 1); 1057 aSpecimenUID := piece(aList[0], '^', 2); 1058 end; 1067 1059 if length(cboModifiers.ItemID) > 0 then aModifier := cboModifiers.Items[cboModifiers.ItemIndex]; 1068 1060 if length(cboReasons.ItemID) > 0 then aReason := cboReasons.Items[cboReasons.ItemIndex]; 1069 1061 if length(cboSurgery.ItemID) > 0 then aSurgery := cboSurgery.Items[cboSurgery.ItemIndex]; 1070 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex];1071 1062 if Length(cboSurgery.ItemID) > 0 then 1072 1063 begin … … 1076 1067 begin 1077 1068 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 1078 and ( piece(aList[i],'^',3) = cboSurgery.Text) then1069 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 1079 1070 begin 1080 1071 aMSBOS := StrToInt(piece(aList[i],'^',4)); … … 1086 1077 aMSBOSContinue := 1087 1078 MessageBox(PChar('The number of units ordered (' + tQuantity.Text + 1088 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 1089 + IntToStr(aMSBOS) + 1090 ') for the ' + cboSurgery.text + 1091 ' surgical procedure selected.' + CRLF + CRLF + 'Do you wish to continue?'), 1092 PChar('Maximum Number of Units Exceeded'), 1093 MB_YESNO); 1079 ') for ' + aLabTest.TestName + ' Exceeds the maximum number recommended (' 1080 + IntToStr(aMSBOS) + 1081 ') for the ' + cboSurgery.text + 1082 ' surgical procedure.' + CRLF + 1083 'If you need to order more than the maximum number of units, please enter a justification in the Comment box.' 1084 + CRLF + CRLF + 'Edit the Blood component Quantity?'), 1085 PChar('Maximum Number of Units Exceeded'), 1086 MB_YESNO); 1094 1087 RestoreTopMosts; 1095 1088 end; 1096 if aMSBOSContinue = 7then1089 if aMSBOSContinue = 6 then 1097 1090 begin 1098 1091 ShowMsg(cboAvailComp.Text + ' has NOT been added to this request.'); 1092 lvSelectionList.Clear; 1093 uSelectedItems.Clear; 1094 uTestsForResults.Clear; 1095 uRaw.Clear; 1096 uGetTnS := 0; 1097 lblTNS.Caption := ''; 1098 lblTNS.Visible := false; 1099 memMessage.Text := ''; 1100 pnlMessage.Visible := false; 1101 FLastItemID := ''; 1102 InitDialog; 1103 cboModifiers.ItemIndex := -1; 1104 cboAvailTest.ItemIndex := -1; 1105 cboAvailComp.ItemIndex := -1; 1106 cboSurgery.ItemIndex := -1; 1107 cboUrgency.ItemIndex := -1; 1108 cboReasons.ItemIndex := -1; 1109 cboCollType.ItemIndex := -1; 1110 cboCollTime.ItemIndex := -1; 1111 cboQuick.ItemIndex := -1; 1112 calWantTime.Text := ''; 1113 memDiagComment.Text := ''; 1114 GroupBox1.Visible := true; 1115 tQuantity.Text := ''; 1116 FLastCollType := ''; 1117 FLastCollTime := ''; 1118 FLastLabCollTime := ''; 1119 txtImmedColl.Text := ''; 1120 calCollTime.text := ''; 1099 1121 exit; 1100 1122 end; … … 1103 1125 end; 1104 1126 end; 1105 if (uTNSOrders.Count < 1) then //SpecimenNeeded(aList, uVBECList, aLabTest.ItemID) then //check to see if type and screen is needed 1127 for i := lvSelectionList.Items.Count - 1 downto 0 do 1128 begin 1129 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 1130 begin 1131 aGotTNS := true; 1132 break; 1133 end; 1134 end; 1135 if (uTNSOrders.Count < 1) and (aGotTNS = false) and (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then //check to see if type and screen is needed CQ 17349 1106 1136 begin 1107 1137 uGetTnS := 1; … … 1113 1143 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 1114 1144 begin 1115 aSpecimen := piece(aList[i],'^',2) + '^' + aSpecimen; 1145 aSpecimenReq := piece(aList[i],'^',2); 1146 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 1147 aSpecimenUID := ''; 1116 1148 break; 1117 1149 end; … … 1136 1168 end; 1137 1169 CurAdd := 1; 1138 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests1170 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 1139 1171 uSelectedItems.Add(aStr); 1140 1172 for i := 0 to uSelectedItems.Count - 1 do … … 1160 1192 aMsg := ''; 1161 1193 LRORDERMODE := TORDER_MODE_INFO; 1162 {if uGetTnS = 1 then1163 begin1164 lblTNS.Caption := 'TYPE + SCREEN must be added to order';1165 lblTNS.Visible := true;1166 memMessage.Text := 'TYPE + SCREEN must be added to order';1167 memMessage.Visible := false;1168 pnlMessage.Visible := true;1169 pnlDiagnosticTests.Caption := 'Diagnostic Tests*';1170 end; }1171 {if uGetTnS = 1 then1172 begin1173 if responses.QuickOrder < 1 then1174 begin1175 for i := 1 to cboAvailTest.Items.Count - 1 do1176 begin1177 if piece(cboAvailTest.Items[i],'^',1) = aTypeScreen then1178 begin1179 if piece(aSpecimen,'^',1) = '1' then1180 begin1181 cboCollTime.Text := calWantTime.Text;1182 aCollSave := cboCollTime.Text + '^' + cboCollTime.ItemID + '^' + cboCollType.Text + '^' + cboCollType.ItemID;1183 cboCollTime.Text := '';1184 cboCollType.Text := '';1185 uSpecimen := 1;1186 end;1187 cboModifiers.Text := '';1188 cboAvailTest.SelectByID(aTypeScreen);1189 cboTests.SelectByID(aTypeScreen);1190 cboTestsClick(self);1191 //cboAvailTestSelect(Self);1192 uSpecimen := 0;1193 cboCollTime.Text := piece(aCollSave,'^',1);1194 cboCollType.Text := piece(aCollSave,'^',3);1195 aCollSave := '';1196 break;1197 end;1198 end;1199 aMsg := 'An order for Type and Screen has been added to this request' + '.';1200 end1201 else1202 begin1203 lblTNS.Caption := 'TYPE + SCREEN must be added to order';1204 lblTNS.Visible := true;1205 memMessage.Text := 'TYPE + SCREEN must be added to order';1206 memMessage.Visible := false;1207 pnlMessage.Visible := true;1208 end;1209 end;1210 if (uGetTnS = 1) then1211 begin1212 if length(aMsg) > 0 then aMsg := aMsg + crlf + crlf;1213 ShowMsg(aMsg);1214 end; }1215 1216 //cboModifiers.Text := '';1217 edtResults.Height := 247;1218 edtInfo.Height := 247;1219 1194 if lvSelectionList.Items.Count > 0 then 1220 1195 begin … … 1234 1209 aTestYes := '1'; 1235 1210 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 1236 //DetermineCollectionDefaults(Responses); 1211 //DetermineCollectionDefaults(Responses); //cboCollType = COLLECT , calCollTime = START 1237 1212 i := 1 ; 1238 1213 AResponse := Responses.FindResponseByName('COMMENT',i); … … 1260 1235 end; 1261 1236 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 1262 with cboCollType do if Length(ItemID) > 0 then1263 begin1264 Responses.Update('COLLECT', 1, ItemID, ItemID) ;1265 FLastCollType := ItemID;1266 end;1267 1237 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 1268 1238 else 1269 1239 begin 1270 cboUrgency.ItemIndex := 1; 1240 cboUrgency.ItemIndex := 2; 1241 for i := 0 to cboUrgency.Items.Count - 1 do 1242 begin 1243 aUrgText := cboUrgency.Items[i]; 1244 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 1245 begin 1246 cboUrgency.ItemIndex := i; 1247 break; 1248 end; 1249 end; 1271 1250 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 1272 1251 cboUrgencyChange(self); … … 1274 1253 if Length(memDiagComment.Text) > 0 then Responses.Update('COMMENT',1,memDiagComment.Text,memDiagComment.Text); 1275 1254 if Length(cboReasons.Text) > 0 then Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 1276 LoadCollType(cboCollType);1277 if (cboCollType.ItemID = 'LC') or (cboCollType.ItemID = 'I') then1278 if not(ALabTest.LabCanCollect) and OrderForInpatient then1279 cboCollType.SelectByID('WC')1280 else if not(ALabTest.LabCanCollect) then1281 cboCollType.SelectByID('SP');1282 SetupCollTimes(cboCollType.ItemID);1283 if cboCollType.ItemID = 'LC' then1284 begin1285 with cboCollTime do1286 if Length(ItemID) > 0 then1287 begin1288 Responses.Update('START', 1, Copy(ItemID, 2, 999), Copy(ItemID, 2, 999));1289 FLastLabCollTime := ItemID + U + Text;1290 end1291 else if Length(Text) > 0 then1292 begin1293 Responses.Update('START', 1, ValidCollTime(Text), Text) ;1294 FLastLabCollTime := ValidCollTime(Text);1295 end;1296 end1297 else1298 begin1299 with calCollTime do1300 if FMDateTime > 0 then1301 begin1302 Responses.Update('START', 1, ValidCollTime(Text), Text);1303 FLastColltime := ValidCollTime(Text);1304 end1305 else1306 begin1307 Responses.Update('START', 1, '', '') ;1308 FLastCollTime := '';1309 end;1310 end;1311 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex];1312 with cboCollType do if Length(ItemID) > 0 then1313 begin1314 Responses.Update('COLLECT', 1, ItemID, ItemID) ;1315 FLastCollType := ItemID;1316 end;1317 1255 uTestSelected := true; 1318 1256 with lvSelectionList do … … 1326 1264 end; 1327 1265 CurAdd := 1; 1328 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + aCollTime + '^' + cboCollType.Text + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces1266 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 1329 1267 uSelectedItems.Add(aStr); 1330 1268 for i := 0 to uSelectedItems.Count - 1 do … … 1339 1277 end; 1340 1278 memOrder.Text := Responses.OrderText; 1341 edtResults.Height := 247;1342 edtInfo.Height := 247;1343 1279 if lvSelectionList.Items.Count > 0 then 1344 1280 begin … … 1353 1289 end; 1354 1290 //Quick Order 1291 end; 1292 cList.Clear; 1293 if (Length(cboSurgery.ItemID) > 0) then 1294 begin 1295 for j := 0 to uSelectedItems.Count - 1 do 1296 begin 1297 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 1298 if (piece(uSelectedItems[j],'^',1) = '0') and (not(piece(uSelectedItems[j],'^',3)='')) and (StrToInt(piece(uSelectedItems[j],'^',3)) > 0) and (piece(cboSurgery.Items[cboSurgery.ItemIndex],'^',3) = '1') then 1299 begin 1300 cList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3)); 1301 end; 1302 xLabTest.Free; 1303 end; 1304 end; 1305 if (uChangingMSBOS = false) and (cList.Count > 0) then 1306 begin 1307 lblNoBloodReq.Visible := true; 1308 with Application do 1309 begin 1310 NormalizeTopMosts; 1311 aMSBOSContinue := 1312 MessageBox(PChar('No blood is required for the surgical procedure: ' + cboSurgery.text + 1313 '.' + CRLF + 1314 'If you still need to order any components, please enter a justification in the Comment box.' 1315 + CRLF + CRLF + 'Do you want me to remove ALL the component orders you''ve just entered? '), 1316 PChar('No Blood Required'),MB_YESNO); 1317 RestoreTopMosts; 1318 end; 1319 if aMSBOSContinue = 6 then 1320 begin 1321 tQuantity.Text := ''; 1322 for j := uSelectedItems.Count - 1 downto 0 do 1323 begin 1324 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 1325 begin 1326 lvSelectionList.Items[j].Delete; 1327 uSelectedItems.Delete(j); 1328 Responses.Update('ORDERABLE', (j+1) ,'', ''); 1329 Responses.Update('MODIFIER', (j+1), '', ''); 1330 Responses.Update('QTY', (j+1), '', ''); 1331 end; 1332 end; 1333 cboAvailComp.Text := ''; 1334 cboAvailComp.ItemIndex := -1; 1335 cboModifiers.Text := ''; 1336 cboModifiers.ItemIndex := -1; 1337 lblNoBloodReq.Visible := false; 1338 //if fODBBank. Active then cboAvailTest.SetFocus; 1339 lblTNS.Caption := ''; 1340 lblTNS.Visible := false; 1341 DisableComponentControls; 1342 end; 1355 1343 end; 1356 1344 for i := 0 to lvSelectionList.Items.Count - 1 do … … 1372 1360 begin 1373 1361 NormalizeTopMosts; 1374 aTNSDays := TNSDaysBack;1375 1362 aTNS := 1376 1363 MessageBox(PChar(aTNSString + CRLF + CRLF + 1377 'Do you wish to continue withthis request for Type & Screen?'),1378 1379 1364 'Do you wish to cancel this request for Type & Screen?'), 1365 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 1366 MB_YESNO); 1380 1367 RestoreTopMosts; 1381 if aTNS = 7then1368 if aTNS = 6 then 1382 1369 begin 1383 1370 lvSelectionList.ItemIndex := i; … … 1398 1385 pnlMessage.Visible := true; 1399 1386 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 1400 end; 1387 end 1388 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 1401 1389 if ALabTest <> nil then 1402 1390 begin … … 1440 1428 finally //**SubTest 1441 1429 alist.Free; 1430 cList.Free; 1442 1431 aTests.Free; 1443 1432 end; … … 1719 1708 procedure TLabTest.LoadUrgency(CollType: string; AComboBox:TORComboBox); 1720 1709 var 1721 i: integer; 1710 i, PreviousSelectionIndex: integer; 1711 PreviousSelectionString: String; 1722 1712 begin 1723 1713 if UrgencyList.Count < 1 then Exit; 1724 1714 with AComboBox do 1725 1715 begin 1716 PreviousSelectionIndex := -1; 1717 PreviousSelectionString := SelText; 1726 1718 Clear; 1727 1719 for i := 0 to UrgencyList.Count - 1 do 1720 begin 1728 1721 if (CollType = 'LC') and (Piece(UrgencyList[i], U, 3) = '') then 1729 1722 Continue 1730 1723 else 1731 1724 Items.Add(UrgencyList[i]); 1725 if (PreviousSelectionString <> '') and (PreviousSelectionString = Piece(UrgencyList[i], U, 2)) then 1726 PreviousSelectionIndex := i; 1727 end; 1732 1728 if (LRFURG <> '') and (ALabTest.ObtainUrgency) then 1733 1729 SelectByID(LRFURG) 1730 else if PreviousSelectionIndex > -1 then 1731 ItemIndex := PreviousSelectionIndex 1734 1732 else 1735 1733 SelectByIEN(uDfltUrgency); … … 1864 1862 i:integer; 1865 1863 aborh: boolean; 1866 aSpecimen, aSpecimen Date: string;1864 aSpecimen, aSpecimenUID, aSpecimenDate: string; 1867 1865 aWantDateTime, aExpiredSpecimenDate: TFMDateTime; 1868 1866 begin … … 1870 1868 aborh := false; 1871 1869 aSpecimen := ''; 1870 aSpecimenUID := ''; 1872 1871 OutList.Clear; 1873 1872 ExtractItems(OutList,Alist,'ABORH'); … … 1886 1885 OutList.Clear; 1887 1886 ExtractSpecimen(OutList, uVBECList); 1888 if OutList.Count > 0 then aSpecimen := OutList[0]; 1887 if OutList.Count > 0 then 1888 begin 1889 aSpecimen := Piece(OutList[0], '^',1); 1890 aSpecimenUID := Piece(OutList[0], '^',2); 1891 end; 1889 1892 OutList.Clear; 1890 1893 ExtractItems(OutList,AList,'SPECIMENS'); 1891 1894 aWantDateTime := calWantTime.FMDateTime; 1892 aSpecimenDate := piece(aSpecimen,'^',1);1895 aSpecimenDate := aSpecimen; 1893 1896 aExpiredSpecimenDate := 0; 1894 1897 if Length(aSpecimenDate) > 0 then aExpiredSpecimenDate := StrToFloat(aSpecimenDate); 1895 1896 1898 for i := 0 to OutList.Count - 1 do 1897 1899 begin 1898 1900 if (IntToStr(aLabTest.ItemID) = piece(OutList[i],'^',1)) and (piece(OutList[i],'^',2) = '1') then 1899 if aSpecimen = '' then 1900 begin 1901 result := true; 1902 exit; 1903 end 1904 else if (Length(calWantTime.Text) > 0) and (aExpiredSpecimenDate < aWantDateTime) then 1905 begin 1906 result := true; 1907 exit; 1908 end; 1901 begin 1902 if self.EvtID > 0 then 1903 begin 1904 result := true; 1905 exit; 1906 end; 1907 if aSpecimen = '' then 1908 begin 1909 result := true; 1910 exit; 1911 end 1912 else if (Length(calWantTime.Text) > 0) and (aExpiredSpecimenDate < aWantDateTime) then 1913 begin 1914 result := true; 1915 exit; 1916 end; 1917 end; 1909 1918 end; 1910 1919 end; … … 1963 1972 TX_TOO_MANY_DAYS = 'Maximum number of days allowed is '; 1964 1973 TX_TOO_MANY_TIMES = 'For this frequency, the maximum number of times allowed is: X'; 1965 //TX_NO_COMMENT = 'A comment is required for this test and collection sample.';1966 1974 TX_NUMERIC_REQD = 'A numeric value is required for urine volume'; 1967 1975 TX_DOSEDRAW_REQD = 'Both DOSE and DRAW times are required for this order'; 1968 1976 TX_TDM_REQD = 'A value for LEVEL is required for this order'; 1969 //TX_ANTICOAG_REQD = 'You must specify an anticoagulant on this order.' ;1970 1977 TX_NO_COLLSAMPLE = 'A collection sample MUST be specified'; 1971 1978 TX_NO_SPECIMEN = 'A specimen MUST be specified'; … … 2189 2196 tmpImmTime, tmpTime: TFMDateTime; 2190 2197 x, tmpORECALLType, tmpORECALLTime: string; 2191 begin 2198 j: integer; 2199 havetest: boolean; 2200 begin 2201 havetest := false; 2202 for j := uSelectedItems.Count - 1 downto 0 do 2203 begin 2204 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') and ((length(calCollTime.Text) > 0) or (length(cboCollTime.Text) > 0)) then 2205 begin 2206 havetest := true; 2207 Break; 2208 end; 2209 end; 2210 //if (havetest = True) and (not(FOrderAction in [ORDER_QUICK, ORDER_EDIT])) then havetest := false; 2192 2211 x := GetLastCollectionTime; 2193 2212 tmpORECALLType := Piece(x, U, 1); 2194 2213 tmpORECALLTime := Piece(x, U, 2); 2195 2214 if CollType = 'SP' then 2215 begin 2216 cboColltime.Visible := False; 2217 txtImmedColl.Visible := False; 2218 pnlCollTimeButton.Visible := False; 2219 pnlCollTimeButton.TabStop := False; 2220 calCollTime.Visible := True; 2221 calCollTime.Enabled := True; 2222 if FLastCollTime <> '' then 2223 begin 2224 calCollTime.Text := ValidCollTime(FLastColltime); 2225 if IsFMDateTime(calCollTime.Text) then 2226 begin 2227 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2228 calCollTime.FMDateTime := StrToFMDateTime(FLastCollTime); 2229 end; 2230 end 2231 else if tmpORECALLTime <> '' then 2232 begin 2233 calCollTime.Text := ValidCollTime(tmpORECALLTime); 2234 if IsFMDateTime(calCollTime.Text) then 2235 begin 2236 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2237 calCollTime.FMDateTime := StrToFMDateTime(tmpORECALLTime); 2238 end; 2239 end 2240 else if LRFDATE <> '' then 2241 calCollTime.Text := LRFDATE 2242 else if not(FOrderAction in [ORDER_EDIT]) then 2243 calCollTime.Text := 'TODAY' 2244 else if (havetest = false) then 2245 calCollTime.Text := 'TODAY'; 2246 if (havetest = false) and (RemoveCollTimeDefault = True) then 2247 begin 2248 calCollTime.Text := ''; 2249 calCollTime.FMDateTime := 0; 2250 end; 2251 end 2252 else if CollType = 'WC' then 2196 2253 begin 2197 2254 cboColltime.Visible := False; … … 2203 2260 if FLastCollTime <> '' then 2204 2261 begin 2205 calCollTime.Text := ValidColl Time(FLastColltime);2262 calCollTime.Text := ValidColltime(FLastColltime); 2206 2263 if IsFMDateTime(calCollTime.Text) then 2207 2264 begin 2208 2265 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2209 calColl time.FMDateTime := StrToFMDateTime(FLastCollTime);2266 calCollTime.FMDateTime := StrToFMDateTime(FLastCollTime); 2210 2267 end; 2211 2268 end 2212 2269 else if tmpORECALLTime <> '' then 2213 2270 begin 2214 calCollTime.Text := ValidColl Time(tmpORECALLTime);2271 calCollTime.Text := ValidColltime(tmpORECALLTime); 2215 2272 if IsFMDateTime(calCollTime.Text) then 2216 2273 begin 2217 2274 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2218 calColl time.FMDateTime := StrToFMDateTime(tmpORECALLTime);2275 calCollTime.FMDateTime := StrToFMDateTime(tmpORECALLTime); 2219 2276 end; 2220 2277 end 2221 2278 else if LRFDATE <> '' then 2222 2279 calCollTime.Text := LRFDATE 2223 else 2224 calCollTime.Text := 'TODAY'; 2225 end 2226 else if CollType = 'WC' then 2227 begin 2228 cboColltime.Visible := False; 2229 txtImmedColl.Visible := False; 2230 pnlCollTimeButton.Visible := False; 2231 pnlCollTimeButton.TabStop := False; 2232 calCollTime.Visible := True; 2233 calColltime.Enabled := True; 2234 if FLastCollTime <> '' then 2235 begin 2236 calCollTime.Text := ValidColltime(FLastColltime); 2237 if IsFMDateTime(calCollTime.Text) then 2238 begin 2239 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2240 calColltime.FMDateTime := StrToFMDateTime(FLastCollTime); 2241 end; 2242 end 2243 else if tmpORECALLTime <> '' then 2244 begin 2245 calCollTime.Text := ValidColltime(tmpORECALLTime); 2246 if IsFMDateTime(calCollTime.Text) then 2247 begin 2248 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2249 calColltime.FMDateTime := StrToFMDateTime(tmpORECALLTime); 2250 end; 2251 end 2252 else if LRFDATE <> '' then 2253 calCollTime.Text := LRFDATE 2254 else 2280 else if not(FOrderAction in [ORDER_EDIT]) then 2255 2281 calCollTime.Text := 'NOW'; 2282 if (havetest = false) and (RemoveCollTimeDefault = True) then 2283 begin 2284 calCollTime.Text := ''; 2285 calCollTime.FMDateTime := 0; 2286 end; 2256 2287 end 2257 2288 else if CollType = 'LC' then … … 2274 2305 else 2275 2306 cboCollTime.ItemIndex := 0; 2307 if (havetest = false) and (RemoveCollTimeDefault = True) then 2308 begin 2309 cboCollTime.Text := ''; 2310 end; 2276 2311 end 2277 2312 else if CollType = 'I' then … … 2279 2314 cboColltime.Visible := False; 2280 2315 calCollTime.Visible := False; 2281 calColl time.Enabled := False;2316 calCollTime.Enabled := False; 2282 2317 txtImmedColl.Visible := True; 2283 2318 pnlCollTimeButton.Visible := True; … … 2291 2326 else if LRFDATE <> '' then 2292 2327 tmpTime := StrToFMDateTime(LRFDATE); 2293 2294 2328 if tmpTime > tmpImmTime then 2295 2329 begin … … 2301 2335 calCollTime.FMDateTime := GetDefaultImmCollTime; 2302 2336 txtImmedColl.Text := FormatFMDateTime('mmm dd,yy@hh:nn', calCollTime.FMDateTime); 2337 end; 2338 if (havetest = false) and (RemoveCollTimeDefault = True) then 2339 begin 2340 calCollTime.Text := ''; 2341 calCollTime.FMDateTime := 0; 2342 txtImmedColl.Text := ''; 2303 2343 end; 2304 2344 end; … … 2387 2427 begin 2388 2428 inherited; 2429 cboReasons.Text := StringReplace(cboReasons.Text,CRLF,' ',[rfReplaceAll]); 2389 2430 if (length(cboReasons.Text) > 75) then 2390 2431 begin … … 2414 2455 var 2415 2456 i: integer; 2416 text : string;2417 2457 ListItem: TListItem; 2418 aCollTime,aTypeScreen,aStr,aModifier,aSpecimen,a TestYes,x,aName,aTNSString: string;2458 aCollTime,aTypeScreen,aStr,aModifier,aSpecimen,aSpecimenUID,aSpecimenReq,aTestYes,x,aName,aTNSString, aUrgText: string; 2419 2459 aList: TStringList; 2420 curAdd, AnInstance,aTNS,aTNSDays: Integer;2460 curAdd,aTNS: Integer; 2421 2461 sub,sub1: string; 2422 AResponse: TResponse;2462 aChanging: Boolean; 2423 2463 begin 2424 2464 if cboAvailTest.ItemID = '' then Exit; 2425 2465 aList := TStringList.Create; 2466 aChanging := changing; 2426 2467 try 2427 2468 ALabTest := nil; 2428 2469 aTypeScreen := ''; 2429 aSpecimen := '^'; 2470 aSpecimen := ''; 2471 aSpecimenUID := ''; 2472 aSpecimenReq := ''; 2430 2473 aTestYes := '1'; 2431 2474 aModifier := ''; 2432 2475 changing := true; 2433 2476 tQuantity.Text := ''; 2477 changing := aChanging; 2434 2478 sub1 := ''; 2435 2479 cboModifiers.ItemIndex := -1; … … 2439 2483 ALabTest := TLabTest.Create(cboAvailTest.ItemID, Responses); 2440 2484 sub := GetSubtype(ALabTest.TestName); 2441 with CtrlInits do 2442 begin 2443 SetControl(cboCollType, 'Collection Types'); 2444 LoadCollType(cboCollType); 2445 if FLastCollType <> '' then 2446 cboCollType.SelectByID(FLastCollType) 2447 else if uDfltCollType <> '' then 2448 cboCollType.SelectByID(uDfltCollType) 2449 else if OrderForInpatient then 2450 if (ALabTest.LabCanCollect) then 2451 cboCollType.SelectByID('LC') 2452 else 2453 cboCollType.SelectByID('WC') 2454 else 2455 cboCollType.SelectByID('SP'); 2456 SetupCollTimes(cboCollType.ItemID); 2457 end; 2485 {if not(FOrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK]) then 2486 DetermineCollectionDefaults(Responses); } 2487 DetermineCollectionDefaults(Responses); 2458 2488 with cboAvailTest do 2459 2489 begin 2460 if (Length(ItemID) = 0) or (ItemID = '0') then Exit; 2490 if (Length(ItemID) = 0) or (ItemID = '0') then 2491 begin 2492 changing := aChanging; 2493 Exit; 2494 end; 2461 2495 FLastLabID := ItemID ; 2462 2496 FLastItemID := ItemID; … … 2467 2501 lvSelectionList.Items[i].Selected := true; 2468 2502 lvSelectionListClick(self); 2503 changing := aChanging; 2469 2504 Exit; 2470 2505 end; 2471 Changing := True;2472 Changing := False;2473 2506 ExtractTypeScreen(aList, uVBECList); 2474 2507 if aList.Count > 0 then aTypeScreen := aList[0]; 2475 2508 aList.Clear; 2476 2509 aTNSString := ''; 2477 if ( StrToInt(aTypeScreen) = cboAvailTest.ItemID) and (uTNSOrders.Count > 0) then2510 if (Changing = false) and (StrToInt(aTypeScreen) = cboAvailTest.ItemID) and (uTNSOrders.Count > 0) then 2478 2511 begin 2479 2512 for i := 0 to uTNSOrders.Count - 1 do … … 2482 2515 begin 2483 2516 NormalizeTopMosts; 2484 aTNSDays := TNSDaysBack;2485 2517 aTNS := 2486 2518 MessageBox(PChar(aTNSString + CRLF + CRLF + 2487 'Do you wish to continue?'),2488 2489 2519 'Do you wish to cancel this request for Type & Screen?'), 2520 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 2521 MB_YESNO); 2490 2522 RestoreTopMosts; 2491 if aTNS = 7then2523 if aTNS = 6 then 2492 2524 begin 2493 2525 cboAvailTest.ItemIndex := -1; … … 2515 2547 end; 2516 2548 end; 2517 Changing := False;2518 2549 end; 2519 2550 if LRORDERMODE = TORDER_MODE_DIAG then 2520 2551 begin 2521 2552 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 2522 with cboCollType do if Length(ItemID) > 0 then 2553 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 2554 else if changing = false then 2523 2555 begin 2524 Responses.Update('COLLECT', 1, ItemID, ItemID) ; 2525 FLastCollType := ItemID; 2526 end; 2527 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 2528 else 2529 begin 2530 cboUrgency.ItemIndex := 1; 2556 for i := 0 to cboUrgency.Items.Count - 1 do 2557 begin 2558 aUrgText := cboUrgency.Items[i]; 2559 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 2560 begin 2561 cboUrgency.ItemIndex := i; 2562 break; 2563 end; 2564 end; 2531 2565 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 2532 2566 end; 2533 2567 if Length(memDiagComment.Text) > 0 then Responses.Update('COMMENT',1,memDiagComment.Text,memDiagComment.Text); 2534 2568 if Length(cboReasons.Text) > 0 then Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 2569 with cboCollTime do 2570 2535 2571 if cboCollType.ItemID = 'LC' then 2536 2572 begin … … 2547 2583 end; 2548 2584 end 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2585 else 2586 begin 2587 with calCollTime do 2588 if FMDateTime > 0 then 2589 begin 2590 Responses.Update('START', 1, ValidCollTime(Text), Text); 2591 FLastColltime := ValidCollTime(Text); 2592 end 2593 else 2594 begin 2595 Responses.Update('START', 1, '', '') ; 2596 FLastCollTime := ''; 2597 end; 2598 end; 2599 if Length(cboCollType.Text) > 0 then Responses.Update('COLLECT',1,cboCollType.ItemID,cboCollType.ItemID); 2564 2600 end; 2565 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex];2566 2601 uTestSelected := true; 2567 2602 with lvSelectionList do … … 2583 2618 end; 2584 2619 end; 2585 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + aCollTime + '^' + cboCollType.Text + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces2620 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 2586 2621 uSelectedItems.Add(aStr); 2587 2622 CurAdd := 1; … … 2600 2635 aList.Free; 2601 2636 end; 2602 edtResults.Height := 247;2603 edtInfo.Height := 247;2604 2637 if lvSelectionList.Items.Count > 0 then 2605 2638 begin … … 2618 2651 aMSBOS,aMSBOSContinue,curAdd,AnInstance: integer; 2619 2652 sub,sub1: string; 2620 AResponse: TResponse;2621 2653 ListItem: TListItem; 2622 aTypeScreen,aSpecimen,aTestYes,aStr,aMsg,aModifier,x,x1,aReason,aSurgery,aCollTime,aCollSave,aName: String; 2654 aTypeScreen,aSpecimen,aSpecimenUID,aSpecimenReq,aTestYes,aStr,aMsg,aModifier,x,x1,aReason,aSurgery,aCollTime,aCollSave,aName,aUrgText: String; 2655 aChanging: Boolean; 2623 2656 begin 2624 2657 if cboAvailComp.ItemID = '' then Exit; … … 2626 2659 aTests := TStringList.Create; 2627 2660 sub1 := ''; 2661 aChanging := changing; 2628 2662 try 2629 2663 DisableDiagTestControls; … … 2634 2668 tQuantity.Text := ''; 2635 2669 cboModifiers.ItemIndex := -1; 2636 changing := false;2670 changing := aChanging; 2637 2671 end; 2638 2672 LRORDERMODE := TORDER_MODE_COMP; … … 2652 2686 ALabTest := TLabTest.Create(ItemID, Responses); 2653 2687 sub := GetSubtype(ALabTest.TestName); 2654 Changing := False;2688 changing := aChanging; 2655 2689 StatusText(''); 2656 2690 end; 2657 //Check for and display any associated Lab Results2658 2691 aList.Clear; 2659 2692 TestAdded := 0; 2660 2693 getTest := 0; 2661 ExtractTests(aList, uVBECList); //Get Results associated with ordered components2694 ExtractTests(aList, uVBECList); //Get Lab Results associated with ordered components 2662 2695 for j := 0 to aList.Count - 1 do 2663 2696 begin … … 2683 2716 if TestAdded = 1 then 2684 2717 begin 2685 edtResults.Clear;2686 2718 aTests.Clear; 2687 2719 GetPatientBloodResults(aTests, Patient.DFN, uTestsForResults); 2688 QuickCopy(ATests,edtResults); 2689 if edtResults.Lines.Count > 0 then TabResults.Caption := 'Lab Results Available'; 2690 uRaw.Clear; 2691 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 2720 if aTests.Count > 0 then 2721 begin 2722 edtResults.Clear; 2723 QuickCopy(ATests,edtResults); 2724 TabResults.Caption := 'Lab Results Available'; 2725 uRaw.Clear; 2726 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 2727 end; 2692 2728 end; 2693 2729 CurAdd := 1; … … 2699 2735 end; 2700 2736 aTypeScreen := ''; 2701 aSpecimen := '^'; 2737 aSpecimen := ''; 2738 aSpecimenUID := ''; 2739 aSpecimenReq := ''; 2702 2740 aTestYes := '0'; 2703 2741 aReason := ''; … … 2709 2747 aList.Clear; 2710 2748 ExtractSpecimen(aList, uVBECList); 2711 if aList.Count > 0 then aSpecimen := aList[0]; 2749 if aList.Count > 0 then 2750 begin 2751 aSpecimen := piece(aList[0], '^', 1); 2752 aSpecimenUID := piece(aList[0], '^', 2); 2753 end; 2754 if (cboSurgery.ItemID = '') and (length(cboSurgery.Text) > 0) then 2755 begin 2756 for i := 0 to cboSurgery.Items.Count - 1 do 2757 if uppercase(cboSurgery.Text) = uppercase(piece(cboSurgery.Items[i],'^',2)) then 2758 begin 2759 cboSurgery.ItemIndex := i; 2760 Break; 2761 end; 2762 end; 2712 2763 if length(cboModifiers.ItemID) > 0 then aModifier := cboModifiers.Items[cboModifiers.ItemIndex]; 2713 2764 if length(cboReasons.ItemID) > 0 then aReason := cboReasons.Items[cboReasons.ItemIndex]; 2714 2765 if length(cboSurgery.ItemID) > 0 then aSurgery := cboSurgery.Items[cboSurgery.ItemIndex]; 2715 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex]; 2716 if Length(cboSurgery.ItemID) > 0 then 2717 begin 2766 if (Length(cboSurgery.ItemID) > 0) and (length(tQuantity.Text) > 0) and (strToInt(tQuantity.Text) > 0) then 2767 begin 2768 uChangingMSBOS := true; 2769 cboSurgeryChange(self); 2770 uChangingMSBOS := false; 2771 if cboAvailComp.ItemIndex = -1 then Exit; 2718 2772 aList.Clear; 2719 2773 ExtractMSBOS(aList, uVBECList); //Get maximum units for selected Surgey … … 2721 2775 begin 2722 2776 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 2723 and ( piece(aList[i],'^',3) = cboSurgery.Text) then2777 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 2724 2778 begin 2725 2779 aMSBOS := StrToInt(piece(aList[i],'^',4)); … … 2731 2785 aMSBOSContinue := 2732 2786 MessageBox(PChar('The number of units ordered (' + tQuantity.Text + 2733 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 2734 + IntToStr(aMSBOS) + 2735 ') for the ' + cboSurgery.text + 2736 ' surgical procedure selected.' + CRLF + CRLF + 'Do you wish to continue?'), 2737 PChar('Maximum Number of Units Exceeded'), 2738 MB_YESNO); 2787 ') for ' + aLabTest.TestName + ' Exceeds the maximum number recommended (' 2788 + IntToStr(aMSBOS) + 2789 ') for the ' + cboSurgery.text + 2790 ' surgical procedure.' + CRLF + 2791 'If you need to order more than the maximum number of units, please enter a justification in the Comment box.' 2792 + CRLF + CRLF + 'Edit the Blood component Quantity?'), 2793 PChar('Maximum Number of Units Exceeded'), 2794 MB_YESNO); 2739 2795 RestoreTopMosts; 2740 2796 end; 2741 if aMSBOSContinue = 7then2797 if aMSBOSContinue = 6 then 2742 2798 begin 2743 2799 ShowMsg(cboAvailComp.Text + ' has NOT been added to this request.'); … … 2748 2804 end; 2749 2805 end; 2750 if (uTNSOrders.Count < 1) then // SpecimenNeeded(aList, uVBECList, aLabTest.ItemID) then //check to see if type and screen is needed2806 if (uTNSOrders.Count < 1) and (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then //check to see if type and screen is needed CQ 17349 2751 2807 begin 2752 2808 uGetTnS := 1; … … 2772 2828 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 2773 2829 begin 2774 aSpecimen := piece(aList[i],'^',2) + '^' + aSpecimen; 2830 aSpecimenReq := piece(aList[i],'^',2); 2831 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 2832 aSpecimenUID := ''; 2775 2833 break; 2776 2834 end; … … 2794 2852 ListItem.SubItems.Add(piece(cboAvailComp.Items[cboAvailComp.ItemIndex],'^',1)); 2795 2853 end; 2796 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests2854 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 2797 2855 uSelectedItems.Add(aStr); 2798 2856 CurAdd := 1; … … 2816 2874 else 2817 2875 begin 2818 cboUrgency.ItemIndex := 1; 2876 cboUrgency.ItemIndex := 2; 2877 for j := 0 to cboUrgency.Items.Count - 1 do 2878 begin 2879 aUrgText := cboUrgency.Items[j]; 2880 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 2881 begin 2882 cboUrgency.ItemIndex := i; 2883 break; 2884 end; 2885 end; 2819 2886 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 2820 2887 end; … … 2836 2903 pnlMessage.Visible := true; 2837 2904 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 2838 end; 2839 {if uGetTnS = 1 then 2840 begin 2841 if responses.QuickOrder < 1 then 2842 begin 2843 for i := 1 to cboAvailTest.Items.Count - 1 do 2844 begin 2845 if piece(cboAvailTest.Items[i],'^',1) = aTypeScreen then 2846 begin 2847 if piece(aSpecimen,'^',1) = '1' then 2848 begin 2849 cboCollTime.Text := calWantTime.Text; 2850 aCollSave := cboCollTime.Text + '^' + cboCollTime.ItemID + '^' + cboCollType.Text + '^' + cboCollType.ItemID; 2851 cboCollTime.Text := ''; 2852 cboCollType.Text := ''; 2853 uSpecimen := 1; 2854 end; 2855 cboModifiers.Text := ''; 2856 cboAvailTest.SelectByID(aTypeScreen); 2857 cboTests.SelectByID(aTypeScreen); 2858 cboTestsClick(self); 2859 //cboAvailTestSelect(Self); 2860 uSpecimen := 0; 2861 cboCollTime.Text := piece(aCollSave,'^',1); 2862 cboCollType.Text := piece(aCollSave,'^',3); 2863 aCollSave := ''; 2864 break; 2865 end; 2866 end; 2867 aMsg := 'An order for Type and Screen has been added to this request' + '.'; 2868 end 2869 else 2870 begin 2871 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 2872 lblTNS.Visible := true; 2873 memMessage.Text := 'TYPE + SCREEN must be added to order'; 2874 memMessage.Visible := false; 2875 pnlMessage.Visible := true; 2876 end; 2877 end; 2878 if (uGetTnS = 1) then 2879 begin 2880 if length(aMsg) > 0 then aMsg := aMsg + crlf + crlf; 2881 ShowMsg(aMsg); 2882 end; } 2883 edtResults.Height := 247; 2884 edtInfo.Height := 247; 2905 end 2906 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 2885 2907 if lvSelectionList.Items.Count > 0 then 2886 2908 begin … … 2899 2921 2900 2922 procedure TfrmODBBank.DisableComponentControls; 2923 var 2924 j: integer; 2901 2925 begin 2902 2926 lblQuantity.Enabled := false; … … 2904 2928 lblModifiers.Enabled := false; 2905 2929 cboModifiers.Enabled := false; 2930 lblQuantity.Caption := 'Quantity'; 2931 lblWanted.Caption := 'Date/Time Wanted'; 2932 lblReason.Caption := 'Reason for Request'; 2906 2933 cboAvailComp.ItemIndex := -1; 2934 for j := uSelectedItems.Count - 1 downto 0 do 2935 begin 2936 if piece(uSelectedItems[j],'^',1) = '0' then 2937 begin 2938 lblReason.Caption := 'Reason for Request*'; 2939 lblWanted.Caption := 'Date/Time Wanted*'; 2940 Break; 2941 end; 2942 end; 2907 2943 end; 2908 2944 … … 2913 2949 lblModifiers.Enabled := true; 2914 2950 cboModifiers.Enabled := true; 2951 lblQuantity.Caption := 'Quantity*'; 2952 lblWanted.Caption := 'Date/Time Wanted*'; 2953 lblReason.Caption := 'Reason for Request*'; 2915 2954 if not(changing) then 2916 2955 if not(uSelUrgency = 'PRE-OP') then … … 2919 2958 cboUrgency.SelectByID(IntToStr(uDfltUrgency)); 2920 2959 if cboUrgency.Text = 'PRE-OP' then 2921 begin 2922 lblSurgery.Enabled := true; 2923 cboSurgery.Enabled := true; 2924 lblSurgery.Caption := 'Surgery*'; 2925 end 2926 else 2927 begin 2928 lblSurgery.Enabled := false; 2929 cboSurgery.Enabled := false; 2930 lblSurgery.Caption := 'Surgery'; 2931 end; 2960 begin 2961 lblSurgery.Enabled := true; 2962 cboSurgery.Enabled := true; 2963 lblSurgery.Caption := 'Surgery*'; 2964 end 2965 else 2966 begin 2967 if Length(cboSurgery.Text) > 0 then 2968 begin 2969 lblSurgery.Enabled := true; 2970 cboSurgery.Enabled := true; 2971 lblSurgery.Caption := 'Surgery*'; 2972 end 2973 else 2974 begin 2975 lblSurgery.Enabled := false; 2976 cboSurgery.Enabled := false; 2977 lblSurgery.Caption := 'Surgery'; 2978 cboSurgery.ItemIndex := -1; 2979 Responses.Update('MISC',1,cboSurgery.Text,cboSurgery.Text); 2980 end; 2981 end; 2982 2932 2983 lblDiagComment.Enabled := true; 2933 2984 end; 2934 2985 2935 2986 procedure TfrmODBBank.DisableDiagTestControls; 2936 begin 2937 lblCollTime.Enabled := false; 2938 calCollTime.Enabled := false; 2939 cboCollTime.Enabled := false; 2940 lblCollType.Enabled := false; 2941 cboCollType.Enabled := false; 2942 cmdImmedColl.Enabled := false; 2987 var 2988 i,j: integer; 2989 diagflg: boolean; 2990 begin 2991 diagflg := false; 2992 for i := 0 to uSelectedItems.Count - 1 do 2993 begin 2994 if (piece(uSelectedItems[i],'^',1) = '1') then 2995 begin 2996 diagflg := true; 2997 Break; 2998 end; 2999 end; 3000 if diagflg = false then 3001 begin 3002 lblCollTime.Enabled := false; 3003 calCollTime.Enabled := false; 3004 cboCollTime.Enabled := false; 3005 lblCollType.Enabled := false; 3006 cboCollType.Enabled := false; 3007 cmdImmedColl.Enabled := false; 3008 end; 3009 lblCollTime.Caption := 'Collection Date/Time'; 3010 lblCollType.Caption := 'Collection Type'; 2943 3011 cboAvailTest.ItemIndex := -1; 2944 cboAvailTest.InitLongList(''); 3012 for j := uSelectedItems.Count - 1 downto 0 do 3013 begin 3014 if piece(uSelectedItems[j],'^',1) = '1' then 3015 begin 3016 lblCollTime.Caption := 'Collection Date/Time*'; 3017 lblCollType.Caption := 'Collection Type*'; 3018 Break; 3019 end; 3020 end; 2945 3021 end; 2946 3022 … … 2953 3029 cboCollType.Enabled := true; 2954 3030 cmdImmedColl.Enabled := true; 3031 lblCollTime.Caption := 'Collection Date/Time*'; 3032 lblCollType.Caption := 'Collection Type*'; 2955 3033 if not(changing) then 2956 3034 if not(uSelUrgency = 'PRE-OP') then … … 2971 3049 begin 2972 3050 if ALabTest = nil then exit; 2973 if ALabTest.LabSubscript = 'BB' then exit;2974 calCollTime.Clear;2975 cboCollTime.Clear;2976 3051 calCollTime.Enabled := True; 2977 3052 lblCollTime.Enabled := True; … … 3024 3099 begin 3025 3100 calCollTime.Enabled := False; 3026 if RespStart <> nil then txtImmedColl.Text := RespStart.EValue; 3101 cboCollType.SelectByID('I'); 3102 SetupCollTimes('I'); 3103 //cboCollTypeClick(self); 3104 //txtImmedColl.Enabled := True; 3105 if RespStart <> nil then 3106 begin 3107 txtImmedColl.Text := RespStart.EValue; 3108 end; 3027 3109 end; 3028 3110 end … … 3032 3114 end; 3033 3115 3116 procedure TfrmODBBank.cboAvailTestEnter(Sender: TObject); 3117 var 3118 j: integer; 3119 begin 3120 inherited; 3121 if Length(cboAvailTest.Text) > 0 then Exit; 3122 for j := uSelectedItems.Count - 1 downto 0 do 3123 begin 3124 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 3125 begin 3126 lvSelectionList.Items[j].Selected := true; 3127 lvSelectionListClick(self); 3128 Break; 3129 end; 3130 end; 3131 end; 3132 3034 3133 procedure TfrmODBBank.cboAvailTestExit(Sender: TObject); 3035 3134 begin 3036 3135 inherited; 3037 if (Length(cboAvailTest.ItemID) = 0) or (cboAvailTest.ItemID = '0') then Exit; 3136 if (Length(cboAvailTest.Text)>0) and (Length(cboAvailTest.ItemID) = 0) or (cboAvailTest.ItemID = '0') then 3137 begin 3138 ShowMsg('Invalid Test Selection. Please select a valid Test.'); 3139 cboAvailTestSelect(cboAvailTest); 3140 cboAvailTest.SetFocus; 3141 Exit; 3142 end; 3038 3143 if cboAvailTest.ItemID = FLastLabID then Exit; 3039 cboAvailTestSelect(cboAvailTest); 3040 cboAvailTest.SetFocus; 3041 PostMessage(Handle, WM_NEXTDLGCTL, 0, 0); 3042 end; 3043 3044 procedure TfrmODBBank.cboAvailCompChange(Sender: TObject); 3045 begin 3046 inherited; 3047 changing := true; 3048 changing := false; 3144 if not (Length(cboAvailTest.ItemID) = 0) then cboAvailTestSelect(cboAvailTest); 3145 end; 3146 3147 procedure TfrmODBBank.cboAvailCompEnter(Sender: TObject); 3148 var 3149 j: integer; 3150 begin 3151 inherited; 3152 if Length(cboAvailComp.Text) > 0 then Exit; 3153 for j := uSelectedItems.Count - 1 downto 0 do 3154 begin 3155 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 3156 begin 3157 lvSelectionList.Items[j].Selected := true; 3158 lvSelectionListClick(self); 3159 Break; 3160 end; 3161 end; 3049 3162 end; 3050 3163 … … 3052 3165 begin 3053 3166 inherited; 3054 if (Length(cboAvailComp.ItemID) = 0) or (cboAvailComp.ItemID = '0') then Exit; 3167 if (Length(cboAvailComp.Text)>0) and (Length(cboAvailComp.ItemID) = 0) or (cboAvailComp.ItemID = '0') then 3168 begin 3169 ShowMsg('Invalid Component selection. Please select a valid Component.'); 3170 cboAvailCompSelect(cboAvailComp); 3171 cboAvailComp.SetFocus; 3172 Exit; 3173 end; 3055 3174 if cboAvailComp.ItemID = FLastLabID then Exit; 3056 cboAvailCompSelect(cboAvailComp); 3057 cboAvailComp.SetFocus; 3058 PostMessage(Handle, WM_NEXTDLGCTL, 0, 0); 3175 if not (Length(cboAvailComp.ItemID) = 0) then cboAvailCompSelect(cboAvailComp); 3059 3176 end; 3060 3177 … … 3130 3247 end; 3131 3248 3249 procedure TfrmODBBank.pnlBloodComponentsClick(Sender: TObject); 3250 begin 3251 inherited; 3252 cboAvailComp.SetFocus; 3253 end; 3254 3255 procedure TfrmODBBank.pnlBloodComponentsEnter(Sender: TObject); 3256 begin 3257 inherited; 3258 pnlBloodComponents.Color := clActiveborder; 3259 end; 3260 3261 procedure TfrmODBBank.pnlBloodComponentsExit(Sender: TObject); 3262 begin 3263 inherited; 3264 pnlBloodcomponents.Color := clBtnFace; 3265 end; 3266 3267 procedure TfrmODBBank.pnlDiagnosticTestsClick(Sender: TObject); 3268 begin 3269 inherited; 3270 cboAvailTest.SetFocus; 3271 end; 3272 3273 procedure TfrmODBBank.pnlDiagnosticTestsEnter(Sender: TObject); 3274 begin 3275 inherited; 3276 pnlDiagnosticTests.Color := clActiveBorder; 3277 end; 3278 3279 procedure TfrmODBBank.pnlDiagnosticTestsExit(Sender: TObject); 3280 begin 3281 inherited; 3282 pnlDiagnosticTests.Color := clBtnFace; 3283 end; 3284 3132 3285 procedure TfrmODBBank.cboCollTimeChange(Sender: TObject); 3133 3286 var … … 3163 3316 end; 3164 3317 3318 procedure TfrmODBBank.cboCollTimeEnter(Sender: TObject); 3319 var 3320 j: integer; 3321 begin 3322 inherited; 3323 if Length(cboAvailTest.Text) > 0 then Exit; 3324 for j := uSelectedItems.Count - 1 downto 0 do 3325 begin 3326 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 3327 begin 3328 lvSelectionList.Items[j].Selected := true; 3329 lvSelectionListClick(self); 3330 Break; 3331 end; 3332 end; 3333 end; 3334 3165 3335 procedure TfrmODBBank.cboCollTypeChange(Sender: TObject); 3166 3336 begin … … 3180 3350 SetupCollTimes(cboCollType.ItemID); 3181 3351 if Length(cboCollType.Text) > 0 then Responses.Update('COLLECT',1,cboCollType.ItemID,cboCollType.ItemID); 3182 FLastCollType := cboCollType.ItemID;3183 3352 calCollTimeChange(self); 3353 end; 3354 3355 procedure TfrmODBBank.cboCollTypeClick(Sender: TObject); 3356 begin 3357 inherited; 3358 FOrderAction := 0; 3359 end; 3360 3361 procedure TfrmODBBank.cboCollTypeEnter(Sender: TObject); 3362 var 3363 j: integer; 3364 begin 3365 inherited; 3366 if Length(cboAvailTest.Text) > 0 then Exit; 3367 for j := uSelectedItems.Count - 1 downto 0 do 3368 begin 3369 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 3370 begin 3371 lvSelectionList.Items[j].Selected := true; 3372 lvSelectionListClick(self); 3373 Break; 3374 end; 3375 end; 3184 3376 end; 3185 3377 … … 3226 3418 end; 3227 3419 3420 procedure TfrmODBBank.cboModifiersEnter(Sender: TObject); 3421 var 3422 j: integer; 3423 begin 3424 inherited; 3425 if Length(cboAvailComp.Text) > 0 then Exit; 3426 for j := uSelectedItems.Count - 1 downto 0 do 3427 begin 3428 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 3429 begin 3430 lvSelectionList.Items[j].Selected := true; 3431 lvSelectionListClick(self); 3432 Break; 3433 end; 3434 end; 3435 end; 3436 3228 3437 procedure TfrmODBBank.LoadModifiers(AComboBox:TORComboBox); 3229 3438 var … … 3257 3466 begin 3258 3467 Clear; 3259 for i := 0 to uUrgencyList.Count - 1 do3468 {for i := 0 to uUrgencyList.Count - 1 do 3260 3469 if (piece(uUrgencyList[i],'^',2) = 'STAT') and (StatAllowed(Patient.DFN) = false) then 3261 3470 Continue 3262 3471 else 3263 Items.Add(uUrgencyList[i]); 3472 Items.Add(uUrgencyList[i]); } 3473 for i := 0 to uUrgencyList.Count - 1 do 3474 Items.Add(uUrgencyList[i]); 3264 3475 end; 3265 3476 end; … … 3281 3492 if cboCollType.ItemID = 'LC' then 3282 3493 begin 3283 if FLastLabCollTime <> ''then3494 if (FLastLabCollTime <> '') and (length(cboCollTime.Text) < 1) then 3284 3495 cboCollTime.SelectByID(piece(FLastLabCollTime,'^',1)); 3285 3496 end 3286 else 3497 else if length(calcollTime.Text) < 1 then 3287 3498 begin 3288 3499 if FLastCollTime = 'TODAY' then … … 3293 3504 calCollTime.Text := FormatFMDateTime('mmm dd,yyyy@hh:nn',StrToFMDateTime(FLastCollTime)); 3294 3505 end; 3295 if FLastCollType <> ''then3506 if (FLastCollType <> '') and (length(cboCollType.Text) < 1) then 3296 3507 cboCollType.SelectByID(FLastCollType); 3297 3508 if uSelectedItems.Count > 0 then … … 3325 3536 begin 3326 3537 inherited; 3538 memDiagComment.Text := StringReplace(memDiagComment.Text,CRLF,' ',[rfReplaceAll]); 3327 3539 if (length(memDiagComment.Text) > 250) then 3328 3540 begin … … 3353 3565 end; 3354 3566 3567 procedure TfrmODBBank.FormShow(Sender: TObject); 3568 begin 3569 inherited; 3570 pgeProduct.SetFocus; 3571 end; 3572 3355 3573 procedure TfrmODBBank.btnRemoveClick(Sender: TObject); 3356 3574 var … … 3358 3576 x, aName, aModifier, aReason, aTypeScreen: string; 3359 3577 aList: TStringList; 3360 aSel, aSelTst : boolean;3578 aSel, aSelTst, aSelComp, aGotTNS : boolean; 3361 3579 begin 3362 3580 inherited; … … 3369 3587 aSel := false; 3370 3588 aSelTst := false; 3589 aSelComp := false; 3590 aGotTNS := false; 3371 3591 ExtractTypeScreen(aList, uVBECList); 3372 3592 if aList.Count > 0 then aTypeScreen := aList[0]; … … 3381 3601 cboAvailComp.ItemIndex := -1; 3382 3602 tQuantity.Text := ''; 3603 tQuantity.Enabled := false; 3604 lblQuantity.Enabled := false; 3383 3605 cboAvailTest.ItemIndex := -1; 3384 3606 uGetTnS := 0; … … 3398 3620 if lvSelectionList.Items[i].SubItems[3] = piece(uSelectedItems[j],'^',2) then 3399 3621 begin 3400 {if (uGetTnS = 1) and (lvSelectionList.Items[i].SubItems[3] = aTypeScreen) then3401 begin3402 uGetTnS := 1;3403 lblTNS.Caption := 'TYPE+SCREEN must be added to order';3404 lblTNS.Visible := true;3405 memMessage.Text := 'TYPE + SCREEN must be added to order';3406 //memMessage.Visible := true;3407 pnlMessage.Visible := true;3408 pnlDiagnosticTests.Caption := 'Diagnostic Tests*';3409 end; }3410 3622 uSelectedItems.Delete(j); 3411 3623 lvSelectionList.Items[i].Delete; … … 3415 3627 end; 3416 3628 end; 3417 for i := uSelectedItems.Count - 1 downto 0 do3418 begin 3419 if (not(piece(uSelectedItems[i],'^',1) = '1')) and (uTNSOrders.Count < 1) then // and (SpecimenNeeded(aList, uVBECList, StrToInt(piece(uSelectedItems[i],'^',9))))then3629 for i := lvSelectionList.Items.Count - 1 downto 0 do 3630 begin 3631 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 3420 3632 begin 3421 uGetTnS := 1; 3422 lblTNS.Caption := 'TYPE+SCREEN must be added to order'; 3423 lblTNS.Visible := true; 3424 memMessage.Text := 'TYPE + SCREEN must be added to order'; 3425 //memMessage.Visible := true; 3426 pnlMessage.Visible := true; 3427 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 3633 aGotTNS := true; 3428 3634 break; 3429 3635 end; 3430 3636 end; 3431 3637 if aGotTNS = false then 3638 begin 3639 for i := uSelectedItems.Count - 1 downto 0 do 3640 begin 3641 if not(piece(uSelectedItems[i],'^',1) = '1') and (uTNSOrders.Count < 1) and (piece(uSelectedItems[i],'^',5) = '1') then //CQ 17349 3642 begin 3643 uGetTnS := 1; 3644 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 3645 lblTNS.Visible := true; 3646 memMessage.Text := 'TYPE + SCREEN must be added to order'; 3647 pnlMessage.Visible := true; 3648 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 3649 break; 3650 end 3651 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 3652 end; 3653 end; 3432 3654 if (aSel = false) and (lvSelectionList.Items.Count > 0) then 3433 3655 begin … … 3436 3658 end; 3437 3659 Responses.Clear; 3660 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 3661 lblCollTime.Caption := 'Collection Date/Time'; 3662 lblCollType.Caption := 'Collection Type'; 3663 lblQuantity.Caption := 'Quantity'; 3664 lblWanted.Caption := 'Date/Time Wanted'; 3665 lblReason.Caption := 'Reason for Request'; 3438 3666 if lvSelectionList.Items.Count < 1 then 3439 3667 begin 3440 cboReasons.ItemIndex := -1; 3441 memDiagComment.Text := ''; 3442 cboSurgery.ItemIndex := -1; 3443 cboUrgency.ItemIndex := -1; 3668 uGetTnS := 0; 3669 lblTNS.Caption := ''; 3670 lblTNS.Visible := false; 3671 memMessage.Text := ''; 3672 pnlMessage.Visible := false; 3673 FLastItemID := ''; 3674 InitDialog; 3675 cboModifiers.ItemIndex := -1; 3676 cboAvailTest.ItemIndex := -1; 3677 cboAvailComp.ItemIndex := -1; 3444 3678 cboCollType.ItemIndex := -1; 3445 3679 cboCollTime.ItemIndex := -1; 3446 3680 cboQuick.ItemIndex := -1; 3447 calCollTime.Text := ''; 3681 calWantTime.Text := ''; 3682 GroupBox1.Visible := true; 3683 tQuantity.Text := ''; 3684 FLastCollType := ''; 3685 FLastCollTime := ''; 3686 FLastLabCollTime := ''; 3687 txtImmedColl.Text := ''; 3688 calCollTime.text := ''; 3689 lblNoBloodReq.Visible := false; 3448 3690 end; 3449 3691 for i := 0 to uSelectedItems.Count - 1 do … … 3454 3696 begin 3455 3697 if Length(piece(x,'^',2)) > 0 then Responses.Update('ORDERABLE', CurAdd, piece(x,'^',2), aName); 3698 lblCollTime.Caption := 'Collection Date/Time*'; 3699 lblCollType.Caption := 'Collection Type*'; 3456 3700 aSelTst := true; 3457 3701 end … … 3465 3709 cboAvailComp.ItemIndex := -1; 3466 3710 tQuantity.Text := ''; 3711 lblQuantity.Caption := 'Quantity*'; 3712 lblWanted.Caption := 'Date/Time Wanted*'; 3713 lblReason.Caption := 'Reason for Request*'; 3714 //aSelComp := true; 3467 3715 end; 3468 3716 Inc(CurAdd); … … 3474 3722 calCollTime.Text := ''; 3475 3723 end; 3724 {if aSelcomp = false then 3725 lblNoBloodReq.Visible := false 3726 else 3727 lblNoBloodReq.Visible := true; } 3476 3728 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 3477 3729 if cboCollType.ItemID = 'LC' then … … 3569 3821 memMessage.Text := ''; 3570 3822 pnlMessage.Visible := false; 3823 FLastItemID := ''; 3571 3824 InitDialog; 3572 3825 cboModifiers.ItemIndex := -1; … … 3583 3836 GroupBox1.Visible := true; 3584 3837 tQuantity.Text := ''; 3838 tQuantity.Enabled := false; 3839 lblQuantity.Enabled := false; 3585 3840 FLastCollType := ''; 3586 3841 FLastCollTime := ''; 3587 3842 FLastLabCollTime := ''; 3588 3843 txtImmedColl.Text := ''; 3844 calCollTime.text := ''; 3845 lblNoBloodReq.Visible := false; 3846 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 3847 lblCollTime.Caption := 'Collection Date/Time'; 3848 lblCollType.Caption := 'Collection Type'; 3849 lblQuantity.Caption := 'Quantity'; 3850 lblWanted.Caption := 'Date/Time Wanted'; 3851 lblReason.Caption := 'Reason for Request'; 3589 3852 end; 3590 3853 … … 3622 3885 3623 3886 procedure TfrmODBBank.calWantTimeChange(Sender: TObject); 3624 begin 3625 inherited; 3887 var 3888 i: integer; 3889 aList: TStringList; 3890 aSpecimen, aSpecimenUID, aSpecimenReq: string; 3891 aChanging: Boolean; 3892 begin 3893 inherited; 3894 aList := TStringList.Create; 3895 aChanging := changing; 3896 try 3897 aSpecimen := ''; 3898 aSpecimenUID := ''; 3899 aSpecimenReq := ''; 3626 3900 if uSelectedItems.Count > 0 then 3627 3901 begin 3628 with calWantTime do if not Changing then3902 with calWantTime do if not changing then 3629 3903 begin 3630 3904 if FMDateTime = 0 then 3631 3905 begin 3632 3906 ShowMsg('Invalid Date/Time entered'); 3633 Changing := true;3907 changing := true; 3634 3908 calWantTime.Text := ''; 3635 Changing := false;3909 changing := aChanging; 3636 3910 Exit; 3637 3911 end … … 3642 3916 begin 3643 3917 ShowMsg('Date/Time Wanted must be a future Date/Time'); 3644 Changing := true;3918 changing := true; 3645 3919 calWantTime.Text := ''; 3646 Changing := false;3920 changing := aChanging; 3647 3921 Exit; 3648 3922 end; … … 3651 3925 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 3652 3926 memOrder.Text := Responses.OrderText; 3927 aList.Clear; 3928 ExtractSpecimen(aList, uVBECList); 3929 if aList.Count > 0 then 3930 begin 3931 aSpecimen := piece(aList[0], '^', 1); 3932 aSpecimenUID := piece(aList[0], '^', 2); 3933 end; 3934 aList.Clear; 3935 ExtractSpecimens(aList, uVBECList); //Get specimen values to pass back to Server 3936 for i := 0 to aList.Count - 1 do 3937 begin 3938 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 3939 begin 3940 aSpecimenReq := piece(aList[i],'^',2); 3941 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 3942 aSpecimenUID := ''; 3943 break; 3944 end; 3945 end; 3946 Responses.Update('SPECSTS', 1, aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID, aSpecimenReq); 3947 end; 3948 finally 3949 aList.Free; 3950 end; 3951 end; 3952 3953 procedure TfrmODBBank.calWantTimeEnter(Sender: TObject); 3954 var 3955 j: integer; 3956 begin 3957 inherited; 3958 if Length(cboAvailComp.Text) > 0 then Exit; 3959 for j := uSelectedItems.Count - 1 downto 0 do 3960 begin 3961 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 3962 begin 3963 lvSelectionList.Items[j].Selected := true; 3964 lvSelectionListClick(self); 3965 Break; 3966 end; 3653 3967 end; 3654 3968 end; … … 3679 3993 else 3680 3994 begin 3681 lblSurgery.Enabled := false; 3682 cboSurgery.Enabled := false; 3683 lblSurgery.Caption := 'Surgery'; 3684 cboSurgery.ItemIndex := -1; 3685 Responses.Update('MISC',1,cboSurgery.Text,cboSurgery.Text); 3995 if Length(cboSurgery.Text) > 0 then 3996 begin 3997 lblSurgery.Enabled := true; 3998 cboSurgery.Enabled := true; 3999 lblSurgery.Caption := 'Surgery*'; 4000 end 4001 else 4002 begin 4003 lblSurgery.Enabled := false; 4004 cboSurgery.Enabled := false; 4005 lblSurgery.Caption := 'Surgery'; 4006 cboSurgery.ItemIndex := -1; 4007 Responses.Update('MISC',1,cboSurgery.Text,cboSurgery.Text); 4008 end; 3686 4009 end; 3687 4010 end … … 3700 4023 procedure TfrmODBBank.cboSurgeryChange(Sender: TObject); 3701 4024 var 3702 aList : TStringList;4025 aList, bList, cList: TStringList; 3703 4026 i,j,aMSBOS,aMSBOSContinue: integer; 3704 x: string; 3705 handled: boolean; 3706 begin 3707 inherited; 4027 x,aTypeScreen: string; 4028 handled,aGotTNS: boolean; 4029 xLabTest: TLabTest; 4030 begin 4031 inherited; 4032 cboSurgery.Text := StringReplace(cboSurgery.Text,CRLF,' ',[rfReplaceAll]); 3708 4033 aList := TStringList.Create; 4034 bList := TStringList.Create; 4035 cList := TStringList.Create; 3709 4036 handled := false; 4037 //uGetTNS := 0; 4038 //aGotTNS := false; 4039 ExtractTypeScreen(aList, uVBECList); 4040 if aList.Count > 0 then aTypeScreen := aList[0]; 4041 aList.Clear; 4042 bList.Clear; 4043 cList.Clear; 3710 4044 try 3711 if (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) then 4045 cboSurgery.DroppedDown := false; 4046 if (Length(cboSurgery.ItemID) > 0) then 4047 begin 4048 for j := 0 to uSelectedItems.Count - 1 do 4049 begin 4050 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 4051 if (piece(uSelectedItems[j],'^',1) = '0') and (not(piece(uSelectedItems[j],'^',3)='')) and (StrToInt(piece(uSelectedItems[j],'^',3)) > 0) and (piece(cboSurgery.Items[cboSurgery.ItemIndex],'^',3) = '1') then 4052 begin 4053 cList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3)); 4054 end; 4055 xLabTest.Free; 4056 end; 4057 end; 4058 if (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) and (Length(cboAvailComp.Text) > 0) then 3712 4059 begin 3713 4060 aList.Clear; … … 3716 4063 begin 3717 4064 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 3718 and ( piece(aList[i],'^',3) = cboSurgery.Text) then4065 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 3719 4066 begin 3720 4067 aMSBOS := StrToInt(piece(aList[i],'^',4)); 3721 4068 if (aMSBOS > 0) and (StrToInt(tQuantity.Text) > aMSBOS) then 3722 4069 begin 3723 with Application do 3724 begin 3725 NormalizeTopMosts; 3726 aMSBOSContinue := 3727 MessageBox(PChar('The number of unit Quantity selected (' + tQuantity.Text + 3728 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 3729 + IntToStr(aMSBOS) + 3730 ') for the ' + cboSurgery.text + 3731 ' surgical procedure selected.' + CRLF + CRLF + 'Continue to order ' + tQuantity.Text + ' units?'), 3732 PChar('Maximum Number of Units Exceeded'), 3733 MB_YESNO); 3734 RestoreTopMosts; 3735 end; 3736 if aMSBOSContinue = 7 then 3737 begin 3738 ShowMsg('Please enter a new quantity for ' + cboAvailComp.Text); 3739 tQuantity.Text := '0'; 3740 tQuantity.SelLength := 2; 3741 tQuantity.SelectAll; 3742 break; 3743 end; 4070 bList.Add(aLabTest.TestName + '^' + tQuantity.Text + '^' + IntToStr(aMSBOS)); 3744 4071 end; 3745 4072 handled := true; … … 3754 4081 for j := 0 to uSelectedItems.Count - 1 do 3755 4082 begin 3756 ALabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses);4083 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 3757 4084 for i := 0 to aList.Count - 1 do 3758 4085 begin 3759 4086 if (piece(uSelectedItems[j],'^',1) = '0') 3760 and (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID)3761 and ( piece(aList[i],'^',3) = cboSurgery.Text) then4087 and (StrToInt(piece(aList[i],'^',1)) = xLabTest.ItemID) 4088 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 3762 4089 begin 3763 4090 aMSBOS := StrToInt(piece(aList[i],'^',4)); 3764 4091 if (aMSBOS > 0) and (length(piece(uSelectedItems[j],'^',3)) > 0) and (StrToInt(piece(uSelectedItems[j],'^',3)) > aMSBOS) then 3765 4092 begin 3766 with Application do 3767 begin 3768 NormalizeTopMosts; 3769 aMSBOSContinue := 3770 MessageBox(PChar('The number of unit Quantity selected (' + piece(uSelectedItems[j],'^',3) + 3771 ') for ' + lvSelectionList.Items[j].Caption + ' exceeds the maximum number of units (' 3772 + IntToStr(aMSBOS) + 3773 ') for the ' + cboSurgery.text + 3774 ' surgical procedure selected.' + CRLF + CRLF + 'Continue to order ' + piece(uSelectedItems[j],'^',3) + ' units?'), 3775 PChar('Maximum Number of Units Exceeded'), 3776 MB_YESNO); 3777 RestoreTopMosts; 3778 end; 3779 if aMSBOSContinue = 7 then 3780 begin 3781 ShowMsg('Please enter a new quantity for ' + lvSelectionList.Items[j].Caption); 3782 tQuantity.Text := '0'; 3783 tQuantity.SelLength := 2; 3784 tQuantity.SelectAll; 3785 x := uSelectedItems[j]; 3786 SetPiece(x,U,3,''); 3787 uSelectedItems[j] := x; 3788 lvSelectionList.Items[j].SubItems[0] := ''; 3789 RePaint; 3790 break; 3791 end; 4093 bList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3) + '^' + IntToStr(aMSBOS)); 3792 4094 end; 3793 4095 break; 3794 4096 end; 3795 4097 end; 4098 xLabTest.Free; 4099 end; 4100 end; 4101 if (uChangingMSBOS = false) and (cList.Count > 0) then 4102 begin 4103 lblNoBloodReq.Visible := true; 4104 with Application do 4105 begin 4106 NormalizeTopMosts; 4107 aMSBOSContinue := 4108 MessageBox(PChar('No blood is required for the surgical procedure: ' + cboSurgery.text + 4109 '.' + CRLF + 4110 'If you still need to order any components, please enter a justification in the Comment box.' 4111 + CRLF + CRLF + 'Do you want me to remove ALL the component orders you''ve just entered? '), 4112 PChar('No Blood Required'),MB_YESNO); 4113 RestoreTopMosts; 4114 end; 4115 if aMSBOSContinue = 6 then 4116 begin 4117 tQuantity.Text := ''; 4118 bList.Clear; 4119 for j := uSelectedItems.Count - 1 downto 0 do 4120 begin 4121 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 4122 begin 4123 lvSelectionList.Items[j].Delete; 4124 uSelectedItems.Delete(j); 4125 Responses.Update('ORDERABLE', (j+1) ,'', ''); 4126 Responses.Update('MODIFIER', (j+1), '', ''); 4127 Responses.Update('QTY', (j+1), '', ''); 4128 end; 4129 end; 4130 cboAvailComp.Text := ''; 4131 cboAvailComp.ItemIndex := -1; 4132 cboModifiers.Text := ''; 4133 cboModifiers.ItemIndex := -1; 4134 lblNoBloodReq.Visible := false; 4135 //if fODBBank. Active then cboAvailTest.SetFocus; 4136 lblTNS.Caption := ''; 4137 lblTNS.Visible := false; 4138 uGetTNS := 0; 4139 aGotTNS := false; 4140 DisableComponentControls; 4141 for i := lvSelectionList.Items.Count - 1 downto 0 do 4142 begin 4143 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 4144 begin 4145 aGotTNS := true; 4146 break; 4147 end; 4148 end; 4149 for i := uSelectedItems.Count - 1 downto 0 do 4150 begin 4151 if (aGotTNS = false) and not(piece(uSelectedItems[i],'^',1) = '1') and (uTNSOrders.Count < 1) and (piece(uSelectedItems[i],'^',5) = '1') then //CQ 17349 4152 begin 4153 uGetTnS := 1; 4154 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 4155 lblTNS.Visible := true; 4156 memMessage.Text := 'TYPE + SCREEN must be added to order'; 4157 pnlMessage.Visible := true; 4158 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 4159 break; 4160 end 4161 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 4162 end; 4163 end; 4164 end 4165 else 4166 begin 4167 lblNoBloodReq.Visible := false; 4168 end; 4169 4170 if (uChangingMSBOS = false) and (bList.Count > 0) then 4171 begin 4172 x := ''; 4173 for i := 0 to bList.Count - 1 do 4174 begin 4175 x := x + CRLF + piece(bList[i],'^',1) + ' (' + piece(bList[i],'^',2) + ') Max allowed: ' + piece(bList[i],'^',3); 4176 end; 4177 with Application do 4178 begin 4179 NormalizeTopMosts; 4180 aMSBOSContinue := 4181 MessageBox(PChar('The number of units ordered' + x + CRLF + 4182 'Exceeds the maximum number recommended for ' 4183 + cboSurgery.text + CRLF + CRLF + 4184 'If you need to order more than the recommended maximum units, please enter a justification in the Comment box.') 4185 ,PChar('Maximum Number of Units Exceeded'), 4186 MB_OK); 4187 RestoreTopMosts; 3796 4188 end; 3797 4189 end; … … 3806 4198 Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 3807 4199 end; 3808 memOrder.Text := Responses.OrderText; 4200 memOrder.Text := Responses.OrderText; 3809 4201 finally 3810 4202 aList.Free; 4203 bList.Free; 4204 cList.Free; 3811 4205 end; 3812 4206 end; … … 3844 4238 end; 3845 4239 try 3846 if (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) then 3847 begin 4240 if not(aLabTest = nil) and (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) then 4241 begin 4242 uChangingMSBOS := true; 4243 cboSurgeryChange(self); 4244 uChangingMSBOS := false; 3848 4245 aList.Clear; 3849 4246 ExtractMSBOS(aList, uVBECList); //Get maximum units for selected Surgery … … 3851 4248 begin 3852 4249 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 3853 and ( piece(aList[i],'^',3) = cboSurgery.Text) then4250 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) and (Length(tQuantity.Text) > 0) then 3854 4251 begin 3855 4252 aMSBOS := StrToInt(piece(aList[i],'^',4)); … … 3861 4258 aMSBOSContinue := 3862 4259 MessageBox(PChar('The number of units ordered (' + tQuantity.Text + 3863 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 3864 + IntToStr(aMSBOS) + 3865 ') for the ' + cboSurgery.text + 3866 ' surgical procedure selected.' + CRLF + CRLF + 'Do you wish to continue?'), 3867 PChar('Maximum Number of Units Exceeded'), 3868 MB_YESNO); 4260 ') for ' + aLabTest.TestName + ' Exceeds the maximum number recommended (' 4261 + IntToStr(aMSBOS) + 4262 ') for the ' + cboSurgery.text + 4263 ' surgical procedure.' + CRLF + 4264 'If you need to order more than the maximum number of units, please enter a justification in the Comment box.' 4265 + CRLF + CRLF + 'Edit the Blood component Quantity?'), 4266 PChar('Maximum Number of Units Exceeded'), 4267 MB_YESNO); 4268 3869 4269 RestoreTopMosts; 3870 4270 end; 3871 if aMSBOSContinue = 7then4271 if aMSBOSContinue = 6 then 3872 4272 begin 3873 4273 ShowMsg('Please enter a new quantity for ' + cboAvailComp.Text); … … 3927 4327 3928 4328 procedure TfrmODBBank.tQuantityEnter(Sender: TObject); 4329 var 4330 j: integer; 3929 4331 begin 3930 4332 inherited; 3931 4333 tQuantity.SelLength := 2; 3932 4334 tQuantity.SelectAll; 4335 if Length(cboAvailComp.Text) > 0 then Exit; 4336 for j := uSelectedItems.Count - 1 downto 0 do 4337 begin 4338 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 4339 begin 4340 lvSelectionList.Items[j].Selected := true; 4341 lvSelectionListClick(self); 4342 Break; 4343 end; 4344 end; 4345 end; 4346 4347 procedure TfrmODBBank.txtImmedCollEnter(Sender: TObject); 4348 var 4349 j: integer; 4350 begin 4351 inherited; 4352 if Length(cboAvailTest.Text) > 0 then Exit; 4353 for j := uSelectedItems.Count - 1 downto 0 do 4354 begin 4355 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 4356 begin 4357 lvSelectionList.Items[j].Selected := true; 4358 lvSelectionListClick(self); 4359 Break; 4360 end; 4361 end; 3933 4362 end; 3934 4363 … … 3970 4399 end; 3971 4400 4401 procedure TfrmODBBank.calCollTimeEnter(Sender: TObject); 4402 var 4403 j: integer; 4404 begin 4405 inherited; 4406 if Length(cboAvailTest.Text) > 0 then Exit; 4407 for j := uSelectedItems.Count - 1 downto 0 do 4408 begin 4409 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 4410 begin 4411 lvSelectionList.Items[j].Selected := true; 4412 lvSelectionListClick(self); 4413 Break; 4414 end; 4415 end; 4416 end; 4417 3972 4418 end. -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODBase.dfm
r829 r1693 25 25 Width = 430 26 26 Height = 48 27 TabStop = False28 27 Color = clCream 29 28 Ctl3D = True … … 32 31 ScrollBars = ssVertical 33 32 TabOrder = 0 34 Caption = 'Order'35 33 end 36 34 object cmdAccept: TButton [1] -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODBase.pas
r829 r1693 44 44 private 45 45 FDialog: string; 46 FDialogDisplayName: string; 46 47 FResponseList: TList; 47 48 FPrompts: TList; … … 99 100 const AnIValue, AnEValue: string); 100 101 property Dialog: string read FDialog write SetDialog; 102 property DialogDisplayName: string read FDialogDisplayName write FDialogDisplayName; 101 103 property DisplayGroup: Integer read FDisplayGroup write FDisplayGroup; 102 104 property CopyOrder: string read FCopyOrder write SetCopyOrder; … … 645 647 if CopyOrder <> '' then DupORIFN := CopyOrder; 646 648 //if {(CopyOrder <> '') or} (EditOrder <> '') then Exit; // only check new orders 647 with FResponseList do for i := 0 to Count - 1 do with TResponse(Items[i]) do 648 if (PromptID = 'ORDERABLE') or (PromptID = 'ADDITIVE') then 649 begin 650 OrderableIEN := IValue; 651 TheInstance := Instance; 652 PkgPart := ''; 653 if AFillerID = 'LR' then PkgPart := '^LR^' + IValueFor('SPECIMEN', TheInstance); 654 if (AFillerID = 'PSI') or (AFillerID = 'PSO') or (AFillerID = 'PSH') 655 then PkgPart := U + AFillerID + U + IValueFor('DRUG', TheInstance); 656 // was -- then PkgPart := '^PS^' + IValueFor('DRUG', TheInstance); 657 if AFillerID = 'PSIV' then 649 with FResponseList do 650 for i := 0 to FResponseList.Count - 1 do 658 651 begin 659 if PromptID = 'ORDERABLE' then PkgPart := '^PSIV^B;' + IValueFor('VOLUME', TheInstance); 660 if PromptID = 'ADDITIVE' then PkgPart := '^PSIV^A'; 652 with TResponse(Items[i]) do 653 begin 654 if (PromptID = 'ORDERABLE') or (PromptID = 'ADDITIVE') then 655 begin 656 OrderableIEN := IValue; 657 TheInstance := Instance; 658 PkgPart := ''; 659 if AFillerID = 'LR' then PkgPart := '^LR^' + IValueFor('SPECIMEN', TheInstance); 660 if (AFillerID = 'PSI') or (AFillerID = 'PSO') or (AFillerID = 'PSH') or (AFillerID = 'PSNV') 661 then PkgPart := U + AFillerID + U + IValueFor('DRUG', TheInstance); 662 // was -- then PkgPart := '^PS^' + IValueFor('DRUG', TheInstance); 663 if AFillerID = 'PSIV' then 664 begin 665 if PromptID = 'ORDERABLE' then PkgPart := '^PSIV^B;' + IValueFor('VOLUME', TheInstance); 666 if PromptID = 'ADDITIVE' then PkgPart := '^PSIV^A'; 667 end; 668 AList.Add(OrderableIEN + PkgPart); 669 end; 670 //AGP IV CHANGES 671 if (AFillerID = 'PSI') or (AFillerID = 'PSO') or (AFillerID = 'PSH') or (AFillerID = 'PSIV') or (AFillerID = 'PSNV') then 672 begin 673 IF PromptID = 'COMMENT' then continue; 674 Alist.Add(AFillerID + U + PromptID + U + InttoStr(Instance) + U + IValueFor(PromptID, Instance) + U + EValueFor(PromptID, Instance)); 675 end; 661 676 end; 662 AList.Add(OrderableIEN + PkgPart); 663 end; 677 end; 664 678 AStartDtTm := IValueFor('START', 1); 665 679 end; … … 1138 1152 ExpandOrderObjects(tmp, HasObjects); 1139 1153 FOrderContainsObjects := FOrderContainsObjects or HasObjects; 1154 1155 if frmODBase.FAbortOrder then 1156 begin 1157 SetTemplateDialogCanceled(FALSE); 1158 Exit; 1159 end; 1160 1140 1161 if IEN <> 0 then 1141 1162 begin … … 1155 1176 CheckBoilerplate4Fields(tmp, cptn); 1156 1177 List.Text := tmp; 1178 if WasTemplateDialogCanceled then frmODBase.FAbortOrder := True; 1179 1157 1180 end; 1158 1181 … … 1301 1324 {Caller needs to set pnlMessage.TabOrder} 1302 1325 begin 1326 //TDP - Added pnlMessage.Caption for screen reader readability 1327 pnlMessage.Caption := 'Informational Message.'; 1303 1328 memMessage.Lines.SetText(PChar(AMessage)); 1304 1329 //begin CQ: 2640 … … 1323 1348 FOrderAction := OrderAction; 1324 1349 FAbortOrder := False; 1350 SetTemplateDialogCanceled(False); //wat/jh CQ 20061 1325 1351 case OrderAction of 1326 1352 ORDER_NEW: {nothing}; … … 1468 1494 StatusText('Order Checking...'); 1469 1495 Responses.BuildOCItems(OIList, StartDtTm, FillerID); 1470 OrderChecksOnAccept(Responses.OrderChecks, FillerID, StartDtTm, OIList, DupORIFN );1496 OrderChecksOnAccept(Responses.OrderChecks, FillerID, StartDtTm, OIList, DupORIFN,'0'); 1471 1497 DupORIFN := ''; 1472 1498 StatusText(''); … … 1490 1516 begin 1491 1517 Result := True; 1518 IsDelayOrder := False; 1492 1519 Validate(ErrMsg); 1493 IsDelayOrder := False;1494 1520 if Length(ErrMsg) > 0 then 1495 1521 begin … … 1500 1526 if not AcceptOrderChecks then 1501 1527 begin 1528 //added code to shut CPRS down without access violations if the fOCAccept is open when timing out. 1529 if frmFrame.TimedOut then 1530 begin 1531 Result := False; 1532 Exit; 1533 end; 1502 1534 if AskAnotherOrder(DialogIEN) then 1503 1535 InitDialog // ClearDialogControls is in InitDialog … … 1541 1573 else CanSign := CH_SIGN_NA; 1542 1574 if NewOrder.Signature = OSS_NOT_REQUIRE then CanSign := CH_SIGN_NA; 1543 if NewOrder.EventPtr <> '' then IsDelayOrder := True; 1544 Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, Responses.FViewName, CanSign,'',0, NewOrder.DGroupName, False,IsDelayOrder); 1575 if (NewOrder.EventPtr <> '') and (GetEventDefaultDlg(responses.FEventIFN) <> InttoStr(Responses.QuickOrder)) then 1576 IsDelayOrder := True; 1577 Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, Responses.FViewName, CanSign,'',0, NewOrder.DGroupName, False, IsDelayOrder); 1545 1578 1546 1579 UBAGlobals.TargetOrderID := NewOrder.ID; … … 1711 1744 //self.Responses.Cancel := False; 1712 1745 if User.NoOrdering then Exit; 1713 if FAbortOrder then exit; 1746 if FAbortOrder then 1747 begin 1748 SetTemplateDialogCanceled(FALSE); 1749 exit; 1750 end; 1714 1751 if FOrderAction in [ORDER_EDIT, ORDER_COPY] then Exit; // don't invoke verify dialog 1715 1752 if FOrderAction = ORDER_QUICK then Exit; // should this be here?? -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODDiet.dfm
r829 r1693 22 22 object pgeDiet: TTabSheet 23 23 Caption = 'Diet' 24 ExplicitLeft = 0 25 ExplicitTop = 0 26 ExplicitWidth = 0 27 ExplicitHeight = 0 24 28 object lblDietAvail: TLabel 25 29 Left = 4 … … 435 439 object pgeTubefeeding: TTabSheet 436 440 Caption = 'Tubefeeding' 441 ExplicitLeft = 0 442 ExplicitTop = 0 443 ExplicitWidth = 0 444 ExplicitHeight = 0 437 445 object lblTFProductList: TLabel 438 446 Left = 4 … … 584 592 Style = csDropDownList 585 593 Ctl3D = False 586 ItemHeight = 13594 ItemHeight = 0 587 595 ParentCtl3D = False 588 596 TabOrder = 2 … … 640 648 object pgeEarlyLate: TTabSheet 641 649 Caption = 'Early / Late Tray' 650 ExplicitLeft = 0 651 ExplicitTop = 0 652 ExplicitWidth = 0 653 ExplicitHeight = 0 642 654 object lblELStart: TLabel 643 655 Left = 287 … … 872 884 object pgeIsolations: TTabSheet 873 885 Caption = 'Isolations / Precautions' 886 ExplicitLeft = 0 887 ExplicitTop = 0 888 ExplicitWidth = 0 889 ExplicitHeight = 0 874 890 object lblIsolation: TLabel 875 891 Left = 4 … … 932 948 object pgeAdditional: TTabSheet 933 949 Caption = 'Additional Order' 950 ExplicitLeft = 0 951 ExplicitTop = 0 952 ExplicitWidth = 0 953 ExplicitHeight = 0 934 954 object lblAddlOrder: TLabel 935 955 Left = 4 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODDiet.pas
r829 r1693 235 235 TX_TFAMT = 'The quantity is invalid for '; 236 236 TX_TF5000 = 'The total quantity ordered may not exceed 5000ml.'; 237 TX_HLPQTY = CRLF + 'The following may be entered for quantity:' + CRLF + 238 ' Units may be K for Kcals, C for cc''s, M for ml, O for oz. or U for units (e.g. cans).' + CRLF + 239 ' Frequency may be DAY, HOUR, QD, QH, BID, TID, QID, Q2H, Q3H, Q4H, or Q6H.' + CRLF + 240 ' May also input 100CC/HR X 16 for 16 hours. Valid quantity for powder form' + CRLF + 241 ' product can be "# GRAMS" as 20 G, GRAMS, or GMS, or as 1 PKG or 1 U and the' + CRLF + 242 ' frequency (e.g. 20 GRAMS/DAY or 1 PKG/TID).'; 237 238 // CQ #15833 - Removed references of 'c' and 'cc', changed 100CC example to 100ML - JCS 239 TX_HLPQTY = CRLF + 'Valid entries for quantity:' + CRLF + CRLF + 240 'Units K for Kcals; M for ml; O for oz.; U for units (e.g. cans), PKG' + CRLF + 241 'Frequency DAILY HOUR QH BID TID QID Q2H Q3H Q4H Q6H' + CRLF + CRLF + 242 'Or 100 ml/HR X 16 for 16 hours' + CRLF + CRLF + 243 'IF powder form product, Then' + CRLF + 244 ' (# GRAMS or # Unit or PKG) / FREQUENCY' + CRLF + CRLF + 245 'Examples:' + CRLF + 246 ' 20 GRAMS/Day' + CRLF + 247 ' 1 PKG/TID' + CRLF + 248 ' 6 U/D' + CRLF + 249 ' 1 U/Q3H' + CRLF + 250 ' 50ml/TID' + CRLF + 251 ' 100 ML/HR'; 243 252 TX_ELMEAL = 'A meal must be selected.'; 244 253 TX_ELTIME = 'A meal time must be selected.'; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODGen.dfm
r829 r1693 2 2 Left = 223 3 3 Top = 290 4 Height = 295 4 5 Caption = 'frmODGen' 5 ExplicitLeft = 223 6 ExplicitTop = 290 6 ExplicitHeight = 295 7 7 PixelsPerInch = 96 8 8 TextHeight = 13 9 object sbxMain: TScrollBox [0] 9 object lblOrderSig: TLabel [0] 10 Left = 8 11 Top = 193 12 Width = 44 13 Height = 13 14 Caption = 'Order Sig' 15 end 16 inherited memOrder: TCaptionMemo 17 Top = 209 18 ExplicitTop = 209 19 end 20 object sbxMain: TScrollBox [2] 10 21 Left = 0 11 22 Top = 0 … … 15 26 TabOrder = 4 16 27 end 28 inherited cmdAccept: TButton 29 Top = 209 30 ExplicitTop = 209 31 end 17 32 inherited cmdQuit: TButton 18 Top = 219 19 ExplicitTop = 219 33 Top = 234 34 ExplicitTop = 234 35 end 36 inherited pnlMessage: TPanel 37 Top = 191 38 ExplicitTop = 191 20 39 end 21 40 inherited amgrMain: TVA508AccessibilityManager … … 26 45 ( 27 46 'Component = memOrder' 28 'Status = stsDefault') 47 'Label = lblOrderSig' 48 'Status = stsOK') 29 49 ( 30 50 'Component = cmdAccept' … … 43 63 'Status = stsDefault')) 44 64 end 65 object VA508CompMemOrder: TVA508ComponentAccessibility 66 Component = memOrder 67 OnStateQuery = VA508CompMemOrderStateQuery 68 Left = 96 69 Top = 232 70 end 45 71 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODGen.pas
r829 r1693 22 22 TfrmODGen = class(TfrmODBase) 23 23 sbxMain: TScrollBox; 24 lblOrderSig: TLabel; 25 VA508CompMemOrder: TVA508ComponentAccessibility; 24 26 procedure FormCreate(Sender: TObject); 25 27 procedure FormClose(Sender: TObject; var Action: TCloseAction); 26 28 procedure cmdAcceptClick(Sender: TObject); 29 procedure VA508CompMemOrderStateQuery(Sender: TObject; var Text: string); 27 30 private 28 31 FilterOut: boolean; … … 35 38 Direction, InsertAt: Integer); 36 39 procedure PlaceControls; 37 procedure PlaceDateTime(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );38 procedure PlaceFreeText(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );40 procedure PlaceDateTime(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 41 procedure PlaceFreeText(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 39 42 procedure PlaceHidden(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem); 40 procedure PlaceNumeric(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );41 procedure PlaceSetOfCodes(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );42 procedure PlaceYesNo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );43 procedure PlaceLookup(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );44 procedure PlaceMemo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );43 procedure PlaceNumeric(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 44 procedure PlaceSetOfCodes(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 45 procedure PlaceYesNo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 46 procedure PlaceLookup(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 47 procedure PlaceMemo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 45 48 procedure PlaceLabel(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem); 46 49 procedure TrimAllMemos; 50 function SetComponentName(Editor: TWinControl; Index: Integer; DialogCtrl: TDialogCtrl): Boolean; 47 51 protected 48 52 FFormCloseCalled : Boolean; … … 84 88 IDs,TSstr, AttendStr: string; 85 89 begin 86 FFormCloseCalled := false; 90 FFormCloseCalled := false; 87 91 inherited; 88 92 FilterOut := True; … … 243 247 end; 244 248 249 procedure TfrmODGen.VA508CompMemOrderStateQuery(Sender: TObject; 250 var Text: string); 251 begin 252 inherited; 253 Text := memOrder.Text; 254 end; 255 245 256 procedure TfrmODGen.Validate(var AnErrMsg: string); 246 257 var … … 328 339 DialogCtrl.Preserve := Length(DialogItem.EDefault) > 0; 329 340 case DialogItem.DataType of 330 'D': PlaceDateTime(DialogCtrl, DialogItem );331 'F': PlaceFreeText(DialogCtrl, DialogItem );341 'D': PlaceDateTime(DialogCtrl, DialogItem, I); 342 'F': PlaceFreeText(DialogCtrl, DialogItem, i); 332 343 'H': PlaceHidden(DialogCtrl, DialogItem); 333 'N': PlaceNumeric(DialogCtrl, DialogItem );334 'P': PlaceLookup(DialogCtrl, DialogItem );335 'R': PlaceDateTime(DialogCtrl, DialogItem );336 'S': PlaceSetOfCodes(DialogCtrl, DialogItem );337 'W': PlaceMemo(DialogCtrl, DialogItem );338 'Y': PlaceYesNo(DialogCtrl, DialogItem );344 'N': PlaceNumeric(DialogCtrl, DialogItem, i); 345 'P': PlaceLookup(DialogCtrl, DialogItem, i); 346 'R': PlaceDateTime(DialogCtrl, DialogItem, i); 347 'S': PlaceSetOfCodes(DialogCtrl, DialogItem, i); 348 'W': PlaceMemo(DialogCtrl, DialogItem, i); 349 'Y': PlaceYesNo(DialogCtrl, DialogItem, i); 339 350 end; 340 351 FDialogCtrlList.Add(DialogCtrl); … … 343 354 end; 344 355 345 procedure TfrmODGen.PlaceDateTime(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );356 procedure TfrmODGen.PlaceDateTime(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 346 357 const 347 358 NUM_CHAR = 22; … … 354 365 TORDateBox(Editor).DateOnly := Pos('T', DialogItem.Domain) = 0; 355 366 with TORDateBox(Editor) do RequireTime := (not DateOnly) and (Pos('R', DialogItem.Domain) > 0); //v26.48 - RV PSI-05-002 367 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 368 // TORDateBox(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 356 369 TORDateBox(Editor).Text := DialogItem.EDefault; 357 370 TORDateBox(Editor).Hint := DialogItem.HelpText; … … 364 377 end; 365 378 366 procedure TfrmODGen.PlaceFreeText(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );379 procedure TfrmODGen.PlaceFreeText(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 367 380 begin 368 381 with DialogCtrl do … … 374 387 HT_FRAME * FCharHt); 375 388 TEdit(Editor).MaxLength := StrToIntDef(Piece(DialogItem.Domain, ':', 2), 0); 389 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 390 // TCaptionEdit(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 376 391 TEdit(Editor).Text := DialogItem.EDefault; 377 392 TEdit(Editor).Hint := DialogItem.HelpText; … … 384 399 end; 385 400 386 procedure TfrmODGen.PlaceNumeric(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );401 procedure TfrmODGen.PlaceNumeric(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 387 402 const 388 403 NUM_CHAR = 16; … … 394 409 Editor.SetBounds(FEditorLeft, FEditorTop, NUM_CHAR * FCharWd, HT_FRAME * FCharHt); 395 410 TEdit(Editor).MaxLength := NUM_CHAR; 411 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 412 // TCaptionEdit(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 396 413 TEdit(Editor).Text := DialogItem.EDefault; 397 414 TEdit(Editor).Hint := DialogItem.HelpText + '|' + DialogItem.Domain; … … 404 421 end; 405 422 406 procedure TfrmODGen.PlaceSetOfCodes(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );423 procedure TfrmODGen.PlaceSetOfCodes(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 407 424 const 408 425 NUM_CHAR = 32; … … 417 434 TORComboBox(Editor).ListItemsOnly := True; 418 435 TORComboBox(Editor).Pieces := '2'; 436 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 437 // TORComboBox(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 419 438 Editor.SetBounds(FEditorLeft, FEditorTop, NUM_CHAR * FCharWd, HT_FRAME * FCharHt); 420 439 x := DialogItem.Domain; … … 427 446 TORComboBox(Editor).SelectByID(DialogItem.IDefault); 428 447 //TORComboBox(Editor).Text := DialogItem.EDefault; 429 TORComboBox(Editor). Hint:= DialogItem.HelpText;448 TORComboBox(Editor).RpcCall := DialogItem.HelpText; 430 449 if Length(DialogItem.HelpText) > 0 then TORComboBox(Editor).ShowHint := True; 431 450 TORComboBox(Editor).OnChange := ControlChange; … … 435 454 end; 436 455 437 procedure TfrmODGen.PlaceYesNo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );456 procedure TfrmODGen.PlaceYesNo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 438 457 const 439 458 NUM_CHAR = 9; … … 446 465 TORComboBox(Editor).ListItemsOnly := True; 447 466 TORComboBox(Editor).Pieces := '2'; 467 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 468 //TORComboBox(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 448 469 Editor.SetBounds(FEditorLeft, FEditorTop, NUM_CHAR * FCharWd, HT_FRAME * FCharHt); 449 470 TORComboBox(Editor).Items.Add('0^No'); … … 451 472 TORComboBox(Editor).SelectByID(DialogItem.IDefault); 452 473 //TORComboBox(Editor).Text := DialogItem.EDefault; 453 TORComboBox(Editor). Hint:= DialogItem.HelpText;474 TORComboBox(Editor).RpcCall := DialogItem.HelpText; 454 475 if Length(DialogItem.HelpText) > 0 then TORComboBox(Editor).ShowHint := True; 455 476 TORComboBox(Editor).OnChange := ControlChange; … … 459 480 end; 460 481 461 procedure TfrmODGen.PlaceLookup(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );482 procedure TfrmODGen.PlaceLookup(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 462 483 const 463 484 NUM_CHAR = 32; … … 482 503 TORComboBox(Editor).Pieces := '2'; 483 504 TORComboBox(Editor).LongList := True; 505 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 506 // TORComboBox(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 484 507 // 2nd bar piece of hint is not visible, hide xref, global ref, & screen code in tab pieces 485 TORComboBox(Editor). Hint:= DialogItem.HelpText + '|' + XRef + #9 + GblRef + #9 +508 TORComboBox(Editor).RpcCall := DialogItem.HelpText + '|' + XRef + #9 + GblRef + #9 + 486 509 DialogItem.ScreenRef; 487 510 if ( compareText(TsID,DialogItem.Id)=0 ) or (compareText(TSDomain,DialogItem.Domain)=0)then … … 538 561 begin 539 562 inherited; 540 XRef := Piece(TORComboBox(Sender). Hint, '|', 2);563 XRef := Piece(TORComboBox(Sender).RpcCall, '|', 2); 541 564 GblRef := Piece(XRef, #9, 2); 542 565 ScreenRef := Piece(XRef, #9, 3); … … 545 568 end; 546 569 547 procedure TfrmODGen.PlaceMemo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem );570 procedure TfrmODGen.PlaceMemo(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer); 548 571 const 549 572 NUM_LINES = 3; … … 556 579 sbxMain.Width - FEditorLeft - WD_MARGIN - GetSystemMetrics(SM_CXVSCROLL), 557 580 (FCharHt * NUM_LINES) + HT_FRAME); 581 SetComponentName(Editor, CurrentItemNumber, DialogCtrl); 582 // TCaptionMemo(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber); 558 583 TMemo(Editor).Text := DialogItem.EDefault; 559 584 TMemo(Editor).Hint := DialogItem.HelpText; … … 574 599 575 600 procedure TfrmODGen.PlaceLabel(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem); 601 var 602 ht: integer; 576 603 begin 577 604 with DialogCtrl do … … 580 607 Prompt.Parent := sbxMain; 581 608 Prompt.Caption := DialogItem.Prompt; 609 ht := Prompt.Height; // CQ#15849 610 if ht < FCharHt then 611 ht := FCharHt; 582 612 Prompt.AutoSize := False; 583 Prompt.SetBounds(WD_MARGIN, FEditorTop + HT_LBLOFF, FLabelWd, FCharHt);613 Prompt.SetBounds(WD_MARGIN, FEditorTop + HT_LBLOFF, FLabelWd, ht); 584 614 Prompt.Alignment := taRightJustify; 585 615 Prompt.Visible := True; … … 604 634 begin 605 635 inherited; 636 TrimAllMemos; 606 637 Application.ProcessMessages; 607 TrimAllMemos;608 638 end; 609 639 … … 632 662 end; 633 663 664 function TfrmODGen.SetComponentName(Editor: TWinControl; Index: Integer; DialogCtrl: TDialogCtrl): Boolean; 665 Var 666 I: Integer; 667 SaveName: String; 668 begin 669 //strip all non alphanumeric characters to create the save name 670 SaveName := ''; 671 //Check for blank id 672 if DialogCtrl.ID = '' then DialogCtrl.ID := 'EMPTY'; 673 674 for i := 1 to length(DialogCtrl.ID) do begin 675 if (DialogCtrl.ID[i] in ['A'..'Z']) or (DialogCtrl.ID[i] in ['a'..'z']) or (DialogCtrl.ID[i] in ['0'..'9']) then 676 SaveName := SaveName + DialogCtrl.ID[i]; 677 end; 678 SaveName := SaveName + '_' + IntToStr(Index); 679 680 //extra backup - make sure that the component name doesn't already exist 681 //Now set up the component name 682 try 683 Editor.Name := SaveName; 684 except 685 Editor.Name := SaveName + '_' + IntToStr(Index); 686 end; 687 end; 688 634 689 end. 635 690 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODLab.dfm
r829 r1693 99 99 end 100 100 inherited memOrder: TCaptionMemo 101 TabOrder = 2 0101 TabOrder = 22 102 102 end 103 103 object txtImmedColl: TCaptionEdit [13] … … 108 108 Color = clBtnFace 109 109 ReadOnly = True 110 TabOrder = 1 4110 TabOrder = 16 111 111 Text = 'txtImmedColl' 112 112 end … … 116 116 Width = 165 117 117 Height = 21 118 TabOrder = 1 3118 TabOrder = 15 119 119 OnChange = ControlChange 120 120 DateOnly = False … … 128 128 BevelInner = bvLowered 129 129 BevelOuter = bvNone 130 TabOrder = 8130 TabOrder = 10 131 131 object lblUrineVolume: TOROffsetLabel 132 132 Left = 6 … … 156 156 BevelInner = bvLowered 157 157 BevelOuter = bvNone 158 TabOrder = 7158 TabOrder = 9 159 159 object lblAntiCoagulant: TOROffsetLabel 160 160 Left = 6 … … 184 184 BevelInner = bvLowered 185 185 BevelOuter = bvNone 186 TabOrder = 6186 TabOrder = 8 187 187 Visible = False 188 188 object lblOrderComment: TOROffsetLabel … … 212 212 Height = 118 213 213 BevelOuter = bvNone 214 TabOrder = 5214 TabOrder = 7 215 215 end 216 216 object pnlDoseDraw: TORAutoPanel [19] … … 221 221 BevelInner = bvLowered 222 222 BevelOuter = bvNone 223 TabOrder = 1 0223 TabOrder = 12 224 224 object lblDose: TOROffsetLabel 225 225 Left = 10 … … 268 268 BevelInner = bvLowered 269 269 BevelOuter = bvNone 270 TabOrder = 9270 TabOrder = 11 271 271 object lblPeakTrough: TOROffsetLabel 272 272 Left = 6 … … 294 294 end 295 295 end 296 inherited cmdAccept: TButton 297 Left = 443 298 TabOrder = 18 299 ExplicitLeft = 443 300 end 301 inherited cmdQuit: TButton 302 TabOrder = 19 303 end 304 inherited pnlMessage: TPanel 305 Left = 18 306 Top = 192 307 Height = 56 308 TabOrder = 21 309 ExplicitLeft = 18 310 ExplicitTop = 192 311 ExplicitHeight = 56 312 inherited imgMessage: TImage 313 Top = 11 314 ExplicitTop = 11 315 end 316 inherited memMessage: TRichEdit 317 Left = 41 318 Top = 5 319 Height = 43 320 PopupMenu = MessagePopup 321 ExplicitLeft = 41 322 ExplicitTop = 5 323 ExplicitHeight = 43 324 end 325 end 326 object pnlCollTimeButton: TKeyClickPanel [24] 296 object pnlCollTimeButton: TKeyClickPanel [21] 327 297 Left = 288 328 298 Top = 167 … … 331 301 BevelOuter = bvNone 332 302 Caption = 'Select collection time' 333 TabOrder = 1 5303 TabOrder = 17 334 304 TabStop = True 335 305 OnClick = cmdImmedCollClick … … 360 330 end 361 331 end 362 object cboAvailTest: TORComboBox [2 5]332 object cboAvailTest: TORComboBox [22] 363 333 Left = 6 364 334 Top = 18 … … 386 356 CharsNeedMatch = 1 387 357 end 388 object cboFrequency: TORComboBox [2 6]358 object cboFrequency: TORComboBox [23] 389 359 Left = 326 390 360 Top = 166 … … 406 376 Sorted = False 407 377 SynonymChars = '<>' 408 TabOrder = 1 6378 TabOrder = 18 409 379 OnChange = cboFrequencyChange 410 380 CharsNeedMatch = 1 411 381 end 412 object cboCollSamp: TORComboBox [2 7]382 object cboCollSamp: TORComboBox [24] 413 383 Left = 269 414 384 Top = 28 … … 437 407 CharsNeedMatch = 1 438 408 end 439 object cboSpecimen: TORComboBox [2 8]409 object cboSpecimen: TORComboBox [25] 440 410 Left = 269 441 411 Top = 55 … … 459 429 Sorted = False 460 430 SynonymChars = '<>' 461 TabOrder = 2431 TabOrder = 3 462 432 OnChange = cboSpecimenChange 463 433 OnEnter = cboSpecimenMouseClick … … 466 436 CharsNeedMatch = 1 467 437 end 468 object cboUrgency: TORComboBox [2 9]438 object cboUrgency: TORComboBox [26] 469 439 Left = 269 470 440 Top = 82 … … 486 456 Sorted = False 487 457 SynonymChars = '<>' 488 TabOrder = 3458 TabOrder = 5 489 459 OnChange = cboUrgencyChange 490 460 CharsNeedMatch = 1 491 461 end 492 object txtAddlComment: TCaptionEdit [ 30]462 object txtAddlComment: TCaptionEdit [27] 493 463 Left = 187 494 464 Top = 122 495 465 Width = 180 496 466 Height = 21 497 TabOrder = 4467 TabOrder = 6 498 468 Visible = False 499 469 OnExit = txtAddlCommentExit 500 470 Caption = 'Additional Comment' 501 471 end 502 object txtDays: TCaptionEdit [ 31]472 object txtDays: TCaptionEdit [28] 503 473 Left = 430 504 474 Top = 166 … … 507 477 Hint = 'Enter a number of days, or an "X" followed by a number of times.' 508 478 Enabled = False 509 TabOrder = 17479 TabOrder = 20 510 480 OnChange = ControlChange 511 481 Caption = 'How Long?' 512 482 end 513 object FLabCommonCombo: TORListBox [ 32]483 object FLabCommonCombo: TORListBox [29] 514 484 Left = 440 515 485 Top = 247 … … 520 490 ParentShowHint = False 521 491 ShowHint = True 522 TabOrder = 2 2492 TabOrder = 26 523 493 Visible = False 524 494 ItemTipColor = clWindow 525 495 LongList = False 526 496 end 527 object cboCollTime: TORComboBox [3 3]497 object cboCollTime: TORComboBox [30] 528 498 Left = 149 529 499 Top = 166 … … 545 515 Sorted = False 546 516 SynonymChars = '<>' 547 TabOrder = 1 2517 TabOrder = 14 548 518 OnChange = cboCollTimeChange 549 519 OnExit = cboCollTimeExit 550 520 CharsNeedMatch = 1 551 521 end 552 object cboCollType: TORComboBox [3 4]522 object cboCollType: TORComboBox [31] 553 523 Left = 6 554 524 Top = 166 … … 570 540 Sorted = False 571 541 SynonymChars = '<>' 572 TabOrder = 1 1542 TabOrder = 13 573 543 OnChange = cboCollTypeChange 574 544 CharsNeedMatch = 1 575 545 end 546 object Frequencylbl508: TVA508StaticText [32] 547 Name = 'Frequencylbl508' 548 Left = 323 549 Top = 149 550 Width = 59 551 Height = 15 552 Alignment = taLeftJustify 553 Caption = 'How Often?' 554 Enabled = False 555 TabOrder = 19 556 Visible = False 557 ShowAccelChar = True 558 end 559 object HowManyDayslbl508: TVA508StaticText [33] 560 Name = 'HowManyDayslbl508' 561 Left = 431 562 Top = 152 563 Width = 57 564 Height = 15 565 Alignment = taLeftJustify 566 Caption = 'How Long?' 567 Enabled = False 568 TabOrder = 21 569 Visible = False 570 ShowAccelChar = True 571 end 572 inherited cmdAccept: TButton 573 Left = 443 574 TabOrder = 23 575 ExplicitLeft = 443 576 end 577 object specimenlbl508: TVA508StaticText [35] 578 Name = 'specimenlbl508' 579 Left = 210 580 Top = 56 581 Width = 49 582 Height = 15 583 Alignment = taLeftJustify 584 Caption = 'Specimen' 585 Enabled = False 586 TabOrder = 4 587 Visible = False 588 ShowAccelChar = True 589 end 590 inherited cmdQuit: TButton 591 TabOrder = 24 592 end 593 object CollSamplbl508: TVA508StaticText [37] 594 Name = 'CollSamplbl508' 595 Left = 187 596 Top = 31 597 Width = 72 598 Height = 15 599 Alignment = taLeftJustify 600 Caption = 'Collect Sample' 601 Enabled = False 602 TabOrder = 2 603 Visible = False 604 ShowAccelChar = True 605 end 606 inherited pnlMessage: TPanel 607 Left = 18 608 Top = 192 609 Height = 56 610 TabOrder = 25 611 ExplicitLeft = 18 612 ExplicitTop = 192 613 ExplicitHeight = 56 614 inherited imgMessage: TImage 615 Top = 11 616 ExplicitTop = 11 617 end 618 inherited memMessage: TRichEdit 619 Left = 41 620 Top = 5 621 Height = 43 622 PopupMenu = MessagePopup 623 ExplicitLeft = 41 624 ExplicitTop = 5 625 ExplicitHeight = 43 626 end 627 end 576 628 inherited amgrMain: TVA508AccessibilityManager 577 629 Data = ( … … 668 720 ( 669 721 'Component = frmODLab' 722 'Status = stsDefault') 723 ( 724 'Component = Frequencylbl508' 725 'Status = stsDefault') 726 ( 727 'Component = HowManyDayslbl508' 728 'Status = stsDefault') 729 ( 730 'Component = specimenlbl508' 731 'Status = stsDefault') 732 ( 733 'Component = CollSamplbl508' 670 734 'Status = stsDefault')) 671 735 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODLab.pas
r829 r1693 6 6 SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, 7 7 Forms, Dialogs, StdCtrls, ORCtrls, ORfn, fODBase, ExtCtrls, ComCtrls, uConst, 8 ORDtTm, Buttons, Menus, VA508AccessibilityManager ;8 ORDtTm, Buttons, Menus, VA508AccessibilityManager, VA508AccessibilityRouter; 9 9 10 10 type … … 57 57 MessagePopup: TPopupMenu; 58 58 ViewinReportWindow1: TMenuItem; 59 Frequencylbl508: TVA508StaticText; 60 HowManyDayslbl508: TVA508StaticText; 61 specimenlbl508: TVA508StaticText; 62 CollSamplbl508: TVA508StaticText; 59 63 procedure FormCreate(Sender: TObject); 60 64 procedure ControlChange(Sender: TObject); … … 107 111 procedure ReadServerVariables; 108 112 procedure DisplayChangedOrders(ACollType: string); 113 procedure setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl; lbl2: string); 109 114 public 110 115 procedure SetupDialog(OrderAction: Integer; const ID: string); override; … … 206 211 procedure TfrmODLab.FormCreate(Sender: TObject); 207 212 var 208 i, n : integer;213 i, n, HMD508: integer; 209 214 AList: TStringList; 210 215 begin … … 263 268 if cboAvailTest.Items.Count > 0 then cboAvailTest.InsertSeparator; 264 269 cboAvailTest.InitLongList(''); 270 //TDP - CQ#19396 HMD508 added to guarantee 508 label did not change width 271 HMD508 := HowManyDayslbl508.Width; 265 272 SetControl(cboFrequency, 'Schedules'); 273 HowManydayslbl508.Width := HMD508; 266 274 with cboFrequency do 267 275 begin … … 271 279 lblHowManyDays.Enabled := False; { have this call change event in case } 272 280 txtDays.Enabled := False; { the default is not 'one time'? } 281 //TDP - CQ#19396 Following line does not appear to be needed 282 //setup508Label(HowManyText, HowManyDayslbl508, txtDays, lblHowManyDays.Caption); 273 283 end; 274 284 if EvTDelayLoc>0 then … … 283 293 Font.Color := clGrayText; 284 294 lblFrequency.Enabled := False; 295 setup508Label(Text, Frequencylbl508, cboFrequency, lblFrequency.Caption); 285 296 end; 286 297 PreserveControl(cboAvailTest); … … 294 305 AList.Free; 295 306 end; 307 end; 308 309 {TDP - CQ#19396 Added to address 508 related changes. I modified slightly to 310 change lbl.Caption and retain lbl.Width} 311 procedure TfrmODLab.setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl; lbl2: string); 312 var 313 Width: integer; 314 begin 315 if ScreenReaderSystemActive and not ctrl.Enabled then begin 316 lbl.Enabled := True; 317 lbl.Visible := True; 318 Width := lbl.Width; 319 lbl.Caption := lbl2 +'. Read Only. Value is ' + Text; 320 lbl.Width := Width; 321 end else 322 lbl.Visible := false; 296 323 end; 297 324 … … 745 772 procedure TLabTest.LoadUrgency(CollType: string; AComboBox:TORComboBox); 746 773 var 747 i: integer; 774 i, PreviousSelectionIndex: integer; 775 PreviousSelectionString: String; 748 776 begin 749 777 with AComboBox do 750 778 begin 779 PreviousSelectionIndex := -1; 780 PreviousSelectionString := SelText; 781 751 782 Clear; 752 for i := 0 to UrgencyList.Count - 1 do 783 for i := 0 to UrgencyList.Count - 1 do begin 753 784 if (CollType = 'LC') and (Piece(UrgencyList[i], U, 3) = '') then 754 785 Continue 755 786 else 756 787 Items.Add(UrgencyList[i]); 788 if (PreviousSelectionString <> '') and (PreviousSelectionString = Piece(UrgencyList[i], U, 2)) then 789 PreviousSelectionIndex := i; 790 end; 791 757 792 if (LRFURG <> '') and (ALabTest.ObtainUrgency) then 758 793 SelectByID(LRFURG) 794 else if PreviousSelectionIndex > -1 then 795 ItemIndex := PreviousSelectionIndex 759 796 else 760 797 SelectByIEN(uDfltUrgency); … … 1292 1329 lblCollSamp.Enabled := True; 1293 1330 cboCollSamp.Enabled := True; 1331 //TDP - CQ#19396 Added cboCollSamp 508 changes 1332 setup508Label(cboCollSamp.Text, collsamplbl508, cboCollSamp, lblCollSamp.Caption); 1294 1333 end 1295 1334 else … … 1306 1345 lblCollSamp.Enabled := False; 1307 1346 cboCollSamp.Enabled := False; 1347 //TDP - CQ#19396 Added cboCollSamp 508 changes 1348 setup508Label(cboCollSamp.Text, collsamplbl508, cboCollSamp, lblCollSamp.Caption); 1308 1349 end; 1309 1350 if ObtainSpecimen then … … 1311 1352 lblSpecimen.Enabled:= True; 1312 1353 cboSpecimen.Enabled:= True; 1354 setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption); 1313 1355 end else 1314 1356 begin 1315 1357 lblSpecimen.Enabled:= False; 1316 1358 cboSpecimen.Enabled:= False; 1359 setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption); 1317 1360 end; 1318 1361 if ObtainUrgency then … … 1360 1403 lblSpecimen.Enabled:= True; 1361 1404 cboSpecimen.Enabled:= True; 1405 setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption); 1362 1406 end else 1363 1407 begin 1364 1408 lblSpecimen.Enabled:= False; 1365 1409 cboSpecimen.Enabled:= False; 1410 setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption); 1366 1411 end; 1367 1412 if ObtainComment then … … 1419 1464 procedure TfrmODLab.cboFrequencyChange(Sender: TObject); 1420 1465 var 1421 x : string;1466 x, HowManyText: string; 1422 1467 const 1423 1468 HINT_TEXT1 = 'Enter a number of days'; … … 1434 1479 txtDays.Hint := ''; 1435 1480 txtDays.Enabled := True; 1481 //TDP - txtDays 508 changes 1482 if txtDays.Text = '' then HowManyText := 'no value' 1483 else HowManyText := txtDays.Text; 1484 setup508Label(HowManyText, HowManyDayslbl508, txtDays, lblHowManyDays.Caption); 1436 1485 txtDays.Showhint := True; 1437 1486 end … … 1441 1490 lblHowManyDays.Enabled := False; 1442 1491 txtDays.Enabled := False; 1492 //TDP - txtDays 508 changes 1493 HowManyText := 'no value'; 1494 setup508Label(HowManyText, HowManyDayslbl508, txtDays, lblHowManyDays.Caption); 1443 1495 txtDays.ShowHint := False; 1444 1496 end; … … 2025 2077 2026 2078 end. 2027 2028 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMedIV.dfm
r829 r1693 5 5 Height = 465 6 6 Caption = 'Infusion Order' 7 Constraints.MinHeight = 3 507 Constraints.MinHeight = 360 8 8 Constraints.MinWidth = 500 9 9 ExplicitWidth = 668 … … 27 27 object lblComponent: TLabel [2] 28 28 Left = 214 29 Top = 729 Top = 6 30 30 Width = 85 31 31 Height = 13 … … 34 34 object lblAmount: TLabel [3] 35 35 Left = 328 36 Top = 736 Top = 6 37 37 Width = 84 38 38 Height = 13 … … 55 55 end 56 56 object Label1: TLabel [6] 57 Left = 858 Top = 34 459 Width = 13360 Height = 13 61 Caption = ' * Indicates a Required Field'57 Left = 10 58 Top = 345 59 Width = 44 60 Height = 13 61 Caption = 'Order Sig' 62 62 end 63 63 object lblRoute: TLabel [7] … … 131 131 OnClick = lblTypeHelpClick 132 132 end 133 object txtRate: TCaptionEdit [13] 133 object lblAddFreq: TLabel [13] 134 Left = 488 135 Top = 6 136 Width = 95 137 Height = 13 138 Caption = 'Additive Frequency*' 139 end 140 object lblPrevAddFreq: TLabel [14] 141 Left = 557 142 Top = 6 143 Width = 77 144 Height = 13 145 Caption = 'Prev. Add. Freq.' 146 end 147 object txtRate: TCaptionEdit [15] 134 148 Left = 486 135 149 Top = 211 … … 137 151 Height = 21 138 152 AutoSelect = False 139 TabOrder = 8153 TabOrder = 10 140 154 OnChange = txtRateChange 141 155 Caption = 'Infusion Rate' 142 156 end 143 object cboPriority: TORComboBox [1 4]157 object cboPriority: TORComboBox [16] 144 158 Left = 8 145 159 Top = 252 … … 161 175 Sorted = False 162 176 SynonymChars = '<>' 163 TabOrder = 1 0177 TabOrder = 12 164 178 OnChange = cboPriorityChange 165 179 OnExit = cboPriorityExit 180 OnKeyUp = cboPriorityKeyUp 166 181 CharsNeedMatch = 1 167 182 end 168 object grdSelected: TCaptionStringGrid [1 5]169 Left = 21 4170 Top = 21183 object grdSelected: TCaptionStringGrid [17] 184 Left = 215 185 Top = 18 171 186 Width = 437 172 187 Height = 76 173 ColCount = 3174 188 DefaultColWidth = 100 175 189 DefaultRowHeight = 19 190 DefaultDrawing = False 176 191 FixedCols = 0 177 192 RowCount = 1 … … 179 194 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected] 180 195 ScrollBars = ssVertical 181 TabOrder = 1196 TabOrder = 2 182 197 OnDrawCell = grdSelectedDrawCell 183 198 OnKeyPress = grdSelectedKeyPress 184 199 OnMouseDown = grdSelectedMouseDown 185 Caption = 'Selected Solution and Additives' 186 end 187 object cmdRemove: TButton [16] 200 end 201 object cmdRemove: TButton [18] 188 202 Left = 443 189 203 Top = 100 … … 191 205 Height = 18 192 206 Caption = 'Remove' 193 TabOrder = 2207 TabOrder = 3 194 208 OnClick = cmdRemoveClick 195 209 end 196 object memComments: TCaptionMemo [1 7]210 object memComments: TCaptionMemo [19] 197 211 Left = 214 198 212 Top = 121 … … 202 216 'memComments') 203 217 ScrollBars = ssVertical 204 TabOrder = 13218 TabOrder = 4 205 219 OnChange = ControlChange 206 220 Caption = 'Comments' 207 221 end 208 object txtSelected: TCaptionEdit [ 18]222 object txtSelected: TCaptionEdit [20] 209 223 Tag = -1 210 224 Left = 416 … … 219 233 OnChange = txtSelectedChange 220 234 OnExit = txtSelectedExit 235 OnKeyDown = txtSelectedKeyDown 221 236 Caption = 'Volume' 222 237 end 223 object cboSelected: TCaptionComboBox [ 19]238 object cboSelected: TCaptionComboBox [21] 224 239 Tag = -1 225 Left = 46 0240 Left = 462 226 241 Top = 45 227 242 Width = 53 … … 231 246 ItemHeight = 13 232 247 ParentCtl3D = False 233 TabOrder = 4248 TabOrder = 6 234 249 Visible = False 235 OnC hange = cboSelectedChange236 On Exit = cboSelectedExit250 OnCloseUp = cboSelectedCloseUp 251 OnKeyDown = cboSelectedKeyDown 237 252 Caption = 'Volume/Strength' 238 253 end 239 254 inherited memOrder: TCaptionMemo 240 Top = 3 59255 Top = 364 241 256 Width = 475 242 TabStop = True 243 TabOrder = 16 244 ExplicitTop = 359 257 TabOrder = 17 258 ExplicitTop = 364 245 259 ExplicitWidth = 475 246 260 end 247 object pnlXDuration: TPanel [2 1]261 object pnlXDuration: TPanel [23] 248 262 Left = 184 249 263 Top = 252 … … 251 265 Height = 21 252 266 BevelOuter = bvNone 253 TabOrder = 1 1267 TabOrder = 13 254 268 OnEnter = pnlXDurationEnter 255 269 object txtXDuration: TCaptionEdit … … 261 275 OnChange = txtXDurationChange 262 276 OnExit = txtXDurationExit 263 Caption = 'Duration'264 277 end 265 278 object cboDuration: TComboBox … … 269 282 Height = 21 270 283 ItemHeight = 13 271 TabOrder = 2284 TabOrder = 1 272 285 OnChange = cboDurationChange 273 286 OnEnter = cboDurationEnter 274 287 end 275 288 end 276 object pnlCombo: TPanel [2 2]289 object pnlCombo: TPanel [24] 277 290 Left = 8 278 291 Top = 2 … … 280 293 Height = 185 281 294 BevelOuter = bvNone 282 TabOrder = 2 5295 TabOrder = 26 283 296 object cboAdditive: TORComboBox 284 297 Left = 0 … … 303 316 SynonymChars = '<>' 304 317 TabPositions = '20' 305 TabOrder = 0318 TabOrder = 1 306 319 OnExit = cboAdditiveExit 307 320 OnMouseClick = cboAdditiveMouseClick … … 321 334 ' Additives ') 322 335 TabIndex = 0 323 TabStop = False324 336 OnChange = tabFluidChange 325 337 end … … 346 358 SynonymChars = '<>' 347 359 TabPositions = '20' 348 TabOrder = 1360 TabOrder = 0 349 361 OnExit = cboSolutionExit 350 362 OnMouseClick = cboSolutionMouseClick … … 353 365 end 354 366 end 355 object cboRoute: TORComboBox [2 3]367 object cboRoute: TORComboBox [25] 356 368 Left = 8 357 369 Top = 211 … … 372 384 Sorted = False 373 385 SynonymChars = '<>' 374 TabOrder = 3386 TabOrder = 5 375 387 OnChange = cboRouteChange 376 388 OnClick = cboRouteClick 377 389 OnExit = cboRouteExit 390 OnKeyDown = cboRouteKeyDown 391 OnKeyUp = cboRouteKeyUp 378 392 CharsNeedMatch = 1 379 393 UniqueAutoComplete = True 380 394 end 381 object cboSchedule: TORComboBox [2 4]395 object cboSchedule: TORComboBox [26] 382 396 Left = 304 383 397 Top = 211 … … 398 412 Sorted = True 399 413 SynonymChars = '<>' 400 TabOrder = 6414 TabOrder = 8 401 415 OnChange = cboScheduleChange 402 416 OnClick = cboScheduleClick 403 417 OnExit = cboScheduleExit 418 OnKeyDown = cboScheduleKeyDown 419 OnKeyUp = cboScheduleKeyUp 404 420 CharsNeedMatch = 1 405 421 UniqueAutoComplete = True 406 422 end 407 object cboType: TComboBox [2 5]423 object cboType: TComboBox [27] 408 424 Left = 184 409 425 Top = 211 … … 413 429 ParentShowHint = False 414 430 ShowHint = True 415 TabOrder = 5431 TabOrder = 7 416 432 OnChange = cboTypeChange 417 end 418 object chkPRN: TCheckBox [26] 433 OnKeyDown = cboTypeKeyDown 434 end 435 object chkPRN: TCheckBox [28] 419 436 Left = 436 420 437 Top = 213 … … 422 439 Height = 21 423 440 Caption = 'PRN' 424 TabOrder = 7441 TabOrder = 9 425 442 OnClick = chkPRNClick 426 443 end 427 object chkDoseNow: TCheckBox [2 7]444 object chkDoseNow: TCheckBox [29] 428 445 Left = 8 429 446 Top = 279 … … 433 450 Caption = 'Give Additional Dose Now' 434 451 Constraints.MinWidth = 147 435 TabOrder = 1 2452 TabOrder = 14 436 453 OnClick = chkDoseNowClick 437 454 end 438 object cboInfusionTime: TComboBox [ 28]455 object cboInfusionTime: TComboBox [30] 439 456 Left = 576 440 457 Top = 211 … … 442 459 Height = 21 443 460 ItemHeight = 13 444 TabOrder = 9461 TabOrder = 11 445 462 OnChange = cboInfusionTimeChange 446 463 OnEnter = cboInfusionTimeEnter 447 464 end 448 object lblAdminTime: TVA508StaticText [ 29]465 object lblAdminTime: TVA508StaticText [31] 449 466 Name = 'lblAdminTime' 450 467 Left = 8 … … 455 472 ParentShowHint = False 456 473 ShowHint = True 457 TabOrder = 1 4474 TabOrder = 15 458 475 TabStop = True 459 476 Visible = False 460 477 ShowAccelChar = True 461 478 end 462 object lblFirstDose: TVA508StaticText [3 0]479 object lblFirstDose: TVA508StaticText [32] 463 480 Name = 'lblFirstDose' 464 481 Left = 8 … … 467 484 Height = 4 468 485 Alignment = taLeftJustify 469 TabOrder = 1 5486 TabOrder = 16 470 487 TabStop = True 471 488 Visible = False 472 489 ShowAccelChar = True 473 490 end 491 object cboAddFreq: TCaptionComboBox [33] 492 Left = 488 493 Top = 72 494 Width = 145 495 Height = 21 496 ItemHeight = 13 497 TabOrder = 25 498 Visible = False 499 OnCloseUp = cboAddFreqCloseUp 500 OnKeyDown = cboAddFreqKeyDown 501 end 474 502 inherited cmdAccept: TButton 475 503 Left = 495 476 Top = 3 59477 TabOrder = 1 7504 Top = 364 505 TabOrder = 18 478 506 ExplicitLeft = 495 479 ExplicitTop = 3 59507 ExplicitTop = 364 480 508 end 481 509 inherited cmdQuit: TButton 482 510 Left = 495 483 Top = 3 86484 TabOrder = 1 8511 Top = 391 512 TabOrder = 19 485 513 ExplicitLeft = 495 486 ExplicitTop = 3 86514 ExplicitTop = 391 487 515 end 488 516 inherited pnlMessage: TPanel 489 517 Left = 56 490 Top = 34 9491 TabOrder = 19518 Top = 341 519 TabOrder = 20 492 520 ExplicitLeft = 56 493 ExplicitTop = 349 521 ExplicitTop = 341 522 end 523 object lbl508Required: TVA508StaticText [37] 524 Name = 'lbl508Required' 525 Left = 6 526 Top = 318 527 Width = 135 528 Height = 15 529 Alignment = taLeftJustify 530 Caption = ' * Indicates a Required Field' 531 TabOrder = 1 532 ShowAccelChar = True 494 533 end 495 534 inherited amgrMain: TVA508AccessibilityManager … … 497 536 ( 498 537 'Component = txtRate' 499 'Status = stsDefault') 538 'Label = lblInfusionRate' 539 'Status = stsOK') 500 540 ( 501 541 'Component = cboPriority' 502 'Status = stsDefault') 542 'Label = lblPriority' 543 'Status = stsOK') 503 544 ( 504 545 'Component = grdSelected' … … 521 562 ( 522 563 'Component = txtXDuration' 523 'Status = stsDefault') 564 'Label = lblLimit' 565 'Status = stsOK') 524 566 ( 525 567 'Component = pnlCombo' … … 536 578 ( 537 579 'Component = cboRoute' 538 'Status = stsDefault') 580 'Label = lblRoute' 581 'Status = stsOK') 539 582 ( 540 583 'Component = cboSchedule' 541 'Status = stsDefault') 584 'Label = lblSchedule' 585 'Status = stsOK') 542 586 ( 543 587 'Component = cboType' 544 'Status = stsDefault') 588 'Label = lblType' 589 'Status = stsOK') 545 590 ( 546 591 'Component = chkPRN' … … 551 596 ( 552 597 'Component = memOrder' 553 'Status = stsDefault') 598 'Label = Label1' 599 'Status = stsOK') 554 600 ( 555 601 'Component = cmdAccept' … … 569 615 ( 570 616 'Component = cboInfusionTime' 571 'Status = stsDefault') 617 'Text = Infusion Rate Time' 618 'Status = stsOK') 572 619 ( 573 620 'Component = cboDuration' 574 'Status = stsDefault') 621 'Text = Duration/Volume Units' 622 'Status = stsOK') 575 623 ( 576 624 'Component = lblAdminTime' … … 578 626 ( 579 627 'Component = lblFirstDose' 628 'Status = stsDefault') 629 ( 630 'Component = cboAddFreq' 631 'Status = stsDefault') 632 ( 633 'Component = lbl508Required' 580 634 'Status = stsDefault')) 581 635 end 636 object VA508CompOrderSig: TVA508ComponentAccessibility 637 Component = memOrder 638 OnStateQuery = VA508CompOrderSigStateQuery 639 Left = 24 640 Top = 368 641 end 642 object VA508CompRoute: TVA508ComponentAccessibility 643 Component = cboRoute 644 OnInstructionsQuery = VA508CompRouteInstructionsQuery 645 Left = 104 646 Top = 240 647 end 648 object VA508CompType: TVA508ComponentAccessibility 649 Component = cboType 650 OnInstructionsQuery = VA508CompTypeInstructionsQuery 651 Left = 224 652 Top = 280 653 end 654 object VA508CompSchedule: TVA508ComponentAccessibility 655 Component = cboSchedule 656 OnInstructionsQuery = VA508CompScheduleInstructionsQuery 657 Left = 384 658 Top = 240 659 end 660 object VA508CompGrdSelected: TVA508ComponentAccessibility 661 Component = grdSelected 662 OnCaptionQuery = VA508CompGrdSelectedCaptionQuery 663 Left = 288 664 Top = 64 665 end 582 666 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMedIV.pas
r829 r1693 45 45 txtAllIVRoutes: TLabel; 46 46 lblTypeHelp: TLabel; 47 cboAddFreq: TCaptionComboBox; 48 lblAddFreq: TLabel; 49 lblPrevAddFreq: TLabel; 50 lbl508Required: TVA508StaticText; 51 VA508CompOrderSig: TVA508ComponentAccessibility; 52 VA508CompRoute: TVA508ComponentAccessibility; 53 VA508CompType: TVA508ComponentAccessibility; 54 VA508CompSchedule: TVA508ComponentAccessibility; 55 VA508CompGrdSelected: TVA508ComponentAccessibility; 47 56 procedure FormCreate(Sender: TObject); 48 57 procedure tabFluidChange(Sender: TObject); … … 59 68 procedure FormResize(Sender: TObject); 60 69 procedure txtSelectedExit(Sender: TObject); 61 procedure cboSelectedExit(Sender: TObject);62 70 procedure ControlChange(Sender: TObject); 63 71 procedure txtSelectedChange(Sender: TObject); 64 procedure cboSelectedChange(Sender: TObject);65 72 procedure grdSelectedDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; 66 73 State: TGridDrawState); … … 94 101 procedure cboRouteClick(Sender: TObject); 95 102 procedure lblTypeHelpClick(Sender: TObject); 103 procedure cboSelectedCloseUp(Sender: TObject); 104 procedure cboRouteKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 105 procedure cboScheduleKeyUp(Sender: TObject; var Key: Word; 106 Shift: TShiftState); 107 procedure cboPriorityKeyUp(Sender: TObject; var Key: Word; 108 Shift: TShiftState); 109 procedure cboAddFreqKeyDown(Sender: TObject; var Key: Word; 110 Shift: TShiftState); 111 procedure cboAddFreqCloseUp(Sender: TObject); 112 procedure FormKeyPress(Sender: TObject; var Key: Char); 113 procedure txtSelectedKeyDown(Sender: TObject; var Key: Word; 114 Shift: TShiftState); 115 procedure cboSelectedKeyDown(Sender: TObject; var Key: Word; 116 Shift: TShiftState); 117 procedure cboTypeKeyDown(Sender: TObject; var Key: Word; 118 Shift: TShiftState); 119 procedure cboRouteKeyDown(Sender: TObject; var Key: Word; 120 Shift: TShiftState); 121 procedure cboScheduleKeyDown(Sender: TObject; var Key: Word; 122 Shift: TShiftState); 123 procedure VA508CompOrderSigStateQuery(Sender: TObject; var Text: string); 124 procedure VA508CompRouteInstructionsQuery(Sender: TObject; 125 var Text: string); 126 procedure VA508CompTypeInstructionsQuery(Sender: TObject; var Text: string); 127 procedure VA508CompScheduleInstructionsQuery(Sender: TObject; 128 var Text: string); 129 procedure VA508CompGrdSelectedCaptionQuery(Sender: TObject; 130 var Text: string); 96 131 private 97 132 FInpatient: Boolean; … … 102 137 OSchedule: string; 103 138 oAdmin: string; 104 Action: integer;105 139 OrderIEN: string; 106 140 FAdminTimeText: string; … … 108 142 FOriginalDurationType: integer; 109 143 FOriginalInfusionType: integer; 110 FInitialOrderID: boolean; 144 FIVTypeDefined: boolean; 145 //FInitialOrderID: boolean; 111 146 procedure SetValuesFromResponses; 112 147 procedure DoSetFontSize( FontSize: integer); … … 119 154 procedure UpdateDuration(SchType: string); 120 155 procedure ClearAllFields; 156 function UpdateAddFreq(OI: integer): string; 157 function IsAltCtrl_L_Pressed(Shift : TShiftState; Key : Word) : Boolean; 158 procedure SetCtrlAlt_L_LabelAccessText(var Text: string; theLabel : TLabel); 121 159 public 160 OrdAction: integer; 122 161 procedure InitDialog; override; 123 162 procedure SetupDialog(OrderAction: Integer; const ID: string); override; … … 152 191 Units: string; 153 192 Volumes: string; 193 AddFreq: string; 154 194 end; 155 195 … … 168 208 TX_BAD_ROUTE = 'Route cannot be free-text'; 169 209 TX_LEADING_NUMERIC = 'this additive must start with a leading numeric value'; 210 TX_BAD_BAG = 'A valid additive frequency must be entered for '; 211 Tx_BAG_NO_COMMENTS ='"See Comments" entered for additive '; 212 TX_BAG_NO_COMMENTS1 = ' no comments defined for this order.'; 170 213 171 214 (* … … 200 243 Exit; 201 244 end; 245 OrdAction := -1; 202 246 DoSetFontSize(MainFontSize); 203 247 FillerID := 'PSIV'; // does 'on Display' order check **KCM** … … 221 265 var 222 266 bottom: integer; 223 begin 224 inherited; 267 isNewOrder: boolean; 268 begin 269 inherited; 270 if OrdAction in [ORDER_COPY, ORDER_EDIT] then isNewOrder := false 271 else isNewOrder := True; 225 272 with grdSelected do 226 273 begin 227 274 ColWidths[1] := Canvas.TextWidth(' 10000 ') + GetSystemMetrics(SM_CXVSCROLL); 228 275 ColWidths[2] := Canvas.TextWidth('meq.') + GetSystemMetrics(SM_CXVSCROLL); 229 ColWidths[0] := ClientWidth - ColWidths[1] - ColWidths[2] - 4; 276 //AGP ADDITIVE FREQUENCY CHANGES 277 ColWidths[3] := Canvas.TextWidth(lblAddFreq.Caption + ' ') + GetSystemMetrics(SM_CXVSCROLL); 278 if IsNewOrder = false then 279 begin 280 ColWidths[4] := Canvas.TextWidth(lblPrevAddFreq.Caption) + GetSystemMetrics(SM_CXVSCROLL); 281 ColWidths[0] := ClientWidth - ColWidths[1] - ColWidths[2] - ColWidths[3] - ColWidths[4] - 5; 282 end 283 else 284 begin 285 ColWidths[4] := 0; 286 ColWidths[0] := ClientWidth - ColWidths[1] - ColWidths[2] - ColWidths[3] - ColWidths[4] - 25; 287 end; 230 288 end; 231 289 lblAmount.Left := grdSelected.Left + grdSelected.ColWidths[0]; 290 lblAddFreq.Left := grdSelected.Left + grdSelected.ColWidths[0] + grdSelected.ColWidths[1] + grdSelected.ColWidths[2]; 291 if isNewOrder = false then 292 begin 293 lblPrevAddFreq.Visible := True; 294 lblPrevAddFreq.Left := grdSelected.Left + grdSelected.ColWidths[0] + grdSelected.ColWidths[1] + grdSelected.ColWidths[2] + grdSelected.ColWidths[3]; 295 end 296 else lblPrevAddFreq.Visible := False; 232 297 self.cboType.SelLength := 0; 233 298 self.cboInfusionTime.SelLength := 0; … … 243 308 self.lblAdminTime.Top := self.chkDoseNow.Top + self.chkDoseNow.Height + 2; 244 309 self.lblFirstDose.Top := self.lblAdminTime.Top + self.lblAdminTime.Height + 2; 245 if self.Label1.Top < (self.lblFirstDose.Top + self.lblFirstDose.Height) then 246 begin 247 self.Label1.Top := self.lblFirstDose.Top + self.lblFirstDose.Height + 2; 310 self.lbl508Required.Top := self.lblFirstDose.Top + self.lblFirstDose.Height + 5; 311 if self.Label1.Top < (self.lbl508Required.Top + self.lbl508Required.Height) then 312 begin 313 self.Label1.Top := self.lbl508Required.Top + self.lbl508Required.Height + 5; 248 314 self.memOrder.Top := self.Label1.Top + self.Label1.Height; 249 315 end; … … 262 328 //FRouteConflict := False; 263 329 //lblTypeHelp.Hint := IVTypeHelpText; 330 ClearAllFields; 331 //FIVTypeDefined := false; 264 332 lblType.Hint := IVTypeHelpText; 265 333 cboType.Hint := IVTYpeHelpText; … … 286 354 //if (Patient.Inpatient) and (cboSchedule.Items.IndexOfName('Other')<0) then 287 355 if cboSchedule.Items.IndexOf('Other') = -1 then cboSchedule.Items.Add('OTHER'); 288 289 356 cboSchedule.Enabled := False; 290 357 lblschedule.Enabled := False; … … 310 377 chkDoseNow.Visible := false; 311 378 chkPRN.Enabled := false; 379 //AGP ADDITIVE FREQUENCY CHANGES 380 if cboAddFreq.Items.Count = 0 then 381 begin 382 cboAddFreq.Items.Add('1 Bag/Day'); 383 cboAddFreq.Items.Add('All Bags'); 384 cboAddFreq.Items.Add('See Comments'); 385 end; 312 386 end; 313 387 tabFluid.TabIndex := 0; … … 330 404 oAdmin := ''; 331 405 self.txtAllIVRoutes.Visible := false; 406 memorder.text := ''; 407 memOrder.Lines.Clear; 332 408 end; 333 409 … … 339 415 CRLF + ' over a specified time period (e.g. Infuse over 30 min.).' + CRLF + CRLF + 340 416 'Examples:' + CRLF + 'Continuous = Infusion/drip' + CRLF + 'Intermittent = IVP/IVPB'; 417 end; 418 419 procedure TfrmODMedIV.SetCtrlAlt_L_LabelAccessText(var Text: string; theLabel : TLabel); 420 begin 421 if theLabel.Visible then 422 Text := 'Press Ctrl + Alt + L to access ' + theLabel.Caption; 341 423 end; 342 424 … … 455 537 end; 456 538 539 procedure TfrmODMedIV.VA508CompRouteInstructionsQuery( 540 Sender: TObject; var Text: string); 541 begin 542 inherited; 543 SetCtrlAlt_L_LabelAccessText(Text, txtAllIVRoutes); 544 end; 545 546 procedure TfrmODMedIV.VA508CompScheduleInstructionsQuery(Sender: TObject; 547 var Text: string); 548 begin 549 inherited; 550 SetCtrlAlt_L_LabelAccessText(Text, txtNSS); 551 end; 552 553 procedure TfrmODMedIV.VA508CompTypeInstructionsQuery(Sender: TObject; 554 var Text: string); 555 begin 556 inherited; 557 SetCtrlAlt_L_LabelAccessText(Text, lblTypeHelp); 558 end; 559 560 procedure TfrmODMedIV.VA508CompGrdSelectedCaptionQuery(Sender: TObject; 561 var Text: string); 562 begin 563 inherited; 564 if grdSelected.Col = 0 then 565 Text := lblComponent.Caption 566 else if grdSelected.Col = 1 then 567 Text := lblAmount.Caption 568 else if grdSelected.Col = 2 then 569 Text := lblAmount.Caption + ', Unit' 570 else if grdSelected.Col = 3 then 571 Text := lblAddFreq.Caption 572 else if grdSelected.Col = 4 then 573 Text := lblPrevAddFreq.Caption; 574 end; 575 576 procedure TfrmODMedIV.VA508CompOrderSigStateQuery(Sender: TObject; 577 var Text: string); 578 begin 579 inherited; 580 Text := memOrder.Text; 581 end; 582 457 583 procedure TfrmODMedIV.Validate(var AnErrMsg: string); 458 584 var 459 585 DispWarning, ItemOK, Result: Boolean; 460 LDec,RDec,x, tempStr, iunit, infError : string;586 LDec,RDec,x, tempStr, iunit, infError, Bag: string; 461 587 digits, i, j, Len, temp, Value: Integer; 462 588 … … 499 625 end; 500 626 end; 627 //AGP ADDITIVE FREQUENCY CHANGES 628 if MixedCase(self.cboType.Items.Strings[self.cboType.ItemIndex]) = 'Continuous' then 629 begin 630 Bag := (Cells[3, i]); 631 if Length(Bag) = 0 then 632 begin 633 SetError(TX_BAD_BAG + cells[0, i]); 634 end 635 else if cboAddFreq.Items.IndexOf(Bag) = -1 then 636 begin 637 SetError(TX_BAD_BAG + cells[0, i]); 638 end 639 else if (MixedCase(Bag) = 'See Comments') and ((self.memComments.Text = '') or (self.memComments.Text = CRLF)) then 640 begin 641 SetError(Tx_BAG_NO_COMMENTS + cells[0,i] + Tx_BAG_NO_COMMENTS1); 642 end; 643 644 end; 501 645 end; 502 646 end; … … 574 718 else if (iunit = 'Hours') and (Len > 2) then setError('Infuse Over Time cannot exceed 2 spaces for ' + iunit); 575 719 end; 576 if (cboSchedule.ItemIndex = -1) and (cboSchedule.Text = '') then SetError(TX_NO_SCHEDULE); 720 if (cboSchedule.ItemIndex = -1) and (cboSchedule.Text = '') and (chkPRN.Checked = false) then SetError(TX_NO_SCHEDULE); 721 if (cboSchedule.ItemIndex > -1) and (cboSchedule.Text = '') then 722 begin 723 cboSchedule.ItemIndex := -1; 724 SetError(TX_NO_SCHEDULE) 725 end; 577 726 if (cboSchedule.ItemIndex = -1) and (cboSchedule.Text <> '') then SetError(TX_BAD_SCHEDULE); 578 727 end; 579 728 if txtXDuration.Text = '' then 580 729 begin 581 if AnErrMsg = '' then self.FInitialOrderID := True; 582 exit; 730 if AnErrMsg = '' then exit; 731 //if AnErrMsg = '' then self.FInitialOrderID := True; 732 //exit; 583 733 end; 584 734 Len := Length(txtXDuration.Text); … … 607 757 SetError('Duration with a unit of "doses" must be greater then 0 and less then 2000000'); 608 758 end; 609 if AnErrMsg = '' then self.FInitialOrderID := True;759 //if AnErrMsg = '' then self.FInitialOrderID := True; 610 760 611 761 end; … … 629 779 procedure TfrmODMedIV.SetValuesFromResponses; 630 780 var 631 x, addRoute, tempSch, AdminTime, TempOrder, tmpSch, tempIRoute, tempRoute : string;632 AnInstance, i, idx : Integer;633 AResponse : TResponse;781 x, addRoute, tempSch, AdminTime, TempOrder, tmpSch, tempIRoute, tempRoute, PreAddFreq: string; 782 AnInstance, i, idx, j: Integer; 783 AResponse, AddFreqResp: TResponse; 634 784 AnIVComponent: TIVComponent; 635 785 AllIVRoute: TStringList; … … 637 787 begin 638 788 Changing := True; 639 self.FInitialOrderID := false;789 //self.FInitialOrderID := false; 640 790 with Responses do 641 791 begin 792 SetControl(cboType, 'TYPE', 1); 793 if cboType.ItemIndex > -1 then FIVTypeDefined := True; 642 794 FInpatient := OrderForInpatient; 643 795 AnInstance := NextInstance('ORDERABLE', 0); … … 682 834 Cells[1, RowCount - 1] := IntToStr(AnIVComponent.Amount); 683 835 Cells[2, RowCount - 1] := AnIVComponent.Units; 836 Cells[3, RowCount - 1] := 'N/A'; 684 837 end; 685 838 end; … … 721 874 AnIVComponent.Units := Piece(x, U, 1); 722 875 AnIVComponent.Volumes := Copy(x, Pos(U, x) + 1, Length(x)); 876 //AGP ADDITIVE FREQUENCY CHANGES 877 AnIVComponent.AddFreq := ''; 878 PreAddFreq := ''; 879 AddFreqResp := FindResponseByName('ADDFREQ', AnInstance); 880 if AddFreqResp <> nil then 881 begin 882 if cboAddFreq.Items.IndexOf(AddFreqResp.IValue) = -1 then 883 begin 884 AnIvComponent.AddFreq := ''; 885 end 886 else AnIvComponent.AddFreq := AddFreqResp.IValue; 887 PreAddFreq := AddFreqResp.IValue; 888 end; 723 889 with grdSelected do 724 890 begin … … 729 895 Cells[1, RowCount - 1] := IntToStr(AnIVComponent.Amount); 730 896 Cells[2, RowCount - 1] := AnIVComponent.Units; 897 Cells[3, RowCount -1] := AnIVComponent.AddFreq; 898 if OrdAction in [ORDER_COPY, ORDER_EDIT] then Cells[4, RowCount -1] := PreAddFreq; 731 899 end; 732 900 end; … … 803 971 //if (cboSchedule.ItemIndex > -1) then lblAdminTime.Caption := 'Admin. Time: ' + Piece(cboSchedule.Items.strings[cboSchedule.itemindex],U,5); 804 972 //if (cboSchedule.ItemIndex > -1) and (Piece(lblAdminTime.Caption, ':' ,2) = ' ') then lblAdminTime.Caption := 'Admin. Time: ' + AdminTime; 805 if ( Action in [ORDER_COPY, ORDER_EDIT]) then973 if (OrdAction in [ORDER_COPY, ORDER_EDIT]) then 806 974 begin 807 975 TempOrder := Piece(OrderIEN,';',1); … … 812 980 if AResponse <> nil then AdminTime := AResponse.EValue; 813 981 //lblAdminTime.Caption := 'Admin. Time: ' + AdminTime; 814 if cboSchedule.ItemIndex > -1then982 if (cboSchedule.ItemIndex > -1) and (AdminTime <> '') then 815 983 begin 816 984 tmpSch := cboSchedule.Items.Strings[cboSchedule.itemindex]; … … 848 1016 cboInfusionTime.itemindex := 0; 849 1017 end; 1018 For j := 0 to grdSelected.RowCount -1 do 1019 grdSelected.Cells[3,j] := 'N/A'; 850 1020 end 851 1021 else … … 890 1060 begin 891 1061 inherited; 892 Action := OrderAction;1062 OrdAction := OrderAction; 893 1063 OrderIEN := id; 894 self.FInitialOrderID := True;1064 //self.FInitialOrderID := True; 895 1065 if self.EvtID > 0 then FAdminTimeText := 'To Be Determined'; 1066 if isIMO = true then self.Caption := 'Clinic ' + self.Caption; 896 1067 if (isIMO) or ((patient.Inpatient = true) and (encounter.Location <> patient.Location)) and (FAdminTimeText = '') then 897 1068 FAdminTimeText := 'Not defined for Clinic Locations'; 898 1069 if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then 899 1070 begin 900 901 1071 SetValuesFromResponses; 902 1072 end; … … 928 1098 procedure TfrmODMedIV.cboSolutionNeedData(Sender: TObject; const StartFrom: string; 929 1099 Direction, InsertAt: Integer); 930 var 931 CurString: string; 932 begin 933 inherited; 934 if (Direction = 1) then 935 CurString := AnsiUpperCase(StartFrom) + ' '; 936 cboSolution.ForDataUse(SubSetOfOrderItems(CurString, Direction, 'S.IVB RX')); 1100 begin 1101 cboSolution.ForDataUse(SubSetOfOrderItems(StartFrom, Direction, 'S.IVB RX')); 937 1102 end; 938 1103 939 1104 procedure TfrmODMedIV.cbotypeChange(Sender: TObject); 1105 var 1106 i: integer; 940 1107 begin 941 1108 inherited; … … 955 1122 lblInfusionRate.Caption := 'Infuse Over Time (Optional)'; 956 1123 cboInfusionTime.Enabled := true; 957 cboDuration.Items.Add('doses'); 1124 if cboDuration.items.IndexOf('doses') = -1 then cboDuration.Items.Add('doses'); 1125 //AGP ADDITIVE FREQUECNY CHANGES 1126 lblAddFreq.Caption := 'Additive Frequency'; 1127 for i := 0 to grdselected.RowCount - 1 do 1128 begin 1129 if (TIVComponent(grdselected.Objects[0, i]) <> nil) and (TIVComponent(grdselected.Objects[0, i]).Fluid = 'A') then 1130 begin 1131 grdSelected.Cells[3, i] := 'N/A'; 1132 end; 1133 end; 958 1134 end 959 1135 //else if (self.cbotype.Text = 'Continuous') or (self.cboType.itemIndex = 0) then … … 975 1151 updateDuration(''); 976 1152 cboduration.Items.Delete(cboDuration.Items.IndexOf('doses')); 977 end; 1153 lblAddFreq.Caption := 'Additive Frequency*'; 1154 if FIVTypeDefined = True then 1155 begin 1156 for i := 0 to grdselected.RowCount - 1 do 1157 begin 1158 if (TIVComponent(grdselected.Objects[0, i]) <> nil) and (TIVComponent(grdselected.Objects[0, i]).Fluid = 'A') then 1159 begin 1160 grdSelected.Cells[3, i] := ''; 1161 end; 1162 end; 1163 end; 1164 end; 1165 FIVTypeDefined := True; 978 1166 self.txtRate.Text := ''; 979 1167 ControlChange(Sender); 1168 end; 1169 1170 procedure TfrmODMedIV.cboTypeKeyDown(Sender: TObject; var Key: Word; 1171 Shift: TShiftState); 1172 begin 1173 inherited; 1174 if IsAltCtrl_L_Pressed(Shift, Key) then 1175 lblTypeHelpClick(lblTypeHelp); 1176 end; 1177 1178 function TfrmODMedIV.IsAltCtrl_L_Pressed(Shift : TShiftState; Key : Word) : Boolean; 1179 begin 1180 Result := (ssCtrl in Shift) and (ssAlt in Shift) and (Key = Ord('L')); 980 1181 end; 981 1182 … … 986 1187 T2 = #13#13'The first order''s administrative schedule is "'; 987 1188 T3 = #13'The second order''s administrative schedule is "'; 988 T4 = #13#13'Do you want to continue?'; 1189 T4 = #13#13'Do you want to continue?'; 1190 T5 = '" and a priority of "'; 989 1191 T1A = 'By checking the "Give additional dose now" box, you have actually entered a new order with the schedule "NOW"'; 990 1192 T2A = ' in addition to the one you are placing for the same medication.'; … … 992 1194 medNm: string; 993 1195 theSch: string; 1196 ordPriority: string; 994 1197 //SchID: integer; 995 1198 begin … … 1000 1203 //SchID := cboSchedule.ItemIndex; 1001 1204 theSch := cboSchedule.Text; 1205 ordPriority := cboPriority.SelText; 1002 1206 if length(theSch)>0 then 1003 1207 begin 1004 1208 //if (InfoBox(T1+medNm+T+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL)then 1005 if (InfoBox(T1+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL)then 1209 //if (InfoBox(T1+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL)then 1210 if (InfoBox(T1+T2+'NOW'+T5+ordPriority+T+T3+theSch+T5+ordPriority+T+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL)then 1006 1211 begin 1007 1212 chkDoseNow.Checked := False; … … 1089 1294 Cells[1, RowCount - 1] := IntToStr(AnIVComponent.Amount); 1090 1295 Cells[2, RowCount - 1] := AnIVComponent.Units; 1296 Cells[3, RowCount - 1] := 'N/A'; 1091 1297 Row := RowCount - 1; 1092 1298 if Length(Piece(AnIVComponent.Volumes, U, 2)) > 0 then Col := 1 else Col := 0; 1093 if RowCount = 1 then // switch to additives after 1st IV1299 (* if RowCount = 1 then // switch to additives after 1st IV 1094 1300 begin 1095 1301 tabFluid.TabIndex := 1; 1096 1302 tabFluidChange(Self); 1097 end; 1303 end; *) 1098 1304 end; 1099 1305 Application.ProcessMessages; //CQ: 10157 1306 updateRoute; 1100 1307 ClickOnGridCell; 1101 updateRoute;1308 //updateRoute; 1102 1309 ControlChange(Sender); 1103 1310 //updateRoute(routeIEN); … … 1117 1324 procedure TfrmODMedIV.cboAdditiveNeedData(Sender: TObject; const StartFrom: string; 1118 1325 Direction, InsertAt: Integer); 1119 var 1120 CurString: string; 1121 begin 1122 inherited; 1123 if (Direction = 1) then 1124 CurString := AnsiUpperCase(StartFrom) + ' '; 1125 cboAdditive.ForDataUse(SubSetOfOrderItems(CurString, Direction, 'S.IVA RX')); 1326 begin 1327 cboAdditive.ForDataUse(SubSetOfOrderItems(StartFrom, Direction, 'S.IVA RX')); 1328 end; 1329 1330 procedure TfrmODMedIV.cboAddFreqCloseUp(Sender: TObject); 1331 begin 1332 inherited; 1333 with cboAddFreq do 1334 begin 1335 if tag < 0 then exit; 1336 grdSelected.Cells[Tag div 256, Tag mod 256] := MixedCase(items.Strings[itemindex]); 1337 Tag := -1; 1338 Hide; 1339 ControlChange(Sender); 1340 TControl(self.grdSelected).Enabled := True; 1341 ActiveControl := self.grdSelected; 1342 end; 1343 grdSelected.Refresh; 1344 end; 1345 1346 procedure TfrmODMedIV.cboAddFreqKeyDown(Sender: TObject; var Key: Word; 1347 Shift: TShiftState); 1348 begin 1349 inherited; 1350 if (Key = VK_RETURN) or (Key = VK_Tab) then 1351 begin 1352 cboAddFreqCloseUp(cboAddFreq); 1353 Key := 0; 1354 end; 1126 1355 end; 1127 1356 … … 1177 1406 cboPriority.SetFocus; 1178 1407 end; 1408 end; 1409 1410 procedure TfrmODMedIV.cboPriorityKeyUp(Sender: TObject; var Key: Word; 1411 Shift: TShiftState); 1412 begin 1413 inherited; 1414 if (Key = VK_BACK) and (cboPriority.Text = '') then cboPriority.ItemIndex := -1; 1179 1415 end; 1180 1416 … … 1232 1468 end; 1233 1469 1470 procedure TfrmODMedIV.cboRouteKeyDown(Sender: TObject; var Key: Word; 1471 Shift: TShiftState); 1472 begin 1473 inherited; 1474 if IsAltCtrl_L_Pressed(Shift, Key) then 1475 txtAllIVRoutesClick(txtAllIVRoutes); 1476 end; 1477 1478 procedure TfrmODMedIV.cboRouteKeyUp(Sender: TObject; var Key: Word; 1479 Shift: TShiftState); 1480 begin 1481 inherited; 1482 if (Key = VK_BACK) and (cboRoute.Text = '') then cboRoute.ItemIndex := -1; 1483 end; 1484 1234 1485 procedure TfrmODMedIV.cboAdditiveMouseClick(Sender: TObject); 1235 1486 var … … 1273 1524 Cells[0, RowCount - 1] := AnIVComponent.Name; 1274 1525 Cells[2, RowCount - 1] := AnIVComponent.Units; 1526 Cells[3, RowCount -1] := UpdateAddFreq(AnIVComponent.IEN); 1275 1527 Row := RowCount - 1; 1276 1528 Col := 1; … … 1302 1554 self.cboDuration.Text := ''; 1303 1555 self.txtAllIVRoutes.Visible := false; 1304 self.FInitialOrderID := True;1556 //self.FInitialOrderID := True; 1305 1557 cbotypeChange(self.cboType); 1306 1558 if self.cboroute.Items.Count > 0 then self.cboRoute.Clear; 1559 FIVTypeDefined := false; 1307 1560 end; 1308 1561 … … 1324 1577 SetFocus; 1325 1578 if AControl is TComboBox then //CQ: 10157 1326 TComboBox(AControl).DroppedDown := True; 1579 begin 1580 TComboBox(AControl).DroppedDown := True; 1581 TControl(self.grdSelected).Enabled := false; 1582 end; 1327 1583 end; 1328 1584 end; … … 1330 1586 begin 1331 1587 AnIVComponent := TIVComponent(grdSelected.Objects[0, grdSelected.Row]); 1332 if (AnIVComponent = nil) or (grdSelected.Col = 0) then Exit; 1588 if (AnIVComponent = nil) or (grdSelected.Col = 0) then 1589 begin 1590 if (AnIVComponent <> nil) and (grdSelected.Col = 0) then grdSelected.Refresh; 1591 Exit; 1592 end; 1333 1593 // allow selection if more the 1 unit to choose from 1334 1594 if (grdSelected.Col = 2) and (Length(Piece(AnIVComponent.Units, U, 2)) > 0) then … … 1354 1614 PlaceControl(txtSelected); 1355 1615 end; 1616 // AGP ADDITIVE FREQUENCY CHANGES 1617 if (Self.cboType.ItemIndex < 1) and (grdSelected.Col = 3) and (AnIVComponent.Fluid = 'A') then 1618 begin 1619 cboAddFreq.ItemIndex := cboAddFreq.Items.IndexOf(grdSelected.Cells[grdSelected.Col, grdSelected.Row]); 1620 cboAddFreq.Tag := (grdSelected.Col * 256) + grdSelected.Row; 1621 PlaceControl(cboAddFreq); 1622 end; 1356 1623 end; 1357 1624 … … 1376 1643 Hide; 1377 1644 end; 1645 grdSelected.Refresh; 1646 end; 1647 1648 1649 1650 procedure TfrmODMedIV.txtSelectedKeyDown(Sender: TObject; var Key: Word; 1651 Shift: TShiftState); 1652 begin 1653 inherited; 1654 if (Key = VK_RETURN) or (Key = VK_Tab) then 1655 begin 1656 ActiveControl := grdSelected; 1657 Key := 0; 1658 end; 1378 1659 end; 1379 1660 1380 1661 procedure TfrmODMedIV.cboScheduleChange(Sender: TObject); 1662 var 1663 othSch: string; 1664 idx: integer; 1381 1665 begin 1382 1666 inherited; … … 1386 1670 self.cboDuration.ItemIndex := -1; 1387 1671 end; 1388 if self.cboSchedule.ItemIndex > -1 then updateDuration(Piece(cboSchedule.Items.Strings[cboSchedule.itemindex],U,3)); 1672 if self.cboSchedule.ItemIndex > -1 then 1673 begin 1674 if cboSchedule.ItemIndex = cboSchedule.Items.IndexOf('Other') then 1675 begin 1676 othSch := CreateOtherSchedule; 1677 if length(trim(othSch)) > 1 then 1678 begin 1679 cboSchedule.Items.Add(othSch + U + U + NSSScheduleType + U + NSSAdminTime); 1680 idx := cboSchedule.Items.IndexOf(Piece(OthSch, U, 1)); 1681 cboSchedule.ItemIndex := idx; 1682 end 1683 else cboSchedule.itemindex := -1; 1684 end; 1685 if cboSchedule.itemIndex > -1 then updateDuration(Piece(cboSchedule.Items.Strings[cboSchedule.itemindex],U,3)); 1686 end; 1389 1687 ControlChange(sender); 1390 1688 end; … … 1393 1691 var 1394 1692 othSch: string; 1395 idx , i: integer;1693 idx: integer; 1396 1694 begin 1397 1695 inherited; … … 1402 1700 begin 1403 1701 cboSchedule.Items.Add(othSch + U + U + NSSScheduleType + U + NSSAdminTime); 1404 idx := -1; 1405 for I := 0 to cboSchedule.Items.Count - 1 do 1406 if Piece(cboSchedule.Items.Strings[i], U, 1) = othSch then 1407 begin 1408 idx := i; 1409 break; 1410 end; 1411 //idx := cboSchedule.Items.IndexOfName(othSch); 1702 idx := cboSchedule.Items.IndexOf(Piece(OthSch, U, 1)); 1412 1703 cboSchedule.ItemIndex := idx; 1413 1704 end; … … 1431 1722 cboSchedule.SetFocus; 1432 1723 end; 1433 end; 1434 1435 procedure TfrmODMedIV.cboSelectedChange(Sender: TObject); // combo editor for grid 1724 if (cboSchedule.ItemIndex > -1) and (cboSchedule.Text = '') then cboSchedule.ItemIndex := -1; 1725 end; 1726 1727 procedure TfrmODMedIV.cboScheduleKeyDown(Sender: TObject; var Key: Word; 1728 Shift: TShiftState); 1729 begin 1730 inherited; 1731 if IsAltCtrl_L_Pressed(Shift, Key) then 1732 txtNSSClick(txtNSS); 1733 end; 1734 1735 procedure TfrmODMedIV.cboScheduleKeyUp(Sender: TObject; var Key: Word; 1736 Shift: TShiftState); 1737 begin 1738 inherited; 1739 if (Key = VK_BACK) and (cboSchedule.Text = '') then cboSchedule.ItemIndex := -1; 1740 end; 1741 1742 procedure TfrmODMedIV.cboSelectedCloseUp(Sender: TObject); 1436 1743 begin 1437 1744 inherited; 1438 1745 with cboSelected do 1439 1746 begin 1440 if Tag < 0 then Exit; 1441 grdSelected.Cells[Tag div 256, Tag mod 256] := Text; 1442 end; 1443 ControlChange(Sender); 1444 end; 1445 1446 procedure TfrmODMedIV.cboSelectedExit(Sender: TObject); 1447 begin 1448 inherited; 1449 with cboSelected do 1450 begin 1451 grdSelected.Cells[Tag div 256, Tag mod 256] := Text; 1747 if tag < 0 then exit; 1748 grdSelected.Cells[Tag div 256, Tag mod 256] := MixedCase(items.Strings[itemindex]); 1452 1749 Tag := -1; 1453 1750 Hide; 1751 ControlChange(Sender); 1752 TControl(self.grdSelected).Enabled := True; 1753 ActiveControl := self.grdSelected; 1754 end; 1755 grdSelected.Refresh; 1756 end; 1757 1758 procedure TfrmODMedIV.cboSelectedKeyDown(Sender: TObject; var Key: Word; 1759 Shift: TShiftState); 1760 begin 1761 inherited; 1762 if (Key = VK_RETURN) or (Key = VK_Tab) then 1763 begin 1764 cboSelectedCloseUp(cboSelected); 1765 Key := 0; 1454 1766 end; 1455 1767 end; … … 1528 1840 if Length(Cells[1,i]) > 0 then Responses.Update('STRENGTH', CurAdd, Cells[1,i], Cells[1,i]); 1529 1841 if Length(Cells[2,i]) > 0 then Responses.Update('UNITS', CurAdd, Cells[2,i], Cells[2,i]); 1842 //AGP ADDITIVE FREQUECNY CHANGES 1843 if (Length(Cells[3,i]) > 0) and (Cells[3,i] <> 'N/A') then Responses.Update('ADDFREQ', CurAdd, Cells[3,i], Cells[3,i]); 1530 1844 Inc(CurAdd); 1531 1845 end; {if Fluid A} … … 1558 1872 end; 1559 1873 end; 1560 if cboType.Text = 'Intermittent' then iType := 'I' 1561 else iType := 'C'; 1874 if (cboType.ItemIndex > -1) and (cboType.Items.Strings[cboType.ItemIndex] = 'Intermittent') then iType := 'I' 1875 else if (cboType.ItemIndex > -1) and (cboType.Items.Strings[cboType.ItemIndex] = 'Continuous') then iType := 'C' 1876 else iType := ''; 1562 1877 Responses.Update('TYPE',1,iType,cboType.Text); 1563 1878 Responses.Update('ROUTE',1,cboRoute.ItemID,cboRoute.Text); … … 1635 1950 begin 1636 1951 aSchedule := ''; 1637 if not ShowOtherSchedule(aSchedule) then 1638 begin 1639 cboSchedule.ItemIndex := -1; 1640 cboSchedule.Text := ''; 1641 end 1642 else 1952 cboSchedule.ItemIndex := -1; 1953 cboSchedule.Text := ''; 1954 cboSchedule.DroppedDown := false; 1955 if ShowOtherSchedule(aSchedule) then 1643 1956 begin 1644 1957 Result := Piece(aSchedule,U,1); … … 1652 1965 begin 1653 1966 inherited; 1654 if Sender = ActiveControl then Exit;1655 if not (gdSelected in State) then Exit;1967 //if Sender = ActiveControl then Exit; 1968 //if not (gdSelected in State) then Exit; 1656 1969 with Sender as TStringGrid do 1657 1970 begin 1658 Canvas.Brush.Color := Color; 1659 Canvas.Font := Font; 1971 if State = [gdSelected..gdFocused] then 1972 begin 1973 Canvas.Font.Color := Get508CompliantColor(clWhite); 1974 Canvas.Brush.Color := clHighlight; 1975 //Canvas.Font.Color := clHighlightText; 1976 Canvas.Font.Style := [fsBold]; 1977 Canvas.MoveTo(Rect.Left,Rect.top); 1978 end 1979 else 1980 begin 1981 if (ACol = 4) and (ColWidths[4] > 0) then 1982 Canvas.Brush.Color := clInactiveBorder 1983 else Canvas.Brush.Color := clWindow; 1984 Canvas.Font := Font; 1985 end; 1986 Canvas.FillRect(Rect); 1987 //Canvas.Brush.Color := Color; 1988 1660 1989 Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, Cells[ACol, ARow]); 1661 1990 end; … … 1696 2025 tabFluidChange(tabFluid); 1697 2026 end; 2027 end; 2028 2029 procedure TfrmODMedIV.FormKeyPress(Sender: TObject; var Key: Char); 2030 begin 2031 if (Key = #13) and (ActiveControl = grdSelected) then 2032 Key := #0; //Don't let the base class turn it into a forward tab! 2033 inherited; 1698 2034 end; 1699 2035 … … 1781 2117 cboSchedule.ItemIndex := idx; 1782 2118 exit; 2119 end; 2120 //if PRN schedule than set the checkbox than exit 2121 if (X = ' PRN') or (X = 'PRN') then 2122 begin 2123 chkPRN.Checked := True; 2124 Exit; 1783 2125 end; 1784 2126 //Check to see if schedule is a Day-of-Week Schedule (MO-WE-FR@BID) … … 1805 2147 //tempSch := U + Piece(x, '@', 1) + '@' + Pieces(cboSchedule.Items.Strings[idx], U, 2, 5); 1806 2148 tempSch := Piece(x, '@', 1) + '@' + cboSchedule.Items.Strings[idx]; 1807 cboSchedule.Items.Add(tempSch);1808 2149 cboSchedule.Text := (Piece(tempSch,U,1)); 1809 2150 cboSchedule.ItemIndex := cboSchedule.Items.IndexOf(Piece(tempSch, U, 1)); … … 1886 2227 end; 1887 2228 2229 function TfrmODMedIV.UpdateAddFreq(OI: integer): string; 2230 begin 2231 if (self.cboType.ItemIndex = -1) or (MixedCase(self.cboType.Items.Strings[self.cboType.ItemIndex]) = 'Continuous') then 2232 Result := GetDefaultAddFreq(OI) 2233 else Result := ''; 2234 end; 2235 1888 2236 procedure TfrmODMedIV.UpdateDuration(SchType: string); 1889 2237 begin … … 1909 2257 i: integer; 1910 2258 OrderIds, TempIVRoute: TStringList; 1911 Default: boolean;2259 //Default: boolean; 1912 2260 begin 1913 2261 if self.grdSelected.RowCount > 0 then self.txtAllIVRoutes.Visible := True; … … 1928 2276 if OrderIds.Count > 0 then 1929 2277 begin 1930 if (self.FInitialOrderID = True) and (self.grdSelected.RowCount = 1) then Default := True 1931 else Default := False; 1932 LoadDosageFormIVRoutes(self.cboRoute.Items, OrderIds, Default); 1933 if default = True then 2278 //if (self.FInitialOrderID = True) and (self.grdSelected.RowCount = 1) then Default := True 2279 //else Default := False; 2280 LoadDosageFormIVRoutes(self.cboRoute.Items, OrderIds); 2281 //if default = True then 2282 // begin 2283 for I := 0 to cboRoute.items.Count - 1 do 1934 2284 begin 1935 for I := 0 to cboRoute.items.Count - 1 do 1936 if Piece(cboRoute.Items.Strings[i], U, 5) = 'D' then 1937 begin 1938 cboRoute.ItemIndex := i; 1939 break; 1940 end; 1941 self.FInitialOrderID := false; 2285 if Piece(cboRoute.Items.Strings[i], U, 5) = 'D' then 2286 begin 2287 cboRoute.ItemIndex := i; 2288 break; 2289 end; 1942 2290 end; 2291 // self.FInitialOrderID := false; 2292 //end; 1943 2293 OrderIds.Free; 1944 2294 end; … … 1954 2304 procedure TfrmODMedIV.txtAllIVRoutesClick(Sender: TObject); 1955 2305 var 1956 i: integer; 1957 begin 1958 inherited; 1959 if MessageDlg('You can also select "OTHER" from the Route list' 2306 i: integer; 2307 msg : String; 2308 begin 2309 inherited; 2310 msg := 'You can also select "OTHER" from the Route list' 1960 2311 + ' to select a Route from the Expanded Med Route List.' 1961 + #13#10 + 'Click OK to launch the Expanded Med Route List.' ,1962 mtInformation, [mbOK, mbCancel],0) = mrOKthen2312 + #13#10 + 'Click OK to launch the Expanded Med Route List.'; 2313 if ShowMsg(msg, smiInfo, smbOKCancel) = smrOk then 1963 2314 begin 1964 2315 for I := 0 to cboRoute.Items.Count - 1 do if cboRoute.Items.Strings[i] = U + 'OTHER' then break; … … 1971 2322 procedure TfrmODMedIV.txtNSSClick(Sender: TObject); 1972 2323 var 1973 i: integer; 1974 begin 1975 inherited; 1976 if MessageDlg('You can also select ' + '"' + 'Other' + '"' + ' from the schedule list' 2324 i: integer; 2325 msg : String; 2326 begin 2327 inherited; 2328 msg := 'You can also select ' + '"' + 'Other' + '"' + ' from the schedule list' 1977 2329 + ' to create a day-of-week schedule.' 1978 + #13#10 + 'Click OK to launch schedule builder' ,1979 mtInformation, [mbOK, mbCancel],0) =mrOK then2330 + #13#10 + 'Click OK to launch schedule builder'; 2331 if ShowMsg(msg, smiInfo, smbOKCancel) = smrOK then 1980 2332 begin 1981 2333 //cboSchedule.Items.Add(U + 'OTHER'); -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMedNVA.dfm
r829 r1693 3 3 Top = 183 4 4 Width = 632 5 Height = 5 365 Height = 542 6 6 Caption = 'Document Herbal/OTC/Non-VA Medications' 7 7 Constraints.MinHeight = 365 8 8 ExplicitWidth = 632 9 ExplicitHeight = 5 369 ExplicitHeight = 542 10 10 PixelsPerInch = 96 11 11 TextHeight = 13 12 12 inherited memOrder: TCaptionMemo 13 13 Left = 0 14 Top = 46 114 Top = 467 15 15 Width = 525 16 16 Anchors = [akLeft, akRight, akBottom] … … 18 18 TabOrder = 4 19 19 ExplicitLeft = 0 20 ExplicitTop = 46 120 ExplicitTop = 467 21 21 ExplicitWidth = 525 22 22 end … … 25 25 Top = 34 26 26 Width = 593 27 Height = 4 1527 Height = 421 28 28 Anchors = [akLeft, akTop, akRight, akBottom] 29 29 BevelOuter = bvNone … … 73 73 Top = 137 74 74 Width = 593 75 Height = 2 7875 Height = 284 76 76 Align = alClient 77 77 Columns = < … … 99 99 object txtMed: TEdit [2] 100 100 Left = 5 101 Top = 6101 Top = 12 102 102 Width = 596 103 103 Height = 21 … … 113 113 object pnlFields: TPanel [3] 114 114 Left = 3 115 Top = 30115 Top = 43 116 116 Width = 624 117 Height = 42 8117 Height = 423 118 118 Anchors = [akLeft, akTop, akRight, akBottom] 119 119 BevelOuter = bvNone … … 125 125 Top = 0 126 126 Width = 624 127 Height = 2 64127 Height = 259 128 128 Align = alClient 129 129 Constraints.MinHeight = 80 … … 132 132 DesignSize = ( 133 133 624 134 2 64)134 259) 135 135 object lblRoute: TLabel 136 136 Left = 349 … … 172 172 end 173 173 object tabDose: TTabControl 174 Left = -7174 Left = 1 175 175 Top = 19 176 176 Width = 175 … … 188 188 Top = 36 189 189 Width = 383 190 Height = 2 22190 Height = 217 191 191 Anchors = [akLeft, akTop, akRight, akBottom] 192 192 Style = orcsSimple … … 210 210 OnClick = cboDosageClick 211 211 OnExit = cboDosageExit 212 OnKeyUp = cboDosageKeyUp 212 213 CharsNeedMatch = 1 213 214 end … … 216 217 Top = 36 217 218 Width = 114 218 Height = 2 23219 Height = 218 219 220 Anchors = [akTop, akRight, akBottom] 220 221 Style = orcsSimple … … 238 239 OnChange = cboRouteChange 239 240 OnClick = ControlChange 240 On Exit = cboRouteExit241 OnKeyUp = cboRouteKeyUp 241 242 CharsNeedMatch = 1 242 243 end 243 244 object cboSchedule: TORComboBox 244 245 Left = 467 245 Top = 3 6246 Top = 37 246 247 Width = 157 247 Height = 2 23248 Height = 218 248 249 Anchors = [akTop, akRight, akBottom] 249 250 Style = orcsSimple … … 265 266 OnChange = cboScheduleChange 266 267 OnClick = cboScheduleClick 267 On Exit = cboScheduleExit268 OnKeyUp = cboScheduleKeyUp 268 269 CharsNeedMatch = 1 269 270 end … … 283 284 object pnlBottom: TPanel 284 285 Left = 0 285 Top = 2 64286 Top = 259 286 287 Width = 624 287 288 Height = 164 … … 388 389 object btnSelect: TButton [4] 389 390 Left = 539 390 Top = 46 3391 Top = 469 391 392 Width = 72 392 393 Height = 21 … … 400 401 inherited cmdAccept: TButton 401 402 Left = 540 402 Top = 46 3403 Top = 469 403 404 Width = 69 404 405 Anchors = [akRight, akBottom] … … 406 407 Visible = False 407 408 ExplicitLeft = 540 408 ExplicitTop = 46 3409 ExplicitTop = 469 409 410 ExplicitWidth = 69 410 411 end 411 412 inherited cmdQuit: TButton 412 413 Left = 546 413 Top = 4 89414 Top = 495 414 415 Width = 49 415 416 Anchors = [akRight, akBottom] 416 417 TabOrder = 7 417 418 ExplicitLeft = 546 418 ExplicitTop = 4 89419 ExplicitTop = 495 419 420 ExplicitWidth = 49 420 421 end … … 436 437 ( 437 438 'Component = txtMed' 438 'Status = stsDefault') 439 'Text = Medication' 440 'Status = stsOK') 439 441 ( 440 442 'Component = pnlFields' … … 484 486 ( 485 487 'Component = memOrder' 486 'Status = stsDefault') 488 'Text = Order Sig' 489 'Status = stsOK') 487 490 ( 488 491 'Component = cmdAccept' -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMedNVA.pas
r829 r1693 63 63 procedure lblGuidelineClick(Sender: TObject); 64 64 procedure ListViewClick(Sender: TObject); 65 procedure cboScheduleExit(Sender: TObject);66 65 procedure cboScheduleChange(Sender: TObject); 67 66 procedure cboRouteChange(Sender: TObject); … … 70 69 procedure cboDosageChange(Sender: TObject); 71 70 procedure cboScheduleClick(Sender: TObject); 72 procedure cboRouteExit(Sender: TObject);73 71 procedure DispOrderMessage(const AMessage: string); 74 72 … … 92 90 Change: TItemChange); 93 91 procedure FormKeyPress(Sender: TObject; var Key: Char); 92 procedure cboDosageKeyUp(Sender: TObject; var Key: Word; 93 Shift: TShiftState); 94 procedure cboRouteKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 95 procedure cboScheduleKeyUp(Sender: TObject; var Key: Word; 96 Shift: TShiftState); 94 97 95 98 private … … 380 383 FRemoveText := True; 381 384 FShrinkDrugMsg := False; 385 if ScreenReaderActive then lstQuick.TabStop := True; 382 386 end; 383 387 … … 813 817 chunk := GetCacheChunkIndex(Item.Index); 814 818 list := TStringList(FNVAMedCache[chunk]); 815 x := list[Item.Index mod MED_CACHE_CHUNK_SIZE]; 816 Item.Caption := Piece(x, U, 2); 817 Item.Data := Pointer(StrToIntDef(Piece(x, U, 1), 0)); 819 //This is to make sure that the index that is being used is not outside of the stringlist 820 If Item.Index mod MED_CACHE_CHUNK_SIZE < list.Count then begin 821 x := list[Item.Index mod MED_CACHE_CHUNK_SIZE]; 822 Item.Caption := Piece(x, U, 2); 823 Item.Data := Pointer(StrToIntDef(Piece(x, U, 1), 0)); 824 end; 818 825 end; 819 826 … … 1138 1145 btnSelect.Default := False; 1139 1146 cmdAccept.Visible := True; 1140 cmdAccept.Default := True;1147 cmdAccept.Default := False; 1141 1148 btnSelect.TabOrder := txtMed.TabOrder + 1; 1142 1149 cmdAccept.TabStop := True; … … 1391 1398 end; 1392 1399 1400 procedure TfrmODMedNVA.cboDosageKeyUp(Sender: TObject; var Key: Word; 1401 Shift: TShiftState); 1402 begin 1403 inherited; 1404 if (Key = VK_BACK) and (cboDosage.Text = '') then cboDosage.ItemIndex := -1; 1405 end; 1406 1393 1407 { cboRoute -------------------------------------- } 1394 1408 … … 1407 1421 end; 1408 1422 1409 procedure TfrmODMedNVA.cboRouteExit(Sender: TObject); 1410 begin 1411 inherited; 1423 1424 1425 procedure TfrmODMedNVA.cboRouteKeyUp(Sender: TObject; var Key: Word; 1426 Shift: TShiftState); 1427 begin 1428 inherited; 1429 if (Key = VK_BACK) and (cboRoute.Text = '') then cboRoute.ItemIndex := -1; 1412 1430 end; 1413 1431 … … 1426 1444 end; 1427 1445 1428 procedure TfrmODMedNVA.cboScheduleExit(Sender: TObject); 1429 begin 1446 1447 procedure TfrmODMedNVA.cboScheduleKeyUp(Sender: TObject; var Key: Word; 1448 Shift: TShiftState); 1449 begin 1450 inherited; 1451 if (Key = VK_BACK) and (cboSchedule.Text = '') then cboSchedule.ItemIndex := -1; 1430 1452 end; 1431 1453 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMeds.dfm
r829 r1693 3 3 Top = 183 4 4 Width = 584 5 Height = 572 6 HorzScrollBar.Range = 558 7 VertScrollBar.Range = 399 5 Height = 578 6 AutoScroll = True 8 7 Caption = 'Medication Order' 9 8 Constraints.MinHeight = 325 9 Constraints.MinWidth = 452 10 10 OnShow = FormShow 11 11 ExplicitWidth = 584 12 ExplicitHeight = 57 212 ExplicitHeight = 578 13 13 DesignSize = ( 14 14 576 15 54 5)15 544) 16 16 PixelsPerInch = 96 17 17 TextHeight = 13 … … 20 20 Top = 34 21 21 Width = 580 22 Height = 47 022 Height = 476 23 23 Anchors = [akLeft, akTop, akRight, akBottom] 24 24 BevelOuter = bvNone … … 68 68 Top = 137 69 69 Width = 580 70 Height = 33 370 Height = 339 71 71 Align = alClient 72 72 BevelInner = bvLowered … … 99 99 inherited memOrder: TCaptionMemo 100 100 Tag = 13 101 Top = 5 05101 Top = 511 102 102 Width = 502 103 TabStop = True104 103 Anchors = [akLeft, akRight, akBottom] 105 104 TabOrder = 4 106 ExplicitTop = 5 05105 ExplicitTop = 511 107 106 ExplicitWidth = 502 108 107 end 109 108 object txtMed: TEdit [2] 110 109 Left = 6 111 Top = 6110 Top = 12 112 111 Width = 580 113 112 Height = 21 … … 123 122 object btnSelect: TButton [3] 124 123 Left = 515 125 Top = 5 05124 Top = 511 126 125 Width = 72 127 126 Height = 21 … … 135 134 object pnlFields: TPanel [4] 136 135 Left = 6 137 Top = 34136 Top = 44 138 137 Width = 580 139 Height = 4 70138 Height = 465 140 139 Anchors = [akLeft, akTop, akRight, akBottom] 141 140 BevelOuter = bvNone … … 148 147 Top = 0 149 148 Width = 580 150 Height = 19 7149 Height = 192 151 150 Align = alClient 152 151 Constraints.MinHeight = 80 … … 154 153 DesignSize = ( 155 154 580 156 19 7)155 192) 157 156 object lblRoute: TLabel 158 157 Left = 280 … … 195 194 Top = 36 196 195 Width = 580 197 Height = 15 6196 Height = 151 198 197 Anchors = [akLeft, akTop, akRight, akBottom] 199 198 ColCount = 7 … … 259 258 Top = 36 260 259 Width = 279 261 Height = 15 5260 Height = 150 262 261 Anchors = [akLeft, akTop, akRight, akBottom] 263 262 Style = orcsSimple … … 289 288 Top = 36 290 289 Width = 113 291 Height = 15 6290 Height = 151 292 291 Anchors = [akTop, akRight, akBottom] 293 292 Style = orcsSimple … … 312 311 OnClick = ControlChange 313 312 OnExit = cboRouteExit 313 OnKeyUp = cboRouteKeyUp 314 314 CharsNeedMatch = 1 315 315 UniqueAutoComplete = True … … 319 319 Top = 36 320 320 Width = 178 321 Height = 15 6321 Height = 151 322 322 Anchors = [akTop, akRight, akBottom] 323 323 Style = orcsSimple … … 341 341 OnEnter = cboScheduleEnter 342 342 OnExit = cboScheduleExit 343 OnKeyUp = cboScheduleKeyUp 343 344 CharsNeedMatch = 1 344 345 UniqueAutoComplete = True … … 473 474 TabStop = True 474 475 OnClick = btnXDurationClick 476 OnEnter = pnlXDurationButtonEnter 475 477 object btnXDuration: TSpeedButton 476 478 Left = 0 … … 558 560 OnExit = cboXScheduleExit 559 561 OnKeyDown = memMessageKeyDown 562 OnKeyUp = cboXScheduleKeyUp 560 563 CharsNeedMatch = 1 561 564 UniqueAutoComplete = True … … 575 578 object pnlBottom: TPanel 576 579 Left = 0 577 Top = 19 7580 Top = 192 578 581 Width = 580 579 582 Height = 273 … … 600 603 end 601 604 object lblQuantity: TLabel 602 Left = 8 4605 Left = 81 603 606 Top = 65 604 607 Width = 39 … … 609 612 end 610 613 object lblRefills: TLabel 611 Left = 1 64614 Left = 140 612 615 Top = 65 613 616 Width = 28 … … 616 619 end 617 620 object lblPriority: TLabel 618 Left = 50 0621 Left = 503 619 622 Top = 61 620 623 Width = 31 … … 682 685 end 683 686 object txtQuantity: TCaptionEdit 684 Left = 8 3687 Left = 80 685 688 Top = 78 686 Width = 60689 Width = 40 687 690 Height = 21 688 691 AutoSize = False … … 694 697 end 695 698 object spnQuantity: TUpDown 696 Left = 1 43699 Left = 120 697 700 Top = 78 698 701 Width = 16 … … 703 706 end 704 707 object txtRefills: TCaptionEdit 705 Left = 1 64708 Left = 140 706 709 Top = 78 707 710 Width = 30 … … 715 718 end 716 719 object spnRefills: TUpDown 717 Left = 1 94720 Left = 170 718 721 Top = 78 719 722 Width = 15 … … 724 727 end 725 728 object grpPickup: TGroupBox 726 Left = 283729 Left = 188 727 730 Top = 66 728 731 Width = 172 729 732 Height = 36 730 Anchors = [akTop, akRight]731 733 Caption = 'Pick Up' 732 734 TabOrder = 7 … … 760 762 end 761 763 object cboPriority: TORComboBox 762 Left = 499764 Left = 502 763 765 Top = 76 764 766 Width = 72 … … 782 784 TabOrder = 9 783 785 OnChange = ControlChange 786 OnKeyUp = cboPriorityKeyUp 784 787 CharsNeedMatch = 1 785 788 end … … 885 888 OnExit = cboXSequenceExit 886 889 OnKeyDown = memMessageKeyDown 890 OnKeyUp = cboXSequenceKeyUp 887 891 CharsNeedMatch = 1 888 892 end … … 890 894 inherited cmdAccept: TButton 891 895 Left = 514 892 Top = 5 05896 Top = 511 893 897 Anchors = [akRight, akBottom] 894 898 TabOrder = 6 … … 896 900 Visible = False 897 901 ExplicitLeft = 514 898 ExplicitTop = 5 05902 ExplicitTop = 511 899 903 end 900 904 inherited cmdQuit: TButton 901 905 Left = 514 902 Top = 53 0906 Top = 536 903 907 Width = 51 904 908 Anchors = [akRight, akBottom] 905 909 TabOrder = 7 906 910 ExplicitLeft = 514 907 ExplicitTop = 53 0911 ExplicitTop = 536 908 912 ExplicitWidth = 51 909 913 end … … 1064 1068 ( 1065 1069 'Component = memOrder' 1066 'Status = stsDefault') 1070 'Text = Order Sig' 1071 'Status = stsOK') 1067 1072 ( 1068 1073 'Component = cmdAccept' … … 1085 1090 ( 1086 1091 'Component = lblAdminSch' 1087 'Status = stsDefault') 1092 'Text = Admin Schedule.' 1093 'Status = stsOK') 1088 1094 ( 1089 1095 'Component = lblAdminTime' -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMeds.pas
r829 r1693 189 189 procedure cboXSequenceEnter(Sender: TObject); 190 190 procedure txtRefillsChange(Sender: TObject); 191 procedure QuantityMessageCheck(Tag: integer) ; 192 procedure pnlXDurationButtonEnter(Sender: TObject); 193 procedure cboRouteKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 194 procedure cboScheduleKeyUp(Sender: TObject; var Key: Word; 195 Shift: TShiftState); 196 procedure cboXScheduleKeyUp(Sender: TObject; var Key: Word; 197 Shift: TShiftState); 198 procedure cboXSequenceKeyUp(Sender: TObject; var Key: Word; 199 Shift: TShiftState); 200 procedure cboPriorityKeyUp(Sender: TObject; var Key: Word; 201 Shift: TShiftState); 191 202 //procedure btnNSSClick(Sender: TObject); 192 203 private … … 289 300 procedure UpdateDefaultSupply(const CurUnits, CurSchedule, CurDuration, CurDispDrug: string; 290 301 var CurSupply: Integer; var CurQuantity: double; var SkipQtyCheck: Boolean); 291 procedure UpdateSupplyQuantity(const CurUnits, CurSchedule, CurDuration, CurDispDrug : string;302 procedure UpdateSupplyQuantity(const CurUnits, CurSchedule, CurDuration, CurDispDrug, CurInstruct: string; 292 303 var CurSupply: Integer; var CurQuantity: double); 293 304 procedure UpdateDurationControls( FreeText: boolean); … … 397 408 FLD_COMMENT = 80; 398 409 FLD_PTINSTR = 85; 410 FLD_DRUG_ID_INT = 90; 399 411 {dosage type tab index values} 400 412 TI_DOSE = 0; … … 542 554 end; 543 555 if self.EvtID > 0 then FAdminTimeText := 'To Be Determined'; 556 if (isIMO = True) then self.Caption := 'Clinic Orders Medications' 557 else if FInptDlg = True then self.Caption := 'Inpatient Medications' 558 else if DlgFormID = OD_MEDOUTPT then self.Caption := 'Outpatient Medications' 559 else self.Caption := 'Medications Orders'; 544 560 ListForOrderable(FCacheIEN, ListCount, x); 545 561 lstAll.Items.Count := ListCount; … … 614 630 procedure TfrmODMeds.SetupDialog(OrderAction: Integer; const ID: string); 615 631 var 616 AnInstr, OrderID, nsSch, Text, tempOrder, tempSchString, tempSchType, AdminTime : string;617 i x: integer;632 AnInstr, OrderID, nsSch, Text, tempOrder, tempSchString, tempSchType, AdminTime, x: string; 633 i, ix: integer; 618 634 LocChange: boolean; 619 635 AResponse: TResponse; … … 631 647 //AGP 27.72 Order Action behave similar to QO this is why Edit and Copy are setting FIsQuickOrder to true 632 648 //this is not the best approach but this should fix the problem with order edit losing the quantity value. 633 if ( OrderAction = ORDER_QUICK) or (OrderAction = ORDER_EDIT) or (OrderAction = ORDER_COPY) then649 if ((OrderAction = ORDER_QUICK) or (OrderAction = ORDER_EDIT) or (OrderAction = ORDER_COPY)) then 634 650 begin 635 651 FIsQuickOrder := True; … … 647 663 Changing := True; 648 664 txtMed.Tag := StrToIntDef(Responses.IValueFor('ORDERABLE', 1), 0); 665 if OrderAction = ORDER_QUICK then 666 begin 667 if DEACheckFailed(txtMed.Tag, FInptDlg) then 668 begin 669 //btnSelect.Visible := False; 670 btnSelect.Enabled := False; 671 InfoBox(TX_NO_DEA, TC_NO_DEA, MB_OK); 672 AbortOrder := True; 673 Exit; 674 end; 675 end; 649 676 if (OrderAction = ORDER_QUICK) and (uOrders.PassDrugTstCall = False) and 650 677 (uOrders.OutptDisp = OutptDisp) and (PassDrugTest(txtMed.Tag, 'Q', false) = False) then Exit; … … 672 699 if length(nsSch) > 0 then 673 700 begin 674 SetSchedule( nsSch);701 SetSchedule(UpperCase(nsSch)); 675 702 {cboSchedule.SelectByID(nsSch); 676 703 if cboSchedule.ItemIndex < 0 then … … 694 721 AResponse := Responses.FindResponseByName('ADMIN', 1); 695 722 if AResponse <> nil then AdminTime := AResponse.EValue; 696 if self.cboSchedule.ItemIndex > -1then723 if (self.cboSchedule.ItemIndex > -1) and (AdminTime <> '') then 697 724 begin 698 725 tempSchString := self.cboSchedule.Items.Strings[cboSchedule.itemindex]; … … 700 727 self.cboSchedule.Items.strings[cboSchedule.ItemIndex] := tempSchString; 701 728 end; 702 if self.tabDose.TabIndex = TI_COMPLEXthen729 if (self.tabDose.TabIndex = TI_COMPLEX) and (Responses.InstanceCount('INSTR') = 1) and (AdminTime <> '') then 703 730 begin 704 731 if self.cboXSchedule.ItemIndex > -1 then … … 722 749 end; 723 750 end; 724 if self.tabDose.TabIndex = TI_COMPLEXthen751 if (self.tabDose.TabIndex = TI_COMPLEX) and (Responses.InstanceCount('INSTR') = 1) then 725 752 begin 726 753 if self.cboXSchedule.ItemIndex > -1 then … … 742 769 end; 743 770 if ((OrderAction <> Order_COPY) and (OrderAction <> Order_EDIT)) or 744 (XfInToOutNow = true) or (FIsQuickOrder) then UpdateRelated(FALSE); //AGP Change 771 (XfInToOutNow = true) or (FIsQuickOrder) then 772 begin 773 UpdateRelated(FALSE); //AGP Change 774 //Need to do the following code to reset the FLastUnits and FLastSchedule in case a free text Dose is found. If the following 775 //code is not done than the quantity will reset to zero 776 if not FInptDlg then 777 begin 778 FLastUnits := ''; 779 FLastSchedule := ''; 780 FLastInstruct := ''; 781 //Lasti := Responses.InstanceCount('INSTR'); 782 //Lasti := Responses.NextInstance('DOSE', 0); 783 for I := 1 to Responses.InstanceCount('INSTR') do 784 begin 785 x := ValueOfResponse(FLD_DOSEUNIT, i); 786 FLastUnits := FLastUnits + x + U; 787 x := Responses.IValueFor('INSTR', i); 788 FLastInstruct := FLastInstruct + x + U; 789 x := ValueOfResponse(FLD_SCHEDULE, i); 790 FLastSchedule := FLastSchedule + x + U; 791 end; 792 end; 793 end; 745 794 Changing := False; 746 795 if ((OrderAction = Order_Copy) or (OrderAction = Order_Edit)) and … … 762 811 memComment.Clear; // sometimes the sig is in the comment 763 812 end; 813 FQOInitial := False; 764 814 ControlChange(Self); 765 815 if Self.IsSupply then … … 818 868 ADrug := ValueOfResponse(FLD_DRUG_ID, AnInstance); 819 869 tmpX := x; //Changed for CQ: 7370 - it was tmpX := Trim(x); 870 if Pos(CRLF, tmpX)> 0 then 871 begin 872 SetError('Schedule cannot contains control characters'); 873 Exit; 874 end; 820 875 if (Length(tmpX) = 0) and (not FInptDlg) then SetError(TX_NO_SCHED) 821 876 else if (Length(tmpX) = 0) and FInptDlg and ScheduleRequired(txtMed.Tag, ARoute, ADrug) … … 824 879 begin 825 880 if FInptDlg then ValidLevel := ValidSchedule(tmpX) else ValidLevel := ValidSchedule(tmpX, 'O'); 881 (* if FInptDlg and (tmpX <> '') and (cboSchedule.ItemIndex = -1) and 882 (self.tabDose.TabIndex = TI_DOSE) then 883 //SetError('Unique Schedule Selection Required'); 884 SetError('More than one schedule starts with "'+tmpX+'". Please select a schedule from the list.'); *) 826 885 if ValidLevel = SCH_NO_RTN then 827 886 begin … … 857 916 if Length(Responses.IValueFor('INSTR', i)) > 60 then 858 917 begin 859 SetError(TX_DOSE_LEN); 860 cboDosage.SetFocus; //CQ: 7467 918 if self.tabDose.TabIndex = TI_COMPLEX then 919 begin 920 SetError('Dosage: ' + Responses.IValueFor('INSTR', i) + CRLF + TX_DOSE_LEN); 921 end 922 else 923 begin 924 SetError(TX_DOSE_LEN); 925 cboDosage.SetFocus; //CQ: 7467 926 end; 861 927 end; 862 928 end; … … 889 955 Exit; 890 956 end; 957 if Uppercase(ValFor(Col_Sequence, i)) = 'THEN' then 958 begin 959 if ValFor(Col_Duration,i) = '' then 960 begin 961 SetError('A duration is required when using "Then" as a sequence.'); 962 Exit; 963 end; 964 end; 891 965 end; 892 966 end; … … 1318 1392 chunk := GetCacheChunkIndex(Item.Index); 1319 1393 list := TStringList(FMedCache[chunk]); 1320 x := list[Item.Index mod MED_CACHE_CHUNK_SIZE]; 1321 Item.Caption := Piece(x, U, 2); 1322 Item.Data := Pointer(StrToIntDef(Piece(x, U, 1), 0)); 1394 //This is to make sure that the index that is being used is not outside of the stringlist 1395 If Item.Index mod MED_CACHE_CHUNK_SIZE < list.Count then begin 1396 x := list[Item.Index mod MED_CACHE_CHUNK_SIZE]; 1397 Item.Caption := Piece(x, U, 2); 1398 Item.Data := Pointer(StrToIntDef(Piece(x, U, 1), 0)); 1399 end; 1323 1400 end; 1324 1401 … … 1415 1492 end; *) 1416 1493 FAltChecked := True; 1417 ;1418 1494 SetOnMedSelect; // set up for this medication 1419 1495 SetOnQuickOrder; // insert quick order responses … … 1424 1500 if (txtQuantity.Text = '0') and (Length(QOQuantityStr)>0) then 1425 1501 txtQuantity.Text := QOQuantityStr; 1502 //FQOInitial := False; 1426 1503 end 1427 1504 else if (FActiveMedList = lstAll) and (lstAll.Selected <> nil) then // orderable item … … 1453 1530 begin 1454 1531 temp := self.MedName; 1455 CheckFormularyOI( MedIEN, temp, FInptDlg);1532 CheckFormularyOI(medIEN, temp, FInptDlg); 1456 1533 FAltChecked := True; 1534 txtMed.Text := ''; 1457 1535 end; 1458 1536 if MedIEN <> txtMed.Tag then … … 1481 1559 else ShowMedSelect; // show the selection fields 1482 1560 FNoZERO := False; 1561 if FQOInitial = True then FQOInitial := False; 1562 1483 1563 end; 1484 1564 … … 1585 1665 // set up lists & initial values based on orderable item 1586 1666 SetControl(txtMed, 'Medication'); 1587 if (self.MedName <> '') then1667 if (self.MedName <> '') then 1588 1668 begin 1589 1669 if (txtMed.Text <> self.MedName) then … … 1603 1683 AResponse := Responses.FindResponseByName('SCHEDULE',1); 1604 1684 if (AResponse <> nil) and (AResponse.EValue <> '') then x := AResponse.EValue; 1605 SetSchedule( x);1685 SetSchedule(UpperCase(x)); 1606 1686 (* if x <> '' then 1607 1687 begin … … 1716 1796 var 1717 1797 AResponse: TResponse; 1718 x,LocRoute,TempSch,DispGrp : string;1798 x,LocRoute,TempSch,DispGrp, SchType: string; 1719 1799 i, DispDrug: Integer; 1720 1800 begin … … 1730 1810 SetDosage(IValueFor('INSTR', i)); 1731 1811 with cboDosage do 1732 if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] 1812 //agp change QO code to populate the Grid with the same fields after selection CQ 15933 1813 //if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] 1814 if ItemIndex > -1 then x := Piece(Text, TAB, 1) + TAB + Items[ItemIndex] 1733 1815 else x := IValueFor('INSTR',i); //AGP Change 26.41 for CQ 9102 PSI-05-015 affect copy and edit functionality 1734 1816 grdDoses.Cells[COL_DOSAGE, i] := x; … … 1737 1819 if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] else x := Text; 1738 1820 grdDoses.Cells[COL_ROUTE, i] := x; 1739 if FIsQuickOrder then TempSch := cboSchedule.Text; 1740 SetSchedule(IValueFor('SCHEDULE', i)); 1741 if (cboSchedule.Text = '') and (FIsQuickOrder) and (NSSchedule = False) then 1742 begin 1743 cboSchedule.SelectByID(TempSch); 1744 cboSchedule.Text := TempSch; 1745 end; 1821 SetSchedule(UpperCase(IValueFor('SCHEDULE', i))); 1746 1822 if (cboSchedule.Text = '') and (FIsQuickOrder) and (NSSchedule = True) then cboSchedule.ItemIndex := -1; 1747 1823 x := cboSchedule.Text; … … 1755 1831 begin 1756 1832 if IValueFor('ADMIN', i) <> '' then grdDoses.Cells[COL_ADMINTIME, i] := IValueFor('ADMIN', i) 1757 else if cboSchedule.ItemIndex > -1then1833 else if (cboSchedule.ItemIndex > -1) and (chkPRN.Checked = false) then 1758 1834 grdDoses.Cells[COL_ADMINTIME, i] := Piece(cboSchedule.Items.Strings[cboSchedule.itemIndex],U,4) 1759 1835 else grdDoses.Cells[COL_ADMINTIME, i] := ''; 1760 1836 if grdDoses.Cells[COL_ADMINTIME, i] = '' then grdDoses.Cells[COL_ADMINTIME, i] := 'Not Defined'; 1761 1837 if FAdminTimeText <> '' then grdDoses.Cells[COL_ADMINTIME, i] := FAdminTimeText; 1838 //done to prevent admin time showing up in schedules that should not have admin times. Also remove Not Defined for schedule 1839 //should not show the admin time 1840 if (cboSchedule.ItemIndex > -1) or (chkPRN.Checked = True) then 1841 begin 1842 SchType := ''; 1843 if (cboSchedule.ItemIndex > -1) then SchType := Piece(cboSchedule.Items.Strings[cboSchedule.itemIndex],U,3); 1844 if (SchType = 'P') or (SchType = 'O') or (SchType = 'OC') or (ChkPRN.Checked = True) then 1845 grdDoses.Cells[COL_ADMINTIME, i] := ''; 1846 end; 1762 1847 end; 1848 chkPRN.Checked := false; 1763 1849 if IValueFor('CONJ', i) = 'A' then x := 'AND' 1764 1850 else if IValueFor('CONJ', i) = 'T' then x := 'THEN' … … 1779 1865 SetDosage(IValueFor('INSTR', 1)); 1780 1866 SetControl(cboRoute, 'ROUTE', 1); 1781 SetSchedule( IValueFor('SCHEDULE', 1));1867 SetSchedule(UpperCase(IValueFor('SCHEDULE', 1))); 1782 1868 if (cboSchedule.Text = '') and (FIsQuickOrder) and (NSSchedule = False) then 1783 1869 begin … … 1845 1931 end; {if FInptDlg..else} 1846 1932 end; {with} 1847 if FInptDlgthen1933 if (FInptDlg) then 1848 1934 begin 1849 1935 x := ValueOfResponse(FLD_SCHEDULE, 1); … … 1901 1987 btnSelect.Default := False; 1902 1988 cmdAccept.Visible := True; 1903 cmdAccept.Default := True;1989 cmdAccept.Default := False; 1904 1990 cmdAccept.Left := cmdQuit.Left; 1905 1991 cmdAccept.Top := MemOrder.Top; … … 1996 2082 begin 1997 2083 tabDose.TabIndex := TI_COMPLEX; 2084 lblAdminSchSetTexT(''); 1998 2085 MoveCombo(cboDosage, cboXDosage); 1999 2086 MoveCombo(cboRoute, cboXRoute); … … 2079 2166 end; 2080 2167 cboSchedule.ItemIndex := -1; 2168 cboSchedule.Text := ''; 2081 2169 if chkPRN.Checked = True then chkPRN.Checked := False; 2082 2170 cboSchedule.SelectByID(x); 2083 2171 if cboSchedule.ItemIndex > -1 then exit; 2172 if (X = ' PRN') or (X = 'PRN') then 2173 begin 2174 chkPRN.Checked := True; 2175 Exit; 2176 end; 2084 2177 // if cboSchedule.ItemIndex < 0 then 2085 2178 //begin … … 2433 2526 end; 2434 2527 2528 procedure TfrmODMeds.cboRouteKeyUp(Sender: TObject; var Key: Word; 2529 Shift: TShiftState); 2530 begin 2531 inherited; 2532 if (Key = VK_BACK) and (cboRoute.Text = '') then cboRoute.ItemIndex := -1; 2533 end; 2534 2435 2535 { cboSchedule ----------------------------------- } 2436 2536 … … 2472 2572 if length(trim(othSch)) > 1 then 2473 2573 begin 2574 othSch := othSch + U + U + NSSScheduleType + U + NSSAdminTime; 2474 2575 cboSchedule.Items.Add(othSch); 2475 idx := cboSchedule.Items.IndexOf( OthSch);2576 idx := cboSchedule.Items.IndexOf(Piece(OthSch, U, 1)); 2476 2577 cboSchedule.ItemIndex := idx; 2477 2578 end; … … 2526 2627 txtXDurationChange(Sender); 2527 2628 ControlChange(Sender); 2629 end; 2630 2631 procedure TfrmODMeds.QuantityMessageCheck(tag: integer); 2632 var 2633 DispDrug: integer; 2634 x: string; 2635 2636 begin 2637 if FInptDlg then Exit; 2638 DispDrug := StrToIntDef(ValueOf(FLD_DRUG_ID, tag), 0); 2639 if DispDrug > 0 then 2640 begin 2641 if not FSuppressMsg then 2642 begin 2643 DispOrderMessage(DispenseMessage(DispDrug)); 2644 FSuppressMsg := False; 2645 end; 2646 x := QuantityMessage(DispDrug); 2647 end 2648 else x := ''; 2649 if Length(x) > 0 2650 then lblQtyMsg.Caption := TX_QTY_PRE + x + TX_QTY_POST 2651 else lblQtyMsg.Caption := ''; 2528 2652 end; 2529 2653 … … 2742 2866 for i := 0 to Pred(FAllDoses.Count) do 2743 2867 begin 2744 if AnsiSameText(DoseDrug, Copy(FAllDoses[i], 1, Length(DoseDrug))) then 2868 // CQ #16957 - Corrected code that would potentially mis-match drugs - JCS 2869 //if AnsiSameText(DoseDrug, Copy(FAllDoses[i], 1, Length(DoseDrug))) then 2870 if AnsiSameText(DoseDrug, Pieces(FAllDoses[i],U,1,2)) then 2745 2871 begin 2746 2872 Result := Piece(FAllDoses[i], U, 3); … … 3142 3268 if Piece(x, ' ', 2) = 'MONTHS' then DoseMinutes := ExtractInteger(x) * 43200; 3143 3269 if Piece(x, ' ', 2) = 'WEEKS' then DoseMinutes := ExtractInteger(x) * 10080; 3144 if P iece(x, ' ', 2) = 'DAYS'then DoseMinutes := ExtractInteger(x) * 1440;3270 if Pos('DAY',Piece(x, ' ', 2))>0 then DoseMinutes := ExtractInteger(x) * 1440; 3145 3271 if Piece(x, ' ', 2) = 'HOURS' then DoseMinutes := ExtractInteger(x) * 60; 3146 3272 if Piece(x, ' ', 2) = 'MINUTES' then DoseMinutes := ExtractInteger(x); … … 3182 3308 with grdDoses do 3183 3309 begin 3184 i := grdDoses.Width - 12; // 12 = 4pixel margin + 8 pixel column 03310 i := grdDoses.Width - 20; // 20 = 12 pixel margin + 8 pixel column 0 3185 3311 i := i - GetSystemMetrics(SM_CXVSCROLL); // compensate for appearance of scroll bar 3186 3312 if (not FinptDlg) or (FAdminTimeText = 'Not defined for Clinic Locations') then … … 3464 3590 DisableDefaultButton(self); 3465 3591 DisableCancelButton(self); 3592 QuantityMessageCheck(cboXDosage.Tag); 3466 3593 end; 3467 3594 … … 3730 3857 str := str + CRLF + CRLF + AdminTimeHelpText; 3731 3858 infoBox(str,'Administration Time Information',MB_OK); 3859 end; 3860 3861 procedure TfrmODMeds.pnlXDurationButtonEnter(Sender: TObject); 3862 begin 3863 inherited; 3864 QuantityMessageCheck(self.grdDoses.Row); 3732 3865 end; 3733 3866 … … 4074 4207 FLD_QUANTITY : 4075 4208 begin 4076 if Pos(',', txtQuantity.Text)>0 then 4209 if Pos(',', txtQuantity.Text)>0 then 4077 4210 Result := Piece(txtQuantity.Text,',',1) + Piece(txtQuantity.Text,',',2) 4078 4211 else … … 4129 4262 begin 4130 4263 Checked := false; 4131 4264 if ((StrToFloatDef(txtQuantity.Text, 0) = 0) and (StrToIntDef(txtSupply.Text, 0) = 0) and 4132 4265 (txtQuantity.Tag = 0) and (txtSupply.Tag = 0) and (cboDosage.Text <> '')) 4133 4266 or ((cboDosage.ItemIndex < 0) and (not FIsQuickOrder)) or … … 4137 4270 ADrug := Piece(CurDispDrug, U, 1); 4138 4271 CurSupply := DefaultDays(ADrug, CurUnits, CurSchedule); 4139 if CurSupply > 0 then 4272 if CurSupply > 0 then 4140 4273 begin 4141 4274 spnSupply.Position := CurSupply; … … 4160 4293 SkipQtyCheck := TRUE; 4161 4294 end; 4162 if FQOInitial = true then FQOInitial := False;4295 //if FQOInitial = true then FQOInitial := False; 4163 4296 end; 4164 4297 if (IsClozapineOrder = true) and (CurDispDrug <> '') and (CurDispDrug <> U)and (Checked = false) then … … 4185 4318 end; 4186 4319 4187 procedure TfrmODMeds.UpdateSupplyQuantity(const CurUnits, CurSchedule, CurDuration, CurDispDrug: string; 4320 //add CURInstrcut to this procedure. This address a problem with an user starting with a free-text dosage and changing 4321 //to another free-text dose and the quantity value not updating. 4322 procedure TfrmODMeds.UpdateSupplyQuantity(const CurUnits, CurSchedule, CurDuration, CurDispDrug, CurInstruct: string; 4188 4323 var CurSupply: Integer; var CurQuantity: double); 4189 4324 const … … 4197 4332 ADrug: string; 4198 4333 SaveChanging: Boolean; 4199 tmpQuty: Double; 4200 begin 4201 tmpQuty := 0; 4334 tmpQuantity: double; 4335 begin 4202 4336 if (tabDose.TabIndex = TI_COMPLEX) and (txtSupply.Tag = 0) and (txtQuantity.Tag = 0) then 4203 4337 begin … … 4220 4354 (CurDuration = FLastDuration) and 4221 4355 (CurQuantity = FLastQuantity) and 4222 (CurSupply = FLastSupply) then Exit; 4356 (CurSupply = FLastSupply) and 4357 (CurInstruct = FLastInstruct) then Exit; 4223 4358 // exit if supply & quantity have both been directly edited 4224 4359 if (txtSupply.Tag > 0) and (txtQuantity.Tag > 0) then Exit; … … 4229 4364 else if (CurSupply <> FLastSupply) and (txtQuantity.Tag = 0) then UpdateControl := UPD_QUANTITY 4230 4365 else if (CurQuantity <> FLastQuantity) and (txtSupply.Tag = 0) then UpdateControl := UPD_SUPPLY; 4231 if (UpdateControl = UPD_NONE) and (( CurUnits <> FLastUnits) or (CurSchedule <> FLastSchedule)) then4366 if (UpdateControl = UPD_NONE) and (((CurUnits <> FLastUnits) or (CurInstruct <> FLastInstruct)) or (CurSchedule <> FLastSchedule)) then 4232 4367 begin 4233 4368 if txtQuantity.Tag = 0 then UpdateControl := UPD_QUANTITY … … 4239 4374 if FIsQuickOrder and (CurQuantity > 0) and FQOInitial then 4240 4375 begin 4241 FQOInitial := False;4376 txtQuantity.Text := FloatToStr(CurQuantity); 4242 4377 Exit; 4243 4378 end; 4244 if FIsQuickOrder and (CurQuantity > 0) then4245 tmpQuty := CurQuantity;4246 4379 CurQuantity := DaysToQty(CurSupply, CurUnits, CurSchedule, CurDuration, ADrug); 4247 if (tmpQuty > 0) and (CurQuantity <= 0) then 4248 begin 4249 txtQuantity.Text := FloatToStr(tmpQuty); 4250 CurQuantity := tmpQuty; 4251 end else if (CurQuantity >= 0) then 4380 if (CurQuantity >= 0) then 4252 4381 txtQuantity.Text := FloatToStr(CurQuantity); 4253 4382 end; … … 4258 4387 UPD_BOTH : begin 4259 4388 txtSupply.Text := IntToStr(CurSupply); 4260 tmpQuty := 0; 4389 spnSupply.Position := StrToIntDef(txtSupply.Text, 0); 4390 tmpQuantity := DaysToQty(CurSupply, CurUnits, CurSchedule, CurDuration, ADrug); 4261 4391 if FIsQuickOrder and (CurQuantity > 0) and FQOInitial then 4392 begin 4393 txtQuantity.Text := FloatToStr(CurQuantity); 4394 Exit; 4395 end; 4396 (* if FIsQuickOrder and (CurQuantity > 0) and (tmpQuantity = 0) and FQOInitial then 4262 4397 begin 4263 FQOInitial := False;4398 txtQuantity.Text := FloatToStr(CurQuantity); 4264 4399 Exit; 4265 end; 4266 if FIsQuickOrder and (CurQuantity > 0) then 4267 tmpQuty := CurQuantity; 4268 CurQuantity := DaysToQty(CurSupply, CurUnits, CurSchedule, CurDuration, ADrug); 4269 if (tmpQuty > 0) and (CurQuantity <= 0) then 4270 begin 4271 txtQuantity.Text := FloatToStr(tmpQuty); 4272 CurQuantity := tmpQuty; 4273 end else if CurQuantity >= 0 then 4400 end; *) 4401 //CurQuantity := DaysToQty(CurSupply, CurUnits, CurSchedule, CurDuration, ADrug); 4402 CurQuantity := tmpQuantity; 4403 if CurQuantity >= 0 then 4274 4404 txtQuantity.Text := FloatToStr(CurQuantity); 4275 4405 end; … … 4579 4709 lblAdminTime.Caption := ''; 4580 4710 end; 4581 if (self.tabDose.TabIndex = TI_DOSE) and (CurSchedule <> FLastSchedule) then UpdateStartExpires(CurSchedule); 4582 //AGP remove this code for CQ 11772 4583 (*if (ValueOf(FLD_SCHED_TYP) = 'O') 4584 or (Responses.EventType in ['A','D','T','M','O']) 4585 or ((Length(cboSchedule.Text)>0) and (cboSchedule.ItemIndex < 0)) then 4586 begin 4587 if (chkDoseNow.Checked) and (chkDoseNow.Visible) then 4588 begin 4589 chkDoseNowClick(Self); 4590 chkDoseNow.Checked := False; 4591 end; 4592 chkDoseNow.Visible := False; 4593 lblAdminTime.Visible := False; 4594 end 4595 else 4596 begin 4597 chkDoseNow.Visible := TRUE; 4598 lblAdminTime.Visible := not chkDoseNow.Checked; 4599 end; *) 4711 if (self.tabDose.TabIndex = TI_DOSE) and (CurSchedule <> FLastSchedule) then 4712 UpdateStartExpires(CurSchedule); 4600 4713 if Responses.EventType in ['A','D','T','M','O'] then lblAdminTime.Visible := False; 4601 4714 end; 4602 4715 if not FInptDlg then 4603 4716 begin 4604 4717 CurSchedule := CurScheduleOut; 4605 4718 if ((CurInstruct <> FLastInstruct) and (CurUnits <> U)) or ((IsClozapineOrder = true) and (CurDispDrug <> '') and (CurDispDrug <> U)) //AGP Change 26.48 Do not update quantity and day supply if no matching dose on the server 4719 //if ((CurInstruct <> FLastInstruct) and (CurUnits <> U)) 4606 4720 then UpdateDefaultSupply(CurUnits, CurSchedule, CurDuration, CurDispDrug, CurSupply, CurQuantity, 4607 4721 LackQtyInfo); … … 4611 4725 end 4612 4726 else 4613 UpdateSupplyQuantity(CurUnits, CurSchedule, CurDuration, CurDispDrug, Cur Supply, CurQuantity);4727 UpdateSupplyQuantity(CurUnits, CurSchedule, CurDuration, CurDispDrug, CurInstruct, CurSupply, CurQuantity); 4614 4728 // if (CurDispDrug <> FLastDispDrug) then UpdateSC(CurDispDrug); 4615 4729 if ((CurDispDrug <> FLastDispDrug) or (CurSupply <> FLastSupply)) and ((CurDispDrug <> '') and (CurSupply > 0)) then … … 4633 4747 if FUpdated then ControlChange(Self); 4634 4748 FScheduleChanged := false; 4749 //FQOInitial := False; 4635 4750 end; 4636 4751 … … 4644 4759 Exit; 4645 4760 end; 4761 if timCheckChanges.Enabled = True then sleep(1500); 4646 4762 //AGP Change for 26.45 PSI-04-069 4647 4763 if self.tabDose.TabIndex = 1 then … … 4690 4806 T = '"'; 4691 4807 T1 = 'By checking the "Give additional dose now" box, you have actually entered two orders for the same medication "'; 4692 T2 = #13#13'The first order''s administrative schedule is"';4693 T3 = #13'The second order''s administrative schedule is"';4808 T2 = #13#13'The "Give additional dose now" order has an administration schedule of "'; 4809 T3 = #13'The "Ongoing" order has an administration schedule of "'; 4694 4810 T4 = #13#13'Do you want to continue?'; 4811 T5 = '" and a priority of "'; 4695 4812 T1A = 'By checking the "Give additional dose now" box, you have actually entered a new order with the schedule "NOW"'; 4696 4813 T2A = ' in addition to the one you are placing for the same medication "'; … … 4698 4815 medNm: string; 4699 4816 theSch: string; 4817 ordPriority: string; 4700 4818 begin 4701 4819 inherited; … … 4704 4822 medNm := txtMed.Text; 4705 4823 theSch := cboSchedule.Text; 4824 ordPriority := cboPriority.SelText; 4706 4825 if length(theSch)>0 then 4707 4826 begin 4708 4827 //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 4709 if InfoBox(T1+medNm+T+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL then 4828 //if InfoBox(T1+medNm+T+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL then 4829 if InfoBox(T1+medNm+T+T2+'NOW'+T5+ordPriority+T+T3+theSch+T5+ordPriority+T+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL then 4710 4830 begin 4711 4831 chkDoseNow.Checked := False; … … 4832 4952 lblAdminTime.Caption := ''; 4833 4953 PrnPos := Pos('PRN',cboSchedule.Text); 4834 if (PrnPos < 1) then4954 if (PrnPos < 1) and (FQOInitial = false) then 4835 4955 UpdateStartExpires(cboSchedule.Text + ' PRN'); 4836 4956 end … … 4840 4960 begin 4841 4961 tempSch := ';'+Trim(cboSchedule.Text); 4842 UpdateStartExpires(tempSch);4962 if FQOInitial = false then UpdateStartExpires(tempSch); 4843 4963 end; 4844 4964 //lblAdminTime.Caption := FAdminTimeLbl; … … 4846 4966 cboScheduleClick(Self); 4847 4967 end; 4968 if FQOInitial = false then updateRelated(False); 4969 //updateRelated(False); 4848 4970 ControlChange(Self); 4849 4971 end; … … 4965 5087 procedure TfrmODMeds.FormKeyPress(Sender: TObject; var Key: Char); 4966 5088 begin 4967 (* if (Key = #13) and (ActiveControl = grdDoses{pnlXSequence}) then 4968 begin 4969 ShowEditor(grdDoses.Col, grdDoses.Row, #0); 4970 Key := #0; //Don't let the base class turn it into a forward tab! 4971 end *) 4972 //else 4973 if (Key = #13) and (ActiveControl = txtMed) then 4974 Key := #0; //Don't let the base class turn it into a forward tab! 5089 if (Key = #13) and (ActiveControl = txtMed) then 5090 Key := #0 //Don't let the base class turn it into a forward tab! 5091 else if (Key = #13) and (self.tabDose.TabIndex = TI_Complex) then 5092 Key := #0 5093 else 5094 inherited; 4975 5095 end; 4976 5096 … … 4993 5113 DisableDefaultButton(self); 4994 5114 DisableCancelButton(self); 5115 QuantityMessageCheck(self.grdDoses.Row); 4995 5116 end; 4996 5117 … … 5041 5162 tempAdmin := lblAdminSchGetText; 5042 5163 if tempAdmin <> '' then lblAdminSchSetText('Admin Time: ' + tempAdmin); 5164 if not (FInptDLG) then 5165 begin 5166 if self.cboPriority.Left < (self.grpPickup.Left + self.grpPickup.Width) then 5167 begin 5168 self.cboPriority.Left := self.grpPickup.Left + self.grpPickup.Width + 2; 5169 if self.Width < (self.cboPriority.Left + self.cboPriority.Width) then 5170 begin 5171 self.Width := self.cboPriority.Left + self.cboPriority.Width + 9; 5172 self.cboPriority.Left := self.pnlBottom.Width - self.cboPriority.Width - 2; 5173 end; 5174 self.lblPriority.Left := self.cboPriority.Left; 5175 end; 5176 end; 5043 5177 end; 5044 5178 … … 5134 5268 result := False; 5135 5269 IsInptDlg := False; 5136 Td := FMToday; 5270 // CQ #15188 - changed to use function to determine Td value - TDP 5271 //Td := FMToday; 5272 Td := IMOTimeFrame; 5137 5273 if DlgFormID = MedsInDlgFormId then IsInptDlg := TRUE; 5138 5274 IsIMOLocation := IsValidIMOLoc(Encounter.Location,Patient.DFN); 5275 5276 // CQ #15188 - allow IMO functionality 23 hours after encounter date/time - JCS 5277 // CQ #15188 - changed to use function to set Td. Reverted this line back to original - TDP 5278 {if (IsInptDlg) and (not Patient.Inpatient) and IsIMOLocation and 5279 (Encounter.DateTime > DateTimeToFMDateTime(FMDateTimeToDateTime(FMNow) - (23/24))) then} 5139 5280 if (IsInptDlg) and (not Patient.Inpatient) and IsIMOLocation and (Encounter.DateTime > Td) then 5140 5281 result := True; … … 5271 5412 cboSchedule.ItemIndex := -1; 5272 5413 ValidateInpatientSchedule(cboSchedule); 5414 updateRelated(False); 5415 end; 5416 5417 5418 procedure TfrmODMeds.cboScheduleKeyUp(Sender: TObject; var Key: Word; 5419 Shift: TShiftState); 5420 begin 5421 inherited; 5422 if (Key = VK_BACK) and (cboSchedule.Text = '') then cboSchedule.itemindex:= -1; 5273 5423 end; 5274 5424 … … 5285 5435 ScheduleCombo.Text := TrimLeft(UpperCase(ScheduleCombo.Text)); 5286 5436 {if user entered schedule verify it is in list} 5287 if ScheduleCombo.ItemIndex < 0 then // CQ: 73975437 if (ScheduleCombo.ItemIndex < 0) and (not FInptDlg) then // CQ: 7397 and CQ 17934 5288 5438 begin //Fix for CQ: 9299 - Outpatient Med orders will not accept free text schedule 5289 5439 tmpIndex := GetSchedListIndex(ScheduleCombo,ScheduleCombo.Text); … … 5298 5448 ' select ''OTHER'' from the list.', 5299 5449 'Incorrect Schedule.'); 5450 ScheduleCombo.ItemIndex := -1; 5451 ScheduleCombo.Text := ''; 5300 5452 FShowPnlXScheduleOk := True; //Added for CQ: 7370 5301 5453 if ScheduleCombo.CanFocus then 5302 5454 ScheduleCombo.SetFocus; 5303 ScheduleCombo.SelStart := Length(ScheduleCombo.Text);5455 //ScheduleCombo.SelStart := Length(ScheduleCombo.Text); 5304 5456 end; 5305 5457 end; … … 5369 5521 doesn't for simple orders } 5370 5522 ValidateInpatientSchedule(cboXSchedule); 5523 end; 5524 5525 5526 procedure TfrmODMeds.cboXScheduleKeyUp(Sender: TObject; var Key: Word; 5527 Shift: TShiftState); 5528 begin 5529 inherited; 5530 if (Key = VK_BACK) and (cboXSchedule.Text = '') then cboXSchedule.ItemIndex := -1; 5371 5531 end; 5372 5532 … … 5396 5556 DisableDefaultButton(self); 5397 5557 DisableCancelButton(self); 5558 QuantityMessageCheck(self.grdDoses.Row); 5398 5559 end; 5399 5560 … … 5427 5588 end; 5428 5589 5590 5591 procedure TfrmODMeds.cboXSequenceKeyUp(Sender: TObject; var Key: Word; 5592 Shift: TShiftState); 5593 begin 5594 inherited; 5595 if (Key = VK_BACK) and (cboXSequence.Text = '') then cboXSequence.ItemIndex := -1; 5596 end; 5597 5429 5598 procedure TfrmODMeds.cboXSequence1Exit(Sender: TObject); 5430 5599 begin … … 5437 5606 begin 5438 5607 inherited; 5608 if (Key = VK_BACK) and (cboDosage.Text = '') then cboDosage.ItemIndex := -1; 5439 5609 //Fix for CQ: 7545 5440 5610 if cboDosage.ItemIndex > -1 then … … 5444 5614 end; 5445 5615 5616 5617 procedure TfrmODMeds.cboPriorityKeyUp(Sender: TObject; var Key: Word; 5618 Shift: TShiftState); 5619 begin 5620 inherited; 5621 if (Key = VK_BACK) and (cboPriority.Text = '') then cboPriority.ItemIndex := -1; 5622 end; 5623 5446 5624 procedure TfrmODMeds.cboXDosageKeyUp(Sender: TObject; var Key: Word; 5447 5625 Shift: TShiftState); 5448 5626 begin 5449 5627 inherited; 5628 if (Key = VK_BACK) and (cboXDosage.Text = '') then cboXDosage.itemindex := -1; 5450 5629 //Fix for CQ: 7545 5451 5630 if cboXDosage.ItemIndex > -1 then … … 5506 5685 //agp Change CQ 10719 5507 5686 self.chkXPRN.OnClick(self.chkXPRN); 5687 QuantityMessageCheck(self.grdDoses.Row); 5508 5688 end; 5509 5689 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMisc.dfm
r829 r1693 34 34 end 35 35 inherited memOrder: TCaptionMemo 36 TabStop = False 37 TabOrder = 5 38 end 39 inherited cmdAccept: TButton 36 40 TabOrder = 6 37 41 end 38 inherited cmdAccept: TButton39 TabOrder = 440 end41 42 inherited cmdQuit: TButton 42 TabOrder = 543 TabOrder = 7 43 44 end 44 45 inherited pnlMessage: TPanel 45 TabOrder = 746 TabOrder = 1 46 47 end 47 48 object cboCare: TORComboBox [8] 48 Left = 649 Top = 2 049 Left = 8 50 Top = 25 50 51 Width = 292 51 52 Height = 21 52 53 Style = orcsDropDown 53 54 AutoSelect = True 55 Caption = 'Patient Care' 54 56 Color = clWindow 55 57 DropDownCount = 8 … … 75 77 Width = 140 76 78 Height = 21 77 TabOrder = 279 TabOrder = 3 78 80 Text = 'Now' 79 81 OnChange = ControlChange … … 87 89 Width = 140 88 90 Height = 21 89 TabOrder = 391 TabOrder = 4 90 92 OnChange = ControlChange 91 93 DateOnly = False … … 98 100 Width = 508 99 101 Height = 21 100 TabOrder = 1102 TabOrder = 2 101 103 OnChange = ControlChange 102 104 Caption = 'Instructions' -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODMisc.pas
r829 r1693 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 7 fODBase, StdCtrls, ORCtrls, ORDtTm, ComCtrls, ExtCtrls, ORFn, uConst, 8 VA508AccessibilityManager ;8 VA508AccessibilityManager, VA508AccessibilityRouter; 9 9 10 10 type … … 56 56 InitDialog; 57 57 StatusText(''); 58 if ScreenReaderSystemActive then memOrder.TabStop := true; 58 59 end; 59 60 … … 77 78 Changing := False; 78 79 ControlChange(Self); 79 SetFocusedControl(txtComment);80 if not ScreenReaderSystemActive then SetFocusedControl(txtComment); 80 81 end; 81 82 end; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODRad.dfm
r829 r1693 8 8 Constraints.MinHeight = 404 9 9 Constraints.MinWidth = 586 10 ExplicitLeft = 28211 ExplicitTop = 22512 10 ExplicitWidth = 586 13 11 ExplicitHeight = 404 … … 19 17 Width = 490 20 18 Anchors = [akLeft, akRight, akBottom] 21 TabOrder = 619 TabOrder = 4 22 20 ExplicitLeft = 0 23 21 ExplicitTop = 326 … … 32 30 ParentShowHint = False 33 31 ShowHint = True 34 TabOrder = 732 TabOrder = 3 35 33 Visible = False 36 34 ItemTipColor = clWindow … … 173 171 Height = 18 174 172 Caption = 'Remove' 175 TabOrder = 4173 TabOrder = 5 176 174 OnClick = cmdRemoveClick 177 175 end 178 176 end 179 inherited cmdAccept: TButton 180 Left = 497 181 Top = 326 182 Anchors = [akRight, akBottom] 183 TabOrder = 3 184 ExplicitLeft = 497 185 ExplicitTop = 326 186 end 187 object pnlRightBase: TORAutoPanel [4] 177 object pnlRightBase: TORAutoPanel [3] 188 178 Left = 215 189 179 Top = 0 … … 233 223 object lblSubmit: TLabel 234 224 Left = 154 235 Top = 4 2225 Top = 45 236 226 Width = 48 237 227 Height = 13 … … 264 254 Width = 96 265 255 Height = 21 266 TabOrder = 8256 TabOrder = 9 267 257 OnChange = calPreOpChange 268 258 OnExit = calPreOpExit … … 280 270 ParentShowHint = False 281 271 ShowHint = True 282 TabOrder = 6272 TabOrder = 7 283 273 OnClick = ControlChange 284 274 OnExit = chkIsolationExit … … 373 363 Height = 17 374 364 Caption = 'Pre-Op' 375 TabOrder = 9365 TabOrder = 13 376 366 Visible = False 377 367 OnClick = ControlChange … … 412 402 ParentShowHint = False 413 403 ShowHint = True 414 TabOrder = 5404 TabOrder = 6 415 405 Caption = 'Exams Over the Last 7 Days' 416 406 ItemTipColor = clWindow … … 424 414 Height = 41 425 415 Caption = 'Pregnant' 426 TabOrder = 7416 TabOrder = 8 427 417 object radPregnant: TRadioButton 428 418 Left = 2 … … 453 443 end 454 444 end 445 object Submitlbl508: TVA508StaticText 446 Name = 'Submitlbl508' 447 Left = 154 448 Top = 43 449 Width = 120 450 Height = 15 451 Alignment = taLeftJustify 452 Caption = 'Submit To (for screen R.)' 453 Enabled = False 454 TabOrder = 5 455 Visible = False 456 ShowAccelChar = True 457 end 455 458 end 456 459 object pnlHandR: TPanel … … 505 508 end 506 509 end 510 inherited cmdAccept: TButton 511 Left = 497 512 Top = 326 513 Anchors = [akRight, akBottom] 514 TabOrder = 5 515 ExplicitLeft = 497 516 ExplicitTop = 326 517 end 507 518 inherited cmdQuit: TButton 508 519 Left = 498 509 520 Top = 353 510 521 Anchors = [akRight, akBottom] 511 TabOrder = 4522 TabOrder = 6 512 523 ExplicitLeft = 498 513 524 ExplicitTop = 353 … … 519 530 Height = 55 520 531 TabOrder = 2 532 OnMouseUp = pnlMessageMouseUp 521 533 ExplicitLeft = 5 522 534 ExplicitTop = 318 … … 596 608 ( 597 609 'Component = grpPregnant' 598 'Status = stsDefault') 610 'Text = Pregnant group box. Disabled. Patient is male.' 611 'Status = stsOK') 599 612 ( 600 613 'Component = radPregnant' … … 614 627 ( 615 628 'Component = txtReason' 616 'Status = stsDefault') 629 630 'Text = Reason for Study REQUIRED text 64 characters maximum leng' + 631 'th' 632 'Status = stsOK') 617 633 ( 618 634 'Component = memOrder' … … 632 648 ( 633 649 'Component = frmODRad' 650 'Status = stsDefault') 651 ( 652 'Component = Submitlbl508' 634 653 'Status = stsDefault')) 635 654 end 655 object VA508ComponentAccessibility1: TVA508ComponentAccessibility 656 Component = memHistory 657 OnStateQuery = VA508ComponentAccessibility1StateQuery 658 Left = 336 659 Top = 64 660 end 661 object VA508ComponentAccessibility2: TVA508ComponentAccessibility 662 Component = grpPregnant 663 Left = 536 664 Top = 224 665 end 636 666 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODRad.pas
r829 r1693 6 6 SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, 7 7 Forms, Dialogs, StdCtrls, ORCtrls, fODBase, ORFn, ExtCtrls, 8 ComCtrls, uConst, ORDtTm, VA508AccessibilityManager ;8 ComCtrls, uConst, ORDtTm, VA508AccessibilityManager, VA508AccessibilityRouter; 9 9 10 10 type … … 49 49 txtReason: TCaptionEdit; 50 50 pnlRightBase: TORAutoPanel; 51 Submitlbl508: TVA508StaticText; 52 VA508ComponentAccessibility1: TVA508ComponentAccessibility; 53 VA508ComponentAccessibility2: TVA508ComponentAccessibility; 51 54 procedure cboProcedureNeedData(Sender: TObject; 52 55 const StartFrom: string; Direction, InsertAt: Integer); … … 71 74 procedure calPreOpExit(Sender: TObject); 72 75 procedure cboImTypeDropDownClose(Sender: TObject); 76 procedure pnlMessageExit(Sender: TObject); 77 procedure VA508ComponentAccessibility1StateQuery(Sender: TObject; 78 var Text: string); 79 procedure pnlMessageMouseUp(Sender: TObject; Button: TMouseButton; 80 Shift: TShiftState; X, Y: Integer); 73 81 private 74 82 FLastRadID: string; … … 82 90 procedure ImageTypeChange; 83 91 procedure FormFirstOpened(Sender: TObject); 92 procedure setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl); 84 93 protected 85 94 procedure InitDialog; override; … … 221 230 i: integer; 222 231 tmplst: TStringList; 232 cboSubmitText: String; 223 233 begin 224 234 if not FEditCopy then … … 266 276 lblSubmit.Enabled := False; 267 277 cboSubmit.Enabled := False; 278 //TDP - CQ#19393 cboSubmit 508 changes 279 cboSubmitText := cboSubmit.Text; 280 if cboSubmitText = '' then cboSubmitText := 'No Value'; 281 setup508Label(cboSubmitText, Submitlbl508, cboSubmit); 268 282 cboSubmit.Font.Color := clGrayText; 269 283 end … … 283 297 lblSubmit.Enabled := True; 284 298 cboSubmit.Enabled := True; 299 //TDP - CQ#19393 cboSubmit 508 changes 300 cboSubmitText := cboSubmit.Text; 301 if cboSubmitText = '' then cboSubmitText := 'No Value'; 302 setup508Label(cboSubmitText, Submitlbl508, cboSubmit); 285 303 cboSubmit.Font.Color := clWindowText; 286 304 end … … 290 308 lblSubmit.Enabled := False; 291 309 cboSubmit.Enabled := False; 310 //TDP - CQ#19393 cboSubmit 508 changes 311 cboSubmitText := cboSubmit.Text; 312 if cboSubmitText = '' then cboSubmitText := 'No Value'; 313 setup508Label(cboSubmitText, Submitlbl508, cboSubmit); 292 314 cboSubmit.Font.Color := clGrayText; 293 315 end; … … 301 323 lblSubmit.Enabled := False; 302 324 cboSubmit.Enabled := False; 325 //TDP - CQ#19393 cboSubmit 508 changes 326 cboSubmitText := cboSubmit.Text; 327 if cboSubmitText = '' then cboSubmitText := 'No Value'; 328 setup508Label(cboSubmitText, Submitlbl508, cboSubmit); 303 329 cboSubmit.Font.Color := clGrayText; 304 330 end; … … 311 337 cboProcedure.InitLongList('') ; 312 338 StatusText(''); 313 314 339 end; 315 340 … … 349 374 else with Encounter do Responses.Update('LOCATION', 1, IntToStr(Location) , LocationName); 350 375 memOrder.Text := Responses.OrderText; 376 end; 377 378 //TDP - CQ#19393 Made history memobox read text 379 procedure TfrmODRad.VA508ComponentAccessibility1StateQuery(Sender: TObject; 380 var Text: string); 381 begin 382 inherited; 383 Text := memHistory.Text; 351 384 end; 352 385 … … 639 672 if (Patient.Sex <> 'F') then 640 673 begin 674 //TDP - CQ#19393 change to allow grpPregnant to be tabbed to if screen reader active 675 if ScreenReaderSystemActive then grpPregnant.TabStop := True; 641 676 radPregnant.Enabled := False; 642 677 radPregnantNo.Enabled := False; … … 695 730 begin 696 731 if (Patient.Sex = 'F') and ((Patient.Age > 55) or (Patient.Age < 12)) then 732 begin 697 733 radPregnantNo.Checked := True; 734 grpPregnant.TabStop := False; 735 end; 698 736 end; 699 737 … … 720 758 end; 721 759 760 //TDP - CQ#19393 cboSubmit 508 changes. Can change in future to be generic if needed. (See fODLab.pas) 761 procedure TfrmODRad.setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl); 762 begin 763 if ScreenReaderSystemActive and not ctrl.Enabled then begin 764 lbl.Enabled := True; 765 lbl.Visible := True; 766 lbl.Caption := lblSubmit.Caption + '. Read Only. Value is ' + Text; 767 lbl.Width := lblSubmit.Width + 2; 768 end else 769 lbl.Visible := false; 770 end; 771 722 772 procedure TfrmODRad.cboProcedureExit(Sender: TObject); 723 773 var … … 739 789 for i := 0 to Items.Count - 1 do 740 790 Responses.Update('MODIFIER',i+1, Piece(Items[i],U,1), Piece(Items[i],U,2)); 791 //TDP - Made Order Message next focus if showing and Tab or Entered was pressed 792 if (pnlMessage.Showing) AND ((TabIsPressed()) OR (EnterIsPressed())) then memMessage.SetFocus; 741 793 end; 742 794 … … 778 830 begin 779 831 result := not ((radPregnant.Checked) or (radPregnantNo.Checked) or (radPregnantUnknown.Checked)); 832 end; 833 834 {TDP - Added to control where focus went now that pnlMessage was being focused 835 out of turn after cboProcedure.} 836 procedure TfrmODRad.pnlMessageExit(Sender: TObject); 837 begin 838 inherited; 839 if TabIsPressed() then cboAvailMod.SetFocus; 840 if ShiftTabIsPressed() then cboProcedure.SetFocus; 841 end; 842 843 {TDP - Added to control where focus went now that pnlMessage was being focused 844 out of turn after cboProcedure.} 845 procedure TfrmODRad.pnlMessageMouseUp(Sender: TObject; Button: TMouseButton; 846 Shift: TShiftState; X, Y: Integer); 847 begin 848 inherited; 849 cboProcedure.SetFocus; 780 850 end; 781 851 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODRadConShRes.dfm
r829 r1693 9 9 OldCreateOrder = True 10 10 Position = poScreenCenter 11 ExplicitWidth = 294 12 ExplicitHeight = 146 11 13 PixelsPerInch = 96 12 14 TextHeight = 13 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODRadConShRes.pas
r829 r1693 60 60 Enabled := True; 61 61 SelectByID(Piece(Source,U,1)); 62 BringToFront; 62 cboSource.Visible := True; 63 txtResearch.Visible := False; 64 //BringToFront; 63 65 ShowModal; 64 66 end … … 71 73 begin 72 74 cboSource.Enabled := False; 73 txtResearch.BringToFront; 75 cboSource.Visible := False; 76 srcLabel.Caption := 'Enter Source:'; 77 txtResearch.Visible := True; 78 //txtResearch.BringToFront; 74 79 txtResearch.Text := Source; 75 80 ShowModal; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODReleaseEvent.dfm
r829 r1693 9 9 OnDestroy = FormDestroy 10 10 ExplicitWidth = 494 11 ExplicitHeight = 4 8811 ExplicitHeight = 495 12 12 PixelsPerInch = 96 13 13 TextHeight = 13 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODReleaseEvent.pas
r829 r1693 118 118 SendReleaseOrders(OrdersLst); 119 119 LastCheckedPtEvt := ''; 120 121 //CQ #15813 Modired code to look for error string mentioned in CQ and change strings to conts - JCS 120 122 with OrdersLst do if Count > 0 then for i := 0 to Count - 1 do 121 123 begin … … 123 125 begin 124 126 OrderText := FindOrderText(Piece(OrdersLst[i], U, 1)); 125 if Piece(OrdersLst[i],U,4) = 'Invalid Pharmacy order number'then127 if Piece(OrdersLst[i],U,4) = TX_SAVERR_PHARM_ORD_NUM_SEARCH_STRING then 126 128 InfoBox(TX_SAVERR1 + Piece(OrdersLst[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 127 'The changes to this order have not been saved. You must contact Pharmacy to complete any action on this order.', 128 TC_SAVERR, MB_OK) 129 TX_SAVERR_PHARM_ORD_NUM, TC_SAVERR, MB_OK) 130 else if Piece(OrdersLst[i],U,4) = TX_SAVERR_IMAGING_PROC_SEARCH_STRING then 131 InfoBox(TX_SAVERR1 + Piece(OrdersLst[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 132 TX_SAVERR_IMAGING_PROC, TC_SAVERR, MB_OK) 129 133 else 130 134 InfoBox(TX_SAVERR1 + Piece(OrdersLst[i], U, 4) + TX_SAVERR2 + OrderText, -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODText.dfm
r829 r1693 1 1 inherited frmODText: TfrmODText 2 Width = 525 3 Height = 279 4 Anchors = [akLeft, akTop, akBottom] 2 5 Caption = 'Text Only Order' 6 ExplicitWidth = 525 7 ExplicitHeight = 279 3 8 PixelsPerInch = 96 4 9 TextHeight = 13 … … 24 29 Caption = 'Stop Date/Time' 25 30 end 31 object lblOrderSig: TLabel [3] 32 Left = 8 33 Top = 178 34 Width = 44 35 Height = 13 36 Caption = 'Order Sig' 37 end 26 38 inherited memOrder: TCaptionMemo 27 TabOrder = 6 28 end 29 inherited cmdAccept: TButton 30 TabOrder = 3 39 TabOrder = 4 31 40 end 32 41 object memText: TMemo [5] … … 35 44 Width = 508 36 45 Height = 124 37 TabOrder = 0 46 Anchors = [akLeft, akTop, akBottom] 47 TabOrder = 1 38 48 OnChange = ControlChange 39 49 end … … 43 53 Width = 140 44 54 Height = 21 45 TabOrder = 155 TabOrder = 2 46 56 OnChange = ControlChange 47 57 DateOnly = False … … 54 64 Width = 140 55 65 Height = 21 56 TabOrder = 266 TabOrder = 3 57 67 OnChange = ControlChange 58 68 DateOnly = False … … 60 70 Caption = 'Stop Date/Time' 61 71 end 72 inherited cmdAccept: TButton 73 TabOrder = 5 74 end 62 75 inherited cmdQuit: TButton 63 TabOrder = 476 TabOrder = 6 64 77 end 65 78 inherited pnlMessage: TPanel 66 TabOrder = 579 TabOrder = 0 67 80 end 68 81 inherited amgrMain: TVA508AccessibilityManager … … 79 92 ( 80 93 'Component = memOrder' 81 'Status = stsDefault') 94 'Label = lblOrderSig' 95 'Status = stsOK') 82 96 ( 83 97 'Component = cmdAccept' … … 96 110 'Status = stsDefault')) 97 111 end 112 object VA508CompMemOrder: TVA508ComponentAccessibility 113 Component = memOrder 114 OnStateQuery = VA508CompMemOrderStateQuery 115 Left = 152 116 Top = 216 117 end 98 118 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODText.pas
r829 r1693 16 16 lblStart: TLabel; 17 17 lblStop: TLabel; 18 VA508CompMemOrder: TVA508ComponentAccessibility; 19 lblOrderSig: TLabel; 18 20 procedure FormCreate(Sender: TObject); 19 21 procedure ControlChange(Sender: TObject); 20 22 procedure cmdAcceptClick(Sender: TObject); 23 procedure VA508CompMemOrderStateQuery(Sender: TObject; var Text: string); 21 24 public 22 25 procedure InitDialog; override; … … 70 73 end 71 74 else txtStart.Text := 'NOW'; 75 end; 76 77 procedure TfrmODText.VA508CompMemOrderStateQuery(Sender: TObject; 78 var Text: string); 79 begin 80 inherited; 81 Text := memOrder.Text; 72 82 end; 73 83 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOMNavA.pas
r829 r1693 647 647 if grdMenu.Objects[grdMenu.Col, grdMenu.Row] is TOrderMenuItem then begin 648 648 OrderMenuItem := TOrderMenuItem(grdMenu.Objects[grdMenu.Col, grdMenu.Row]); 649 Text := OrderMenuItem.Mnemonic + ', ' + OrderMenuItem.ItemText; 649 650 if OrderMenuItem.AutoAck then 650 Text := 'Auto Accept, '+ OrderMenuItem.ItemText;651 Text := 'Auto Accept, '+ Text; 651 652 end; 652 653 end; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOMSet.pas
r829 r1693 109 109 SetItem: TSetItem; 110 110 theOwner: TComponent; 111 ok: boolean; 111 112 112 113 procedure SkipToNext; 113 114 begin 115 if FClosing then Exit; 114 116 lstSet.Checked[lstSet.ItemIndex] := True; 115 117 DoNextItem; … … 117 119 118 120 begin 119 DoingNextItem := true;121 DoingNextItem := true; 120 122 //frmFrame.UpdatePtInfoOnRefresh; 121 123 if FClosing then Exit; … … 144 146 'A': if not ActivateAction(IntToStr(SetItem.DialogIEN), Self, ItemIndex) then 145 147 begin 146 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 147 lstSet.Checked[lstSet.ItemIndex] := True 148 else SkipToNext; 148 if Not FClosing then 149 begin 150 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 151 lstSet.Checked[lstSet.ItemIndex] := True 152 else SkipToNext; 153 end; 149 154 end; 150 155 'D', 'Q': if not ActivateOrderDialog(IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex) then 156 begin 157 if Not FClosing then 158 begin 159 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 160 lstSet.Checked[lstSet.ItemIndex] := True 161 else SkipToNext; 162 end; 163 end; 164 'M': begin 165 ok := ActivateOrderMenu(IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex); 166 if not FClosing then 167 begin 168 if ok then 169 Inc(FActiveMenus) 170 else 171 begin 172 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 173 lstSet.Checked[lstSet.ItemIndex] := True 174 else 175 SkipToNext; 176 end; 177 end; 178 end; 179 'O': begin 180 if (Self.Owner.Name = 'frmOMNavA') then theOwner := Self.Owner else theOwner := self; 181 if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, theOwner, ItemIndex) then 151 182 begin 152 183 if Not FClosing then … … 157 188 end; 158 189 end; 159 'M': if ActivateOrderMenu( IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex)160 then Inc(FActiveMenus)161 else162 begin163 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then164 lstSet.Checked[lstSet.ItemIndex] := True165 else166 SkipToNext;167 end;168 'O': begin169 if (Self.Owner.Name = 'frmOMNavA') then theOwner := Self.Owner else theOwner := self;170 if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, theOwner, ItemIndex) then171 begin172 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then173 lstSet.Checked[lstSet.ItemIndex] := True174 else SkipToNext;175 end;176 190 end; 177 191 else begin … … 186 200 procedure TfrmOMSet.UMDelayEvent(var Message: TMessage); 187 201 begin 202 if CloseRequested then 203 begin 204 Close; 205 if Not FClosing then 206 begin 207 CloseRequested := False; 208 FClosing := False; 209 DoNextItem; 210 end 211 else Exit; 212 end; 188 213 // ignore if delay from other than current itemindex 189 214 // (prevents completion of an order set from calling DoNextItem) 190 215 if Message.WParam = lstSet.ItemIndex then 191 216 if lstSet.ItemIndex < lstSet.Items.Count - 1 then DoNextItem else Close; 192 if CloseRequested then193 Close;194 217 end; 195 218 … … 252 275 else if lstSet.ItemIndex < (lstSet.Items.Count - 1) 253 276 then CanClose := InfoBox(TX_STOP, TC_STOP, MB_YESNO) = IDYES; 277 FClosing := CanClose; 254 278 end; 255 279 … … 281 305 begin 282 306 if DoingNextItem then 283 CloseRequested := true //Fix for CQ: 8297 307 begin 308 CloseRequested := true; //Fix for CQ: 8297 309 FClosing := true; 310 end 284 311 else 285 312 Close; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOMVerify.dfm
r829 r1693 8 8 OnClose = FormClose 9 9 OnCreate = FormCreate 10 OnShow = FormShow 10 11 ExplicitWidth = 587 11 12 ExplicitHeight = 208 … … 46 47 Width = 567 47 48 Height = 132 49 TabStop = False 48 50 Font.Charset = ANSI_CHARSET 49 51 Font.Color = clWindowText … … 65 67 '10') 66 68 ParentFont = False 69 ReadOnly = True 67 70 ScrollBars = ssBoth 68 71 TabOrder = 3 69 72 WantTabs = True 70 73 WordWrap = False 71 OnKey Up = memTextKeyUp74 OnKeyDown = memTextKeyDown 72 75 end 73 76 inherited amgrMain: TVA508AccessibilityManager … … 84 87 ( 85 88 'Component = memText' 86 'Status = stsDefault') 89 'Text = Order information.' 90 'Status = stsOK') 87 91 ( 88 92 'Component = frmOMVerify' 89 93 'Status = stsDefault')) 90 94 end 95 object VA508ComponentAccessibility1: TVA508ComponentAccessibility 96 Component = memText 97 OnStateQuery = VA508ComponentAccessibility1StateQuery 98 Left = 48 99 Top = 32 100 end 91 101 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOMVerify.pas
r829 r1693 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, StdCtrls, ComCtrls, VA508AccessibilityManager ;7 fAutoSz, StdCtrls, ComCtrls, VA508AccessibilityManager, VA508AccessibilityRouter; 8 8 9 9 type … … 13 13 cmdCancel: TButton; 14 14 memText: TRichEdit; 15 VA508ComponentAccessibility1: TVA508ComponentAccessibility; 15 16 procedure cmdAcceptClick(Sender: TObject); 16 17 procedure cmdEditClick(Sender: TObject); … … 20 21 procedure memTextKeyUp(Sender: TObject; var Key: Word; 21 22 Shift: TShiftState); 23 procedure FormDestroy(Sender: TObject); 24 procedure VA508ComponentAccessibility1StateQuery(Sender: TObject; 25 var Text: string); 26 procedure FormShow(Sender: TObject); 27 procedure memTextKeyDown(Sender: TObject; var Key: Word; 28 Shift: TShiftState); 22 29 private 23 30 FLevel: Integer; … … 26 33 procedure ShowVerifyText(var QuickLevel: Integer; var VerifyText: string; InptDispGrp: boolean = False); 27 34 35 var 36 frmOMVerify: TfrmOMVerify; 28 37 implementation 29 38 … … 34 43 procedure ShowVerifyText(var QuickLevel: Integer; var VerifyText: string; InptDispGrp: boolean); 35 44 var 36 frmOMVerify: TfrmOMVerify;45 //frmOMVerify: TfrmOMVerify; 37 46 tempStrs,prompts: TStringList; 38 47 flag: boolean; … … 68 77 prompts.Add('priority'); 69 78 frmOMVerify := TfrmOMVerify.Create(Application); 70 try71 79 ResizeFormToFont(TForm(frmOMVerify)); 72 80 if InptDispGrp then … … 79 87 SetString(VerifyText, tempStrs.GetText, StrLen(tempStrs.GetText)) 80 88 end; 81 82 with frmOMVerify do83 begin84 SetBounds(frmFrame.Left, frmFrame.Top + frmFrame.Height - Height, Width, Height);85 89 SetFormPosition(frmOMVerify); 86 90 ExpandOrderObjects(VerifyText, HasObjects); 87 memText.Lines.SetText(PChar(VerifyText)); 88 ShowModal; 89 QuickLevel := FLevel; 90 end; 91 finally 92 frmOMVerify.Release; 93 end; 91 frmOMVerify.memText.Lines.SetText(PChar(VerifyText)); 92 frmOMVerify.ShowModal; 93 if frmOMVerify.ModalResult = mrOK then 94 begin 95 QuickLevel := frmOMVerify.FLevel; 96 end; 97 //agp on CPRS timeout ModalResult equal mrCancel this prevent starting a new order 98 //when the chart is timing out. 99 if frmOMVerify.ModalResult = mrCancel then QuickLevel := QL_CANCEL; 100 frmOMVerify.Free; 94 101 end; 95 102 … … 98 105 begin 99 106 inherited; 107 frmOMVerify := nil; 100 108 FLevel := QL_CANCEL; 109 ModalResult := mrNone; 110 end; 111 112 113 procedure TfrmOMVerify.FormDestroy(Sender: TObject); 114 begin 115 inherited; 116 frmOMVerify := nil; 117 end; 118 119 procedure TfrmOMVerify.FormShow(Sender: TObject); 120 begin 121 inherited; 122 if ScreenReaderSystemActive then 123 begin 124 memText.TabStop := true; 125 memText.SetFocus; 126 end; 101 127 end; 102 128 … … 105 131 inherited; 106 132 FLevel := QL_AUTO; 107 Close;133 ModalResult := mrOK; 108 134 end; 109 135 … … 112 138 inherited; 113 139 FLevel := QL_DIALOG; 114 Close;140 ModalResult := mrOK; 115 141 end; 116 142 … … 119 145 inherited; 120 146 FLevel := QL_CANCEL; 121 Close;147 ModalResult := mrOK; 122 148 end; 123 149 … … 129 155 end; 130 156 157 procedure TfrmOMVerify.memTextKeyDown(Sender: TObject; var Key: Word; 158 Shift: TShiftState); 159 begin 160 inherited; 161 if ShiftTabIsPressed() then 162 begin 163 FindNextControl(Sender as TWinControl, False, True, False).SetFocus; //previous control 164 Key := 0; 165 end; 166 if TabIsPressed() then 167 begin 168 FindNextControl(Sender as TWinControl, True, True, False).SetFocus; //next control 169 Key := 0; 170 end; 171 if (key = VK_ESCAPE) then begin 172 FindNextControl(Sender as TWinControl, False, True, False).SetFocus; //previous control 173 key := 0; 174 end; 175 end; 176 131 177 procedure TfrmOMVerify.memTextKeyUp(Sender: TObject; var Key: Word; 132 178 Shift: TShiftState); 133 179 begin 134 180 inherited; 135 if (Key = VK_TAB) then181 {if (Key = VK_TAB) then 136 182 begin 137 183 if ssShift in Shift then … … 149 195 FindNextControl(Sender as TWinControl, False, True, False).SetFocus; //previous control 150 196 key := 0; 151 end; 197 end; } 198 end; 199 200 procedure TfrmOMVerify.VA508ComponentAccessibility1StateQuery(Sender: TObject; 201 var Text: string); 202 begin 203 inherited; 204 Text := memText.Text; 152 205 end; 153 206 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrders.dfm
r829 r1693 4 4 HelpContext = 4000 5 5 Caption = 'Orders Page' 6 ClientHeight = 5 716 ClientHeight = 591 7 7 ClientWidth = 766 8 8 HelpFile = 'overvw' … … 11 11 OnShow = FormShow 12 12 ExplicitWidth = 774 13 ExplicitHeight = 6 1713 ExplicitHeight = 645 14 14 PixelsPerInch = 96 15 15 TextHeight = 13 16 16 inherited shpPageBottom: TShape 17 Top = 5 6617 Top = 586 18 18 Width = 766 19 19 ExplicitTop = 528 … … 22 22 inherited sptHorz: TSplitter 23 23 Left = 117 24 Height = 5 6624 Height = 586 25 25 OnMoved = sptHorzMoved 26 26 ExplicitLeft = 117 … … 29 29 inherited pnlLeft: TPanel 30 30 Width = 117 31 Height = 5 6631 Height = 586 32 32 ExplicitWidth = 117 33 ExplicitHeight = 5 6633 ExplicitHeight = 586 34 34 object OROffsetLabel1: TOROffsetLabel 35 35 Left = 0 … … 64 64 Cursor = crVSplit 65 65 Align = alTop 66 OnMoved = sptVertMoved 66 67 end 67 68 object lstSheets: TORListBox … … 71 72 Height = 56 72 73 Align = alTop 74 Constraints.MinHeight = 30 73 75 ItemHeight = 13 74 76 ParentShowHint = False … … 85 87 Top = 116 86 88 Width = 117 87 Height = 4 5089 Height = 470 88 90 Align = alClient 89 91 ItemHeight = 13 … … 112 114 Left = 121 113 115 Width = 645 114 Height = 5 66116 Height = 586 115 117 ParentColor = True 116 118 ParentCtl3D = False … … 119 121 ExplicitLeft = 121 120 122 ExplicitWidth = 645 121 ExplicitHeight = 5 66123 ExplicitHeight = 586 122 124 object lblOrders: TOROffsetLabel 123 125 Left = 0 … … 226 228 Top = 36 227 229 Width = 645 228 Height = 5 30230 Height = 550 229 231 Style = lbOwnerDrawVariable 230 232 Align = alClient -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrders.pas
r829 r1693 163 163 Section: THeaderSection); 164 164 procedure sptHorzMoved(Sender: TObject); 165 procedure sptVertMoved(Sender: TObject); 165 166 private 166 167 { Private declarations } … … 225 226 function AllowContextChange(var WhyNot: string): Boolean; override; 226 227 function PlaceOrderForDefaultDialog(ADlgInfo: string; IsDefaultDialog: boolean; AEvent: TOrderDelayEvent): boolean; 227 function PtEvtCompleted(APtEvtID: integer; APtEvtName: string; FromMeds: boolean = False ): boolean;228 function PtEvtCompleted(APtEvtID: integer; APtEvtName: string; FromMeds: boolean = False; Signing: boolean = False): boolean; 228 229 procedure RefreshToFirstItem; 229 230 procedure ChangesUpdate(APtEvtID: string); … … 1176 1177 FCompress := False; 1177 1178 end; 1178 1179 //CQ 18660 Orders for events should be modal. Orders for non-event should not be modal 1180 if AnOrderView.EventDelay.EventIFN = 0 then NeedShowModal := False 1181 else NeedShowModal := True; 1179 1182 if (FCurrentView <> nil) and (AnOrderView.EventDelay.EventIFN <> FCurrentView.EventDelay.EventIFN) and (FCurrentView.EventDelay.EventIFN > 0 ) then 1180 1183 begin … … 1398 1401 begin 1399 1402 result := MixedCase(ProviderName); 1400 result := Piece(result, ',', 1) + ',' + Copy(Piece(result, ',', 2), 1, 1); 1403 // result := Piece(result, ',', 1) + ',' + Copy(Piece(result, ',', 2), 1, 1); 1404 // CQ#15915 1405 result := Piece(result, ',', 1) + ',' + Piece(result, ',', 2); 1401 1406 end; 1402 1407 5: result := VerNurse; … … 2350 2355 ALocation: Integer; 2351 2356 AName: string; 2352 begin 2353 inherited; 2357 Delayed: boolean; 2358 begin 2359 inherited; 2360 Delayed := False; 2354 2361 if NoneSelected(TX_NOSEL_SIGN) then Exit; 2355 2362 if not AuthorizedUser then Exit; … … 2375 2382 if not LockedForOrdering then Exit; 2376 2383 2377 if (FCurrentView.EventDelay.PtEventIFN>0) and (PtEvtCompleted(FCurrentView.EventDelay.PtEventIFN, FCurrentView.EventDelay.EventName)) then 2378 Exit; 2384 //CQ 18392 and CQ 18121 Made changes to this code, PtEVTComplete function and the finally statement at the end to support the fix for these CQs 2385 if (FCurrentView.EventDelay.PtEventIFN>0) then 2386 Delayed := (PtEvtCompleted(FCurrentView.EventDelay.PtEventIFN, FCurrentView.EventDelay.EventName, false, true)); 2387 //if (FCurrentView.EventDelay.PtEventIFN>0) and (PtEvtCompleted(FCurrentView.EventDelay.PtEventIFN, FCurrentView.EventDelay.EventName)) then 2388 // Exit; 2379 2389 2380 2390 SelectedList := TList.Create; … … 2413 2423 SelectedList.Free; 2414 2424 UnlockIfAble; 2425 //CQ #17491: Added UpdatePtInfoOnRefresh here to allow for the updating of the patient 2426 //status indicator in the header bar if the patient becomes admitted/discharged. 2427 frmFrame.UpdatePtInfoOnRefresh; 2428 if Delayed = True then 2429 begin 2430 InitOrderSheetsForEvtDelay; 2431 lstSheets.ItemIndex := 0; 2432 lstSheetsClick(self); 2433 RefreshOrderList(True); 2434 end; 2415 2435 end; 2416 2436 end; … … 3243 3263 end; 3244 3264 3245 function TfrmOrders.PtEvtCompleted(APtEvtID: integer; APtEvtName: string; FromMeds: boolean ): boolean;3265 function TfrmOrders.PtEvtCompleted(APtEvtID: integer; APtEvtName: string; FromMeds: boolean; Signing: boolean): boolean; 3246 3266 begin 3247 3267 Result := False; … … 3253 3273 InfoBox('The event "Delayed ' + APtEvtName + '" ' + TX_CMPTEVT, 'Warning', MB_OK or MB_ICONWARNING); 3254 3274 GroupChangesUpdate('Delayed ' + APtEvtName); 3275 if signing = true then 3276 begin 3277 Result := True; 3278 exit; 3279 end; 3255 3280 InitOrderSheetsForEvtDelay; 3256 3281 lstSheets.ItemIndex := 0; … … 3338 3363 hdrOrders.Sections[i].Width := origWidths[i]; 3339 3364 lstOrders.Invalidate; 3365 RefreshOrderList(false); 3340 3366 end; 3341 3367 end; … … 3474 3500 end; 3475 3501 3502 procedure TfrmOrders.sptVertMoved(Sender: TObject); 3503 begin 3504 inherited; 3505 if self.sptVert.Top < self.lstSheets.Constraints.MinHeight then 3506 self.sptVert.Top := self.lstSheets.Constraints.MinHeight + 1; 3507 3508 end; 3509 3476 3510 initialization 3477 3511 SpecifyFormIsNotADialog(TfrmOrders); -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersDC.pas
r829 r1693 80 80 frmDCOrders.lblReason.Visible := True; 81 81 frmDCOrders.lstReason.Visible := True; 82 frmDCOrders.lstReason.ScrollWidth := 10; 82 83 end else 83 84 begin -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersOnChart.dfm
r829 r1693 8 8 OnCreate = FormCreate 9 9 ExplicitWidth = 470 10 ExplicitHeight = 3 6810 ExplicitHeight = 375 11 11 PixelsPerInch = 96 12 12 TextHeight = 13 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersOnChart.pas
r829 r1693 93 93 uCore.TempEncounterLocName := ''; 94 94 95 //CQ #15813 Modired code to look for error string mentioned in CQ and change strings to conts - JCS 95 96 with SignList do if Count > 0 then for i := 0 to Count - 1 do 96 97 begin … … 98 99 begin 99 100 OrderText := FindOrderText(Piece(SignList[i], U, 1)); 100 if Piece(SignList[i],U,4) = 'Invalid Pharmacy order number'then101 if Piece(SignList[i],U,4) = TX_SAVERR_PHARM_ORD_NUM_SEARCH_STRING then 101 102 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 102 'The changes to this order have not been saved. You must contact Pharmacy to complete any action on this order.', 103 TC_SAVERR, MB_OK) 103 TX_SAVERR_PHARM_ORD_NUM, TC_SAVERR, MB_OK) 104 else if Piece(SignList[i],U,4) = TX_SAVERR_IMAGING_PROC_SEARCH_STRING then 105 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 106 TX_SAVERR_IMAGING_PROC, TC_SAVERR, MB_OK) 104 107 else 105 108 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText, -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersRelease.dfm
r829 r1693 6 6 Position = poScreenCenter 7 7 OnCreate = FormCreate 8 ExplicitLeft = 3189 ExplicitTop = 18610 8 ExplicitHeight = 377 11 9 PixelsPerInch = 96 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersRelease.pas
r829 r1693 128 128 129 129 130 //CQ #15813 Modired code to look for error string mentioned in CQ and change strings to conts - JCS 130 131 with SignList do if Count > 0 then for i := 0 to Count - 1 do 131 132 begin … … 133 134 begin 134 135 OrderText := FindOrderText(Piece(SignList[i], U, 1)); 135 if Piece(SignList[i],U,4) = 'Invalid Pharmacy order number'then136 if Piece(SignList[i],U,4) = TX_SAVERR_PHARM_ORD_NUM_SEARCH_STRING then 136 137 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 137 'The changes to this order have not been saved. You must contact Pharmacy to complete any action on this order.', 138 TC_SAVERR, MB_OK) 138 TX_SAVERR_PHARM_ORD_NUM, TC_SAVERR, MB_OK) 139 else if Piece(SignList[i],U,4) = TX_SAVERR_IMAGING_PROC_SEARCH_STRING then 140 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 141 TX_SAVERR_IMAGING_PROC, TC_SAVERR, MB_OK) 139 142 else 140 143 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText, -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersRenew.dfm
r829 r1693 58 58 Caption = 'Cancel' 59 59 Constraints.MinHeight = 21 60 TabOrder = 060 TabOrder = 2 61 61 OnClick = cmdCancelClick 62 62 end … … 81 81 Constraints.MinHeight = 21 82 82 Enabled = False 83 TabOrder = 283 TabOrder = 0 84 84 OnClick = cmdChangeClick 85 85 end … … 111 111 OnMeasureItem = lstOrdersMeasureItem 112 112 HintOnItem = True 113 ExplicitTop = 12 113 114 end 114 115 inherited amgrMain: TVA508AccessibilityManager -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersRenew.pas
r829 r1693 262 262 FixHeaderControlDelphi2006Bug(hdrOrders); 263 263 OKPressed := False; 264 hdrOrders.Sections[0].Width := Round(self.width * 0.75); 265 hdrOrders.Sections[1].Width := Round(self.width * 0.25); 264 266 ResizeFormToFont(Self); 265 SetFormPosition(Self); 267 SetFormPosition(Self); 266 268 end; 267 269 … … 410 412 var 411 413 ARect: TRect; 412 begin 414 cnt: integer; 415 x: string; 416 begin 417 cnt := 0; 413 418 ARect.Left := 0; 414 419 ARect.Top := 0; … … 416 421 ARect.Right := hdrOrders.Sections[Column].Width -6; 417 422 Result := WrappedTextHeightByFont(lstOrders.Canvas,lstOrders.Font,TheOrderText,ARect); 423 //AGP 28.0 this fix address the issue of WrappedTextHeightByFont appearing to not take in account CRLF 424 if Pos(CRLF, TheOrderText) > 0 then 425 begin 426 repeat 427 x := Copy(TheOrderText, 1, Pos(CRLF, TheOrderText) - 1); 428 if Length(x) = 0 then x := TheOrderText; 429 Delete(TheOrderText, 1, Length(x) + 2); {delete text + CRLF} 430 cnt := cnt + 1; 431 until TheOrderText = ''; 432 if cnt > 0 then Result := Result + (cnt * Abs(self.Font.Height)); 433 if Result > 255 then Result := 255; 434 end; 435 418 436 end; 419 437 … … 423 441 OIInfo,FillerID: string; 424 442 AnOIList: TStringList; 443 subI: integer; 425 444 begin 426 445 AnOIList := TStringList.Create; 427 446 OIInfo := DataForOrderCheck(AnOrderID); 428 447 FillerID := Piece(OIInfo,'^',2); 429 AnOIList.Add(OIInfo); 430 OrderChecksOnAccept(OCList, FillerID, '', AnOIList, AnOrderID); 448 subI := 1; 449 while Length(Piece(OIInfo,'|',subI))>1 do 450 begin 451 AnOIList.Add(Piece(OIInfo,'|',subI)); 452 subI := subI + 1; 453 end; 454 OrderChecksOnAccept(OCList, FillerID, '', AnOIList, AnOrderID,'1'); 431 455 Result := AcceptOrderWithChecks(OCList); 432 456 end; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersSign.dfm
r829 r1693 14 14 OnShow = FormShow 15 15 ExplicitWidth = 841 16 ExplicitHeight = 5 1416 ExplicitHeight = 521 17 17 DesignSize = ( 18 18 833 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersSign.pas
r829 r1693 7 7 uses 8 8 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 9 fAutoSz, StdCtrls, ORFn, ORCtrls, AppEvnts, mCoPayDesc, XUDIGSIGSC_TLB,9 fAutoSz, StdCtrls, StrUtils, ORFn, ORCtrls, AppEvnts, mCoPayDesc, XUDIGSIGSC_TLB, 10 10 ComCtrls, CheckLst, ExtCtrls, uConsults, UBAGlobals,UBACore, UBAMessages, UBAConst, 11 11 Menus, ORClasses, fBase508Form, fPrintLocation, VA508AccessibilityManager; … … 211 211 OrderText, ASvc: string; 212 212 PrintLoc: Integer; 213 AList, ClinicList, DCList,OrderPrintList, WardList: TStringList;213 AList, ClinicList, OrderPrintList, WardList: TStringList; 214 214 EncLocName, EncLocText: string; 215 215 EncLocIEN: integer; 216 216 EncDT: TFMDateTime; 217 217 EncVC: Char; 218 //ChangeItem: TChangeItem; 218 219 219 220 function FindOrderText(const AnID: string): string; … … 330 331 end; 331 332 332 333 frmSignOrders.ShowModal; 333 334 if frmSignOrders.OKPressed then 334 335 begin … … 428 429 if (Patient.Inpatient = True) and (Encounter.Location <> Patient.Location) then 429 430 begin 430 DCList := TStringList.Create;431 431 EncLocName := Encounter.LocationName; 432 432 EncLocIEN := Encounter.Location; … … 440 440 if TOrder(SelectedList.Items[i]).DGroupName = 'Clinic Orders' then ContainsIMOOrders := true; 441 441 if TOrder(SelectedList.Items[i]).DGroupName = '' then continue; 442 if TOrder(SelectedList.Items[i]).EventPtr <> '' then continue;443 if Pos('DC', TOrder(SelectedList.Items[i]).ActionOn) > 0then442 if (Pos('DC', TOrder(SelectedList.Items[i]).ActionOn) > 0) or 443 (TOrder(SelectedList.Items[i]).IsOrderPendDC = true) then 444 444 begin 445 DCList.Add(TOrder(SelectedList.Items[i]).ID);445 WardList.Add(TOrder(SelectedList.Items[i]).ID); 446 446 Continue; 447 447 end; 448 //ChangeItem := Changes.Locate(20,TOrder(SelectedList.Items[i]).ID); 449 //if ChangeItem = nil then continue; 450 //if ChangeItem.Delay = true then continue; 451 if TOrder(SelectedList.Items[i]).IsDelayOrder = true then continue; 448 452 OrderPrintList.Add(TOrder(SelectedList.Items[i]).ID + ':' + TOrder(SelectedList.Items[i]).Text); 449 453 end; … … 452 456 frmPrintLocation.PrintLocation(OrderPrintList, EncLocIEN, EncLocName, EncLocText, EncDT, EncVC, ClinicList, 453 457 WardList, WardIen,WardName, ContainsIMOOrders, true); 454 fframe.frmFrame.OrderPrintForm := false;458 //fframe.frmFrame.OrderPrintForm := false; 455 459 end 456 else DoNotPrint := True; 457 if (DCList <> nil) and (DCList.Count > 0) then 458 begin 459 for i := 0 to DCList.Count - 1 do 460 WardList.Add(DCList.Strings[i]); 461 if (WardIEN = 0) and (WardName = '') then 462 CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc); 460 else if (clinicList.count = 0) and (wardList.Count = 0) then DoNotPrint := True; 461 if (WardIEN = 0) and (WardName = '') then CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc); 463 462 end; 464 if DCList <> nil then DCList.Free;465 end;466 463 end; 467 464 uCore.TempEncounterLoc := 0; … … 473 470 end; 474 471 472 //CQ #15813 Modified code to look for error string mentioned in CQ and change strings to conts - JCS 473 //CQ #15813 Adjusted code to handle error message properly - TDP 475 474 with SignList do if Count > 0 then for i := 0 to Count - 1 do 476 475 begin … … 478 477 begin 479 478 OrderText := FindOrderText(Piece(SignList[i], U, 1)); 480 if Piece(SignList[i],U,4) = 'Invalid Pharmacy order number'then479 if Piece(SignList[i],U,4) = TX_SAVERR_PHARM_ORD_NUM_SEARCH_STRING then 481 480 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 482 'The changes to this order have not been saved. You must contact Pharmacy to complete any action on this order.', 483 TC_SAVERR, MB_OK) 481 TX_SAVERR_PHARM_ORD_NUM, TC_SAVERR, MB_OK) 482 else if AnsiContainsStr(Piece(SignList[i],U,4), TX_SAVERR_IMAGING_PROC_SEARCH_STRING) then 483 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF + 484 TX_SAVERR_IMAGING_PROC, TC_SAVERR, MB_OK) 484 485 else 485 486 InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText, -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersTS.dfm
r829 r1693 9 9 OnClose = FormClose 10 10 OnCreate = FormCreate 11 ExplicitLeft = 8412 ExplicitTop = 7713 11 ExplicitWidth = 464 14 12 ExplicitHeight = 385 … … 17 15 object pnlMiddle: TPanel [0] 18 16 Left = 0 19 Top = 7817 Top = 60 20 18 Width = 456 21 19 Height = 56 22 20 Align = alTop 23 21 Constraints.MinHeight = 45 24 TabOrder = 022 TabOrder = 1 25 23 object grpChoice: TGroupBox 26 24 Left = 1 … … 81 79 Top = 0 82 80 Width = 456 83 Height = 7881 Height = 60 84 82 Align = alTop 85 83 Anchors = [akLeft, akTop, akRight, akBottom] 86 84 AutoSize = True 87 85 BorderStyle = bsSingle 88 TabOrder = 1 89 object lblPtInfo: TLabel 86 TabOrder = 0 87 object lblPtInfo: TVA508StaticText 88 Name = 'lblPtInfo' 90 89 Left = 1 91 90 Top = 1 92 Width = 391 Width = 450 93 92 Height = 34 94 93 Align = alTop 95 Color = clBtnFace94 Alignment = taLeftJustify 96 95 Constraints.MinHeight = 34 97 ParentColor = False98 Layout = tlCenter96 TabOrder = 0 97 ShowAccelChar = True 99 98 end 100 99 object pnldif: TPanel … … 102 101 Top = 35 103 102 Width = 450 104 Height = 38103 Height = 20 105 104 Align = alTop 106 105 Anchors = [akLeft, akTop, akRight, akBottom] 107 TabOrder = 0106 TabOrder = 1 108 107 object Image1: TImage 109 108 Left = 1 110 109 Top = 1 111 110 Width = 24 112 Height = 22111 Height = 18 113 112 Align = alLeft 114 113 AutoSize = True … … 131 130 ExplicitHeight = 36 132 131 end 133 object Label1: TLabel 132 object lblUseAdmit: TVA508StaticText 133 Name = 'lblUseAdmit' 134 134 Left = 34 135 135 Top = 4 136 Width = 327 137 Height = 13 136 Width = 329 137 Height = 15 138 Alignment = taLeftJustify 138 139 Caption = 139 140 'Use Admit: if patient is newly admitted to the hospital or nursi' + 140 141 'ng home.' 141 end 142 object Label2: TLabel 142 TabOrder = 0 143 ShowAccelChar = True 144 end 145 object lblUseTransfer: TVA508StaticText 146 Name = 'lblUseTransfer' 143 147 Left = 34 144 148 Top = 21 145 Width = 361 146 Height = 13 149 Width = 363 150 Height = 15 151 Alignment = taLeftJustify 147 152 Caption = 148 153 'Use Transfer: if inpatient will move from one ward or treating t' + 149 154 'eam to another.' 150 end 151 end 152 end 153 object Panel1: TPanel [2] 155 TabOrder = 1 156 Visible = False 157 ShowAccelChar = True 158 end 159 end 160 end 161 object pnlBottom: TPanel [2] 154 162 Left = 0 155 Top = 1 34163 Top = 116 156 164 Width = 456 157 Height = 2 17165 Height = 235 158 166 Align = alClient 159 167 TabOrder = 2 168 ExplicitTop = 112 169 ExplicitHeight = 239 160 170 inline fraEvntDelayList: TfraEvntDelayList 161 171 Left = 1 162 172 Top = 1 163 173 Width = 454 164 Height = 2 15174 Height = 233 165 175 Align = alClient 166 176 AutoScroll = True 167 177 TabOrder = 0 168 TabStop = True169 178 Visible = False 170 179 ExplicitLeft = 1 171 180 ExplicitTop = 1 172 181 ExplicitWidth = 454 173 ExplicitHeight = 2 15182 ExplicitHeight = 237 174 183 inherited pnlDate: TPanel 175 184 Left = 349 176 Height = 2 15185 Height = 233 177 186 ExplicitLeft = 349 178 ExplicitHeight = 2 15187 ExplicitHeight = 237 179 188 inherited lblEffective: TLabel 180 189 Left = 453 … … 190 199 inherited pnlList: TPanel 191 200 Width = 349 192 Height = 2 15201 Height = 233 193 202 ExplicitWidth = 349 194 ExplicitHeight = 2 15203 ExplicitHeight = 237 195 204 inherited lblEvntDelayList: TLabel 196 205 Width = 347 … … 199 208 inherited mlstEvents: TORListBox 200 209 Width = 347 201 Height = 1 79210 Height = 197 202 211 OnDblClick = cmdOKClick 212 OnChange = fraEvntDelayListmlstEventsChange 203 213 ExplicitWidth = 347 204 ExplicitHeight = 179214 ExplicitHeight = 201 205 215 end 206 216 inherited edtSearch: TCaptionEdit … … 238 248 'Status = stsDefault') 239 249 ( 240 'Component = Panel1'250 'Component = pnlBottom' 241 251 'Status = stsDefault') 242 252 ( … … 260 270 ( 261 271 'Component = frmOrdersTS' 272 'Status = stsDefault') 273 ( 274 'Component = lblUseTransfer' 275 'Status = stsDefault') 276 ( 277 'Component = lblPtInfo' 278 'Status = stsDefault') 279 ( 280 'Component = lblUseAdmit' 262 281 'Status = stsDefault')) 263 282 end -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersTS.pas
r829 r1693 12 12 pnlMiddle: TPanel; 13 13 pnlTop: TPanel; 14 lblPtInfo: T Label;14 lblPtInfo: TVA508StaticText; 15 15 grpChoice: TGroupBox; 16 16 radReleaseNow: TRadioButton; … … 20 20 cmdOK: TButton; 21 21 cmdCancel: TButton; 22 Label1: TLabel;23 Label2: TLabel;24 Panel1: TPanel;22 lblUseAdmit: TVA508StaticText; 23 lblUseTransfer: TVA508StaticText; 24 pnlBottom: TPanel; 25 25 fraEvntDelayList: TfraEvntDelayList; 26 26 procedure cmdOKClick(Sender: TObject); … … 170 170 end; 171 171 172 procedure TfrmOrdersTS.cmdOKClick(Sender: TObject); 172 procedure TfrmOrdersTS.cmdOKClick(Sender: TObject); 173 var 174 tempStr: String; 173 175 begin 174 176 inherited; … … 183 185 Exit; 184 186 end; 187 188 tempStr := fraEvntDelayList.mlstEvents.Items.ValueFromIndex[fraEvntDelayList.mlstEvents.ItemIndex]; 189 190 if(fraEvntDelayList.mlstEvents.ItemIndex >= 0) and (Length(Piece(tempStr,'^',2))<1)then 191 begin 192 InfoBox('Invalid release event selected.', 'No Selection Made', MB_OK); 193 Exit; 194 end; 195 185 196 if (fraEvntDelayList.mlstEvents.ItemIndex >= 0) and F1stClick then 186 197 begin -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOrdersUnhold.pas
r829 r1693 47 47 begin 48 48 OriginalID := TOrder(Items[i]).ID; 49 ReleaseOrderHold(TOrder(Items[i])); 49 ReleaseOrderHold(TOrder(Items[i])); 50 TOrder(Items[i]).ActionOn := OriginalID + '=UH'; 51 SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_ACT, Integer(Items[i])); 50 52 end; 51 53 Result := True; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOtherSchedule.dfm
r829 r1693 12 12 OnCreate = FormCreate 13 13 ExplicitWidth = 600 14 ExplicitHeight = 3 8914 ExplicitHeight = 396 15 15 PixelsPerInch = 96 16 16 TextHeight = 13 … … 308 308 object NSScboSchedule: TORComboBox 309 309 Left = 5 310 Top = 1 6310 Top = 19 311 311 Width = 121 312 312 Height = 180 … … 326 326 SynonymChars = '<>' 327 327 TabOrder = 0 328 OnExit = NSScboScheduleExit 329 OnKeyUp = NSScboScheduleKeyUp 328 330 CharsNeedMatch = 1 329 331 UniqueAutoComplete = True -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOtherSchedule.pas
r829 r1693 66 66 procedure btnSchRemoveClick(Sender: TObject); 67 67 procedure FormDestroy(Sender: TObject); 68 procedure NSScboScheduleExit(Sender: TObject); 69 procedure NSScboScheduleKeyUp(Sender: TObject; var Key: Word; 70 Shift: TShiftState); 68 71 private 69 72 FDaySchedule: array [1..7] of string; … … 683 686 end; 684 687 688 procedure TfrmOtherSchedule.NSScboScheduleExit(Sender: TObject); 689 begin 690 inherited; 691 if Pos(CRLF, NSScboSchedule.Text)> 0 then 692 begin 693 NSScboSchedule.Text := ''; 694 NSScboSchedule.ItemIndex := -1; 695 Application.MessageBox('Schedule field cannot contain a control character. Please select a valid unique schedule from the list.' +CRLF + 696 'Or remove the schedule text from the schedule list and select specific times from the administration times list.', 697 'Incorrect Schedule.'); 698 NSScboSchedule.SetFocus; 699 end; 700 if (NSScboSchedule.Text <> '') and (NSScboSchedule.ItemIndex = -1) then 701 begin 702 Application.MessageBox('Please select a valid unique schedule from the list.' +CRLF + 703 'Or remove the schedule text from the schedule list and select specific times from the administration times list.', 704 'Incorrect Schedule.'); 705 NSSCboSchedule.Text := ''; 706 NSScboSchedule.SetFocus; 707 end; 708 709 end; 710 711 procedure TfrmOtherSchedule.NSScboScheduleKeyUp(Sender: TObject; var Key: Word; 712 Shift: TShiftState); 713 begin 714 inherited; 715 if (Key = VK_BACK) and (NSScboSchedule.Text = '') then NSScboSchedule.itemindex:= -1; 716 end; 717 685 718 procedure TfrmOtherSchedule.lstMinuteKeyDown(Sender: TObject; 686 719 var Key: Word; Shift: TShiftState); -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/rODBase.pas
r829 r1693 446 446 procedure PutNewOrder(var AnOrder: TOrder; ConstructOrder: TConstructOrder; OrderSource: string); 447 447 var 448 i : Integer;449 x, y, z: string;448 i, inc, len, numLoop, remain: Integer; 449 ocStr, tmpStr, x, y, z: string; 450 450 begin 451 451 with RPCBrokerV do … … 469 469 Param[6].PType := literal; 470 470 Param[6].Value := AnOrder.EditOf; // null if new order, otherwise ORIFN of original 471 if (ConstructOrder.DGroup = IVDisp) then471 if (ConstructOrder.DGroup = IVDisp) or (ConstructOrder.DialogName = 'PSJI OR PAT FLUID OE') then 472 472 SetupORDIALOG(Param[7], ConstructOrder.ResponseList, True) 473 473 else … … 483 483 y := '"ORCHECK","' + Piece(OCList[i], U, 1) + '","' + Piece(OCList[i], U, 3) + 484 484 '","' + IntToStr(i+1) + '"'; 485 Param[7].Mult[y] := Pieces(OCList[i], U, 2, 4); 485 //Param[7].Mult[y] := Pieces(OCList[i], U, 2, 4); 486 OCStr := Pieces(OCList[i], U, 2, 4); 487 len := Length(OCStr); 488 if len > 255 then 489 begin 490 numLoop := len div 255; 491 remain := len mod 255; 492 inc := 0; 493 while inc <= numLoop do 494 begin 495 tmpStr := Copy(OCStr, 1, 255); 496 OCStr := Copy(OCStr, 256, Length(OcStr)); 497 Param[7].Mult[y + ',' + InttoStr(inc)] := tmpStr; 498 inc := inc +1; 499 end; 500 if remain > 0 then Param[7].Mult[y + ',' + inttoStr(inc)] := OCStr; 501 502 end 503 else 504 Param[7].Mult[y] := OCStr; 486 505 end; 487 506 if ConstructOrder.DelayEvent in ['A','D','T','M','O'] then -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/rODLab.pas
r829 r1693 28 28 procedure GetPatientBloodResultsRaw(Dest: TStrings; PatientID: string; ATests: TStringList); 29 29 function StatAllowed(PatientID: string): boolean; 30 function RemoveCollTimeDefault: boolean; 31 function GetDiagnosticPanelLocation: boolean; 30 32 procedure GetBloodComponents(Dest: TStrings); 33 procedure GetDiagnosticTests(Dest: TStrings); 31 34 function NursAdminSuppress: boolean; 32 35 function GetSubtype(TestName: string): string; … … 54 57 end; 55 58 59 procedure GetDiagnosticTests(Dest: TStrings); 60 begin 61 tCallV(Dest, 'ORWDXVB3 DIAGORD', []); 62 end; 63 56 64 function NursAdminSuppress: boolean; 57 65 begin … … 62 70 begin 63 71 Result := (StrToInt(sCallV('ORWDXVB STATALOW',[PatientID])) > 0); 72 end; 73 74 function RemoveCollTimeDefault: boolean; 75 begin 76 Result := (StrToInt(sCallV('ORWDXVB3 COLLTIM',[nil])) > 0); 77 end; 78 79 function GetDiagnosticPanelLocation: boolean; 80 begin 81 Result := (StrToInt(sCallV('ORWDXVB3 SWPANEL',[nil])) > 0); 64 82 end; 65 83 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/rODMeds.pas
r829 r1693 38 38 procedure LoadDOWSchedules(Dest: TStrings); 39 39 procedure LoadAllIVRoutes(Dest: TStrings); 40 procedure LoadDosageFormIVRoutes(Dest: TStrings; OrderIDs: TStringList; Default: boolean); 40 procedure LoadDosageFormIVRoutes(Dest: TStrings; OrderIDs: TStringList); 41 function GetDefaultAddFreq(OID: integer): string; 41 42 function QtyToDays(Quantity: Double; const UnitsPerDose, Schedule, Duration, Drug: string): Integer; 42 43 function DaysToQty(DaysSupply: Integer; const UnitsPerDose, Schedule, Duration, Drug: string): Integer; … … 204 205 end; 205 206 206 procedure LoadDosageFormIVRoutes(Dest: TStrings; OrderIDs: TStringList ; Default: boolean);207 begin 208 CallV('ORWDPS33 IVDOSFRM', [OrderIDs, Default,False]);207 procedure LoadDosageFormIVRoutes(Dest: TStrings; OrderIDs: TStringList); 208 begin 209 CallV('ORWDPS33 IVDOSFRM', [OrderIDs, False]); 209 210 FastAssign(RPCBrokerV.Results, Dest); 210 211 end; 212 213 function GetDefaultAddFreq(OID: integer): string; 214 begin 215 result := sCallV('ORWDPS33 GETADDFR', [OID]); 216 end; 217 211 218 procedure LoadDOWSchedules(Dest: TStrings); 212 219 begin -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/rODRad.pas
r829 r1693 13 13 function SubsetOfImagingTypes: TStrings; 14 14 function SubsetOfRadSources(SrcType: string): TStrings; 15 function LocationType(Location: integer): string; 15 function LocationType(Location: integer): string; 16 16 function ReasonForStudyCarryOn: Boolean; 17 17 … … 74 74 begin 75 75 Result := sCallV('ORWDRA32 LOCTYPE',[Location]); 76 end; 76 end; 77 77 78 78 function ReasonForStudyCarryOn: Boolean; -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/rOrders.pas
r829 r1693 40 40 EnteredInError: Integer; //AGP Changes 26.12 PSI-04-053 41 41 DCOriginalOrder: boolean; 42 IsOrderPendDC: boolean; 43 IsDelayOrder: boolean; 42 44 procedure Assign(Source: TOrder); 43 45 procedure Clear; … … 312 314 313 315 { Order Checking } 316 function IsMonograph(): Boolean; 317 procedure DeleteMonograph(); 318 procedure GetMonographList(ListOfMonographs: TStringList); 319 procedure GetMonograph(Monograph: TStringList; x: Integer); 320 procedure GetXtraTxt(OCText: TStringList; x: String; y: String); 314 321 function FillerIDForDialog(IEN: Integer): string; 315 322 function OrderChecksEnabled: Boolean; 316 323 function OrderChecksOnDisplay(const FillerID: string): string; 317 324 procedure OrderChecksOnAccept(ListOfChecks: TStringList; const FillerID, StartDtTm: string; 318 OIList: TStringList; DupORIFN: string );325 OIList: TStringList; DupORIFN: string; Renewal: string); 319 326 procedure OrderChecksOnDelay(ListOfChecks: TStringList; const FillerID, StartDtTm: string; 320 327 OIList: TStringList); … … 578 585 579 586 procedure SetOrderFields(AnOrder: TOrder; const x, y, z: string); 580 { 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 581 { Pieces: ~IFN^Grp^ActTm^StrtTm^StopTm^Sts^Sig^Nrs^Clk^PrvID^PrvNam^ActDA^Flag^DCType^ChrtRev^DEA#^VA#^DigSig^IMO^DCOrigOrder }587 { 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 588 { Pieces: ~IFN^Grp^ActTm^StrtTm^StopTm^Sts^Sig^Nrs^Clk^PrvID^PrvNam^ActDA^Flag^DCType^ChrtRev^DEA#^VA#^DigSig^IMO^DCOrigOrder^ISDCOrder^IsDelayOrder} 582 589 begin 583 590 with AnOrder do … … 614 621 if Piece(x,U,20) = '1' then DCOriginalOrder := True 615 622 else DCOriginalOrder := False; 623 if Piece(X,u,21) = '1' then IsOrderPendDC := True 624 else IsOrderPendDC := False; 625 if Piece(x,u,22) = '1' then IsDelayOrder := True 626 else IsDelayOrder := False; 616 627 end; 617 628 end; … … 1250 1261 OrderMenuItem: TOrderMenuItem; 1251 1262 i: Integer; 1263 OrderTitle: String; 1252 1264 begin 1253 1265 CallV('ORWDXM MENU', [AMenuIEN]); … … 1256 1268 // Results[0] = Name^Cols^PathSwitch^^^LRFZX^LRFSAMP^LRFSPEC^LRFDATE^LRFURG^LRFSCH^PSJNPOC^ 1257 1269 // GMRCNOPD^GMRCNOAT^GMRCREAF^^^^^ 1258 AnOrderMenu.Title := Piece(Results[0], U, 1); 1270 OrderTitle := Piece(Results[0], U, 1); 1271 if (Pos('&', OrderTitle) > 0) and 1272 (Copy(OrderTitle, Pos('&', OrderTitle) + 1, 1) <> '&') then 1273 OrderTitle := Copy(OrderTitle, 1, Pos('&', OrderTitle)) + '&' + Copy(OrderTitle, Pos('&', OrderTitle) + 1, Length(OrderTitle)); 1274 1275 AnOrderMenu.Title := OrderTitle; 1259 1276 AnOrderMenu.NumCols := StrToIntDef(Piece(Results[0], U, 2), 1); 1260 1277 AnOrderMenu.KeyVars := Pieces(Results[0], U, 6, 6 + MAX_KEYVARS); … … 2200 2217 begin 2201 2218 Result := sCallV('ORWDXC FILLID', [IEN]); 2219 end; 2220 function IsMonograph(): Boolean; 2221 var ret: string; 2222 begin 2223 ret := CharAt(sCallV('ORCHECK ISMONO', [nil]), 1); 2224 Result := ret = '1'; 2225 end; 2226 2227 procedure GetMonographList(ListOfMonographs: TStringList); 2228 begin 2229 CallV('ORCHECK GETMONOL', []); 2230 FastAssign(RPCBrokerV.Results, ListOfMonographs); 2231 end; 2232 2233 procedure GetMonograph(Monograph: TStringList; x: Integer); 2234 begin 2235 CallV('ORCHECK GETMONO', [x]); 2236 FastAssign(RPCBrokerV.Results, Monograph); 2237 end; 2238 2239 procedure DeleteMonograph(); 2240 begin 2241 CallV('ORCHECK DELMONO', []); 2242 end; 2243 2244 procedure GetXtraTxt(OCText: TStringList; x: String; y: String); 2245 begin 2246 CallV('ORCHECK GETXTRA', [x,y]); 2247 FastAssign(RPCBrokerV.Results, OCText); 2202 2248 end; 2203 2249 … … 2215 2261 2216 2262 procedure OrderChecksOnAccept(ListOfChecks: TStringList; const FillerID, StartDtTm: string; 2217 OIList: TStringList; DupORIFN: string );2263 OIList: TStringList; DupORIFN: string; Renewal: string); 2218 2264 begin 2219 2265 // don't pass OIList if no items, since broker pauses 5 seconds per order 2220 2266 if OIList.Count > 0 2221 then CallV('ORWDXC ACCEPT', [Patient.DFN, FillerID, StartDtTm, Encounter.Location, OIList, DupORIFN ])2267 then CallV('ORWDXC ACCEPT', [Patient.DFN, FillerID, StartDtTm, Encounter.Location, OIList, DupORIFN, Renewal]) 2222 2268 else CallV('ORWDXC ACCEPT', [Patient.DFN, FillerID, StartDtTm, Encounter.Location]); 2223 2269 FastAssign(RPCBrokerV.Results, ListOfChecks); … … 2241 2287 2242 2288 procedure SaveOrderChecksForSession(const AReason: string; ListOfChecks: TStringList); 2243 begin 2244 CallV('ORWDXC SAVECHK', [Patient.DFN, AReason, ListOfChecks]); 2289 var 2290 i, inc, len, numLoop, remain, y: integer; 2291 OCStr, TmpStr: string; 2292 begin 2293 //CallV('ORWDXC SAVECHK', [Patient.DFN, AReason, ListOfChecks]); 2245 2294 { no result used currently } 2295 RPCBrokerV.ClearParameters := True; 2296 RPCBrokerV.RemoteProcedure := 'ORWDXC SAVECHK'; 2297 RPCBrokerV.Param[0].PType := literal; 2298 RPCBrokerV.Param[0].Value := Patient.DFN; //*DFN* 2299 RPCBrokerV.Param[1].PType := literal; 2300 RPCBrokerV.Param[1].Value := AReason; 2301 RPCBrokerV.Param[2].PType := list; 2302 RPCBrokerV.Param[2].Mult['"ORCHECKS"'] := IntToStr(ListOfChecks.count); 2303 for i := 0 to ListOfChecks.Count - 1 do 2304 begin 2305 OCStr := ListofChecks.Strings[i]; 2306 len := Length(OCStr); 2307 if len > 255 then 2308 begin 2309 numLoop := len div 255; 2310 remain := len mod 255; 2311 inc := 0; 2312 while inc <= numLoop do 2313 begin 2314 tmpStr := Copy(OCStr, 1, 255); 2315 OCStr := Copy(OCStr, 256, Length(OcStr)); 2316 RPCBrokerV.Param[2].Mult['"ORCHECKS",' + InttoStr(i) + ',' + InttoStr(inc)] := tmpStr; 2317 inc := inc +1; 2318 end; 2319 if remain > 0 then RPCBrokerV.Param[2].Mult['"ORCHECKS",' + InttoStr(i) + ',' + inttoStr(inc)] := OCStr; 2320 2321 end 2322 else 2323 RPCBrokerV.Param[2].Mult['"ORCHECKS",' + InttoStr(i)] := OCStr; 2324 end; 2325 CallBroker; 2246 2326 end; 2247 2327 -
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/uOrders.pas
r829 r1693 4 4 5 5 uses 6 Windows, Messages, SysUtils, Classes, Controls, Forms, uConst, rOrders, ORFn, 7 Dialogs, ORCtrls, stdCtrls, strUtils, fODBase, fODMedOIFA; 6 Windows, Messages, SysUtils, Classes, Controls, Forms, uConst, rConsults, 7 rOrders, ORFn, Dialogs, ORCtrls, stdCtrls, strUtils, fODBase, fODMedOIFA, 8 VA508AccessibilityRouter; 8 9 9 10 type … … 72 73 function AllowActionOnIMO(AnEvtTyp: char): boolean; 73 74 function IMOActionValidation(AnId: string; var IsIMOOD: boolean; var x: string; AnEventType: char): boolean; 75 function IMOTimeFrame: TFMDateTime; 74 76 75 77 … … 290 292 ((Encounter.Provider > 0) and (not PersonHasKey(Encounter.Provider, 'PROVIDER'))) then 291 293 begin 292 UpdateEncounter(NPF_PROVIDER );294 UpdateEncounter(NPF_PROVIDER, 0, 0, True); 293 295 frmFrame.DisplayEncounterText; 294 296 end; … … 491 493 MedsNVADlgFormID := FormIDForDialog(MedsNVADlgIen); 492 494 MedsIVDlgFormID := FormIDForDialog(MedsIVDlgIen); 495 end; 496 497 function CanCloseDialog(dialog : TfrmODBase) : Boolean; 498 begin 499 if uOrderDialog.FillerID = 'GMRC' then 500 result := fODConsult.CanFreeConsultDialog(dialog) 501 or fODProc.CanFreeProcDialog(dialog); 493 502 end; 494 503 … … 750 759 case AFormID of 751 760 OM_ALLERGY: if ARTPatchInstalled then 752 DialogClass := TfrmARTAllergy 761 begin 762 // DialogClass := TfrmARTAllergy; 763 EnterEditAllergy(0, TRUE, FALSE, AnOwner, ARefNum); 764 Result := True; 765 // uOrderMenu.Close; 766 Exit; 767 end 753 768 else 754 769 begin … … 786 801 TX_EVTDEL_DIET_CONFLICT = 'Have you done either of the above?'; 787 802 TC_EVTDEL_DIET_CONFLICT = 'Possible delayed order conflict'; 803 TX_INACTIVE_SVC = 'This consult service is currently inactive and not receiving requests.' + CRLF + 804 'Please contact your Clinical Coordinator/IRM staff to fix this order.'; 805 TX_INACTIVE_SVC_CAP = 'Inactive Service'; 806 TX_NO_SVC = 'The order or quick order you have selected does not specify a consult service.' + CRLF + 807 'Please contact your Clinical Coordinator/IRM staff to fix this order.'; 808 TC_NO_SVC = 'No service specified'; 788 809 var 789 810 ResolvedDialog: TOrderDialogResolved; … … 796 817 CxMsg: string; 797 818 AButton: TButton; 819 SvcIEN: string; 820 //CsltFrmID: integer; 798 821 begin 799 822 IsPsoSupply := False; … … 807 830 DrugTestDlgType := false; 808 831 //QOAltOI.OI := 0; 832 Application.ProcessMessages; 809 833 // double check environment before continuing with order 810 834 if uOrderDialog <> nil then uOrderDialog.Close; // then x := uOrderDialog.Name else x := ''; … … 859 883 OrderPtEvtID := GetOrderPtEvtID(Copy(AnID, 2, Length(AnID))); 860 884 OrderEvtID := Piece(EventInfo(OrderPtEvtID),'^',2); 885 //CQ 18660 Orders for events should be modal. Orders for non-event should not be modal 886 if AnEvent.EventIFN > 0 then frmOrders.NeedShowModal := true 887 else frmOrders.NeedShowModal := false; 861 888 // evaluate order dialog, build response list & see what form should be presented 862 889 FillChar(ResolvedDialog, SizeOf(ResolvedDialog), #0); … … 967 994 if QuickLevel = QL_REJECT then InfoBox(ShowText, TC_DLG_REJECT, MB_OK); 968 995 if (QuickLevel = QL_VERIFY) and (IsPharmacyOrder or ANeedVerify) then ShowVerifyText(QuickLevel, ShowText, DisplayGroup=InptDisp); 969 if QuickLevel = QL_AUTO then FormID := OD_AUTOACK; 996 if QuickLevel = QL_AUTO then 997 begin 998 //CsltFrmID := FormID; 999 FormID := OD_AUTOACK; 1000 end; 970 1001 if (QuickLevel = QL_REJECT) or (QuickLevel = QL_CANCEL) then Exit; 971 1002 PushKeyVars(ResolvedDialog.QOKeyVars); … … 1046 1077 uOrderDialog.IsSupply := True; 1047 1078 SetupDialog(ORDER_QUICK, ResolvedDialog.ResponseID); 1079 {if ((ResolvedDialog.DisplayGroup = CsltDisp) 1080 and (ResolvedDialog.QuickLevel = QL_AUTO)) then 1081 TfrmODCslt.SetupDialog(ORDER_QUICK, ResolvedDialog.ResponseID);} 1048 1082 end; 1049 1083 end; 1050 1084 1051 1085 if Assigned(uOrderDialog) then 1052 with uOrderDialog do if AbortOrder then 1053 begin 1054 Close; 1055 Exit; 1056 end; 1086 with uOrderDialog do 1087 if AbortOrder and CanCloseDialog(uOrderDialog) then 1088 begin 1089 Close; 1090 if Assigned(uOrderDialog) then 1091 uOrderDialog.Destroy; 1092 Exit; 1093 end; 1057 1094 1058 1095 if CharAt(AnID, 1) = 'T' then … … 1148 1185 if ValidateDrugAutoAccept(tempDrug, tempUnit, tempSch, tempDur, tempOI, StrtoInt(tempSupply), StrtoInt(tempQuantity), StrtoInt(tempRefills)) = false then Exit; 1149 1186 end; 1187 if ((ResolvedDialog.DisplayGroup = CsltDisp) and (ResolvedDialog.QuickLevel = QL_AUTO)) then 1188 begin 1189 with Responses do 1190 begin 1191 Changing := True; 1192 tmpResp := TResponse(FindResponseByName('ORDERABLE',1)); 1193 if tmpResp <> nil then 1194 SvcIEN := GetServiceIEN(tmpResp.IValue) 1195 else 1196 begin 1197 InfoBox(TX_NO_SVC, TC_NO_SVC, MB_ICONERROR or MB_OK); 1198 //AbortOrder := True; 1199 //Close; 1200 Exit; 1201 end; 1202 if SvcIEN = '-1' then 1203 begin 1204 InfoBox(TX_INACTIVE_SVC, TX_INACTIVE_SVC_CAP, MB_OK); 1205 //AbortOrder := True; 1206 //Close; 1207 Exit; 1208 end; 1209 end; 1210 end; 1150 1211 cmdAcceptClick(Application); // auto-accept order 1151 1212 Result := uOrderDialog.AcceptOK; 1213 if (result = true) and (ScreenReaderActive) then 1214 GetScreenReader.Speak('Auto Accept Quick Order '+ Responses.DialogDisplayName + ' placed.'); 1152 1215 1153 1216 //BAPHII 1.3.2 … … 1304 1367 var 1305 1368 InitialCall: Boolean; 1369 i: integer; 1370 str: string; 1306 1371 begin 1307 1372 InitialCall := False; 1373 if ScreenReaderActive then 1374 begin 1375 for i := 0 to AList.Count - 1 do 1376 begin 1377 if Piece(Alist.Strings[i],U,2) = 'Q' then str := str + CRLF + 'Quick Order ' + Piece(Alist.Strings[i],U,3) 1378 else if Piece(Alist.Strings[i],U,2) = 'S' then str := str + CRLF + 'Order Set ' + Piece(Alist.Strings[i],U,3) 1379 else if Piece(Alist.Strings[i],U,2) = 'M' then str := str + CRLF + 'Order Menu ' + Piece(Alist.Strings[i],U,3) 1380 else if Piece(Alist.Strings[i],U,2) = 'A' then str := str + CRLF + 'Order Action ' + Piece(Alist.Strings[i],U,3) 1381 else str := str + CRLF + 'Order Dialog ' + Piece(Alist.Strings[i],U,3); 1382 end; 1383 if infoBox('This order set contains the following items:'+ CRLF + str + CRLF+ CRLF + 'Select the OK button to start this order set.' + 1384 'To stop the order set while it is in process, press Alt +F6 to navigate to the order set dialog, and select the Stop Order Set Button.', 'Starting Order Set' ,MB_OKCANCEL) = IDCANCEL then 1385 begin 1386 Result := False; 1387 exit; 1388 end; 1389 end; 1308 1390 if uOrderSet = nil then 1309 1391 begin … … 1379 1461 { make sure a location and provider are selected before ordering } 1380 1462 if not AuthorizedUser then Exit; 1381 if (not Patient.Inpatient) and (AnEvent.EventIFN > 0 ) then x := '' 1463 //Added to force users without the Provider or ORES key to select an a provider when adding new orders to existing delay orders 1464 if (not Patient.Inpatient) and (AnEvent.EventIFN > 0 ) then 1465 begin 1466 if (User.OrderRole = OR_PHYSICIAN) and (Encounter.Provider = User.DUZ) and (User.IsProvider) then 1467 x := '' 1468 else if not EncounterPresentEDO then Exit; 1469 x := ''; 1470 end 1382 1471 else 1383 1472 begin … … 1842 1931 //else 1843 1932 //Encounter.Location := PrintLoc; 1933 if (PrintLoc = 0) and (Encounter.Location > 0) then PrintLoc := Encounter.Location; 1844 1934 if PrintLoc = 0 1845 1935 then PrintLoc := CommonLocationForOrders(OrderList); 1846 if (PrintLoc = 0) and (Encounter.Location > 0) then PrintLoc := Encounter.Location;1847 1848 1936 if PrintLoc = 0 then // location required for DEVINFO 1849 1937 begin … … 1865 1953 end 1866 1954 else InfoBox(TX_SIGN_LOC, TC_REQ_LOC, MB_OK or MB_ICONWARNING); 1867 (* Encounter.Location := PrintLoc;1868 if Encounter.Location = 01869 then Encounter.Location := CommonLocationForOrders(OrderList);1870 if Encounter.Location = 0 then // location required for DEVINFO1871 begin1872 LookupLocation(ALocation, AName, LOC_ALL, TX_LOC_PRINT);1873 if ALocation > 0 then Encounter.Location := ALocation;1874 end;1875 if printLoc = 0 then frmFrame.DisplayEncounterText;1876 if Encounter.Location <> 0 then1877 begin1878 SetupOrdersPrint(OrderList, DeviceInfo, Nature, False, PrintIt, PrintName);1879 if PrintIt then1880 PrintOrdersOnReview(OrderList, DeviceInfo)1881 else1882 PrintServiceCopies(OrderList);1883 end1884 else InfoBox(TX_SIGN_LOC, TC_REQ_LOC, MB_OK or MB_ICONWARNING); *)1885 1955 end; 1886 1956 … … 1916 1986 result := False; 1917 1987 IsInptDlg := False; 1918 Td := FMToday; 1988 //CQ #15188 - allow IMO functionality 23 hours after encounter date/time - TDP 1989 //Td := FMToday; 1990 Td := IMOTimeFrame; 1919 1991 if ( (DlgID = MedsInDlgIen) or (DlgID = MedsIVDlgIen) or (IsInptQO(dlgId)) or (IsIVQO(dlgId))) then IsInptDlg := TRUE; 1920 1992 IsIMOLocation := IsValidIMOLoc(Encounter.Location,Patient.DFN); … … 1936 2008 else 1937 2009 begin 1938 Td := FMToday; 2010 //CQ #15188 - allow IMO functionality 23 hours after encounter date/time - TDP 2011 //Td := FMToday; 2012 Td := IMOTimeFrame; 1939 2013 if IsValidIMOLoc(Encounter.Location,Patient.DFN) and (Encounter.DateTime > Td) then 1940 2014 Result := True … … 2004 2078 end; 2005 2079 end; 2080 end; 2081 2082 //CQ #15188 - New function to allow IMO functionality 23 hours after encounter date/time - TDP 2083 function IMOTimeFrame: TFMDateTime; 2084 begin 2085 Result := DateTimeToFMDateTime(FMDateTimeToDateTime(FMNow) - (23/24)); 2006 2086 end; 2007 2087
Note:
See TracChangeset
for help on using the changeset viewer.