Changeset 1679 for cprs/trunk/CPRS-Chart/Consults/fODProc.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Consults/fODProc.pas
r829 r1679 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 7 fODBase, StdCtrls, ORCtrls, ExtCtrls, ComCtrls, ORfn, uConst, Buttons, 8 Menus, VA508AccessibilityManager;8 Menus, ORDtTm, VA508AccessibilityManager; 9 9 10 10 type 11 11 TfrmODProc = class(TfrmODBase) 12 cboUrgency: TORComboBox; 13 cboPlace: TORComboBox; 14 txtAttn: TORComboBox; 12 pnlMain: TPanel; 13 pnlCombatVet: TPanel; 15 14 lblProc: TLabel; 16 cboProc: TORComboBox; 15 lblService: TOROffsetLabel; 16 lblReason: TLabel; 17 17 lblUrgency: TStaticText; 18 18 lblPlace: TStaticText; 19 19 lblAttn: TStaticText; 20 20 lblProvDiag: TStaticText; 21 pnlReason: TPanel; 22 memReason: TCaptionRichEdit; 23 cboUrgency: TORComboBox; 24 cboPlace: TORComboBox; 25 txtAttn: TORComboBox; 26 cboProc: TORComboBox; 21 27 cboCategory: TORComboBox; 22 28 cboService: TORComboBox; 23 lblService: TOROffsetLabel; 29 cmdLexSearch: TButton; 30 gbInptOpt: TGroupBox; 31 radInpatient: TRadioButton; 32 radOutpatient: TRadioButton; 33 txtProvDiag: TCaptionEdit; 34 lblEarliest: TStaticText; 35 calEarliest: TORDateBox; 36 lblLatest: TStaticText; 37 calLatest: TORDateBox; 24 38 mnuPopProvDx: TPopupMenu; 25 39 mnuPopProvDxDelete: TMenuItem; 26 cmdLexSearch: TButton;27 40 popReason: TPopupMenu; 28 41 popReasonCut: TMenuItem; … … 31 44 popReasonPaste2: TMenuItem; 32 45 popReasonReformat: TMenuItem; 33 pnlReason: TPanel; 34 memReason: TCaptionRichEdit; 35 gbInptOpt: TGroupBox; 36 radInpatient: TRadioButton; 37 radOutpatient: TRadioButton; 38 txtProvDiag: TCaptionEdit; 39 lblReason: TLabel; 46 txtCombatVet: TVA508StaticText; 47 servicelbl508: TVA508StaticText; 40 48 procedure FormCreate(Sender: TObject); 41 49 procedure txtAttnNeedData(Sender: TObject; const StartFrom: String; … … 64 72 procedure FormResize(Sender: TObject); 65 73 procedure FormClose(Sender: TObject; var Action: TCloseAction); 74 procedure FormShow(Sender: TObject); 66 75 private 67 76 FLastProcID: string; … … 74 83 function ShowPrerequisites: boolean; 75 84 procedure DoSetFontSize( FontSize: integer); 85 procedure SetUpCombatVet; 86 procedure updateService; 87 procedure setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl); 76 88 protected 77 89 procedure InitDialog; override; … … 83 95 end; 84 96 97 98 function CanFreeProcDialog(dialog : TfrmODBase) : boolean; 99 85 100 implementation 86 101 … … 89 104 uses 90 105 rODBase, rConsults, uCore, uConsults, rCore, fConsults, fPCELex, rPCE, ORClasses, 91 clipbrd, fPreReq, uTemplates, fFrame, uODBase, 92 uVA508CPRSCompatibility; 106 clipbrd, fPreReq, uTemplates, fFrame, uODBase, VA508AccessibilityRouter, 107 uVA508CPRSCompatibility; 108 93 109 94 110 var 95 111 ProvDx: TProvisionalDiagnosis; 96 112 GMRCREAF: string; 113 OkToFreeProcDialog: boolean; 97 114 98 115 const … … 108 125 TX_INACTIVE_CODE_REQD = 'Another code must be selected before the order can be saved.'; 109 126 TX_INACTIVE_CODE_OPTIONAL = 'If another code is not selected, no code will be saved.'; 127 TX_PAST_DATE = 'Earliest appropriate date must be today or later.'; 128 TX_BAD_DATES = 'Latest appropriate date must be equal to or later than earliest date.'; 129 130 { ********* Static Unit Methods ************ } 131 132 function CanFreeProcDialog(dialog : TfrmODBase) : boolean; 133 begin 134 Result := true; 135 if (dialog is TfrmODProc) then 136 Result := OkToFreeProcDialog; 137 end; 138 139 { ********************* TfrmODProc Methods **************** } 110 140 111 141 procedure TfrmODProc.FormCreate(Sender: TObject); … … 114 144 AutoSizeDisabled := True; 115 145 inherited; 146 OkToFreeProcDialog := False; 116 147 DoSetFontSize(MainFontSize); 117 148 AllowQuickOrder := True; … … 126 157 cboProc.InitLongList('') ; 127 158 txtAttn.InitLongList('') ; 159 calEarliest.Text := 'TODAY'; 160 //calLatest.Text := 'TODAY+30'; 161 PreserveControl(calEarliest); 162 //PreserveControl(calLatest); 128 163 PreserveControl(txtAttn); 129 164 PreserveControl(cboProc); 165 if (patient.CombatVet.IsEligible = True) then 166 begin 167 SetUpCombatVet; 168 end 169 else 170 begin 171 txtCombatVet.Enabled := False; 172 pnlCombatVet.SendToBack; 173 end; 130 174 InitDialog; 131 175 end; … … 198 242 SetControl(cboPlace, 'PLACE', 1); 199 243 SetControl(txtAttn, 'PROVIDER', 1); 244 SetControl(calEarliest, 'EARLIEST', 1); 245 //SetControl(calLatest, 'LATEST', 1); 200 246 cboProc.Enabled := False; 201 247 cboProc.Font.Color := clGrayText; … … 229 275 if WasTemplateDialogCanceled then 230 276 begin 231 AbortOrder := True; 277 AbortOrder := True; 278 OkToFreeProcDialog := true; 279 SetTemplateDialogCanceled(FALSE); 232 280 Close; 233 281 Exit; … … 238 286 begin 239 287 AbortOrder := True; 288 OkToFreeProcDialog := true; 289 SetTemplateDialogCanceled(FALSE); 240 290 Close; 241 291 Exit; … … 258 308 inherited; 259 309 if cboProc.ItemIEN = 0 then SetError(TX_NO_PROC); 260 if cboUrgency.ItemIEN = 0 then SetError(TX_NO_URGENCY);261 if cboPlace.ItemID = '' then SetError(TX_NO_PLACE);310 if cboUrgency.ItemIEN = 0 then SetError(TX_NO_URGENCY); 311 if cboPlace.ItemID = '' then SetError(TX_NO_PLACE); 262 312 if (not ContainsVisibleChar(memReason.Text)) 263 313 then SetError(TX_NO_REASON); … … 265 315 if (ProvDx.Reqd = 'R') and (Length(txtProvDiag.Text) = 0) then 266 316 begin 267 if ProvDx.PromptMode = 'F' then317 if ProvDx.PromptMode = 'F' then 268 318 SetError(TX_NO_DIAG) 269 319 else 270 320 SetError(TX_SELECT_DIAG); 271 321 end; 322 if calEarliest.FMDateTime < FMToday then SetError(TX_PAST_DATE); 323 //if calLatest.FMDateTime < FMToday then SetError(TX_PAST_DATE); 324 //if calLatest.FMDateTime < calEarliest.FMDateTime then SetError(TX_BAD_DATES); 272 325 end; 273 326 … … 337 390 else Responses.Update('ORDERABLE', 1, '', ''); 338 391 end; 339 (* with cboProc do if ItemIEN > 0 then Responses.Update('ORDERABLE', 1, ItemID, Text) 340 else Responses.Update('ORDERABLE', 1, '', '');*) 341 with cboService do if ItemIEN > 0 then Responses.Update('SERVICE', 1, ItemID, Text) 342 else Responses.Update('SERVICE', 1, '', ''); 392 updateService(); 343 393 with memReason do if GetTextLen > 0 then Responses.Update('COMMENT', 1, TX_WPTYPE, Text); 344 394 with cboCategory do if ItemID <> '' then Responses.Update('CLASS', 1, ItemID, Text); … … 346 396 with cboPlace do if ItemID <> '' then Responses.Update('PLACE', 1, ItemID, Text); 347 397 with txtAttn do if ItemIEN > 0 then Responses.Update('PROVIDER', 1, ItemID, Text); 398 with calEarliest do if Length(Text) > 0 then Responses.Update('EARLIEST', 1, Text, Text); 399 //with calLatest do if Length(Text) > 0 then Responses.Update('LATEST', 1, Text, Text); 348 400 if Length(ProvDx.Text) > 0 then Responses.Update('MISC', 1, ProvDx.Text, ProvDx.Text) 349 401 else Responses.Update('MISC', 1, '', ''); … … 415 467 SetControl(cboPlace, 'PLACE', 1); 416 468 SetControl(txtAttn, 'PROVIDER', 1); 469 SetControl(calEarliest, 'EARLIEST', 1); 470 //SetControl(calLatest, 'LATEST', 1); 417 471 SetTemplateDialogCanceled(FALSE); 418 472 SetControl(memReason, 'COMMENT', 1); … … 588 642 end; 589 643 644 procedure TfrmODProc.setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl); 645 begin 646 if ScreenReaderSystemActive and not ctrl.Enabled then begin 647 lbl.Enabled := True; 648 lbl.Visible := True; 649 lbl.Caption := lblService.Caption + ', ' + Text; 650 lbl.Width := (ctrl.Left + ctrl.Width) - lbl.Left; 651 end else 652 lbl.Visible := false; 653 end; 654 590 655 procedure TfrmODProc.cboServiceChange(Sender: TObject); 591 656 begin … … 813 878 end; 814 879 880 procedure TfrmODProc.updateService; 881 begin 882 with cboService do 883 if ItemIEN > 0 then 884 begin 885 setup508Label(Text, servicelbl508, cboService); 886 Responses.Update('SERVICE', 1, ItemID, Text); 887 end 888 else begin 889 Responses.Update('SERVICE', 1, '', ''); 890 setup508Label('No service selected.', servicelbl508, cboService); 891 end; 892 end; 893 815 894 procedure TfrmODProc.DoSetFontSize(FontSize: integer); 816 895 begin … … 840 919 begin 841 920 inherited; 842 memOrder.Top := PnlReason.Top + PnlReason.Height + 5; 843 921 if Patient.CombatVet.IsEligible then 922 begin 923 memOrder.Top := pnlCombatVet.Height + PnlReason.Top + PnlReason.Height + 7; 924 end 925 else 926 begin 927 memOrder.Top := PnlReason.Top + PnlReason.Height + 7; 928 end; 929 930 end; 931 932 procedure TfrmODProc.FormShow(Sender: TObject); 933 begin 934 inherited; 935 setup508Label('No service selected.', servicelbl508, cboService); 844 936 end; 845 937 … … 850 942 end; 851 943 944 procedure TfrmODProc.SetUpCombatVet; 945 begin 946 pnlCombatVet.BringToFront; 947 txtCombatVet.Enabled := True; 948 txtCombatVet.Caption := 'Combat Veteran Eligibility Expires on ' + patient.CombatVet.ExpirationDate; 949 pnlMain.Top := pnlMain.Top + pnlCombatVet.Height; 950 pnlMain.Anchors := [akLeft,akTop,akRight]; 951 self.Height := self.Height + pnlCombatVet.Height; 952 pnlMain.Anchors := [akLeft,akTop,akRight,akBottom]; 953 end; 954 852 955 end. 853 956
Note:
See TracChangeset
for help on using the changeset viewer.