ABMM2PV4 ;IHS/SD/SDR - MU Patient Volume EP Report ;
;;2.6;IHS 3P BILLING SYSTEM;**11,12,15**;NOV 12, 2009;Build 251
;IHS/SD/SDR - 2.6*12 - Made changes for uncomp care; uncomp should be a separate detail line
; and should be included in pt vol total, not as separate line
;IHS/SD/SDR - 2.6*12 - Included numerator and msgs about numerator, denominator
;IHS/SD/SDR - 2.6*15 - HEAT161159 - Changed PT LST to sort differently so there won't be duplicate vsts on pt lst.
;IHS/SD/SDR - 2.6*15 - HEAT174501 - Added Provider NPI to host file
;IHS/SD/SDR - 2.6*15 - HEAT171490 - Added facility NPI and TIN to pt list host file
;IHS/SD/SDR - 2.6*15 - HEAT183289 - Added Tribal self-insured flag to output and summary total lines
;
GRPPRT ;EP
I ABMY("RFMT")="P" D PATIENT Q
I +$G(^XTMP("ABM-PVP2",$J,"PRV TOP"))>29.5 S ABMPMET=1 D MET Q
D NOTMET
K ^XTMP("ABM-PVP2",$J)
Q
MET ;
S ABM("PG")=1
S ABMSDT=$P($G(^XTMP("ABM-PVP2",$J,"PRV TOP")),U,2)
D HDR^ABMM2PV3
I $Y+5>IOSL D HD^ABMM2PV3 Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
S ABMNUMT=0 ;abm*2.6*12
S ABMVLOC=0
F S ABMVLOC=$O(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT,ABMVLOC)) Q:'ABMVLOC D
.I $Y+5>IOSL D HD^ABMM2PV3 Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.F ABM=1:1:80 W "-"
.S ABMLOC=$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E")
.S (ABMTENC,ABMDENOM)=+$G(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT,ABMVLOC))
.S ABMMPD=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,ABMVLOC,"MCD"))
.S ABMMZPD=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"MCD"))
.S ABMMENR=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,ABMVLOC,"MCD"))
.S ABMCPD=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,ABMVLOC,"CHIP"))
.S ABMCZPD=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"CHIP"))
.S ABMCENR=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,ABMVLOC,"CHIP"))
.S ABMOTHPD=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"OTHR"))
.;start new abm*2.6*12
.I $G(ABMFQHC)=1 D
..S ABMUNCR=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,ABMVLOC,"UNCOMP")) ;abm*2.6*12 uncomp care
..S ABMTSI=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM TRIBSI",ABMSDT,ABMVLOC,"TRIBSI")) ;abm*2.6*15 HEAT183289 tribal self-insured
.S ABMNUMT=+$G(ABMNUMT)+ABMMPD+ABMMZPD+ABMMENR+ABMCPD+ABMCZPD+ABMCENR+$G(ABMUNCR) ;abm*2.6*15 HEAT183289
.;S ABMNUMT=+$G(ABMNUMT)+ABMMPD+ABMMZPD+ABMMENR+ABMCPD+ABMCZPD+ABMCENR+$G(ABMUNCR)+$G(ABMTSI) ;abm*2.6*15 HEAT183289
.;end new abm*2.6*12
.S ^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"UNCOMP")=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"UNCOMP"))+$G(ABMUNCOM) ;abm*2.6*12 uncomp care
.S ^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"UNCOMP")=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"UNCOMP"))+$G(ABMUNCOM) ;abm*2.6*12 uncomp care
.;start new abm*2.6*15 HEAT183289 tribal self-insured
.;S ^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"TRIBSI")=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"TRIBSI"))+$G(ABMTSI)
.;S ^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"TRIBSI")=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"TRIBSI"))+$G(ABMTSI)
.;end new HEAT183289
.W !,"Patient Volume "_ABMLOC_": "_+$P($G(^XTMP("ABM-PVP2",$J,"PRV PERCENT",ABMSDT,ABMVLOC)),U)_"%"
.W !!,"Total Patient Encounters (Denominator) "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT,ABMVLOC)),8)
.W !,"Total Numerator Encounters "_ABMLOC_": ",?70,$J((ABMMPD+ABMMZPD+ABMMENR+ABMCPD+ABMCZPD+ABMCENR+$G(ABMUNCR)),8)
.W !,"Total Medicaid Paid Encounters "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,ABMVLOC,"MCD")),8)
.W !,"Total Medicaid Zero Paid Encounters "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"MCD")),8)
.W !,"Total Medicaid Enrolled (Not Billed) Encounters "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,ABMVLOC,"MCD")),8)
.W !,"Total Kidscare/Chip Paid Encounters "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,ABMVLOC,"CHIP")),8)
.W !,"Total Kidscare/Chip Zero Paid Encounters "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"CHIP")),8)
.W !,"Total Kidscare/Chip Enrolled (Not Billed) Encounters "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,ABMVLOC,"CHIP")),8)
.;W !,"Total Paid Other Encounters "_ABMLOC_" (*not included in numer.): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"OTHR")),8) ;abm*2.6*15
.W !,"Total Paid Other Encounters "_ABMLOC_" (*not included in numer.): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,ABMVLOC,"OTHR")),8) ;abm*2.6*15
.;W:($G(ABMFQHC)=1) !,"Total Uncompensated Care "_ABMLOC_": ",?70,$J(ABMUNCR,8) ;abm*2.6*12 uncomp care ;abm*2.6*15 HEAT183289
.;start new abm*2.6*15 HEAT183289
.I ($G(ABMFQHC)=1) D
..;W !,"Total Uncompensated Care "_ABMLOC_": ",?70,$J(ABMUNCR,8) ;abm*2.6*15
..W !,"Total Uncompensated Care "_ABMLOC_": ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,ABMVLOC,"UNCOMP")),8) ;abm*2.6*15
..;W !,"Total Tribal Self-Insured "_ABMLOC_" (*not incl. in numerator): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM TRIBSI",ABMSDT,"TRIBSI")),8) ;abm*2.6*15
..W !,"Total Tribal Self-Insured "_ABMLOC_" (*not incl. in numerator): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM TRIBSI",ABMSDT,ABMVLOC,"TRIBSI")),8) ;abm*2.6*15 ;end new HEAT183289
;
W !
F ABM=1:1:80 W "-"
W !,"Patient Volume all calculated Facilities: ",+$P($G(^XTMP("ABM-PVP2",$J,"PRV TOP")),U)_"%"
W !!,"Total Patient Encounters (Denominator) All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT)),8)
W !,"Total Numerator Encounters All Facilities Total: ",?70,$J(ABMNUMT,8)
W !,"Total Medicaid Paid Encounters All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,"MCD")),8)
W !,"Total Medicaid Zero Paid Encounters All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,"MCD")),8)
W !,"Total Medicaid Enrolled (Not Billed) Encounters All Facs Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,"MCD")),8) ;abm*2.6*12
W !,"Total Kidscare/Chip Paid Encounters All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,"CHIP")),8)
W !,"Total Kidscare/Chip Zero Paid Encounters All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,"CHIP")),8)
;W !,"Total Kidscare/Chip Enrolled Encounters All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,"CHIP")),8) ;abm*2.6*12
W !,"Total Kidscare/Chip Enrolled (Not Billed) Encounters All Facs: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,"CHIP")),8) ;abm*2.6*12
;W !,"Total Paid Other Encounters All Fac. (*not included in numerator): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"OTHR")),8) ;abm*2.6*12 ;abm*2.6*15
W !,"Total Paid Other Encounters All Fac. (*not included in numerator): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,"OTHR")),8) ;abm*2.6*12 ;abm*2.6*15
;W:($G(ABMFQHC)=1) !,"Total Uncompensated Care All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),8) ;abm*2.6*12 uncomp care ;abm*2.6*15 HEAT183289
;start new abm*2.6*15 HEAT183289
I ($G(ABMFQHC)=1) D
.W !,"Total Uncompensated Care All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),8)
.W !,"Total Tribal Self-Insured All Facilities Total (*not incl. in numer.): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM TRIBSI",ABMSDT,"TRIBSI")),7)
;end new HEAT183289
W !
Q
NOTMET ;EP
S ABMCNT=0
K ABMLN
S ABMSDT=$P($G(^XTMP("ABM-PVP2",$J,"PRV TOP")),U,2)
;
I +$G(ABMY("TVDTS"))'=0 D
.S ABMCNT=0
.S ABMDT=0
.F S ABMDT=$O(^XTMP("ABM-PVP2",$J,"PRV PERCENT",ABMDT)) Q:'ABMDT D
..;I ABMY("90")'="A"&(ABMY("SDT")'=ABMSDT) Q ;abm*2.6*12 HEAT134048
.I "^A^D^"'[("^"_ABMY("90")_"^")&(ABMY("SDT")'=ABMSDT) Q ;only whole yr for auto ;abm*2.6*12 uncomp care
.;start new abm*2.6*12 HEAT134048
.S X1=ABMY("SDT")
.S X2=275
.D C^%DTC
.I "^A^D^"[("^"_ABMY("90")_"^")&(ABMSDT>X) Q ;275 days after start won't be 90 days anymore
.;end new HEAT134048
..S ABMPRC($G(^XTMP("ABM-PVP2",$J,"PRV PERCENT",ABMDT)),ABMCNT)=ABMDT
.S ABMP=""
.S ABMSAV=ABMCNT-ABMY("TVDTS")
.F S ABMP=$O(ABMPRC(ABMP)) Q:ABMP="" D
..S ABMCNT=0,ABMC=0
..F S ABMCNT=$O(ABMPRC(ABMP,ABMCNT)) Q:'ABMCNT D Q:(ABMC=ABMSAV)
...K ^XTMP("ABM-PVP2",$J,"PRV PERCENT",$G(ABMPRC(ABMP,ABMCNT))),ABMP("PRV")
...S ABMC=ABMC+1
;
S ABM("PG")=1
S ABMSDT=$P($G(^XTMP("ABM-PVP2",$J,"PRV TOP")),U,2)
I +ABMSDT=0 S ABMSDT=ABMY("SDT")
D HDR^ABMM2PV3
W !,"The Patient Volume Threshold (30% for EPs, or 20% for Pediatricians) was not"
W !,"met for the "_$S(("^A^B^C^"[("^"_ABMY("90")_"^")):"timeframe entered",1:"MU Qualification year")_"."
W !,"Details for the volumes that were achieved are provided for your information.",!
W !,"Highest Patient Volume Met: ",+$P($G(^XTMP("ABM-PVP2",$J,"PRV TOP")),U)_"%"
W !,"First Day Highest Patient Volume Achieved: ",$$SDT^ABMDUTL(ABMSDT)
;
I $Y+5>IOSL D HD^ABMM2PV3 Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
S ABMTHPV=0
S:ABMSDT ABMTHPV=+$G(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT))
S ABMMHPV=0
S:ABMSDT ABMMHPV=+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM",ABMSDT))
W !!,"Total Patient Encounters of First Highest Patient Volume Period: ",ABMTHPV,!
S ABMU("TXT")="Total Medicaid"_$S(+$G(ABMFQHC)=1:"/Needy Individual",1:"")
S ABMU("TXT")=ABMU("TXT")_" Encounters of First Highest Patient Volume Period: "_ABMMHPV
S ABMU("LM")=0,ABMU("RM")=80,ABMU("LNG")=80
D ^ABMDWRAP
D NMHDR^ABMM2PV5
;
S ABMSDT=0,ABMCNT=0
S ABMDTCNT=0
F S ABMSDT=$O(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT)) Q:'ABMSDT D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.I "^A^D^"'[("^"_ABMY("90")_"^")&(ABMY("SDT")'=ABMSDT) Q ;only whole year for automated ;abm*2.6*12 uncomp care
.;start new abm*2.6*12 HEAT134048
.S X1=ABMY("SDT")
.S X2=275
.D C^%DTC
.I "^A^D^"[("^"_ABMY("90")_"^")&(ABMSDT>X) Q ;275 days after start won't be 90 days anymore
.;end new HEAT134048
.S ABMDTCNT=+$G(ABMDTCNT)+1
.;
.I $Y+5>IOSL D HD^ABMM2PV3,NMHDR^ABMM2PV5 Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.I +$G(ABMY("EDT"))=0 D
..S X1=ABMSDT
..S X2=89
..D C^%DTC
..S ABMEDT=X
.I +$G(ABMY("EDT"))'=0 S ABMEDT=ABMY("EDT")
.S ABMPD=$TR($P($$MDT^ABMDUTL(ABMSDT),"-",1,2),"-"," ")_"-"_$TR($P($$MDT^ABMDUTL(ABMEDT),"-",1,2),"-"," ") ;rpt prd
.S ABMRT=$J($G(^XTMP("ABM-PVP2",$J,"PRV PERCENT",ABMSDT)),5)_"%" ;rate
.S ABMDEN=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-DENOM",ABMSDT)),6) ;denom.
.S ABMNUM=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM",ABMSDT)),6) ;num.
.S ABMMCDPD=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,"MCD")),6)
.S ABMSCHPD=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM PD",ABMSDT,"CHIP")),5)
.S ABMMCDZP=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,"MCD")),6)
.S ABMMCDEN=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,"MCD")),6)
.S ABMSCHZP=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ZEROPD",ABMSDT,"CHIP")),5)
.S ABMSCHEN=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,"CHIP")),5)
.;S ABMUNCOM=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),6) ;abm*2.6*12 ;abm*2.6*15
.S ABMUNCOM=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),4) ;abm*2.6*12 ;abm*2.6*15
.S ABMTSI=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM TRIBSI",ABMSDT,"TRIBSI")),2) ;abm*2.6*15 HEAT183289
.;W !,ABMPD,?15,ABMRT,?20,ABMDEN,?28,ABMNUM,?35,ABMMCDPD,?41,ABMMCDZP,?50,ABMMCDEN,?57,ABMSCHPD,?63,ABMSCHZP,?73,ABMSCHEN ;abm*2.6*12
.W !,ABMPD,?13,ABMRT,?20,ABMDEN,?27,ABMNUM,?34,ABMMCDPD,?41,ABMMCDZP,?48,ABMMCDEN,?55,ABMSCHPD,?62,ABMSCHZP,?67,ABMSCHEN ;abm*2.6*12
.;I ABMFQHC=1 W ?74,ABMUNCOM ;abm*2.6*12 ;abm*2.6*15
.I ABMFQHC=1 W ?74,ABMUNCOM,?78,ABMTSI ;abm*2.6*15
I ABMDTCNT=0 D
.W !!, "<< NO DATA FOUND FOR SELECTION >>"
Q
PATIENT ;EP
D PATIENT^ABMM2P10 ;abm*2.6*15 split routine due to size
Q
ABMM2PV4 ;IHS/SD/SDR - MU Patient Volume EP Report ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**11,12,15**;NOV 12, 2009;Build 251
+2 ;IHS/SD/SDR - 2.6*12 - Made changes for uncomp care; uncomp should be a separate detail line
+3 ; and should be included in pt vol total, not as separate line
+4 ;IHS/SD/SDR - 2.6*12 - Included numerator and msgs about numerator, denominator
+5 ;IHS/SD/SDR - 2.6*15 - HEAT161159 - Changed PT LST to sort differently so there won't be duplicate vsts on pt lst.
+6 ;IHS/SD/SDR - 2.6*15 - HEAT174501 - Added Provider NPI to host file
+7 ;IHS/SD/SDR - 2.6*15 - HEAT171490 - Added facility NPI and TIN to pt list host file
+8 ;IHS/SD/SDR - 2.6*15 - HEAT183289 - Added Tribal self-insured flag to output and summary total lines
+9 ;
GRPPRT ;EP
+1 IF ABMY("RFMT")="P"
DO PATIENT
QUIT
+2 IF +$GET(^XTMP("ABM-PVP2",$JOB,"PRV TOP"))>29.5
SET ABMPMET=1
DO MET
QUIT
+3 DO NOTMET
+4 KILL ^XTMP("ABM-PVP2",$JOB)
+5 QUIT
MET ;
+1 SET ABM("PG")=1
+2 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP2",$JOB,"PRV TOP")),U,2)
+3 DO HDR^ABMM2PV3
+4 IF $Y+5>IOSL
DO HD^ABMM2PV3
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+5 ;abm*2.6*12
SET ABMNUMT=0
+6 SET ABMVLOC=0
+7 FOR
SET ABMVLOC=$ORDER(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT,ABMVLOC))
IF 'ABMVLOC
QUIT
Begin DoDot:1
+8 IF $Y+5>IOSL
DO HD^ABMM2PV3
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+9 FOR ABM=1:1:80
WRITE "-"
+10 SET ABMLOC=$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E")
+11 SET (ABMTENC,ABMDENOM)=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT,ABMVLOC))
+12 SET ABMMPD=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,ABMVLOC,"MCD"))
+13 SET ABMMZPD=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"MCD"))
+14 SET ABMMENR=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,ABMVLOC,"MCD"))
+15 SET ABMCPD=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,ABMVLOC,"CHIP"))
+16 SET ABMCZPD=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"CHIP"))
+17 SET ABMCENR=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,ABMVLOC,"CHIP"))
+18 SET ABMOTHPD=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV ENC CNT",ABMSDT,ABMVLOC,"OTHR"))
+19 ;start new abm*2.6*12
+20 IF $GET(ABMFQHC)=1
Begin DoDot:2
+21 ;abm*2.6*12 uncomp care
SET ABMUNCR=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM UNCOMP",ABMSDT,ABMVLOC,"UNCOMP"))
+22 ;abm*2.6*15 HEAT183289 tribal self-insured
SET ABMTSI=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM TRIBSI",ABMSDT,ABMVLOC,"TRIBSI"))
End DoDot:2
+23 ;abm*2.6*15 HEAT183289
SET ABMNUMT=+$GET(ABMNUMT)+ABMMPD+ABMMZPD+ABMMENR+ABMCPD+ABMCZPD+ABMCENR+$GET(ABMUNCR)
+24 ;S ABMNUMT=+$G(ABMNUMT)+ABMMPD+ABMMZPD+ABMMENR+ABMCPD+ABMCZPD+ABMCENR+$G(ABMUNCR)+$G(ABMTSI) ;abm*2.6*15 HEAT183289
+25 ;end new abm*2.6*12
+26 ;abm*2.6*12 uncomp care
SET ^XTMP("ABM-PVP2",$JOB,"PRV ENC CNT",ABMSDT,ABMVLOC,"UNCOMP")=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV ENC CNT",ABMSDT,ABMVLOC,"UNCOMP"))+$GET(ABMUNCOM)
+27 ;abm*2.6*12 uncomp care
SET ^XTMP("ABM-PVP2",$JOB,"PRV ENC CNT",ABMSDT,"UNCOMP")=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV ENC CNT",ABMSDT,"UNCOMP"))+$GET(ABMUNCOM)
+28 ;start new abm*2.6*15 HEAT183289 tribal self-insured
+29 ;S ^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"TRIBSI")=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"TRIBSI"))+$G(ABMTSI)
+30 ;S ^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"TRIBSI")=+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"TRIBSI"))+$G(ABMTSI)
+31 ;end new HEAT183289
+32 WRITE !,"Patient Volume "_ABMLOC_": "_+$PIECE($GET(^XTMP("ABM-PVP2",$JOB,"PRV PERCENT",ABMSDT,ABMVLOC)),U)_"%"
+33 WRITE !!,"Total Patient Encounters (Denominator) "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT,ABMVLOC)),8)
+34 WRITE !,"Total Numerator Encounters "_ABMLOC_": ",?70,$JUSTIFY((ABMMPD+ABMMZPD+ABMMENR+ABMCPD+ABMCZPD+ABMCENR+$GET(ABMUNCR)),8)
+35 WRITE !,"Total Medicaid Paid Encounters "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,ABMVLOC,"MCD")),8)
+36 WRITE !,"Total Medicaid Zero Paid Encounters "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"MCD")),8)
+37 WRITE !,"Total Medicaid Enrolled (Not Billed) Encounters "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,ABMVLOC,"MCD")),8)
+38 WRITE !,"Total Kidscare/Chip Paid Encounters "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,ABMVLOC,"CHIP")),8)
+39 WRITE !,"Total Kidscare/Chip Zero Paid Encounters "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,ABMVLOC,"CHIP")),8)
+40 WRITE !,"Total Kidscare/Chip Enrolled (Not Billed) Encounters "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,ABMVLOC,"CHIP")),8)
+41 ;W !,"Total Paid Other Encounters "_ABMLOC_" (*not included in numer.): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,ABMVLOC,"OTHR")),8) ;abm*2.6*15
+42 ;abm*2.6*15
WRITE !,"Total Paid Other Encounters "_ABMLOC_" (*not included in numer.): ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,ABMVLOC,"OTHR")),8)
+43 ;W:($G(ABMFQHC)=1) !,"Total Uncompensated Care "_ABMLOC_": ",?70,$J(ABMUNCR,8) ;abm*2.6*12 uncomp care ;abm*2.6*15 HEAT183289
+44 ;start new abm*2.6*15 HEAT183289
+45 IF ($GET(ABMFQHC)=1)
Begin DoDot:2
+46 ;W !,"Total Uncompensated Care "_ABMLOC_": ",?70,$J(ABMUNCR,8) ;abm*2.6*15
+47 ;abm*2.6*15
WRITE !,"Total Uncompensated Care "_ABMLOC_": ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM UNCOMP",ABMSDT,ABMVLOC,"UNCOMP")),8)
+48 ;W !,"Total Tribal Self-Insured "_ABMLOC_" (*not incl. in numerator): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM TRIBSI",ABMSDT,"TRIBSI")),8) ;abm*2.6*15
+49 ;abm*2.6*15 ;end new HEAT183289
WRITE !,"Total Tribal Self-Insured "_ABMLOC_" (*not incl. in numerator): ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM TRIBSI",ABMSDT,ABMVLOC,"TRIBSI")),8)
End DoDot:2
End DoDot:1
+50 ;
+51 WRITE !
+52 FOR ABM=1:1:80
WRITE "-"
+53 WRITE !,"Patient Volume all calculated Facilities: ",+$PIECE($GET(^XTMP("ABM-PVP2",$JOB,"PRV TOP")),U)_"%"
+54 WRITE !!,"Total Patient Encounters (Denominator) All Facilities Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT)),8)
+55 WRITE !,"Total Numerator Encounters All Facilities Total: ",?70,$JUSTIFY(ABMNUMT,8)
+56 WRITE !,"Total Medicaid Paid Encounters All Facilities Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,"MCD")),8)
+57 WRITE !,"Total Medicaid Zero Paid Encounters All Facilities Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,"MCD")),8)
+58 ;abm*2.6*12
WRITE !,"Total Medicaid Enrolled (Not Billed) Encounters All Facs Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,"MCD")),8)
+59 WRITE !,"Total Kidscare/Chip Paid Encounters All Facilities Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,"CHIP")),8)
+60 WRITE !,"Total Kidscare/Chip Zero Paid Encounters All Facilities Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,"CHIP")),8)
+61 ;W !,"Total Kidscare/Chip Enrolled Encounters All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM ENR",ABMSDT,"CHIP")),8) ;abm*2.6*12
+62 ;abm*2.6*12
WRITE !,"Total Kidscare/Chip Enrolled (Not Billed) Encounters All Facs: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,"CHIP")),8)
+63 ;W !,"Total Paid Other Encounters All Fac. (*not included in numerator): ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV ENC CNT",ABMSDT,"OTHR")),8) ;abm*2.6*12 ;abm*2.6*15
+64 ;abm*2.6*12 ;abm*2.6*15
WRITE !,"Total Paid Other Encounters All Fac. (*not included in numerator): ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,"OTHR")),8)
+65 ;W:($G(ABMFQHC)=1) !,"Total Uncompensated Care All Facilities Total: ",?70,$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),8) ;abm*2.6*12 uncomp care ;abm*2.6*15 HEAT183289
+66 ;start new abm*2.6*15 HEAT183289
+67 IF ($GET(ABMFQHC)=1)
Begin DoDot:1
+68 WRITE !,"Total Uncompensated Care All Facilities Total: ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),8)
+69 WRITE !,"Total Tribal Self-Insured All Facilities Total (*not incl. in numer.): ",?70,$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM TRIBSI",ABMSDT,"TRIBSI")),7)
End DoDot:1
+70 ;end new HEAT183289
+71 WRITE !
+72 QUIT
NOTMET ;EP
+1 SET ABMCNT=0
+2 KILL ABMLN
+3 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP2",$JOB,"PRV TOP")),U,2)
+4 ;
+5 IF +$GET(ABMY("TVDTS"))'=0
Begin DoDot:1
+6 SET ABMCNT=0
+7 SET ABMDT=0
+8 FOR
SET ABMDT=$ORDER(^XTMP("ABM-PVP2",$JOB,"PRV PERCENT",ABMDT))
IF 'ABMDT
QUIT
Begin DoDot:2
+9 ;I ABMY("90")'="A"&(ABMY("SDT")'=ABMSDT) Q ;abm*2.6*12 HEAT134048
End DoDot:2
+10 ;only whole yr for auto ;abm*2.6*12 uncomp care
IF "^A^D^"'[("^"_ABMY("90")_"^")&(ABMY("SDT")'=ABMSDT)
QUIT
+11 ;start new abm*2.6*12 HEAT134048
+12 SET X1=ABMY("SDT")
+13 SET X2=275
+14 DO C^%DTC
+15 ;275 days after start won't be 90 days anymore
IF "^A^D^"[("^"_ABMY("90")_"^")&(ABMSDT>X)
QUIT
+16 ;end new HEAT134048
+17 SET ABMPRC($GET(^XTMP("ABM-PVP2",$JOB,"PRV PERCENT",ABMDT)),ABMCNT)=ABMDT
+18 SET ABMP=""
+19 SET ABMSAV=ABMCNT-ABMY("TVDTS")
+20 FOR
SET ABMP=$ORDER(ABMPRC(ABMP))
IF ABMP=""
QUIT
Begin DoDot:2
+21 SET ABMCNT=0
SET ABMC=0
+22 FOR
SET ABMCNT=$ORDER(ABMPRC(ABMP,ABMCNT))
IF 'ABMCNT
QUIT
Begin DoDot:3
+23 KILL ^XTMP("ABM-PVP2",$JOB,"PRV PERCENT",$GET(ABMPRC(ABMP,ABMCNT))),ABMP("PRV")
+24 SET ABMC=ABMC+1
End DoDot:3
IF (ABMC=ABMSAV)
QUIT
End DoDot:2
End DoDot:1
+25 ;
+26 SET ABM("PG")=1
+27 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP2",$JOB,"PRV TOP")),U,2)
+28 IF +ABMSDT=0
SET ABMSDT=ABMY("SDT")
+29 DO HDR^ABMM2PV3
+30 WRITE !,"The Patient Volume Threshold (30% for EPs, or 20% for Pediatricians) was not"
+31 WRITE !,"met for the "_$SELECT(("^A^B^C^"[("^"_ABMY("90")_"^")):"timeframe entered",1:"MU Qualification year")_"."
+32 WRITE !,"Details for the volumes that were achieved are provided for your information.",!
+33 WRITE !,"Highest Patient Volume Met: ",+$PIECE($GET(^XTMP("ABM-PVP2",$JOB,"PRV TOP")),U)_"%"
+34 WRITE !,"First Day Highest Patient Volume Achieved: ",$$SDT^ABMDUTL(ABMSDT)
+35 ;
+36 IF $Y+5>IOSL
DO HD^ABMM2PV3
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+37 SET ABMTHPV=0
+38 IF ABMSDT
SET ABMTHPV=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT))
+39 SET ABMMHPV=0
+40 IF ABMSDT
SET ABMMHPV=+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM",ABMSDT))
+41 WRITE !!,"Total Patient Encounters of First Highest Patient Volume Period: ",ABMTHPV,!
+42 SET ABMU("TXT")="Total Medicaid"_$SELECT(+$GET(ABMFQHC)=1:"/Needy Individual",1:"")
+43 SET ABMU("TXT")=ABMU("TXT")_" Encounters of First Highest Patient Volume Period: "_ABMMHPV
+44 SET ABMU("LM")=0
SET ABMU("RM")=80
SET ABMU("LNG")=80
+45 DO ^ABMDWRAP
+46 DO NMHDR^ABMM2PV5
+47 ;
+48 SET ABMSDT=0
SET ABMCNT=0
+49 SET ABMDTCNT=0
+50 FOR
SET ABMSDT=$ORDER(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT))
IF 'ABMSDT
QUIT
Begin DoDot:1
+51 ;only whole year for automated ;abm*2.6*12 uncomp care
IF "^A^D^"'[("^"_ABMY("90")_"^")&(ABMY("SDT")'=ABMSDT)
QUIT
+52 ;start new abm*2.6*12 HEAT134048
+53 SET X1=ABMY("SDT")
+54 SET X2=275
+55 DO C^%DTC
+56 ;275 days after start won't be 90 days anymore
IF "^A^D^"[("^"_ABMY("90")_"^")&(ABMSDT>X)
QUIT
+57 ;end new HEAT134048
+58 SET ABMDTCNT=+$GET(ABMDTCNT)+1
+59 ;
+60 IF $Y+5>IOSL
DO HD^ABMM2PV3
DO NMHDR^ABMM2PV5
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+61 IF +$GET(ABMY("EDT"))=0
Begin DoDot:2
+62 SET X1=ABMSDT
+63 SET X2=89
+64 DO C^%DTC
+65 SET ABMEDT=X
End DoDot:2
+66 IF +$GET(ABMY("EDT"))'=0
SET ABMEDT=ABMY("EDT")
+67 ;rpt prd
SET ABMPD=$TRANSLATE($PIECE($$MDT^ABMDUTL(ABMSDT),"-",1,2),"-"," ")_"-"_$TRANSLATE($PIECE($$MDT^ABMDUTL(ABMEDT),"-",1,2),"-"," ")
+68 ;rate
SET ABMRT=$JUSTIFY($GET(^XTMP("ABM-PVP2",$JOB,"PRV PERCENT",ABMSDT)),5)_"%"
+69 ;denom.
SET ABMDEN=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-DENOM",ABMSDT)),6)
+70 ;num.
SET ABMNUM=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM",ABMSDT)),6)
+71 SET ABMMCDPD=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,"MCD")),6)
+72 SET ABMSCHPD=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM PD",ABMSDT,"CHIP")),5)
+73 SET ABMMCDZP=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,"MCD")),6)
+74 SET ABMMCDEN=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,"MCD")),6)
+75 SET ABMSCHZP=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ZEROPD",ABMSDT,"CHIP")),5)
+76 SET ABMSCHEN=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM ENR",ABMSDT,"CHIP")),5)
+77 ;S ABMUNCOM=$J(+$G(^XTMP("ABM-PVP2",$J,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),6) ;abm*2.6*12 ;abm*2.6*15
+78 ;abm*2.6*12 ;abm*2.6*15
SET ABMUNCOM=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM UNCOMP",ABMSDT,"UNCOMP")),4)
+79 ;abm*2.6*15 HEAT183289
SET ABMTSI=$JUSTIFY(+$GET(^XTMP("ABM-PVP2",$JOB,"PRV-NUM TRIBSI",ABMSDT,"TRIBSI")),2)
+80 ;W !,ABMPD,?15,ABMRT,?20,ABMDEN,?28,ABMNUM,?35,ABMMCDPD,?41,ABMMCDZP,?50,ABMMCDEN,?57,ABMSCHPD,?63,ABMSCHZP,?73,ABMSCHEN ;abm*2.6*12
+81 ;abm*2.6*12
WRITE !,ABMPD,?13,ABMRT,?20,ABMDEN,?27,ABMNUM,?34,ABMMCDPD,?41,ABMMCDZP,?48,ABMMCDEN,?55,ABMSCHPD,?62,ABMSCHZP,?67,ABMSCHEN
+82 ;I ABMFQHC=1 W ?74,ABMUNCOM ;abm*2.6*12 ;abm*2.6*15
+83 ;abm*2.6*15
IF ABMFQHC=1
WRITE ?74,ABMUNCOM,?78,ABMTSI
End DoDot:1
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+84 IF ABMDTCNT=0
Begin DoDot:1
+85 WRITE !!,