Procedure

ListCPTModifiers

Module

rPCE

Last Modified

10/7/2014 12:48:38 PM

Comments

CPTCodes expected in the format of code^code^code
NeededModifiers in format of ModIEN1;ModIEN2;ModIEN3

Scope

Interfaced

Declaration

procedure ListCPTModifiers(Dest: TStrings; CPTCodes, NeededModifiers: string);

Calls Hierarchy


ListCPTModifiers
 ├ModifierList
 │ ├TPCEData.VisitDateTime
 │ │ └TPCEData.IsSecondaryVisit
 │ └MixedCaseModifier
 └ModifierIdx
   ├TPCEData.VisitDateTime...
   ├FMToday
   │ └FMNow
   └MixedCaseModifier

Called-By Hierarchy


                                                                    ListCPTModifiers
                                                      TfrmProcedures.ShowModifiers┤ 
                                                     TfrmProcedures.clbListClick┤ │ 
                                                     TfrmProcedures.lbGridSelect┤ │ 
                                                TfrmProcedures.btnSelectAllClick┤ │ 
                                                   TfrmProcedures.lbSectionClick┤ │ 
                                                    TfrmProcedures.btnOtherClick┤ │ 
                                                   TfrmProcedures.btnRemoveClick┘ │ 
                                                       TfrmVisitType.ShowModifiers┘ 
                                                    TfrmVisitType.lbxVisitsClick┘   
                                            TfrmVisitType.lstVTypeSectionClick┘     
                                             TfrmEncounterFrame.SectionClick┤       
                                                                  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...┘       │       
                                                    TfrmVisitType.MatchVType┘       
                                        TfrmEncounterFrame.SynchPCEData...┘         

Calls

Name Declaration Comments
ModifierIdx function ModifierIdx(ModIEN: string): integer; -
ModifierList function ModifierList(CPTCode: string): string; -

Called-By

Name Declaration Comments
TfrmProcedures.ShowModifiers procedure ShowModifiers; -
TfrmVisitType.ShowModifiers procedure ShowModifiers; -


Source

688   procedure ListCPTModifiers(Dest: TStrings; CPTCodes, NeededModifiers: string);
689   //CPTCodes expected in the format of code^code^code
690   //NeededModifiers in format of ModIEN1;ModIEN2;ModIEN3
691   var
692     TmpSL: TStringList;
693     i, j, idx, cnt, found: integer;
694     s, Code: string;
695   
696   begin
697     if(not assigned(uModifiers)) then uModifiers := TORStringList.Create;
698     if(copy(CPTCodes, length(CPTCodes), 1) <> U) then
699       CPTCodes := CPTCodes + U;
700     if(copy(NeededModifiers, length(NeededModifiers), 1) <> ';') then
701       NeededModifiers := NeededModifiers + ';';
702   
703     TmpSL := TStringList.Create;
704     try
705       repeat
706         i := pos(U, CPTCodes);
707         if(i > 0) then
708         begin
709           Code := copy(CPTCodes, 1, i-1);
710           delete(CPTCodes,1,i);
711           if(Code <> '') then
712             TmpSL.Add(ModifierList(Code));
713           i := pos(U, CPTCodes);
714         end;
715       until(i = 0);
716       if(TmpSL.Count = 0) then
717         s := ';0;'
718       else
719       if(TmpSL.Count = 1) then
720         s := TmpSL[0]
721       else
722       begin
723         s := '';
724         found := 0;
725         cnt := StrToIntDef(piece(TmpSL[0], ';', 2), 0);
726         for i := 1 to cnt do
727         begin
728           Code := U + Piece(TmpSL[0], U, i+1);
729           for j := 1 to TmpSL.Count-1 do
730           begin
731             if(pos(Code + U, TmpSL[j]) = 0) then
732             begin
733               Code := '';
734               break;
735             end;
736           end;
737           if(Code <> '') then
738           begin
739             s := s + Code;
740             inc(found);
741           end;
742         end;
743         s := s + U;
744         SetPiece(s , U, 1, ';' + IntToStr(Found) + ';');
745       end;
746     finally
747       TmpSL.Free;
748     end;
749   
750     Dest.Clear;
751     cnt := StrToIntDef(piece(s, ';', 2), 0);
752     if(NeededModifiers <> '') then
753     begin
754       found := cnt;
755       repeat
756         i := pos(';',NeededModifiers);
757         if(i > 0) then
758         begin
759           idx := StrToIntDef(copy(NeededModifiers,1,i-1),0);
760           if(idx > 0) then
761           begin
762             Code := IntToStr(ModifierIdx(IntToStr(idx))) + U;
763             if(pos(U+Code, s) = 0) then
764             begin
765               s := s + Code;
766               inc(cnt);
767             end;
768           end;
769           delete(NeededModifiers,1,i);
770         end;
771       until(i = 0);
772       if(found <> cnt) then
773         SetPiece(s , ';', 2, IntToStr(cnt));
774     end;
775     for i := 1 to cnt do
776     begin
777       idx := StrToIntDef(piece(s, U, i + 1), -1);
778       if(idx >= 0) then
779         Dest.Add(uModifiers[idx]);
780     end;
781   end;