Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ABMCPTT

ABMCPTT.m

Go to the documentation of this file.
  1. ABMCPTT ;IHS/SD/SDR - New routine created in Serenji at 6/28/2007 8:09:46 AM
  1. ;;2.6;IHS 3P BILLING SYSTEM;**27**;NOV 12, 2009;Build 486
  1. ;IHS/SD/SDR 2.6*27 new routine - to identify non-DINUM/dup CPT entries and how many times in the fee table
  1. ;
  1. Q
  1. ;CPT entries that aren't DINUMed
  1. START ;EP
  1. K ^ABMFTMP("ABM-P27-VAL") ;make sure this is clear upon first run; otherwise everything seems like a duplicate
  1. K SDR
  1. S CPTIEN=0
  1. F S CPTIEN=$O(^ICPT(CPTIEN)) Q:'CPTIEN D
  1. .S CPT=$P($G(^ICPT(CPTIEN,0)),U)
  1. .I +CPT=0 Q ;it's a HCPCS; skip it for now
  1. .I $L(CPT)'=+$L(+CPT) Q ;has an alpha at the end; skip for now
  1. .S SDR(CPT)=+$G(SDR(CPT))+1
  1. .S SDR("CPT",CPT,$G(SDR(CPT)))=CPTIEN
  1. .S SDR("CNT",CPT)=+$G(SDR("CNT",CPT))+1
  1. ;
  1. S CPT=0
  1. W !!
  1. ;how many times CPT is in CPT file and not DINUMed
  1. W !!,"How many times a CPT is in the CPT file"
  1. W !,"CPT",?12,"Count",?18,"CPTIEN",?28,"Status",?38,"Status Dt"
  1. F S CPT=$O(SDR(CPT)) Q:'CPT D
  1. .Q:$G(SDR(CPT))=1
  1. .W !,CPT,?12,$G(SDR("CNT",CPT))
  1. .S CPTIEN=0
  1. .F S CPTIEN=$O(SDR("CPT",CPT,CPTIEN)) Q:'CPTIEN D
  1. ..W !?18,$G(SDR("CPT",CPT,CPTIEN))
  1. ..W ?28,$S($P($$CPT^ICPTCOD($G(SDR("CPT",CPT,CPTIEN)),DT),U,7)=1:"Active",1:"Inactive")
  1. ..W ?38,$$SDT^ABMDUTL($P($$CPT^ICPTCOD($G(SDR("CPT",CPT,CPTIEN)),DT),U,6))
  1. ;
  1. ;
  1. K SDR
  1. S FEETAB=0
  1. F S FEETAB=$O(^ABMDFEE(FEETAB)) Q:'FEETAB D
  1. .F MULT=11,13,15,17,19,23 D
  1. ..S CPTIEN=0
  1. ..F S CPTIEN=$O(^ABMDFEE(FEETAB,MULT,CPTIEN)) Q:'CPTIEN D
  1. ...I +$P($G(^ABMDFEE(FEETAB,MULT,CPTIEN,0)),U)=0 Q ;zero or no pointer
  1. ...I '$D(^ICPT($P($G(^ABMDFEE(FEETAB,MULT,CPTIEN,0)),U))) Q ;no CPT in CPT file
  1. ...S CPT=$P(^ICPT($P($G(^ABMDFEE(FEETAB,MULT,CPTIEN,0)),U),0),U)
  1. ...;S SDR(FEETAB,MULT,CPT)=+$G(SDR(FEETAB,MULT,CPT))+1
  1. ...;S SDR("CD",FEETAB,MULT,CPT,CPTIEN)=""
  1. ...S ^ABMFTMP("ABM-P27-VAL",FEETAB,MULT,CPT)=+$G(^ABMFTMP("ABM-P27-VAL",FEETAB,MULT,CPT))+1
  1. ...S ^ABMFTMP("ABM-P27-VAL","CD",FEETAB,MULT,CPT,CPTIEN)=""
  1. ;
  1. PRINT ;EP
  1. K SDR
  1. S CPTIEN=0
  1. F S CPTIEN=$O(^ICPT(CPTIEN)) Q:'CPTIEN D
  1. .S CPT=$P($G(^ICPT(CPTIEN,0)),U)
  1. .I +CPT=0 Q ;it's a HCPCS; skip it for now
  1. .I $L(CPT)'=+$L(+CPT) Q ;has an alpha at the end; skip for now
  1. .S SDR(CPT)=+$G(SDR(CPT))+1
  1. .S SDR("CPT",CPT,$G(SDR(CPT)))=CPTIEN
  1. .S SDR("CNT",CPT)=+$G(SDR("CNT",CPT))+1
  1. ;
  1. S CPT=0
  1. W !!
  1. ;how many times CPT is in CPT file and not DINUMed
  1. W !!,"How many times a CPT is in the CPT file"
  1. W !,"CPT",?12,"Count",?18,"CPTIEN",?28,"Status",?38,"Status Dt"
  1. F S CPT=$O(SDR(CPT)) Q:'CPT D
  1. .Q:$G(SDR(CPT))=1
  1. .W !,CPT,?12,$G(SDR("CNT",CPT))
  1. .S CPTIEN=0
  1. .F S CPTIEN=$O(SDR("CPT",CPT,CPTIEN)) Q:'CPTIEN D
  1. ..W !?18,$G(SDR("CPT",CPT,CPTIEN))
  1. ..W ?28,$S($P($$CPT^ICPTCOD($G(SDR("CPT",CPT,CPTIEN)),DT),U,7)=1:"Active",1:"Inactive")
  1. ..W ?38,$$SDT^ABMDUTL($P($$CPT^ICPTCOD($G(SDR("CPT",CPT,CPTIEN)),DT),U,6))
  1. ;
  1. W !!,"How many times CPT in fee table"
  1. W !,"FT",?4,"MLT",?8,"CPT",?16,"Cnt",?20,"FTCPTIEN",?32,"Status"
  1. S FEETAB=0
  1. F S FEETAB=$O(^ABMFTMP("ABM-P27-VAL",FEETAB)) Q:'FEETAB D
  1. .S MULT=0
  1. .F S MULT=$O(^ABMFTMP("ABM-P27-VAL",FEETAB,MULT)) Q:'MULT D
  1. ..S CPT=0
  1. ..F S CPT=$O(^ABMFTMP("ABM-P27-VAL",FEETAB,MULT,CPT)) Q:'CPT D
  1. ...I $G(^ABMFTMP("ABM-P27-VAL",FEETAB,MULT,CPT))<2 Q ;only one entry for CPT
  1. ...W !,FEETAB,?4,MULT,?8,CPT,?16,$G(^ABMFTMP("ABM-P27-VAL",FEETAB,MULT,CPT))
  1. ...S CPTIEN=0
  1. ...F S CPTIEN=$O(^ABMFTMP("ABM-P27-VAL","CD",FEETAB,MULT,CPT,CPTIEN)) Q:'CPTIEN D
  1. ....W !?20,CPTIEN
  1. ....W ?32,$S($P($$CPT^ICPTCOD(CPTIEN,DT),U,7)=1:"Active",1:"Inactive")
  1. .K SDR
  1. Q
  1. ;
  1. CPTCHK ;
  1. K SDR
  1. S FEETAB=0
  1. F S FEETAB=$O(^ABMFTMP("ABM-FT",FEETAB)) Q:'FEETAB D
  1. .S MULT=0
  1. .F S MULT=$O(^ABMFTMP("ABM-FT",FEETAB,MULT)) Q:'MULT D
  1. ..S CPTIEN=0
  1. ..F S CPTIEN=$O(^ABMFTMP("ABM-FT",FEETAB,MULT,CPTIEN)) Q:'CPTIEN D
  1. ...S CPT=$P($G(^ABMFTMP("ABM-FT",FEETAB,MULT,CPTIEN,0)),U)
  1. ...I $G(^ICPT(CPT,0))="" K ^ABMFTMP("ABM-FT",FEETAB,MULT,CPTIEN)
  1. Q