Changeset 829 for cprs/trunk/CPRS-Chart/Consults/fODConsult.pas
- Timestamp:
- Jul 7, 2010, 4:31:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Consults/fODConsult.pas
r456 r829 8 8 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 9 9 fODBase, StdCtrls, ORCtrls, ExtCtrls, ComCtrls, ORfn, uConst, Buttons, 10 Menus, UBAGlobals, rOrders, fBALocalDiagnoses, UBAConst, UBACore, ORNet ; 10 Menus, UBAGlobals, rOrders, fBALocalDiagnoses, UBAConst, UBACore, ORNet, 11 VA508AccessibilityManager ; 11 12 12 13 type … … 18 19 txtAttn: TORComboBox; 19 20 lblService: TLabel; 20 lblUrgency: T StaticText;21 lblPlace: T StaticText;22 lblAttn: T StaticText;23 lblProvDiag: T StaticText;21 lblUrgency: TLabel; 22 lblPlace: TLabel; 23 lblAttn: TLabel; 24 lblProvDiag: TLabel; 24 25 treService: TORTreeView; 25 26 cboCategory: TORComboBox; … … 86 87 procedure cmdQuitClick(Sender: TObject); 87 88 procedure FormClose(Sender: TObject; var Action: TCloseAction); 89 procedure FormResize(Sender: TObject); 90 procedure treServiceEnter(Sender: TObject); 88 91 89 92 private … … 103 106 procedure SaveConsultDxForNurse(pDiagnosis: string); // save the dx entered by nurese if Master BA switch is ON 104 107 procedure SetUpCopyConsultDiagnoses(pOrderID:string); 108 procedure AdjustMemReasonSize; 105 109 protected 106 110 procedure InitDialog; override; … … 125 129 uses 126 130 rODBase, rConsults, uCore, uConsults, rCore, fConsults, fPCELex, rPCE, fPreReq, 127 ORClasses, clipbrd, uTemplates, fFrame, uODBase ;131 ORClasses, clipbrd, uTemplates, fFrame, uODBase, uVA508CPRSCompatibility; 128 132 129 133 var … … 153 157 TX_INACTIVE_CODE_OPTIONAL = 'If another code is not selected, no code will be saved.'; 154 158 159 TX_SVC_HRCHY = 'services/specialties hierarchy'; 160 TX_VIEW_SVC_HRCHY = 'View services/specialties hierarchically'; 161 TX_CLOSE_SVC_HRCHY = 'Close services/specialties hierarchy tree view'; 162 155 163 procedure TfrmODCslt.FormCreate(Sender: TObject); 156 164 begin … … 180 188 Responses.Dialog := 'GMRCOR CONSULT'; // loads formatting info 181 189 StatusText('Loading Default Values'); 182 Defaults.Assign(ODForConsults); // ODForConsults returns TStrings with defaults190 FastAssign(ODForConsults, Defaults); // ODForConsults returns TStrings with defaults 183 191 CtrlInits.LoadDefaults(Defaults); 184 192 txtAttn.InitLongList('') ; … … 229 237 btnServiceTree.Enabled := True; 230 238 pnlServiceTreeButton.Enabled := True; 231 ActiveControl := cboService;232 239 SetProvDiagPromptingMode; 240 ActiveControl := cboService; // set after call to SetProvDiagPromptingMode 233 241 Changing := False; 234 242 StatusText(''); … … 240 248 'Please contact your Clinical Coordinator/IRM staff to fix this order.'; 241 249 TX_INACTIVE_SVC_CAP = 'Inactive Service'; 250 TX_NO_SVC = 'The order or quick order you have selected does not specify a consult service.' + CRLF + 251 'Please contact your Clinical Coordinator/IRM staff to fix this order.'; 252 TC_NO_SVC = 'No service specified'; 242 253 var 243 254 i:integer; … … 254 265 Changing := True; 255 266 tmpResp := TResponse(FindResponseByName('ORDERABLE',1)); 256 SvcIEN := GetServiceIEN(tmpResp.IValue); 267 if tmpResp <> nil then 268 SvcIEN := GetServiceIEN(tmpResp.IValue) 269 else 270 begin 271 InfoBox(TX_NO_SVC, TC_NO_SVC, MB_ICONERROR or MB_OK); 272 AbortOrder := True; 273 Close; 274 Exit; 275 end; 257 276 if SvcIEN = '-1' then 258 277 begin … … 284 303 SetProvDiagPromptingMode; 285 304 GetProvDxandValidateCode(Responses); 305 SetTemplateDialogCanceled(FALSE); 286 306 SetControl(memReason, 'COMMENT', 1); 307 if WasTemplateDialogCanceled then 308 begin 309 AbortOrder := True; 310 Close; 311 Exit; 312 end; 313 SetTemplateDialogCanceled(FALSE); 287 314 SetupReasonForRequest(OrderAction); 315 if WasTemplateDialogCanceled then 316 begin 317 AbortOrder := True; 318 Close; 319 Exit; 320 end; 288 321 Changing := False; 289 322 ControlChange(Self); … … 292 325 begin 293 326 if QuickList.Count > 0 then BuildQuickTree(QuickList, '0', nil) ; 294 SvcList.Assign(LoadServiceListWithSynonyms(CN_SVC_LIST_ORD)); {RV}295 AList.Assign(SvcList);327 FastAssign(LoadServiceListWithSynonyms(CN_SVC_LIST_ORD), SvcList); {RV} 328 FastAssign(SvcList, AList); 296 329 SortByPiece(AList, U, 2); 297 330 BuildServiceTree(treService, SvcList, '0', nil) ; … … 308 341 if QuickList.Count > 0 then with cboService do 309 342 begin 310 Items.Assign(QuickList);343 FastAssign(QuickList, cboService.Items); 311 344 Items.Add(LLS_LINE); 312 345 Items.Add(LLS_SPACE); … … 338 371 Exit; 339 372 end; 340 memReason.Lines.Assign(DefaultReasonForRequest(cboService.ItemID, True));373 QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason); 341 374 end; 342 375 PreserveControl(treService); … … 555 588 SetControl(cboPlace, 'PLACE', 1); 556 589 SetControl(txtAttn, 'PROVIDER', 1); 590 SetTemplateDialogCanceled(FALSE); 557 591 SetControl(memReason, 'COMMENT', 1); 592 if WasTemplateDialogCanceled and OrderContainsObjects then 593 begin 594 AbortOrder := TRUE; 595 Close; 596 Exit; 597 end; 558 598 if ((cboService.ItemIEN > 0) and (Length(memReason.Text) = 0)) then 559 memReason.Lines.Assign(DefaultReasonForRequest(cboService.ItemID, True));599 QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason); 560 600 SetupReasonForRequest(ORDER_QUICK); 561 601 GetProvDxandValidateCode(Responses); … … 571 611 Exit; 572 612 end; 573 memReason.Lines.Assign(DefaultReasonForRequest(cboService.ItemID, True));613 QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason); 574 614 SetupReasonForRequest(ORDER_NEW); 575 615 end; … … 620 660 end; 621 661 662 procedure TfrmODCslt.treServiceEnter(Sender: TObject); 663 begin 664 inherited; 665 cmdQuit.Cancel := FALSE; 666 end; 667 622 668 procedure TfrmODCslt.treServiceExit(Sender: TObject); 623 669 begin 624 670 inherited; 671 cmdQuit.Cancel := TRUE; 625 672 with cboService do 626 673 begin … … 688 735 AStringList := TStringList.Create; 689 736 try 690 AStringList.Assign(memReason.Lines); 737 //QuickCopy(memReason, AStringList); 738 AStringList.Text := memReason.Text; 691 739 LimitStringLength(AStringList, 74); 692 memReason.Lines.Assign(AstringList); 740 //QuickCopy(AstringList, memReason); 741 memReason.Text := AStringList.Text; 693 742 ControlChange(Self); 694 743 finally … … 762 811 SetControl(cboPlace, 'PLACE', 1); 763 812 SetControl(txtAttn, 'PROVIDER', 1); 813 SetTemplateDialogCanceled(FALSE); 764 814 SetControl(memReason, 'COMMENT', 1); 815 if WasTemplateDialogCanceled and OrderContainsObjects then 816 begin 817 AbortOrder := TRUE; 818 Close; 819 Exit; 820 end; 765 821 // if ((cboService.ItemIEN > 0) and (Length(memReason.Text) = 0)) then 766 // memReason.Lines.Assign(DefaultReasonForRequest(cboService.ItemID, True));822 // QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason); 767 823 SetupReasonForRequest(ORDER_QUICK); 768 824 GetProvDxandValidateCode(Responses); … … 779 835 Exit; 780 836 end; 781 memReason.Lines.Assign(DefaultReasonForRequest(cboService.ItemID, True));837 QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason); 782 838 SetupReasonForRequest(ORDER_NEW); 783 839 Changing := False; … … 824 880 if treService.Visible then 825 881 begin 882 // for some reason screen reader is reading caption when tree view is not visible 883 treService.Caption := TX_SVC_HRCHY; 884 pnlServiceTreeButton.Caption := TX_CLOSE_SVC_HRCHY; 885 btnServiceTree.Hint := TX_CLOSE_SVC_HRCHY; 826 886 treService.SetFocus; 827 887 with treService do for i := 0 to Items.Count-1 do … … 834 894 end; 835 895 end; 896 end 897 else 898 begin 899 treService.Caption := ''; 900 pnlServiceTreeButton.Caption := TX_VIEW_SVC_HRCHY; 901 btnServiceTree.Hint := TX_VIEW_SVC_HRCHY; 902 pnlServiceTreeButton.SetFocus; 836 903 end; 837 904 Changing := False; … … 863 930 txtProvDiag.Enabled := False; 864 931 txtProvDiag.Font.Color := clGrayText; 865 lblProvDiag.Enabled := False;866 932 txtProvDiag.ReadOnly := True; 867 933 txtProvDiag.Color := clBtnFace; … … 940 1006 txtProvDiag.Color := clBtnFace; 941 1007 txtProvDiag.Font.Color := clBtnText; 942 lblProvDiag.Enabled := False;943 1008 txtProvDiag.Hint := ''; 944 1009 if cboService.ItemIEN = 0 then Exit; … … 962 1027 txtProvDiag.Color := clBtnFace; 963 1028 txtProvDiag.Font.Color := clBtnText; 964 lblProvDiag.Enabled := False;965 1029 end 966 1030 else … … 972 1036 txtProvDiag.Color := clWindow; 973 1037 txtProvDiag.Font.Color := clWindowText; 974 lblProvDiag.Enabled := True;975 1038 end; 976 1039 'L': begin … … 989 1052 txtProvDiag.Color := clInfoBk; 990 1053 txtProvDiag.Font.Color := clInfoText; 991 lblProvDiag.Enabled := True;992 1054 end; 993 1055 end; … … 1037 1099 begin 1038 1100 if ((OrderAction = ORDER_QUICK) and (cboService.ItemID <> '') and (Length(memReason.Text) = 0)) then 1039 memReason.Lines.Assign(DefaultReasonForRequest(cboService.ItemID, True));1101 QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason); 1040 1102 EditReason := GMRCREAF; 1041 1103 if EditReason = '' then EditReason := ReasonForRequestEditable(cboService.ItemID + CSLT_PTR); … … 1065 1127 if ItemIEN > 0 then 1066 1128 begin 1067 Alist.Assign(GetServicePrerequisites(ItemID + CSLT_PTR));1129 FastAssign(GetServicePrerequisites(ItemID + CSLT_PTR), Alist); 1068 1130 if AList.Count > 0 then 1069 1131 begin … … 1154 1216 try 1155 1217 Result := GetDefaultReasonForRequest(Service + CSLT_PTR, Resolve); 1156 TmpSL.Assign(Result);1218 FastAssign(Result, TmpSL); 1157 1219 x := TmpSL.Text; 1158 1220 ExpandOrderObjects(x, HasObjects); … … 1160 1222 Responses.OrderContainsObjects := HasObjects; 1161 1223 ExecuteTemplateOrBoilerPlate(TmpSL, cboService.ItemIEN , ltConsult, nil, 'Reason for Request: ' + cboService.DisplayText[cboService.ItemIndex], DocInfo); 1162 if TmpSL.Text <> x then Responses.OrderContainsObjects := False; 1163 Result.Assign(TmpSL); 1224 AbortOrder := WasTemplateDialogCanceled; 1225 Responses.OrderContainsObjects := HasObjects or TemplateBPHasObjects; 1226 if AbortOrder then 1227 begin 1228 Result.Text := ''; 1229 Close; 1230 Exit; 1231 end 1232 else 1233 FastAssignWith508Msg(TmpSL, Result); 1164 1234 finally 1165 1235 TmpSL.Free; … … 1190 1260 treServiceChange(Sender, treService.Selected); 1191 1261 end; 1262 VK_ESCAPE: 1263 begin 1264 key := 0; 1265 btnServiceTreeClick(Self); 1266 end 1192 1267 else 1193 1268 FKeyBoarding := True; … … 1406 1481 end; 1407 1482 1483 procedure TfrmODCslt.FormResize(Sender: TObject); 1484 begin 1485 inherited; 1486 AdjustMemReasonSize(); 1487 end; 1488 1489 procedure TfrmODCslt.AdjustMemReasonSize; 1490 const 1491 PIXEL_SPACE = 3; 1492 begin 1493 pnlReason.Top := cboService.Top + cboService.Height + PIXEL_SPACE; 1494 pnlReason.Height := memOrder.Top - pnlReason.Top - PIXEL_SPACE; 1495 end; 1496 1408 1497 end. 1409 1498
Note:
See TracChangeset
for help on using the changeset viewer.