Procedure

AddProbsToDiagnoses

Module

rPCE

Last Modified

10/7/2014 12:48:38 PM

Scope

Interfaced

Declaration

procedure AddProbsToDiagnoses;

Calls Hierarchy


AddProbsToDiagnoses
 ├TPCEData.VisitDateTime
 │ └TPCEData.IsSecondaryVisit
 ├rpcGetProviderPatientDaysDx
 └rpcGetPersonalDxList

Called-By Hierarchy


                                                             AddProbsToDiagnoses
                                                             LoadEncounterForm┘ 
                                                       ListVisitTypeSections┤   
                                                                  InitList┘ │   
                                         TfrmEncounterFrame.SynchPCEData┘   │   
                                                             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...┘       │   
                                                       ListDiagnosisSections┤   
                                        TfrmEncounterFrame.SynchPCEData...┘ │   
                                                         ListImmunizSections┤   
                                        TfrmEncounterFrame.SynchPCEData...┘ │   
                                                       ListProcedureSections┤   
                                        TfrmEncounterFrame.SynchPCEData...┘ │   
                                                            ListSkinSections┤   
                                        TfrmEncounterFrame.SynchPCEData...┘ │   
                                                         ListPatientSections┤   
                                        TfrmEncounterFrame.SynchPCEData...┘ │   
                                                          ListHealthSections┤   
                                        TfrmEncounterFrame.SynchPCEData...┘ │   
                                                           ListExamsSections┘   
                                        TfrmEncounterFrame.SynchPCEData...┘     

Calls

Name Declaration Comments
rpcGetPersonalDxList function rpcGetPersonalDxList(UserDUZ:int64):TStringList; -
rpcGetProviderPatientDaysDx procedure rpcGetProviderPatientDaysDx(ProviderIEN: string;PatientIEN: string); -
TPCEData.VisitDateTime function VisitDateTime: TFMDateTime; -

Called-By

Name Declaration Comments
LoadEncounterForm procedure LoadEncounterForm; -


Source

509   procedure AddProbsToDiagnoses;
510   var
511     i: integer;                 //loop index
512     EncDT: TFMDateTime;
513     ICDVersion: String;
514   begin
515     //get problem list
516     EncDT := Trunc(uEncPCEData.VisitDateTime);
517     uLastDFN := patient.DFN;
518     ICDVersion := piece(Encounter.GetICDVersion, U, 1);
519     tCallV(uProblems, 'ORWPCE ACTPROB', [Patient.DFN, EncDT]);
520     if uProblems.count > 0 then
521     begin
522       //add category to udiagnoses
523       uDiagnoses.add(U + DX_PROBLEM_LIST_TXT);
524       for i := 1 to (uProblems.count-1) do //start with 1 because strings[0] is the count of elements.
525       begin
526         //filter out 799.9 and inactive codes when ICD-9 is active
527          if (ICDVersion = 'ICD') and (piece(uProblems.Strings[i],U,3) = '799.9') then continue;
528         // otherwise add all active problems (including 799.9, R69, and inactive codes) to udiagnosis
529         uDiagnoses.add(piece(uProblems.Strings[i], U, 3) + U + piece(uProblems.Strings[i], U, 2) + U +
530                          piece(uProblems.Strings[i], U, 13) + U + piece(uProblems.Strings[i], U, 1) + U +
531                          piece(uProblems.Strings[i], U, 14));
532       end;
533   
534       //1.3.10
535       if BILLING_AWARE then
536        begin
537           //  add New Section and dx codes to Encounter Diagnosis Section and Code List.
538           //  Diagnoses  ->  Provider/Patient/24 hrs
539           uDiagnoses.add(UBAConst.ENCOUNTER_TODAYS_DX); //BAPHII 1.3.10
540           //BADxList := AddProviderPatientDaysDx(UBACore.uDxLst, IntToStr(Encounter.Provider), Patient.DFN); //BAPHII 1.3.10
541           rpcGetProviderPatientDaysDx(IntToStr(Encounter.Provider), Patient.DFN); //BAPHII 1.3.10
542   
543           for i := 0 to (UBACore.uDxLst.Count-1) do //BAPHII 1.3.10
544              uDiagnoses.add(UBACore.uDxLst[i]); //BAPHII 1.3.10
545           //  Code added after presentation.....
546           //  Add Personal Diagnoses Section and Codes to Encounter Diagnosis Section and Code List.
547           UBACore.uDxLst.Clear;
548           uDiagnoses.Add(UBAConst.ENCOUNTER_PERSONAL_DX);
549           UBACore.uDxLst := rpcGetPersonalDxList(User.DUZ);
550           for i := 0 to (UBACore.uDxLst.Count -1) do
551           begin
552               uDiagnoses.Add(UBACore.uDxLst.Strings[i]);
553           end;
554        end;
555   
556     end;
557   end;