Procedure

SetDefaultProvider

Module

uPCE

Last Modified

7/15/2014 3:26:36 PM

Scope

Interfaced

Declaration

procedure SetDefaultProvider(ProviderList: TPCEProviderList; APCEData: TPCEData);

Calls Hierarchy


SetDefaultProvider
 ├InvalidPCEProviderTxt
 │ ├CheckActivePerson
 │ └IsUserAProvider
 ├TPCEData.PersonClassDate
 │ └FMToday
 │   └FMNow
 ├TEncounter.GetProviderName
 │ └TEncounter.UpdateText
 │   └GetEncounterText
 ├DefaultProvider
 ├CheckActivePerson
 ├TIUSiteParams
 └TPCEProviderList.AddProvider
   └TPCEProviderList.Add
     ├TPCEProviderList.GetPrimaryIdx
     ├TPCEProviderList.IndexOfProvider
     └TPCEProviderList.SetPrimaryIdx
       ├TPCEProviderList.GetPrimaryIdx
       └TPCEProviderList.SetPrimary

Called-By Hierarchy


                                                      SetDefaultProvider
                                                             UpdatePCE┤ 
                                                TPCEData.OK2SignNote┤ │ 
                                                         IsOK2Sign┘ │ │ 
                                      TfrmDCSumm.mnuActSignClick┤   │ │ 
                                         TfrmDCSumm.SaveSignItem┤   │ │ 
                                         TfrmReview.cmdOKClick┘ │   │ │ 
                                               ReviewChanges┘   │   │ │ 
                           TfrmFrame.AllowContextChangeAll┤     │   │ │ 
                                TfrmFrame.FormCloseQuery┤ │     │   │ │ 
                              TfrmFrame.mnuFileNextClick┤ │     │   │ │ 
                            TfrmFrame.mnuFileOpenClick┤ │ │     │   │ │ 
                                TfrmFrame.UMInitiate┤ │ │ │     │   │ │ 
                       TfrmFrame.mnuFileNextClick...┤ │ │ │     │   │ │ 
                       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.mnuFileNotifRemoveClick┤ │ │     │   │ │ 
                             TfrmFrame.NextButtonClick┘ │ │     │   │ │ 
                           TfrmFrame.SetUpNextButton┘   │ │     │   │ │ 
                     TfrmFrame.mnuFileOpenClick...┤     │ │     │   │ │ 
                              TfrmFrame.FormResize┘     │ │     │   │ │ 
                            TfrmFrame.ChangeFont┘       │ │     │   │ │ 
                    TfrmFrame.LoadSizesForUser┤         │ │     │   │ │ 
               TfrmFrame.LoadUserPreferences┘ │         │ │     │   │ │ 
                      TfrmFrame.UMInitiate┘   │         │ │     │   │ │ 
                    TfrmFrame.mnuFontSizeClick┘         │ │     │   │ │ 
                           TfrmFrame.mnuFileOpenClick...┤ │     │   │ │ 
                           TfrmFrame.ctxContextorPending┤ │     │   │ │ 
                          TfrmFrame.StartCCOWContextor┘ │ │     │   │ │ 
                                TfrmFrame.FormCreate┘   │ │     │   │ │ 
                         TfrmFrame.ctxContextorCommitted┤ │     │   │ │ 
                       TfrmFrame.StartCCOWContextor...┘ │ │     │   │ │ 
                  TfrmFrame.mnuFileResumeContextGetClick┤ │     │   │ │ 
                  TfrmFrame.mnuFileResumeContextSetClick┘ │     │   │ │ 
                                  TfrmFrame.FormCloseQuery┤     │   │ │ 
                              TfrmFrame.mnuFileReviewClick┤     │   │ │ 
                                           UpdateEncounter┘     │   │ │ 
                         TfrmFrame.mnuFileEncounterClick┤       │   │ │ 
                                 TfrmFrame.ViewInfo...┤ │       │   │ │ 
                    TfrmODMedIV.SetValuesFromResponses┤ │       │   │ │ 
                             TfrmODMedIV.SetupDialog┤ │ │       │   │ │ 
                   TfrmODMedIV.cboSolutionMouseClick┘ │ │       │   │ │ 
                       TfrmODMedIV.cboSolutionExit┘   │ │       │   │ │ 
                  TfrmODMedIV.cboSolutionMouseClick...┤ │       │   │ │ 
                     TfrmODMedIV.cboAdditiveMouseClick┤ │       │   │ │ 
                         TfrmODMedIV.cboAdditiveExit┘ │ │       │   │ │ 
                                TfrmODAuto.SetupDialog┤ │       │   │ │ 
                                   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┘   │ │       │   │ │ 
                               TfrmOMSet.InsertList...┤ │       │   │ │ 
                                TfrmODMeds.SetupDialog┤ │       │   │ │ 
                             TfrmODMeds.btnSelectClick┤ │       │   │ │ 
                             TfrmODMeds.UMDelayClick┘ │ │       │   │ │ 
                                    ExecuteRenewOrders┘ │       │   │ │ 
                         TfrmOrders.mnuActRenewClick┤   │       │   │ │ 
                           TfrmMeds.mnuActRenewClick┘   │       │   │ │ 
                                        EncounterPresent┤       │   │ │ 
                                      ReadyForNewOrder┤ │       │   │ │ 
                           TfrmRemDlg.btnFinishClick┤ │ │       │   │ │ 
        TfrmConsults.mnuActNewConsultRequestClick...┤ │ │       │   │ │ 
             TfrmConsults.mnuActNewProcedureClick...┤ │ │       │   │ │ 
                                     ChangeOrders...┤ │ │       │   │ │ 
                                     ChangeOrdersEvt┤ │ │       │   │ │ 
                                       CopyOrders...┤ │ │       │   │ │ 
                                   TransferOrders...┤ │ │       │   │ │ 
                            TfrmOrders.lstWriteClick┤ │ │       │   │ │ 
                             TfrmMeds.mnuActNewClick┘ │ │       │   │ │ 
                                     ReadyForNewOrder1┤ │       │   │ │ 
            TfrmOrders.PlaceOrderForDefaultDialog...┘ │ │       │   │ │ 
                              TfrmOrders.mnuActDCClick┤ │       │   │ │ 
                             TfrmOrders.mnuActRelClick┤ │       │   │ │ 
                            TfrmOrders.mnuActHoldClick┤ │       │   │ │ 
                          TfrmOrders.mnuActUnholdClick┤ │       │   │ │ 
                           TfrmOrders.mnuActRenewClick┤ │       │   │ │ 
                         TfrmOrders.mnuActReleaseClick┤ │       │   │ │ 
                         TfrmOrders.mnuActOnChartClick┤ │       │   │ │ 
                            TfrmOrders.mnuActSignClick┤ │       │   │ │ 
                                TfrmMeds.mnuActDCClick┤ │       │   │ │ 
                              TfrmMeds.mnuActHoldClick┤ │       │   │ │ 
                             TfrmMeds.mnuActRenewClick┤ │       │   │ │ 
                            TfrmMeds.mnuActUnholdClick┤ │       │   │ │ 
                              TfrmMeds.mnuActCopyClick┤ │       │   │ │ 
                            TfrmMeds.mnuActRefillClick┘ │       │   │ │ 
                                     EncounterPresentEDO┤       │   │ │ 
                                   ReadyForNewOrder...┤ │       │   │ │ 
                         TfrmOrders.mnuActChgEvntClick┤ │       │   │ │ 
                          TfrmOrders.mnuActChangeClick┤ │       │   │ │ 
                            TfrmOrders.mnuActCopyClick┤ │       │   │ │ 
                       TfrmOrders.btnDelayedOrderClick┤ │       │   │ │ 
                            TfrmMeds.mnuActChangeClick┤ │       │   │ │ 
                              TfrmMeds.mnuActCopyClick┘ │       │   │ │ 
                                             UpdateVisit┤       │   │ │ 
                                           EditPCEData┤ │       │   │ │ 
                             TfrmSurgery.cmdPCEClick┤ │ │       │   │ │ 
                                 UpdateEncounterInfo┘ │ │       │   │ │ 
                             TfrmNotes.cmdPCEClick┘   │ │       │   │ │ 
                        TfrmVitals.btnEnterVitalsClick┘ │       │   │ │ 
                                             UpdateVisit┤       │   │ │ 
                                        EncounterPresent┘       │   │ │ 
                         TfrmProblems.lstProbActsClick┘         │   │ │ 
                     TfrmProblems.wgProbDataDblClick┤           │   │ │ 
                           TfrmProblems.lstViewClick┘           │   │ │ 
                   TfrmProblems.HighlightDuplicate┘             │   │ │ 
                         TfrmProblems.AddProblem┤               │   │ │ 
              TfrmProblems.lstProbActsClick...┤ │               │   │ │ 
                 TfrmProblems.lstProbPickClick┤ │               │   │ │ 
              TfrmProblems.lstProbPickDblClick┤ │               │   │ │ 
              TfrmProblems.edProbEntKeyPress┘ │ │               │   │ │ 
                      TfrmProblems.UMPLLexicon┘ │               │   │ │ 
                   TfrmdlgProb.bbChangeProbClick┘               │   │ │ 
                           TfrmConsults.mnuActSignatureSignClick┤   │ │ 
                                       TfrmConsults.SaveSignItem┤   │ │ 
                                      TfrmReview.cmdOKClick...┘ │   │ │ 
                                     TfrmSurgery.mnuActSignClick┤   │ │ 
                                        TfrmSurgery.SaveSignItem┤   │ │ 
                                      TfrmReview.cmdOKClick...┘ │   │ │ 
                                       TfrmNotes.mnuActSignClick┤   │ │ 
                                          TfrmNotes.SaveSignItem┘   │ │ 
                                      TfrmReview.cmdOKClick...┘     │ │ 
                                              TfrmDCSumm.cmdPCEClick┤ │ 
                                            TfrmConsults.cmdPCEClick┤ │ 
                                                      EditPCEData...┤ │ 
                                             TfrmSurgery.cmdPCEClick┤ │ 
                                              UpdateEncounterInfo...┘ │ 
                                                  NoPrimaryPCEProvider┘ 
                                                 MissingProviderInfo┤   
                                           TPCEData.OK2SignNote...┤ │   
                                         TfrmRemDlg.btnFinishClick┘ │   
                                             TPCEData.OK2SignNote...┤   
                                   TfrmEncounterFrame.FormCloseQuery┘   

Calls

Name Declaration Comments
TPCEProviderList.AddProvider function AddProvider(AIEN, AName: string; APrimary: boolean): integer; -
CheckActivePerson function CheckActivePerson(provider:string;DateTime:TFMDateTime): boolean; -
DefaultProvider function DefaultProvider(ALocation: integer; AUser: Int64; ADate: TFMDateTime; ANoteIEN: integer): string; -
TEncounter.GetProviderName function GetProviderName: string; -
InvalidPCEProviderTxt function InvalidPCEProviderTxt(AIEN: Int64; ADate: TFMDateTime): string; -
TPCEData.PersonClassDate function PersonClassDate: TFMDateTime; -
TIUSiteParams function TIUSiteParams: string; -

Called-By

Name Declaration Comments
NoPrimaryPCEProvider function NoPrimaryPCEProvider(AProviders: TPCEProviderList; PCEData: TPCEData): boolean; -
UpdatePCE function UpdatePCE(PCEData: TPCEData; SaveOnExit: boolean = TRUE): boolean; -


Source

802   procedure SetDefaultProvider(ProviderList: TPCEProviderList; APCEData: TPCEData);
803   var
804     SIEN, tmp: string;
805     DefUser, AUser: Int64;
806     UserName: string;
807   
808   begin
809     DefUser := Encounter.Provider;
810     if(DefUser <> 0) and (InvalidPCEProviderTxt(DefUser, APCEData.PersonClassDate) <> '') then
811       DefUser := 0;
812     if(DefUser <> 0) then
813     begin
814       AUser := DefUser;
815       UserName := Encounter.ProviderName;
816     end
817     else
818     if(InvalidPCEProviderTxt(User.DUZ, APCEData.PersonClassDate) = '') then
819     begin
820       AUser := User.DUZ;
821       UserName := User.Name;
822     end
823     else
824     begin
825       AUser := 0;
826       UserName := '';
827     end;
828     if(AUser = 0) then
829       ProviderList.FPendingUser := ''
830     else
831       ProviderList.FPendingUser := IntToStr(AUser) + U + UserName;
832     ProviderList.FPendingDefault := '';
833     tmp := DefaultProvider(APCEData.Location, DefUser, APCEData.PersonClassDate, APCEData.NoteIEN);
834     SIEN := IntToStr(StrToIntDef(Piece(tmp,U,1),0));
835     if(SIEN <> '0') then
836     begin
837       if(CheckActivePerson(SIEN, APCEData.PersonClassDate)) then
838       begin
839         if(piece(TIUSiteParams, U, 8) = '1') and // Check to see if DEFAULT PRIMARY PROVIDER is by Location 
840           (SIEN = IntToStr(User.DUZ)) then
841           ProviderList.AddProvider(SIEN, Piece(tmp,U,2) ,TRUE)
842         else
843           ProviderList.FPendingDefault := tmp;
844       end;
845     end;
846   end;