Procedure

TfrmODBase.cmdAcceptClick

Module

fODBase

Last Modified

7/15/2014 3:26:40 PM

Visibility

Public/Published

Owner

TfrmODBase

Declaration

procedure cmdAcceptClick(Sender: TObject);

Calls Hierarchy


TfrmODBase.cmdAcceptClick
 ├IsCompletedPtEvt
 ├CheckForAutoDCDietOrders
 │ ├LoadOrdersAbbr
 │ │ ├ClearOrders
 │ │ ├LoadDGroupMap
 │ │ ├ExpiredOrdersStartDT
 │ │ ├FMNow
 │ │ └SeqOfDGroup
 │ │   └LoadDGroupMap
 │ └RetrieveOrderFields
 │   └SetOrderFields
 │     ├TOrder.Clear
 │     ├SeqOfDGroup...
 │     └TopNameOfDGroup
 │       └LoadDGroupMap
 ├CurrentDietText
 ├TfrmODBase.ValidSave
 │ ├TfrmODBase.Validate
 │ │ ├TResponses.IValueFor
 │ │ ├StrToFMDateTime
 │ │ ├FMToday
 │ │ │ └FMNow
 │ │ ├PersonHasKey
 │ │ ├IsPFSSActive
 │ │ ├TResponses.PromptExists
 │ │ ├TResponses.Update
 │ │ │ ├TResponses.FindResponseByName
 │ │ │ └TResponses.IENForPrompt
 │ │ └TEncounter.GetVisitStr
 │ │   └TEncounter.GetVisitCategory
 │ ├TfrmODBase.AcceptOrderChecks
 │ │ ├OrderChecksEnabled
 │ │ ├TResponses.BuildOCItems
 │ │ │ ├TResponses.IValueFor
 │ │ │ └TResponses.EValueFor
 │ │ ├OrderChecksOnAccept
 │ │ └AcceptOrderWithChecks
 │ │   ├TfrmBase508Form.Create
 │ │   │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ │   │ ├UnfocusableControlEnter
 │ │   │ └AdjustControls
 │ │   │   ├TfrmBase508Form.ModifyUnfocusableControl
 │ │   │   └..(rec)..
 │ │   ├IsMonograph
 │ │   └GetXtraTxt
 │ ├TfrmFrame.GetTimedOut
 │ │ └TimedOut
 │ ├AskAnotherOrder
 │ ├TfrmODBase.InitDialog
 │ │ ├TfrmODBase.ClearDialogControls
 │ │ │ ├ClearControl
 │ │ │ └TfrmODBase.ShowOrderMessage
 │ │ └TResponses.Clear
 │ ├TfrmODBase.ClearDialogControls...
 │ ├TfrmODBase.LESValidationCheck
 │ │ ├GetDispGroupForLES
 │ │ ├TResponses.IValueFor
 │ │ └LESValidationForChangedLabOrder
 │ ├TResponses.SaveOrder
 │ │ ├CheckQOGroup
 │ │ ├IsValidIMOLoc
 │ │ ├EventExist
 │ │ ├PutNewOrder
 │ │ │ ├SetupORDIALOG
 │ │ │ └SetOrderFields...
 │ │ ├EventInfo
 │ │ ├SaveEvtForOrder
 │ │ └rpcGetBAMasterSwStatus
 │ ├SetDefaultCoPayToNewOrder
 │ ├ProcessOrderAcceptEventHook
 │ │ ├GetOrderAcceptGUIDs
 │ │ ├EnsureEventHookObjects
 │ │ │ └TCPRSEventHookManager.Create
 │ │ │   ├TCPRSBroker.Create
 │ │ │   └TCPRSState.Create
 │ │ └TCPRSEventHookManager.ProcessComObject
 │ │   └TCPRSBroker.Initialize
 │ ├GetEventDefaultDlg
 │ └TChanges.Add
 │   └TChangeItem.Create
 ├AskAnotherOrder
 ├TfrmODBase.InitDialog...
 ├LateTrayCheck
 │ ├TResponses.FindResponseByName
 │ └CheckLateTray
 │   ├StrToFMDateTime
 │   ├FMToday...
 │   ├FMNow
 │   ├LoadDietParams
 │   ├SetAvailTimes
 │   │ └AMPMToFMTime
 │   └TfrmBase508Form.Create...
 ├TfrmODBase.OrderForInpatient
 │ ├OrderEventTypeOnCreate
 │ └IsPassEvt1
 ├TfrmODBase.ClearDialogControls...
 ├LateTrayOrder
 │ ├OrderLateTray
 │ │ └SetOrderFromResults
 │ │   └SetOrderFields...
 │ └TChanges.Add...
 └TfrmOrders.GroupChangesUpdate
   ├TChanges.ChangeOrderGrp
   └TChanges.ReplaceODGrpName

Called-By Hierarchy


                               TfrmODBase.cmdAcceptClick
                                   ActivateOrderDialog┘ 
                           TfrmRemDlg.btnFinishClick┤   
           TfrmConsults.mnuActNewConsultRequestClick┤   
                   TfrmConsults.cmdNewConsultClick┘ │   
                TfrmConsults.mnuActNewProcedureClick┤   
                      TfrmConsults.cmdNewProcClick┘ │   
                                        ChangeOrders┤   
                      TfrmOrders.mnuActChangeClick┤ │   
                        TfrmMeds.mnuActChangeClick┘ │   
                                     ChangeOrdersEvt┤   
                                          CopyOrders┤   
                        TfrmOrders.mnuActCopyClick┤ │   
                          TfrmMeds.mnuActCopyClick┤ │   
                           TfrmODActive.btnOKClick┘ │   
                                      TransferOrders┤   
                        TfrmOrders.mnuActCopyClick┤ │   
                          TfrmMeds.mnuActCopyClick┤ │   
                           TfrmODActive.btnOKClick┘ │   
                            TfrmOrders.lstWriteClick┤   
               TfrmOrders.PlaceOrderForDefaultDialog┤   
                  TfrmOrders.DisplayDefaultDlgList┤ │   
                       TfrmOrders.ResetOrderPage┘ │ │   
               TfrmOrders.btnDelayedOrderClick┘   │ │   
                                 DisplayEvntDialog┤ │   
                             SetDelayEventForMed┘ │ │   
                      TfrmMeds.mnuActCopyClick┘   │ │   
                                 DisplayEvntDialog┤ │   
                                  SetViewForCopy┘ │ │   
                    TfrmOrders.mnuActCopyClick┘   │ │   
                                 DisplayEvntDialog┘ │   
                                ExecuteChangeEvt┘   │   
                 TfrmOrders.mnuActChgEvntClick┘     │   
                             TfrmMeds.mnuActNewClick┤   
                           TfrmOMNavA.ActivateDialog┤   
                         TfrmOMNavA.grdMenuKeyDown┤ │   
                         TfrmOMNavA.grdMenuMouseUp┘ │   
                                TfrmOMSet.DoNextItem┘   
                              TfrmOMSet.InsertList┤     
                               ActivateOrderList┘ │     
                     TfrmRemDlg.btnFinishClick┤   │     
                             ActivateOrderHTML┤   │     
                    TfrmOrders.lstWriteClick┤ │   │     
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │     
                              ActivateOrderSet┤   │     
                   TfrmRemDlg.btnFinishClick┤ │   │     
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │     
     TfrmConsults.mnuActNewProcedureClick...┤ │   │     
                    TfrmOrders.lstWriteClick┤ │   │     
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │     
                     TfrmMeds.mnuActNewClick┤ │   │     
                TfrmOMNavA.ActivateDialog...┤ │   │     
                     TfrmOMSet.DoNextItem...┘ │   │     
                       TfrmOMNavA.DoSelectList┘   │     
                     TfrmOMNavA.grdMenuKeyUp┤     │     
                   TfrmOMNavA.grdMenuMouseUp┘     │     
                                        SkipToNext┤     
                         TfrmOMSet.DoNextItem...┘ │     
                            TfrmOMSet.UMDelayEvent┘     

Calls

Name Declaration Comments
AskAnotherOrder function AskAnotherOrder(ADialog: Integer): Boolean; -
CheckForAutoDCDietOrders procedure CheckForAutoDCDietOrders(EvtID: integer; DispGrp: integer; CurrentText: string; var CancelText: string; Sender: TObject); -
TfrmODBase.ClearDialogControls procedure ClearDialogControls; -
CurrentDietText function CurrentDietText: string; -
TfrmOrders.GroupChangesUpdate procedure GroupChangesUpdate(GrpName: string); -
TfrmODBase.InitDialog procedure InitDialog; virtual; -
IsCompletedPtEvt function IsCompletedPtEvt(APtEvtID: integer): boolean; -
LateTrayCheck procedure LateTrayCheck(SomeResponses: TResponses; EventId: integer; IsOutpatient: boolean; var LateTrayFields: TLateTrayFields); -
LateTrayOrder procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean); -
TfrmODBase.OrderForInpatient function OrderForInpatient: Boolean; -
TfrmODBase.ValidSave function ValidSave: Boolean; -

Called-By

Name Declaration Comments
ActivateOrderDialog function ActivateOrderDialog(const AnID: string; AnEvent: TOrderDelayEvent; AnOwner: TComponent; ARefNum: Integer; ANeedVerify: boolean = True): Boolean; -


Source

1589  procedure TfrmODBase.cmdAcceptClick(Sender: TObject);
1590  const
1591    TX_CMPTEVT = ' occurred since you started writing delayed orders. '
1592      + 'The orders that were entered and signed have now been released. '
1593      + 'Any unsigned orders will be released immediately upon signature. '
1594      + #13#13
1595      + 'To write new delayed orders for this event you need to click the write delayed orders button again and select the appropriate event. '
1596      + 'Orders delayed to this same event will remain delayed until the event occurs again.'
1597      + #13#13
1598      + 'The Orders tab will now be refreshed and switched to the Active Orders view. '
1599      + 'If you wish to continue to write active orders for this patient, '
1600      + 'close this message window and continue as usual.';
1601  var
1602    theGrpName: string;
1603    alreadyClosed: boolean;
1604    LateTrayFields: TLateTrayFields;
1605    x, CxMsg: string;
1606  begin
1607    FAcceptOK := False;
1608    CIDCOkToSave := False;
1609    alreadyClosed := False;
1610    self.Responses.Cancel := False;
1611    if frmOrders <> nil then
1612    begin
1613      if (frmOrders.TheCurrentView <> nil) and (frmOrders.TheCurrentView.EventDelay.PtEventIFN>0) and IsCompletedPtEvt(frmOrders.TheCurrentView.EventDelay.PtEventIFN) then
1614      begin
1615        theGrpName := 'Delayed ' + frmOrders.TheCurrentView.EventDelay.EventName;
1616        SaveAsCurrent := True;
1617      end;
1618    end;
1619  
1620    // check for diet orders that will be auto-DCd because of start/stop overlaps
1621    if Responses.Dialog = 'FHW1' then
1622    begin
1623      if (Self.EvtID <> 0) then
1624      begin
1625        CheckForAutoDCDietOrders(Self.EvtID, Self.DisplayGroup, '', CxMsg, cmdAccept);
1626        if CxMsg <> '' then
1627        begin
1628          if InfoBox(CxMsg + CRLF + CRLF +
1629             'Have you done either of the above?', 'Possible delayed order conflict',
1630             MB_ICONWARNING or MB_YESNO) = ID_NO
1631             then exit;
1632        end;
1633      end
1634      else if FAutoAccept then
1635      begin
1636        x := CurrentDietText;
1637        CheckForAutoDCDietOrders(0, Self.DisplayGroup, x, CxMsg, nil);
1638        if CxMsg <> '' then
1639        begin
1640          if InfoBox(CxMsg + CRLF +
1641                    'Are you sure?', 'Confirm', MB_ICONWARNING or MB_YESNO) = ID_NO then
1642          begin
1643            //AbortOrder := True;
1644            FAcceptOK := FALSE;
1645            //cmdQuitClick(Self);
1646            exit;
1647          end;
1648        end;
1649      end;
1650    end;
1651  
1652    if ValidSave then
1653    begin
1654      FAcceptOK := True;
1655      CIDCOkToSave := True;
1656      with Responses do
1657        if not FAutoAccept and (CopyOrder = '') and (EditOrder = '') and (TransferOrder = '')
1658          and AskAnotherOrder(DialogIEN)
1659          then InitDialog           // ClearDialogControls is in InitDialog
1660          else
1661          begin
1662            LateTrayFields.LateMeal := #0;
1663            with Responses do
1664              if FAutoAccept and ((Dialog = 'FHW1') or (Dialog = 'FHW OP MEAL') or (Dialog ='FHW SPECIAL MEAL')) then
1665              begin
1666                LateTrayCheck(Responses, Self.EvtID, not OrderForInpatient, LateTrayFields);
1667              end;
1668            ClearDialogControls;    // to allow form to close without prompting to save order
1669            with LateTrayFields do if LateMeal <> #0 then LateTrayOrder(LateTrayFields, OrderForInpatient);
1670            Close;
1671            alreadyClosed := True;
1672          end;
1673      if NoFresh then
1674      begin
1675        if SaveAsCurrent then
1676        begin
1677          SaveAsCurrent := False;
1678          with Responses do
1679          begin
1680            if not alreadyClosed then
1681            begin
1682              ClearDialogControls;
1683              Close;
1684            end;
1685          end;
1686          frmOrders.GroupChangesUpdate(theGrpName);
1687          Exit;
1688        end;
1689      end else
1690      begin
1691        if SaveAsCurrent then
1692        begin
1693          SaveAsCurrent := False;
1694          with Responses do
1695          begin
1696            if not alreadyClosed then
1697            begin
1698              ClearDialogControls;
1699              Close;
1700            end;
1701          end;
1702          frmOrders.GroupChangesUpdate(theGrpName);
1703          //EDONeedRefresh := True;
1704          Exit;
1705        end;
1706      end
1707    end; {if ValidSave}
1708    if SaveAsCurrent then
1709      SaveAsCurrent := False;
1710  end;