Procedure

TfrmOrders.lstSheetsClick

Module

fOrders

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmOrders

Declaration

procedure lstSheetsClick(Sender: TObject);

Calls Hierarchy


TfrmOrders.lstSheetsClick
 ├CloseOrdering
 ├TfrmOrders.PtEvtCompleted
 │ ├IsCompletedPtEvt
 │ ├TfrmOrders.GroupChangesUpdate
 │ │ ├TChanges.ChangeOrderGrp
 │ │ └TChanges.ReplaceODGrpName
 │ ├TfrmOrders.InitOrderSheetsForEvtDelay
 │ │ ├TfrmOrders.InitOrderSheets
 │ │ │ ├TfrmOrders.ClearOrderSheets
 │ │ │ ├LoadOrderSheetsED
 │ │ │ ├DGroupAll
 │ │ │ └EventInfo
 │ │ └TfrmOrders.DfltViewForEvtDelay
 │ │   ├TfrmOrders.CanChangeOrderView
 │ │   │ └ActiveOrdering
 │ │   └LoadOrderViewDefault
 │ ├TfrmOrders.lstSheetsClick...
 │ └TfrmOrders.RefreshOrderList
 │   ├LoadOrdersAbbr
 │   │ ├ClearOrders
 │   │ ├LoadDGroupMap
 │   │ ├ExpiredOrdersStartDT
 │   │ ├FMNow
 │   │ └SeqOfDGroup
 │   │   └LoadDGroupMap
 │   ├ClearOrders
 │   ├LoadOrdersAbbr
 │   │ ├LoadDGroupMap
 │   │ ├FMNow
 │   │ └SeqOfDGroup...
 │   ├TfrmOrders.ExpandEventSection
 │   ├TfrmOrders.CompressEventSection
 │   ├SortOrders
 │   │ ├InverseByGroup
 │   │ │ └TChanges.Exist
 │   │ ├ForwardByGroup
 │   │ │ └TChanges.Exist
 │   │ ├InverseChrono
 │   │ └ForwardChrono
 │   ├TfrmOrders.AddToListBox
 │   │ └TfrmOrders.GetPlainText
 │   │   └TfrmOrders.GetOrderText
 │   │     ├LoadFlagReason
 │   │     ├TfrmOrders.GetStartStopText
 │   │     └NameOfStatus
 │   └DGroupAll
 ├DeleteEmptyEvt
 │ ├PtEvtEmpty
 │ ├GetEventName
 │ └DeletePtEvent
 ├TfrmOrders.ChangesUpdate
 │ ├TheParentPtEvt
 │ └TChanges.Remove
 │   ├UnlockOrder
 │   └UnlockDocument
 ├TfrmOrders.InitOrderSheetsForEvtDelay...
 ├..(rec)..
 ├LoadWriteOrdersED
 ├LoadWriteOrders
 ├TfrmOrders.RefreshOrderList...
 ├PtEvtEmpty
 └DeletePtEvent

Called-By Hierarchy


                            TfrmOrders.lstSheetsClick
                       TfraEvntDelayList.CheckMatch┤ 
                          TfrmOrdersTS.cmdOKClick┘ │ 
TfrmOrdersTS.fraEvntDelayListmlstEventsDblClick┤   │ 
                       TfrmOrdersTS.FormKeyDown┘   │ 
                 TfraEvntDelayList.mlstEventsChange┤ 
   TfrmOrdersTS.fraEvntDelayListcboEvntListChange┤ │ 
    TfrmOrdersTS.fraEvntDelayListmlstEventsChange┤ │ 
    TfrmMedCopy.fraEvntDelayListcboEvntListChange┤ │ 
     TfrmMedCopy.fraEvntDelayListmlstEventsChange┤ │ 
 TfrmCopyOrders.fraEvntDelayListcboEvntListChange┤ │ 
  TfrmCopyOrders.fraEvntDelayListmlstEventsChange┘ │ 
                    TfrmOrders.mnuViewDfltShowClick┤ 
                           TfrmOrders.DisplayPage┘ │ 
                                          ..(rec)..┤ 
                           TfrmOrders.lstWriteClick┤ 
                         TfrmOrders.mnuActCopyClick┤ 
                         TfrmOrders.mnuActSignClick┤ 
                          TfrmOrders.ResetOrderPage┤ 
                  TfrmOrders.btnDelayedOrderClick┘ │ 
              TfrmOrders.PlaceOrderForDefaultDialog┤ 
                 TfrmOrders.DisplayDefaultDlgList┤ │ 
                   TfrmOrders.ResetOrderPage...┘ │ │ 
                                DisplayEvntDialog┤ │ 
                            SetDelayEventForMed┘ │ │ 
                     TfrmMeds.mnuActCopyClick┘   │ │ 
                                DisplayEvntDialog┤ │ 
                                 SetViewForCopy┘ │ │ 
                   TfrmOrders.mnuActCopyClick┘   │ │ 
                                DisplayEvntDialog┘ │ 
                               ExecuteChangeEvt┘   │ 
                TfrmOrders.mnuActChgEvntClick┘     │ 
                           TfrmOrders.ClickLstSheet┤ 
            TfraEvntDelayList.mlstEventsChange...┤ │ 
                     TfrmOrders.ResetOrderPage...┤ │ 
                        ExecuteReleaseEventOrders┘ │ 
                      TfrmOrders.mnuActRelClick┘   │ 
                        TfrmOrders.InitOrderSheets2┤ 
                     TfrmFrame.mnuFileReviewClick┘ │ 
                          TfrmOrders.PtEvtCompleted┤ 
                       TfrmFrame.DetermineNextTab┤ │ 
                     TfrmFrame.mnuFileOpenClick┤ │ │ 
                         TfrmFrame.UMInitiate┤ │ │ │ 
                   TfrmFrame.mnuFileNextClick┤ │ │ │ 
              TfrmFrame.mnuFileOpenClick...┤ │ │ │ │ 
          TfrmFrame.mnuFileNotifRemoveClick┤ │ │ │ │ 
                  TfrmFrame.NextButtonClick┘ │ │ │ │ 
                TfrmFrame.SetUpNextButton┘   │ │ │ │ 
          TfrmFrame.mnuFileOpenClick...┤     │ │ │ │ 
                   TfrmFrame.FormResize┘     │ │ │ │ 
                 TfrmFrame.ChangeFont┘       │ │ │ │ 
         TfrmFrame.LoadSizesForUser┤         │ │ │ │ 
    TfrmFrame.LoadUserPreferences┘ │         │ │ │ │ 
           TfrmFrame.UMInitiate┘   │         │ │ │ │ 
         TfrmFrame.mnuFontSizeClick┘         │ │ │ │ 
                TfrmFrame.mnuFileRefreshClick┤ │ │ │ 
                TfrmOrders.CheckOrderStatus┤ │ │ │ │ 
            TfrmOrders.mnuActChgEvntClick┤ │ │ │ │ │ 
               TfrmOrders.mnuActHoldClick┤ │ │ │ │ │ 
             TfrmOrders.mnuActUnholdClick┤ │ │ │ │ │ 
              TfrmOrders.mnuActRenewClick┤ │ │ │ │ │ 
             TfrmOrders.mnuActChangeClick┤ │ │ │ │ │ 
               TfrmOrders.mnuActCopyClick┘ │ │ │ │ │ 
                     TfrmMeds.mnuActDCClick┤ │ │ │ │ 
                    TfrmMeds.CheckMedStatus┘ │ │ │ │ 
                 TfrmMeds.mnuActHoldClick┤   │ │ │ │ 
                TfrmMeds.mnuActRenewClick┤   │ │ │ │ 
               TfrmMeds.mnuActUnholdClick┤   │ │ │ │ 
               TfrmMeds.mnuActChangeClick┤   │ │ │ │ 
                 TfrmMeds.mnuActCopyClick┤   │ │ │ │ 
               TfrmMeds.mnuActRefillClick┘   │ │ │ │ 
                           TfrmFrame.ViewInfo┘ │ │ │ 
                        TfrmDCSumm.ViewInfo┤   │ │ │ 
                      TfrmConsults.ViewInfo┤   │ │ │ 
              TfrmFrame.pnlRemindersMouseUp┤   │ │ │ 
               TfrmFrame.RemindersChanged┘ │   │ │ │ 
                   TfrmFrame.FormCreate┘   │   │ │ │ 
                     TfrmFrame.pnlCIRNClick┤   │ │ │ 
               TfrmFrame.pnlVistaWebClick┤ │   │ │ │ 
                    TfrmFrame.FormKeyDown┘ │   │ │ │ 
                  TfrmFrame.pnlPatientClick┤   │ │ │ 
                    TfrmFrame.pnlVisitClick┤   │ │ │ 
              TfrmFrame.pnlPrimaryCareClick┤   │ │ │ 
                TfrmFrame.pnlRemindersClick┤   │ │ │ 
                 TfrmFrame.pnlPostingsClick┤   │ │ │ 
                     TfrmFrame.pnlFlagClick┤   │ │ │ 
                       TfrmFrame.laMHVClick┤   │ │ │ 
                      TfrmFrame.laVAA2Click┤   │ │ │ 
                        TfrmOrders.ViewInfo┤   │ │ │ 
                          TfrmMeds.ViewInfo┤   │ │ │ 
                       TfrmSurgery.ViewInfo┤   │ │ │ 
                         TfrmNotes.ViewInfo┤   │ │ │ 
                      TfrmProblems.ViewInfo┘   │ │ │ 
                    TfrmFrame.UpdateCCOWContext┘ │ │ 
                TfrmFrame.mnuFileOpenClick...┤   │ │ 
              TfrmFrame.ctxContextorCommitted┤   │ │ 
               TfrmFrame.StartCCOWContextor┘ │   │ │ 
                     TfrmFrame.FormCreate┘   │   │ │ 
       TfrmFrame.mnuFileResumeContextGetClick┘   │ │ 
                     TfrmFrame.mnuFileReviewClick┤ │ 
                     TfrmOrders.lstSheetsClick...┤ │ 
                         TfrmOrders.lstWriteClick┤ │ 
                         TfrmOrders.mnuActDCClick┤ │ 
                    TfrmOrders.mnuActChgEvntClick┤ │ 
                       TfrmOrders.mnuActHoldClick┤ │ 
                       TfrmOrders.mnuActFlagClick┤ │ 
                    TfrmOrders.mnuActCommentClick┤ │ 
                     TfrmOrders.mnuActChangeClick┤ │ 
                       TfrmOrders.mnuActCopyClick┤ │ 
                       TfrmOrders.mnuActSignClick┤ │ 
                  TfrmOrders.btnDelayedOrderClick┤ │ 
                         TfrmMeds.mnuActCopyClick┤ │ 
                          TfrmODActive.btnOKClick┘ │ 
                            TfrmOrders.UMEventOccur┤ 
                           TfrmMeds.mnuActCopyClick┤ 
                            TfrmMeds.mnuActNewClick┤ 
                             SetDelayEventForMed...┤ 
                                  SetViewForCopy...┤ 
                          TfrmCopyOrders.cmdOKClick┤ 
                      TfrmCopyOrders.UMStillDelay┤ │ 
TfrmCopyOrders.fraEvntDelayListmlstEventsDblClick┤ │ 
                       TfrmCopyOrders.FormKeyDown┘ │ 
                                ExecuteChangeEvt...┤ 
                                    ExecuteDCOrders┘ 
                         TfrmOrders.mnuActDCClick┤   
                           TfrmMeds.mnuActDCClick┘   

Calls

Name Declaration Comments
TfrmOrders.ChangesUpdate procedure ChangesUpdate(APtEvtID: string); -
CloseOrdering function CloseOrdering: Boolean; -
DeleteEmptyEvt function DeleteEmptyEvt(APtEvntID: string; var APtEvntName: string; Ask: boolean = True): boolean; -
DeletePtEvent procedure DeletePtEvent(APtEvtID: string); -
TfrmOrders.InitOrderSheetsForEvtDelay procedure InitOrderSheetsForEvtDelay; -
LoadWriteOrders procedure LoadWriteOrders(Dest: TStrings); -
LoadWriteOrdersED procedure LoadWriteOrdersED(Dest: TStrings; EvtID: string); -
TfrmOrders.lstSheetsClick procedure lstSheetsClick(Sender: TObject); -
TfrmOrders.PtEvtCompleted function PtEvtCompleted(APtEvtID: integer; APtEvtName: string; FromMeds: boolean = False; Signing: boolean = False): boolean; -
PtEvtEmpty function PtEvtEmpty(APtEvtID: string): Boolean; -
TfrmOrders.RefreshOrderList procedure RefreshOrderList(FromServer: Boolean; APtEvtID: string = ''); -

Called-By

Name Declaration Comments
TfraEvntDelayList.CheckMatch procedure CheckMatch; -
TfrmOrders.ClickLstSheet procedure ClickLstSheet; -
TfrmCopyOrders.cmdOKClick procedure cmdOKClick(Sender: TObject); -
ExecuteChangeEvt function ExecuteChangeEvt(SelectedList: TList; var DoesDestEvtOccur: boolean; var DestPtEvtID: integer; var DestPtEvtName: string): boolean; -
ExecuteDCOrders function ExecuteDCOrders(SelectedList: TList; var DelEvt: boolean): Boolean; -
TfrmOrders.InitOrderSheets2 procedure InitOrderSheets2(AnItem: string = ''); -
TfrmOrders.lstSheetsClick procedure lstSheetsClick(Sender: TObject); -
TfrmOrders.lstWriteClick procedure lstWriteClick(Sender: TObject); -
TfraEvntDelayList.mlstEventsChange procedure mlstEventsChange(Sender: TObject); -
TfrmOrders.mnuActCopyClick procedure mnuActCopyClick(Sender: TObject); -
TfrmMeds.mnuActCopyClick procedure mnuActCopyClick(Sender: TObject); -
TfrmMeds.mnuActNewClick procedure mnuActNewClick(Sender: TObject); -
TfrmOrders.mnuActSignClick procedure mnuActSignClick(Sender: TObject); -
TfrmOrders.mnuViewDfltShowClick procedure mnuViewDfltShowClick(Sender: TObject); -
TfrmOrders.PlaceOrderForDefaultDialog function PlaceOrderForDefaultDialog(ADlgInfo: string; IsDefaultDialog: boolean; AEvent: TOrderDelayEvent): boolean; -
TfrmOrders.PtEvtCompleted function PtEvtCompleted(APtEvtID: integer; APtEvtName: string; FromMeds: boolean = False; Signing: boolean = False): boolean; -
TfrmOrders.ResetOrderPage procedure ResetOrderPage(AnEvent: TOrderDelayEvent; ADlgLst: TStringList; IsRealeaseNow: boolean); -
SetDelayEventForMed function SetDelayEventForMed(const RadCap: string; var ADelayEvent: TOrderDelayEvent; var IsNewEvent: Boolean; LimitEvent: Char): Boolean; -
SetViewForCopy function SetViewForCopy(var IsNewEvent: boolean; var DoesDestEvtOccur: boolean; var DestPtEvtID: integer; var DestPtEvtName: string): Boolean; -
TfrmOrders.UMEventOccur procedure UMEventOccur(var Message: TMessage); message UM_EVENTOCCUR; -


Source

1167  procedure TfrmOrders.lstSheetsClick(Sender: TObject);
1168  const
1169    TX_EVTDEL = 'There are no orders tied to this event, would you like to cancel it?';
1170  var
1171    AnOrderView: TOrderView;
1172    APtEvtId: string;
1173  begin
1174    inherited;
1175    if not CloseOrdering then Exit;
1176    FCompress  := True;
1177    if lstSheets.ItemIndex < 0 then Exit;
1178    with lstSheets do
1179    begin
1180     AnOrderView := TOrderView(Items.Objects[ItemIndex]);
1181     AnOrderView.EventDelay.PtEventIFN := StrToIntDef(Piece(Items[lstSheets.ItemIndex],'^',1),0);
1182     if AnOrderView.EventDelay.PtEventIFN > 0 then
1183      FCompress := False;
1184    end;
1185    //CQ 18660 Orders for events should be modal. Orders for non-event should not be modal
1186    if AnOrderView.EventDelay.EventIFN = 0 then NeedShowModal := False
1187    else NeedShowModal := True;
1188    if (FCurrentView <> nil) and (AnOrderView.EventDelay.EventIFN <> FCurrentView.EventDelay.EventIFN) and (FCurrentView.EventDelay.EventIFN > 0 ) then
1189    begin
1190      APtEvtID := IntToStr(FCurrentView.EventDelay.PtEventIFN);
1191      if frmMeds.ActionOnMedsTab then
1192        Exit;
1193      if (FCurrentView.EventDelay.PtEventIFN>0) and (PtEvtCompleted(FCurrentView.EventDelay.PtEventIFN, FCurrentView.EventDelay.EventName)) then
1194        Exit;
1195      if (not FDontCheck) and DeleteEmptyEvt(APtEvtID, FCurrentView.EventDelay.EventName) then
1196      begin
1197        ChangesUpdate(APtEvtID);
1198        FCompress := True;
1199        InitOrderSheetsForEvtDelay;
1200        lstSheets.ItemIndex := 0;
1201        lstSheetsClick(self);
1202        Exit;
1203      end;
1204    end;
1205  
1206    if (FCurrentView = nil) or (AnOrderView <> FCurrentView) or ((AnOrderView=FcurrentView) and (FCurrentView.EventDelay.EventIFN>0)) then
1207    begin
1208      FCurrentView := AnOrderView;
1209      if FCurrentView.EventDelay.EventIFN > 0 then
1210      begin
1211        FCompress := False;
1212        lstWrite.Items.Clear;
1213        lblWrite.Caption := 'Write ' + FCurrentView.ViewName;
1214        lstWrite.Caption := lblWrite.Caption;
1215        lstWrite.Items.Clear;
1216        LoadWriteOrdersED(lstWrite.Items, IntToStr(AnOrderView.EventDelay.EventIFN));
1217        if lstWrite.Items.Count < 1 then
1218          LoadWriteOrders(lstWrite.Items);
1219        RefreshOrderList(FROM_SERVER,Piece(lstSheets.Items[lstSheets.ItemIndex],'^',1));
1220        mnuActRel.Visible   := True;
1221        popOrderRel.Visible := True;
1222        if (lstOrders.Items.Count = 0) and (not NewEvent) then
1223        begin
1224          if frmMeds.ActionOnMedsTab then
1225             Exit;
1226          if (FCurrentView.EventDelay.PtEventIFN>0) and (PtEvtCompleted(FCurrentView.EventDelay.PtEventIFN, FCurrentView.EventDelay.EventName)) then
1227            Exit;
1228          if PtEvtEmpty(Piece(lstSheets.Items[lstSheets.ItemIndex],'^',1)) then
1229          begin
1230            if (FAskForCancel) and ( InfoBox(TX_EVTDEL, 'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES ) then
1231            begin
1232              DeletePtEvent(Piece(lstSheets.Items[lstSheets.ItemIndex],'^',1));
1233              FCompress := True;
1234              lstSheets.Items.Objects[lstSheets.ItemIndex].Free;
1235              lstSheets.Items.Delete(lstSheets.ItemIndex);
1236              FCurrentView := TOrderView.Create;
1237              lstSheets.ItemIndex := 0;
1238              lstSheetsClick(self);
1239              Exit;
1240            end;
1241          end;
1242        end;
1243        if NewEvent then
1244          NewEvent := False;
1245      end
1246      else
1247      begin
1248        NewEvent := False;
1249        mnuActRel.Visible   := False;
1250        popOrderRel.Visible := False;
1251        lblWrite.Caption := 'Write Orders';
1252        lstWrite.Caption := lblWrite.Caption;
1253        LoadWriteOrders(lstWrite.Items);
1254        RefreshOrderList(FROM_SERVER);
1255      end;
1256    end else
1257    begin
1258      mnuActRel.Visible   := False;
1259      popOrderRel.Visible := False;
1260      lblWrite.Caption := 'Write Orders';
1261      lstWrite.Caption := lblWrite.Caption;
1262      LoadWriteOrders(lstWrite.Items);
1263      RefreshOrderList(FROM_SERVER);
1264    end;
1265    FCompress := True;
1266  end;