Changeset 1679 for cprs/trunk/CPRS-Chart/Orders/uOrders.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Orders/uOrders.pas
r829 r1679 4 4 5 5 uses 6 Windows, Messages, SysUtils, Classes, Controls, Forms, uConst, rOrders, ORFn, 7 Dialogs, ORCtrls, stdCtrls, strUtils, fODBase, fODMedOIFA; 6 Windows, Messages, SysUtils, Classes, Controls, Forms, uConst, rConsults, 7 rOrders, ORFn, Dialogs, ORCtrls, stdCtrls, strUtils, fODBase, fODMedOIFA, 8 VA508AccessibilityRouter; 8 9 9 10 type … … 72 73 function AllowActionOnIMO(AnEvtTyp: char): boolean; 73 74 function IMOActionValidation(AnId: string; var IsIMOOD: boolean; var x: string; AnEventType: char): boolean; 75 function IMOTimeFrame: TFMDateTime; 74 76 75 77 … … 290 292 ((Encounter.Provider > 0) and (not PersonHasKey(Encounter.Provider, 'PROVIDER'))) then 291 293 begin 292 UpdateEncounter(NPF_PROVIDER );294 UpdateEncounter(NPF_PROVIDER, 0, 0, True); 293 295 frmFrame.DisplayEncounterText; 294 296 end; … … 491 493 MedsNVADlgFormID := FormIDForDialog(MedsNVADlgIen); 492 494 MedsIVDlgFormID := FormIDForDialog(MedsIVDlgIen); 495 end; 496 497 function CanCloseDialog(dialog : TfrmODBase) : Boolean; 498 begin 499 if uOrderDialog.FillerID = 'GMRC' then 500 result := fODConsult.CanFreeConsultDialog(dialog) 501 or fODProc.CanFreeProcDialog(dialog); 493 502 end; 494 503 … … 750 759 case AFormID of 751 760 OM_ALLERGY: if ARTPatchInstalled then 752 DialogClass := TfrmARTAllergy 761 begin 762 // DialogClass := TfrmARTAllergy; 763 EnterEditAllergy(0, TRUE, FALSE, AnOwner, ARefNum); 764 Result := True; 765 // uOrderMenu.Close; 766 Exit; 767 end 753 768 else 754 769 begin … … 786 801 TX_EVTDEL_DIET_CONFLICT = 'Have you done either of the above?'; 787 802 TC_EVTDEL_DIET_CONFLICT = 'Possible delayed order conflict'; 803 TX_INACTIVE_SVC = 'This consult service is currently inactive and not receiving requests.' + CRLF + 804 'Please contact your Clinical Coordinator/IRM staff to fix this order.'; 805 TX_INACTIVE_SVC_CAP = 'Inactive Service'; 806 TX_NO_SVC = 'The order or quick order you have selected does not specify a consult service.' + CRLF + 807 'Please contact your Clinical Coordinator/IRM staff to fix this order.'; 808 TC_NO_SVC = 'No service specified'; 788 809 var 789 810 ResolvedDialog: TOrderDialogResolved; … … 796 817 CxMsg: string; 797 818 AButton: TButton; 819 SvcIEN: string; 820 //CsltFrmID: integer; 798 821 begin 799 822 IsPsoSupply := False; … … 807 830 DrugTestDlgType := false; 808 831 //QOAltOI.OI := 0; 832 Application.ProcessMessages; 809 833 // double check environment before continuing with order 810 834 if uOrderDialog <> nil then uOrderDialog.Close; // then x := uOrderDialog.Name else x := ''; … … 859 883 OrderPtEvtID := GetOrderPtEvtID(Copy(AnID, 2, Length(AnID))); 860 884 OrderEvtID := Piece(EventInfo(OrderPtEvtID),'^',2); 885 //CQ 18660 Orders for events should be modal. Orders for non-event should not be modal 886 if AnEvent.EventIFN > 0 then frmOrders.NeedShowModal := true 887 else frmOrders.NeedShowModal := false; 861 888 // evaluate order dialog, build response list & see what form should be presented 862 889 FillChar(ResolvedDialog, SizeOf(ResolvedDialog), #0); … … 967 994 if QuickLevel = QL_REJECT then InfoBox(ShowText, TC_DLG_REJECT, MB_OK); 968 995 if (QuickLevel = QL_VERIFY) and (IsPharmacyOrder or ANeedVerify) then ShowVerifyText(QuickLevel, ShowText, DisplayGroup=InptDisp); 969 if QuickLevel = QL_AUTO then FormID := OD_AUTOACK; 996 if QuickLevel = QL_AUTO then 997 begin 998 //CsltFrmID := FormID; 999 FormID := OD_AUTOACK; 1000 end; 970 1001 if (QuickLevel = QL_REJECT) or (QuickLevel = QL_CANCEL) then Exit; 971 1002 PushKeyVars(ResolvedDialog.QOKeyVars); … … 1046 1077 uOrderDialog.IsSupply := True; 1047 1078 SetupDialog(ORDER_QUICK, ResolvedDialog.ResponseID); 1079 {if ((ResolvedDialog.DisplayGroup = CsltDisp) 1080 and (ResolvedDialog.QuickLevel = QL_AUTO)) then 1081 TfrmODCslt.SetupDialog(ORDER_QUICK, ResolvedDialog.ResponseID);} 1048 1082 end; 1049 1083 end; 1050 1084 1051 1085 if Assigned(uOrderDialog) then 1052 with uOrderDialog do if AbortOrder then 1053 begin 1054 Close; 1055 Exit; 1056 end; 1086 with uOrderDialog do 1087 if AbortOrder and CanCloseDialog(uOrderDialog) then 1088 begin 1089 Close; 1090 if Assigned(uOrderDialog) then 1091 uOrderDialog.Destroy; 1092 Exit; 1093 end; 1057 1094 1058 1095 if CharAt(AnID, 1) = 'T' then … … 1148 1185 if ValidateDrugAutoAccept(tempDrug, tempUnit, tempSch, tempDur, tempOI, StrtoInt(tempSupply), StrtoInt(tempQuantity), StrtoInt(tempRefills)) = false then Exit; 1149 1186 end; 1187 if ((ResolvedDialog.DisplayGroup = CsltDisp) and (ResolvedDialog.QuickLevel = QL_AUTO)) then 1188 begin 1189 with Responses do 1190 begin 1191 Changing := True; 1192 tmpResp := TResponse(FindResponseByName('ORDERABLE',1)); 1193 if tmpResp <> nil then 1194 SvcIEN := GetServiceIEN(tmpResp.IValue) 1195 else 1196 begin 1197 InfoBox(TX_NO_SVC, TC_NO_SVC, MB_ICONERROR or MB_OK); 1198 //AbortOrder := True; 1199 //Close; 1200 Exit; 1201 end; 1202 if SvcIEN = '-1' then 1203 begin 1204 InfoBox(TX_INACTIVE_SVC, TX_INACTIVE_SVC_CAP, MB_OK); 1205 //AbortOrder := True; 1206 //Close; 1207 Exit; 1208 end; 1209 end; 1210 end; 1150 1211 cmdAcceptClick(Application); // auto-accept order 1151 1212 Result := uOrderDialog.AcceptOK; 1213 if (result = true) and (ScreenReaderActive) then 1214 GetScreenReader.Speak('Auto Accept Quick Order '+ Responses.DialogDisplayName + ' placed.'); 1152 1215 1153 1216 //BAPHII 1.3.2 … … 1304 1367 var 1305 1368 InitialCall: Boolean; 1369 i: integer; 1370 str: string; 1306 1371 begin 1307 1372 InitialCall := False; 1373 if ScreenReaderActive then 1374 begin 1375 for i := 0 to AList.Count - 1 do 1376 begin 1377 if Piece(Alist.Strings[i],U,2) = 'Q' then str := str + CRLF + 'Quick Order ' + Piece(Alist.Strings[i],U,3) 1378 else if Piece(Alist.Strings[i],U,2) = 'S' then str := str + CRLF + 'Order Set ' + Piece(Alist.Strings[i],U,3) 1379 else if Piece(Alist.Strings[i],U,2) = 'M' then str := str + CRLF + 'Order Menu ' + Piece(Alist.Strings[i],U,3) 1380 else if Piece(Alist.Strings[i],U,2) = 'A' then str := str + CRLF + 'Order Action ' + Piece(Alist.Strings[i],U,3) 1381 else str := str + CRLF + 'Order Dialog ' + Piece(Alist.Strings[i],U,3); 1382 end; 1383 if infoBox('This order set contains the following items:'+ CRLF + str + CRLF+ CRLF + 'Select the OK button to start this order set.' + 1384 'To stop the order set while it is in process, press Alt +F6 to navigate to the order set dialog, and select the Stop Order Set Button.', 'Starting Order Set' ,MB_OKCANCEL) = IDCANCEL then 1385 begin 1386 Result := False; 1387 exit; 1388 end; 1389 end; 1308 1390 if uOrderSet = nil then 1309 1391 begin … … 1379 1461 { make sure a location and provider are selected before ordering } 1380 1462 if not AuthorizedUser then Exit; 1381 if (not Patient.Inpatient) and (AnEvent.EventIFN > 0 ) then x := '' 1463 //Added to force users without the Provider or ORES key to select an a provider when adding new orders to existing delay orders 1464 if (not Patient.Inpatient) and (AnEvent.EventIFN > 0 ) then 1465 begin 1466 if (User.OrderRole = OR_PHYSICIAN) and (Encounter.Provider = User.DUZ) and (User.IsProvider) then 1467 x := '' 1468 else if not EncounterPresentEDO then Exit; 1469 x := ''; 1470 end 1382 1471 else 1383 1472 begin … … 1842 1931 //else 1843 1932 //Encounter.Location := PrintLoc; 1933 if (PrintLoc = 0) and (Encounter.Location > 0) then PrintLoc := Encounter.Location; 1844 1934 if PrintLoc = 0 1845 1935 then PrintLoc := CommonLocationForOrders(OrderList); 1846 if (PrintLoc = 0) and (Encounter.Location > 0) then PrintLoc := Encounter.Location;1847 1848 1936 if PrintLoc = 0 then // location required for DEVINFO 1849 1937 begin … … 1865 1953 end 1866 1954 else InfoBox(TX_SIGN_LOC, TC_REQ_LOC, MB_OK or MB_ICONWARNING); 1867 (* Encounter.Location := PrintLoc;1868 if Encounter.Location = 01869 then Encounter.Location := CommonLocationForOrders(OrderList);1870 if Encounter.Location = 0 then // location required for DEVINFO1871 begin1872 LookupLocation(ALocation, AName, LOC_ALL, TX_LOC_PRINT);1873 if ALocation > 0 then Encounter.Location := ALocation;1874 end;1875 if printLoc = 0 then frmFrame.DisplayEncounterText;1876 if Encounter.Location <> 0 then1877 begin1878 SetupOrdersPrint(OrderList, DeviceInfo, Nature, False, PrintIt, PrintName);1879 if PrintIt then1880 PrintOrdersOnReview(OrderList, DeviceInfo)1881 else1882 PrintServiceCopies(OrderList);1883 end1884 else InfoBox(TX_SIGN_LOC, TC_REQ_LOC, MB_OK or MB_ICONWARNING); *)1885 1955 end; 1886 1956 … … 1916 1986 result := False; 1917 1987 IsInptDlg := False; 1918 Td := FMToday; 1988 //CQ #15188 - allow IMO functionality 23 hours after encounter date/time - TDP 1989 //Td := FMToday; 1990 Td := IMOTimeFrame; 1919 1991 if ( (DlgID = MedsInDlgIen) or (DlgID = MedsIVDlgIen) or (IsInptQO(dlgId)) or (IsIVQO(dlgId))) then IsInptDlg := TRUE; 1920 1992 IsIMOLocation := IsValidIMOLoc(Encounter.Location,Patient.DFN); … … 1936 2008 else 1937 2009 begin 1938 Td := FMToday; 2010 //CQ #15188 - allow IMO functionality 23 hours after encounter date/time - TDP 2011 //Td := FMToday; 2012 Td := IMOTimeFrame; 1939 2013 if IsValidIMOLoc(Encounter.Location,Patient.DFN) and (Encounter.DateTime > Td) then 1940 2014 Result := True … … 2004 2078 end; 2005 2079 end; 2080 end; 2081 2082 //CQ #15188 - New function to allow IMO functionality 23 hours after encounter date/time - TDP 2083 function IMOTimeFrame: TFMDateTime; 2084 begin 2085 Result := DateTimeToFMDateTime(FMDateTimeToDateTime(FMNow) - (23/24)); 2006 2086 end; 2007 2087
Note:
See TracChangeset
for help on using the changeset viewer.