Changeset 829 for cprs/trunk/CPRS-Chart/Orders/fODDietLT.pas
- Timestamp:
- Jul 7, 2010, 4:31:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Orders/fODDietLT.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 fAutoSz, ExtCtrls, StdCtrls, ORFn ;7 fAutoSz, ExtCtrls, StdCtrls, ORFn, fODBase, rODBase, VA508AccessibilityManager; 8 8 9 9 type … … 36 36 37 37 procedure CheckLateTray(const StartTime: string; var LateTrayFields: TLateTrayFields; IsOutpatient: boolean; AMeal: char = #0); 38 procedure LateTrayCheck(SomeResponses: TResponses; EventId: integer; IsOutpatient: boolean; var LateTrayFields: TLateTrayFields); 39 procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean); 38 40 39 41 implementation … … 192 194 end; 193 195 196 procedure LateTrayCheck(SomeResponses: TResponses; EventId: integer; IsOutpatient: boolean; var LateTrayFields: TLateTrayFields); 197 var 198 AResponse, AnotherResponse: TResponse; 199 begin 200 if IsOutpatient then 201 begin 202 AResponse := SomeResponses.FindResponseByName('ORDERABLE', 1); 203 if (EventID = 0) and (AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then 204 begin 205 AResponse := SomeResponses.FindResponseByName('START', 1); 206 AnotherResponse := SomeResponses.FindResponseByName('MEAL', 1); 207 if (AResponse <> nil) and (AnotherResponse <> nil) then 208 CheckLateTray(AResponse.IValue, LateTrayFields, True, CharAt(AnotherResponse.IValue, 1)); 209 end; 210 end 211 else 212 begin 213 AResponse := SomeResponses.FindResponseByName('ORDERABLE', 1); 214 if (EventID = 0) and (AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then 215 begin 216 AResponse := SomeResponses.FindResponseByName('START', 1); 217 if AResponse <> nil then CheckLateTray(AResponse.IValue, LateTrayFields, False); 218 end; 219 end; 220 end; 221 222 procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean); 223 const 224 TX_EL_SAVE_ERR = 'An error occurred while saving this late tray order.'; 225 TC_EL_SAVE_ERR = 'Error Saving Late Tray Order'; 226 var 227 NewOrder: TOrder; 228 CanSign: integer; 229 begin 230 NewOrder := TOrder.Create; 231 try 232 with LateTrayFields do OrderLateTray(NewOrder, LateMeal, LateTime, IsBagged); 233 if NewOrder.ID <> '' then 234 begin 235 if IsInpatient then 236 begin 237 if (Encounter.Provider = User.DUZ) and User.CanSignOrders 238 then CanSign := CH_SIGN_YES 239 else CanSign := CH_SIGN_NA; 240 end 241 else 242 begin 243 CanSign := CH_SIGN_NA; 244 end; 245 Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, '', CanSign); 246 SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_NEW, Integer(NewOrder)) 247 end 248 else InfoBox(TX_EL_SAVE_ERR, TC_EL_SAVE_ERR, MB_OK); 249 finally 250 NewOrder.Free; 251 end; 252 end; 253 194 254 // ---------- frmODDietLT procedures --------------- 195 255 procedure TfrmODDietLT.FormCreate(Sender: TObject);
Note:
See TracChangeset
for help on using the changeset viewer.