Changeset 829 for cprs/trunk/CPRS-Chart/Orders/fODBase.pas
- Timestamp:
- Jul 7, 2010, 4:31:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Orders/fODBase.pas
r456 r829 8 8 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, fAutoSz, StdCtrls, 9 9 ORCtrls, ORFn, uConst, rOrders, rODBase, uCore, ComCtrls, ExtCtrls, Menus, Mask, 10 Buttons, UBAGlobals, UBACore ;10 Buttons, UBAGlobals, UBACore, VA508AccessibilityManager; 11 11 12 12 type … … 182 182 procedure SetDialogIEN(Value: Integer); virtual; 183 183 procedure Validate(var AnErrMsg: string); virtual; 184 procedure updateSig; virtual; 184 185 function ValidSave: Boolean; 185 186 procedure ShowOrderMessage(Show: boolean); … … 221 222 222 223 var 223 frmODBase: TfrmODBase ;224 frmODBase: TfrmODBase = nil; 224 225 XfInToOutNow :boolean = False; // it's used only for transfering Inpatient Meds to OutPatient Med for 225 226 // immediately release (NO EVENT DELAY) … … 246 247 uses fOCAccept, uODBase, rCore, rMisc, fODMessage, 247 248 fTemplateDialog, uEventHooks, uTemplates, rConsults,fOrders,uOrders, 248 fFrame, uTemplateFields, fClinicWardMeds ;249 fFrame, uTemplateFields, fClinicWardMeds, fODDietLT, rODDiet, VAUtils; 249 250 250 251 const … … 425 426 else if AControl is TButton then with TButton(AControl) do Caption := CtrlInit.Text 426 427 else if AControl is TEdit then with TEdit(AControl) do Text := CtrlInit.Text 427 else if AControl is TMemo then with TMemo(AControl) do Lines.Assign(CtrlInit.List)428 else if AControl is TRichEdit then with TRichEdit(AControl) do Lines.Assign(CtrlInit.List)429 else if AControl is TORListBox then with TORListBox(AControl) do Items.Assign(CtrlInit.List)430 else if AControl is TListBox then with TListBox(AControl) do Items.Assign(CtrlInit.List)428 else if AControl is TMemo then FastAssign(CtrlInit.List, TMemo(AControl).Lines) 429 else if AControl is TRichEdit then QuickCopy(CtrlInit.List, TRichEdit(AControl)) 430 else if AControl is TORListBox then FastAssign(CtrlInit.List, TORListBox(AControl).Items) 431 else if AControl is TListBox then FastAssign(CtrlInit.List, TListBox(AControl).Items) 431 432 else if AControl is TComboBox then with TComboBox(AControl) do 432 433 begin 433 Items.Assign(CtrlInit.List);434 FastAssign(CtrlInit.List, TComboBox(AControl).Items); 434 435 Text := CtrlInit.Text; 435 436 end 436 437 else if AControl is TORComboBox then with TORComboBox(AControl) do 437 438 begin 438 Items.Assign(CtrlInit.List);439 FastAssign(CtrlInit.List, TORComboBox(AControl).Items); 439 440 if LongList then InitLongList(Text) else Text := CtrlInit.Text; 440 441 SelectByID(CtrlInit.ListID); … … 450 451 CtrlInit := FindInitByName(ASection); 451 452 if CtrlInit = nil then Exit; 452 if AControl is TMemo then with TMemo(AControl) do Lines.Assign(CtrlInit.List)453 else if AControl is TORListBox then with TORListBox(AControl) do Items.Assign(CtrlInit.List)454 else if AControl is TListBox then with TListBox(AControl) do Items.Assign(CtrlInit.List)455 else if AControl is TComboBox then with TComboBox(AControl) do Items.Assign(CtrlInit.List)456 else if AControl is TORComboBox then with TORComboBox(AControl) do Items.Assign(CtrlInit.List);453 if AControl is TMemo then FastAssign(CtrlInit.List, TMemo(AControl).Lines) 454 else if AControl is TORListBox then FastAssign(CtrlInit.List, TORListBox(AControl).Items) 455 else if AControl is TListBox then FastAssign(CtrlInit.List, TListBox(AControl).Items) 456 else if AControl is TComboBox then FastAssign(CtrlInit.List, TComboBox(AControl).Items) 457 else if AControl is TORComboBox then FastAssign(CtrlInit.List, TORComboBox(AControl).Items); 457 458 end; 458 459 … … 1028 1029 //AGP Text orders are only treated as IMO if the order display group is a nursing display group 1029 1030 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)) or1031 (((pos('OR GXTEXT WORD PROCESSING ORDER',ConstructOrder.DialogName)>0) and (ConstructOrder.DGroup = NurDisp)) or 1031 1032 ((ConstructOrder.DialogName = 'OR GXMISC GENERAL') and (ConstructOrder.DGroup = NurDisp)) or 1032 1033 ((ConstructOrder.DialogName = 'OR GXTEXT TEXT ONLY ORDER') and (ConstructOrder.DGroup = NurDisp))) and //AGP Change CQ #10757 … … 1144 1145 // CheckBoilerplate4Fields(tmp, cptn) 1145 1146 //else 1146 ExecuteTemplateOrBoilerPlate(tmp, IEN, LType, nil, cptn, DocInfo); 1147 1148 // CQ #11669 - changing an existing order shouldn't restart template - JM 1149 if assigned(frmODBase) and (frmODBase.FOrderAction = ORDER_EDIT) then 1150 CheckBoilerplate4Fields(tmp, cptn) 1151 else 1152 ExecuteTemplateOrBoilerPlate(tmp, IEN, LType, nil, cptn, DocInfo); 1147 1153 end 1148 1154 else … … 1391 1397 begin 1392 1398 inherited; 1393 memOrder.Color := ReadOnlyColor;1399 frmODBase := Self; 1394 1400 FAcceptOK := False; 1395 1401 FAutoAccept := False; … … 1420 1426 FEvtType := OrderEventTypeOnCreate; 1421 1427 FEvtName := OrderEventNameOnCreate; 1428 DefaultButton := cmdAccept; 1422 1429 end; 1423 1430 1424 1431 procedure TfrmODBase.FormDestroy(Sender: TObject); 1425 1432 begin 1433 frmODBase := nil; 1426 1434 FCtrlInits.Free; 1427 1435 FResponses.Free; … … 1478 1486 NewOrder: TOrder; 1479 1487 CanSign, OrderAction: Integer; 1488 IsDelayOrder: boolean; 1480 1489 //thisSourceOrder: TOrder; 1481 1490 begin 1482 1491 Result := True; 1483 1492 Validate(ErrMsg); 1493 IsDelayOrder := False; 1484 1494 if Length(ErrMsg) > 0 then 1485 1495 begin … … 1531 1541 else CanSign := CH_SIGN_NA; 1532 1542 if NewOrder.Signature = OSS_NOT_REQUIRE then CanSign := CH_SIGN_NA; 1533 Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, Responses.FViewName, CanSign); 1543 if NewOrder.EventPtr <> '' then IsDelayOrder := True; 1544 Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, Responses.FViewName, CanSign,'',0, NewOrder.DGroupName, False,IsDelayOrder); 1534 1545 1535 1546 UBAGlobals.TargetOrderID := NewOrder.ID; … … 1558 1569 theGrpName: string; 1559 1570 alreadyClosed: boolean; 1571 LateTrayFields: TLateTrayFields; 1572 x, CxMsg: string; 1560 1573 begin 1561 1574 FAcceptOK := False; … … 1571 1584 end; 1572 1585 end; 1586 1587 // check for diet orders that will be auto-DCd because of start/stop overlaps 1588 if Responses.Dialog = 'FHW1' then 1589 begin 1590 if (Self.EvtID <> 0) then 1591 begin 1592 CheckForAutoDCDietOrders(Self.EvtID, Self.DisplayGroup, '', CxMsg, cmdAccept); 1593 if CxMsg <> '' then 1594 begin 1595 if InfoBox(CxMsg + CRLF + CRLF + 1596 'Have you done either of the above?', 'Possible delayed order conflict', 1597 MB_ICONWARNING or MB_YESNO) = ID_NO 1598 then exit; 1599 end; 1600 end 1601 else if FAutoAccept then 1602 begin 1603 x := CurrentDietText; 1604 CheckForAutoDCDietOrders(0, Self.DisplayGroup, x, CxMsg, nil); 1605 if CxMsg <> '' then 1606 begin 1607 if InfoBox(CxMsg + CRLF + 1608 'Are you sure?', 'Confirm', MB_ICONWARNING or MB_YESNO) = ID_NO then 1609 begin 1610 //AbortOrder := True; 1611 FAcceptOK := FALSE; 1612 //cmdQuitClick(Self); 1613 exit; 1614 end; 1615 end; 1616 end; 1617 end; 1618 1573 1619 if ValidSave then 1574 1620 begin … … 1581 1627 else 1582 1628 begin 1629 LateTrayFields.LateMeal := #0; 1630 with Responses do 1631 if FAutoAccept and ((Dialog = 'FHW1') or (Dialog = 'FHW OP MEAL') or (Dialog ='FHW SPECIAL MEAL')) then 1632 begin 1633 LateTrayCheck(Responses, Self.EvtID, not OrderForInpatient, LateTrayFields); 1634 end; 1583 1635 ClearDialogControls; // to allow form to close without prompting to save order 1636 with LateTrayFields do if LateMeal <> #0 then LateTrayOrder(LateTrayFields, OrderForInpatient); 1584 1637 Close; 1585 1638 alreadyClosed := True; … … 1627 1680 begin 1628 1681 inherited; 1682 FFromQuit := True; 1629 1683 Close; 1630 1684 end; … … 1665 1719 exit; 1666 1720 end; 1721 if FFromQuit = False then updateSig; 1667 1722 if Length(memOrder.Text) > 0 then 1668 1723 begin … … 1681 1736 if not ValidSave then CanClose := False; 1682 1737 if CanClose then InitDialog; 1738 end; 1739 1740 procedure TfrmODBase.updateSig; 1741 begin 1742 1683 1743 end; 1684 1744 … … 1785 1845 if Length(TempMSG)>0 then 1786 1846 begin 1787 ShowM essage(TempMSG);1847 ShowMsg(TempMSG); 1788 1848 Result := False; 1789 1849 end;
Note:
See TracChangeset
for help on using the changeset viewer.