Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/Orders
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- Location:
- cprs/branches/foia-cprs/CPRS-Chart/Orders
- Files:
-
- 3 added
- 53 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCAccept.dfm
r459 r460 11 11 TextHeight = 13 12 12 object memChecks: TRichEdit 13 Left = 8 14 Top = 8 15 Width = 454 16 Height = 120 13 Left = 0 14 Top = 0 15 Width = 472 16 Height = 136 17 Align = alClient 17 18 ReadOnly = True 18 19 ScrollBars = ssVertical 19 TabOrder = 220 TabOrder = 0 20 21 WantReturns = False 21 22 end 22 object cmdAccept: TButton 23 Left = 148 24 Top = 140 25 Width = 80 26 Height = 21 27 Caption = 'Accept Order' 28 Default = True 29 ModalResult = 6 30 TabOrder = 0 31 end 32 object cmdCancel: TButton 33 Left = 244 34 Top = 140 35 Width = 80 36 Height = 21 37 Cancel = True 38 Caption = 'Cancel Order' 39 ModalResult = 7 23 object pnlBottom: TPanel 24 Left = 0 25 Top = 136 26 Width = 472 27 Height = 33 28 Align = alBottom 29 BevelOuter = bvNone 40 30 TabOrder = 1 31 object cmdAccept: TButton 32 Left = 148 33 Top = 7 34 Width = 80 35 Height = 21 36 Caption = 'Accept Order' 37 Default = True 38 ModalResult = 6 39 TabOrder = 0 40 end 41 object cmdCancel: TButton 42 Left = 244 43 Top = 7 44 Width = 80 45 Height = 21 46 Cancel = True 47 Caption = 'Cancel Order' 48 ModalResult = 7 49 TabOrder = 1 50 end 41 51 end 42 52 end -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCAccept.pas
r459 r460 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, StdCtrls, ComCtrls, ORFn ;7 fAutoSz, StdCtrls, ComCtrls, ORFn, ExtCtrls; 8 8 9 9 type 10 10 TfrmOCAccept = class(TfrmAutoSz) 11 11 memChecks: TRichEdit; 12 pnlBottom: TPanel; 12 13 cmdAccept: TButton; 13 14 cmdCancel: TButton; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCSession.dfm
r459 r460 1 1 inherited frmOCSession: TfrmOCSession 2 Left = 2203 Top = 3922 Left = 365 3 Top = 221 4 4 Width = 504 5 5 Height = 298 … … 7 7 Caption = 'Order Checks' 8 8 Position = poScreenCenter 9 ShowHint = True 10 OnClose = FormClose 11 OnShow = FormShow 9 12 PixelsPerInch = 96 10 13 TextHeight = 13 11 object lblJustify: TLabel 12 Left = 8 13 Top = 195 14 Width = 248 15 Height = 13 16 Caption = 'Enter justification for overriding critical order checks -' 17 end 18 object lstChecks: TListBox 19 Left = 8 20 Top = 8 21 Width = 480 22 Height = 149 14 object lstChecks: TCaptionListBox 15 Left = 0 16 Top = 0 17 Width = 496 18 Height = 160 19 Style = lbOwnerDrawVariable 20 Align = alClient 23 21 ItemHeight = 13 24 22 MultiSelect = True 25 Style = lbOwnerDrawVariable 26 TabOrder = 0 23 ParentShowHint = False 24 ShowHint = True 25 TabOrder = 1 27 26 OnDrawItem = lstChecksDrawItem 28 27 OnMeasureItem = lstChecksMeasureItem 28 HintOnItem = True 29 29 end 30 object txtJustify: TCaptionEdit 31 Left = 8 32 Top = 209 33 Width = 480 34 Height = 21 35 MaxLength = 80 36 TabOrder = 2 37 Caption = 'Enter justification for overriding critical order checks -' 38 end 39 object cmdCancelOrder: TButton 40 Left = 356 41 Top = 162 42 Width = 133 43 Height = 21 44 Caption = 'Cancel Selected Order(s)' 45 TabOrder = 1 46 OnClick = cmdCancelOrderClick 47 end 48 object cmdContinue: TButton 49 Left = 212 50 Top = 242 51 Width = 72 52 Height = 21 53 Caption = 'Continue' 54 TabOrder = 3 55 OnClick = cmdContinueClick 30 object pnlBottom: TPanel 31 Left = 0 32 Top = 160 33 Width = 496 34 Height = 111 35 Align = alBottom 36 BevelOuter = bvNone 37 TabOrder = 0 38 DesignSize = ( 39 496 40 111) 41 object lblJustify: TLabel 42 Left = 8 43 Top = 34 44 Width = 248 45 Height = 13 46 Anchors = [akLeft, akTop, akRight] 47 Caption = 'Enter justification for overriding critical order checks -' 48 end 49 object txtJustify: TCaptionEdit 50 Left = 8 51 Top = 50 52 Width = 480 53 Height = 21 54 Anchors = [akLeft, akTop, akRight] 55 MaxLength = 80 56 TabOrder = 0 57 OnKeyDown = txtJustifyKeyDown 58 Caption = 'Enter justification for overriding critical order checks -' 59 end 60 object cmdCancelOrder: TButton 61 Left = 356 62 Top = 5 63 Width = 133 64 Height = 21 65 Anchors = [akLeft, akTop, akRight] 66 Caption = 'Cancel Selected Order(s)' 67 TabOrder = 2 68 OnClick = cmdCancelOrderClick 69 end 70 object cmdContinue: TButton 71 Left = 212 72 Top = 82 73 Width = 72 74 Height = 21 75 Anchors = [akLeft, akTop, akRight] 76 Caption = 'Continue' 77 TabOrder = 3 78 OnClick = cmdContinueClick 79 end 56 80 end 57 81 end -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCSession.pas
r459 r460 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, StdCtrls, ORFn, uConst, ORCtrls ;7 fAutoSz, StdCtrls, ORFn, uConst, ORCtrls, ExtCtrls; 8 8 9 9 type 10 10 TfrmOCSession = class(TfrmAutoSz) 11 lstChecks: TListBox; 11 lstChecks: TCaptionListBox; 12 pnlBottom: TPanel; 13 lblJustify: TLabel; 12 14 txtJustify: TCaptionEdit; 13 lblJustify: TLabel;14 15 cmdCancelOrder: TButton; 15 16 cmdContinue: TButton; … … 20 21 procedure lstChecksDrawItem(Control: TWinControl; Index: Integer; 21 22 Rect: TRect; State: TOwnerDrawState); 23 procedure FormClose(Sender: TObject; var Action: TCloseAction); 24 procedure FormShow(Sender: TObject); 25 procedure FormResize(Sender: TObject); 26 procedure txtJustifyKeyDown(Sender: TObject; var Key: Word; 27 Shift: TShiftState); 22 28 private 23 29 FCritical: Boolean; … … 36 42 {$R *.DFM} 37 43 38 uses rOrders, uCore ;44 uses rOrders, uCore, rMisc; 39 45 40 46 type … … 49 55 var 50 56 uCheckedOrders: TList; 57 FOldHintHidePause: integer; 51 58 52 59 constructor TOCRec.Create(const AnID: string); … … 54 61 OrderID := AnID; 55 62 Checks := TStringList.Create; 63 FOldHintHidePause := Application.HintHidePause; 56 64 end; 57 65 58 66 destructor TOCRec.Destroy; 59 67 begin 68 Application.HintHidePause := FOldHintHidePause; 60 69 Checks.Free; 61 70 inherited Destroy; … … 141 150 frmOCSession.SetReqJustify; 142 151 MessageBeep(MB_ICONASTERISK); 152 if frmOCSession.Visible then frmOCSession.SetFocus; 143 153 frmOCSession.ShowModal; 144 154 finally … … 166 176 lblJustify.Visible := FCritical; 167 177 txtJustify.Visible := FCritical; 168 end; 169 170 procedure TfrmOCSession.lstChecksMeasureItem(Control: TWinControl; Index: Integer; 171 178 179 end; 180 181 procedure TfrmOCSession.lstChecksMeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); 172 182 var 173 183 i, AHt, TotalHt: Integer; … … 177 187 begin 178 188 inherited; 189 179 190 with lstChecks do 180 begin 181 if Index >= uCheckedOrders.Count then Exit; 182 OCRec := TOCRec(uCheckedOrders.Items[Index]); 183 ARect := ItemRect(Index); 184 ARect.Left := ARect.Left + 2; 185 AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect, 186 DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK) + 2; 187 TotalHt := AHt; 188 for i := 0 to OCRec.Checks.Count - 1 do 189 begin 190 ARect := ItemRect(Index); 191 ARect.Left := ARect.Left + 10; 192 x := Piece(OCRec.Checks[i], U, 3); 193 AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, 194 DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK); 195 TotalHt := TotalHt + AHt; 196 end; 197 end; 191 begin 192 if Index >= uCheckedOrders.Count then Exit; 193 OCRec := TOCRec(uCheckedOrders.Items[Index]); 194 ARect := ItemRect(Index); 195 ARect.Left := ARect.Left + 2; 196 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 197 TotalHt := AHt; 198 199 for i := 0 to OCRec.Checks.Count - 1 do 200 begin 201 ARect := ItemRect(Index); 202 ARect.Left := ARect.Left + 10; 203 x := Piece(OCRec.Checks[i], U, 3); 204 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 205 TotalHt := TotalHt + AHt; 206 end; 207 end; 198 208 Height := TotalHt + 2; // add 2 for focus rectangle 199 end; 200 201 procedure TfrmOCSession.lstChecksDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; 202 209 if Height > 255 then Height := 255; //CQ7178 210 end; 211 212 procedure TfrmOCSession.lstChecksDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); 203 213 var 204 214 i, AHt: Integer; … … 208 218 begin 209 219 inherited; 220 210 221 with lstChecks do 211 begin 212 if Index >= uCheckedOrders.Count then Exit; 213 OCRec := TOCRec(uCheckedOrders.Items[Index]); 214 ARect := ItemRect(Index); 215 AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect, 216 DT_LEFT or DT_NOPREFIX or DT_WORDBREAK) + 2; 217 ARect.Left := ARect.Left + 10; 218 ARect.Top := ARect.Top + AHt; 219 for i := 0 to OCRec.Checks.Count - 1 do 220 begin 221 x := Piece(OCRec.Checks[i], U, 3); 222 if not (odSelected in State) then 223 begin 224 if (Piece(OCRec.Checks[i], U, 2) = '1') 225 then 222 begin 223 if Index >= uCheckedOrders.Count then Exit; 224 OCRec := TOCRec(uCheckedOrders.Items[Index]); 225 ARect := ItemRect(Index); 226 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 227 ARect.Left := ARect.Left + 10; 228 ARect.Top := ARect.Top + AHt; 229 for i := 0 to OCRec.Checks.Count - 1 do 226 230 begin 227 if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then 228 Canvas.Font.Color := clBlue; 229 Canvas.Font.Style := [fsUnderline]; 230 end 231 else Canvas.Font.Color := clWindowText; 232 end; 233 AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, 234 DT_LEFT or DT_NOPREFIX or DT_WORDBREAK); 235 ARect.Top := ARect.Top + AHt; 236 end; 237 end; 231 x := Piece(OCRec.Checks[i], U, 3); 232 if not (odSelected in State) then 233 begin 234 if (Piece(OCRec.Checks[i], U, 2) = '1') then 235 begin 236 if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then 237 Canvas.Font.Color := clBlue; 238 Canvas.Font.Style := [fsUnderline]; 239 end 240 else Canvas.Font.Color := clWindowText; 241 end; 242 AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING); //CQ7178: added DT_EXTERNALLEADING 243 ARect.Top := ARect.Top + AHt; 244 end; 245 end; 246 238 247 end; 239 248 … … 268 277 if FCritical and ((Length(txtJustify.Text) < 2) or not ContainsVisibleChar(txtJustify.Text)) then 269 278 begin 270 InfoBox('A justification for overriding critical order checks is required.',279 InfoBox('A justification for overriding critical order checks is required.', 271 280 'Justification Required', MB_OK); 272 281 Exit; … … 278 287 end; 279 288 289 procedure TfrmOCSession.FormClose(Sender: TObject; 290 var Action: TCloseAction); 291 begin 292 inherited; 293 SaveUserBounds(Self); //Save Position & Size of Form 294 end; 295 296 procedure TfrmOCSession.FormShow(Sender: TObject); 297 begin 298 inherited; 299 SetFormPosition(Self); //Get Saved Position & Size of Form 300 end; 301 302 303 procedure TfrmOCSession.FormResize(Sender: TObject); 304 begin 305 //TfrmAutoSz has defect must call inherited Resize for the resize to function. 306 inherited; 307 end; 308 309 procedure TfrmOCSession.txtJustifyKeyDown(Sender: TObject; var Key: Word; 310 Shift: TShiftState); 311 begin 312 inherited; 313 //GE CQ9540 activate Return key, behave as "Continue" buttom clicked. 314 if Key = VK_RETURN then cmdContinueClick(self); 315 end; 316 280 317 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODAllgy.dfm
r459 r460 184 184 TabOrder = 3 185 185 OnChange = ControlChange 186 CharsNeedMatch = 1 186 187 end 187 188 object grpObsHist: TRadioGroup … … 260 261 OnChange = ControlChange 261 262 OnNeedData = cboOriginatorNeedData 263 CharsNeedMatch = 1 262 264 end 263 265 object cboSymptoms: TORComboBox … … 285 287 OnMouseClick = cboSymptomsMouseClick 286 288 OnNeedData = cboSymptomsNeedData 289 CharsNeedMatch = 1 287 290 end 288 291 object btnCurrent: TButton … … 328 331 TabOrder = 11 329 332 OnChange = ControlChange 333 CharsNeedMatch = 1 330 334 end 331 335 object btnRemove: TButton -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODAllgy.pas
r459 r460 496 496 497 497 procedure TfrmODAllergy.cboSymptomsMouseClick(Sender: TObject); 498 var 499 x: string; 498 500 begin 499 501 inherited; … … 501 503 Changing := True; 502 504 if lstSelectedSymptoms.SelectByID(cboSymptoms.ItemID) > -1 then exit; 505 with cboSymptoms do 506 if Piece(Items[ItemIndex], U, 3) <> '' then 507 x := ItemID + U + Piece(Items[ItemIndex], U, 3) 508 else 509 x := ItemID + U + Piece(Items[ItemIndex], U, 2); 503 510 with lstSelectedSymptoms do 504 511 begin 505 Items.Add( cboSymptoms.Items[cboSymptoms.ItemIndex]);512 Items.Add(x); 506 513 SelectByID(cboSymptoms.ItemID); 507 514 end; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODAuto.pas
r459 r460 24 24 25 25 uses rODBase, rOrders, fTemplateDialog, uTemplateFields, rTemplates, uConst, uTemplates, 26 rConsults ;26 rConsults, uCore, uODBase; 27 27 28 28 procedure TfrmODAuto.InitDialog; … … 38 38 LType: TTemplateLinkType; 39 39 IEN: integer; 40 HasObjects: boolean; 40 41 41 42 begin … … 44 45 LType := DisplayGroupToLinkType(Responses.DisplayGroup); 45 46 tmp := Responses.EValueFor('COMMENT', 1); 47 ExpandOrderObjects(tmp, HasObjects); 48 Responses.OrderContainsObjects := Responses.OrderContainsObjects or HasObjects; 46 49 if (LType <> ltNone) or HasTemplateField(tmp) then 47 50 begin … … 56 59 else 57 60 CheckBoilerplate4Fields(tmp, cptn); 58 61 59 62 if tmp <> '' then 60 63 Responses.Update('COMMENT', 1, TX_WPTYPE, tmp) -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODBase.dfm
r459 r460 4 4 Width = 528 5 5 Height = 275 6 HorzScrollBar.Range = 500 7 HorzScrollBar.Tracking = True 8 HorzScrollBar.Visible = True 9 VertScrollBar.Range = 225 10 VertScrollBar.Visible = True 11 AutoScroll = False 6 12 BorderIcons = [biSystemMenu] 7 13 Caption = '' -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODBase.pas
r459 r460 62 62 FLogTime: TFMDateTime; 63 63 FViewName: string; 64 FCancel: boolean; 65 FOrderContainsObjects: boolean; 64 66 function FindResponseByIEN(APromptIEN, AnInstance: Integer): TResponse; 65 67 function GetOrderText: string; … … 83 85 function GetIENForPrompt(const APromptID: string): Integer; 84 86 function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; 87 function PromptExists(const APromptID: string):boolean; 85 88 function InstanceCount(const APromptID: string): Integer; 86 89 function IValueFor(const APromptID: string; AnInstance: Integer): string; … … 96 99 const AnIValue, AnEValue: string); 97 100 property Dialog: string read FDialog write SetDialog; 98 property DisplayGroup: Integer read FDisplayGroup ;101 property DisplayGroup: Integer read FDisplayGroup write FDisplayGroup; 99 102 property CopyOrder: string read FCopyOrder write SetCopyOrder; 100 103 property EditOrder: string read FEditOrder; // write SetEditOrder; … … 110 113 property VarTrailing: string read FVarTrailing write FVarTrailing; 111 114 property TheList: TList read FResponseList write FResponseList; 115 property Cancel: boolean read FCancel write FCancel; 116 property OrderContainsObjects: boolean read FOrderContainsObjects write FOrderContainsObjects; 112 117 end; 113 118 … … 241 246 uses fOCAccept, uODBase, rCore, rMisc, fODMessage, 242 247 fTemplateDialog, uEventHooks, uTemplates, rConsults,fOrders,uOrders, 243 fFrame, uTemplateFields ;248 fFrame, uTemplateFields, fClinicWardMeds; 244 249 245 250 const … … 583 588 procedure TResponses.SetCopyOrder(const AnID: string); 584 589 { sets responses to the values for an order that is created by copying } 590 var 591 HasObjects: boolean; 585 592 begin 586 593 if AnID = '' then … … 590 597 end; 591 598 Clear; 592 LoadResponses(FResponseList, AnID ); // Example AnID=C123456;1-3604599 LoadResponses(FResponseList, AnID, HasObjects); // Example AnID=C123456;1-3604 593 600 FCopyOrder := Copy(Piece(AnID, '-', 1), 2, Length(AnID)); 601 FOrderContainsObjects := HasObjects; 594 602 end; 595 603 596 604 procedure TResponses.SetEditOrder(const AnID: string); 597 605 { sets responses to the values for an order that is about to be edited } 606 var 607 HasObjects: boolean; 598 608 begin 599 609 Clear; 600 LoadResponses(FResponseList, AnID ); // Example AnID=X123456;1610 LoadResponses(FResponseList, AnID, HasObjects); // Example AnID=X123456;1 601 611 FEditOrder := Copy(Piece(AnID, '-', 1), 2, Length(AnID)); 612 FOrderContainsObjects := HasObjects; 602 613 end; 603 614 604 615 procedure TResponses.SetQuickOrder(AnIEN: Integer); 605 616 { sets responses to a quick order value - this is used by the QuickOrder property} 617 var 618 HasObjects: boolean; 606 619 begin 607 620 Clear; 608 LoadResponses(FResponseList, IntToStr(AnIEN) ); // Example AnIEN=134621 LoadResponses(FResponseList, IntToStr(AnIEN), HasObjects); // Example AnIEN=134 609 622 FQuickOrder := AnIEN; 623 FOrderContainsObjects := HasObjects; 610 624 end; 611 625 612 626 procedure TResponses.SetQuickOrderByID(const AnID: string); 613 627 { sets responses to a quick order value } 628 var 629 HasObjects: boolean; 614 630 begin 615 631 Clear; 616 LoadResponses(FResponseList, AnID ); // Example AnID=134-3645632 LoadResponses(FResponseList, AnID, HasObjects); // Example AnID=134-3645 617 633 FQuickOrder := StrToIntDef(Piece(AnID, '-', 1), 0); // 2nd '-' piece is $H seconds 634 FOrderContainsObjects := HasObjects; 618 635 end; 619 636 … … 671 688 break; 672 689 end; 690 end; 691 692 function TResponses.PromptExists(const APromptID: string): boolean; 693 var 694 i: Integer; 695 begin 696 Result := False; 697 with FPrompts do for i := 0 to Count - 1 do with TPrompt(Items[i]) do 698 if (ID = APromptID) then Result := True; 673 699 end; 674 700 … … 958 984 APtEvtPtr: string; 959 985 begin 986 //IMOLoc := 0; 960 987 NewPtEvtPtr := 0; 961 988 QOUDGroup := False; … … 984 1011 if IsIMODialog then 985 1012 DGroup := ClinDisp; 1013 //AGP Change 26.35, 26.41 8518 added text order 1014 //AGP Change 26.55 remove IMO functionality for inpatient 1015 (*if (Patient.Inpatient = true) and (IsValidIMOLoc(encounter.Location,Patient.DFN)=true) and 1016 ((ConstructOrder.DialogName = 'PSJ OR PAT OE') or (ConstructOrder.DialogName = 'PSJI OR PAT FLUID OE') or 1017 (ConstructOrder.DialogName = 'OR GXTEXT WORD PROCESSING ORDE')) and 1018 ((FEditOrder = '') and (Self.FEventName = '') and (Self.FCopyOrder = '')) then 1019 begin 1020 if frmClinicWardMeds.ClinicOrWardLocation(Encounter.location) = Encounter.Location then 1021 begin 1022 ConstructOrder.IsIMODialog := True; 1023 ConstructOrder.DGroup := ClinDisp; 1024 end 1025 else IMOLoc := Patient.Location; 1026 end; *) 1027 //AGP Change 26.51, change logic to set text orders to IMO for outpatients at an outpatient location. 1028 //AGP Text orders are only treated as IMO if the order display group is a nursing display group 1029 if (Patient.Inpatient = False) and (IsValidIMOLoc(encounter.Location,Patient.DFN)=true) and 1030 (((pos('OR GXTEXT WORD PROCESSING ORDE',ConstructOrder.DialogName)>0) and (ConstructOrder.DGroup = NurDisp)) or 1031 ((ConstructOrder.DialogName = 'OR GXMISC GENERAL') and (ConstructOrder.DGroup = NurDisp)) or 1032 ((ConstructOrder.DialogName = 'OR GXTEXT TEXT ONLY ORDER') and (ConstructOrder.DGroup = NurDisp))) and //AGP Change CQ #10757 1033 ((FEditOrder = '') and (Self.FEventName = '') and (Self.FCopyOrder = '')) then 1034 begin 1035 ConstructOrder.IsIMODialog := True; 1036 ConstructOrder.DGroup := ClinDisp; 1037 end; 986 1038 IsEventDefaultOR := EventDefaultOD; 987 1039 if IsUDGroup or QOUDGroup then … … 1003 1055 APtEvtPtr := IntToStr(EventExist(Patient.DFN, FEventIFN)); 1004 1056 PTEventPtr := APtEvtPtr; 1057 //PutNewOrder(AnOrder, ConstructOrder, OrderSource, IMOLoc); 1005 1058 PutNewOrder(AnOrder, ConstructOrder, OrderSource); 1006 1059 if not SaveAsCurrent then … … 1012 1065 else 1013 1066 begin 1067 //PutNewOrder(AnOrder, ConstructOrder, OrderSource, IMOLoc); 1014 1068 PutNewOrder(AnOrder, ConstructOrder, OrderSource); 1015 1069 if not SaveAsCurrent then … … 1064 1118 AResponse: TResponse; 1065 1119 IEN: integer; 1120 HasObjects: boolean; 1066 1121 1067 1122 procedure AssignBPText(List: TStrings; const Value: string); … … 1080 1135 else IEN := 0; 1081 1136 end; 1137 ExpandOrderObjects(tmp, HasObjects); 1138 FOrderContainsObjects := FOrderContainsObjects or HasObjects; 1082 1139 if IEN <> 0 then 1083 1140 begin … … 1091 1148 else 1092 1149 CheckBoilerplate4Fields(tmp, cptn); 1093 1094 1150 List.Text := tmp; 1095 1151 end; … … 1326 1382 if (Encounter.Provider = 0) or (PersonHasKey(Encounter.Provider, 'PROVIDER') = False) 1327 1383 then AnErrMsg := TX_NO_PROVIDER; 1384 if IsPFSSActive and Responses.PromptExists('VISITSTR') then 1385 Responses.Update('VISITSTR', 1, Encounter.VisitStr, Encounter.VisitStr); 1328 1386 end; 1329 1387 … … 1432 1490 if not AcceptOrderChecks then 1433 1491 begin 1492 if AskAnotherOrder(DialogIEN) then 1493 InitDialog // ClearDialogControls is in InitDialog 1494 else 1495 begin 1496 ClearDialogControls; // to allow form to close without prompting to save order 1497 Close; 1498 end; 1434 1499 Result := False; 1435 1500 Exit; … … 1497 1562 CIDCOkToSave := False; 1498 1563 alreadyClosed := False; 1564 self.Responses.Cancel := False; 1499 1565 if frmOrders <> nil then 1500 1566 begin … … 1589 1655 begin 1590 1656 inherited; 1657 //self.Responses.Cancel := False; 1591 1658 if User.NoOrdering then Exit; 1592 1659 if FAbortOrder then exit; … … 1726 1793 end; 1727 1794 1795 1728 1796 end. 1729 1797 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODDiet.dfm
r459 r460 1 1 inherited frmODDiet: TfrmODDiet 2 Left = 404 3 Top = 199 2 Left = 541 3 Top = 398 4 Width = 532 5 Height = 291 4 6 Caption = 'Diet Order' 5 7 OnKeyDown = FormKeyDown … … 9 11 Left = 0 10 12 Top = 0 11 Width = 52 012 Height = 1 8613 Width = 524 14 Height = 194 13 15 ActivePage = pgeOutPt 14 16 Align = alTop … … 86 88 OnMouseClick = cboDietAvailMouseClick 87 89 OnNeedData = cboDietAvailNeedData 90 CharsNeedMatch = 1 88 91 end 89 92 object lstDietSelect: TORListBox … … 165 168 TabOrder = 6 166 169 OnChange = DietChange 170 CharsNeedMatch = 1 167 171 end 168 172 object chkCancelTubefeeding: TCheckBox … … 195 199 end 196 200 object lblOPDietAvail: TLabel 197 Left = 127198 Top = 0201 Left = 0 202 Top = 1 199 203 Width = 70 200 204 Height = 13 … … 203 207 object lblOPComment: TLabel 204 208 Left = 4 205 Top = 1 17209 Top = 128 206 210 Width = 92 207 211 Height = 13 … … 216 220 end 217 221 object lblOPSelect: TLabel 218 Left = 127219 Top = 3 8222 Left = 0 223 Top = 39 220 224 Width = 64 221 225 Height = 13 … … 223 227 end 224 228 object grpOPMeal: TKeyClickRadioGroup 225 Left = 5226 Top = 5229 Left = 168 230 Top = 11 227 231 Width = 110 228 232 Height = 107 … … 234 238 'Evening' 235 239 '<none selected>') 236 TabOrder = 0240 TabOrder = 3 237 241 TabStop = True 238 242 OnClick = grpOPMealClick … … 242 246 Top = 5 243 247 Width = 93 244 Height = 1 49248 Height = 155 245 249 Caption = 'Days of Week' 246 250 TabOrder = 8 … … 334 338 end 335 339 object cboOPDietAvail: TORComboBox 336 Left = 127337 Top = 1 5340 Left = 0 341 Top = 16 338 342 Width = 157 339 343 Height = 21 … … 341 345 AutoSelect = True 342 346 Caption = 'Available Diet Components' 343 Color = clWindow344 DropDownCount = 8345 ItemHeight = 13346 ItemTipColor = clWindow347 ItemTipEnable = True348 ListItemsOnly = True349 LongList = True350 LookupPiece = 0351 MaxLength = 0352 Pieces = '2'353 Sorted = False354 SynonymChars = '<>'355 TabOrder = 1356 OnExit = cboDietAvailExit357 OnMouseClick = cboOPDietAvailMouseClick358 OnNeedData = cboOPDietAvailNeedData359 end360 object txtOPDietComment: TCaptionEdit361 Left = 4362 Top = 131363 Width = 404364 Height = 21365 MaxLength = 80366 TabOrder = 11367 OnChange = OPChange368 Caption = 'Special Instructions'369 end370 object cboOPDelivery: TORComboBox371 Left = 292372 Top = 86373 Width = 120374 Height = 21375 Style = orcsDropDown376 AutoSelect = True377 Caption = 'Delivery'378 347 Color = clWindow 379 348 DropDownCount = 8 … … 388 357 Sorted = False 389 358 SynonymChars = '<>' 390 TabOrder = 9 359 TabOrder = 0 360 OnExit = cboDietAvailExit 361 OnKeyDown = cboOPDietAvailKeyDown 362 OnMouseClick = cboOPDietAvailMouseClick 363 CharsNeedMatch = 1 364 end 365 object txtOPDietComment: TCaptionEdit 366 Left = 3 367 Top = 143 368 Width = 404 369 Height = 21 370 MaxLength = 80 371 TabOrder = 11 391 372 OnChange = OPChange 373 Caption = 'Special Instructions' 374 end 375 object cboOPDelivery: TORComboBox 376 Left = 292 377 Top = 86 378 Width = 120 379 Height = 21 380 Style = orcsDropDown 381 AutoSelect = True 382 Caption = 'Delivery' 383 Color = clWindow 384 DropDownCount = 8 385 ItemHeight = 13 386 ItemTipColor = clWindow 387 ItemTipEnable = True 388 ListItemsOnly = True 389 LongList = False 390 LookupPiece = 0 391 MaxLength = 0 392 Pieces = '2' 393 Sorted = False 394 SynonymChars = '<>' 395 TabOrder = 6 396 OnChange = OPChange 397 CharsNeedMatch = 1 392 398 end 393 399 object lstOPDietSelect: TORListBox 394 Left = 127395 Top = 5 2400 Left = 0 401 Top = 53 396 402 Width = 156 397 403 Height = 56 … … 399 405 ParentShowHint = False 400 406 ShowHint = True 401 TabOrder = 2407 TabOrder = 1 402 408 Caption = 'Selected Diet Components' 403 409 ItemTipColor = clWindow 404 410 LongList = False 405 411 Pieces = '2' 412 OnChange = OPChange 406 413 end 407 414 object cmdOPRemove: TButton 408 Left = 212409 Top = 1 09415 Left = 85 416 Top = 110 410 417 Width = 72 411 418 Height = 17 412 419 Caption = 'Remove' 413 TabOrder = 3420 TabOrder = 2 414 421 OnClick = cmdOPRemoveClick 415 422 end … … 421 428 Caption = 'Cancel Tubefeeding' 422 429 State = cbGrayed 423 TabOrder = 10430 TabOrder = 7 424 431 Visible = False 425 OnClick = DietChange432 OnClick = OPChange 426 433 end 427 434 end … … 469 476 Height = 13 470 477 Caption = 'Amount' 478 end 479 object lblOPTFStart: TLabel 480 Left = 341 481 Top = 90 482 Width = 51 483 Height = 13 484 Caption = 'Start Date:' 471 485 end 472 486 object cboProduct: TORComboBox … … 493 507 OnExit = cboProductExit 494 508 OnMouseClick = cboProductMouseClick 509 CharsNeedMatch = 1 495 510 end 496 511 object txtTFComment: TCaptionEdit 497 Left = 4512 Left = 6 498 513 Top = 133 499 514 Width = 504 500 515 Height = 21 501 516 MaxLength = 240 502 TabOrder = 6517 TabOrder = 8 503 518 OnChange = TFChange 504 519 Caption = 'Special Instructions' … … 542 557 object txtQuantity: TCaptionEdit 543 558 Tag = -1 544 Left = 340545 Top = 1 08559 Left = 151 560 Top = 124 546 561 Width = 93 547 562 Height = 19 548 563 Hint = 549 'Enter quantity as 2000 K, 100 CC/HOUR, 8 OZ/TID, etc; total quan' +550 'tity may not exceed 5000 cc.'564 'Enter quantity as 2000 K, 100 ML/HOUR, 8 OZ/TID, etc; total quan' + 565 'tity may not exceed 5000ml.' 551 566 Ctl3D = False 552 567 ParentCtl3D = False … … 563 578 object cboStrength: TCaptionComboBox 564 579 Tag = -1 565 Left = 444566 Top = 1 08580 Left = 252 581 Top = 124 567 582 Width = 53 568 583 Height = 21 … … 583 598 'FULL') 584 599 Caption = 'Strength' 600 end 601 object calOPTFStart: TORDateBox 602 Left = 341 603 Top = 104 604 Width = 169 605 Height = 21 606 TabStop = False 607 TabOrder = 7 608 Visible = False 609 OnChange = TFChange 610 DateOnly = False 611 RequireTime = False 612 Caption = 'Start Date:' 613 end 614 object cboOPTFRecurringMeals: TORComboBox 615 Left = 342 616 Top = 105 617 Width = 160 618 Height = 21 619 Style = orcsDropDown 620 AutoSelect = True 621 Color = clWindow 622 DropDownCount = 8 623 ItemHeight = 13 624 ItemTipColor = clWindow 625 ItemTipEnable = True 626 ListItemsOnly = False 627 LongList = False 628 LookupPiece = 0 629 MaxLength = 0 630 Pieces = '2,3' 631 Sorted = False 632 SynonymChars = '<>' 633 TabPositions = '12' 634 TabOrder = 6 635 TabStop = True 636 OnChange = TFChange 637 CharsNeedMatch = 1 585 638 end 586 639 end … … 705 758 Width = 120 706 759 Height = 21 707 TabOrder = 3760 TabOrder = 4 708 761 OnChange = calELStopChange 709 762 DateOnly = True … … 717 770 Height = 152 718 771 Caption = 'Days of Week' 719 TabOrder = 4772 TabOrder = 5 720 773 object chkMonday: TCheckBox 721 774 Left = 8 … … 788 841 Height = 17 789 842 Caption = 'Bagged Meal' 790 TabOrder = 5843 TabOrder = 6 791 844 OnClick = ELChange 845 end 846 object cboOPELRecurringMeals: TORComboBox 847 Left = 287 848 Top = 15 849 Width = 121 850 Height = 21 851 Style = orcsDropDown 852 AutoSelect = True 853 Color = clWindow 854 DropDownCount = 8 855 ItemHeight = 13 856 ItemTipColor = clWindow 857 ItemTipEnable = True 858 ListItemsOnly = False 859 LongList = False 860 LookupPiece = 0 861 MaxLength = 0 862 Pieces = '2,3' 863 Sorted = False 864 SynonymChars = '<>' 865 TabPositions = '12' 866 TabOrder = 3 867 TabStop = True 868 OnChange = ELChange 869 CharsNeedMatch = 1 792 870 end 793 871 end … … 861 939 Caption = 'Enter Additional Diet Order' 862 940 end 941 object lblOPAOStart: TLabel 942 Left = 6 943 Top = 72 944 Width = 51 945 Height = 13 946 Caption = 'Start Date:' 947 end 863 948 object txtAOComment: TCaptionEdit 864 949 Left = 4 … … 867 952 Height = 21 868 953 MaxLength = 80 869 TabOrder = 0954 TabOrder = 1 870 955 OnChange = AOChange 871 956 Caption = 'Enter Additional Diet Order' 872 957 end 958 object calOPAOStart: TORDateBox 959 Left = 54 960 Top = 88 961 Width = 169 962 Height = 21 963 TabStop = False 964 TabOrder = 4 965 Visible = False 966 OnChange = AOChange 967 DateOnly = False 968 RequireTime = False 969 Caption = 'Start Date:' 970 end 971 object cboOPAORecurringMeals: TORComboBox 972 Left = 6 973 Top = 88 974 Width = 168 975 Height = 21 976 Style = orcsDropDown 977 AutoSelect = True 978 Color = clWindow 979 DropDownCount = 8 980 ItemHeight = 13 981 ItemTipColor = clWindow 982 ItemTipEnable = True 983 ListItemsOnly = False 984 LongList = False 985 LookupPiece = 0 986 MaxLength = 0 987 Pieces = '2,3' 988 Sorted = False 989 SynonymChars = '<>' 990 TabPositions = '12' 991 TabOrder = 2 992 TabStop = True 993 OnChange = AOChange 994 CharsNeedMatch = 1 995 end 873 996 end 874 997 end 998 inherited memOrder: TCaptionMemo 999 Top = 208 1000 end 875 1001 inherited cmdAccept: TButton 1002 Left = 445 1003 Top = 208 876 1004 TabOrder = 2 877 1005 end 878 1006 inherited cmdQuit: TButton 1007 Left = 445 1008 Top = 235 879 1009 TabOrder = 3 880 1010 end 881 1011 inherited pnlMessage: TPanel 882 Top = 1 721012 Top = 197 883 1013 Height = 57 884 1014 TabOrder = 1 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODDiet.pas
r459 r460 96 96 cmdOPRemove: TButton; 97 97 chkOPCancelTubefeeding: TCheckBox; 98 calOPTFStart: TORDateBox; 99 lblOPTFStart: TLabel; 100 lblOPAOStart: TLabel; 101 calOPAOStart: TORDateBox; 102 cboOPAORecurringMeals: TORComboBox; 103 cboOPTFRecurringMeals: TORComboBox; 104 cboOPELRecurringMeals: TORComboBox; 98 105 procedure nbkDietChanging(Sender: TObject; 99 106 var AllowChange: Boolean); … … 137 144 procedure FormKeyDown(Sender: TObject; var Key: Word; 138 145 Shift: TShiftState); 139 // Outpatient meal additions140 procedure cboOPDietAvailNeedData(Sender: TObject;141 const StartFrom: String; Direction, InsertAt: Integer);142 146 procedure cboOPDietAvailMouseClick(Sender: TObject); 143 147 procedure cboOPDietAvailExit(Sender: TObject); … … 149 153 procedure grpOPMealClick(Sender: TObject); 150 154 procedure cmdOPRemoveClick(Sender: TObject); 155 procedure cboOPDietAvailKeyDown(Sender: TObject; var Key: Word; 156 Shift: TShiftState); 151 157 private 152 158 FNextCol: Integer; … … 177 183 function TFStrengthCode(const x: string): Integer; 178 184 // Outpatient meal additions 185 function FMDOW(AnFMDate: TFMDateTime): integer; 186 function FMDays(AStart, AEnd: TFMDateTime): string; 179 187 function GetOPDaysOfWeek: string; 180 procedure SetEnableOPDOW(AllowUse: Boolean );188 procedure SetEnableOPDOW(AllowUse: Boolean; OneTimeDay: integer; DaysToCheck: string = ''); 181 189 procedure ResetControlsOP; 182 190 procedure SetValuesFromResponsesOP; … … 184 192 procedure OPDietCheckForNPO; 185 193 procedure OPDietCheckForTF; 194 function PatientHasRecurringMeals(var MealList: TStringList; MealType: string = ''): boolean; 186 195 protected 187 196 procedure InitDialog; override; … … 195 204 uDialogName: string; 196 205 uFHAUTH: boolean; 206 uRecurringMealList: TStringList; 197 207 198 208 implementation … … 200 210 {$R *.DFM} 201 211 202 uses uCore, rODBase, rODDiet, rCore, rOrders, fODDietLT, uAccessibleStringGrid ;212 uses uCore, rODBase, rODDiet, rCore, rOrders, fODDietLT, uAccessibleStringGrid, DateUtils; 203 213 204 214 const … … 209 219 TX_DIET_PRC = 'This diet conflicts with '; 210 220 TC_DIET_ERR = 'Unable to Add Diet'; 211 TX_INPT_ONLY = 'Diets may be entered for inpatients only.'; 212 //TX_INPT_ONLY = 'This type of diet may be entered for inpatients only.'; 221 TX_INPT_ONLY = 'This type of diet may be entered for inpatients only.'; 213 222 TC_INPT_ONLY = 'Ordering Restriction'; 214 223 TX_CANCEL_TF = 'Cancel the current tubefeeding order?' + CRLF + CRLF; … … 221 230 TX_TFQTY = 'A quantity must be entered for '; 222 231 TX_TFAMT = 'The quantity is invalid for '; 223 TX_TF5000 = 'The total quantity ordered may not exceed 5000 cc.';232 TX_TF5000 = 'The total quantity ordered may not exceed 5000ml.'; 224 233 TX_HLPQTY = CRLF + 'The following may be entered for quantity:' + CRLF + 225 ' Units may be K for Kcals, C for cc''s, O for oz. or U for units (e.g. cans).' + CRLF +234 ' Units may be K for Kcals, C for cc''s, M for ml, O for oz. or U for units (e.g. cans).' + CRLF + 226 235 ' Frequency may be DAY, HOUR, QD, QH, BID, TID, QID, Q2H, Q3H, Q4H, or Q6H.' + CRLF + 227 236 ' May also input 100CC/HR X 16 for 16 hours. Valid quantity for powder form' + CRLF + … … 242 251 TX_AONONE = 'Text for additional order has not been entered.'; 243 252 TX_ACCEPT = 'Accept the following order?' + CRLF + CRLF; 253 TX_CONTINUE = 'Continue editing the following order?' + CRLF + CRLF; 254 TX_DISCARD = CRLF + CRLF + 'Answering NO will discard all changes.'; 244 255 TC_ACCEPT = 'Unsaved Order'; 245 256 TX_EL_SAVE_ERR = 'An error occurred while saving this late tray order.'; … … 274 285 'coordinator enters times for E/L trays for this location.'; 275 286 TC_NO_PARAMS = 'Unable to Order Early/Late Tray'; 287 TX_NOSTART = 'A valid start date must be entered.'; 288 TC_NOSTART = 'Start date required'; 289 TX_NOT_THIS_LOC = 'This location has not been configured to' + CRLF + 290 'allow ordering of meals for outpatients.' + CRLF + CRLF + 291 'Please contact your IRM diet package coordinator.'; 292 TC_NOT_THIS_LOC = 'Unable to order from this location'; 293 TX_NO_OUTPT_ORDERS = 'Diet orders may only be entered for inpatients.'; 294 TC_NO_OUTPT_ORDERS = 'Ordering Restriction'; 295 TX_NO_MEALS_DEFINED = 'No diet types have been defined to be orderable for outpatients.' + CRLF + CRLF + 296 'Please contact your IRM diet package coordinator.'; 297 TC_NO_MEALS_DEFINED = 'Unable to order outpatient meals'; 298 299 FMDayLetters: array[1..7] of string[1] = ('M', 'T', 'W', 'R', 'F', 'S', 'X'); 276 300 277 301 type … … 290 314 begin 291 315 inherited; 316 AbortOrder := False; 317 uRecurringMealList := TStringList.Create; 292 318 if OrderForInpatient then 293 319 begin … … 302 328 else // this block will go away after FH patch installed everywhere 303 329 begin 304 InfoBox(TX_ INPT_ONLY, TC_INPT_ONLY, MB_OK);305 Close;330 InfoBox(TX_NO_OUTPT_ORDERS, TC_NO_OUTPT_ORDERS, MB_OK); 331 AbortOrder := True; 306 332 Exit; 307 333 end; … … 313 339 if StrToIntDef(ALocation, 0) < 1 then 314 340 ALocation := IntToStr(Encounter.Location); 315 LoadDietParams(uDietParams, ALocation); 316 if pgeOutPt.TabVisible then 317 with uDietParams, cboOPDelivery do 318 begin 319 if Tray then Items.Add('T^Tray'); 320 if Cafeteria then Items.Add('C^Cafeteria'); 321 if DiningRm then Items.Add('D^Dining Room'); 322 //if Bagged then Items.Add('B^Bagged'); // ???? 323 ItemIndex := 0; 324 chkBagged.Visible := uDietParams.Bagged; // ???? 341 if (not OrderForInpatient) and OutpatientPatchInstalled and (not OutpatientLocationConfigured(ALocation)) then 342 begin 343 InfoBox(TX_NOT_THIS_LOC, TC_NOT_THIS_LOC, MB_OK or MB_ICONINFORMATION); 344 AbortOrder := True; 325 345 end 326 346 else 327 with uDietParams, cboDelivery do 328 begin 329 if Tray then Items.Add('T^Tray'); 330 if Cafeteria then Items.Add('C^Cafeteria'); 331 if DiningRm then Items.Add('D^Dining Room'); 332 ItemIndex := 0; 333 chkBagged.Visible := uDietParams.Bagged; 347 begin 348 LoadDietParams(uDietParams, ALocation); 349 if pgeOutPt.TabVisible then 350 with uDietParams, cboOPDelivery do 351 begin 352 if Tray then Items.Add('T^Tray'); 353 if Cafeteria then Items.Add('C^Cafeteria'); 354 if DiningRm then Items.Add('D^Dining Room'); 355 ItemIndex := 0; 356 chkBagged.Visible := uDietParams.Bagged; 357 end 358 else 359 with uDietParams, cboDelivery do 360 begin 361 if Tray then Items.Add('T^Tray'); 362 if Cafeteria then Items.Add('C^Cafeteria'); 363 if DiningRm then Items.Add('D^Dining Room'); 364 ItemIndex := 0; 365 chkBagged.Visible := uDietParams.Bagged; 366 end; 334 367 end; 335 368 TAccessibleStringGrid.WrapControl(grdSelected); … … 340 373 TAccessibleStringGrid.UnwrapControl(grdSelected); 341 374 TFClearGrid; 375 uRecurringMealList.Free; 342 376 inherited; 343 377 end; … … 350 384 ColWidths[1] := Canvas.TextWidth('XFULLX') + GetSystemMetrics(SM_CXVSCROLL); 351 385 ColWidths[2] := Canvas.TextWidth('100 GRAMS/HOUR X 24'); 352 ColWidths[3] := Canvas.TextWidth('55000 cc');386 ColWidths[3] := Canvas.TextWidth('55000ml'); 353 387 ColWidths[0] := ClientWidth - ColWidths[1] - ColWidths[2] - ColWidths[3] - 3; 354 388 lblTFStrength.Left := Left + ColWidths[0] + 3; … … 368 402 procedure TfrmODDiet.SetupDialog(OrderAction: Integer; const ID: string); 369 403 begin 404 if AbortOrder then exit; 370 405 inherited; 371 406 uDialogName := ExternalName(DialogIEN, 101.41); … … 396 431 end; 397 432 'T': begin 433 if (not OrderForInpatient) and (not PatientHasRecurringMeals(uRecurringMealList)) then 434 begin 435 Close; 436 Exit; 437 end; 398 438 nbkDiet.ActivePage := pgeTubefeeding; 399 439 nbkDietChange(Self); … … 401 441 end; 402 442 'E': begin 443 if (not OrderForInpatient) and (not PatientHasRecurringMeals(uRecurringMealList)) then 444 begin 445 Close; 446 Exit; 447 end; 403 448 nbkDiet.ActivePage := pgeEarlyLate; 404 449 nbkDietChange(Self); … … 411 456 end; 412 457 'A': begin 458 if (not OrderForInpatient) and (not PatientHasRecurringMeals(uRecurringMealList)) then 459 begin 460 Close; 461 Exit; 462 end; 413 463 nbkDiet.ActivePage := pgeAdditional; 414 464 nbkDietChange(Self); … … 442 492 nbkDietChange(Self); 443 493 if OrderAction <> ORDER_NEW then SetValuesFromResponsesDO; 494 ActiveControl := cboOPDietAvail; 444 495 end; 445 496 end; … … 517 568 end; 518 569 if Sum > 5000 then SetError(TX_TF5000); 570 if not OrderForInpatient then 571 if not calOPTFStart.IsValid then SetError(TX_BAD_START); 519 572 end; 520 573 if nbkDiet.ActivePage = pgeEarlyLate then 521 574 begin 522 575 if grpMeal.ItemIndex = 3 then SetError(TX_ELMEAL); 523 if GetMealTime = '' then SetError(TX_ELTIME);524 576 if not calELStart.IsValid then SetError(TX_ELNOSTART); 525 if not calELStop.IsValid then SetError(TX_ELNOSTOP);526 577 if calELStart.FMDateTime < FMToday then SetError(TX_ELSTARTLT); 527 if calELStop.FMDateTime < FMToday then SetError(TX_ELSTOPLT);528 if calELStop.FMDateTime < calELStart.FMDateTime then SetError(TX_ELSTOPSTART);529 578 if calELStart.FMDateTime > FMDateTimeOffsetBy(FMToday, 30) then SetError(TX_ELSTART30); 530 if calELStop.FMDateTime > FMDateTimeOffsetBy(FMToday, 30) then SetError(TX_ELSTOP30); 579 if OrderForInpatient then 580 begin 581 if GetMealTime = '' then SetError(TX_ELTIME); 582 if not calELStop.IsValid then SetError(TX_ELNOSTOP); 583 if calELStop.FMDateTime < FMToday then SetError(TX_ELSTOPLT); 584 if calELStop.FMDateTime < calELStart.FMDateTime then SetError(TX_ELSTOPSTART); 585 if calELStop.FMDateTime > FMDateTimeOffsetBy(FMToday, 30) then SetError(TX_ELSTOP30); 586 end; 531 587 if grpDOW.Enabled and (GetDaysOfWeek = '') then SetError(TX_ELDOW); 532 588 if MealTimePassed then SetError(TX_ELPAST); … … 539 595 begin 540 596 if not ContainsVisibleChar(txtAOComment.Text) then SetError(TX_AONONE); 541 end; 542 { TODO -oRich V. -cOutpatient Meals : Add any required Outpatient Meals validation code here } 597 if not OrderForInpatient then 598 if not calOPAOStart.IsValid then SetError(TX_BAD_START); 599 end; 543 600 if nbkDiet.ActivePage = pgeOutPt then 544 601 begin … … 580 637 FTabChanging := True; 581 638 if Length(memOrder.Text) > 0 then 582 if InfoBox(TX_ACCEPT + memOrder.Text, TC_ACCEPT, MB_YESNO) = ID_YES then 583 begin 584 cmdAcceptClick(Self); 585 AllowChange := AcceptOK; 586 end else 587 begin 588 memOrder.Text := ''; 589 memOrder.Lines.Clear; 590 Responses.Clear; 639 begin 640 if nbkDiet.ActivePage = pgeOutpt then 641 begin 642 if InfoBox(TX_CONTINUE + memOrder.Text + TX_DISCARD, TC_ACCEPT, MB_YESNO) = ID_YES then 643 begin 644 AllowChange := FALSE; 645 end else 646 begin 647 memOrder.Text := ''; 648 memOrder.Lines.Clear; 649 Responses.Clear; 650 end; 651 end 652 else 653 begin 654 if InfoBox(TX_ACCEPT + memOrder.Text, TC_ACCEPT, MB_YESNO) = ID_YES then 655 begin 656 cmdAcceptClick(Self); 657 AllowChange := AcceptOK; 658 end else 659 begin 660 memOrder.Text := ''; 661 memOrder.Lines.Clear; 662 Responses.Clear; 663 end; 664 end 591 665 end; 592 666 FTabChanging := False; … … 594 668 595 669 procedure TfrmODDiet.nbkDietChange(Sender: TObject); 670 var 671 x, CxMsg: string ; 672 i: integer; 673 AStringList: TStringList; 674 const 675 // TX_CX_CUR = 'A new diet order will CANCEL and REPLACE this current diet:' + CRLF + CRLF; 676 TX_CX_CUR = 'A new diet order will CANCEL and REPLACE this current diet now unless' + CRLF + 677 'you specify a start date for when the new diet should replace the current' + CRLF + 678 'diet:' + CRLF + CRLF; 679 TX_CX_FUT = 'A new diet order with no expiration date will CANCEL and REPLACE these diets:' + CRLF + CRLF; 596 680 begin 597 681 inherited; 598 682 // much of the logic here can be eliminated if ClearDialogControls starts clearing containers 683 if AbortOrder then 684 begin 685 cmdQuitClick(Self); 686 exit; 687 end; 599 688 StatusText('Loading Dialog Definition'); 600 689 if Sender <> Self then Responses.Clear; … … 603 692 begin 604 693 AllowQuickOrder := True; 605 OrderMessage(CurrentDietText); 694 x := CurrentDietText; 695 if Piece(x, #13, 1) <> 'Current Diet: ' then 696 begin 697 AStringList := TStringList.Create; 698 try 699 AStringList.Text := x; 700 CxMsg := TX_CX_CUR + #9 + Piece(AStringList[0], ':', 1) + ':' + CRLF + CRLF 701 + #9 + Copy(AStringList[0], 16, 99) + CRLF; 702 if AStringList.Count > 1 then 703 begin 704 CxMsg := CxMsg + CRLF + CRLF + 705 TX_CX_FUT + #9 + Piece(AStringList[1], ':', 1) + ':' + CRLF + CRLF 706 + #9 + Copy(AStringList[1], 22, 99) + CRLF; 707 if AStringList.Count > 2 then 708 for i := 2 to AStringList.Count - 1 do 709 CxMsg := CxMsg + #9 + TrimLeft(AStringList[i]) + CRLF; 710 end; 711 finally 712 AStringList.Free; 713 end; 714 end; 715 if CxMsg <> '' then 716 begin 717 if InfoBox(CxMsg + CRLF + 718 'Are you sure?', 'Confirm', MB_ICONWARNING or MB_YESNO) = ID_NO then 719 begin 720 AbortOrder := True; 721 cmdQuitClick(Self); 722 exit; 723 end; 724 end; 725 OrderMessage(x); 606 726 Responses.Dialog := 'FHW1'; // Diet Order 607 727 DisplayGroup := DisplayGroupForDialog('FHW1'); … … 615 735 if nbkDiet.ActivePage = pgeTubefeeding then 616 736 begin 617 { TODO -oRich V. -cOutpatient Meals : Prompt for which recurring meal(s) to apply this order against }618 737 if not OrderForInpatient then 619 738 begin 620 // get list of existing OP recurring meals 621 // if none, then exit with message 622 // if some, display and allow selection of multiple dates/times 623 // set different dialog/display group? 624 end; 739 if not PatientHasRecurringMeals(uRecurringMealList) then 740 begin 741 Changing := False; 742 nbkDiet.ActivePage := pgeOutPt; 743 nbkDietChange(nbkDiet); 744 Exit; 745 end 746 else 747 cboOPTFRecurringMeals.Items.Assign(uRecurringMealList); 748 end; 749 cboOPTFRecurringMeals.Visible := not OrderForInpatient; 750 calOPTFStart.Visible := False; 751 lblOPTFStart.Visible := not OrderForInpatient; 625 752 AllowQuickOrder := True; 626 753 if Length(uDietParams.CurTF) > 0 … … 644 771 if nbkDiet.ActivePage = pgeEarlyLate then 645 772 begin 646 { TODO -oRich V. -cOutpatient Meals : Prompt for which recurring meal to apply this order against }647 773 if not OrderForInpatient then 648 begin 649 // get list of existing OP recurring meals 650 // if none, then exit with message 651 // if some, display and allow selection of one and only one 652 // set different dialog/display group? 653 end 774 begin 775 if not PatientHasRecurringMeals(uRecurringMealList) then 776 begin 777 Changing := False; 778 nbkDiet.ActivePage := pgeOutPt; 779 nbkDietChange(nbkDiet); 780 Exit; 781 end 782 else 783 cboOPELRecurringMeals.Items.Assign(uRecurringMealList); 784 end 654 785 else if (StrToIntDef(uDietParams.EarlyIEN, 0) = 0) or (StrToIntDef(uDietParams.LateIEN, 0) = 0) then 655 begin 656 InfoBox(TX_NO_PARAMS, TC_NO_PARAMS, MB_ICONERROR or MB_OK); 657 if pgeEarlyLate <> nil then 658 nbkDiet.SelectNextPage(False); 659 Exit; 660 end; 786 begin 787 InfoBox(TX_NO_PARAMS, TC_NO_PARAMS, MB_ICONERROR or MB_OK); 788 if pgeEarlyLate <> nil then 789 nbkDiet.SelectNextPage(False); 790 Changing := False; 791 Exit; 792 end; 793 cboOPELRecurringMeals.Visible := not OrderForInpatient; 794 cboOPELRecurringMeals.TabStop := not OrderForInpatient; 795 calELStart.Visible := OrderForInpatient; 796 calELStart.TabStop := OrderForInpatient; 797 calELStop.Visible := OrderForInpatient; 798 lblELStop.Visible := OrderForInpatient; 799 grpDOW.Visible := OrderForInpatient; 800 grpDOW.Enabled := OrderForInpatient; 661 801 AllowQuickOrder := False; 662 802 OrderMessage(''); … … 678 818 if nbkDiet.ActivePage = pgeAdditional then 679 819 begin 680 { TODO -oRich V. -cOutpatient Meals : Prompt for which recurring meal(s) to apply this order against } 681 if not OrderForInpatient then 682 begin 683 // get list of existing OP recurring meals 684 // if none, then exit with message 685 // if some, display and allow selection of multiple dates/times 686 // set different dialog/display group? 687 end; 820 if not OrderForInpatient then 821 begin 822 if not PatientHasRecurringMeals(uRecurringMealList) then 823 begin 824 Changing := False; 825 nbkDiet.ActivePage := pgeOutPt; 826 nbkDietChange(nbkDiet); 827 Exit; 828 end 829 else 830 cboOPAORecurringMeals.Items.Assign(uRecurringMealList); 831 end; 832 cboOPAORecurringMeals.Visible := not OrderForInpatient; 833 calOPAOStart.Visible := False; //not OrderForInpatient; 834 lblOPAOStart.Visible := not OrderForInpatient; 688 835 AllowQuickOrder := False; 689 836 OrderMessage(''); … … 694 841 if nbkDiet.ActivePage = pgeOutPt then 695 842 begin 696 OrderMessage(CurrentDietText); 843 x := CurrentDietText; 844 if Length(Piece(x, #$D, 1)) > Length('Current Diet: ') then 845 OrderMessage(x) 846 else 847 OrderMessage(''); 848 if (uDialogName <> 'FHW SPECIAL MEAL') and (uDialogName <> 'FHW OP MEAL') then 849 uDialogName := 'FHW OP MEAL'; 697 850 Responses.Dialog := uDialogName; 698 851 DisplayGroup := DisplayGroupForDialog(uDialogName); 699 if uDialogName = 'FHW OP MEAL' then // Recurring meal 700 begin 701 AllowQuickOrder := True; 702 ResetControlsOP; 703 LoadDietQuickList(cboOPDietAvail.Items, 'MEAL'); // use D.G. short name here 704 cboOPDietAvail.InsertSeparator; 705 cboOPDietAvail.InitLongList(''); 706 { TODO -oRich V. -cOutpatient Meals : Need to DC Tubefeeding order for OP meals? } 707 chkOPCancelTubefeeding.State := cbGrayed; 708 chkOPCancelTubefeeding.Visible := False; 709 grpOPMeal.Caption := 'Recurring Meal'; 710 SetEnableOPDOW(False); 711 end 712 else if uDialogName = 'FHW SPECIAL MEAL' then // Special meal 852 if uDialogName = 'FHW SPECIAL MEAL' then // Special meal 713 853 begin 714 854 AllowQuickOrder := False; 715 855 ResetControlsOP; 716 cboOPDietAvail.I nitLongList('');856 cboOPDietAvail.Items.AddStrings(SubsetOfOPDiets); 717 857 { TODO -oRich V. -cOutpatient Meals : Need to DC Tubefeeding order for OP meals? } 718 858 chkOPCancelTubefeeding.State := cbGrayed; … … 723 863 pgeAdditional.TabVisible := False; 724 864 pgeEarlyLate.TabVisible := False; 725 cboOPDietAvail.SelectByIEN(uDietParams. RegIEN);865 cboOPDietAvail.SelectByIEN(uDietParams.OPDefaultDiet); 726 866 cboOPDietAvailMouseClick(Self); 867 Changing := False; 868 end 869 else if uDialogName = 'FHW OP MEAL' then // Recurring meal 870 begin 871 AllowQuickOrder := True; 872 ResetControlsOP; 873 LoadDietQuickList(cboOPDietAvail.Items, 'MEAL'); // use D.G. short name here 874 cboOPDietAvail.InsertSeparator; 875 cboOPDietAvail.Items.AddStrings(SubsetOfOPDiets); 876 cboOPDietAvail.SelectByIEN(uDietParams.OPDefaultDiet); 877 { TODO -oRich V. -cOutpatient Meals : Need to DC Tubefeeding order for OP meals? } 878 chkOPCancelTubefeeding.State := cbGrayed; 879 chkOPCancelTubefeeding.Visible := False; 880 grpOPMeal.Caption := 'Recurring Meal'; 881 SetEnableOPDOW(False, -1); 882 cboOPDietAvailMouseClick(Self); 883 Changing := False; 727 884 end; 728 885 end; … … 802 959 InfoBox(Piece(ADiet,'^',2), TC_DIET_ERR, MB_OK); 803 960 cboDietAvail.ItemIndex := -1; 961 Changing := False; 804 962 Exit; 805 963 end; … … 935 1093 TFClearGrid; 936 1094 chkCancelTrays.Checked := False; 1095 calOPTFStart.Text := ''; 937 1096 txtTFComment.Text := ''; 938 1097 end; … … 973 1132 AResponse := FindResponseByName('CANCEL', 1); 974 1133 if AResponse <> nil then chkCancelTrays.Checked := AResponse.IValue = '1'; 1134 if not OrderForInpatient then 1135 begin 1136 SetControl(cboOPTFRecurringMeals, 'DATETIME', 1); 1137 SetControl(calOPTFStart, 'DATETIME', 1); 1138 end; 975 1139 SetControl(txtTFComment, 'COMMENT', 1); 976 1140 end; … … 1114 1278 begin 1115 1279 grdSelected.Cells[2, ARow] := Piece(x, U, 2); 1116 grdSelected.Cells[3, ARow] := Piece(x, U, 1) + ' cc';1280 grdSelected.Cells[3, ARow] := Piece(x, U, 1) + 'ml'; 1117 1281 end 1118 1282 else grdSelected.Cells[3, ARow] := ''; … … 1268 1432 then Responses.Update('CANCEL', 1, '1', 'Yes') 1269 1433 else Responses.Update('CANCEL', 1, '0', 'No'); 1434 if not OrderForInpatient then 1435 begin 1436 calOPTFStart.FMDateTime := StrToFloatDef(cboOPTFRecurringMeals.ItemID, 0); 1437 Responses.Update('DATETIME', 1, FloatToStr(calOPTFStart.FMDateTime), calOPTFStart.Text); 1438 end; 1270 1439 memOrder.Text := Responses.OrderText; 1271 1440 end; … … 1323 1492 if radLT3.Caption = AResponse.IValue then radLT3.Checked := True; 1324 1493 end; 1325 SetControl(calELStart, 'START', 1); 1326 SetControl(calELStop, 'STOP', 1); 1494 if not OrderForInpatient then 1495 SetControl(cboOPELRecurringMeals, 'START', 1) 1496 else 1497 begin 1498 SetControl(calELStart, 'START', 1); 1499 SetControl(calELStop, 'STOP', 1); 1500 end; 1327 1501 calELStopChange(Self); 1328 1502 AResponse := FindResponseByName('SCHEDULE', 1); … … 1403 1577 lblNoTimes.Visible := not HasTimes; 1404 1578 end; 1405 1406 begin 1407 inherited; 1579 var 1580 AMeal: string; 1581 begin 1582 inherited; 1583 Changing := True; 1408 1584 case grpMeal.ItemIndex of 1409 0: SetMealTimes(uDietParams.BTimes); 1410 1: SetMealTimes(uDietParams.NTimes); 1411 2: SetMealTimes(uDietParams.ETimes); 1412 else SetMealTimes(''); 1413 end; 1585 0: begin 1586 SetMealTimes(uDietParams.BTimes); 1587 AMeal := 'B'; 1588 end; 1589 1: begin 1590 SetMealTimes(uDietParams.NTimes); 1591 AMeal := 'N'; 1592 end; 1593 2: begin 1594 SetMealTimes(uDietParams.ETimes); 1595 AMeal := 'E'; 1596 end; 1597 else 1598 begin 1599 SetMealTimes(''); 1600 AMeal := ''; 1601 end; 1602 end; 1603 if not OrderForInpatient then 1604 begin 1605 if AMeal = '' then 1606 begin 1607 uRecurringMealList.Clear; 1608 cboOPELRecurringMeals.Clear; 1609 end 1610 else if not PatientHasRecurringMeals(uRecurringMealList, AMeal) then 1611 begin 1612 uRecurringMealList.Clear; 1613 cboOPELRecurringMeals.Clear; 1614 grpMeal.ItemIndex := 3; 1615 end 1616 else 1617 cboOPELRecurringMeals.Items.Assign(uRecurringMealList); 1618 end; 1619 Changing := False; 1620 ELChange(grpMeal); 1414 1621 end; 1415 1622 … … 1445 1652 begin 1446 1653 inherited; 1447 if (Length(calELStop.Text) > 0) and (calELStop.Text = calELStart.Text) 1654 if not OrderForInpatient then SetEnableDOW(False) 1655 else if (Length(calELStop.Text) > 0) and (calELStop.Text = calELStart.Text) 1448 1656 then SetEnableDOW(False) 1449 1657 else SetEnableDOW(True); … … 1478 1686 then Responses.Update('ORDERABLE', 1, uDietParams.EarlyIEN, 'EARLY TRAY') 1479 1687 else Responses.Update('ORDERABLE', 1, uDietParams.LateIEN, 'LATE TRAY'); 1688 end; 1689 if not OrderForInpatient then 1690 begin 1691 calELStart.FMDateTime := StrToFloatDef(cboOPELRecurringMeals.ItemID, 0); 1692 calELStop.FMDateTime := calELStart.FMDateTime; 1480 1693 end; 1481 1694 with calELStart do if Length(Text) > 0 then Responses.Update('START', 1, Text, Text); … … 1525 1738 begin 1526 1739 txtAOComment.Text := ''; 1740 calOPAOStart.Text := ''; 1527 1741 end; 1528 1742 … … 1532 1746 ResetControlsAO; 1533 1747 Responses.SetControl(txtAOComment, 'COMMENT', 1); 1748 //Responses.SetControl(calOPAOStart, 'DATETIME', 1); 1749 Responses.SetControl(cboOPAORecurringMeals, 'DATETIME', 1); 1534 1750 Changing := False; 1535 1751 AOChange(Self); … … 1542 1758 with txtAOComment do if Text <> '' 1543 1759 then Responses.Update('COMMENT', 1, Text, Text); 1760 if not OrderForInpatient then 1761 begin 1762 calOPAOStart.FMDateTime := StrToFloatDef(cboOPAORecurringMeals.ItemID, 0); 1763 Responses.Update('DATETIME', 1, FloatToStr(calOPAOStart.FMDateTime), calOPAOStart.Text); 1764 end; 1544 1765 memOrder.Text := Responses.OrderText; 1545 1766 end; 1546 1767 1768 1547 1769 { Outpatient Meals Order tab ----------------------------------------------------------------- } 1548 1549 procedure TfrmODDiet.cboOPDietAvailNeedData(Sender: TObject; const StartFrom: string;1550 Direction, InsertAt: Integer);1551 begin1552 inherited;1553 cboOPDietAvail.ForDataUse(SubsetOfOPDiets(StartFrom, Direction));1554 end;1555 1770 1556 1771 procedure TfrmODDiet.cboOPDietAvailMouseClick(Sender: TObject); … … 1566 1781 begin 1567 1782 inherited; 1783 if cboOPDietAvail.Items.Count = 0 then 1784 begin 1785 InfoBox(TX_NO_MEALS_DEFINED, TC_NO_MEALS_DEFINED, MB_OK or MB_ICONINFORMATION); 1786 AbortOrder := True; 1787 exit; 1788 end ; 1568 1789 if CharAt(cboOPDietAvail.ItemID, 1) = 'Q' then // setup quick order 1569 1790 begin … … 1592 1813 OPChange(Sender); 1593 1814 end; {if cboOPDietAvail} 1815 OPChange(Sender); 1594 1816 cboOPDietAvail.ItemIndex := -1; 1595 OPChange(Sender);1596 1817 end; 1597 1818 … … 1643 1864 procedure TfrmODDiet.SetValuesFromResponsesOP; 1644 1865 var 1645 //AnInstance: Integer;1646 1866 AResponse: TResponse; 1647 1867 ADiet: string; … … 1651 1871 with Responses do 1652 1872 begin 1653 (* AnInstance := NextInstance('ORDERABLE', 0);1654 while AnInstance > 0 do1655 begin1656 AResponse := FindResponseByName('ORDERABLE', AnInstance);1657 if AResponse <> nil then1658 begin1659 ADiet := DietAttributes(StrToIntDef(AResponse.IValue,0));1660 if Piece(ADiet,'^',1)='0' then1661 begin1662 InfoBox(Piece(ADiet,'^',2), TC_OP_DIET_ERR, MB_OK);1663 cboOPDietAvail.ItemIndex := -1;1664 Exit;1665 end;1666 lstOPDietSelect.Items.Add(ADiet);1667 end;1668 AnInstance := NextInstance('ORDERABLE', AnInstance);1669 end; {while AnInstance - ORDERABLE}*)1670 1671 1873 AResponse := FindResponseByName('ORDERABLE', 1); 1672 1874 if AResponse <> nil then … … 1677 1879 InfoBox(Piece(ADiet,'^',2), TC_OP_DIET_ERR, MB_OK); 1678 1880 cboOPDietAvail.ItemIndex := -1; 1881 Changing := False; 1679 1882 Exit; 1680 1883 end; … … 1721 1924 begin 1722 1925 inherited; 1926 if Changing then exit; 1723 1927 if FChangeStop then 1724 1928 calOPStop.Text := calOPStart.Text … … 1727 1931 end; 1728 1932 1933 function TfrmODDiet.FMDOW(AnFMDate: TFMDateTime): integer; 1934 var 1935 WinDate: TDateTime; 1936 x: integer; 1937 begin 1938 WinDate := FMDateTimeToDateTime(AnFMDate); 1939 x := DayOfTheWeek(WinDate); 1940 Result := x; 1941 end; 1942 1943 function TfrmODDiet.FMDays(AStart, AEnd: TFMDateTime): string; 1944 var 1945 AWinStart, AWinEnd: TDateTime; 1946 i: double; 1947 Days: string; 1948 begin 1949 AWinStart := FMDateTimeToDateTime(AStart); 1950 AWinEnd := FMDateTimeToDateTime(AEnd); 1951 i := AWinStart; 1952 repeat 1953 Days := Days + FMDayLetters[DayOfTheWeek(i)]; 1954 i := i + 1; 1955 until i > AWinEnd; 1956 Result := Days; 1957 end; 1958 1729 1959 procedure TfrmODDiet.calOPStartExit(Sender: TObject); 1730 begin 1731 inherited; 1732 if (Length(calOPStop.Text) > 0) and (calOPStop.Text = calOPStart.Text) 1733 then SetEnableOPDOW(False) 1734 else SetEnableOPDOW(True); 1960 var 1961 Days: string; 1962 begin 1963 inherited; 1964 if not (calOPStart.FMDateTime > 0) then 1965 begin 1966 SetEnableOPDOW(False, -1); 1967 Exit ; 1968 end; 1969 if (Length(calOPStop.Text) > 0) and (calOPStop.Text = calOPStart.Text) then 1970 SetEnableOPDOW(False, FMDOW(calOPStart.FMDateTime)) 1971 else 1972 begin 1973 Days := FMDays(calOPStart.FMDateTime, calOPStop.FMDateTime); 1974 SetEnableOPDOW(True, -1, Days); 1975 end; 1735 1976 end; 1736 1977 1737 1978 procedure TfrmODDiet.calOPStopChange(Sender: TObject); 1738 begin 1739 inherited; 1740 if (Length(calOPStop.Text) > 0) and (calOPStop.FMDateTime = calOPStart.FMDateTime) 1741 then SetEnableOPDOW(False) 1742 else SetEnableOPDOW(True); 1979 var 1980 Days: string; 1981 begin 1982 inherited; 1983 if Changing then exit; 1984 if not (calOPStop.FMDateTime > 0) then 1985 begin 1986 SetEnableOPDOW(False, -1); 1987 Exit ; 1988 end; 1989 if (Length(calOPStop.Text) > 0) and (calOPStop.FMDateTime = calOPStart.FMDateTime) then 1990 SetEnableOPDOW(False, FMDOW(calOPStart.FMDateTime)) 1991 else 1992 begin 1993 Days := FMDays(calOPStart.FMDateTime, calOPStop.FMDateTime); 1994 SetEnableOPDOW(True, -1, Days); 1995 end; 1743 1996 OPChange(Sender); 1744 1997 end; … … 1752 2005 if Changing then Exit; 1753 2006 if Sender <> Self then Responses.Clear; // Sender=Self when called from SetupDialog 1754 // Per NFS, only one selection allowed from any of 5 available OP diets2007 // Per NFS, only one selection allowed from any of 10-15 available OP diets 1755 2008 with lstOPDietSelect do if Items.Count > 0 then 1756 2009 Responses.Update('ORDERABLE', 1, Piece(Items[0], U, 1), Piece(Items[0], U, 2)); … … 1765 2018 begin 1766 2019 x := GetOPDaysOfWeek; 1767 if Length(x) > 0 then Responses.Update('SCHEDULE', 1, x, x); 2020 if Length(x) = 0 then x := 'ONCE'; 2021 Responses.Update('SCHEDULE', 1, x, x); 1768 2022 end; 1769 2023 with txtOPDietComment do {if Length(Text) > 0 then} Responses.Update('COMMENT', 1, Text, Text); … … 1784 2038 end; 1785 2039 1786 procedure TfrmODDiet.SetEnableOPDOW(AllowUse: Boolean); 1787 begin 2040 procedure TfrmODDiet.SetEnableOPDOW(AllowUse: Boolean; OneTimeDay: integer; DaysToCheck: string = ''); 2041 var 2042 i: integer; 2043 begin 2044 if (not AllowUse) and (OneTimeDay > -1) then 2045 begin 2046 for i := 0 to grpOPDOW.ControlCount - 1 do 2047 begin 2048 if grpOPDOW.Controls[i] is TCheckBox then 2049 TCheckBox(grpOPDOW.Controls[i]).Checked := False; 2050 end; 2051 //TCheckBox(grpOPDOW.Controls[OneTimeDay - 1]).Checked := True; CQ #8305 2052 end; 1788 2053 grpOPDOW.Enabled := AllowUse; 1789 chkOPMonday.Enabled := AllowUse ;1790 chkOPTuesday.Enabled := AllowUse ;1791 chkOPWednesday.Enabled := AllowUse ;1792 chkOPThursday.Enabled := AllowUse ;1793 chkOPFriday.Enabled := AllowUse ;1794 chkOPSaturday.Enabled := AllowUse ;1795 chkOPSunday.Enabled := AllowUse ;2054 chkOPMonday.Enabled := AllowUse and (Pos('M', DaysToCheck) > 0); 2055 chkOPTuesday.Enabled := AllowUse and (Pos('T', DaysToCheck) > 0); 2056 chkOPWednesday.Enabled := AllowUse and (Pos('W', DaysToCheck) > 0); 2057 chkOPThursday.Enabled := AllowUse and (Pos('R', DaysToCheck) > 0); 2058 chkOPFriday.Enabled := AllowUse and (Pos('F', DaysToCheck) > 0); 2059 chkOPSaturday.Enabled := AllowUse and (Pos('S', DaysToCheck) > 0); 2060 chkOPSunday.Enabled := AllowUse and (Pos('X', DaysToCheck) > 0); 1796 2061 end; 1797 2062 … … 1896 2161 // check if late tray should be ordered 1897 2162 AResponse := Responses.FindResponseByName('ORDERABLE', 1); 1898 if ( AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then2163 if (Self.EvtID = 0) and (AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then 1899 2164 begin 1900 2165 AResponse := Responses.FindResponseByName('START', 1); … … 1915 2180 // check if late tray should be ordered 1916 2181 AResponse := Responses.FindResponseByName('ORDERABLE', 1); 1917 if ( AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then2182 if (Self.EvtID = 0) and (AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then 1918 2183 begin 1919 2184 AResponse := Responses.FindResponseByName('START', 1); … … 1930 2195 if NewOrder.ID <> '' then 1931 2196 begin 1932 if (Encounter.Provider = User.DUZ) and User.CanSignOrders 1933 then CanSign := CH_SIGN_YES 1934 else CanSign := CH_SIGN_NA; 2197 if OrderForInpatient then 2198 begin 2199 if (Encounter.Provider = User.DUZ) and User.CanSignOrders 2200 then CanSign := CH_SIGN_YES 2201 else CanSign := CH_SIGN_NA; 2202 end 2203 else 2204 begin 2205 CanSign := CH_SIGN_NA; 2206 end; 1935 2207 Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, '', CanSign); 1936 2208 SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_NEW, Integer(NewOrder)) … … 1955 2227 end; 1956 2228 2229 procedure TfrmODDiet.cboOPDietAvailKeyDown(Sender: TObject; var Key: Word; 2230 Shift: TShiftState); 2231 begin 2232 inherited; 2233 if Key = VK_RETURN then cboOPDietAvailMouseClick(Self); 2234 end; 2235 2236 function TfrmODDiet.PatientHasRecurringMeals(var MealList: TStringList; MealType: string = ''): boolean; 2237 const 2238 TX_NO_RECURRING_MEALS = 'For outpatients, this type of order requires association with an existing recurring' + CRLF + 2239 'meal order. There are currently no active recurring meal orders for this patient.' + CRLF + CRLF + 2240 'Those orders must be signed and released before they can be linked to this item.'; 2241 TC_NO_RECURRING_MEALS = 'Unable to order ' ; 2242 begin 2243 MealList.Clear; 2244 GetCurrentRecurringOPMeals(MealList, MealType); 2245 if MealList.Count = 0 then 2246 begin 2247 InfoBox(TX_NO_RECURRING_MEALS, TC_NO_RECURRING_MEALS + nbkDiet.ActivePage.Caption, MB_OK); 2248 Result := False; 2249 end 2250 else 2251 Result := True; 2252 end; 2253 1957 2254 end. 1958 2255 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODDietLT.pas
r459 r460 75 75 begin 76 76 TimePart := Frac(x); 77 if TimePart > 0.1 2then77 if TimePart > 0.1159 then 78 78 begin 79 x := x - 0.12;79 if TimePart > 0.1259 then x := x - 0.12; 80 80 Suffix := 'P' 81 81 end … … 127 127 (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 6), 0) / 10000)) then Meal := 'E'; 128 128 if Meal = #0 then Exit; 129 // get the available late times for this meal130 case Meal of131 'B': AvailTimes := Pieces(DietParams.BTimes, U, 4, 6);132 'E': AvailTimes := Pieces(DietParams.ETimes, U, 4, 6);133 'N': AvailTimes := Pieces(DietParams.NTimes, U, 4, 6);134 end;135 SetAvailTimes(TimePart, TimeCount, AvailTimes);136 if TimeCount = 0 then Exit;137 129 end 138 130 else // for outpatients 139 131 begin 132 (* From Rich Knoepfle, NFS developer 133 If they order a breakfast and it is after the LATE BREAKFAST ALARM END, I don't allow them to do it. (For special meals I don't allow them to order something for the following day). 134 If it's before the LATE BREAKFAST ALARM BEGIN than I accept the order. 135 If it's between the LATE BREAKFAST ALARM BEGIN and ALARM END then I ask if they want to order a Late breakfast tray. 136 *) 140 137 Meal := AMeal; 141 138 case AMeal of 142 'B': if TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 1), 0) / 10000) then Meal := #0; 143 'N': if TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 3), 0) / 10000) then Meal := #0; 144 'E': if TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 5), 0) / 10000) then Meal := #0; 139 'B': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 1), 0) / 10000)) or 140 (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 2), 0) / 10000)) then Meal := #0; 141 'N': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 3), 0) / 10000)) or 142 (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 4), 0) / 10000)) then Meal := #0; 143 'E': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 5), 0) / 10000)) or 144 (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 6), 0) / 10000)) then Meal := #0; 145 145 end; 146 146 if Meal = #0 then exit; 147 147 end; 148 149 // get the available late times for this meal 150 case Meal of 151 'B': AvailTimes := Pieces(DietParams.BTimes, U, 4, 6); 152 'E': AvailTimes := Pieces(DietParams.ETimes, U, 4, 6); 153 'N': AvailTimes := Pieces(DietParams.NTimes, U, 4, 6); 154 end; 155 SetAvailTimes(TimePart, TimeCount, AvailTimes); 156 if TimeCount = 0 then Exit; 157 148 158 // setup form to get the selected late tray 149 159 frmODDietLT := TfrmODDietLT.Create(Application); … … 153 163 begin 154 164 FOutpatient := IsOutpatient; 155 if not IsOutpatient then 156 begin 157 if Length(Piece(AvailTimes, U, 1)) > 0 then radLT1.Caption := Piece(AvailTimes, U, 1); 158 if Length(Piece(AvailTimes, U, 2)) > 0 then radLT2.Caption := Piece(AvailTimes, U, 2); 159 if Length(Piece(AvailTimes, U, 3)) > 0 then radLT3.Caption := Piece(AvailTimes, U, 3); 160 radLT1.Visible := Length(radLT1.Caption) > 0; 161 radLT2.Visible := Length(radLT2.Caption) > 0; 162 radLT3.Visible := Length(radLT3.Caption) > 0; 163 radLT1.Checked := TimeCount = 1; 164 end 165 else GroupBox1.Visible := False; 165 if Length(Piece(AvailTimes, U, 1)) > 0 then radLT1.Caption := Piece(AvailTimes, U, 1); 166 if Length(Piece(AvailTimes, U, 2)) > 0 then radLT2.Caption := Piece(AvailTimes, U, 2); 167 if Length(Piece(AvailTimes, U, 3)) > 0 then radLT3.Caption := Piece(AvailTimes, U, 3); 168 radLT1.Visible := Length(radLT1.Caption) > 0; 169 radLT2.Visible := Length(radLT2.Caption) > 0; 170 radLT3.Visible := Length(radLT3.Caption) > 0; 171 radLT1.Checked := TimeCount = 1; 166 172 chkBagged.Visible := DietParams.Bagged; 167 173 with lblMealCutOff do case Meal of … … 174 180 if YesPressed then 175 181 begin 176 if not IsOutpatient then 177 begin 178 with radLT1 do if Checked then LateTrayFields.LateTime := Caption; 179 with radLT2 do if Checked then LateTrayFields.LateTime := Caption; 180 with radLT3 do if Checked then LateTrayFields.LateTime := Caption; 181 end 182 else 183 LateTrayFields.LateTime := FMTimeToAMPM(FMToday + TimePart); 182 with radLT1 do if Checked then LateTrayFields.LateTime := Caption; 183 with radLT2 do if Checked then LateTrayFields.LateTime := Caption; 184 with radLT3 do if Checked then LateTrayFields.LateTime := Caption; 184 185 LateTrayFields.LateMeal := Meal; 185 186 LateTrayFields.IsBagged := chkBagged.Checked; 186 end; {if YesPressed}187 end; 187 188 end; {with frmODDietLT} 188 189 finally -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODGen.pas
r459 r460 339 339 Editor.SetBounds(FEditorLeft, FEditorTop, NUM_CHAR * FCharWd, HT_FRAME * FCharHt); 340 340 TORDateBox(Editor).DateOnly := Pos('T', DialogItem.Domain) = 0; 341 with TORDateBox(Editor) do RequireTime := (not DateOnly) and (Pos('R', DialogItem.Domain) > 0); //v26.48 - RV PSI-05-002 341 342 TORDateBox(Editor).Text := DialogItem.EDefault; 342 343 TORDateBox(Editor).Hint := DialogItem.HelpText; … … 490 491 end; 491 492 with TORComboBox(Editor) do 493 begin 492 494 Items.AddStrings(TStrings(TopTSList)); 495 LongList := false; 496 end; 493 497 end else 494 498 TORComboBox(Editor).OnNeedData := LookupNeedData; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODLab.dfm
r459 r460 374 374 OnExit = cboAvailTestExit 375 375 OnNeedData = cboAvailTestNeedData 376 CharsNeedMatch = 1 376 377 end 377 378 object cboFrequency: TORComboBox … … 397 398 TabOrder = 16 398 399 OnChange = cboFrequencyChange 400 CharsNeedMatch = 1 399 401 end 400 402 object cboCollSamp: TORComboBox … … 423 425 OnKeyPause = cboCollSampKeyPause 424 426 OnMouseClick = cboCollSampMouseClick 427 CharsNeedMatch = 1 425 428 end 426 429 object cboSpecimen: TORComboBox … … 451 454 OnKeyPause = cboSpecimenKeyPause 452 455 OnMouseClick = cboSpecimenMouseClick 456 CharsNeedMatch = 1 453 457 end 454 458 object cboUrgency: TORComboBox … … 474 478 TabOrder = 3 475 479 OnChange = cboUrgencyChange 480 CharsNeedMatch = 1 476 481 end 477 482 object txtAddlComment: TCaptionEdit … … 533 538 OnChange = cboCollTimeChange 534 539 OnExit = cboCollTimeExit 540 CharsNeedMatch = 1 535 541 end 536 542 object cboCollType: TORComboBox … … 556 562 TabOrder = 11 557 563 OnChange = cboCollTypeChange 564 CharsNeedMatch = 1 558 565 end 559 566 object dlgLabCollTime: TORDateTimeDlg -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODLab.pas
r459 r460 181 181 182 182 uses rODBase, rODLab, uCore, rCore, fODLabOthCollSamp, fODLabOthSpec, fODLabImmedColl, fLabCollTimes, 183 rOrders, uODBase, fRptBox ;183 rOrders, uODBase, fRptBox, fFrame; 184 184 185 185 … … 208 208 AList: TStringList; 209 209 begin 210 frmFrame.pnlVisit.Enabled := false; 210 211 AutoSizeDisabled := True; 211 212 inherited; … … 417 418 TestID := StrToInt(LabTestIEN); 418 419 TestName := Piece(ExtractDefault(LoadData, 'Test Name'),U,1); 419 LabSubscript := Piece(ExtractDefault(LoadData, ' Test Name'),U,2);420 LabSubscript := Piece(ExtractDefault(LoadData, 'Item ID'),U,2); 420 421 TestReqComment := ExtractDefault(LoadData, 'ReqCom'); 421 422 if Length(ExtractDefault(LoadData, 'Unique CollSamp')) > 0 then UniqueCollSamp := True; … … 826 827 827 828 procedure TfrmODLab.ControlChange(Sender: TObject); 829 var 830 AResponse: TResponse; 831 AVisitStr: string; 828 832 begin 829 833 inherited; 830 834 if Changing or (ALabTest = nil) then Exit; 835 AResponse := Responses.FindResponseByName('VISITSTR', 1); 836 if AResponse <> nil then 837 AVisitStr := AResponse.EValue; 831 838 Responses.Clear; 832 839 with ALabTest do … … 877 884 with txtDays do if Enabled then Responses.Update('DAYS', 1, Text, Text); 878 885 { worry about stop date later } 886 if AVisitStr <> '' then Responses.Update('VISITSTR', 1, AVisitStr, AVisitStr); 879 887 memOrder.Text := Responses.OrderText; 880 888 end; … … 1527 1535 inherited; 1528 1536 if FCmtTypes <> nil then FCmtTypes.Free; 1537 frmFrame.pnlVisit.Enabled := true; 1529 1538 end; 1530 1539 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedFA.dfm
r459 r460 5 5 Height = 205 6 6 Caption = 'Formulary Alternatives' 7 FormStyle = fsStayOnTop 7 8 OnCreate = FormCreate 8 9 PixelsPerInch = 96 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedIV.dfm
r459 r460 1 1 inherited frmODMedIV: TfrmODMedIV 2 Left = 3213 Top = 1992 Left = 587 3 Top = 331 4 4 Width = 610 5 5 Height = 341 6 Caption = 'I V FluidOrder'6 Caption = 'Infusion Order' 7 7 OnKeyDown = FormKeyDown 8 8 PixelsPerInch = 96 … … 11 11 Left = 6 12 12 Top = 196 13 Width = 6314 Height = 13 15 Caption = 'Infusion Rate '13 Width = 96 14 Height = 13 15 Caption = 'Infusion Rate (ml/hr)' 16 16 end 17 17 object lblPriority: TLabel [1] … … 30 30 end 31 31 object lblAmount: TLabel [3] 32 Left = 3 3332 Left = 328 33 33 Top = 6 34 Width = 7435 Height = 13 36 Caption = 'Volume/Stren th'34 Width = 80 35 Height = 13 36 Caption = 'Volume/Strength' 37 37 WordWrap = True 38 38 end … … 51 51 Caption = 'Duration or Total Volume' 52 52 end 53 object Label1: TStaticText [6] 54 Left = 100 55 Top = 213 56 Width = 28 57 Height = 17 58 Caption = 'ml/hr' 59 TabOrder = 15 60 end 61 object cboAdditive: TORComboBox [7] 62 Left = 6 63 Top = 20 64 Width = 200 65 Height = 125 66 Style = orcsSimple 67 AutoSelect = True 68 Caption = 'Additives' 69 Color = clWindow 70 DropDownCount = 11 71 ItemHeight = 13 72 ItemTipColor = clWindow 73 ItemTipEnable = True 74 ListItemsOnly = True 75 LongList = True 76 LookupPiece = 0 77 MaxLength = 0 78 Pieces = '2' 79 Sorted = False 80 SynonymChars = '<>' 81 TabPositions = '20' 82 TabOrder = 0 83 OnExit = cboAdditiveExit 84 OnMouseClick = cboAdditiveMouseClick 85 OnNeedData = cboAdditiveNeedData 86 CharsNeedMatch = 1 87 end 88 object tabFluid: TTabControl [8] 89 Left = 7 90 Top = 3 91 Width = 200 92 Height = 21 93 TabHeight = 15 94 TabOrder = 13 95 Tabs.Strings = ( 96 ' Solutions ' 97 ' Additives ') 98 TabIndex = 0 99 TabStop = False 100 OnChange = tabFluidChange 101 end 102 inherited memOrder: TCaptionMemo 103 Top = 255 104 Width = 475 105 TabOrder = 11 106 end 107 object txtRate: TCaptionEdit [10] 53 object txtRate: TCaptionEdit [6] 108 54 Left = 6 109 55 Top = 210 … … 111 57 Height = 21 112 58 AutoSelect = False 113 TabOrder = 659 TabOrder = 5 114 60 OnChange = ControlChange 61 OnExit = txtRateExit 115 62 Caption = 'Infusion Rate' 116 63 end 117 object cboPriority: TORComboBox [ 11]64 object cboPriority: TORComboBox [7] 118 65 Left = 134 119 66 Top = 210 … … 135 82 Sorted = False 136 83 SynonymChars = '<>' 137 TabOrder = 784 TabOrder = 6 138 85 OnChange = ControlChange 139 86 CharsNeedMatch = 1 140 87 end 141 object grdSelected: TCaptionStringGrid [ 12]88 object grdSelected: TCaptionStringGrid [8] 142 89 Left = 214 143 90 Top = 20 … … 152 99 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected] 153 100 ScrollBars = ssVertical 154 TabOrder = 3101 TabOrder = 2 155 102 OnDrawCell = grdSelectedDrawCell 156 103 OnKeyPress = grdSelectedKeyPress … … 158 105 Caption = 'Selected Solution and Additives' 159 106 end 160 object cmdRemove: TButton [ 13]107 object cmdRemove: TButton [9] 161 108 Left = 443 162 109 Top = 99 … … 164 111 Height = 18 165 112 Caption = 'Remove' 166 TabOrder = 4113 TabOrder = 3 167 114 OnClick = cmdRemoveClick 168 115 end 169 object memComments: TCaptionMemo [1 4]116 object memComments: TCaptionMemo [10] 170 117 Left = 214 171 118 Top = 120 … … 175 122 'memComments') 176 123 ScrollBars = ssVertical 177 TabOrder = 5124 TabOrder = 4 178 125 OnChange = ControlChange 179 126 Caption = 'Comments' 180 127 end 181 object txtSelected: TCaptionEdit [1 5]128 object txtSelected: TCaptionEdit [11] 182 129 Tag = -1 183 130 Left = 416 … … 187 134 Ctl3D = False 188 135 ParentCtl3D = False 189 TabOrder = 1136 TabOrder = 0 190 137 Text = 'meq.' 191 138 Visible = False … … 194 141 Caption = 'Volume' 195 142 end 196 object cboSelected: TCaptionComboBox [1 6]143 object cboSelected: TCaptionComboBox [12] 197 144 Tag = -1 198 145 Left = 460 … … 204 151 ItemHeight = 13 205 152 ParentCtl3D = False 206 TabOrder = 2153 TabOrder = 1 207 154 Visible = False 208 155 OnChange = cboSelectedChange … … 210 157 Caption = 'Volume/Strength' 211 158 end 159 inherited memOrder: TCaptionMemo 160 Top = 255 161 Width = 475 162 TabOrder = 10 163 end 212 164 inherited cmdAccept: TButton 213 165 Left = 495 214 166 Top = 255 215 TabOrder = 9167 TabOrder = 8 216 168 end 217 169 inherited cmdQuit: TButton 218 170 Left = 495 219 171 Top = 282 220 TabOrder = 10172 TabOrder = 9 221 173 end 222 174 inherited pnlMessage: TPanel 223 175 Top = 237 224 TabOrder = 12 225 end 226 object cboSolution: TORComboBox 227 Left = 6 228 Top = 19 229 Width = 200 230 Height = 164 231 Style = orcsSimple 232 AutoSelect = True 233 Caption = 'Solutions' 234 Color = clWindow 235 DropDownCount = 11 236 ItemHeight = 13 237 ItemTipColor = clWindow 238 ItemTipEnable = True 239 ListItemsOnly = True 240 LongList = True 241 LookupPiece = 0 242 MaxLength = 0 243 Pieces = '2' 244 Sorted = False 245 SynonymChars = '<>' 246 TabPositions = '20' 247 TabOrder = 14 248 OnExit = cboSolutionExit 249 OnMouseClick = cboSolutionMouseClick 250 OnNeedData = cboSolutionNeedData 251 CharsNeedMatch = 1 176 TabOrder = 11 252 177 end 253 178 object pnlXDuration: TPanel … … 257 182 Height = 21 258 183 BevelOuter = bvNone 259 TabOrder = 8184 TabOrder = 7 260 185 OnEnter = pnlXDurationEnter 261 186 DesignSize = ( 262 187 121 263 188 21) 264 object btnXDuration: T SpeedButton189 object btnXDuration: TBitBtn 265 190 Left = 69 266 191 Top = 1 … … 269 194 Anchors = [akLeft, akTop, akRight, akBottom] 270 195 Caption = 'days' 196 TabOrder = 1 197 OnClick = btnXDurationClick 271 198 Glyph.Data = { 272 199 AE000000424DAE0000000000000076000000280000000E000000070000000100 … … 279 206 NumGlyphs = 2 280 207 Spacing = 0 281 Transparent = False282 OnClick = btnXDurationClick283 208 end 284 209 object txtXDuration: TCaptionEdit … … 293 218 end 294 219 end 220 object pnlCombo: TPanel 221 Left = 8 222 Top = 1 223 Width = 200 224 Height = 185 225 BevelOuter = bvNone 226 TabOrder = 17 227 object cboAdditive: TORComboBox 228 Left = 0 229 Top = 20 230 Width = 200 231 Height = 165 232 Style = orcsSimple 233 Align = alClient 234 AutoSelect = True 235 Caption = 'Additives' 236 Color = clWindow 237 DropDownCount = 11 238 ItemHeight = 13 239 ItemTipColor = clWindow 240 ItemTipEnable = True 241 ListItemsOnly = True 242 LongList = True 243 LookupPiece = 0 244 MaxLength = 0 245 Pieces = '2' 246 Sorted = False 247 SynonymChars = '<>' 248 TabPositions = '20' 249 TabOrder = 0 250 OnExit = cboAdditiveExit 251 OnMouseClick = cboAdditiveMouseClick 252 OnNeedData = cboAdditiveNeedData 253 CharsNeedMatch = 1 254 end 255 object tabFluid: TTabControl 256 Left = 0 257 Top = 0 258 Width = 200 259 Height = 20 260 Align = alTop 261 TabHeight = 15 262 TabOrder = 1 263 Tabs.Strings = ( 264 ' Solutions ' 265 ' Additives ') 266 TabIndex = 0 267 TabStop = False 268 OnChange = tabFluidChange 269 end 270 object cboSolution: TORComboBox 271 Left = 0 272 Top = 20 273 Width = 200 274 Height = 165 275 Style = orcsSimple 276 Align = alClient 277 AutoSelect = True 278 Caption = 'Solutions' 279 Color = clWindow 280 DropDownCount = 11 281 ItemHeight = 13 282 ItemTipColor = clWindow 283 ItemTipEnable = True 284 ListItemsOnly = True 285 LongList = True 286 LookupPiece = 0 287 MaxLength = 0 288 Pieces = '2' 289 Sorted = False 290 SynonymChars = '<>' 291 TabPositions = '20' 292 TabOrder = 2 293 OnExit = cboSolutionExit 294 OnMouseClick = cboSolutionMouseClick 295 OnNeedData = cboSolutionNeedData 296 CharsNeedMatch = 1 297 end 298 end 295 299 object popDuration: TPopupMenu 296 300 AutoHotkeys = maManual -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedIV.pas
r459 r460 9 9 type 10 10 TfrmODMedIV = class(TfrmODBase) 11 tabFluid: TTabControl;12 cboSolution: TORComboBox;13 11 lblInfusionRate: TLabel; 14 12 txtRate: TCaptionEdit; 15 lblPriority: TLabel;16 cboPriority: TORComboBox;17 13 lblComponent: TLabel; 18 14 lblAmount: TLabel; … … 21 17 lblComments: TLabel; 22 18 memComments: TCaptionMemo; 23 cboAdditive: TORComboBox;24 19 txtSelected: TCaptionEdit; 25 20 cboSelected: TCaptionComboBox; 26 Label1: TStaticText;27 21 popDuration: TPopupMenu; 28 22 popML: TMenuItem; … … 33 27 txtXDuration: TCaptionEdit; 34 28 lblLimit: TLabel; 35 btnXDuration: TSpeedButton; 29 btnXDuration: TBitBtn; 30 pnlCombo: TPanel; 31 cboAdditive: TORComboBox; 32 tabFluid: TTabControl; 33 cboSolution: TORComboBox; 34 lblPriority: TLabel; 35 cboPriority: TORComboBox; 36 36 procedure FormCreate(Sender: TObject); 37 37 procedure tabFluidChange(Sender: TObject); … … 64 64 procedure pnlXDurationEnter(Sender: TObject); 65 65 procedure txtXDurationExit(Sender: TObject); 66 procedure txtRateExit(Sender: TObject); 66 67 private 67 68 FInpatient: Boolean; … … 84 85 {$R *.DFM} 85 86 86 uses ORFn, uConst, rODMeds, rODBase, uAccessibleStringGrid ;87 uses ORFn, uConst, rODMeds, rODBase, uAccessibleStringGrid, fFrame; 87 88 88 89 const … … 129 130 Restriction: string; 130 131 begin 132 frmFrame.pnlVisit.Enabled := false; 131 133 inherited; 132 134 AllowQuickOrder := True; … … 155 157 with grdSelected do for i := 0 to RowCount - 1 do TIVComponent(Objects[0, i]).Free; 156 158 inherited; 159 frmFrame.pnlVisit.Enabled := True; 157 160 end; 158 161 … … 454 457 end; 455 458 end; 459 Application.ProcessMessages; //CQ: 10157 456 460 ClickOnGridCell; 457 if cboAdditive.Visible then458 ActiveControl := cboAdditive;459 461 ControlChange(Sender); 460 462 end; … … 522 524 Col := 1; 523 525 end; 526 Application.ProcessMessages; //CQ: 10157 524 527 ClickOnGridCell; 525 528 ControlChange(Sender); … … 550 553 Show; 551 554 SetFocus; 555 if AControl is TComboBox then //CQ: 10157 556 TComboBox(AControl).DroppedDown := True; 552 557 end; 553 558 end; … … 855 860 procedure TfrmODMedIV.txtXDurationExit(Sender: TObject); 856 861 var 862 Len: Integer; 857 863 Code: double; 864 Digits, Warning: string; 858 865 begin 859 866 inherited; 860 867 if Changing then Exit; 868 //AGP Change 26.15 HIN-1203-42283 Added additional check to make sure the user can only enter the correct duration 869 Len := Length(txtXDuration.Text); 870 if (Len > 0) and (Pos('.', txtXDuration.Text)=0) then 871 begin 872 Warning := '0'; 873 Digits := '2'; 874 if ((btnXDuration.Caption = 'days') or (btnXDuration.Caption = 'hours') or (btnXDuration.Caption = 'L')) and (Len > 2) then Warning := '1'; 875 if (btnXDuration.Caption = 'ml') and (Len > 4) then Warning := '1'; 876 if Warning = '1' then 877 begin 878 if btnXduration.Caption = 'ml' then Digits := '4'; 879 ShowMessage('Invalid Value.' + #13#10 + 'Reason: Duration for ' + btnXDuration.Caption + ' cannot be greater than ' + digits + ' digits.'); 880 txtXDuration.Text := ''; 881 txtXDuration.SetFocus; 882 Exit; 883 end; 884 end; 861 885 if (Pos('.', txtXDuration.Text)>0) and 862 886 ((btnXduration.Caption = 'days') or (btnXduration.Caption = 'hours')) then … … 897 921 end; 898 922 923 procedure TfrmODMedIV.txtRateExit(Sender: TObject); 924 var 925 ErrorText, LDec,RDec: string; 926 i: Integer; 927 Result: boolean; 928 begin 929 inherited; 930 //AGP Change 26.28 for CQ # 7598 add infusion rate check for valid value 931 ErrorText := 'The Infusion Rate must be in one of the following formats:' + CRLF + CRLF + 'nnnn.nn ml/hr or text@per labels per day'; 932 Result := False; 933 if pos('@',Self.txtRate.Text)>0 then exit; 934 if pos('.',Self.txtRate.Text)>0 then 935 begin 936 LDec := Piece(Self.txtRate.Text,'.',1); 937 RDec := Piece(Self.txtRate.Text,'.',2); 938 if Length(LDec)>4 then Result := True; 939 if Length(RDec)>2 then Result := True; 940 end 941 else if Length(Self.txtRate.Text)>4 then Result := True; 942 if (Result = False) and (pos('.',Self.txtRate.Text)=0) then 943 begin 944 for i := 1 to Length(Self.txtRate.Text) do if not (Self.txtRate.Text[i] in ['0'..'9']) then Result := True 945 end; 946 if Result = True then 947 begin 948 InfoBox(ErrorText,'Warning - Invalid Infusion Rate', MB_OK); 949 Self.txtRate.Text := ''; 950 Self.txtRate.SetFocus; 951 end; 952 end; 953 899 954 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedNVA.dfm
r459 r460 1 1 inherited frmODMedNVA: TfrmODMedNVA 2 Left = 1 683 Top = 362 Left = 100 3 Top = 167 4 4 Width = 632 5 5 Height = 536 … … 57 57 Height = 133 58 58 Align = alTop 59 BevelInner = bvLowered 60 BevelOuter = bvSpace 59 61 Columns = < 60 62 item … … 63 65 ColumnClick = False 64 66 HideSelection = False 67 HotTrack = True 65 68 OwnerData = True 66 69 ParentShowHint = False … … 71 74 ViewStyle = vsReport 72 75 OnChange = lstChange 76 OnClick = ListViewClick 73 77 OnData = lstQuickData 78 OnEditing = ListViewEditing 79 OnEnter = ListViewEnter 80 OnResize = ListViewResize 74 81 Caption = 'Quick Orders' 75 82 end … … 215 222 OnExit = cboDosageExit 216 223 CharsNeedMatch = 1 217 UniqueAutoComplete = True218 224 end 219 225 object cboRoute: TORComboBox … … 245 251 OnExit = cboRouteExit 246 252 CharsNeedMatch = 1 247 UniqueAutoComplete = True248 253 end 249 254 object cboSchedule: TORComboBox … … 273 278 OnExit = cboScheduleExit 274 279 CharsNeedMatch = 1 275 UniqueAutoComplete = True276 280 end 277 281 object chkPRN: TCheckBox … … 285 289 ParentColor = False 286 290 TabOrder = 5 291 OnClick = chkPRNClick 287 292 end 288 293 end … … 308 313 object Label1: TLabel 309 314 Left = 5 310 Top = 50315 Top = 47 311 316 Width = 108 312 317 Height = 13 … … 319 324 Height = 13 320 325 Caption = 'Start Date:' 326 end 327 object Image1: TImage 328 Left = 25 329 Top = 17 330 Width = 31 331 Height = 31 321 332 end 322 333 object memComment: TCaptionMemo … … 354 365 end 355 366 object lbStatements: TORListBox 356 Left = 8357 Top = 62367 Left = 7 368 Top = 59 358 369 Width = 603 359 Height = 76370 Height = 81 360 371 Style = lbOwnerDrawFixed 361 372 Anchors = [akLeft, akTop, akRight] … … 370 381 OnClickCheck = lbStatementsClickCheck 371 382 end 383 object memDrugMsg: TMemo 384 Left = 63 385 Top = 15 386 Width = 533 387 Height = 31 388 Anchors = [akLeft, akRight, akBottom] 389 Color = clCream 390 Lines.Strings = ( 391 '') 392 ReadOnly = True 393 ScrollBars = ssVertical 394 TabOrder = 6 395 Visible = False 396 end 372 397 end 373 398 end 374 399 object btnSelect: TButton 375 400 Left = 539 376 Top = 46 1401 Top = 463 377 402 Width = 72 378 403 Height = 21 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedNVA.pas
r459 r460 1 1 unit fODMedNVA; 2 2 3 interface 3 interface 4 4 5 5 uses … … 41 41 Label2: TLabel; 42 42 btnSelect: TButton; 43 Image1: TImage; 44 memDrugMsg: TMemo; 43 45 procedure FormCreate(Sender: TObject); 44 46 procedure btnSelectClick(Sender: TObject); … … 68 70 procedure cboScheduleClick(Sender: TObject); 69 71 procedure cboRouteExit(Sender: TObject); 70 72 procedure DispOrderMessage(const AMessage: string); 71 73 72 74 … … 89 91 Change: TItemChange); 90 92 procedure FormKeyPress(Sender: TObject; var Key: Char); 93 91 94 private 92 95 {selection} … … 121 124 FPtInstruct: string; 122 125 FAltChecked: Boolean; 126 FShrinkDrugMsg: boolean; 123 127 FQOQuantity: Double; 124 128 FQODosage: string; … … 129 133 FDisabledCancelButton: TButton; 130 134 FShrinked: boolean; 135 FQOInitial: boolean; 131 136 FRemoveText : Boolean; 132 137 {selection} … … 291 296 TX_NO_FUTURE_DATES = 'Dates in the future are not allowed.'; 292 297 TX_BAD_DATE = 'Dates must be in the format mm/dd/yy or mm/yy'; 293 298 TX_CAP_FUTURE = 'Invalid date'; 294 299 295 300 { procedures inherited from fODBase --------------------------------------------------------- } … … 300 305 var 301 306 ListCount: Integer; 302 Restriction, x : string; 303 begin 307 Restriction, x: string; 308 begin 309 frmFrame.pnlVisit.Enabled := false; 304 310 AutoSizeDisabled := True; 305 311 // ActivateOrderDialog(Piece(DialogInfo, ';', 1), DelayEvent, Self, 0); 306 312 inherited; 313 AllowQuickOrder := True; 314 307 315 if User.OrderRole in[OR_CLERK] then // if user is clerk check restrictions else ok to write NonVA Order. 308 begin 309 CheckAuthForNVAMeds(Restriction); 310 if Length(Restriction) > 0 then 311 begin 312 InfoBox(Restriction, TC_RESTRICT, MB_OK); 313 Close; 314 Exit; 315 end; 316 end; 316 begin 317 CheckAuthForNVAMeds(Restriction); 318 if Length(Restriction) > 0 then 319 begin 320 CheckAuthForNVAMeds(Restriction); 321 if Length(Restriction) > 0 then 322 begin 323 InfoBox(Restriction, TC_RESTRICT, MB_OK); 324 Close; 325 Exit; 326 end; 327 end; 328 end; // clerk restrictions 317 329 318 330 if DlgFormID = OD_MEDNONVA then FNonVADlg := TRUE; … … 363 375 LoadOTCStatements(lbStatements.Items); 364 376 FRemoveText := True; 377 FShrinkDrugMsg := False; 365 378 end; 366 379 … … 376 389 // TAccessibleStringGrid.UnwrapControl(grdDoses); 377 390 inherited; 391 frmFrame.pnlVisit.Enabled := true; 378 392 end; 379 393 … … 401 415 procedure TfrmODMedNVA.SetupDialog(OrderAction: Integer; const ID: string); 402 416 var 417 //AnInstr: string; 403 418 OrderID: string; 404 419 begin … … 429 444 Changing := False; 430 445 end; 431 446 { prevent the SIG from being part of the comments on pre-CPRS prescriptions } 447 {if (OrderAction in [ORDER_COPY, ORDER_EDIT]) and (cboDosage.Text = '') then //commented out by cla 2/27/04 - CQ 2591 448 begin 449 OrderID := Copy(Piece(ID, ';', 1), 2, Length(ID)); 450 AnInstr := TextForOrder(OrderID); 451 pnlMessage.TabOrder := 0; 452 OrderMessage(AnInstr); 453 if OrderAction = ORDER_COPY 454 then AnInstr := 'Copy: ' + AnInstr 455 else AnInstr := 'Change: ' + AnInstr; 456 Caption := AnInstr; 457 memComment.Clear; // sometimes the sig is in the comment 458 lbStatements.Clear; 459 end;} 432 460 ControlChange(Self); 433 461 end; … … 527 555 end; 528 556 529 530 557 { Navigate medication selection lists ------------------------------------------------------- } 531 558 … … 607 634 var 608 635 Offset: Integer; 636 SelRect: TRect; 609 637 begin 610 638 AListView.Selected.MakeVisible(FALSE); 639 SelRect := AListView.Selected.DisplayRect(drBounds); // CQ: 6636 640 FRowHeight := SelRect.Bottom - SelRect.Top; 611 641 Offset := AListView.Selected.Index - AListView.TopItem.Index; 612 642 Application.ProcessMessages; … … 803 833 Changing := True; 804 834 ResetOnMedChange; 805 if (FActiveMedList = lstAll) and (lstAll.Selected <> nil) then // orderable item 835 if (FActiveMedList = lstQuick) and (lstQuick.Selected <> nil) then // quick order 836 begin 837 ErrMsg := ''; 838 FIsQuickOrder := True; 839 FQOInitial := True; 840 Responses.QuickOrder := Integer(lstQuick.Selected.Data); 841 txtMed.Tag := StrToIntDef(Responses.IValueFor('ORDERABLE', 1), 0); 842 IsActivateOI(ErrMsg, txtMed.Tag); 843 if Length(ErrMsg)>0 then 844 begin 845 //btnSelect.Visible := False; 846 btnSelect.Enabled := False; 847 ShowMessage(ErrMsg); 848 Exit; 849 end; 850 if txtMed.Tag = 0 then 851 begin 852 //btnSelect.Visible := False; 853 btnSelect.Enabled := False; 854 txtMed.SetFocus; 855 Exit; 856 end; 857 SetOnMedSelect; // set up for this medication 858 SetOnQuickOrder; // insert quick order responses 859 ShowMedFields; 860 end 861 else if (FActiveMedList = lstAll) and (lstAll.Selected <> nil) then // orderable item 806 862 begin 807 863 MedIEN := Integer(lstAll.Selected.Data); … … 831 887 ShowMedFields; 832 888 end 833 else 889 else // no selection 834 890 begin 835 891 MessageBeep(0); … … 842 898 else ShowMedSelect; // show the selection fields 843 899 FNoZERO := False; 844 845 900 end; 846 901 … … 848 903 begin 849 904 cboDosage.Items.Clear; 905 chkPRN.Checked := False; 906 cboSchedule.ItemIndex := -1; 907 cboSchedule.Text := ''; // leave items intact 908 memComment.Lines.Clear; 850 909 cboDosage.Text := ''; 851 910 cboRoute.Items.Clear; … … 867 926 QOPiUnChk := False; 868 927 PKIEnviron := False; 869 if GetPKISite and GetPKIUse then //PKI check for crypto object on workstation 870 begin 871 try //PKI object creation 872 crypto := CoXuDigSigS.Create; 873 crypto.GetCSP; 874 StatusText(crypto.Reason); 875 PKIEnviron := True; 876 except 877 on E: Exception do 878 begin 879 {ShowMessage('An error has been encountered while trying to create PKI environment: '+ E.Message + 880 '. This order will be processed without Digital Signature encryption.');} 881 PKIEnviron := False; 882 end; 883 end; 884 crypto := nil; 885 end; 886 if PKIEnviron = False then 887 if GetPKISite then PKIEnviron := True; 928 if GetPKISite then PKIEnviron := True; 888 929 with CtrlInits do 889 930 begin … … 950 991 // end; 951 992 pnlMessage.TabOrder := cboDosage.TabOrder + 1; 952 OrderMessage(TextOf('Message')); 993 994 // DispOrderMessage(TextOf('Message')); 953 995 end; 954 996 end; … … 971 1013 with cboDosage do 972 1014 if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] else x := Text; 1015 973 1016 SetControl(cboRoute, 'ROUTE', i); 974 1017 with cboRoute do … … 1001 1044 else 1002 1045 SetDosage(IValueFor('INSTR', 1)); 1003 SetControl(cbo Route, 'ROUTE', 1);1046 SetControl(cboDosage, 'DOSAGE', 1); // CQ: HDS00007776 1004 1047 SetSchedule(IValueFor('SCHEDULE', 1)); 1005 1048 if (cboSchedule.Text = '') and FIsQuickOrder then … … 1174 1217 NonPRNPart: string; 1175 1218 begin 1219 1176 1220 cboSchedule.ItemIndex := -1; 1177 1221 if Pos('PRN', x) > 0 then … … 1179 1223 NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1)); 1180 1224 cboSchedule.SelectByID(NonPRNPart); 1181 if cboSchedule.ItemIndex > -1 then chkPRN.Checked := True else 1182 begin 1183 cboSchedule.SelectByID(x); 1184 if cboSchedule.ItemIndex < 0 then cboSchedule.Text := x; 1185 end; 1225 if cboSchedule.ItemIndex < 0 then 1226 begin 1227 if NSSchedule then 1228 begin 1229 chkPRN.Checked := False; 1230 cboSchedule.Text := ''; 1231 end else 1232 begin 1233 chkPRN.Checked := True; 1234 cboSchedule.Items.Add(NonPRNPart); 1235 cboSchedule.Text := NonPRNPart; 1236 end; 1237 end else 1238 chkPRN.Checked := True; 1186 1239 end else 1187 1240 begin 1188 1241 chkPRN.Checked := False; 1189 1242 cboSchedule.SelectByID(x); 1190 if cboSchedule.ItemIndex < 0 then cboSchedule.Text := x; 1243 if cboSchedule.ItemIndex < 0 then 1244 begin 1245 if NSSchedule then 1246 begin 1247 cboSchedule.Text := ''; 1248 end 1249 else 1250 begin 1251 cboSchedule.Items.Add(x); 1252 cboSchedule.Text := x; 1253 cboSchedule.SelectByID(x); 1254 end; 1255 end; 1191 1256 end; 1192 1257 end; … … 1246 1311 var 1247 1312 DispDrug: Integer; 1248 x: string; 1249 begin 1250 inherited; 1251 UpdateRelated(False); 1313 begin 1314 inherited; 1315 UpdateRelated(False); 1252 1316 DispDrug := StrToIntDef(ValueOf(FLD_DRUG_ID), 0); 1253 1317 if cboDosage.Text = '' then //cla 3/18/04 … … 1256 1320 cboDosage.ItemIndex := -1; 1257 1321 end; 1322 { hds8084 1258 1323 if DispDrug > 0 then 1259 1324 begin 1260 1325 if not FSuppressMsg then begin 1261 1326 pnlMessage.TabOrder := cboDosage.TabOrder + 1; 1262 OrderMessage(DispenseMessage(DispDrug));1327 DispOrderMessage(DispenseMessage(DispDrug)); 1263 1328 end; 1264 1329 x := QuantityMessage(DispDrug); 1265 1330 end 1266 1331 else x := ''; 1332 } 1267 1333 with cboDosage do 1268 1334 if (ItemIndex > -1) and (Piece(Items[ItemIndex], U, 3) = 'NF') … … 1589 1655 then Responses.Update('ROUTE', 1, ValueOf(FLD_ROUTE_ID), x) 1590 1656 else Responses.Update('ROUTE', 1, '', x); 1591 // x := ValueOf(FLD_SCHEDULE); Responses.Update('SCHEDULE', 1, x, x);1657 x := ValueOf(FLD_SCHEDULE); Responses.Update('SCHEDULE', 1, x, x); // CQ:7297, 7534 1592 1658 end; 1593 1659 end; {case TabDose.TabIndex} … … 1598 1664 if Length(calStart.Text) > 0 then 1599 1665 Responses.Update('START', 1, calStart.Text, 'Start Date: ' + calStart.Text); //cla 7-17-03 1600 1666 1601 1667 x := ValueOf(FLD_STATEMENTS); 1602 1668 Responses.Update('STATEMENTS',1, TX_WPTYPE, x); … … 1697 1763 if ItemIndex > -1 then Result := Piece(Items[ItemIndex], U, 4); 1698 1764 FLD_SCHEDULE : begin 1699 Result := cboSchedule.Text;1765 Result := UpperCase(cboSchedule.Text); 1700 1766 if chkPRN.Checked then Result := Result + ' PRN'; 1701 1767 if UpperCase(Copy(Result, Length(Result) - 6, Length(Result))) = 'PRN PRN' … … 1768 1834 if Length(CurSchedule)=0 then Exit; 1769 1835 ASchedule := Trim(CurSchedule); 1770 if (Pos('^',ASchedule)=0) then1836 {if (Pos('^',ASchedule)=0) then //GE CQ7506 1771 1837 begin 1772 1838 PrnPos := Pos('PRN',ASchedule); 1773 1839 if (PrnPos > 1) and (CharAt(ASchedule,PrnPos-1) <> ';') then 1774 1840 Delete(ASchedule, PrnPos, Length(ASchedule)); 1775 end 1776 elseif (Pos('^',ASchedule)>0) then1841 end } 1842 if (Pos('^',ASchedule)>0) then 1777 1843 begin 1778 1844 PrnPos := Pos('PRN',ASchedule); … … 1929 1995 begin 1930 1996 Val(TabletNum, ie, code); 1997 if ie = 0 then begin end; 1931 1998 if code <> 0 then 1932 1999 Exit; … … 1967 2034 1968 2035 procedure TfrmODMedNVA.chkPRNClick(Sender: TObject); 1969 begin 1970 inherited; 1971 if chkPRN.Checked then lblAdminTime.Caption := '' 2036 var 2037 tempSch: string; 2038 PRNPos: integer; 2039 begin 2040 inherited; 2041 {if chkPRN.Checked then lblAdminTime.Caption := '' 1972 2042 else 1973 2043 begin 1974 2044 lblAdminTime.Caption := FAdminTimeLbl; 2045 end; 2046 ControlChange(Self); 2047 } 2048 if chkPRN.Checked then 2049 begin 2050 lblAdminTime.Caption := ''; 2051 PrnPos := Pos('PRN',cboSchedule.Text); 2052 if (PrnPos < 1) then 2053 UpdateStartExpires(cboSchedule.Text + ' PRN'); 2054 end 2055 else 2056 begin 2057 if Length(Trim(cboSchedule.Text))>0 then 2058 begin 2059 tempSch := ';'+Trim(cboSchedule.Text); 2060 UpdateStartExpires(tempSch); 2061 end; 2062 lblAdminTime.Caption := FAdminTimeLbl; 2063 1975 2064 end; 1976 2065 ControlChange(Self); … … 2194 2283 end; 2195 2284 2285 procedure TfrmODMedNVA.DispOrderMessage(const AMessage: string); 2286 begin 2287 if ContainsVisibleChar(AMessage) then 2288 begin 2289 image1.Visible := True; 2290 memDrugMsg.Visible := True; 2291 image1.Picture.Icon.Handle := LoadIcon(0, IDI_ASTERISK); 2292 memDrugMsg.Lines.Clear; 2293 memDrugMsg.Lines.SetText(PChar(AMessage)); 2294 if fShrinkDrugMsg then 2295 begin 2296 pnlBottom.Height := pnlBottom.Height + memDrugMsg.Height + 2; 2297 fShrinkDrugMsg := False; 2298 end; 2299 end else 2300 begin 2301 image1.Visible := False; 2302 memDrugMsg.Visible := False; 2303 if not fShrinkDrugMsg then 2304 // begin 2305 // pnlBottom.Height := pnlBottom.Height - memDrugMsg.Height - 2; 2306 fShrinkDrugMsg := True; 2307 // end; 2308 end; 2309 end; 2310 2196 2311 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedOIFA.dfm
r459 r460 1 inherited frmODMedOIFA: TfrmODMedOIFA 2 Width = 316 1 object frmODMedOIFA: TfrmODMedOIFA 2 Left = 0 3 Top = 0 4 Width = 313 3 5 Height = 205 4 6 Caption = 'Formulary Alternatives' 7 Color = clBtnFace 8 Font.Charset = DEFAULT_CHARSET 9 Font.Color = clWindowText 10 Font.Height = -11 11 Font.Name = 'MS Sans Serif' 12 Font.Style = [] 13 FormStyle = fsStayOnTop 14 OldCreateOrder = True 15 Position = poMainFormCenter 16 OnClose = FormClose 5 17 OnCreate = FormCreate 18 OnShow = FormShow 6 19 PixelsPerInch = 96 7 20 TextHeight = 13 8 21 object Label1: TLabel 9 Left = 810 Top = 811 Width = 27322 Left = 0 23 Top = 0 24 Width = 305 12 25 Height = 13 26 Align = alTop 13 27 Caption = 'The selected drug is not in the formulary. Alternatives are:' 14 28 end 15 29 object Label2: TStaticText 16 Left = 817 Top = 1 2718 Width = 25030 Left = 0 31 Top = 134 32 Width = 305 19 33 Height = 17 34 Align = alBottom 20 35 Caption = 'Do you wish to use the selected alternative instead?' 21 TabOrder = 336 TabOrder = 1 22 37 end 23 38 object lstFormAlt: TORListBox 24 Left = 8 25 Top = 22 26 Width = 292 27 Height = 97 39 Left = 0 40 Top = 13 41 Width = 305 42 Height = 121 43 Align = alClient 28 44 ItemHeight = 13 29 45 ParentShowHint = False … … 36 52 Pieces = '2' 37 53 end 38 object cmdYes: TButton 39 Left = 74 40 Top = 148 41 Width = 72 42 Height = 21 43 Caption = 'Yes' 44 Default = True 45 Enabled = False 46 TabOrder = 1 47 OnClick = cmdYesClick 48 end 49 object cmdNo: TButton 50 Left = 162 51 Top = 148 52 Width = 72 53 Height = 21 54 Cancel = True 55 Caption = 'No' 56 TabOrder = 2 57 OnClick = cmdNoClick 54 object btnPanel: TPanel 55 Left = 0 56 Top = 151 57 Width = 305 58 Height = 27 59 Align = alBottom 60 BevelOuter = bvNone 61 TabOrder = 3 62 object cmdYes: TButton 63 Left = 74 64 Top = 3 65 Width = 72 66 Height = 21 67 Caption = 'Yes' 68 Default = True 69 Enabled = False 70 TabOrder = 0 71 OnClick = cmdYesClick 72 end 73 object cmdNo: TButton 74 Left = 162 75 Top = 3 76 Width = 72 77 Height = 21 78 Cancel = True 79 Caption = 'No' 80 TabOrder = 1 81 OnClick = cmdNoClick 82 end 58 83 end 59 84 end -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedOIFA.pas
r459 r460 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, StdCtrls, ORCtrls;7 StdCtrls, ORCtrls, ExtCtrls, fAutoSz; 8 8 9 9 type 10 TfrmODMedOIFA = class(T frmAutoSz)10 TfrmODMedOIFA = class(TForm) 11 11 Label1: TLabel; 12 12 lstFormAlt: TORListBox; 13 13 Label2: TStaticText; 14 btnPanel: TPanel; 14 15 cmdYes: TButton; 15 16 cmdNo: TButton; … … 18 19 procedure cmdNoClick(Sender: TObject); 19 20 procedure lstFormAltClick(Sender: TObject); 21 procedure FormShow(Sender: TObject); 22 procedure FormClose(Sender: TObject; var Action: TCloseAction); 20 23 private 21 24 FSelected: string; … … 30 33 {$R *.DFM} 31 34 32 uses ORFn, rODMeds ;35 uses ORFn, rODMeds, rMisc; 33 36 34 37 procedure CheckFormularyOI(var AnIEN: Integer; var AName: string; ForInpatient: Boolean); … … 130 133 end; 131 134 135 procedure TfrmODMedOIFA.FormShow(Sender: TObject); 136 begin 137 inherited; 138 SetFormPosition(Self); 139 end; 140 141 procedure TfrmODMedOIFA.FormClose(Sender: TObject; 142 var Action: TCloseAction); 143 begin 144 inherited; 145 SaveUserBounds(Self); 146 end; 147 132 148 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMeds.dfm
r459 r460 1 1 inherited frmODMeds: TfrmODMeds 2 Left = 2023 Top = 612 Left = 519 3 Top = 204 4 4 Width = 584 5 Height = 4945 Height = 515 6 6 HorzScrollBar.Range = 558 7 HorzScrollBar.Visible = True8 7 VertScrollBar.Range = 399 9 VertScrollBar.Visible = True10 AutoScroll = False11 8 Caption = 'Medication Order' 12 9 Constraints.MinHeight = 325 … … 15 12 DesignSize = ( 16 13 576 17 4 60)14 488) 18 15 PixelsPerInch = 96 19 16 TextHeight = 13 … … 22 19 Top = 34 23 20 Width = 580 24 Height = 39221 Height = 413 25 22 Anchors = [akLeft, akTop, akRight, akBottom] 26 23 BevelOuter = bvNone … … 71 68 Top = 137 72 69 Width = 580 73 Height = 2 5570 Height = 276 74 71 Align = alClient 75 72 BevelInner = bvLowered … … 101 98 end 102 99 inherited memOrder: TCaptionMemo 103 Top = 4 27100 Top = 448 104 101 Width = 502 105 102 Anchors = [akLeft, akRight, akBottom] … … 122 119 object btnSelect: TButton [3] 123 120 Left = 515 124 Top = 4 27121 Top = 448 125 122 Width = 72 126 123 Height = 21 … … 134 131 inherited cmdAccept: TButton 135 132 Left = 514 136 Top = 4 27133 Top = 448 137 134 Anchors = [akRight, akBottom] 138 135 TabOrder = 6 … … 142 139 inherited cmdQuit: TButton 143 140 Left = 514 144 Top = 4 52141 Top = 473 145 142 Width = 51 146 143 Anchors = [akRight, akBottom] … … 159 156 Top = 34 160 157 Width = 580 161 Height = 392158 Height = 413 162 159 Anchors = [akLeft, akTop, akRight, akBottom] 163 160 BevelOuter = bvNone … … 170 167 Top = 0 171 168 Width = 580 172 Height = 1 73169 Height = 184 173 170 Align = alClient 174 171 Constraints.MinHeight = 80 … … 176 173 DesignSize = ( 177 174 580 178 1 73)175 184) 179 176 object lblRoute: TLabel 180 177 Left = 280 … … 197 194 end 198 195 object txtNSS: TLabel 199 Left = 4 52196 Left = 442 200 197 Top = 22 201 Width = 7 6198 Width = 71 202 199 Height = 13 203 200 Anchors = [akTop, akRight] 204 Caption = '( Non-standard?)'201 Caption = '(Day-Of-Week)' 205 202 Font.Charset = DEFAULT_CHARSET 206 203 Font.Color = clBlue … … 217 214 Top = 36 218 215 Width = 580 219 Height = 1 32216 Height = 143 220 217 Anchors = [akLeft, akTop, akRight, akBottom] 221 218 ColCount = 6 … … 280 277 Top = 36 281 278 Width = 279 282 Height = 1 32279 Height = 143 283 280 Anchors = [akLeft, akTop, akRight, akBottom] 284 281 Style = orcsSimple … … 302 299 OnClick = cboDosageClick 303 300 OnExit = cboDosageExit 301 OnKeyUp = cboDosageKeyUp 304 302 CharsNeedMatch = 1 305 303 UniqueAutoComplete = True … … 309 307 Top = 36 310 308 Width = 113 311 Height = 1 32309 Height = 143 312 310 Anchors = [akTop, akRight, akBottom] 313 311 Style = orcsSimple … … 339 337 Top = 36 340 338 Width = 178 341 Height = 1 32339 Height = 143 342 340 Anchors = [akTop, akRight, akBottom] 343 341 Style = orcsSimple … … 426 424 OnExit = cboXDosageExit 427 425 OnKeyDown = memMessageKeyDown 426 OnKeyUp = cboXDosageKeyUp 428 427 CharsNeedMatch = 1 429 428 UniqueAutoComplete = True … … 546 545 Width = 38 547 546 Height = 19 547 Hint = 'A duration must be defined if using "Then" as a sequence.' 548 548 Caption = 'then' 549 549 Glyph.Data = { … … 556 556 Layout = blGlyphRight 557 557 NumGlyphs = 2 558 ParentShowHint = False 559 ShowHint = True 558 560 Spacing = 1 559 561 OnClick = btnXSequenceClick 562 end 563 object SpeedButton1: TSpeedButton 564 Left = 16 565 Top = 16 566 Width = 23 567 Height = 22 560 568 end 561 569 end … … 598 606 OnChange = cboXScheduleChange 599 607 OnClick = cboXScheduleClick 608 OnEnter = cboXScheduleEnter 600 609 OnExit = cboXScheduleExit 601 610 OnKeyDown = memMessageKeyDown … … 617 626 object pnlBottom: TPanel 618 627 Left = 0 619 Top = 1 73628 Top = 184 620 629 Width = 580 621 Height = 2 19630 Height = 229 622 631 Align = alBottom 623 632 TabOrder = 6 624 633 DesignSize = ( 625 634 580 626 2 19)635 229) 627 636 object lblComment: TLabel 628 637 Left = 4 … … 666 675 end 667 676 object Image1: TImage 668 Left = 1669 Top = 1 83677 Left = 5 678 Top = 177 670 679 Width = 31 671 680 Height = 31 … … 686 695 Top = 2 687 696 Width = 513 688 Height = 4 4697 Height = 43 689 698 Anchors = [akLeft, akTop, akRight] 690 699 ScrollBars = ssVertical … … 707 716 Width = 60 708 717 Height = 21 718 AutoSize = False 709 719 TabOrder = 1 710 720 Text = '0' 711 721 OnChange = txtSupplyChange 722 OnClick = txtSupplyClick 712 723 Caption = 'Days Supply' 713 724 end … … 728 739 Width = 60 729 740 Height = 21 741 AutoSize = False 730 742 TabOrder = 3 731 743 Text = '0' 732 744 OnChange = txtQuantityChange 745 OnClick = txtQuantityClick 733 746 Caption = 'Quantity' 734 747 end … … 750 763 Width = 30 751 764 Height = 21 765 AutoSize = False 752 766 TabOrder = 5 753 767 Text = '0' 754 768 OnChange = ControlChange 769 OnClick = txtRefillsClick 755 770 Caption = 'Refills' 756 771 end … … 817 832 ItemTipColor = clWindow 818 833 ItemTipEnable = True 819 ListItemsOnly = False834 ListItemsOnly = True 820 835 LongList = False 821 836 LookupPiece = 0 … … 825 840 SynonymChars = '<>' 826 841 TabOrder = 10 827 Text = 'ROUTINE'828 842 OnChange = ControlChange 829 843 CharsNeedMatch = 1 … … 842 856 end 843 857 object lblAdminTime: TStaticText 844 Left = 26 7845 Top = 1 04858 Left = 262 859 Top = 120 846 860 Width = 4 847 861 Height = 4 848 862 TabOrder = 16 849 Visible = False850 863 end 851 864 object stcPI: TStaticText … … 885 898 object memDrugMsg: TMemo 886 899 Left = 37 887 Top = 1 83900 Top = 176 888 901 Width = 533 889 Height = 34902 Height = 51 890 903 Anchors = [akLeft, akRight, akBottom] 891 904 Color = clCream -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMeds.pas
r459 r460 86 86 memDrugMsg: TMemo; 87 87 txtNSS: TLabel; 88 SpeedButton1: TSpeedButton; 88 89 procedure FormCreate(Sender: TObject); 89 90 procedure btnSelectClick(Sender: TObject); … … 186 187 procedure cboScheduleExit(Sender: TObject); 187 188 procedure cboXScheduleExit(Sender: TObject); 189 procedure cboDosageKeyUp(Sender: TObject; var Key: Word; 190 Shift: TShiftState); 191 procedure cboXDosageKeyUp(Sender: TObject; var Key: Word; 192 Shift: TShiftState); 193 procedure txtSupplyClick(Sender: TObject); 194 procedure txtQuantityClick(Sender: TObject); 195 procedure txtRefillsClick(Sender: TObject); 196 procedure WMClose(var Msg : TWMClose); message WM_CLOSE; 197 procedure cboXScheduleEnter(Sender: TObject); 188 198 //procedure btnNSSClick(Sender: TObject); 189 199 private … … 236 246 FOrigiMsgDisp: boolean; 237 247 FNSSOther: boolean; 238 FFromClick: boolean;248 {selection} 239 249 FShowPnlXScheduleOk : boolean; 240 250 FRemoveText : Boolean; 241 {selection}251 FSmplPRNChkd: Boolean; 242 252 procedure ChangeDelayed; 243 253 function FindQuickOrder(const x: string): Integer; … … 302 312 // function ValidateRoute(RouteCombo: TORComboBox) : Boolean; Removed based on Site feeback. See CQ: 7518 303 313 function IsSupplyAndOutPatient : boolean; 314 function GetSchedListIndex(SchedCombo: TORComboBox; pSchedule: String):integer; 304 315 protected 305 316 procedure InitDialog; override; 306 317 procedure Validate(var AnErrMsg: string); override; 307 318 public 319 ARow1: integer; 308 320 procedure SetupDialog(OrderAction: Integer; const ID: string); override; 309 321 procedure CheckDecimal(var AStr: string); … … 319 331 320 332 uses rCore, uCore, ORFn, rODMeds, rODBase, rOrders, fRptBox, fODMedOIFA, 321 uAccessibleStringGrid, uOrders, fOtherSchedule, StrUtils ;333 uAccessibleStringGrid, uOrders, fOtherSchedule, StrUtils, fFrame; 322 334 323 335 const … … 329 341 COL_DURATION = 4; 330 342 COL_SEQUENCE = 5; 343 COL_CHKXPRN = 6; 331 344 VAL_DOSAGE = 10; 332 345 VAL_ROUTE = 20; … … 334 347 VAL_DURATION = 40; 335 348 VAL_SEQUENCE = 50; 349 VAL_CHKXPRN = 60; 336 350 TAB = #9; 337 351 {field identifiers} … … 387 401 TC_NO_DEA = 'DEA# Required'; 388 402 TX_NO_MED = 'Medication must be selected.'; 403 TX_NO_SEQ = 'Missing one or more conjunction.'; 389 404 TX_NO_DOSE = 'Dosage must be entered.'; 390 405 TX_DOSE_NUM = 'Dosage may not be numeric only'; … … 422 437 x: string; 423 438 begin 439 frmFrame.pnlVisit.Enabled := false; 424 440 AutoSizeDisabled := True; 425 441 inherited; 426 442 btnXDuration.Align := alClient; 427 443 AllowQuickOrder := True; 444 FSmplPRNChkd := False; // GE CQ7585 428 445 CheckAuthForMeds(x); 429 446 if Length(x) > 0 then … … 456 473 {if not FInptDlg then } Responses.SetPromptFormat('INSTR', '@'); 457 474 StatusText('Loading Schedules'); 458 LoadSchedules(cboSchedule.Items, FInptDlg); 475 //if (Self.EvtID > 0) then LoadSchedules(cboSchedule.Items) 476 //else LoadSchedules(cboSchedule.Items, FInptDlg); 477 LoadSchedules(cboSchedule.Items, FInptDlg); 459 478 StatusText(''); 460 479 if FInptDlg then SetControlsInpatient else SetControlsOutpatient; … … 466 485 begin 467 486 txtNss.Visible := True; 487 //cboSchedule.ListItemsOnly := True; 488 //cboXSchedule.ListItemsOnly := True; 468 489 end; 469 490 with grdDoses do … … 537 558 FAllDrugs.Free; 538 559 TAccessibleStringGrid.UnwrapControl(grdDoses); 560 frmFrame.pnlVisit.Enabled := true; 539 561 inherited; 540 562 end; … … 558 580 FQOInitial := False; 559 581 FNSSOther := False; 560 FFromClick := False;561 582 end; 562 583 563 584 procedure TfrmODMeds.SetupDialog(OrderAction: Integer; const ID: string); 564 585 var 565 AnInstr, OrderID, nsSch : string;586 AnInstr, OrderID, nsSch, Text: string; 566 587 ix: integer; 567 588 begin … … 606 627 begin 607 628 SetSchedule(nsSch); 629 {cboSchedule.SelectByID(nsSch); 630 if cboSchedule.ItemIndex < 0 then 631 begin 632 cboSchedule.Items.Add(nsSch); 633 cboSchedule.ItemIndex := cboSchedule.Items.IndexOf(nsSch); 634 end;} 608 635 end; 609 636 end; … … 611 638 end; 612 639 end; //nss 613 UpdateRelated(FALSE); 640 if ((OrderAction <> Order_COPY) and (OrderAction <> Order_EDIT)) or 641 (XfInToOutNow = true) then UpdateRelated(FALSE); //AGP Change 614 642 Changing := False; 615 643 end; … … 624 652 then AnInstr := 'Copy: ' + AnInstr 625 653 else AnInstr := 'Change: ' + AnInstr; 626 Caption := AnInstr; 654 Text := AnsiReplaceText(AnInstr,CRLF,''); 655 Caption := Text; 627 656 memComment.Clear; // sometimes the sig is in the comment 628 657 end; … … 654 683 // and is not an outpaitent order, then display error text to require route 655 684 if (Length(x) = 0) and (Not IsSupplyAndOutPatient) then 685 begin 686 if cboRoute.Showing = true then cboRoute.SetFocus; //CQ: 7467 656 687 SetError(TX_NO_ROUTE); 688 end; 657 689 if (Length(x) > 0) and NeedLookup then 658 690 begin 659 691 LookupRoute(x, RouteID, RouteAbbr); 660 692 if RouteID = '0' 661 then SetError(TX_NF_ROUTE) 693 then 694 begin 695 if cboRoute.Showing = true then cboRoute.SetFocus; //CQ: 7467 696 SetError(TX_NF_ROUTE); 697 end 662 698 else Responses.Update('ROUTE', AnInstance, RouteID, RouteAbbr); 663 699 end; … … 678 714 else if (Length(tmpX) = 0) and FInptDlg and ScheduleRequired(txtMed.Tag, ARoute, ADrug) 679 715 then SetError(TX_NO_SCHED); 680 681 716 if Length(tmpX) > 0 then 682 717 begin … … 706 741 if (ValueOfResponse(FLD_DRUG_ID, i) = '') then 707 742 begin 708 if not ContainsAlpha(Responses.IValueFor('INSTR', i)) then SetError(TX_DOSE_NUM); 709 if Length(Responses.IValueFor('INSTR', i)) > 60 then SetError(TX_DOSE_LEN); 743 if not ContainsAlpha(Responses.IValueFor('INSTR', i)) then 744 begin 745 SetError(TX_DOSE_NUM); 746 if tabDose.TabIndex = TI_DOSE then 747 cboDosage.SetFocus; //CQ: 7467 748 end; 749 if Length(Responses.IValueFor('INSTR', i)) > 60 then 750 begin 751 SetError(TX_DOSE_LEN); 752 cboDosage.SetFocus; //CQ: 7467 753 end; 710 754 end; 711 755 ValidateRoute(Responses.EValueFor('ROUTE', i), Responses.IValueFor('ROUTE', i) = '', i); … … 713 757 i := Responses.NextInstance('INSTR', i); 714 758 end; 759 //AGP Change 26.45 Fix for then/and conjucntion PSI-04-069 760 if self.tabDose.TabIndex = 1 then 761 begin 762 for i := 2 to self.grdDoses.RowCount do 763 begin 764 if ((ValFor(COL_DOSAGE, i-1) <> '') and (ValFor(COL_DOSAGE, i) <> '')) and (ValFor(COL_SEQUENCE,i-1) = '') then 765 begin 766 SetError(TX_NO_SEQ); 767 Exit; 768 end; 769 end; 770 end; 715 771 if not FInptDlg then // outpatient stuff 716 772 begin … … 953 1009 UniqueText := False; 954 1010 FFromSelf := True; 1011 {AutoSelection is only based upon uniquely matching characters. 1012 Several CQs have been resolved relating to this issue: 1013 See CQ: 1014 7326 - Auto complete does not work correctly if user has quick orders in Medication list 1015 7328 - PSI-05-016: TAM-0205-31170 Med Error due to pre-populated med screen 1016 6715 PSI-04-044 Orders: NJH-0804-20315 Physician unable to enter medication order 1017 } 955 1018 if UniqueText then 956 1019 begin … … 1129 1192 QOQuantityStr := ''; 1130 1193 btnSelect.SetFocus; // let the exit events finish 1194 1131 1195 if pnlMeds.Visible then // display the medication fields 1132 1196 begin … … 1294 1358 lblQtyMsg.Caption := ''; 1295 1359 lblQuantity.Caption := 'Quantity'; 1360 FSmplPRNChkd := chkPRN.Checked; // GE CQ7585 1296 1361 chkPRN.Checked := False; 1297 1362 FLastUnits := ''; … … 1318 1383 QOPiUnChk := False; 1319 1384 PKIEnviron := False; 1320 if GetPKISite and GetPKIUse then //PKI check for crypto object on workstation 1321 begin 1322 try //PKI object creation 1323 crypto := CoXuDigSigS.Create; 1324 crypto.GetCSP; 1325 StatusText(crypto.Reason); 1326 PKIEnviron := True; 1327 except 1328 on E: Exception do 1329 begin 1330 {ShowMessage('An error has been encountered while trying to create PKI environment: '+ E.Message + 1331 '. This order will be processed without Digital Signature encryption.');} 1332 PKIEnviron := False; 1333 end; 1334 end; 1335 crypto := nil; 1336 end; 1337 if PKIEnviron = False then 1338 if GetPKISite then PKIEnviron := True; 1385 if GetPKISite then PKIEnviron := True; 1339 1386 with CtrlInits do 1340 1387 begin … … 1381 1428 end; 1382 1429 pnlTop.Height := pnlFields.Height - pnlBottom.Height; 1383 chkDoseNow.Top := memComment.Top + memComment.Height + 4;1430 chkDoseNow.Top := memComment.Top + memComment.Height + 1; 1384 1431 lblPriority.Top := memcomment.Top + memComment.Height + 1; 1385 1432 cboPriority.Top := lblPriority.Top + lblPriority.Height; 1386 1433 lblAdminTime.Left := chkDoseNow.Left; 1387 lblAdminTime.Top := chkDoseNow.Top + chkDoseNow.Height +1;1434 lblAdminTime.Top := chkDoseNow.Top + chkDoseNow.Height - 1; 1388 1435 end else 1389 1436 begin … … 1456 1503 SetDosage(IValueFor('INSTR', i)); 1457 1504 with cboDosage do 1458 if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] else x := Text; 1505 if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] 1506 else x := IValueFor('INSTR',i); //AGP Change 26.41 for CQ 9102 PSI-05-015 affect copy and edit functionality 1459 1507 grdDoses.Cells[COL_DOSAGE, i] := x; 1460 1508 SetControl(cboRoute, 'ROUTE', i); … … 1474 1522 if ItemIndex > -1 then x := x + TAB + Items[ItemIndex]; 1475 1523 grdDoses.Cells[COL_SCHEDULE, i] := x; 1524 if chkPRN.Checked = True then grdDoses.Cells[COL_CHKXPRN,i] := '1'; 1476 1525 grdDoses.Cells[COL_DURATION, i] := IValueFor('DAYS', i); 1477 1526 if IValueFor('CONJ', i) = 'A' then x := 'AND' … … 1597 1646 txtMed.SetFocus; 1598 1647 FDrugID := ''; 1599 ShowOrderMessage( False );1648 //ShowOrderMessage( False ); 1600 1649 end; 1601 1650 … … 1628 1677 1629 1678 procedure TfrmODMeds.ShowControlsSimple; 1630 var1631 dosagetxt: string;1679 //var 1680 //dosagetxt: string; 1632 1681 begin 1633 1682 //Commented out, no longer using CharsNeedMatch Property … … 1661 1710 procedure TfrmODMeds.ShowControlsComplex; 1662 1711 1663 procedure MoveCombo(SrcCombo, DestCombo: TORComboBox); 1664 begin 1665 DestCombo.Items.Clear; 1666 DestCombo.Items.Assign(SrcCombo.Items); 1667 DestCombo.ItemIndex := SrcCombo.ItemIndex; 1668 DestCombo.Text := Piece(SrcCombo.Text, TAB, 1); 1669 end; 1670 1671 var 1672 dosagetxt: string; 1712 procedure MoveCombo(SrcCombo, DestCombo: TORComboBox; CompSch: boolean = false); //AGP Changes 26.12 PSI-04-63 1713 var 1714 cnt,i,index: integer; 1715 node,text: string; 1716 begin 1717 if (CompSch = false) or not (FInptDlg)then 1718 begin 1719 DestCombo.Items.Clear; 1720 DestCombo.Items.Assign(SrcCombo.Items); 1721 DestCombo.ItemIndex := SrcCombo.ItemIndex; 1722 DestCombo.Text := Piece(SrcCombo.Text, TAB, 1); 1723 end; 1724 if (CompSch = true) and (FInptDlg) then // AGP Changes 26.12 PSI-04-63 1725 begin 1726 //AGP change 26.34 CQ 7201,6902 fix the problem with one time schedule still showing for inpatient complex orders 1727 DestCombo.ItemIndex := -1; 1728 Text := SrcCombo.Text; 1729 index := SrcCombo.ItemIndex; 1730 cnt := 0; 1731 for i := 0 to SrcCombo.Items.Count - 1 do 1732 begin 1733 node := SrcCombo.Items.Strings[i]; 1734 if piece(node,U,3) <> 'O' then 1735 begin 1736 DestCombo.Items.Add(SrcCombo.Items.Strings[i]); 1737 if Piece(node,U,1) = text then DestCombo.ItemIndex := index - cnt; 1738 end 1739 else cnt := cnt+1; 1740 end; 1741 end; 1742 end; 1743 1744 //var 1745 //dosagetxt: string; 1673 1746 begin 1674 1747 tabDose.TabIndex := TI_COMPLEX; 1675 1748 MoveCombo(cboDosage, cboXDosage); 1676 1749 MoveCombo(cboRoute, cboXRoute); 1677 MoveCombo(cboSchedule, cboXSchedule );1750 MoveCombo(cboSchedule, cboXSchedule, true); //AGP Changes 26.12 PSI-04-063 1678 1751 grdDoses.Visible := True; 1679 1752 btnXInsert.Visible := True; … … 1689 1762 ActiveControl := grdDoses; 1690 1763 //Commented out, no longer using CharsNeedMatch Property 1691 {NumCharsForMatch := 0;1764 { NumCharsForMatch := 0; 1692 1765 for i := 0 to cboXDosage.Items.Count - 1 do //find the shortest unit dose text on fifth piece 1693 1766 begin … … 1719 1792 Break; 1720 1793 end; 1721 if ((DoseIndex < 0) and (not IsTransferAction)) then Text := x 1722 else if ((DoseIndex < 0) and IsTransferAction) then Text := '' 1794 if DoseIndex <0 then Text := x 1795 (* if ((DoseIndex < 0) and (not IsTransferAction)) then Text := x 1796 else if ((DoseIndex < 0) and IsTransferAction) and (DosageTab = False) then Text := '' 1797 else if ((DoseIndex < 0) and IsTransferAction) and (DosageTab = True) then Text := x *) 1723 1798 else ItemIndex := DoseIndex; 1724 1799 end; … … 1740 1815 procedure TfrmODMeds.SetSchedule(const x: string); 1741 1816 var 1742 1817 NonPRNPart: string; 1743 1818 begin 1744 1819 cboSchedule.ItemIndex := -1; 1745 if Pos('PRN', x) > 0 then 1820 //AGP change CQ 10593, remove code to match the new expected first dose code 1821 //PSI-05-026 1822 (* if Pos('PRN', x) > 0 then 1746 1823 begin 1747 1824 NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1)); … … 1762 1839 chkPRN.Checked := True; 1763 1840 end else 1764 begin 1841 begin *) 1765 1842 chkPRN.Checked := False; 1766 1843 cboSchedule.SelectByID(x); … … 1773 1850 else 1774 1851 begin 1775 cboSchedule.Items.Add(x); 1776 cboSchedule.Text := x; 1777 cboSchedule.SelectByID(x); 1852 if Pos('PRN', x) > 0 then 1853 begin 1854 NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1)); 1855 chkPRN.Checked := True; 1856 cboSchedule.SelectByID(NonPRNPart); 1857 if cboSchedule.ItemIndex > -1 then EXIT; 1858 cboSchedule.Items.Add(NonPRNPart); 1859 cboSchedule.Text := NonPRNPart; 1860 cboSchedule.SelectByID(NonPRNPart); 1861 EXIT; 1862 end; 1863 cboSchedule.Items.Add(x); 1864 cboSchedule.Text := x; 1865 cboSchedule.SelectByID(x); 1778 1866 end; 1779 end;1780 1867 end; 1781 1868 end; 1782 1869 1783 1870 { Medication edit --------------------------------------------------------------------------- } 1784 1785 1871 procedure TfrmODMeds.tabDoseChange(Sender: TObject); 1786 1872 var 1787 x: string; 1788 1789 begin 1790 inherited; 1873 //text,x, tmpsch: string; 1874 text, x: string; 1875 reset: integer; 1876 begin 1877 inherited; 1878 reset := 0; 1879 //AGP change for CQ 6521 added warning message 1880 //AGP Change for CQ 7508 added tab information 1881 //GE Change warning message functionality show only cq 7590 1882 // when tab changes from complex to simple. 1883 //AGP Change for CQ 7834 and 7832 change text and added check to see if some values have been completed in row 1 1884 if (tabDose.TabIndex = 0) and ((ValFor(COL_DOSAGE, 1)<>'') or (ValFor(COL_SCHEDULE, 1)<>'') or (ValFor(COL_DURATION, 1)<>'') or 1885 (ValFor(COL_SEQUENCE, 1)<>'')) then 1886 begin 1887 text := 'By switching to the Dosage Tab, ' ; 1888 if (InfoBox(text +'you will lose all data on this screen. Click OK to continue or Cancel','Warning',MB_OKCANCEL)=IDCANCEL) then 1889 begin 1890 if tabDose.TabIndex = 1 then tabDose.TabIndex := 0 1891 else tabDose.TabIndex := 1; 1892 reset := 1; 1893 end; 1894 end; 1791 1895 case tabDose.TabIndex of 1792 1896 TI_DOSE: begin 1897 cboXSchedule.Clear; // Added to Fix CQ: 9603 1793 1898 // clean up responses? 1794 1899 FSuppressMsg := FOrigiMsgDisp; 1795 1900 ShowControlsSimple; 1796 ResetOnTabChange; 1901 if reset = 0 then ResetOnTabChange; 1902 txtNss.Left := lblSchedule.Left + lblSchedule.Width + 2; 1797 1903 if (FInptDlg) then txtNss.Visible := True 1798 1904 else txtNss.Visible := False; … … 1805 1911 TI_COMPLEX: begin 1806 1912 FSuppressMsg := FOrigiMsgDisp; 1913 if reset = 1 then exit; 1807 1914 ShowControlsComplex; 1808 1915 ResetOnTabChange; 1916 txtNss.Left := grdDoses.Left + grdDoses.ColWidths[0] + grdDoses.ColWidths[1] + grdDoses.ColWidths[2] + 3; 1809 1917 txtNss.Visible := False; 1810 if txtNss.Visible then txtNss.Visible := False;1811 1918 x := cboXDosage.Text + TAB; 1812 1919 with cboXDosage do if ItemIndex > -1 then x := x + Items[ItemIndex]; … … 1818 1925 with cboXSchedule do if ItemIndex > -1 then x := x + Items[ItemIndex]; 1819 1926 grdDoses.Cells[COL_SCHEDULE, 1] := x; 1927 UpdateStartExpires(ValFor(VAL_SCHEDULE,1)); 1820 1928 ControlChange(Self); 1821 1929 end; {TI_COMPLEX} 1822 1930 end; {case} 1823 1931 end; 1932 1824 1933 1825 1934 procedure TfrmODMeds.lblGuidelineClick(Sender: TObject); … … 1901 2010 1902 2011 procedure TfrmODMeds.cboDosageChange(Sender: TObject); 1903 var 1904 tmpIdx: integer; 1905 tmpTxt,tmpTxt1: string; 1906 begin 1907 inherited; 1908 //if length(cboDosage.Text) < 1 then 1909 // cboDosage.ItemIndex := -1; 2012 begin 2013 inherited; 1910 2014 UpdateRelated; 1911 2015 end; … … 1946 2050 begin 1947 2051 inherited; 1948 //if cboRoute.Text = '' then1949 // cboRoute.ItemIndex := -1;1950 2052 with cboRoute do 1951 2053 if ItemIndex > -1 then … … 1994 2096 begin 1995 2097 inherited; 1996 if (FInptDlg) and (cboSchedule.Text = 'OTHER') then2098 if (FInptDlg) and (cboSchedule.Text = 'OTHER') then 1997 2099 begin 1998 2100 othSch := CreateOtherScheduel; … … 2004 2106 end; 2005 2107 end; 2006 //if cboSchedule.Text = '' then2007 // cboSchedule.ItemIndex := -1;2008 2108 //Remove Deletion of Text, since we are changing the validation to be on exit of the control. 2009 2109 { if (Length(cboSchedule.Text)>0) and (cboSchedule.ItemIndex < 0) and FInptDlg then … … 2116 2216 if Length(Route) = 0 then Route := ValueOf(FLD_ROUTE_NM); 2117 2217 Schedule := ValueOf(FLD_SCHED_EX); 2118 if Length(Schedule) = 0 then Schedule := ValueOf(FLD_SCHEDULE); 2218 (* Schedule := Piece(Temp,U,1); 2219 if Piece(Temp,U,3) = '1' then Schedule := Schedule + ' AS NEEDED'; 2220 if UpperCase(Copy(Schedule, Length(Schedule) - 18, Length(Schedule))) = 'AS NEEDED AS NEEDED' 2221 then Schedule := Copy(Schedule, 1, Length(Schedule) - 10); *) 2222 if Length(Schedule) = 0 then 2223 begin 2224 Schedule := ValueOf(FLD_SCHEDULE); 2225 if RightStr(Schedule,3) = 'PRN' then 2226 begin 2227 Schedule := Copy(Schedule,1,Length(Schedule)-3); //Remove the Trailing PRN 2228 if (RightStr(Schedule,1) = ' ') or (RightStr(Schedule,1) = '-') then 2229 Schedule := Copy(Schedule,1,Length(Schedule)-1); 2230 Schedule := Schedule + ' AS NEEDED' 2231 end; 2232 end; 2119 2233 Result := FSIGVerb + ' ' + Dose + ' ' + Route + ' ' + Schedule; 2120 2234 end; … … 2140 2254 if Length(Route) = 0 then Route := ValueOf(FLD_ROUTE_NM, i); 2141 2255 Schedule := ValueOf(FLD_SCHED_EX, i); 2142 if Length(Schedule) = 0 then Schedule := ValueOf(FLD_SCHEDULE, i); 2256 //if Length(Schedule) = 0 then Schedule := ValueOf(FLD_SCHEDULE, i); 2257 if Length(Schedule) = 0 then 2258 begin 2259 Schedule := ValueOf(FLD_SCHEDULE); 2260 if RightStr(Schedule,3) = 'PRN' then 2261 begin 2262 Schedule := Copy(Schedule,1,Length(Schedule)-3); //Remove the Trailing PRN 2263 if (RightStr(Schedule,1) = ' ') or (RightStr(Schedule,1) = '-') then 2264 Schedule := Copy(Schedule,1,Length(Schedule)-1); 2265 Schedule := Schedule + ' AS NEEDED' 2266 end; 2267 end; 2143 2268 Duration := ValueOf(FLD_DURATION, i); 2144 2269 if Length(Duration) > 0 then Duration := 'FOR ' + Duration; … … 2241 2366 begin 2242 2367 Result := Piece(Piece(grdDoses.Cells[COL_DOSAGE, ARow], TAB, 2), U, 4); 2243 if (not FInptDlg) and (Length(FDrugID) > 0) then 2368 //AGP CHANGE 26.33 change for Remedy ticket 87476 fix for quick orders for complex 2369 //inpatient orders not displaying the correct unit dose in Pharmacy 2370 //if (not FInptDlg) and (Length(FDrugID) > 0) then 2371 if Length(FDrugID) > 0 then 2244 2372 begin 2245 2373 Result := ''; … … 2454 2582 TI_COMPLEX: 2455 2583 begin 2456 if txtNss.Visible then txtNss.Visible := False;2584 //if txtNss.Visible then txtNss.Visible := False; 2457 2585 with grdDoses do for i := 1 to Pred(RowCount) do 2458 2586 begin … … 2491 2619 else Responses.Update('ROUTE', i, '', x); 2492 2620 x := ValueOf(FLD_SCHEDULE, i); Responses.Update('SCHEDULE', i, x, x); 2621 if FSmplPRNChkd then // GE CQ7585 Carry PRN checked from simple to complex tab 2622 begin 2623 pnlXSchedule.Tag := 1; 2624 chkXPRN.Checked := True; 2625 //cboXScheduleClick(Self);// force onclick to fire when complex tab is entered 2626 FSmplPRNChkd := False; 2627 end; 2493 2628 x := ValueOf(FLD_DURATION, i); Responses.Update('DAYS', i, UpperCase(x), x); 2494 2629 x := ValueOf(FLD_SEQUENCE, i); … … 2508 2643 begin 2509 2644 Responses.Update('NOW', 1, ValueOf(FLD_NOW_ID), ValueOf(FLD_NOW_NM)); 2510 x := InpatientSig; Responses.Update('SIG', 1, TX_WPTYPE, x); 2645 x := InpatientSig; 2646 Responses.Update('SIG', 1, TX_WPTYPE, x); 2511 2647 end else // outpatient orders 2512 2648 begin … … 2548 2684 VAL_DURATION : Result := Piece(Cells[COL_DURATION, ARow], TAB, 1); 2549 2685 VAL_SEQUENCE : Result := Piece(Cells[COL_SEQUENCE, ARow], TAB, 1); 2686 VAL_CHKXPRN : Result := Cells[COL_CHKXPRN, ARow]; 2550 2687 end; 2551 2688 end; … … 2729 2866 procedure TfrmODMeds.ShowEditor(ACol, ARow: Integer; AChar: Char); 2730 2867 var 2731 x, NonPRNPart: string;2868 x,tmpText: string; 2732 2869 2733 2870 procedure PlaceControl(AControl: TWinControl); … … 2759 2896 begin 2760 2897 inherited; 2898 txtNSS.Visible := False; 2761 2899 //Make space just select editor. This blows up as soon as some joker makes a 2762 2900 //dosage starting with a space. … … 2784 2922 //grdDoses.Cells[COL_SCHEDULE, ARow] := grdDoses.Cells[COL_SCHEDULE, Pred(ARow)]; 2785 2923 end; 2786 if grdDoses.Cells[COL_SEQUENCE, Pred(ARow)] = '' then 2924 //AGP Change 26.45 remove auto-populate of the sequence field 2925 {* if grdDoses.Cells[COL_SEQUENCE, Pred(ARow)] = '' then 2787 2926 begin 2788 2927 if StrToIntDef(Piece(grdDoses.Cells[COL_DURATION, Pred(ARow)], ' ', 1), 0) > 0 2789 2928 then grdDoses.Cells[COL_SEQUENCE, Pred(ARow)] := 'THEN' 2790 2929 else grdDoses.Cells[COL_SEQUENCE, Pred(ARow)] := 'AND'; 2791 end; 2930 end; *} 2792 2931 end; 2793 2932 // set appropriate value for cboDosage … … 2806 2945 COL_SCHEDULE: begin 2807 2946 // set appropriate value for cboSchedule 2947 if FInptDlg then txtNSS.Visible := True; 2808 2948 x := Piece(grdDoses.Cells[COL_SCHEDULE, ARow], TAB, 1); 2809 2949 Changing := TRUE; 2810 chkXPRN.Checked := False; 2950 if ValFor(VAL_CHKXPRN,Arow)='1' then chkXPRN.Checked := true 2951 else chkXPRN.Checked := False; 2952 if Pos('PRN',x)>0 then 2953 begin 2954 cboXSchedule.SelectByID(x); 2955 if cboXSchedule.ItemIndex <0 then 2956 begin 2957 x := Trim(Copy(x, 1, Pos('PRN', x) - 1)); 2958 chkXPRN.Checked := true; 2959 end; 2960 end; 2811 2961 if Length(x) > 0 then 2812 2962 begin … … 2815 2965 end 2816 2966 else cboXSchedule.ItemIndex := -1; 2817 if Pos('PRN', x) > 0 then2967 (* if Pos('PRN', x) > 0 then 2818 2968 begin 2819 2969 NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1)); … … 2825 2975 if cboXSchedule.ItemIndex < 0 then cboXSchedule.Text := x; 2826 2976 end; 2827 end; 2977 end; *) 2828 2978 Changing := FALSE; 2829 2979 pnlXSequence.Tag := ARow; … … 2844 2994 btnXDuration.Caption := 'days'; 2845 2995 end; 2996 tmpText := txtXDuration.Text; //Fix for CQ: 8107 - Kloogy but works. 2846 2997 UpdateDurationControls(False); 2847 2848 2998 Changing := FALSE; 2849 2999 pnlXDuration.Tag := ARow; 2850 3000 PlaceControl(pnlXDuration); 2851 3001 txtXDuration.SetFocus; 3002 ARow1 := ARow; 3003 txtXDuration.Text := tmpText; //Fix for CQ: 8107 - Kloogy but works. 2852 3004 if AChar <> #0 then PostMessage(Handle, UM_DELAYEVENT, Ord(AChar), COL_DURATION); 2853 3005 end; 2854 3006 COL_SEQUENCE: begin 2855 3007 x := ValFor(COL_SEQUENCE, ARow); 2856 if x = '' then x := 'then';3008 //if x = '' then x := 'and'; AGP Change 26.46 remove for CQ 9535 2857 3009 btnXSequence.Caption := x; 2858 3010 pnlXSequence.Caption := btnXSequence.Caption; 2859 3011 pnlXSequence.Tag := ARow; 3012 ARow1 := ARow; 2860 3013 PlaceControl(pnlXSequence); 2861 btnXSequence.Width := pnlXSequence.Width; 3014 btnXSequence.Width := pnlXSequence.Width; 2862 3015 end; 2863 3016 end; {case ACol} … … 2929 3082 then lblQtyMsg.Caption := TX_QTY_PRE + x + TX_QTY_POST 2930 3083 else lblQtyMsg.Caption := ''; 2931 2932 3084 end; 2933 3085 … … 2985 3137 cboXRoute.ItemIndex := -1; 2986 3138 Exit; 2987 end; 3139 end; 2988 3140 cboXRouteClick(Self); 2989 3141 cboXRoute.Tag := -1; … … 3013 3165 procedure TfrmODMeds.cboXScheduleChange(Sender: TObject); 3014 3166 var 3015 othSch, x , PRN: string;3167 othSch, x: string; 3016 3168 idx : integer; 3017 3169 begin … … 3031 3183 end; 3032 3184 end; 3033 3185 (* if chkXPRN.Checked then PRN := ' PRN' else PRN := ''; 3034 3186 with cboXSchedule do if ItemIndex > -1 3035 3187 then x := Text + PRN + TAB + Items[ItemIndex] 3036 else x := Text + PRN; 3188 else x := Text + PRN; *) 3189 with cboXSchedule do if ItemIndex > -1 3190 then x := Text + TAB + Items[ItemIndex] 3191 else x := Text; 3037 3192 grdDoses.Cells[COL_SCHEDULE, pnlXSchedule.Tag] := x; 3193 self.cboSchedule.Text := x; 3038 3194 UpdateRelated; 3039 3195 end; … … 3042 3198 procedure TfrmODMeds.cboXScheduleClick(Sender: TObject); 3043 3199 var 3044 x, PRN: string; 3045 begin 3046 inherited; 3047 if chkXPRN.Checked then PRN := ' PRN' else PRN := ''; 3200 x: string; 3201 begin 3202 inherited; 3203 //if chkXPRN.Checked then PRN := ' PRN' else PRN := ''; 3204 (* with cboXSchedule do if ItemIndex > -1 3205 then x := Text + PRN + TAB + Items[ItemIndex] 3206 else x := Text + PRN; *) 3048 3207 with cboXSchedule do if ItemIndex > -1 3049 then x := Text + PRN +TAB + Items[ItemIndex]3050 else x := Text + PRN;3051 if (Pos('PRN',X)>0) and (pnlXSchedule.Tag = 1) then3208 then x := Text + TAB + Items[ItemIndex] 3209 else x := Text; 3210 (* if (Pos('PRN',X)>0) and (pnlXSchedule.Tag = 1) then 3052 3211 if lblAdmintime.visible then 3053 lblAdmintime.Caption := ''; 3212 lblAdmintime.Caption := ''; *) 3054 3213 grdDoses.Cells[COL_SCHEDULE, pnlXSchedule.Tag] := x; 3214 UpdateStartExpires(x); 3055 3215 UpdateRelated; 3056 3216 end; 3057 3217 3058 3218 procedure TfrmODMeds.chkXPRNClick(Sender: TObject); 3059 begin 3060 inherited; 3219 var 3220 check: string; 3221 begin 3222 inherited; 3223 if self.chkXPRN.Checked = True then check := '1' 3224 else check := '0'; 3225 self.grdDoses.Cells[COL_CHKXPRN, self.grdDoses.Row] := check; 3061 3226 if not Changing then cboXScheduleClick(Self); 3062 3227 end; … … 3096 3261 var 3097 3262 I, Code: Integer; 3263 OrgValue: string; 3098 3264 begin 3099 3265 inherited; … … 3103 3269 Val(txtXDuration.Text, I, Code); 3104 3270 UpdateDurationControls(Code <> 0); 3105 if (Code <> 0) and (I=0) then 3106 begin 3107 ShowMessage('Free text input is not allowed!'); 3108 txtXDuration.Text := '0'; 3271 //Commented out the "and" to resolve CQ: 7557 3272 if (Code <> 0) {and (I=0)} then 3273 begin 3274 ShowMessage('Please use numeric characters only.'); 3275 with txtXDuration do 3276 begin 3277 Text := IntToStr(I); 3278 SelStart := Length(Text); 3279 end; 3109 3280 Exit; 3110 3281 btnXDuration.Width := 8; … … 3114 3285 PopDuration.Items.Tag := 0; 3115 3286 btnXDuration.Caption := ''; 3116 end 3287 end; 3288 {AGP change 26.19 for PSI-05-018 cq #7322 3117 3289 else if PopDuration.Items.Tag = 0 then 3118 3290 begin 3119 3291 PopDuration.Items.Tag := 3; //Days selection 3120 3292 btnXDuration.Caption := 'days'; 3121 end; 3293 end; } 3122 3294 grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := txtXDuration.Text + ' ' + Uppercase(btnXDuration.Caption); 3123 end else grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := ''; 3295 end else //AGP CHANGE ORDER 3296 begin 3297 if not(FInptDlg) then grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := ''; 3298 OrgValue := ValFor(COL_DURATION, pnlxDuration.tag); 3299 //if ((txtXDuration.Text = '0') or (txtXDuration.Text = '')) and ((ValFor(COL_SEQUENCE, ARow1) = 'THEN') and (FInptDlg)) then //AGP CHANGE ORDER 3300 //AGP change 26.33 Then/And conjunction requiring a duration to include outpatient orders also 3301 if ((txtXDuration.Text = '0') or (txtXDuration.Text = '')) and (ValFor(COL_SEQUENCE, ARow1) = 'THEN') then //AGP CHANGE ORDER 3302 begin 3303 if (InfoBox('A duration is required when using "Then" as a sequence.'+CRLF+'"Then" will be remove from the sequence field if you continue'+ 3304 CRLF+'Click "OK" to continue or click "Cancel"','Duration Warning', MB_OKCANCEL)=1) then 3305 begin 3306 grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := ''; 3307 pnlXSequence.Tag := ARow1; 3308 pnlXSequence.Caption := ''; 3309 grdDoses.Cells[COL_SEQUENCE, pnlXSequence.Tag] := ''; 3310 btnXSequence.Click; 3311 end 3312 else 3313 grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := OrgValue; 3314 end 3315 else grdDoses.Cells[COL_DURATION, pnlXDuration.Tag] := txtXDuration.Text; 3316 end; 3317 // end; 3124 3318 ControlChange(Self); 3125 3319 UpdateRelated; … … 3151 3345 begin 3152 3346 inherited; 3347 inherited; 3153 3348 with TSpeedButton(Sender) do APoint := ClientToScreen(Point(0, Height)); 3154 3349 popXSequence.Popup(APoint.X, APoint.Y); 3155 3350 pnlXSequence.Caption := btnXSequence.Caption; 3351 { 3352 with TSpeedButton(Sender) do APoint := ClientToScreen(Point(0, Height)); 3353 popXSequence.Popup(APoint.X, APoint.Y); 3354 pnlXSequence.Caption := btnXSequence.Caption; 3355 if (pnlXSequence.Caption = 'then') and 3356 ((ValFor(COL_DURATION, ARow1) = '') or 3357 (ValFor(COL_DURATION, ARow1) = '0')) then 3358 begin 3359 InfoBox('A duration is required when using "Then" as a conjunction','Duration Warning',MB_OK); 3360 pnlXSequence.Caption := ''; 3361 btnXSequence.Caption := ''; 3362 end; 3363 } 3156 3364 end; 3157 3365 … … 3162 3370 inherited; 3163 3371 with TMenuItem(Sender) do if Tag > 0 then x := Caption else x := ''; 3372 //AGP Changes 26.12 PSI-04-63 3373 //if ((x = 'then') and (FInptDlg)) and ((ValFor(COL_DURATION, ARow1) = '') or (ValFor(COL_DURATION, ARow1) = '0')) then 3374 //AGP change 26.32 Then/And conjunction requiring a duration to include outpatient orders 3375 if (x = 'then') and ((ValFor(COL_DURATION, ARow1) = '') or (ValFor(COL_DURATION, ARow1) = '0')) then 3376 begin 3377 InfoBox('A duration is required when using "Then" as a conjunction' + CRLF + CRLF+ 3378 'The patient will be instructed to take these doses consecutively, not concurrently.','Duration Warning',MB_OK); 3379 x := ''; 3380 end; 3164 3381 btnXSequence.Caption := x; 3165 3382 pnlXSequence.Caption := btnXSequence.Caption; … … 3279 3496 FLD_ROUTE_EX : with cboRoute do 3280 3497 if ItemIndex > -1 then Result := Piece(Items[ItemIndex], U, 4); 3281 FLD_SCHEDULE : begin 3498 FLD_SCHEDULE : begin //gary) 3282 3499 Result := UpperCase(Trim(cboSchedule.Text)); 3283 3500 if chkPRN.Checked then Result := Result + ' PRN'; … … 3287 3504 FLD_SCHED_EX : begin 3288 3505 with cboSchedule do 3506 begin 3289 3507 if ItemIndex > -1 then Result := Piece(Items[ItemIndex], U, 2); 3508 (* if (Length(Result)=0) and (ItemIndex > -1) then 3509 begin 3510 Result := Piece(Items[ItemIndex], U, 1); 3511 if Piece(Items[ItemIndex], U, 3) = 'P' then 3512 begin 3513 if RightStr(Result,3) = 'PRN' then 3514 begin 3515 Result := Copy(Result,1,Length(Result)-3); //Remove the Trailing PRN 3516 if (RightStr(Result,1) = ' ') or (RightStr(Result,1) = '-') then 3517 Result := Copy(Result,1,Length(Result)-1); 3518 end; 3519 Result := Result + ' AS NEEDED'; 3520 end; 3521 end; 3522 end; *) 3523 if RightStr(Result,3) = 'PRN' then 3524 begin 3525 Result := Copy(Result,1,Length(Result)-3); //Remove the Trailing PRN 3526 if (RightStr(Result,1) = ' ') or (RightStr(Result,1) = '-') then 3527 Result := Copy(Result,1,Length(Result)-1); 3528 Result := Result + ' AS NEEDED' 3529 end; 3290 3530 if (Length(Result) > 0) and chkPRN.Checked then Result := Result + ' AS NEEDED'; 3291 3531 if UpperCase(Copy(Result, Length(Result) - 18, Length(Result))) = 'AS NEEDED AS NEEDED' 3292 3532 then Result := Copy(Result, 1, Length(Result) - 10); 3533 if UpperCase(Copy(Result, Length(Result) - 12, Length(Result))) = 'PRN AS NEEDED' then 3534 begin 3535 Result := Copy(Result, 1, Length(Result) - 13); 3536 if RightStr(Result,1)=' ' then Result := Result + 'AS NEEDED' 3537 else Result := Result + ' AS NEEDED'; 3538 end; 3539 end; 3293 3540 end; 3294 3541 FLD_SCHED_TYP : with cboSchedule do … … 3330 3577 FLD_ROUTE_AB : Result := Piece(Piece(Cells[COL_ROUTE, ARow], TAB, 2), U, 3); 3331 3578 FLD_ROUTE_EX : Result := Piece(Piece(Cells[COL_ROUTE, ARow], TAB, 2), U, 4); 3332 FLD_SCHEDULE : Result := Piece(Cells[COL_SCHEDULE, ARow], TAB, 1); 3579 FLD_SCHEDULE : begin 3580 Result := Piece(Piece(Cells[COL_SCHEDULE, ARow], TAB, 2), U, 1); 3581 if Result = '' then Result := Piece(Cells[COL_SCHEDULE, ARow], TAB, 1); 3582 if valFor(VAL_CHKXPRN,ARow)='1' then Result := Result + ' PRN'; 3583 if UpperCase(Copy(Result, Length(Result) - 6, Length(Result))) = 'PRN PRN' then 3584 Result := Copy(Result, 1, Length(Result) - 4); 3585 end; 3333 3586 FLD_SCHED_EX : begin 3334 Result := Piece(Piece(Cells[COL_SCHEDULE, ARow], TAB, 2), U, 2);3587 (*Result := Piece(Piece(Cells[COL_SCHEDULE, ARow], TAB, 2), U, 2); 3335 3588 if Result = '' then //Added for CQ: 7639 3336 3589 begin … … 3343 3596 (Pos('PRN', Piece(Cells[COL_SCHEDULE, ARow], TAB, 1)) > 0) 3344 3597 then Result := Result + ' AS NEEDED'; 3598 end;*) 3599 Result := Piece(Piece(Cells[COL_SCHEDULE, ARow], TAB, 2),U,2); 3600 if Result = '' then Result := Piece(Piece(Cells[COL_SCHEDULE, ARow], TAB, 2),U,1); //Added for CQ: 7639 3601 if Result = '' then Result := Piece(Cells[COL_SCHEDULE, ARow], TAB, 1); 3602 if RightStr(Result,3) = 'PRN' then 3603 begin 3604 Result := Copy(Result,1,Length(Result)-3); //Remove the Trailing PRN 3605 if (RightStr(Result,1) = ' ') or (RightStr(Result,1) = '-') then 3606 Result := Copy(Result,1,Length(Result)-1); 3607 Result := Result + ' AS NEEDED'; 3608 end; 3609 if valFor(VAL_CHKXPRN,ARow)='1' then Result := Result + ' AS NEEDED'; 3610 if UpperCase(Copy(Result, Length(Result) - 18, Length(Result))) = 'AS NEEDED AS NEEDED' 3611 then Result := Copy(Result, 1, Length(Result) - 10); 3612 if UpperCase(Copy(Result, Length(Result) - 12, Length(Result))) = 'PRN AS NEEDED' then 3613 begin 3614 Result := Copy(Result, 1, Length(Result) - 13); 3615 if RightStr(Result,1)=' ' then Result := Result + 'AS NEEDED' 3616 else Result := Result + ' AS NEEDED'; 3617 end; 3345 3618 end; 3346 3619 FLD_SCHED_TYP : Result := Piece(Piece(Cells[COL_SCHEDULE, ARow], TAB, 2), U, 3); … … 3552 3825 procedure TfrmODMeds.UpdateStartExpires(const CurSchedule: string); 3553 3826 var 3554 ShowText, Duration, ASchedule: string;3827 CompSch, ShowText, Duration, ASchedule: string; 3555 3828 AdminTime: TFMDateTime; 3556 Interval, PrnPos: Integer;3829 i, j, Interval, PrnPos: Integer; 3557 3830 begin 3558 3831 if Length(CurSchedule)=0 then Exit; 3559 3832 ASchedule := Trim(CurSchedule); 3560 if (Pos('^',ASchedule)=0) then 3561 begin 3562 PrnPos := Pos('PRN',ASchedule); 3563 if (PrnPos > 1) and (CharAt(ASchedule,PrnPos-1) <> ';') then 3564 Delete(ASchedule, PrnPos, Length(ASchedule)); 3565 end 3566 else if (Pos('^',ASchedule)>0) then 3833 if (Pos('^',ASchedule)>0) then 3567 3834 begin 3568 3835 PrnPos := Pos('PRN',ASchedule); … … 3571 3838 end; 3572 3839 ASchedule := Trim(ASchedule); 3840 if self.tabDose.TabIndex = TI_COMPLEX then 3841 begin 3842 CompSch := valFor(VAL_SCHEDULE,1); 3843 if CompSch = '' then 3844 begin 3845 ASchedule := ''; 3846 AdminTime := -1; 3847 end; 3848 if CompSch <> '' then 3849 begin 3850 for i := 0 to self.cboXSchedule.Items.Count-1 do 3851 begin 3852 if (Piece(self.cboXSchedule.Items.Strings[i],U,1) = CompSch) and (Piece(self.cboXSchedule.Items.Strings[i],U,3)='P') then 3853 begin 3854 AdminTime := -1; 3855 Aschedule := ''; 3856 end; 3857 end; 3858 end; 3859 if valFor(VAL_CHKXPRN,1)='1' then 3860 begin 3861 AdminTime := -1; 3862 Aschedule := ''; 3863 end; 3864 if (ASchedule <> '') and (CompSch <> '') then ASchedule := ';' + CompSch; 3865 end; 3573 3866 if Length(ASchedule)>0 then 3574 LoadAdminInfo(ASchedule, txtMed.Tag, ShowText, AdminTime, Duration) 3575 else Exit; 3867 LoadAdminInfo(ASchedule, txtMed.Tag, ShowText, AdminTime, Duration); 3868 //else Exit; 3869 if (AdminTime > 0) and (self.tabDose.TabIndex = TI_DOSE) then 3870 begin 3871 if self.cboSchedule.ItemIndex = -1 then 3872 begin 3873 for j := 0 to self.cboSchedule.items.Count -1 do 3874 begin 3875 if (Piece(self.cboSchedule.Items.Strings[j],U,1) = Piece(Aschedule,';',2)) and (Piece(self.cboSchedule.Items.Strings[j],U,3)='P') then 3876 begin 3877 AdminTime := -1; 3878 break; 3879 end; 3880 end; 3881 end; 3882 if (self.cboSchedule.ItemIndex > -1) and (Piece(self.cboSchedule.Items.Strings[self.cboSchedule.ItemIndex],U,3)='P') then 3883 AdminTime := -1; 3884 if self.chkPRN.Checked = true then AdminTime := -1 3885 end; 3576 3886 if AdminTime > 0 then 3577 3887 begin … … 3630 3940 CurSupply, i, pNum, j: Integer; 3631 3941 CurQuantity: double; 3632 LackQtyInfo, SaveChanging : Boolean;3942 LackQtyInfo, SaveChanging, DispFirstDose: Boolean; 3633 3943 begin 3634 3944 inherited; … … 3637 3947 SaveChanging := Changing; 3638 3948 Changing := TRUE; 3949 DispFirstDose := FALSE; 3639 3950 // don't allow Exit procedure so Changing gets reset appropriately 3640 3951 CurUnits := ''; … … 3700 4011 or ((Length(cboSchedule.Text)>0) and (cboSchedule.ItemIndex < 0)) then 3701 4012 begin 3702 if (chkDoseNow.Checked) and (chkDoseNow.Visible) then 4013 if (chkDoseNow.Checked) and (chkDoseNow.Visible) then 4014 begin 4015 chkDoseNowClick(Self); 4016 chkDoseNow.Checked := False; 4017 end; 4018 for i := 0 to cboSchedule.Items.Count-1 do 3703 4019 begin 3704 chkDoseNowClick(Self); 3705 chkDoseNow.Checked := False; 4020 if Piece(cboSchedule.Items.Strings[i],U,1) = Uppercase(cboSchedule.Text) then 4021 begin 4022 DispFirstDose := True; 4023 break; 4024 end; 3706 4025 end; 3707 chkDoseNow.Visible := False; 3708 lblAdminTime.Visible := False; 4026 if not DispFirstDose then 4027 begin 4028 chkDoseNow.Visible := False; 4029 lblAdminTime.Visible := False; 4030 end; 3709 4031 end 3710 4032 else … … 3715 4037 if Responses.EventType in ['A','D','T','M','O'] then lblAdminTime.Visible := False; 3716 4038 end; 3717 if not FInptDlg then4039 if not FInptDlg then 3718 4040 begin 3719 4041 CurSchedule := CurScheduleOut; 3720 if CurInstruct <> FLastInstruct4042 if (CurInstruct <> FLastInstruct) and (CurUnits <> U) //AGP Change 26.48 Do not update quantity and day supply if no matching dose on the server 3721 4043 then UpdateDefaultSupply(CurUnits, CurSchedule, CurDuration, CurDispDrug, CurSupply, CurQuantity, 3722 4044 LackQtyInfo); … … 3751 4073 3752 4074 procedure TfrmODMeds.cmdAcceptClick(Sender: TObject); 3753 begin 3754 if (cboSchedule.Text = 'OTHER') and (FInptDlg)then 4075 var 4076 i: integer; 4077 begin 4078 if (FInptDlg) and (cboSchedule.Text = 'OTHER') then 3755 4079 begin 3756 4080 cboScheduleClick(Self); 3757 4081 Exit; 3758 4082 end; 4083 //AGP Change for 26.45 PSI-04-069 4084 if self.tabDose.TabIndex = 1 then 4085 begin 4086 for i := 2 to self.grdDoses.RowCount do 4087 begin 4088 if ((ValFor(COL_DOSAGE, i-1) <> '') and (ValFor(COL_DOSAGE, i) <> '')) and (ValFor(COL_SEQUENCE,i-1) = '') then 4089 begin 4090 infoBox('To be able to complete a complex order every row except for the last row must have a conjunction defined. ' + CRLF 4091 + CRLF + 'Verify that all rows have a conjunction defined.','Sequence Error',MB_OK); 4092 Exit; 4093 end; 4094 //text := Self.cboXDosage.Items.Strings[i]; 4095 end; 4096 end; 3759 4097 if FInptDlg and (not FOutptIV) 3760 4098 then DisplayGroup := DisplayGroupByName('UD RX') 3761 4099 else DisplayGroup := DisplayGroupByName('O RX'); 4100 //timCheckChangesTimer(Self); 3762 4101 DropLastSequence; 3763 4102 cmdAccept.SetFocus; 3764 4103 inherited; 4104 (*if self.Responses.Cancel = true then 4105 begin 4106 self.Destroy; 4107 exit; 4108 end; *) 3765 4109 end; 3766 4110 … … 3791 4135 if length(theSch)>0 then 3792 4136 begin 3793 if ( ValueOf(FLD_SCHED_TYP) <> 'O') and (InfoBox(T1+medNm+T+T2+theSch+T+T3+'NOW"'+T4, 'Warning', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL)then4137 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 3794 4138 begin 3795 4139 chkDoseNow.Checked := False; … … 3808 4152 if (tabDose.TabIndex = TI_COMPLEX) and chkDoseNow.Checked then 3809 4153 begin 3810 if ( ValueOf(FLD_SCHED_TYP) <> 'O') and (InfoBox('Give Additional Dose Now is in addition to those listed in the table.' + CRLF +4154 if ( (ValueOf(FLD_SCHED_TYP) <> 'O') and (InfoBox('Give Additional Dose Now is in addition to those listed in the table.' + CRLF + 3811 4155 'Please adjust the duration of the first row, if necessary.', 3812 'Give Additional Dose Now for Complex Order', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL) then4156 'Give Additional Dose Now for Complex Order', MB_OKCANCEL or MB_ICONWARNING) = IDCANCEL) ) then 3813 4157 begin 3814 4158 chkDoseNow.Checked := False; … … 3908 4252 var 3909 4253 tempSch: string; 3910 begin 3911 inherited; 3912 if chkPRN.Checked then lblAdminTime.Caption := '' 4254 PRNPos: integer; 4255 begin 4256 inherited; 4257 //GE CQ 7552 4258 if chkPRN.Checked then 4259 begin 4260 lblAdminTime.Caption := ''; 4261 PrnPos := Pos('PRN',cboSchedule.Text); 4262 if (PrnPos < 1) then 4263 UpdateStartExpires(cboSchedule.Text + ' PRN'); 4264 end 3913 4265 else 3914 4266 begin … … 3918 4270 UpdateStartExpires(tempSch); 3919 4271 end; 3920 lblAdminTime.Caption := FAdminTimeLbl;4272 //lblAdminTime.Caption := FAdminTimeLbl; 3921 4273 if txtQuantity.visible then 3922 4274 cboScheduleClick(Self); … … 4031 4383 end 4032 4384 else if (Key = #13) and (ActiveControl = txtMed) then 4033 Key := #0 //Don't let the base class turn it into a forward tab! 4034 else 4035 inherited; 4385 Key := #0; //Don't let the base class turn it into a forward tab! 4036 4386 end; 4037 4387 … … 4284 4634 inherited; 4285 4635 if MessageDlg('You can also select ' + '"' + 'Other' + '"' + ' from the schedule list' 4286 + ' to create a day-of-week or admin-time onlyschedule.'4636 + ' to create a day-of-week schedule.' 4287 4637 + #13#10 + 'Click OK to launch schedule builder', 4288 4638 mtInformation, [mbOK, mbCancel],0) = mrOK then … … 4292 4642 cboSchedule.SelectByID('OTHER'); 4293 4643 cboScheduleClick(Self); 4644 end; 4645 if (tabDose.TabIndex = TI_COMPLEX) then 4646 begin 4647 cboXSchedule.SelectByID('OTHER'); 4648 CBOXScheduleChange(Self); 4294 4649 end; 4295 4650 end; … … 4325 4680 4326 4681 procedure TfrmODMeds.ValidateInpatientSchedule(ScheduleCombo: TORComboBox); 4327 begin 4328 //CQ 7575 Schedule coming across lower-case, change all schedules to Upper-Case. 4682 var 4683 tmpIndex : Integer; 4684 begin 4685 4686 {CQ: 6690 - Orders - autopopulation of schedule field - overtyping only 1 character 4687 CQ: 7280 - PTM 32-34, 42 Meds: NJH-0205-20901 MED DIALOG DROPPING FIRST LETTER (schedule)} 4688 4689 //CQ 7575 Schedule coming across lower-case, change all schedules to Upper-Case. 4329 4690 if (Length(ScheduleCombo.Text) > 0) then 4330 ScheduleCombo.Text := UpperCase(ScheduleCombo.Text); 4691 ScheduleCombo.Text := TrimLeft(UpperCase(ScheduleCombo.Text)); 4692 {if user entered schedule verify it is in list} 4693 if ScheduleCombo.ItemIndex < 0 then // CQ: 7397 4694 begin //Fix for CQ: 9299 - Outpatient Med orders will not accept free text schedule 4695 tmpIndex := GetSchedListIndex(ScheduleCombo,ScheduleCombo.Text); 4696 if tmpIndex > -1 then 4697 ScheduleCombo.ItemIndex := tmpIndex; 4698 end; 4331 4699 if (Length(ScheduleCombo.Text) > 0) and (ScheduleCombo.ItemIndex < 0) and FInptDlg then 4332 4700 begin 4333 4701 FShowPnlXScheduleOk := False; //Added for CQ: 7370 4334 4702 Application.MessageBox('Please select a valid schedule from the list.'+#13+#13+ 4335 'If you would like to create a non-standardschedule please'+4703 'If you would like to create a Day-of-Week schedule please'+ 4336 4704 ' select ''OTHER'' from the list.', 4337 4705 'Incorrect Schedule.'); … … 4344 4712 4345 4713 //Removed based on Site feeback. See CQ: 7518 4346 {function TfrmODMeds.ValidateRoute(RouteCombo: TORComboBox) : Boolean; 4347 begin 4714 (*function TfrmODMeds.ValidateRoute(RouteCombo: TORComboBox) : Boolean; 4715 begin 4716 {CQ: 7331 - Medications - Route - Can not enter any route not listed in Route field in window} 4348 4717 Result := True; 4349 4718 if (Length(RouteCombo.Text) > 0) and (RouteCombo.ItemIndex < 0) and (Not IsSupplyAndOutPatient) then … … 4356 4725 Result := False; 4357 4726 end; 4358 end; }4727 end;*) 4359 4728 4360 4729 function TfrmODMeds.isUniqueQuickOrder(iText: string): Boolean; … … 4373 4742 function TfrmODMeds.IsSupplyAndOutPatient: boolean; 4374 4743 begin 4744 {CQ: 7331 - Medications - Route - Can not enter any route not listed in Route field in window} 4375 4745 Result := False; 4376 4746 if (MedIsSupply(txtMed.Tag)) and (not FInptDlg) then … … 4378 4748 end; 4379 4749 4750 // CQ: 7397 - Inpatient med orders with PRN cancel due to invalid schedule. 4751 function TfrmODMeds.GetSchedListIndex(SchedCombo: TORComboBox; pSchedule: String):integer; 4752 var i: integer; 4753 begin 4754 result := -1; 4755 for i := 0 to SchedCombo.items.Count-1 do 4756 begin 4757 if pSchedule = SchedCombo.DisplayText[i] then 4758 begin 4759 result := i; // match found 4760 break; 4761 end; 4762 end; 4763 end; 4764 4380 4765 4381 4766 procedure TfrmODMeds.cboXScheduleExit(Sender: TObject); 4382 4767 begin 4383 4768 inherited; 4769 {CQ: 7344 - Inconsistency with Schedule box: Allows free-text entry for Complex orders, 4770 doesn't for simple orders } 4384 4771 ValidateInpatientSchedule(cboXSchedule); 4385 4772 end; 4386 4773 4774 procedure TfrmODMeds.cboDosageKeyUp(Sender: TObject; var Key: Word; 4775 Shift: TShiftState); 4776 begin 4777 inherited; 4778 //Fix for CQ: 7545 4779 if cboDosage.ItemIndex > -1 then 4780 cboDosageClick(Sender); 4781 end; 4782 4783 procedure TfrmODMeds.cboXDosageKeyUp(Sender: TObject; var Key: Word; 4784 Shift: TShiftState); 4785 begin 4786 inherited; 4787 //Fix for CQ: 7545 4788 if cboXDosage.ItemIndex > -1 then 4789 cboXDosageClick(Sender); 4790 end; 4791 4792 procedure TfrmODMeds.txtSupplyClick(Sender: TObject); 4793 begin 4794 inherited; 4795 Self.txtSupply.SelectAll; 4796 end; 4797 4798 procedure TfrmODMeds.txtQuantityClick(Sender: TObject); 4799 begin 4800 inherited; 4801 self.txtQuantity.SelectAll; 4802 end; 4803 4804 procedure TfrmODMeds.txtRefillsClick(Sender: TObject); 4805 begin 4806 inherited; 4807 self.txtRefills.SelectAll; 4808 end; 4809 4810 procedure TfrmODMeds.WMClose(var Msg: TWMClose); 4811 begin 4812 if self <> nil then 4813 begin 4814 if (self.tabDose.TabIndex = TI_Dose) then 4815 begin 4816 if Trim(cboSchedule.Text) = '' then cboSchedule.ItemIndex := -1; 4817 ValidateInpatientSchedule(cboSchedule); 4818 if self.cboSchedule.Focused = true then exit; 4819 end; 4820 if (self.tabDose.TabIndex = TI_Complex) then 4821 begin 4822 ValidateInpatientSchedule(cboXSchedule); 4823 if self.cboXSchedule.Focused = true then exit; 4824 end; 4825 end; 4826 inherited 4827 end; 4828 4829 procedure TfrmODMeds.cboXScheduleEnter(Sender: TObject); 4830 begin 4831 inherited; 4832 //agp Change CQ 10719 4833 self.chkXPRN.OnClick(self.chkXPRN); 4834 end; 4835 4387 4836 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODRad.dfm
r459 r460 8 8 Constraints.MinHeight = 344 9 9 Constraints.MinWidth = 576 10 OnPaint = FormPaint11 10 PixelsPerInch = 96 12 11 TextHeight = 13 … … 88 87 SynonymChars = '<>' 89 88 TabOrder = 0 90 OnDropDownClose = cboImTypeChange 89 OnChange = cboImTypeChange 90 OnDropDownClose = cboImTypeDropDownClose 91 91 OnExit = cboImTypeExit 92 92 CharsNeedMatch = 1 … … 241 241 TabOrder = 8 242 242 OnChange = calPreOpChange 243 OnExit = calPreOpExit 243 244 DateOnly = False 244 245 RequireTime = False … … 256 257 TabOrder = 6 257 258 OnClick = ControlChange 259 OnExit = chkIsolationExit 258 260 end 259 261 object calRequestDate: TORDateBox -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODRad.pas
r459 r460 56 56 procedure FormCreate(Sender: TObject); 57 57 procedure cboImTypeChange(Sender: TObject); 58 procedure FormPaint(Sender: TObject);59 58 procedure memReasonExit(Sender: TObject); 60 59 procedure FormResize(Sender: TObject); … … 65 64 procedure cboProcedureExit(Sender: TObject); 66 65 procedure cboImTypeExit(Sender: TObject); 66 procedure FormClose(Sender: TObject; var Action: TCloseAction); 67 procedure chkIsolationExit(Sender: TObject); 68 procedure calPreOpExit(Sender: TObject); 69 procedure cboImTypeDropDownClose(Sender: TObject); 67 70 private 68 71 FLastRadID: string; … … 71 74 FEvtDelayDiv: string; 72 75 FPredefineOrder: boolean; 76 ImageTypeChanged : boolean; 77 FFormFirstOpened: boolean; 78 function NoPregnantSelection : Boolean; 79 procedure ImageTypeChange; 80 procedure FormFirstOpened(Sender: TObject); 73 81 protected 74 82 procedure InitDialog; override; 75 83 procedure Validate(var AnErrMsg: string); override; 76 procedure SetDefaultPregant; 84 procedure SetDefaultPregant; 77 85 public 78 86 procedure SetupDialog(OrderAction: Integer; const ID: string); override; … … 83 91 {$R *.DFM} 84 92 85 uses rODBase, rODRad, rOrders, uCore, rCore, fODRadApproval, fODRadConShRes, fLkUpLocation; 93 uses rODBase, rODRad, rOrders, uCore, rCore, fODRadApproval, fODRadConShRes, fLkUpLocation, fFrame, 94 uFormMonitor; 86 95 87 96 const … … 103 112 var 104 113 Radiologist, Contract, Research: string ; 105 AName : string;114 AName, IsPregnant: string; 106 115 ALocation, AType: integer; 107 116 108 117 { TfrmODBase common methods } 109 118 … … 116 125 if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses do 117 126 begin 118 if (OrderAction = ORDER_QUICK) or (OrderAction = ORDER_ COPY) then127 if (OrderAction = ORDER_QUICK) or (OrderAction = ORDER_EDIT) or (OrderAction = ORDER_COPY) then 119 128 FPredefineOrder := True; 120 129 FEditCopy := True; … … 125 134 for i := 0 to Items.Count-1 do 126 135 if StrToIntDef(Piece(Items[i],U,4), 0) = DisplayGroup then ItemIndex := i; 136 if OrderAction = ORDER_EDIT then 137 begin 138 Enabled := False; 139 Color := clBtnFace; 140 end; 127 141 end; 128 142 if Self.EvtID>0 then … … 171 185 end; 172 186 end; 187 //hds00007460 188 tmpResp := FindResponseByName('PREGNANT',1); 189 if tmpResp <> nil then 190 if Length(tmpResp.EValue)>0 then 191 begin 192 IsPregnant := tmpResp.EValue; 193 if IsPregnant = 'YES' then 194 radPregnant.Checked := True 195 else 196 if IsPregnant = 'NO' then 197 radPregnantNo.Checked := True 198 else 199 if IsPregnant = 'UNKNOWN' then 200 radPregnantUnknown.Checked := True; 201 end; 202 //hds00007460 173 203 Changing := False; 174 204 FEditCopy := False; 175 205 OrderMessage(ImagingMessage(cboProcedure.ItemIEN)) ; 176 206 ControlChange(Self); 207 FPredefineOrder := False; 177 208 end; 178 209 end; … … 184 215 begin 185 216 if not FEditCopy then inherited; 217 186 218 FPreOpDate := ''; 187 219 FLastRadID := ''; … … 203 235 cboProcedure.Items.Add(FRadCommonCombo.Items[i]); 204 236 if FRadCommonCombo.Items.Count>0 then cboProcedure.InsertSeparator; 237 205 238 calRequestDate.Text := 'TODAY'; 206 239 SetControl(cboAvailMod, 'Modifiers'); … … 286 319 with cboCategory do if Length(ItemID) > 0 then Responses.Update('CLASS', 1, ItemID, Text); 287 320 with cboSubmit do if Length(ItemID) > 0 then Responses.Update('IMLOC', 1, ItemID, Text); 288 with radPregnant do if Checked then Responses.Update('PREGNANT', 1, 'Y' , 'Yes')321 with radPregnant do if Checked then Responses.Update('PREGNANT', 1, 'Y' , 'Yes') 289 322 else if not Enabled then Responses.Update('PREGNANT', 1, '' , ''); 290 323 with radPregnantNo do if Checked then Responses.Update('PREGNANT', 1, 'N' , 'No'); … … 387 420 with calRequestDate do 388 421 if FMDateTime = 0 then SetError(TX_NO_DATE); 422 389 423 end; 390 424 391 425 procedure TfrmODRad.cboProcedureNeedData(Sender: TObject; 392 426 const StartFrom: string; Direction, InsertAt: Integer); 427 393 428 begin 394 429 inherited ; 395 430 cboProcedure.ForDataUse(SubSetOfRadProcs(DisplayGroup, StartFrom, Direction)); 396 end;431 end; 397 432 398 433 procedure TfrmODRad.cboAvailModMouseClick(Sender: TObject); … … 402 437 Found: boolean; 403 438 begin 439 if (cboAvailMod.Items.Count < 1) or //GE 04-30-05 prevent list index out of bounds when empty 440 (cboAvailMod.ItemIndex < 0) then Exit; 404 441 Found := False; 405 442 with cboAvailMod do x := Items[ItemIndex]; … … 445 482 begin 446 483 if ItemID <> FLastRadID then 447 begin448 FLastRadID := ItemID;449 if FPredefineOrder then450 FPredefineOrder := False;451 end else Exit;484 begin 485 FLastRadID := ItemID; 486 if FPredefineOrder then 487 FPredefineOrder := False; 488 end else Exit; 452 489 Changing := True; 453 490 if Sender <> Self then … … 539 576 procedure TfrmODRad.FormCreate(Sender: TObject); 540 577 begin 578 FFormFirstOpened := TRUE; 579 ImageTypeChanged := false; 580 frmFrame.pnlVisit.Enabled := false; 541 581 AutoSizeDisabled := True; 542 582 inherited; … … 567 607 radPregnantUnknown.Enabled := False; 568 608 end else SetDefaultPregant; 609 FormMonitorBringToFrontEvent(Self, FormFirstOpened); 569 610 end; 570 611 … … 575 616 begin 576 617 inherited; 577 if FPredefineOrder then 578 FPredefineOrder := False; 579 if Changing or (cboImtype.ItemIndex = -1) then exit; 580 with cboImType do DisplayGroup := StrToIntDef(Piece(Items[ItemIndex], U, 4), 0) ; 581 if DisplayGroup = 0 then exit; 582 CtrlInits.LoadDefaults(ODForRad(Patient.DFN, FEvtDelayDiv, DisplayGroup)); // ODForRad returns TStrings with defaults 583 FPredefineOrder := False; 584 InitDialog; 585 end; 586 587 procedure TfrmODRad.FormPaint(Sender: TObject); 588 begin 589 inherited; 590 with cboImType do 591 if not FEditCopy and (ItemIEN = 0) and (DroppedDown = False) and (Application.Active) 592 then DroppedDown := True; 618 ImageTypeChanged := true; 593 619 end; 594 620 … … 679 705 end; 680 706 707 681 708 procedure TfrmODRad.cboImTypeExit(Sender: TObject); 682 709 begin 683 710 inherited; 684 if FPredefineOrder then Exit 685 else cboImTypeChange(Self); 711 ImageTypeChange; 712 end; 713 714 procedure TfrmODRad.FormClose(Sender: TObject; var Action: TCloseAction); 715 begin 716 inherited; 717 frmFrame.pnlVisit.Enabled := true; 718 FormMonitorBringToFrontEvent(Self, nil); 719 end; 720 721 procedure TfrmODRad.chkIsolationExit(Sender: TObject); 722 begin 723 inherited; 724 //Fix for CQ: 10025 725 if TabIsPressed() then 726 if NoPregnantSelection() then 727 if radPregnant.CanFocus then 728 radPregnant.SetFocus(); 729 end; 730 731 procedure TfrmODRad.calPreOpExit(Sender: TObject); 732 begin 733 inherited; 734 //Fix for CQ: 10025 735 if ShiftTabIsPressed() then 736 if NoPregnantSelection() then 737 if radPregnant.CanFocus then 738 radPregnant.SetFocus(); 739 end; 740 741 function TfrmODRad.NoPregnantSelection : Boolean; 742 begin 743 result := not ((radPregnant.Checked) or (radPregnantNo.Checked) or (radPregnantUnknown.Checked)); 744 end; 745 746 procedure TfrmODRad.cboImTypeDropDownClose(Sender: TObject); 747 begin 748 inherited; 749 ImageTypeChange; 750 end; 751 752 procedure TfrmODRad.ImageTypeChange; 753 begin 754 if not ImageTypeChanged then Exit; 755 ImageTypeChanged := false; 756 if FPredefineOrder then 757 FPredefineOrder := False; 758 if Changing or (cboImtype.ItemIndex = -1) then exit; 759 with cboImType do DisplayGroup := StrToIntDef(Piece(Items[ItemIndex], U, 4), 0) ; 760 if DisplayGroup = 0 then exit; 761 CtrlInits.LoadDefaults(ODForRad(Patient.DFN, FEvtDelayDiv, DisplayGroup)); // ODForRad returns TStrings with defaults 762 FPredefineOrder := False; 763 InitDialog; 764 end; 765 766 procedure TfrmODRad.FormFirstOpened(Sender: TObject); 767 begin 768 if(FFormFirstOpened) then 769 begin 770 FFormFirstOpened := FALSE; 771 with cboImType do 772 if not FEditCopy and (ItemIEN = 0) and (DroppedDown = False) and (Application.Active) then 773 begin 774 cboImType.DroppedDown := TRUE; 775 end; 776 end; 686 777 end; 687 778 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODVitals.dfm
r459 r460 1 1 inherited frmODVitals: TfrmODVitals 2 Left = 2733 Top = 2112 Left = 721 3 Top = 363 4 4 Caption = 'Vital Measurement Order' 5 5 PixelsPerInch = 96 … … 64 64 ListItemsOnly = False 65 65 LongList = False 66 LookupPiece = 0 66 67 MaxLength = 0 67 68 Pieces = '2' … … 70 71 TabOrder = 4 71 72 OnChange = ControlChange 73 CharsNeedMatch = 1 72 74 end 73 75 object cboSchedule: TORComboBox … … 86 88 ListItemsOnly = False 87 89 LongList = False 90 LookupPiece = 0 88 91 MaxLength = 0 89 92 Pieces = '2' … … 92 95 TabOrder = 5 93 96 OnChange = ControlChange 97 CharsNeedMatch = 1 94 98 end 95 99 object calStart: TORDateBox -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODVitals.pas
r459 r460 38 38 procedure FormCreate(Sender: TObject); 39 39 procedure ControlChange(Sender: TObject); 40 procedure FormClose(Sender: TObject; var Action: TCloseAction); 40 41 private 41 42 { Private declarations } … … 54 55 {$R *.DFM} 55 56 56 uses uConst, ORFn, rODBase ;57 uses uConst, ORFn, rODBase, fFrame; 57 58 58 59 const … … 64 65 procedure TfrmODVitals.FormCreate(Sender: TObject); 65 66 begin 67 frmFrame.pnlVisit.Enabled := false; 66 68 inherited; 67 69 FillerID := 'OR'; // does 'on Display' order check **KCM** … … 138 140 end; 139 141 142 procedure TfrmODVitals.FormClose(Sender: TObject; 143 var Action: TCloseAction); 144 begin 145 inherited; 146 frmFrame.pnlVisit.Enabled := true; 147 end; 148 140 149 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOMSet.pas
r459 r460 26 26 procedure FormCreate(Sender: TObject); 27 27 private 28 DoingNextItem : Boolean; 29 CloseRequested : Boolean; 28 30 FDelayEvent: TOrderDelayEvent; 29 31 FClosing: Boolean; … … 105 107 var 106 108 SetItem: TSetItem; 109 theOwner: TComponent; 107 110 108 111 procedure SkipToNext; … … 113 116 114 117 begin 118 DoingNextItem := true; 115 119 //frmFrame.UpdatePtInfoOnRefresh; 116 120 if FClosing then Exit; … … 158 162 SkipToNext; 159 163 end; 160 'O': if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex) then 161 begin 162 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 163 lstSet.Checked[lstSet.ItemIndex] := True 164 else SkipToNext; 164 'O': begin 165 if (Self.Owner.Name = 'frmOMNavA') then theOwner := Self.Owner else theOwner := self; 166 if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, theOwner, ItemIndex) then 167 begin 168 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 169 lstSet.Checked[lstSet.ItemIndex] := True 170 else SkipToNext; 171 end; 165 172 end; 166 173 else begin … … 170 177 end; {case} 171 178 end; {with lstSet} 179 DoingNextItem := false; 172 180 end; 173 181 … … 178 186 if Message.WParam = lstSet.ItemIndex then 179 187 if lstSet.ItemIndex < lstSet.Items.Count - 1 then DoNextItem else Close; 188 if CloseRequested then 189 Close; 180 190 end; 181 191 … … 197 207 begin 198 208 SendMessage(TWinControl(SetItem.OwnedBy).Handle, UM_DESTROY, SetItem.RefNum, 0); 199 Exit;209 //Exit; 200 210 end; 201 211 end; … … 219 229 FClosebyDeaCheck := False; 220 230 NoFresh := True; 231 CloseRequested := false; 232 DoingNextItem := false; 221 233 end; 222 234 … … 264 276 procedure TfrmOMSet.cmdInteruptClick(Sender: TObject); 265 277 begin 266 Close; 278 if DoingNextItem then 279 CloseRequested := true //Fix for CQ: 8297 280 else 281 Close; 267 282 end; 268 283 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOMVerify.pas
r459 r460 30 30 {$R *.DFM} 31 31 32 uses ORFn, uConst, fFrame, rMisc ;32 uses ORFn, uConst, fFrame, rMisc, uODBase; 33 33 34 34 procedure ShowVerifyText(var QuickLevel: Integer; var VerifyText: string; InptDispGrp: boolean); … … 37 37 tempStrs,prompts: TStringList; 38 38 flag: boolean; 39 HasObjects: boolean; 39 40 40 41 function CutoffOutptPrompts(const promptIDs: TStringList; var promptList: TStringList): boolean; … … 83 84 SetBounds(frmFrame.Left, frmFrame.Top + frmFrame.Height - Height, Width, Height); 84 85 SetFormPosition(frmOMVerify); 86 ExpandOrderObjects(VerifyText, HasObjects); 85 87 memText.Lines.SetText(PChar(VerifyText)); 86 88 ShowModal; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrderFlag.dfm
r459 r460 87 87 OnExit = cboOnExit 88 88 OnNeedData = cboAlertRecipientNeedData 89 CharsNeedMatch = 1 89 90 end 90 91 end -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrderFlag.pas
r459 r460 57 57 finally 58 58 frmFlagOrder.Release; 59 AlertRecip := 0; 59 60 end; 60 61 end; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrderSaveQuick.pas
r459 r460 104 104 DGroupName, QuickName, CRC: string; 105 105 NewIEN, AnIndex, i: Integer; 106 IsClinicOrder: boolean; 106 107 begin 107 108 Result := False; 108 109 CRC := ResponseSet.OrderCRC; 110 IsClinicOrder := False; 109 111 if CRC = EMPTY_CRC then 110 112 begin … … 117 119 with frmSaveQuickOrder do 118 120 begin 121 if (ResponseSet.DisplayGroup = ClinDisp) and (ResponseSet.Dialog = 'PSJI OR PAT FLUID OE') then 122 begin 123 ResponseSet.DisplayGroup := IVDisp; 124 IsClinicOrder := True; 125 end; 119 126 if ResponseSet.DisplayGroup = ClinDisp then 120 127 DGroupName := NameOfDGroup(InptDisp) … … 156 163 SaveQuickListForOD(lstQuickList.Items, ResponseSet.DisplayGroup); 157 164 end; {if OKPressed} 165 if IsClinicOrder = True then ResponseSet.DisplayGroup := ClinDisp; 158 166 end; {with frmSaveQuickOrder} 159 167 finally -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrders.dfm
r459 r460 1 1 inherited frmOrders: TfrmOrders 2 Left = 1423 Top = 634 Width = 6982 Left = 451 3 Top = 250 4 Width = 774 5 5 Height = 579 6 6 HelpContext = 4000 … … 14 14 inherited shpPageBottom: TShape 15 15 Top = 528 16 Width = 69016 Width = 766 17 17 end 18 18 inherited sptHorz: TSplitter 19 19 Left = 117 20 20 Height = 528 21 OnMoved = sptHorzMoved 21 22 end 22 23 inherited pnlLeft: TPanel … … 102 103 inherited pnlRight: TPanel 103 104 Left = 121 104 Width = 569105 Width = 645 105 106 Height = 528 106 107 ParentColor = True … … 111 112 Left = 0 112 113 Top = 0 113 Width = 569114 Width = 645 114 115 Height = 19 115 116 Align = alTop … … 144 145 Left = 0 145 146 Top = 19 146 Width = 569147 Width = 645 147 148 Height = 17 148 149 DragReorder = False … … 179 180 ImageIndex = -1 180 181 MinWidth = 16 181 Text = 'N rs'182 Text = 'Nurse' 182 183 Width = 40 183 184 end … … 185 186 ImageIndex = -1 186 187 MinWidth = 16 187 Text = 'Cl k'188 Text = 'Clerk' 188 189 Width = 35 189 190 end … … 197 198 ImageIndex = -1 198 199 MinWidth = 16 199 Text = 'St s'200 Text = 'Status' 200 201 Width = 50 201 202 end … … 206 207 Width = 40 207 208 end> 209 OnSectionClick = hdrOrdersSectionClick 208 210 OnSectionResize = hdrOrdersSectionResize 209 211 OnMouseDown = hdrOrdersMouseDown … … 213 215 Left = 0 214 216 Top = 36 215 Width = 569217 Width = 645 216 218 Height = 492 217 219 Style = lbOwnerDrawVariable … … 301 303 end 302 304 end 305 object mnuViewInformation: TMenuItem 306 Caption = 'Information' 307 OnClick = mnuViewInformationClick 308 object mnuViewDemo: TMenuItem 309 Tag = 1 310 Caption = 'De&mographics...' 311 OnClick = ViewInfo 312 end 313 object mnuViewVisits: TMenuItem 314 Tag = 2 315 Caption = 'Visits/Pr&ovider...' 316 OnClick = ViewInfo 317 end 318 object mnuViewPrimaryCare: TMenuItem 319 Tag = 3 320 Caption = 'Primary &Care...' 321 OnClick = ViewInfo 322 end 323 object mnuViewMyHealtheVet: TMenuItem 324 Tag = 4 325 Caption = 'MyHealthe&Vet...' 326 OnClick = ViewInfo 327 end 328 object mnuInsurance: TMenuItem 329 Tag = 5 330 Caption = '&Insurance...' 331 OnClick = ViewInfo 332 end 333 object mnuViewFlags: TMenuItem 334 Tag = 6 335 Caption = '&Flags...' 336 OnClick = ViewInfo 337 end 338 object mnuViewRemoteData: TMenuItem 339 Tag = 7 340 Caption = 'Remote &Data...' 341 OnClick = ViewInfo 342 end 343 object mnuViewReminders: TMenuItem 344 Tag = 8 345 Caption = '&Reminders...' 346 Enabled = False 347 OnClick = ViewInfo 348 end 349 object mnuViewPostings: TMenuItem 350 Tag = 9 351 Caption = '&Postings...' 352 OnClick = ViewInfo 353 end 354 end 303 355 object Z1: TMenuItem 304 356 Caption = '-' … … 522 574 OnClick = mnuActSignClick 523 575 end 576 object mnuOptimizeFields: TMenuItem 577 Caption = 'Adjust Column Size' 578 Visible = False 579 OnClick = mnuOptimizeFieldsClick 580 end 524 581 end 525 582 end -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrders.pas
r459 r460 89 89 sptVert: TSplitter; 90 90 mnuViewExpired: TMenuItem; 91 mnuViewInformation: TMenuItem; 92 mnuViewDemo: TMenuItem; 93 mnuViewVisits: TMenuItem; 94 mnuViewPrimaryCare: TMenuItem; 95 mnuViewMyHealtheVet: TMenuItem; 96 mnuInsurance: TMenuItem; 97 mnuViewFlags: TMenuItem; 98 mnuViewReminders: TMenuItem; 99 mnuViewRemoteData: TMenuItem; 100 mnuViewPostings: TMenuItem; 101 mnuOptimizeFields: TMenuItem; 91 102 procedure mnuChartTabClick(Sender: TObject); 92 103 procedure FormCreate(Sender: TObject); … … 146 157 procedure hdrOrdersMouseDown(Sender: TObject; Button: TMouseButton; 147 158 Shift: TShiftState; X, Y: Integer); 159 procedure ViewInfo(Sender: TObject); 160 procedure mnuViewInformationClick(Sender: TObject); 161 procedure mnuOptimizeFieldsClick(Sender: TObject); 162 procedure hdrOrdersSectionClick(HeaderControl: THeaderControl; 163 Section: THeaderSection); 164 procedure sptHorzMoved(Sender: TObject); 148 165 private 149 166 { Private declarations } … … 188 205 procedure UseDefaultSort; 189 206 procedure SynchListToOrders; 207 // procedure ActivateDeactiveRenew; 190 208 procedure ValidateSelected(const AnAction, WarningMsg, WarningTitle: string); 191 209 procedure ViewAlertedOrders(OrderIEN: string; Status: integer; DispGrp: string; … … 196 214 function MeasureColumnHeight(AnOrder: TOrder; Index: Integer; Column: integer):integer; 197 215 function GetPlainText(AnOrder: TOrder; index: integer):string; 216 function PatientStatusChanged: boolean; 198 217 procedure UMEventOccur(var Message: TMessage); message UM_EVENTOCCUR; 218 function CheckOrderStatus: boolean; 199 219 public 200 220 procedure setSectionWidths; //CQ6170 … … 229 249 property EvtColWidth: integer read FEvtColWidth write FEvtColWidth; 230 250 property DontCheck: boolean read FDontCheck write FDontCheck; 231 property ParentComplexOrderID: string read FParentComplexOrderID write FParentComplexOrderID; 251 property ParentComplexOrderID: string read FParentComplexOrderID write FParentComplexOrderID; 232 252 end; 233 253 … … 247 267 fOMNavA, rCore, fOCSession, fOrdersPrint, fOrdersTS, fEffectDate, fODActive, fODChild, 248 268 fOrdersCopy, fOMVerify, fODAuto, rODBase, uODBase, rMeds,fODValidateAction, fMeds, uInit, fBALocalDiagnoses, 249 fODConsult;269 fODConsult, fClinicWardMeds, fActivateDeactivate; 250 270 251 271 {$R *.DFM} … … 970 990 if ((TOrder(Items.Objects[i]).DGroupName = 'Inpt. Meds') or 971 991 (TOrder(Items.Objects[i]).DGroupName = 'Out. Meds') or 972 (TOrder(Items.Objects[i]).DGroupName = 'IV Fluids')) then 992 (TOrder(Items.Objects[i]).DGroupName = 'Clin. Orders') or 993 (TOrder(Items.Objects[i]).DGroupName = 'Infusion')) then 973 994 begin 974 995 tmpList.Add(''); … … 993 1014 ReportBox(tmpList, 'Order Details - ' + BigOrderID, True); 994 1015 end; 1016 StatusText(''); 1017 if (frmFrame.TimedOut) or (frmFrame.CCOWDrivedChange) then Exit; //code added to correct access violation on timeout 995 1018 Selected[i] := False; 996 StatusText(''); 997 end; 1019 end; 998 1020 finally 999 1021 tmpList.Free; … … 1324 1346 7: result := ChartRev; 1325 1347 8: result := NameOfStatus(Status); 1326 9: 1327 begin1328 result := MixedCase(Anorder.OrderLocName);1329 if (Index > 0) and (result = TOrder(lstOrders.Items.Objects[Index - 1]).OrderLocName) then result := '';1330 end;1348 9: result := MixedCase(Anorder.OrderLocName); 1349 //begin AGP change 26.52 display all location for orders. 1350 //result := MixedCase(Anorder.OrderLocName); 1351 //if (Index > 0) and (result = TOrder(lstOrders.Items.Objects[Index - 1]).OrderLocName) then result := ''; 1352 //end; 1331 1353 end; 1332 1354 end; … … 1435 1457 NextIndex: Integer; 1436 1458 begin 1437 1459 if PatientStatusChanged then exit; 1438 1460 if BILLING_AWARE then //CQ5114 1439 1461 fODConsult.displayDXCode := ''; //CQ5114 … … 1534 1556 BadList := TStringList.Create; 1535 1557 CheckedList := TStringList.Create; 1536 with lstOrders do for i := 0 to Items.Count - 1 do if Selected[i] then 1537 begin 1538 AnOrder := TOrder(Items.Objects[i]); 1539 //AGP Change 25.34 to fix problem with renewing inpatient meds from an outpatient location 1540 if (AnAction = 'RN') and (AnOrder.Status=6) and (AnOrder.DGroupName = 'Inpt. Meds') and (Patient.inpatient) and (IsClinicLoc(Encounter.Location)) then 1541 begin 1542 Selected[i] := False; 1543 MessageDlg('You can not renew inpatient medication order on a clinic location for selected inpatient.', mtWarning, [mbOK], 0); 1544 end; 1545 if (AnAction = 'RN') or (AnAction = 'EV') then // or (AnAction = 'RW') then 1546 begin 1547 if not IsValidSchedule(AnOrder.ID) then 1548 begin 1549 if (AnAction = 'RN') then 1550 ShowMessage('The order contains invalid schedule and can not be renewed.') 1551 else if (AnAction = 'EV') then 1552 ShowMessage('The order contains invalid schedule and can not be changed to event delayed order.'); 1553 //else if (AnAction = 'RW') then 1554 // ShowMessage('The order contains invalid schedule and can not be copied.); 1558 try 1559 with lstOrders do for i := 0 to Items.Count - 1 do if Selected[i] then 1560 begin 1561 AnOrder := TOrder(Items.Objects[i]); 1562 if (AnAction = 'RN') and (AnOrder.Status=6) and (AnOrder.DGroupName = 'Inpt. Meds') and (Patient.inpatient) and (IsClinicLoc(Encounter.Location)) then 1563 begin 1564 Selected[i] := False; 1565 MessageDlg('You cannot renew inpatient medication order on a clinic location for selected inpatient.', mtWarning, [mbOK], 0); 1566 end; 1567 if ((AnAction = 'RN') or (AnAction = 'EV')) and (AnOrder.EnteredInError = 0) then //AGP Changes PSI-04053 1568 begin 1569 if not IsValidSchedule(AnOrder.ID) then 1570 begin 1571 if (AnAction = 'RN') then 1572 ShowMessage('The order contains invalid schedule and can not be renewed.') 1573 else if (AnAction = 'EV') then 1574 ShowMessage('The order contains invalid schedule and can not be changed to event delayed order.'); 1575 1576 Selected[i] := False; 1577 Continue; 1578 end; 1579 end; 1580 //AGP CHANGE ORDER ENTERED IN ERROR TO ALLOW SIGNATURE AND VERIFY ACTIONS 26.23 1581 if ((AnOrder.EnteredInError = 1) and ((AnOrder.Status = 1) or (AnOrder.Status = 13))) and ((AnAction <> 'ES') and (AnAction <> 'VR')) then 1582 begin 1583 InfoBox(AnOrder.Text + WarningMsg + 'This order has been mark as Entered in error.', WarningTitle, MB_OK); 1584 Selected[i] := False; 1585 Continue; 1586 end; 1587 if ((AnAction <> OA_RELEASE) and (AnOrder.EnteredInError = 0)) or (((AnOrder.EnteredInError = 1) and ((AnOrder.Status = 1) or (AnOrder.Status = 13))) and 1588 (AnAction = 'ES')) then 1589 ValidateOrderAction(AnOrder.ID, AnAction, ErrMsg) 1590 //AGP END Changes 1591 else ErrMsg := ''; 1592 if (Length(ErrMsg)>0) and (Pos('COMPLEX-PSI',ErrMsg)<1) then 1593 begin 1594 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1555 1595 Selected[i] := False; 1556 1596 Continue; 1557 1597 end; 1558 end; 1559 if AnAction <> OA_RELEASE then ValidateOrderAction(AnOrder.ID, AnAction, ErrMsg) 1560 else ErrMsg := ''; 1561 if (Length(ErrMsg)>0) and (Pos('COMPLEX-PSI',ErrMsg)<1) then 1562 begin 1563 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1564 Selected[i] := False; 1565 Continue; 1566 end; 1567 if (Length(ErrMsg)>0) and IsFirstDoseNowOrder(AnOrder.ID) and (AnAction <> 'RL') then 1568 begin 1569 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1570 Selected[i] := False; 1571 Continue; 1572 end; 1573 if (Length(ErrMsg)>0) and ( (AnAction = OA_CHGEVT) or (AnAction = OA_EDREL) ) then 1574 begin 1575 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1576 Selected[i] := False; 1577 Continue; 1578 end; 1579 AParentID := ''; 1580 IsValidActionOnComplexOrder(AnOrder.ID, AnAction,TListBox(lstOrders),CheckedList,ErrMsg, AParentID); 1581 TOrder(Items.Objects[i]).ParentID := AParentID; 1582 if (Length(ErrMsg)=0) and (AnAction=OA_EDREL) then 1598 if (Length(ErrMsg)>0) and IsFirstDoseNowOrder(AnOrder.ID) and (AnAction <> 'RL') then 1599 begin 1600 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1601 Selected[i] := False; 1602 Continue; 1603 end; 1604 if (Length(ErrMsg)>0) and ( (AnAction = OA_CHGEVT) or (AnAction = OA_EDREL) ) then 1605 begin 1606 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1607 Selected[i] := False; 1608 Continue; 1609 end; 1610 AParentID := ''; 1611 IsValidActionOnComplexOrder(AnOrder.ID, AnAction,TListBox(lstOrders),CheckedList,ErrMsg, AParentID); 1612 TOrder(Items.Objects[i]).ParentID := AParentID; 1613 if (Length(ErrMsg)=0) and (AnAction=OA_EDREL) then 1614 begin 1615 if (AnOrder.Signature = 2) and (not VerbTelPolicyOrder(AnOrder.ID)) then 1616 begin 1617 ErrMsg := 'Need to be signed first.'; 1618 Selected[i] := False; 1619 end; 1620 end; 1621 1622 if (AnAction = OA_CHGEVT) or (AnAction = OA_EDREL) then 1623 begin 1624 if Length(ErrMsg)>0 then 1625 begin 1626 Selected[i] := False; 1627 Badlist.Add(AnOrder.Text + '^' + ErrMsg); 1628 end 1629 else 1630 GoodList.Add(AnOrder.Text); 1631 end; 1632 1633 if (Length(ErrMsg) > 0) and (AnAction <> OA_CHGEVT) and (AnAction <> OA_EDREL) then 1634 begin 1635 if Pos('COMPLEX-PSI',ErrMsg)>0 then ErrMsg := TX_COMPLEX; 1636 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1637 Selected[i] := False; 1638 end; 1639 1640 if Selected[i] and (not OrderIsLocked(AnOrder.ID, AnAction)) then Selected[i] := False; 1641 1642 end; //with 1643 1644 if ((AnAction = OA_CHGEVT) or (AnAction = OA_EDREL)) then 1583 1645 begin 1584 if (AnOrder.Signature = 2) and (not VerbTelPolicyOrder(AnOrder.ID)) then 1585 begin 1586 ErrMsg := 'Need to be signed first.'; 1587 Selected[i] := False; 1588 end; 1646 if (BadList.Count = 1) and (GoodList.Count < 1 ) then 1647 InfoBox(Piece(BadList[0],'^',1) + WarningMsg + Piece(BadList[0],'^',2), WarningTitle, MB_OK); 1648 if ((BadList.Count >= 1) and (GoodList.Count >= 1)) or ( BadList.Count > 1 )then 1649 DisplayOrdersForAction(BadList,GoodList,AnAction); 1589 1650 end; 1590 1591 if (AnAction = OA_CHGEVT) or (AnAction = OA_EDREL) then 1592 begin 1593 if Length(ErrMsg)>0 then 1594 begin 1595 Selected[i] := False; 1596 Badlist.Add(AnOrder.Text + '^' + ErrMsg); 1597 end 1598 else 1599 GoodList.Add(AnOrder.Text); 1600 end; 1601 1602 if (Length(ErrMsg) > 0) and (AnAction <> OA_CHGEVT) and (AnAction <> OA_EDREL) then 1603 begin 1604 if Pos('COMPLEX-PSI',ErrMsg)>0 then ErrMsg := TX_COMPLEX; 1605 InfoBox(AnOrder.Text + WarningMsg + ErrMsg, WarningTitle, MB_OK); 1606 Selected[i] := False; 1607 end; 1608 1609 if Selected[i] and (not OrderIsLocked(AnOrder.ID, AnAction)) then Selected[i] := False; 1610 1611 end; //with 1612 1613 if ((AnAction = OA_CHGEVT) or (AnAction = OA_EDREL)) then 1614 begin 1615 if (BadList.Count = 1) and (GoodList.Count < 1 ) then 1616 InfoBox(Piece(BadList[0],'^',1) + WarningMsg + Piece(BadList[0],'^',2), WarningTitle, MB_OK); 1617 if ((BadList.Count >= 1) and (GoodList.Count >= 1)) or ( BadList.Count > 1 )then 1618 DisplayOrdersForAction(BadList,GoodList,AnAction); 1619 end; 1651 finally 1652 GoodList.Free; 1653 BadList.Free; 1654 CheckedList.Free; 1655 end; 1620 1656 end; 1621 1657 … … 1682 1718 SelectedList := TList.Create; 1683 1719 try 1684 ValidateSelected(OA_DC, TX_NO_DC, TC_NO_DC); // validate DC action on each order 1720 //if CheckOrderStatus = True then Exit; 1721 ValidateSelected(OA_DC, TX_NO_DC, TC_NO_DC); // validate DC action on each order 1722 //ActivateDeactiveRenew; AGP 26.53 TURN OFF UNTIL FINAL DECISION CAN BE MADE 1685 1723 MakeSelectedList(SelectedList); // build list of orders that remain 1686 1724 // updating the Changes object happens in ExecuteDCOrders, based on individual order … … 1753 1791 begin 1754 1792 inherited; 1755 if not EncounterPresentEDO then Exit; 1793 if not EncounterPresentEDO then Exit; 1756 1794 if NoneSelected(TX_NOSEL) then Exit; 1757 1795 if not AuthorizedUser then Exit; … … 1764 1802 SelectedList := TList.Create; 1765 1803 try 1804 if CheckOrderStatus = True then Exit; 1766 1805 ValidateSelected(OA_CHGEVT, TX_NO_CV, TC_NO_CV); // validate Change Event action on each order 1767 1806 MakeSelectedList(SelectedList); // build list of orders that remain … … 1799 1838 SelectedList := TList.Create; 1800 1839 try 1840 if CheckOrderStatus = True then Exit; 1801 1841 ValidateSelected(OA_HOLD, TX_NO_HOLD, TC_NO_HOLD); // validate hold action on each order 1802 1842 MakeSelectedList(SelectedList); // build list of orders that remain … … 1824 1864 SelectedList := TList.Create; 1825 1865 try 1866 if CheckOrderStatus = True then Exit; 1826 1867 ValidateSelected(OA_UNHOLD, TX_NO_UNHOLD, TC_NO_UNHOLD); // validate release hold action 1827 1868 MakeSelectedList(SelectedList); // build list of selected orders … … 1850 1891 SelectedList := TList.Create; 1851 1892 try 1893 if CheckOrderStatus = True then Exit; 1852 1894 ValidateSelected(OA_RENEW, TX_NO_RENEW, TC_NO_RENEW); // validate renew action for each 1853 1895 MakeSelectedList(SelectedList); // build list of orders that remain … … 2026 2068 try 2027 2069 if NoneSelected(TX_NOSEL) then Exit; 2070 if CheckOrderStatus = True then Exit; 2028 2071 ValidateSelected(OA_CHANGE, TX_NO_CHANGE, TC_NO_CHANGE); 2029 2072 if (FCurrentView.EventDelay.PtEventIFN>0) and … … 2067 2110 if NoneSelected(TX_NOSEL) then Exit; 2068 2111 NewOrderCreated := False; 2112 if CheckOrderStatus = True then Exit; 2069 2113 ValidateSelected(OA_COPY, TX_NO_COPY, TC_NO_COPY); 2070 2114 if (FCurrentView.EventDelay.PtEventIFN>0) and (PtEvtCompleted(FCurrentView.EventDelay.PtEventIFN, FCurrentView.EventDelay.EventName)) then … … 2269 2313 UBACore.CompleteUnsignedBillingInfo(rpcGetUnsignedOrdersBillingData(OrderListSCEI) ); 2270 2314 end; 2271 2315 2272 2316 {billing Aware} 2273 2317 ExecuteReleaseOrderChecks(SelectedList); // call order checking … … 2279 2323 if Active and (FollowUp = NF_ORDER_REQUIRES_ELEC_SIGNATURE) then 2280 2324 UnsignedOrderAlertFollowup(Piece(RecordID, U, 2)); 2281 UpdateExpiringMedAlerts(Patient.DFN); 2282 UpdateUnverifiedMedAlerts(Patient.DFN); 2283 UpdateUnverifiedOrderAlerts(Patient.DFN); 2325 if Active then 2326 begin 2327 UpdateExpiringMedAlerts(Patient.DFN); 2328 UpdateUnverifiedMedAlerts(Patient.DFN); 2329 UpdateUnverifiedOrderAlerts(Patient.DFN); 2330 end; 2284 2331 if not uInit.TimedOut then 2285 2332 begin … … 2370 2417 NF_DNR_EXPIRING : 2371 2418 ViewAlertedOrders('', STS_EXPIRING, '', False, True, 'All Services, Expiring'); 2372 NF_MEDICATIONS_EXPIRING : 2419 NF_MEDICATIONS_EXPIRING_INPT : 2420 begin 2421 ViewAlertedOrders('', STS_EXPIRING, 'PHARMACY', False, True, 'Medications, Expiring'); 2422 end; 2423 NF_MEDICATIONS_EXPIRING_OUTPT : 2373 2424 begin 2374 2425 ViewAlertedOrders('', STS_EXPIRING, 'PHARMACY', False, True, 'Medications, Expiring'); … … 2509 2560 if (ALocation > 0) and (ALocation <> Encounter.Location) then 2510 2561 begin 2511 if InfoBox(TX_NEW_LOC1 + AName + TX_NEW_LOC2, TC_NEW_LOC, MB_YESNO) = IDYES 2512 then Encounter.Location := ALocation; 2562 //gary 2563 Encounter.Location := frmClinicWardMeds.ClinicOrWardLocation(Alocation); 2564 // if InfoBox(TX_NEW_LOC1 + AName + TX_NEW_LOC2, TC_NEW_LOC, MB_YESNO) = IDYES 2565 // then Encounter.Location := ALocation; 2513 2566 end; 2514 2567 if Encounter.Location = 0 … … 3045 3098 inherited SetFontSize( FontSize ); 3046 3099 RedrawOrderList; 3100 mnuOptimizeFieldsClick(self); 3101 lstSheets.Repaint; 3102 lstWrite.Repaint; 3103 btnDelayedOrder.Repaint; 3047 3104 end; 3048 3105 … … 3050 3107 begin 3051 3108 inherited; 3109 if PatientStatusChanged then exit; 3052 3110 //frmFrame.UpdatePtInfoOnRefresh; 3053 3111 end; … … 3056 3114 begin 3057 3115 inherited; 3116 if PatientStatusChanged then exit; 3058 3117 //frmFrame.UpdatePtInfoOnRefresh; 3059 3118 end; … … 3062 3121 begin 3063 3122 inherited; 3123 if PatientStatusChanged then exit; 3064 3124 //frmFrame.UpdatePtInfoOnRefresh; 3065 3125 end; … … 3068 3128 begin 3069 3129 inherited; 3130 if PatientStatusChanged then exit; 3070 3131 //frmFrame.UpdatePtInfoOnRefresh; 3071 3132 end; … … 3186 3247 var 3187 3248 i: integer; 3188 totalSectionsWidth : integer;3249 totalSectionsWidth, originalwidth: integer; 3189 3250 begin 3190 3251 inherited; 3191 3252 //CQ6170 3192 3253 totalSectionsWidth := getTotalSectionsWidth; 3193 3194 if totalSectionsWidth > lstOrders.Width - 5 then 3195 begin 3196 for i := 0 to hdrOrders.Sections.Count-1 do 3197 begin 3198 hdrOrders.Sections[i].Width := origWidths[i]; 3199 lstOrders.Invalidate; 3200 end; 3201 end; 3254 if totalSectionsWidth > lstOrders.Width - 5 then 3255 begin 3256 originalwidth := 0; 3257 for i := 0 to hdrOrders.Sections.Count - 1 do 3258 originalwidth := originalwidth + origWidths[i]; 3259 if originalwidth < totalSectionsWidth then 3260 begin 3261 for i := 0 to hdrOrders.Sections.Count - 1 do 3262 hdrOrders.Sections[i].Width := origWidths[i]; 3263 lstOrders.Invalidate; 3264 end; 3265 end; 3202 3266 //end CQ6170 3203 3267 end; … … 3209 3273 end; 3210 3274 3275 function TfrmOrders.PatientStatusChanged: boolean; 3276 const 3277 3278 msgTxt1 = 'Patient status was changed from '; 3279 msgTxt2 = 'CPRS needs to refresh patient information to display patient latest record.'; 3280 //GE CQ9537 - Change message text 3281 msgTxt3 = 'Patient has been admitted. '; 3282 msgTxt4 = CRLF + 'You will be prompted to sign your orders. Any new orders subsequently' + 3283 CRLF +'entered and signed will be directed to the inpatient staff.'; 3284 var 3285 PtSelect: TPtSelect; 3286 IsInpatientNow: boolean; 3287 ptSts: string; 3288 begin 3289 result := False; 3290 SelectPatient(Patient.DFN, PtSelect); 3291 IsInpatientNow := Length(PtSelect.Location) > 0; 3292 if Patient.Inpatient <> IsInpatientNow then 3293 begin 3294 if (not Patient.Inpatient) then //GE CQ9537 - Change message text 3295 MessageDlg(msgTxt3 + msgTxt4, mtWarning, [mbOK], 0) 3296 else 3297 begin 3298 if Patient.Inpatient then ptSts := 'Inpatient to Outpatient.'; 3299 MessageDlg(msgTxt1 + ptSts + #13#10#13 + msgTxt2, mtWarning, [mbOK], 0); 3300 end; 3301 frmFrame.mnuFileRefreshClick(Application); 3302 Result := True; 3303 end; 3304 end; 3305 3306 function TfrmOrders.CheckOrderStatus: boolean; 3307 var 3308 i: integer; 3309 AnOrder: TOrder; 3310 begin 3311 Result := False; 3312 with lstOrders do for i := 0 to Items.Count - 1 do if Selected[i] then 3313 begin 3314 AnOrder := TOrder(Items.Objects[i]); 3315 if AnORder.Status <> GetOrderStatus(AnOrder.ID) then 3316 begin 3317 MessageDlg('The Order status has changed.' + #13#10#13 + 'CPRS needs to refresh patient information to display the correct order status', mtWarning, [mbOK], 0); 3318 frmFrame.mnuFileRefreshClick(Application); 3319 Result := True; 3320 EXIT; 3321 end; 3322 end; 3323 end; 3324 3325 (*procedure TfrmOrders.ActivateDeactiveRenew; 3326 var 3327 i: Integer; 3328 AnOrder: TOrder; 3329 tmpArr: TStringList; 3330 begin 3331 tmpArr := TStringList.Create; 3332 with lstOrders do for i := 0 to Items.Count - 1 do if Selected[i] then 3333 begin 3334 AnOrder := TOrder(Items.Objects[i]); 3335 if AnOrder.Status = 5 then tmpArr.Add(AnOrder.ID); 3336 end; 3337 if tmpArr <> nil then frmActivateDeactive.fActivateDeactive(tmpArr); 3338 end; *) 3339 3340 procedure TfrmOrders.ViewInfo(Sender: TObject); 3341 begin 3342 inherited; 3343 frmFrame.ViewInfo(Sender); 3344 end; 3345 3346 procedure TfrmOrders.mnuViewInformationClick(Sender: TObject); 3347 begin 3348 inherited; 3349 mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled; 3350 mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled; 3351 mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled; 3352 mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No'); 3353 mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No'); 3354 mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled; 3355 mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled; 3356 mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled; 3357 mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled; 3358 end; 3359 3360 procedure TfrmOrders.mnuOptimizeFieldsClick(Sender: TObject); 3361 var 3362 totalSectionsWidth, unitvalue: integer; 3363 begin 3364 totalSectionsWidth := pnlRight.Width - 3; 3365 if totalSectionsWidth < 16 then exit; 3366 unitvalue := round(totalSectionsWidth / 16); 3367 with hdrOrders do 3368 begin 3369 Sections[1].Width := unitvalue; 3370 Sections[2].Width := pnlRight.Width - (unitvalue * 10) - 5; 3371 Sections[3].Width := unitvalue * 2; 3372 Sections[4].Width := unitvalue * 2; 3373 Sections[5].Width := unitvalue; 3374 Sections[6].Width := unitvalue; 3375 Sections[7].Width := unitvalue; 3376 Sections[8].Width := unitvalue; 3377 Sections[9].Width := unitvalue; 3378 end; 3379 hdrOrdersSectionResize(hdrOrders, hdrOrders.Sections[0]); 3380 hdrOrders.Repaint; 3381 end; 3382 3383 procedure TfrmOrders.hdrOrdersSectionClick(HeaderControl: THeaderControl; 3384 Section: THeaderSection); 3385 begin 3386 inherited; 3387 //if Section = hdrOrders.Sections[1] then 3388 mnuOptimizeFieldsClick(self); 3389 end; 3390 3391 procedure TfrmOrders.sptHorzMoved(Sender: TObject); 3392 begin 3393 inherited; 3394 mnuOptimizeFieldsClick(self); 3395 end; 3396 3211 3397 end. 3212 3398 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersDC.dfm
r459 r460 65 65 ParentShowHint = False 66 66 ShowHint = True 67 Sorted = True 67 68 TabOrder = 0 68 69 Caption = 'Reason for Discontinue (select one)' -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersDC.pas
r459 r460 36 36 {$R *.DFM} 37 37 38 uses rOrders, uCore, uConst, fOrders, UBAGlobals; 39 { TODO -oRich V. -cOutpatient Meals : Uncomment for processing of child orders treeview. } 40 //, fOrderChildren; 38 uses rOrders, uCore, uConst, fOrders; 41 39 42 40 function ExecuteDCOrders(SelectedList: TList; var DelEvt: boolean): Boolean; … … 52 50 OriginalID,APtEvtID,APtEvtName,AnEvtInfo,tmpPtEvt: string; 53 51 PtEvtList: TStringList; 54 { TODO -oRich V. -cOutpatient Meals : Uncomment for processing of child orders treeview. }55 (* tmpList: TList;56 j: integer;57 AChildOrder: TOrder;*)58 52 begin 59 53 Result := False; … … 63 57 PtEvtList := TStringList.Create; 64 58 if SelectedList.Count = 0 then Exit; 65 { TODO -oRich V. -cOutpatient Meals : Uncomment for processing of child orders treeview. }66 // tmpList := TList.Create;67 59 frmDCOrders := TfrmDCOrders.Create(Application); 68 60 try … … 72 64 begin 73 65 AnOrder := TOrder(Items[i]); 74 75 if BILLING_AWARE then //CQ458976 UBAGlobals.RemoveOrderFromDxList(AnOrder.ID);77 78 { TODO -oRich V. -cOutpatient Meals : Comment next 3 lines for processing of child orders treeview. }79 66 frmDCOrders.lstOrders.Items.Add(AnOrder.Text); 80 67 if not ((AnOrder.Status = 11) and (AnOrder.Signature = 2)) then NeedReason := True; 81 68 end; 82 { TODO -oRich V. -cOutpatient Meals : Uncomment for processing of child orders treeview. }83 //*********** begin OP meals changes **************84 (* if Copy(AnOrder.Text, 1, 1) = '+' then85 begin86 ActOnChildOrders(tmpList, AnOrder.ID);87 { TODO -oRich V. -cOutpatient Meals : How/when to get selected items into SelectedList? }88 for j := tmpList.Count - 1 downto 0 do89 begin90 AChildOrder := TOrder(tmpList.Items[j]);91 frmDCOrders.lstOrders.Items.Add(AChildOrder.Text);92 if not ((AChildOrder.Status = 11) and (AChildOrder.Signature = 2)) then NeedReason := True;93 end;94 end else95 begin96 frmDCOrders.lstOrders.Items.Add(AnOrder.Text);97 if not ((AnOrder.Status = 11) and (AnOrder.Signature = 2)) then NeedReason := True;98 end;99 end;*)100 //************* End OP meals changes ****************101 69 if NeedReason then 102 70 begin … … 126 94 end; 127 95 DCT_DELETION: begin 128 if BILLING_AWARE then129 UBAGlobals.BADeltedOrders.Add(OriginalID);130 96 Changes.Remove(CH_ORD, OriginalID); 131 97 if (AnOrder.ID = '0') or (AnOrder.ID = '') … … 174 140 else with SelectedList do for i := 0 to Count - 1 do UnlockOrder(TOrder(Items[i]).ID); 175 141 finally 176 { TODO -oRich V. -cOutpatient Meals : Uncomment for processing of child orders treeview. }177 //tmpList.Free;178 142 frmDCOrders.Release; 179 143 end; … … 202 166 begin 203 167 inherited; 204 if not (lstReason.ItemIEN > 0) then168 if (lstReason.Visible) and (not (lstReason.ItemIEN > 0)) then 205 169 begin 206 170 InfoBox(TX_REASON_REQ, TC_REASON_REQ, MB_OK); -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersOnChart.pas
r459 r460 33 33 {$R *.DFM} 34 34 35 uses rCore, rOrders, uConst, fOrdersPrint, uOrders; 35 uses rCore, rOrders, uConst, fOrdersPrint, uOrders, fFrame, UCore, 36 fClinicWardMeds; 36 37 37 38 const … … 43 44 var 44 45 frmOnChartOrders: TfrmOnChartOrders; 45 i : Integer;46 i, PrintLoc: Integer; 46 47 SignList: TStringList; 47 48 OrderText: string; … … 62 63 begin 63 64 Result := False; 65 PrintLoc := 0; 64 66 if SelectedList.Count = 0 then Exit; 65 67 frmOnChartOrders := TfrmOnChartOrders.Create(Application); … … 78 80 StatusText('Sending Orders to Service(s)...'); 79 81 if SignList.Count > 0 then SendOrders(SignList, ''); 82 83 if (not frmFrame.TimedOut) then 84 begin 85 if IsValidIMOLoc(uCore.TempEncounterLoc,Patient.DFN) then 86 frmClinicWardMeds.ClinicOrWardLocation(SignList, uCore.TempEncounterLoc,uCore.TempEncounterLocName, PrintLoc) 87 else 88 if (IsValidIMOLoc(Encounter.Location,Patient.DFN)) and ((frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN)) and (Patient.Inpatient = false)) then 89 frmClinicWardMeds.ClinicOrWardLocation(SignList, Encounter.Location,Encounter.LocationName, PrintLoc); 90 end; 91 uCore.TempEncounterLoc := 0; 92 uCore.TempEncounterLocName := ''; 93 80 94 with SignList do if Count > 0 then for i := 0 to Count - 1 do 81 95 begin … … 88 102 end; 89 103 StatusText(''); 90 PrintOrdersOnSignRelease(SignList, NO_WRITTEN );104 PrintOrdersOnSignRelease(SignList, NO_WRITTEN, PrintLoc); 91 105 // SetupOrdersPrint(SignList, DeviceInfo, NO_WRITTEN, False, PrintIt); //*KCM* 92 106 // if PrintIt then PrintOrdersOnReview(SignList, DeviceInfo); //*KCM* -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersRelease.pas
r459 r460 41 41 {$R *.DFM} 42 42 43 uses Hash, rCore, rOrders, uConst, fSignItem, fOrdersPrint, uCore, uOrders, fRptBox; 43 uses Hash, rCore, rOrders, uConst, fSignItem, fOrdersPrint, uCore, uOrders, fRptBox, 44 fFrame, fClinicWardMeds; 44 45 45 46 const … … 55 56 var 56 57 frmReleaseOrders: TfrmReleaseOrders; 57 i : Integer;58 i, PrintLoc: Integer; 58 59 SignList: TStringList; 59 60 OrderText: string; … … 87 88 begin 88 89 Result := False; 90 PrintLoc := 0; 89 91 if SelectedList.Count = 0 then Exit; 90 92 frmReleaseOrders := TfrmReleaseOrders.Create(Application); … … 109 111 StatusText('Sending Orders to Service(s)...'); 110 112 if SignList.Count > 0 then SendOrders(SignList, frmReleaseOrders.ESCode); 113 114 if (not frmFrame.TimedOut) then 115 begin 116 if IsValidIMOLoc(uCore.TempEncounterLoc,Patient.DFN) then 117 frmClinicWardMeds.ClinicOrWardLocation(SignList, uCore.TempEncounterLoc,uCore.TempEncounterLocName, PrintLoc) 118 else 119 if (IsValidIMOLoc(Encounter.Location,Patient.DFN)) and ((frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN)) and (Patient.Inpatient = false)) then 120 frmClinicWardMeds.ClinicOrWardLocation(SignList, Encounter.Location,Encounter.LocationName, PrintLoc); 121 end; 122 uCore.TempEncounterLoc := 0; 123 uCore.TempEncounterLocName := ''; 124 125 //hds7591 Clinic/Ward movement. 126 127 111 128 with SignList do if Count > 0 then for i := 0 to Count - 1 do 112 129 begin … … 120 137 end; 121 138 StatusText(''); 122 PrintOrdersOnSignRelease(SignList, frmReleaseOrders.FNature );139 PrintOrdersOnSignRelease(SignList, frmReleaseOrders.FNature, PrintLoc); 123 140 // SetupOrdersPrint(SignList, DeviceInfo, frmReleaseOrders.FNature, False, PrintIt); //*KCM* 124 141 // if PrintIt then PrintOrdersOnReview(SignList, DeviceInfo); //*KCM* -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersRenew.dfm
r459 r460 1 1 inherited frmRenewOrders: TfrmRenewOrders 2 Left = 273 3 Top = 185 4 Width = 450 5 Height = 270 2 Left = 434 3 Top = 232 4 HorzScrollBar.Tracking = True 5 HorzScrollBar.Visible = True 6 VertScrollBar.Tracking = True 7 AutoScroll = False 6 8 Caption = 'Renew Orders' 9 ClientHeight = 416 10 ClientWidth = 592 7 11 Position = poScreenCenter 12 Scaled = False 8 13 OnClose = FormClose 9 14 OnCreate = FormCreate … … 11 16 PixelsPerInch = 96 12 17 TextHeight = 13 13 object lstOrders: TListBox14 Left = 015 Top = 1716 Width = 44217 Height = 18518 Style = lbOwnerDrawVariable19 Align = alClient20 Color = clCream21 ItemHeight = 1322 TabOrder = 023 OnClick = lstOrdersClick24 OnDrawItem = lstOrdersDrawItem25 OnMeasureItem = lstOrdersMeasureItem26 end27 18 object hdrOrders: THeaderControl 28 19 Left = 0 29 20 Top = 0 30 Width = 44221 Width = 592 31 22 Height = 17 32 23 DragReorder = False 24 Constraints.MinHeight = 17 33 25 Sections = < 34 26 item 27 AutoSize = True 35 28 ImageIndex = -1 36 29 Text = 'Order to be Renewed' 37 Width = 31730 Width = 296 38 31 end 39 32 item 33 AutoSize = True 40 34 ImageIndex = -1 41 35 Text = 'Start/Stop Time' 42 Width = 12536 Width = 296 43 37 end> 38 OnSectionResize = hdrOrdersSectionResize 44 39 end 45 object Panel1: TPanel40 object pnlBottom: TPanel 46 41 Left = 0 47 Top = 20248 Width = 44249 Height = 4142 Top = 393 43 Width = 592 44 Height = 23 50 45 Align = alBottom 46 Anchors = [akLeft, akTop, akRight, akBottom] 47 AutoSize = True 51 48 TabOrder = 2 52 49 DesignSize = ( 53 44254 41)50 592 51 23) 55 52 object cmdCancel: TButton 56 Left = 36257 Top = 1 253 Left = 512 54 Top = 1 58 55 Width = 72 59 56 Height = 21 … … 61 58 Cancel = True 62 59 Caption = 'Cancel' 60 Constraints.MinHeight = 21 63 61 TabOrder = 0 64 62 OnClick = cmdCancelClick 65 63 end 66 64 object cmdOK: TButton 67 Left = 27468 Top = 1 265 Left = 424 66 Top = 1 69 67 Width = 72 70 68 Height = 21 71 69 Anchors = [akTop, akRight] 72 70 Caption = 'OK' 71 Constraints.MinHeight = 21 73 72 Default = True 74 73 TabOrder = 1 … … 77 76 object cmdChange: TButton 78 77 Left = 8 79 Top = 1 278 Top = 1 80 79 Width = 145 81 80 Height = 21 82 81 Caption = 'Change...' 82 Constraints.MinHeight = 21 83 83 Enabled = False 84 84 TabOrder = 2 … … 86 86 end 87 87 end 88 object lstOrders: TCaptionListBox 89 Left = 0 90 Top = 17 91 Width = 592 92 Height = 376 93 Style = lbOwnerDrawVariable 94 Align = alClient 95 Anchors = [] 96 Color = clCream 97 Ctl3D = True 98 ExtendedSelect = False 99 Font.Charset = DEFAULT_CHARSET 100 Font.Color = clWindowText 101 Font.Height = -11 102 Font.Name = 'MS Sans Serif' 103 Font.Style = [] 104 ItemHeight = 24 105 ParentCtl3D = False 106 ParentFont = False 107 ParentShowHint = False 108 ShowHint = True 109 TabOrder = 1 110 OnClick = lstOrdersClick 111 OnDrawItem = lstOrdersDrawItem 112 OnMeasureItem = lstOrdersMeasureItem 113 HintOnItem = True 114 end 88 115 end -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersRenew.pas
r459 r460 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 7 fAutoSz, StdCtrls, ORFn, ComCtrls, uConst, rODMeds, uOrders, fOCAccept, 8 ExtCtrls, uODBase ;8 ExtCtrls, uODBase, ORCtrls; 9 9 10 10 type 11 11 TfrmRenewOrders = class(TfrmAutoSz) 12 lstOrders: TListBox;13 12 hdrOrders: THeaderControl; 14 Panel1: TPanel;13 pnlBottom: TPanel; 15 14 cmdCancel: TButton; 16 15 cmdOK: TButton; 17 16 cmdChange: TButton; 17 lstOrders: TCaptionListBox; 18 18 procedure FormCreate(Sender: TObject); 19 19 procedure cmdOKClick(Sender: TObject); … … 27 27 procedure FormClose(Sender: TObject; var Action: TCloseAction); 28 28 procedure FormShow(Sender: TObject); 29 procedure hdrOrdersSectionResize(HeaderControl: THeaderControl; 30 Section: THeaderSection); 29 31 private 30 32 OKPressed: Boolean; … … 78 80 IsInpt: boolean; 79 81 i,j: Integer; 80 m: integer; //BAPHII 1.3.282 //m: integer; //BAPHII 1.3.2 81 83 PkgInfo:string; 82 84 PlainText,RnErrMsg: string; … … 251 253 AnOrder.LinkObject := nil; 252 254 end; 253 254 255 frmRenewOrders.Release; 255 256 end; 256 257 258 259 257 end; 260 258 … … 283 281 DateHeight := MeasureColumnHeight(x, Index, DATE_COLUMN); 284 282 Height := HigherOf(TextHeight, DateHeight); 283 if Height > 255 then Height := 255; //This is maximum allowed by a windows listbox item. 285 284 end 286 285 end; … … 427 426 end; 428 427 428 procedure TfrmRenewOrders.hdrOrdersSectionResize(HeaderControl: THeaderControl; Section: THeaderSection); 429 begin 430 inherited; 431 lstOrders.Repaint; //CQ6367 432 end; 433 434 429 435 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersSign.dfm
r459 r460 1 1 object frmSignOrders: TfrmSignOrders 2 Left = 3793 Top = 1 622 Left = 400 3 Top = 159 4 4 Width = 585 5 5 Height = 511 … … 43 43 object Label2: TStaticText 44 44 Left = 8 45 Top = 14 445 Top = 147 46 46 Width = 171 47 47 Height = 17 48 48 Caption = 'The following orders will be signed -' 49 TabOrder = 449 TabOrder = 3 50 50 TabStop = True 51 51 end … … 58 58 Caption = 'OK' 59 59 Default = True 60 TabOrder = 260 TabOrder = 1 61 61 OnClick = cmdOKClick 62 62 end … … 69 69 Cancel = True 70 70 Caption = 'Cancel' 71 TabOrder = 371 TabOrder = 2 72 72 OnClick = cmdCancelClick 73 73 end … … 192 192 ShowHint = True 193 193 Style = lbOwnerDrawVariable 194 TabOrder = 1194 TabOrder = 4 195 195 OnClick = clstOrdersClick 196 196 OnDrawItem = clstOrdersDrawItem … … 243 243 object Diagnosis1: TMenuItem 244 244 Caption = '&Diagnosis...' 245 Enabled = False246 245 ShortCut = 32836 247 246 OnClick = buOrdersDiagnosisClick -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersSign.pas
r459 r460 114 114 uses 115 115 Hash, rCore, rOrders, uConst, fOrdersPrint, uCore, uOrders, uSignItems, fOrders, 116 fPCELex, rPCE, fODConsult, fBALocalDiagnoses ;116 fPCELex, rPCE, fODConsult, fBALocalDiagnoses, fClinicWardMeds, fFrame; 117 117 118 118 const … … 208 208 cProvDUZ: Int64; 209 209 OrderText: string; 210 PrintLoc: Integer; 210 211 // tempOrderID: string; 211 212 … … 251 252 Result := False; 252 253 DigSigErr := True; 253 DigStoreErr := False; 254 Obj := Nil; 254 PrintLoc := 0; 255 255 if SelectedList.Count = 0 then Exit; 256 256 if BILLING_AWARE then … … 418 418 if SignList.Count > 0 then 419 419 begin 420 421 //hds7591 Clinic/Ward movement. Patient Admission IMO 422 if not frmFrame.TimedOut then 423 begin 424 if IsValidIMOLoc(uCore.TempEncounterLoc,Patient.DFN) then 425 frmClinicWardMeds.ClinicOrWardLocation(SignList, Encounter.Location,uCore.Encounter.LocationName, PrintLoc) 426 else 427 if (IsValidIMOLoc(Encounter.Location,Patient.DFN)) and ((frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN)) and (Patient.Inpatient = false)) then 428 frmClinicWardMeds.ClinicOrWardLocation(SignList, Encounter.Location,Encounter.LocationName, PrintLoc); 429 end; 430 uCore.TempEncounterLoc := 0; 431 uCore.TempEncounterLocName := ''; 432 //hds7591 Clinic/Ward movement Patient Admission IMO 433 420 434 SigItems.SaveSettings; // Save CoPay FIRST! 421 435 SendOrders(SignList, frmSignOrders.ESCode); 422 end; 423 with SignList do if Count > 0 then for i := 0 to Count - 1 do 436 437 end; 438 439 with SignList do if Count > 0 then for i := 0 to Count - 1 do 424 440 begin 425 441 if Pos('E', Piece(SignList[i], U, 2)) > 0 then … … 443 459 if theSts = 10 then SignList.Delete(cnt); //signed delayed order should not be printed. 444 460 end; 445 PrintOrdersOnSignRelease(SignList, NO_PROVIDER );461 PrintOrdersOnSignRelease(SignList, NO_PROVIDER, PrintLoc); 446 462 finally 447 463 SignList.Free; … … 505 521 506 522 procedure TfrmSignOrders.cmdOKClick(Sender: TObject); 507 {Begin BillingAware}508 var509 BABillingRecs: TStringList;510 {End BillingAware}511 523 const 512 524 TX_NO_CODE = 'An electronic signature code must be entered to sign orders.'; … … 519 531 begin 520 532 inherited; 521 {Begin BillingAware} 522 if BILLING_AWARE then 523 begin 524 BABillingRecs := TStringList.Create; 525 BABillingRecs.Clear; 526 end; 527 {End BillingAware} 528 533 529 534 if txtESCode.Visible and (Length(txtESCode.Text) = 0) then 530 535 begin … … 545 550 begin 546 551 if SigItems.OK2SaveSettings then 547 if Not BADxEntered then // if Dx have been entered and OK is pressed 552 553 if Not UBACore.BADxEntered then // if Dx have been entered and OK is pressed 548 554 begin // billing data will be saved. otherwise error message! 549 555 InfoBox(TX_NO_DX, 'Sign Orders', MB_OK); … … 781 787 begin 782 788 //Billing Awareness 'flyover' hint includes Dx code(s) when Dx code(s) have been assigned to an order 783 thisRec := TBADxRecord.Create;784 789 thisOrderID := TChangeItem(fOrdersSign.frmSignOrders.clstOrders.Items.Objects[Itm]).ID; 785 790 … … 909 914 {Begin BillingAware} 910 915 911 numSelected := 0;912 916 match := false; 913 917 allBlank := false; … … 1264 1268 j: integer; //CQ5054 1265 1269 begin 1266 //if BILLING_AWARE then 1267 //begin 1270 1268 1271 if FOSTFHintWndActive then 1269 1272 begin … … 1290 1293 //end CQ5054 1291 1294 end; 1292 1293 //end //if BILLING_AWARE1294 1295 end; 1295 1296 … … 1315 1316 end; 1316 1317 end; 1317 1318 x := 0;1319 y := 0;1320 1318 1321 1319 try … … 1398 1396 begin 1399 1397 try 1400 if BILLING_AWARE then 1401 begin 1402 if FOSTFhintWndActive then 1403 begin 1404 FOSTFhintWindow.ReleaseHandle; 1405 FOSTFHintWndActive := False; 1406 Application.ProcessMessages; 1407 end; 1408 end; 1398 if FOSTFhintWndActive then 1399 begin 1400 FOSTFhintWindow.ReleaseHandle; 1401 FOSTFHintWndActive := False; 1402 Application.ProcessMessages; 1403 end; 1409 1404 except 1410 1405 on E: Exception do … … 1518 1513 procedure TfrmSignOrders.FormatListForScreenReader; 1519 1514 var 1520 ListStateOn : boolean; 1515 ListStateOn : longbool; 1516 Success: longbool; 1521 1517 begin 1522 1518 //Determine if a screen reader is currently being used. 1523 S ystemParametersInfo(SPI_GETSCREENREADER, 0, @ListStateOn,0);1524 if ListStateOn then1525 SetItemTextToState 1519 Success := SystemParametersInfo(SPI_GETSCREENREADER, 0, @ListStateOn,0); 1520 if Success and ListStateOn then 1521 SetItemTextToState; 1526 1522 end; 1527 1523 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOtherSchedule.dfm
r459 r460 1 1 object frmOtherSchedule: TfrmOtherSchedule 2 Left = 3553 Top = 1542 Left = 544 3 Top = 262 4 4 AutoScroll = False 5 5 Caption = 'Order with schedule '#39'OTHER'#39 6 6 ClientHeight = 362 7 ClientWidth = 3 417 ClientWidth = 369 8 8 Color = clBtnFace 9 9 Constraints.MinHeight = 70 … … 23 23 Left = 0 24 24 Top = 82 25 Width = 3 4125 Width = 369 26 26 Height = 8 27 27 Cursor = crVSplit … … 33 33 Left = 0 34 34 Top = 0 35 Width = 3 4135 Width = 369 36 36 Height = 82 37 37 Align = alTop … … 50 50 Left = 52 51 51 Top = 4 52 Width = 28552 Width = 313 53 53 Height = 74 54 54 Align = alClient … … 64 64 Left = 0 65 65 Top = 90 66 Width = 3 4166 Width = 369 67 67 Height = 272 68 68 Align = alClient … … 72 72 Left = 1 73 73 Top = 1 74 Width = 1 4474 Width = 176 75 75 Height = 202 76 76 Align = alLeft … … 79 79 object cbo7: TCheckBox 80 80 Tag = 1 81 Left = 4581 Left = 86 82 82 Top = 21 83 83 Width = 60 … … 89 89 object cbo1: TCheckBox 90 90 Tag = 2 91 Left = 4491 Left = 85 92 92 Top = 48 93 93 Width = 60 … … 99 99 object cbo2: TCheckBox 100 100 Tag = 3 101 Left = 44101 Left = 85 102 102 Top = 75 103 103 Width = 60 … … 109 109 object cbo3: TCheckBox 110 110 Tag = 4 111 Left = 44111 Left = 85 112 112 Top = 102 113 113 Width = 60 … … 119 119 object cbo4: TCheckBox 120 120 Tag = 5 121 Left = 44121 Left = 85 122 122 Top = 129 123 123 Width = 60 … … 129 129 object cbo5: TCheckBox 130 130 Tag = 6 131 Left = 44131 Left = 85 132 132 Top = 156 133 133 Width = 60 … … 139 139 object cbo6: TCheckBox 140 140 Tag = 7 141 Left = 44141 Left = 85 142 142 Top = 183 143 143 Width = 60 … … 147 147 OnClick = cbo6Click 148 148 end 149 object Button1: TButton 150 Left = 8 151 Top = 64 152 Width = 60 153 Height = 19 154 Caption = 'Everyday' 155 TabOrder = 7 156 OnClick = Button1Click 157 end 149 158 end 150 159 object GroupBox2: TGroupBox 151 Left = 1 52160 Left = 180 152 161 Top = 1 153 162 Width = 188 … … 214 223 end 215 224 object btnRemove: TButton 216 Left = 11 4225 Left = 118 217 226 Top = 94 218 227 Width = 60 219 228 Height = 19 229 Hint = 'Remove the selected time from the Day-of-Week schedule.' 220 230 Caption = 'Remove' 231 ParentShowHint = False 232 ShowHint = True 221 233 TabOrder = 2 222 234 OnClick = btnRemoveClick 235 end 236 object btnAdd: TButton 237 Left = 118 238 Top = 64 239 Width = 60 240 Height = 19 241 Hint = 'Add the selected time to the Day-of-Week schedule' 242 Caption = 'Add' 243 ParentShowHint = False 244 ShowHint = True 245 TabOrder = 3 246 OnClick = btnAddClick 223 247 end 224 248 end … … 226 250 Left = 1 227 251 Top = 203 228 Width = 3 39252 Width = 367 229 253 Height = 68 230 254 Align = alBottom 231 255 TabOrder = 2 232 256 DesignSize = ( 233 3 39257 367 234 258 68) 235 259 object Label1: TLabel … … 241 265 end 242 266 object btn0k1: TButton 243 Left = 176267 Left = 204 244 268 Top = 43 245 269 Width = 75 … … 251 275 end 252 276 object btnCancel: TButton 253 Left = 2 57277 Left = 285 254 278 Top = 42 255 279 Width = 75 … … 264 288 Left = 64 265 289 Top = 8 266 Width = 2 68290 Width = 296 267 291 Height = 21 268 292 Anchors = [akLeft, akTop, akRight] 293 Color = clInfoBk 294 Enabled = False 295 Font.Charset = DEFAULT_CHARSET 296 Font.Color = clWindowText 297 Font.Height = -11 298 Font.Name = 'MS Sans Serif' 299 Font.Style = [fsBold] 300 ParentFont = False 301 ReadOnly = True 269 302 TabOrder = 0 270 303 OnChange = txtScheduleChange -
cprs/branches/foia-cprs/CPRS-Chart/Orders/fOtherSchedule.pas
r459 r460 35 35 memMessage: TMemo; 36 36 Splitter1: TSplitter; 37 btnAdd: TButton; 38 Button1: TButton; 37 39 procedure FormCreate(Sender: TObject); 38 40 procedure btnCancelClick(Sender: TObject); … … 55 57 procedure lstMinuteKeyDown(Sender: TObject; var Key: Word; 56 58 Shift: TShiftState); 59 procedure Button1Click(Sender: TObject); 57 60 private 58 61 FDaySchedule: array [1..7] of string; … … 66 69 procedure UpdateOnFreeTextInput; 67 70 function CheckDay(ADayStr: string): string; 71 68 72 public 69 73 end; … … 87 91 if frmOtherSchedule.ShowModal = mrOK then 88 92 begin 89 ASchedule := frmOtherSchedule.FOtherSchedule;93 ASchedule := UpperCase(frmOtherSchedule.FOtherSchedule); 90 94 Result := True; 91 95 end; … … 121 125 procedure TfrmOtherSchedule.btn0k1Click(Sender: TObject); 122 126 begin 127 if (cbo1.Checked = false) and (cbo2.Checked = false) and (cbo3.Checked = false) and (cbo4.Checked = false) and (cbo5.Checked = false) and 128 (cbo6.Checked = false) and (cbo7.Checked = false) then 129 begin 130 ShowMessage('A day of week must be selected!'); 131 Exit; 132 end; 123 133 if not IsValidSchStr(FOtherSchedule) then 124 134 begin … … 176 186 var 177 187 i : integer; 178 TimePart, DayPart : string;188 TimePart, DayPart,APRN,ASearchTxt: string; 179 189 begin 180 190 TimePart := ''; 181 191 DayPart := ''; 192 APRN := ''; 193 ASearchTxt := UpperCase(txtSchedule.Text); 194 if StrPos(PChar(ASearchTxt),PChar('PRN')) <> nil then APRN := ' PRN'; //hds8326 retain PRN free text if data time entered 182 195 for i := 0 to FTimeSchedule.Count - 1 do 183 196 begin … … 201 214 end 202 215 else FOtherSchedule := TimePart; 216 if Length(APRN) > 0 then FOtherSchedule := FOtherSchedule + APRN; //hds8326 retain PRN free text if data time entered 203 217 txtSchedule.Text := FOtherSchedule; 204 218 end; … … 368 382 var 369 383 idx: integer; 384 x: string; 370 385 begin 371 386 for idx := aDList.Count - 1 downto 0 do 372 387 begin 388 // cq hds8326 PRN entered manually split PRN from DOW to retain last DOW 389 x := UpperCase(aDList.Strings[idx]); // added to properly process DOW when followed by a space "PRN". 390 if Piece(x,' ',2) = 'PRN' then 391 aDLIst.Strings[idx] := Piece(x,' ',1); 392 // cq hds8326 373 393 if ((CheckDay(aDList[idx]) = 'SUN') or (CheckDay(aDList[idx]) = 'SU')) then 374 394 begin … … 419 439 begin 420 440 inherited; 421 i := 0;422 441 dayStr := ''; 423 442 timeStr := ''; … … 437 456 begin 438 457 Val(Piece(txtSchedule.Text,'-',1), i, Code); 458 if i = 0 then begin end; // just to make compiler not give hint 439 459 if Code <> 0 then dayStr := Trim(txtSchedule.Text) 440 460 else timeStr := Trim(txtSchedule.Text); … … 463 483 begin 464 484 inherited; 465 lstMinute.ItemIndex := -1;485 if lstMinute.ItemIndex = -1 then lstMinute.ItemIndex :=0; 466 486 end; 467 487 … … 509 529 FFromCheckBox := True; 510 530 if lstHour.ItemIndex < 0 then Exit; 511 btnAddClick(Self);531 //btnAddClick(Self); 512 532 FFromCheckBox := False; 513 533 end; … … 521 541 FFromCheckBox := True; 522 542 if lstHour.ItemIndex < 0 then Exit; 523 btnAddClick(Self);543 //btnAddClick(Self); 524 544 FFromCheckBox := False; 525 545 end; 526 546 end; 527 547 548 procedure TfrmOtherSchedule.Button1Click(Sender: TObject); 549 begin 550 inherited; 551 cbo1.Checked := true; 552 cbo2.Checked := true; 553 cbo3.Checked := true; 554 cbo4.Checked := true; 555 cbo5.Checked := true; 556 cbo6.Checked := true; 557 cbo7.Checked := true; 558 end; 559 528 560 end. 529 561 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/rODAllergy.pas
r459 r460 49 49 end; 50 50 51 TARTClinUser = record 52 IsClinUser: boolean; 53 ReasonFailed: string; 54 AccessChecked: boolean; 55 end; 56 51 57 function SearchForAllergies(StringToMatch: string): TStrings; 52 58 function SubsetofSymptoms(const StartFrom: string; Direction: Integer): TStrings; … … 64 70 function RequireOriginatorComments: boolean; 65 71 function EnableErrorComments: boolean; 72 function IsARTClinicalUser(var AMessage: string): boolean; 66 73 67 74 implementation … … 73 80 uARTPatchInstalled: TARTPatchInstalled; 74 81 uGMRASiteParams: TGMRASiteParams; 82 uARTClinUser: TARTClinUser; 75 83 76 84 function ODForAllergies: TStrings; … … 326 334 end; 327 335 336 (*function IsARTClinicalUser(var AMessage: string): boolean; 337 const 338 TX_NO_AUTH = 'You are not authorized to perform this action.' + CRLF + 339 'Either the ORES or ORELSE key is required.'; 340 begin 341 Result := (User.UserClass > UC_CLERK); // User has ORES or ORELSE key 342 if not Result then AMessage := TX_NO_AUTH else AMessage := ''; 343 end;*) 344 345 function IsARTClinicalUser(var AMessage: string): boolean; 346 const 347 TX_NO_AUTH = 'You are not authorized to perform this action.' + CRLF; 348 var 349 x: string; 350 begin 351 with uARTClinUser do 352 begin 353 if not AccessChecked then 354 begin 355 x := sCallV('ORWDAL32 CLINUSER',[nil]); 356 IsClinUser := (Piece(x, U, 1) = '1'); 357 if not IsClinUser then ReasonFailed := TX_NO_AUTH + Piece(x, U, 2) else ReasonFailed := ''; 358 AccessChecked := True; 359 end; 360 Result := IsClinUser; 361 AMessage := ReasonFailed ; 362 end; 363 end; 364 328 365 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/rODBase.pas
r459 r460 68 68 end; 69 69 70 TPFSSActive = record 71 PFSSActive: boolean; 72 PFSSChecked: boolean; 73 end; 74 70 75 { General Calls } 71 76 function AskAnotherOrder(ADialog: Integer): Boolean; … … 75 80 procedure LoadDialogDefinition(Dest: TList; const DialogName: string); 76 81 procedure LoadOrderPrompting(Dest: TList; ADialog: Integer); 77 procedure LoadResponses(Dest: TList; const OrderID: string); 82 //procedure LoadResponses(Dest: TList; const OrderID: string); 83 procedure LoadResponses(Dest: TList; const OrderID: string; var HasObjects: boolean); 78 84 procedure PutNewOrder(var AnOrder: TOrder; ConstructOrder: TConstructOrder; OrderSource: string); 79 85 //procedure PutNewOrderAuto(var AnOrder: TOrder; ADialog: Integer); // no longer used … … 88 94 procedure SetDefaultCoPayToNewOrder(AnOrderID, CoPayInfo:string); 89 95 procedure ValidateNumericStr(const x, Dom: string; var ErrMsg: string); 90 96 function IsPFSSActive: boolean; 91 97 92 98 { Quick Order Calls } … … 126 132 implementation 127 133 128 uses TRPCB, uOrders;134 uses TRPCB, uOrders, uODBase; 129 135 130 136 var … … 133 139 uLastQuantityMsg: string; 134 140 uMedRoutes: TStringList; 141 uPFSSActive: TPFSSActive; 135 142 136 143 { Common Internal Calls } … … 175 182 begin 176 183 IVDurVal := Copy(IVDuration,1,length(IVDuration)-1); 177 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + ' 184 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + 'hours'; 178 185 end 179 186 else if (Pos('D',upperCase(IVDuration))>0) then 180 187 begin 181 188 IVDurVal := Copy(IVDuration,1,length(IVDuration)-1); 182 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + ' 189 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + 'days'; 183 190 end 184 191 else if ((Pos('ML',upperCase(IVDuration))>0) or (Pos('CC',upperCase(IVDuration))>0)) then 185 192 begin 186 193 IVDurVal := Copy(IVDuration,1,length(IVDuration)-2); 187 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + ' 194 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + 'ml'; 188 195 end 189 196 else if (Pos('L',upperCase(IVDuration))>0) then 190 197 begin 191 198 IVDurVal := Copy(IVDuration,0,length(IVDuration)-1); 192 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + ' 199 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + 'L'; 193 200 end; 194 201 end; … … 371 378 end; 372 379 373 procedure ExtractToResponses(Dest: TList );380 procedure ExtractToResponses(Dest: TList; var HasObjects: boolean); 374 381 { load a list with TResponse records, assumes source strings are in RPCBrokerV.Results } 375 382 var 376 383 i: Integer; 377 384 AResponse: TResponse; 385 WPContainsObjects, TxContainsObjects: boolean; 386 TempBroker: TStrings; 378 387 begin 379 388 i := 0; 380 with RPCBrokerV do while i < Results.Count do 381 begin 382 if CharAt(Results[i], 1) = '~' then 389 HasObjects := FALSE; 390 TempBroker := TStringlist.Create; 391 TempBroker.Assign(RPCBrokerV.Results); 392 try 393 with TempBroker do while i < Count do 394 begin 395 if CharAt(Strings[i], 1) = '~' then 383 396 begin 384 397 AResponse := TResponse.Create; 385 398 with AResponse do 386 399 begin 387 PromptIEN := StrToIntDef(Piece(Copy( Results[i], 2, 255), U, 1), 0);388 Instance := StrToIntDef(Piece( Results[i], U, 2), 0);389 PromptID := Piece( Results[i], U, 3);400 PromptIEN := StrToIntDef(Piece(Copy(Strings[i], 2, 255), U, 1), 0); 401 Instance := StrToIntDef(Piece(Strings[i], U, 2), 0); 402 PromptID := Piece(Strings[i], U, 3); 390 403 Inc(i); 391 while (i < Results.Count) and (CharAt(Results[i], 1) <> '~') do404 while (i < Count) and (CharAt(Strings[i], 1) <> '~') do 392 405 begin 393 if CharAt( Results[i], 1) = 'i' then IValue := Copy(Results[i], 2, 255);394 if CharAt( Results[i], 1) = 'e' then EValue := Copy(Results[i], 2, 255);395 if CharAt( Results[i], 1) = 't' then406 if CharAt(Strings[i], 1) = 'i' then IValue := Copy(Strings[i], 2, 255); 407 if CharAt(Strings[i], 1) = 'e' then EValue := Copy(Strings[i], 2, 255); 408 if CharAt(Strings[i], 1) = 't' then 396 409 begin 397 410 if Length(EValue) > 0 then EValue := EValue + CRLF; 398 EValue := EValue + Copy( Results[i], 2, 255);411 EValue := EValue + Copy(Strings[i], 2, 255); 399 412 IValue := TX_WPTYPE; // signals that this is a word processing field 400 413 end; 401 414 Inc(i); 402 415 end; {while i} 416 if IValue <> TX_WPTYPE then ExpandOrderObjects(IValue, TxContainsObjects); 417 ExpandOrderObjects(EValue, WPContainsObjects); 418 HasObjects := HasObjects or WPContainsObjects or TxContainsObjects; 403 419 Dest.Add(AResponse); 404 420 end; {with AResponse} 405 421 end; {if CharAt} 406 422 end; {With RPCBrokerV} 407 end; 408 409 procedure LoadResponses(Dest: TList; const OrderID: string); 423 finally 424 TempBroker.Free; 425 end; 426 end; 427 428 procedure LoadResponses(Dest: TList; const OrderID: string; var HasObjects: boolean); 410 429 begin 411 430 CallV('ORWDX LOADRSP', [OrderID]); 412 ExtractToResponses(Dest );431 ExtractToResponses(Dest, HasObjects); 413 432 end; 414 433 … … 427 446 Param[1].Value := IntToStr(Encounter.Provider); 428 447 Param[2].PType := literal; 448 (*if loc > 0 then Param[2].Value := IntToStr(Loc) 449 else Param[2].Value := IntToStr(Encounter.Location);*) 429 450 Param[2].Value := IntToStr(Encounter.Location); 430 451 Param[3].PType := literal; … … 659 680 end; 660 681 682 function IsPFSSActive: boolean; 683 begin 684 with uPFSSActive do 685 if not PFSSChecked then 686 begin 687 PFSSActive := (sCallV('ORWPFSS IS PFSS ACTIVE?', [nil]) = '1'); 688 PFSSChecked := True; 689 end; 690 Result := uPFSSActive.PFSSActive 691 end; 661 692 662 693 { Medication Calls } -
cprs/branches/foia-cprs/CPRS-Chart/Orders/rODDiet.pas
r459 r460 31 31 Alarms: string; 32 32 OPMaxDays: integer; 33 OPDefaultDiet: integer; 33 34 end; 34 35 … … 39 40 procedure AppendTFProducts(Dest: TStrings); 40 41 function SubSetOfDiets(const StartFrom: string; Direction: Integer): TStrings; 41 function SubSetOfOPDiets (const StartFrom: string; Direction: Integer): TStrings;42 function SubSetOfOPDiets: TStrings; 42 43 procedure OrderLateTray(NewOrder: TOrder; Meal: Char; const MealTime: string; Bagged: Boolean); 43 44 function IsolationID: string; … … 48 49 function OutpatientPatchInstalled: boolean; 49 50 function UserHasFHAUTHKey: boolean; 51 procedure GetCurrentRecurringOPMeals(Dest: TStrings; MealType: string = ''); 52 function OutpatientLocationConfigured(ALocation: string): boolean; 50 53 51 54 … … 96 99 else 97 100 OPMaxDays := 30; 101 if Results.Count > 4 then 102 OPDefaultDiet := StrToIntDef(Results[4], 0) 98 103 end; 99 104 end; … … 131 136 end; 132 137 133 function SubSetOfOPDiets (const StartFrom: string; Direction: Integer): TStrings;134 begin 135 CallV('ORWDFH OPDIETS', [ StartFrom, Direction]);138 function SubSetOfOPDiets: TStrings; 139 begin 140 CallV('ORWDFH OPDIETS', [nil]); 136 141 Result := RPCBrokerV.Results; 137 142 end; … … 176 181 if not PatchChecked then 177 182 begin 178 PatchInstalled := False;179 { TODO -oRich V. -cOutpatient Meals : Uncomment when patch available - need number}180 //PatchInstalled := ServerHasPatch('FH_TEST*1.0*1');183 //PatchInstalled := True; 184 { TODO -oRich V. -cOutpatient Meals : Uncomment when available } 185 PatchInstalled := (PackageVersion('FH') >= '5.5'); 181 186 PatchChecked := True; 182 187 end; … … 195 200 end; 196 201 202 procedure GetCurrentRecurringOPMeals(Dest: TStrings; MealType: string = ''); 203 begin 204 CallV('ORWDFH CURRENT MEALS', [Patient.DFN, MealType]); 205 Dest.Assign(RPCBrokerV.Results); 206 MixedCaseList(Dest); 207 end; 208 209 function OutpatientLocationConfigured(ALocation: string): boolean; 210 begin 211 Result := (sCallV('ORWDFH NFSLOC READY', [ALocation]) = '1'); 212 end; 213 197 214 end. -
cprs/branches/foia-cprs/CPRS-Chart/Orders/rODLab.pas
r459 r460 22 22 procedure GetLabTimesForDate(Dest: TStrings; LabDate: TFMDateTime; Location: integer); 23 23 function GetLastCollectionTime: string; 24 procedure GetPatientBBInfo(Dest: TStrings; PatientID: string; Loc: integer); 25 procedure GetPatientBloodResults(Dest: TStrings; PatientID: string; ATests: TStringList); 26 procedure GetPatientBloodResultsRaw(Dest: TStrings; PatientID: string; ATests: TStringList); 27 function StatAllowed(PatientID: string): boolean; 28 procedure GetBloodComponents(Dest: TStrings); 24 29 25 30 implementation … … 27 32 uses rODBase; 28 33 (* fODBase, rODBase, fODLab;*) 34 35 procedure GetBloodComponents(Dest: TStrings); 36 begin 37 tCallV(Dest, 'ORWDXVB COMPORD', []); 38 end; 39 40 function StatAllowed(PatientID: string): boolean; 41 begin 42 Result := (StrToInt(sCallV('ORWDXVB STATALOW',[PatientID])) > 0); 43 end; 44 45 procedure GetPatientBloodResultsRaw(Dest: TStrings; PatientID: string; ATests: TStringList); 46 begin 47 tCallV(Dest, 'ORWDXVB RAW', [PatientID, ATests]); 48 end; 49 50 procedure GetPatientBloodResults(Dest: TStrings; PatientID: string; ATests: TStringList); 51 begin 52 tCallV(Dest, 'ORWDXVB RESULTS', [PatientID, ATests]); 53 end; 54 55 procedure GetPatientBBInfo(Dest: TStrings; PatientID: string; Loc: integer); 56 begin 57 tCallV(Dest, 'ORWDXVB GETALL', [PatientID, Loc]); 58 end; 29 59 30 60 function ODForLab(Location, Division: integer): TStrings; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/rOrders.pas
r459 r460 38 38 ParentID : string; 39 39 LinkObject: TObject; 40 EnteredInError: Integer; //AGP Changes 26.12 PSI-04-053 40 41 procedure Assign(Source: TOrder); 41 42 procedure Clear; … … 604 605 DGroupSeq := SeqOfDGroup(DGroup); 605 606 DGroupName := TopNameOfDGroup(DGroup); 607 //AGP Changes 26.15 PSI-04-063 608 if (pos('Entered in error',Text)>0) then AnOrder.EnteredInError := 1 609 else AnOrder.EnteredInError := 0; 606 610 //if DGroupName = 'Non-VA Meds' then Text := 'Non-VA ' + Text; 607 611 end; … … 680 684 with RPCBrokerV do for i := 1 to Results.Count - 1 do // if orders found (skip 0 element) 681 685 begin 682 if (Piece(RPCBrokerV.Results[i], U, 1) = '0') or (Piece(RPCBrokerV.Results[i], U, 1) = '') then Continue; 683 if (DelimCount(Results[i],U) = 2) then Continue; 686 if (Piece(RPCBrokerV.Results[i], U, 1) = '0') or (Piece(RPCBrokerV.Results[i], U, 1) = '') then Continue; 687 if (DelimCount(Results[i],U) = 2) then Continue; 684 688 AnOrder := TOrder.Create; 685 689 with AnOrder do … … 1126 1130 var 1127 1131 DelayEvent, x, TheOrder: string; 1128 Idx, PickupIdx, ForIMOResponses: integer;1132 Idx, tmpOrderGroup, PickupIdx, ForIMOResponses: integer; 1129 1133 IfUDGrp: Boolean; 1130 1134 IfUDGrpForQO: Boolean; 1135 temp: string; 1131 1136 begin 1132 1137 ForIMOResponses := 0; 1138 tmpOrderGroup := 0; 1139 temp := ''; 1133 1140 if ForIMO then ForIMOResponses := 1; 1134 1141 PickupIdx := 0; … … 1139 1146 begin 1140 1147 Delete(TheOrder,1,1); 1141 if CheckOrderGroup(TheOrder)=1 then IfUDGrp := True else IfUDGrp := False; 1148 tmpOrderGroup := CheckOrderGroup(TheOrder); 1149 if tmpOrderGroup = 1 then IfUDGrp := True else IfUDGrp := False; 1142 1150 end; 1143 1151 if (not IfUDGrp) and (AnEvent.EventType in ['A','T']) then 1144 1152 IfUDGrp := True; 1145 1153 //FLDS=DFN^LOC^ORNP^INPT^SEX^AGE^EVENT^SC%^^^Key Variables 1154 if (Patient.Inpatient = true) and (tmpOrderGroup = 2) then temp := '0'; 1155 if temp <> '0' then temp := BoolChars[Patient.Inpatient]; 1146 1156 with AnEvent do 1147 1157 begin … … 1451 1461 1452 1462 with RPCBrokerV do 1453 begin 1454 ClearParameters := True; 1455 RemoteProcedure := 'ORWDXR RENEW'; 1456 Param[0].PType := literal; 1457 Param[0].Value := AnOrder.ID; 1458 Param[1].PType := literal; 1459 Param[1].Value := Patient.DFN; 1460 Param[2].PType := literal; 1461 Param[2].Value := IntToStr(Encounter.Provider); 1462 Param[3].PType := literal; 1463 Param[3].Value := IntToStr(Encounter.Location); 1464 Param[4].PType := list; 1465 1466 for i := 0 to tmplst.Count - 1 do 1467 Param[4].Mult[IntToStr(i+1)] := tmplst[i]; 1468 1469 Param[4].Mult['"ORCHECK"'] := IntToStr(OCList.Count); 1470 1471 for i := 0 to OCList.Count - 1 do 1472 begin 1473 // put quotes around everything to prevent broker from choking 1474 y := '"ORCHECK","' + Piece(OCList[i], U, 1) + '","' + Piece(OCList[i], U, 3) + '","' + IntToStr(i+1) + '"'; 1475 Param[4].Mult[y] := Pieces(OCList[i], U, 2, 4); 1476 end; 1477 Param[5].PType := literal; 1478 Param[5].Value := IntToStr(IsComplex); 1479 Param[6].PType := literal; 1480 Param[6].Value := FloatToStr(AnIMOOrderAppt); 1481 1463 begin 1464 ClearParameters := True; 1465 RemoteProcedure := 'ORWDXR RENEW'; 1466 Param[0].PType := literal; 1467 Param[0].Value := AnOrder.ID; 1468 Param[1].PType := literal; 1469 Param[1].Value := Patient.DFN; 1470 Param[2].PType := literal; 1471 Param[2].Value := IntToStr(Encounter.Provider); 1472 Param[3].PType := literal; 1473 Param[3].Value := IntToStr(Encounter.Location); 1474 Param[4].PType := list; 1475 for i := 0 to tmplst.Count - 1 do 1476 Param[4].Mult[IntToStr(i+1)] := tmplst[i]; 1477 Param[4].Mult['"ORCHECK"'] := IntToStr(OCList.Count); 1478 for i := 0 to OCList.Count - 1 do 1479 begin 1480 // put quotes around everything to prevent broker from choking 1481 y := '"ORCHECK","' + Piece(OCList[i], U, 1) + '","' + Piece(OCList[i], U, 3) + 1482 '","' + IntToStr(i+1) + '"'; 1483 Param[4].Mult[y] := Pieces(OCList[i], U, 2, 4); 1484 end; 1485 Param[5].PType := literal; 1486 Param[5].Value := IntToStr(IsComplex); 1487 Param[6].PType := literal; 1488 Param[6].Value := FloatToStr(AnIMOOrderAppt); 1482 1489 CallBroker; 1483 1490 SetOrderFromResults(AnOrder); … … 1510 1517 CallV('ORWDXA DCREASON', [nil]); 1511 1518 ExtractItems(Dest, RPCBrokerV.Results, 'DCReason'); 1512 DefaultIEN := StrToIntDef(Piece(ExtractDefault(RPCBrokerV.Results, 'DCReason'), U, 1), 0); 1519 //AGP Change 26.15 for PSI-04-63 1520 //DefaultIEN := StrToIntDef(Piece(ExtractDefault(RPCBrokerV.Results, 'DCReason'), U, 1), 0); 1513 1521 end; 1514 1522 … … 1528 1536 SetOrderFromResults(AnOrder); 1529 1537 AnOrder.ParentID := AParentID; 1530 1531 1538 end; 1532 1539 -
cprs/branches/foia-cprs/CPRS-Chart/Orders/uODBase.pas
r459 r460 22 22 procedure PopKeyVars(NumLevels: Integer = 1); 23 23 procedure PushKeyVars(const NewVals: string); 24 procedure ExpandOrderObjects(var Txt: string; var ContainsObjects: boolean; msg: string = ''); 24 25 25 26 implementation 27 28 uses 29 dShared, Windows, rTemplates; 26 30 27 31 var … … 118 122 end; 119 123 124 procedure ExpandOrderObjects(var Txt: string; var ContainsObjects: boolean; msg: string = ''); 125 var 126 ObjList: TStringList; 127 Err: TStringList; 128 i, j, k, oLen: integer; 129 obj, ObjTxt: string; 130 const 131 CRDelim = #13; 132 TC_BOILER_ERR = 'Order Boilerplate Object Error'; 133 TX_BOILER_ERR = 'Contact IRM and inform them about this error.' + CRLF + 134 'Make sure you give them the name of the quick' + CRLF + 135 'order that you are processing.' ; 136 begin 137 ObjList := TStringList.Create; 138 try 139 Err := nil; 140 if(not dmodShared.BoilerplateOK(Txt, CRDelim, ObjList, Err)) and (assigned(Err)) then 141 begin 142 try 143 Err.Add(CRLF + TX_BOILER_ERR); 144 InfoBox(Err.Text, TC_BOILER_ERR, MB_OK + MB_ICONERROR); 145 finally 146 Err.Free; 147 end; 148 end; 149 if(ObjList.Count > 0) then 150 begin 151 ContainsObjects := True; 152 GetTemplateText(ObjList); 153 i := 0; 154 while (i < ObjList.Count) do 155 begin 156 if(pos(ObjMarker, ObjList[i]) = 1) then 157 begin 158 obj := copy(ObjList[i], ObjMarkerLen+1, MaxInt); 159 if(obj = '') then break; 160 j := i + 1; 161 while (j < ObjList.Count) and (pos(ObjMarker, ObjList[j]) = 0) do 162 inc(j); 163 if((j - i) > 2) then 164 begin 165 ObjTxt := ''; 166 for k := i+1 to j-1 do 167 ObjTxt := ObjTxt + #13 + ObjList[k]; 168 end 169 else 170 ObjTxt := ObjList[i+1]; 171 i := j; 172 obj := '|' + obj + '|'; 173 oLen := length(obj); 174 repeat 175 j := pos(obj, Txt); 176 if(j > 0) then 177 begin 178 delete(Txt, j, OLen); 179 insert(ObjTxt, Txt, j); 180 end; 181 until(j = 0); 182 end 183 else 184 inc(i); 185 end 186 end; 187 finally 188 ObjList.Free; 189 end; 190 end; 191 120 192 initialization 121 193 uOrderEventType := #0; -
cprs/branches/foia-cprs/CPRS-Chart/Orders/uOrders.pas
r459 r460 58 58 procedure QuickOrderListEdit; 59 59 function RefNumFor(AnOwner: TComponent): Integer; 60 procedure PrintOrdersOnSignRelease(OrderList: TStringList; Nature: Char );60 procedure PrintOrdersOnSignRelease(OrderList: TStringList; Nature: Char; PrintLoc : Integer =0); 61 61 procedure SetFontSize( FontSize: integer); 62 62 procedure NextMove(var NMRec: TNextMoveRec; LastIndex: Integer; NewIndex: Integer); … … 74 74 MedsDisp : Integer; 75 75 ClinDisp : Integer; //IMO 76 NurDisp : Integer; 76 77 IVDisp : Integer; 77 78 CsltDisp : Integer; 78 79 ProcDisp : Integer; 80 ImgDisp : Integer; 79 81 NonVADisp: Integer; 80 82 MedsInDlgIen : Integer; … … 94 96 95 97 uses fODDiet, fODMisc, fODGen, fODMedIn, fODMedOut, fODText, fODConsult, fODProc, fODRad, 96 fODLab, f ODMeds, fODMedIV, fODVitals, fODAuto, fODAllgy,fOMNavA, rCore, uCore, fFrame,98 fODLab, fodBBank, fODMeds, fODMedIV, fODVitals, fODAuto, (*fODAllgy,*) fOMNavA, rCore, uCore, fFrame, 97 99 fEncnt, fEffectDate, fOMVerify, fOrderSaveQuick, fOMSet, rMisc, uODBase, rODMeds, 98 100 fLkUpLocation, fOrdersPrint, fOMAction, fARTAllgy, fOMHTML, fOrders, rODBase, 99 101 fODChild, fMeds, rMeds, rPCE, frptBox, fODMedNVA, fODChangeUnreleasedRenew, rODAllergy, 100 UBAGlobals ;102 UBAGlobals, fClinicWardMeds, uTemplateFields; 101 103 102 104 var … … 142 144 TX_NO_QUICK = 'This ordering dialog does not support quick orders.'; 143 145 TC_NO_QUICK = 'Save/Edit Quick Orders'; 146 TX_CANT_SAVE_QO = 'This order contains TIU objects, which may result in patient-specific' + CRLF + 147 'information being included in the order. For this reason, it may not' + CRLF + 148 'be saved as a personal quick order for later reuse.'; 144 149 TX_NO_COPY = CRLF + CRLF + '- cannot be copied.' + CRLF + CRLF + 'Reason: '; 145 150 TC_NO_COPY = 'Unable to Copy Order'; … … 152 157 STEP_FORWARD = 1; 153 158 STEP_BACK = -1; 154 TX_NOINPT = ' You can not place inpatient medication order on a clinic location for selected inpatient.';159 TX_NOINPT = ': You cannot place inpatient medication orders from a clinic location for selected patient.'; 155 160 TX_IMO_WARNING1 = 'You are '; 156 TX_IMO_WARNING2 = ' Clinic Medication orders. The New orders will be saved as Clinic Medication orders and willNOT be available in BCMA';161 TX_IMO_WARNING2 = ' Clinic Orders. The New orders will be saved as Clinic Orders and MAY NOT be available in BCMA'; 157 162 158 163 … … 200 205 OD_DIET: DialogClass := TfrmODDiet; 201 206 OD_LAB: DialogClass := TfrmODLab; 207 OD_BB: DialogClass := TfrmODBBank; 202 208 OD_CONSULT: DialogClass := TfrmODCslt; 203 209 OD_PROCEDURE: DialogClass := TfrmODProc; 204 210 OD_TEXTONLY: DialogClass := TfrmODText; 205 211 OD_VITALS: DialogClass := TfrmODVitals; 206 OD_ALLERGY: DialogClass := TfrmODAllergy;212 //OD_ALLERGY: DialogClass := TfrmODAllergy; 207 213 OD_AUTOACK: DialogClass := TfrmODAuto; 208 214 else Exit; … … 391 397 else 392 398 begin 393 ResolvedDialog.DisplayGroup := InptDisp; 394 ResolvedDialog.DialogIEN := MedsInDlgIen; 395 ResolvedDialog.FormID := MedsInDlgFormId; 399 //AGP changes to handle IMO INV Dialog opening the unit dose dialog. 400 if (ResolvedDialog.DisplayGroup = ClinDisp) and (Resolveddialog.DialogIEN = MedsIVDlgIEN) and (ResolvedDialog.FormID = MedsIVDlgFormId) then 401 begin 402 ResolvedDialog.DisplayGroup := IVDisp; 403 ResolvedDialog.DialogIEN := MedsIVDlgIen; 404 ResolvedDialog.FormID := MedsIVDlgFormId; 405 end 406 else 407 begin 408 ResolvedDialog.DisplayGroup := InptDisp; 409 ResolvedDialog.DialogIEN := MedsInDlgIen; 410 ResolvedDialog.FormID := MedsInDlgFormId; 411 end; 396 412 if Length(ResolvedDialog.ShowText)>0 then 397 413 ResolvedDialog.QuickLevel := 2; … … 452 468 IVDisp := DisplayGroupByName('IV RX'); 453 469 ClinDisp := DisplayGroupByName('C RX'); 470 NurDisp := DisplayGroupByName('NURS'); 454 471 CsltDisp := DisplayGroupByName('CSLT'); 455 472 ProcDisp := DisplayGroupByName('PROC'); 473 ImgDisp := DisplayGroupByName('XRAY'); 456 474 NonVADisp := DisplayGroupByName('NV RX'); 457 475 MedsInDlgIen := DlgIENForName('PSJ OR PAT OE'); … … 817 835 ResolvedDialog.DisplayGroup := ClinDisp; 818 836 ResetDialogProperties(AnID, AnEvent, ResolvedDialog); 837 {* AGP CHANGE 26.20 Remove restriction to allowed for ordering of inpatient medication for an inpatient from an outpatient location 819 838 //jd imo change 820 839 if (ResolvedDialog.DisplayGroup = InptDisp) and (Patient.Inpatient) and (AnEvent.EventIFN < 1) then … … 826 845 end; 827 846 end; 828 //jd imo change end 847 //jd imo change end *} 829 848 if (ResolvedDialog.DisplayGroup = InptDisp) or 830 849 (ResolvedDialog.DisplayGroup = OutptDisp) or … … 865 884 if NSSchedule then ResolvedDialog.QuickLevel := 0; 866 885 end; 886 with ResolvedDialog do if (QuickLevel = QL_VERIFY) and (HasTemplateField(ShowText)) then QuickLevel := QL_DIALOG; 867 887 with ResolvedDialog do 868 888 begin … … 1003 1023 begin 1004 1024 ShowModal; 1005 //Application.ProcessMessages;1006 1025 Result := uOrderDialog.AcceptOK; 1007 1026 uOrderDialog.Destroy; … … 1010 1029 begin 1011 1030 Show; 1012 //Application.ProcessMessages;1013 1031 Result := True; 1014 1032 end; … … 1050 1068 OrdList: TList; 1051 1069 theOrder: TOrder; 1052 begin 1070 // i: integer; 1071 begin 1072 // if Assigned(OrdList) then 1073 // begin 1074 // for i := 0 to pred(OrdList.Count) do 1075 // TObject(OrdList[i]).Free; 1076 // UBAGlobals.tempDxList := nil; 1077 // end; 1053 1078 OrdList := TList.Create; 1054 1079 theOrder := TOrder.Create; … … 1057 1082 RetrieveOrderFields(OrdList, 0, 0); 1058 1083 Result := TOrder(OrdList.Items[0]).Text; 1084 if Assigned(OrdList) then OrdList.Free; //CQ:7554 1059 1085 end; 1060 1086 … … 1349 1375 param2 := FieldsForEditRenewOrder.StopTime; 1350 1376 end; 1351 1377 UBAGlobals.SourceOrderID := AList[i]; //hds6265 added 1352 1378 ExecuteChangeRenewedOrder(AList[i], param1, param2, txtOrder); 1353 1379 AnOrder := TOrder.Create; … … 1393 1419 var 1394 1420 i: Integer; 1395 xx ,xy: string;1421 xx: string; 1396 1422 IsIMOOD,ForIVAlso: boolean; 1397 1423 begin … … 1602 1628 Exit; 1603 1629 end; 1630 if Responses.OrderContainsObjects then 1631 begin 1632 InfoBox(TX_CANT_SAVE_QO, TC_NO_QUICK, MB_ICONERROR or MB_OK); 1633 Exit; 1634 end; 1604 1635 SaveAsQuickOrder(Responses); 1605 1636 end; … … 1639 1670 1640 1671 1641 procedure PrintOrdersOnSignRelease(OrderList: TStringList; Nature: Char );1672 procedure PrintOrdersOnSignRelease(OrderList: TStringList; Nature: Char; PrintLoc : Integer =0); 1642 1673 const 1643 1674 TX_NEW_LOC1 = 'The patient''s location has changed to '; … … 1652 1683 PrintIt: Boolean; 1653 1684 begin 1654 CurrentLocationForPatient(Patient.DFN, ALocation, AName, ASvc); 1655 if (ALocation > 0) and (ALocation <> Encounter.Location) then 1656 begin 1657 Encounter.Location := ALocation; 1658 if InfoBox(TX_NEW_LOC1 + AName + TX_NEW_LOC2, TC_NEW_LOC, MB_YESNO) = IDYES 1659 then Encounter.Location := ALocation; 1660 end; 1685 if PrintLoc = 0 then 1686 begin 1687 CurrentLocationForPatient(Patient.DFN, ALocation, AName, ASvc); 1688 if (ALocation > 0) and (ALocation <> Encounter.Location) then 1689 begin 1690 if InfoBox(TX_NEW_LOC1 + AName + TX_NEW_LOC2, TC_NEW_LOC, MB_YESNO) = IDYES 1691 then Encounter.Location := ALocation; 1692 end; 1693 end 1694 else 1695 Encounter.Location := PrintLoc; 1661 1696 if Encounter.Location = 0 1662 1697 then Encounter.Location := CommonLocationForOrders(OrderList); … … 1747 1782 if CharAt(AnID,1) = 'X' then actName := 'change'; 1748 1783 if CharAt(AnID,1) = 'C' then actName := 'copy'; 1749 x := 'You can 1784 x := 'You cannot ' + actName + ' the clinical medication order.'; 1750 1785 x := RetrieveOrderText(Copy(AnID, 2, Length(AnID))) + #13#13#10 + x; 1751 1786 UnlockOrder(Copy(AnID, 2, Length(AnID))); … … 1774 1809 if (not AllowActionOnIMO(AnEventType)) then 1775 1810 begin 1776 x := 'You can not renew thethe clinical medication order.';1811 x := 'You cannot renew the clinical medication order.'; 1777 1812 x := RetrieveOrderText(Piece(AnID,'^',2)) + #13#13#10 + x; 1778 1813 UnlockOrder(Piece(AnID,'^',2)); … … 1809 1844 OriginalMedsInHeight := 0; 1810 1845 OriginalNonVAMedsHeight := 0; 1846 1811 1847 end.
Note:
See TracChangeset
for help on using the changeset viewer.