ABMMUPV3 ;IHS/SD/SDR - MU Patient Volume EP Report ;
;;2.6;IHS 3P BILLING SYSTEM;**7,8,9**;NOV 12, 2009
;
PRINT ;EP
I ABMY("RTYP")="GRP" D GRPPRT^ABMMUPV4 Q ;abm*2.6*8
S ABMPRV=0
F S ABMPRV=$O(ABMP(ABMPRV)) Q:'ABMPRV D D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
.S ABMPMET=0
.I ABMY("RFMT")="P" D PATIENT Q
.I +$G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV))>29.99 S ABMPMET=1 D MET Q
.I +$G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV))>19.99&($$DOCLASS^ABMDVST2(ABMPRV)["PEDIAT") S ABMPMET=1 D MET Q
.D NOTMET
K ^XTMP("ABM-PVP",$J)
Q
MET ;
S ABM("PG")=1
S ABMSDT=$P($G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV)),U,2)
D HDR
D MHDR
I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
S ABMP("PRV")=0
F S ABMP("PRV")=$O(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMP("PRV"))) Q:'ABMP("PRV") D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.I ABMP("PRV")'=ABMPRV Q
.S ABMVLOC=0
.F S ABMVLOC=$O(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMP("PRV"),ABMVLOC)) Q:'ABMVLOC D
..I $Y+5>IOSL D HD 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")
..W !,"Patient Volume "_ABMLOC_": "_+$P($G(^XTMP("ABM-PVP",$J,"PRV PERCENT",ABMSDT,ABMPRV,ABMVLOC)),U)_"%"
..W !!,"Total Patient Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMPRV,ABMVLOC)),8)
..W !,"Total Paid Medicaid Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV ENC CNT",ABMSDT,ABMPRV,ABMVLOC,"MCD")),8)
..W !,"Total Paid Kidscare/Chip Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV ENC CNT",ABMSDT,ABMPRV,ABMVLOC,"CHIP")),8)
..W !,"Total Paid Other Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV ENC CNT",ABMSDT,ABMPRV,ABMVLOC,"OTHR")),8)
;
W !
F ABM=1:1:80 W "-"
W !,"Patient Volume all calculated Facilities: ",+$P($G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV)),U)_"%"
W !!,"Total Patient Encounters All Facilities Total: ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMPRV)),8)
W !,"Total Paid Medicaid Encounters All Facilities Total: ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV ENC CNT",ABMSDT,ABMPRV,"MCD")),8)
W !,"Total Paid Kidscare/Chip Encounters All Facilities Total: ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV ENC CNT",ABMSDT,ABMPRV,"CHIP")),8) ;abm*2.6*9 NOHEAT
W !,"Total Paid Other Encounters All Facilities Total: ",?54,$J(+$G(^XTMP("ABM-PVP",$J,"PRV ENC CNT",ABMSDT,ABMPRV,"OTHR")),8)
W !
Q
MHDR ;
W !
S ABMU("TXT")="Patient Volume for the Qualification Year was calculated using the Medicaid"_$S(+$G(ABMFQHC)=1:"/Needy Individual",1:"")
S ABMU("TXT")=ABMU("TXT")_" calculation method."
S ABMU("LM")=0,ABMU("RM")=80,ABMU("LNG")=80
D ^ABMDWRAP
W !
Q
NOTMET ;EP
S ABMCNT=0
K ABMLN
S ABMSDT=$P($G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV)),U,2)
;
I +$G(ABMY("TVDTS"))'=0 D
.S ABMCNT=0
.S ABMDT=0
.F S ABMDT=$O(^XTMP("ABM-PVP",$J,"PRV PERCENT",ABMDT)) Q:'ABMDT D
..I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT))) ;abm*2.6*8
..S ABMP("PRV")=0
..F S ABMP("PRV")=$O(^XTMP("ABM-PVP",$J,"PRV PERCENT",ABMDT,ABMP("PRV"))) Q:'ABMP("PRV") D
...I ABMP("PRV")'=ABMPRV Q
...S ABMCNT=ABMCNT+1
...S ABMPRC($G(^XTMP("ABM-PVP",$J,"PRV PERCENT",ABMDT,ABMPRV)),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-PVP",$J,"PRV PERCENT",$G(ABMPRC(ABMP,ABMCNT))),ABMP("PRV")
...S ABMC=ABMC+1
;
S ABM("PG")=1
S ABMSDT=$P($G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV)),U,2)
I +ABMSDT=0 S ABMSDT=ABMY("SDT")
D HDR
W !,"The Patient Volume Threshold (30% for EPs, or 20% for Pediatricians) was not"
W !,"met for the 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-PVP",$J,"PRV TOP",ABMPRV)),U)_"%"
W !,"First Day Highest Patient Volume Achieved: ",$$SDT^ABMDUTL(ABMSDT)
W !!,"Patient Volume for the Qualification Year was calculated using the Medicaid"
W !,$S(+$G(ABMFQHC)=1:"/Needy Individual",1:"")_" calculation method."
;
I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT))) ;abm*2.6*8
S ABMTHPV=0
S:ABMSDT ABMTHPV=+$G(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMPRV))
S ABMMHPV=0
S:ABMSDT ABMMHPV=+$G(^XTMP("ABM-PVP",$J,"PRV-NUM",ABMSDT,ABMPRV))
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 VolumePeriod: "_ABMMHPV
S ABMU("LM")=0,ABMU("RM")=80,ABMU("LNG")=80
D ^ABMDWRAP
D NMHDR
;
S ABMSDT=0,ABMCNT=0
F S ABMSDT=$O(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT)) Q:'ABMSDT D
.;
.S ABMP("PRV")=0
.F S ABMP("PRV")=$O(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMP("PRV"))) Q:'ABMP("PRV") D
..I ABMP("PRV")'=ABMPRV Q
..;start old code abm*2.6*8 NOHEAT
..;S X1=ABMSDT
..;S X2=89
..;D C^%DTC
..;S ABMEDT=X
..;end old code start new code
..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")
..;end new code
..S ABMCNT=ABMCNT+1
..S ABMLN(ABMCNT)=$TR($P($$MDT^ABMDUTL(ABMSDT),"-",1,2),"-"," ")_" - "_$TR($P($$MDT^ABMDUTL(ABMEDT),"-",1,2),"-"," ") ;report period
..S $P(ABMLN(ABMCNT),U,2)=$J($G(^XTMP("ABM-PVP",$J,"PRV PERCENT",ABMSDT,ABMPRV)),3)_"%" ;rate
..S $P(ABMLN(ABMCNT),U,3)=$J(+$G(^XTMP("ABM-PVP",$J,"PRV-DENOM",ABMSDT,ABMPRV)),6) ;denominator
..S $P(ABMLN(ABMCNT),U,4)=$J(+$G(^XTMP("ABM-PVP",$J,"PRV-NUM",ABMSDT,ABMPRV)),6) ;numerator
S ABMCUTOF=$S(ABMCNT#2=1:(ABMCNT+1)\2,1:ABMCNT\2)
S ABMMCNT=1
F ABMCUTOF=(ABMCUTOF+1):1:ABMCNT D
.S ABMLN(ABMMCNT)=ABMLN(ABMMCNT)_U_ABMLN(ABMCUTOF)
.K ABMLN(ABMCUTOF)
.S ABMMCNT=+$G(ABMMCNT)+1
S ABMCNT=0
F S ABMCNT=$O(ABMLN(ABMCNT)) Q:'ABMCNT D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.I $Y+5>IOSL D HD,NMHDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.S ABMPD=$P(ABMLN(ABMCNT),U)
.S ABMRT=$P(ABMLN(ABMCNT),U,2)
.S ABMDEN=$P(ABMLN(ABMCNT),U,3)
.S ABMNUM=$P(ABMLN(ABMCNT),U,4)
.S ABMPD2=$P(ABMLN(ABMCNT),U,5)
.S ABMRT2=$P(ABMLN(ABMCNT),U,6)
.S ABMDEN2=$P(ABMLN(ABMCNT),U,7)
.S ABMNUM2=$P(ABMLN(ABMCNT),U,8)
.W !,ABMPD,?16,ABMRT,?21,ABMDEN,?29,ABMNUM,?40,ABMPD2,?56,ABMRT2,?63,ABMDEN2,?71,ABMNUM2
Q
NMHDR ;EP
W !
F ABM=1:1:80 W "="
W !,"MEDICAID"_$S($G(ABMFQHC)=1:"/NEEDY INDIVIDUAL",1:"")_" PATIENT VOLUME - QUALIFICATION YEAR ",ABMY("QYR")
W !,"Report Period",?16,"Rate",?22,"Denom-",?31,"Numer-",?40,"Report Period",?56,"Rate",?63,"Denom-",?71,"Numer-"
W !?22,"inator",?31,"ator",?63,"inator",?71,"ator"
W !
F ABM=1:1:80 W "="
Q
PATIENT ;EP
S ABM("PG")=1
S ABMSDT=$P($G(^XTMP("ABM-PVP",$J,"PRV TOP",ABMPRV)),U,2)
D HDR
Q:ABMSDT=""
S ABMVLOC=0
F S ABMVLOC=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC)) Q:'ABMVLOC D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.D PTHDR
.S ABMITYP=""
.F S ABMITYP=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP)) Q:ABMITYP="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
..S ABMINS=""
..F S ABMINS=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS)) Q:ABMINS="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
...S ABMPTL=""
...F S ABMPTL=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL)) Q:ABMPTL="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
....S ABMPTF=""
....F S ABMPTF=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF)) Q:ABMPTF="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.....S ABMVDT=0
.....F S ABMVDT=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)) Q:'ABMVDT D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
......;start old code abm*2.6*9 HEAT56697
......;S ABMVDFN=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U)
......;S ABMPT=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U,2)
......;S ABMTRIEN=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U,3)
......;S IENS=ABMVLOC_","_ABMPT_","
......;S ABMHRN=$$GET1^DIQ(9000001.41,IENS,.02)
......;W !,$E(ABMPTL_", "_ABMPTF,1,16) ;pt name
......;W ?18,ABMHRN ;HRN
......;W ?25,$E($$GET1^DIQ(9000010,ABMVDFN,.07,"E"),1,3) ;Category
......;W ?29,$E($$GET1^DIQ(9000010,ABMVDFN,.08,"E"),1,8) ;clinic
......;W ?39,$S(ABMITYP="X":"",1:ABMITYP) ;insurer type
......;W ?42,$S(ABMINS="NO BILL":"NOT BILLED",1:$E(ABMINS,1,10)) ;insurer
......;W ?53,$$CDT^ABMDUTL(ABMVDT) ;visit date
......;W ?70,$S(+ABMTRIEN:$$SDTO^ABMDUTL(ABMTRIEN),1:"") ;dt paid
......;I $P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U,4)'="" W ?79,$P(^(ABMVDT),U,4)
......;I $Y+5>IOSL D HD,PTHDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
......;end old code start new code
......S ABMVDFN=$O(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,0))
......S ABMPT=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,2)
......S ABMTRIEN=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,3)
......S IENS=ABMVLOC_","_ABMPT_","
......S ABMHRN=$$GET1^DIQ(9000001.41,IENS,.02)
......W !,$E(ABMPTL_", "_ABMPTF,1,16) ;pt name
......W ?18,ABMHRN ;HRN
......W ?25,$E($$GET1^DIQ(9000010,ABMVDFN,.07,"E"),1,3) ;Category
......W ?29,$E($$GET1^DIQ(9000010,ABMVDFN,.08,"E"),1,8) ;clinic
......W ?39,$S(ABMITYP="X":"",1:ABMITYP) ;insurer type
......W ?42,$S(ABMINS="NO BILL":"NOT BILLED",1:$E(ABMINS,1,10)) ;insurer
......W ?53,$$CDT^ABMDUTL(ABMVDT) ;visit date
......W ?70,$S(+ABMTRIEN:$$SDTO^ABMDUTL(ABMTRIEN),1:"") ;dt paid
......I $P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,4)'="" W ?79,$P(^(ABMVDFN),U,4)
......I $Y+5>IOSL D HD,PTHDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
......;end new code
Q
PTHDR ;
I IOST["C",(ABM("PG")=1) D HD ;start data on 2nd page of report
W !,"VISIT LOCATION: ",$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E"),!
F ABM=1:1:80 W "="
W !,?25,"Ser",?39,"I.",?42,"Billed",?53,"Date of",?70,"Date"
W !,"PATIENT NAME",?18,"CHART#",?25,"Cat",?29,"Clinic",?39,"T.",?42,"To",?53,"Service",?70,"Paid",!
F ABM=1:1:80 W "="
Q
HD D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
S ABM("PG")=+$G(ABM("PG"))+1
HDR ;EP
S:ABMSDT="" ABMSDT=ABMY("SDT")
I ABMY(90)="A"!(ABMY(90)="B") D
.S X1=ABMSDT
.S X2=89
.D C^%DTC
.S ABMEDT=X
I ABMY(90)="C" S ABMEDT=ABMY("EDT")
D EN^ABMVDF("IOF")
W !
I ABMY("RFMT")="P" D CENTER^ABMUCUTL("CONFIDENTIAL PATIENT INFORMATIONCOVERED BY THE PRIVACY ACT") W !
;I ABMY("RTYP")'="HOS" D CENTER^ABMUCUTL("IHS Meaningful Use Patient Volume Report - Eligible Professional Page "_ABM("PG")) ;abm*2.6*8
I ABMY("RTYP")="SEL" D CENTER^ABMUCUTL("IHS Meaningful Use Patient Volume Report - Eligible Professional Page "_ABM("PG")) ;abm*2.6*8
I ABMY("RTYP")="GRP" D CENTER^ABMUCUTL("IHS Meaningful Use Patient Volume Report - Group Practice Page "_ABM("PG")) ;abm*2.6*8
I ABMY("RTYP")="HOS" D CENTER^ABMUCUTL(" IHS Meaningful Use Patient Volume Report - Hospital Page "_ABM("PG"))
I ABMY("RFMT")'="P",+$G(ABMPMET)=0 W ! D CENTER^ABMUCUTL("Minimum Patient Volume NOT Achieved")
I ABMY("RFMT")="P" W ! D CENTER^ABMUCUTL("PATIENT LIST BY PROVIDER")
W !
D NOW^%DTC
D CENTER^ABMUCUTL("Report Run Date: "_$$CDT^ABMDUTL(%))
W !
D CENTER^ABMUCUTL("Report Generated by: "_$$GET1^DIQ(200,DUZ,.01,"E"))
I ABM("PG")=1 D
.I ABMY("RTYP")'="HOS" D
..W !!,"Participation Year: ",ABMY("PYR")
..W !,"Qualification Year: ",ABMY("QYR")
.I ABMY("RTYP")="HOS" D
..W !!,"Participation Federal fiscal year: ",ABMY("PYR")
..W !,"Qualification Federal fiscal year: ",ABMY("QYR")
.W !,"Reporting Period Identified: ",$S(ABMSDT:$$SDT^ABMDUTL(ABMSDT)_" thru "_$$SDT^ABMDUTL(ABMEDT),ABMY("SDT"):$$SDT^ABMDUTL(ABMY("SDT"))_" thru "_$$SDT^ABMDUTL(ABMEDT),1:"NONE FOUND")
.I ABMY("RTYP")'="HOS" D
..W !,"Facility(s): ",!
..S ABML=0
..F S ABML=$O(ABMF(ABML)) Q:'ABML W ?10,$$GET1^DIQ(9999999.06,ABML,.01,"E"),$S($D(^ABMMUPRM(1,1,"B",ABML)):" (FQHC/RHC)",1:""),! I $D(^ABMMUPRM(1,1,"B",ABML)) S ABMFQHC=1
I +$G(ABMY("TVDTS"))'=0 W !!,"Number of top volume dates to display if minimum thresholds are not met: ",$J(ABMY("TVDTS"),3),!
I ABMY("RFMT")="P",ABM("PG")'=1 W !
I ABMY("RTYP")="SEL" W !,"Eligible Professional: ",$$GET1^DIQ(200,ABMPRV,".01")_" ("_$$GET1^DIQ(7,$$DOCLASS^ABMDVST2(ABMPRV),.01,"E")_")" ;abm*2.6*8
;start new code abm*2.6*8
I ABMY("RTYP")="GRP" D
.Q:ABM("PG")'=1 ;only print on first page
.W !,"Eligible Professionals: "
.I '$D(ABMPRV("E")) W !?3,"<NONE>"
.S ABMPRV=0
.F S ABMPRV=$O(ABMPRV("E",ABMPRV)) Q:'ABMPRV D
..I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
..W !?3,$$GET1^DIQ(200,ABMPRV,".01")_" ("_$$GET1^DIQ(7,$$DOCLASS^ABMDVST2(ABMPRV),.01,"E")_")"
.W !!,"Other Professionals: "
.I '$D(ABMPRV("O")) W !?3,"<NONE>"
.S ABMPRV=0
.F S ABMPRV=$O(ABMPRV("O",ABMPRV)) Q:'ABMPRV D
..I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
..W !?3,$$GET1^DIQ(200,ABMPRV,".01")_" ("_$$GET1^DIQ(7,$$DOCLASS^ABMDVST2(ABMPRV),.01,"E")_")"
.D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
;end new code abm*2.6*8
W !
I ABMY("RFMT")="P" D
.W !
.Q:ABM("PG")'=1
.S ABMU("TXT")="This Patient List is provided for Eligible "_$S(ABMY("RTYP")="HOS":"Hospitals",1:"Professionals")_" to evaluate their "
.S ABMU("TXT")=ABMU("TXT")_"Medicaid"_$S($G(ABMFQHC)=1:"/Needy Individual",1:"")_" Patient Volume Encounters during the Report Period"
.S ABMU("TXT")=ABMU("TXT")_" for participation in the Medicaid EHR Incentive program."
.S ABMU("LM")=0,ABMU("RM")=80,ABMU("LNG")=80
.D ^ABMDWRAP
.W !
I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT))) ;abm*2.6*8
;
Q
ABMMUPV3 ;IHS/SD/SDR - MU Patient Volume EP Report ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**7,8,9**;NOV 12, 2009
+2 ;
PRINT ;EP
+1 ;abm*2.6*8
IF ABMY("RTYP")="GRP"
DO GRPPRT^ABMMUPV4
QUIT
+2 SET ABMPRV=0
+3 FOR
SET ABMPRV=$ORDER(ABMP(ABMPRV))
IF 'ABMPRV
QUIT
Begin DoDot:1
+4 SET ABMPMET=0
+5 IF ABMY("RFMT")="P"
DO PATIENT
QUIT
+6 IF +$GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV))>29.99
SET ABMPMET=1
DO MET
QUIT
+7 IF +$GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV))>19.99&($$DOCLASS^ABMDVST2(ABMPRV)["PEDIAT")
SET ABMPMET=1
DO MET
QUIT
+8 DO NOTMET
End DoDot:1
DO PAZ^ABMDRUTL
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
+9 KILL ^XTMP("ABM-PVP",$JOB)
+10 QUIT
MET ;
+1 SET ABM("PG")=1
+2 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV)),U,2)
+3 DO HDR
+4 DO MHDR
+5 IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+6 SET ABMP("PRV")=0
+7 FOR
SET ABMP("PRV")=$ORDER(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMP("PRV")))
IF 'ABMP("PRV")
QUIT
Begin DoDot:1
+8 IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+9 IF ABMP("PRV")'=ABMPRV
QUIT
+10 SET ABMVLOC=0
+11 FOR
SET ABMVLOC=$ORDER(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMP("PRV"),ABMVLOC))
IF 'ABMVLOC
QUIT
Begin DoDot:2
+12 IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+13 FOR ABM=1:1:80
WRITE "-"
+14 SET ABMLOC=$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E")
+15 WRITE !,"Patient Volume "_ABMLOC_": "_+$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV PERCENT",ABMSDT,ABMPRV,ABMVLOC)),U)_"%"
+16 WRITE !!,"Total Patient Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMPRV,ABMVLOC)),8)
+17 WRITE !,"Total Paid Medicaid Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV ENC CNT",ABMSDT,ABMPRV,ABMVLOC,"MCD")),8)
+18 WRITE !,"Total Paid Kidscare/Chip Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV ENC CNT",ABMSDT,ABMPRV,ABMVLOC,"CHIP")),8)
+19 WRITE !,"Total Paid Other Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV ENC CNT",ABMSDT,ABMPRV,ABMVLOC,"OTHR")),8)
End DoDot:2
End DoDot:1
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+20 ;
+21 WRITE !
+22 FOR ABM=1:1:80
WRITE "-"
+23 WRITE !,"Patient Volume all calculated Facilities: ",+$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV)),U)_"%"
+24 WRITE !!,"Total Patient Encounters All Facilities Total: ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMPRV)),8)
+25 WRITE !,"Total Paid Medicaid Encounters All Facilities Total: ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV ENC CNT",ABMSDT,ABMPRV,"MCD")),8)
+26 ;abm*2.6*9 NOHEAT
WRITE !,"Total Paid Kidscare/Chip Encounters All Facilities Total: ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV ENC CNT",ABMSDT,ABMPRV,"CHIP")),8)
+27 WRITE !,"Total Paid Other Encounters All Facilities Total: ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV ENC CNT",ABMSDT,ABMPRV,"OTHR")),8)
+28 WRITE !
+29 QUIT
MHDR ;
+1 WRITE !
+2 SET ABMU("TXT")="Patient Volume for the Qualification Year was calculated using the Medicaid"_$SELECT(+$GET(ABMFQHC)=1:"/Needy Individual",1:"")
+3 SET ABMU("TXT")=ABMU("TXT")_" calculation method."
+4 SET ABMU("LM")=0
SET ABMU("RM")=80
SET ABMU("LNG")=80
+5 DO ^ABMDWRAP
+6 WRITE !
+7 QUIT
NOTMET ;EP
+1 SET ABMCNT=0
+2 KILL ABMLN
+3 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV)),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-PVP",$JOB,"PRV PERCENT",ABMDT))
IF 'ABMDT
QUIT
Begin DoDot:2
+9 ;abm*2.6*8
IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+10 SET ABMP("PRV")=0
+11 FOR
SET ABMP("PRV")=$ORDER(^XTMP("ABM-PVP",$JOB,"PRV PERCENT",ABMDT,ABMP("PRV")))
IF 'ABMP("PRV")
QUIT
Begin DoDot:3
+12 IF ABMP("PRV")'=ABMPRV
QUIT
+13 SET ABMCNT=ABMCNT+1
+14 SET ABMPRC($GET(^XTMP("ABM-PVP",$JOB,"PRV PERCENT",ABMDT,ABMPRV)),ABMCNT)=ABMDT
End DoDot:3
End DoDot:2
+15 SET ABMP=""
+16 SET ABMSAV=ABMCNT-ABMY("TVDTS")
+17 FOR
SET ABMP=$ORDER(ABMPRC(ABMP))
IF ABMP=""
QUIT
Begin DoDot:2
+18 SET ABMCNT=0
SET ABMC=0
+19 FOR
SET ABMCNT=$ORDER(ABMPRC(ABMP,ABMCNT))
IF 'ABMCNT
QUIT
Begin DoDot:3
+20 KILL ^XTMP("ABM-PVP",$JOB,"PRV PERCENT",$GET(ABMPRC(ABMP,ABMCNT))),ABMP("PRV")
+21 SET ABMC=ABMC+1
End DoDot:3
IF (ABMC=ABMSAV)
QUIT
End DoDot:2
End DoDot:1
+22 ;
+23 SET ABM("PG")=1
+24 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV)),U,2)
+25 IF +ABMSDT=0
SET ABMSDT=ABMY("SDT")
+26 DO HDR
+27 WRITE !,"The Patient Volume Threshold (30% for EPs, or 20% for Pediatricians) was not"
+28 WRITE !,"met for the MU Qualification year."
+29 WRITE !,"Details for the volumes that were achieved are provided for your information.",!
+30 WRITE !,"Highest Patient Volume Met: ",+$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV)),U)_"%"
+31 WRITE !,"First Day Highest Patient Volume Achieved: ",$$SDT^ABMDUTL(ABMSDT)
+32 WRITE !!,"Patient Volume for the Qualification Year was calculated using the Medicaid"
+33 WRITE !,$SELECT(+$GET(ABMFQHC)=1:"/Needy Individual",1:"")_" calculation method."
+34 ;
+35 ;abm*2.6*8
IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+36 SET ABMTHPV=0
+37 IF ABMSDT
SET ABMTHPV=+$GET(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMPRV))
+38 SET ABMMHPV=0
+39 IF ABMSDT
SET ABMMHPV=+$GET(^XTMP("ABM-PVP",$JOB,"PRV-NUM",ABMSDT,ABMPRV))
+40 WRITE !!,"Total Patient Encounters of First Highest Patient Volume Period:",ABMTHPV,!
+41 SET ABMU("TXT")="Total Medicaid"_$SELECT(+$GET(ABMFQHC)=1:"/Needy Individual",1:"")
+42 SET ABMU("TXT")=ABMU("TXT")_" Encounters of First Highest Patient VolumePeriod: "_ABMMHPV
+43 SET ABMU("LM")=0
SET ABMU("RM")=80
SET ABMU("LNG")=80
+44 DO ^ABMDWRAP
+45 DO NMHDR
+46 ;
+47 SET ABMSDT=0
SET ABMCNT=0
+48 FOR
SET ABMSDT=$ORDER(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT))
IF 'ABMSDT
QUIT
Begin DoDot:1
+49 ;
+50 SET ABMP("PRV")=0
+51 FOR
SET ABMP("PRV")=$ORDER(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMP("PRV")))
IF 'ABMP("PRV")
QUIT
Begin DoDot:2
+52 IF ABMP("PRV")'=ABMPRV
QUIT
+53 ;start old code abm*2.6*8 NOHEAT
+54 ;S X1=ABMSDT
+55 ;S X2=89
+56 ;D C^%DTC
+57 ;S ABMEDT=X
+58 ;end old code start new code
+59 IF +$GET(ABMY("EDT"))=0
Begin DoDot:3
+60 SET X1=ABMSDT
+61 SET X2=89
+62 DO C^%DTC
+63 SET ABMEDT=X
End DoDot:3
+64 IF +$GET(ABMY("EDT"))'=0
SET ABMEDT=ABMY("EDT")
+65 ;end new code
+66 SET ABMCNT=ABMCNT+1
+67 ;report period
SET ABMLN(ABMCNT)=$TRANSLATE($PIECE($$MDT^ABMDUTL(ABMSDT),"-",1,2),"-"," ")_" - "_$TRANSLATE($PIECE($$MDT^ABMDUTL(ABMEDT),"-",1,2),"-"," ")
+68 ;rate
SET $PIECE(ABMLN(ABMCNT),U,2)=$JUSTIFY($GET(^XTMP("ABM-PVP",$JOB,"PRV PERCENT",ABMSDT,ABMPRV)),3)_"%"
+69 ;denominator
SET $PIECE(ABMLN(ABMCNT),U,3)=$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV-DENOM",ABMSDT,ABMPRV)),6)
+70 ;numerator
SET $PIECE(ABMLN(ABMCNT),U,4)=$JUSTIFY(+$GET(^XTMP("ABM-PVP",$JOB,"PRV-NUM",ABMSDT,ABMPRV)),6)
End DoDot:2
End DoDot:1
+71 SET ABMCUTOF=$SELECT(ABMCNT#2=1:(ABMCNT+1)\2,1:ABMCNT\2)
+72 SET ABMMCNT=1
+73 FOR ABMCUTOF=(ABMCUTOF+1):1:ABMCNT
Begin DoDot:1
+74 SET ABMLN(ABMMCNT)=ABMLN(ABMMCNT)_U_ABMLN(ABMCUTOF)
+75 KILL ABMLN(ABMCUTOF)
+76 SET ABMMCNT=+$GET(ABMMCNT)+1
End DoDot:1
+77 SET ABMCNT=0
+78 FOR
SET ABMCNT=$ORDER(ABMLN(ABMCNT))
IF 'ABMCNT
QUIT
Begin DoDot:1
+79 IF $Y+5>IOSL
DO HD
DO NMHDR
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+80 SET ABMPD=$PIECE(ABMLN(ABMCNT),U)
+81 SET ABMRT=$PIECE(ABMLN(ABMCNT),U,2)
+82 SET ABMDEN=$PIECE(ABMLN(ABMCNT),U,3)
+83 SET ABMNUM=$PIECE(ABMLN(ABMCNT),U,4)
+84 SET ABMPD2=$PIECE(ABMLN(ABMCNT),U,5)
+85 SET ABMRT2=$PIECE(ABMLN(ABMCNT),U,6)
+86 SET ABMDEN2=$PIECE(ABMLN(ABMCNT),U,7)
+87 SET ABMNUM2=$PIECE(ABMLN(ABMCNT),U,8)
+88 WRITE !,ABMPD,?16,ABMRT,?21,ABMDEN,?29,ABMNUM,?40,ABMPD2,?56,ABMRT2,?63,ABMDEN2,?71,ABMNUM2
End DoDot:1
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+89 QUIT
NMHDR ;EP
+1 WRITE !
+2 FOR ABM=1:1:80
WRITE "="
+3 WRITE !,"MEDICAID"_$SELECT($GET(ABMFQHC)=1:"/NEEDY INDIVIDUAL",1:"")_" PATIENT VOLUME - QUALIFICATION YEAR ",ABMY("QYR")
+4 WRITE !,"Report Period",?16,"Rate",?22,"Denom-",?31,"Numer-",?40,"Report Period",?56,"Rate",?63,"Denom-",?71,"Numer-"
+5 WRITE !?22,"inator",?31,"ator",?63,"inator",?71,"ator"
+6 WRITE !
+7 FOR ABM=1:1:80
WRITE "="
+8 QUIT
PATIENT ;EP
+1 SET ABM("PG")=1
+2 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PRV TOP",ABMPRV)),U,2)
+3 DO HDR
+4 IF ABMSDT=""
QUIT
+5 SET ABMVLOC=0
+6 FOR
SET ABMVLOC=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC))
IF 'ABMVLOC
QUIT
Begin DoDot:1
+7 DO PTHDR
+8 SET ABMITYP=""
+9 FOR
SET ABMITYP=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP))
IF ABMITYP=""
QUIT
Begin DoDot:2
+10 SET ABMINS=""
+11 FOR
SET ABMINS=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS))
IF ABMINS=""
QUIT
Begin DoDot:3
+12 SET ABMPTL=""
+13 FOR
SET ABMPTL=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL))
IF ABMPTL=""
QUIT
Begin DoDot:4
+14 SET ABMPTF=""
+15 FOR
SET ABMPTF=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF))
IF ABMPTF=""
QUIT
Begin DoDot:5
+16 SET ABMVDT=0
+17 FOR
SET ABMVDT=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT))
IF 'ABMVDT
QUIT
Begin DoDot:6
+18 ;start old code abm*2.6*9 HEAT56697
+19 ;S ABMVDFN=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U)
+20 ;S ABMPT=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U,2)
+21 ;S ABMTRIEN=$P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U,3)
+22 ;S IENS=ABMVLOC_","_ABMPT_","
+23 ;S ABMHRN=$$GET1^DIQ(9000001.41,IENS,.02)
+24 ;W !,$E(ABMPTL_", "_ABMPTF,1,16) ;pt name
+25 ;W ?18,ABMHRN ;HRN
+26 ;W ?25,$E($$GET1^DIQ(9000010,ABMVDFN,.07,"E"),1,3) ;Category
+27 ;W ?29,$E($$GET1^DIQ(9000010,ABMVDFN,.08,"E"),1,8) ;clinic
+28 ;W ?39,$S(ABMITYP="X":"",1:ABMITYP) ;insurer type
+29 ;W ?42,$S(ABMINS="NO BILL":"NOT BILLED",1:$E(ABMINS,1,10)) ;insurer
+30 ;W ?53,$$CDT^ABMDUTL(ABMVDT) ;visit date
+31 ;W ?70,$S(+ABMTRIEN:$$SDTO^ABMDUTL(ABMTRIEN),1:"") ;dt paid
+32 ;I $P($G(^XTMP("ABM-PVP",$J,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)),U,4)'="" W ?79,$P(^(ABMVDT),U,4)
+33 ;I $Y+5>IOSL D HD,PTHDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
+34 ;end old code start new code
+35 SET ABMVDFN=$ORDER(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,0))
+36 SET ABMPT=$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,2)
+37 SET ABMTRIEN=$PIECE($GET(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,3)
+38 SET IENS=ABMVLOC_","_ABMPT_","
+39 SET ABMHRN=$$GET1^DIQ(9000001.41,IENS,.02)
+40 ;pt name
WRITE !,$EXTRACT(ABMPTL_", "_ABMPTF,1,16)
+41 ;HRN
WRITE ?18,ABMHRN
+42 ;Category
WRITE ?25,$EXTRACT($$GET1^DIQ(9000010,ABMVDFN,.07,"E"),1,3)
+43 ;clinic
WRITE ?29,$EXTRACT($$GET1^DIQ(9000010,ABMVDFN,.08,"E"),1,8)
+44 ;insurer type
WRITE ?39,$SELECT(ABMITYP="X":"",1:ABMITYP)
+45 ;insurer
WRITE ?42,$SELECT(ABMINS="NO BILL":"NOT BILLED",1:$EXTRACT(ABMINS,1,10))
+46 ;visit date
WRITE ?53,$$CDT^ABMDUTL(ABMVDT)
+47 ;dt paid
WRITE ?70,$SELECT(+ABMTRIEN:$$SDTO^ABMDUTL(ABMTRIEN),1:"")
+48 IF $PIECE($GET(^XTMP("ABM-PVP",$JOB,"PT LST",ABMSDT,ABMPRV,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,4)'=""
WRITE ?79,$PIECE(^(ABMVDFN),U,4)
+49 IF $Y+5>IOSL
DO HD
DO PTHDR
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+50 ;end new code
End DoDot:6
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:5
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:4
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:3
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:2
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:1
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+51 QUIT
PTHDR ;
+1 ;start data on 2nd page of report
IF IOST["C"
IF (ABM("PG")=1)
DO HD
+2 WRITE !,"VISIT LOCATION: ",$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E"),!
+3 FOR ABM=1:1:80
WRITE "="
+4 WRITE !,?25,"Ser",?39,"I.",?42,"Billed",?53,"Date of",?70,"Date"
+5 WRITE !,"PATIENT NAME",?18,"CHART#",?25,"Cat",?29,"Clinic",?39,"T.",?42,"To",?53,"Service",?70,"Paid",!
+6 FOR ABM=1:1:80
WRITE "="
+7 QUIT
HD DO PAZ^ABMDRUTL
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
+1 SET ABM("PG")=+$GET(ABM("PG"))+1
HDR ;EP
+1 IF ABMSDT=""
SET ABMSDT=ABMY("SDT")
+2 IF ABMY(90)="A"!(ABMY(90)="B")
Begin DoDot:1
+3 SET X1=ABMSDT
+4 SET X2=89
+5 DO C^%DTC
+6 SET ABMEDT=X
End DoDot:1
+7 IF ABMY(90)="C"
SET ABMEDT=ABMY("EDT")
+8 DO EN^ABMVDF("IOF")
+9 WRITE !
+10 IF ABMY("RFMT")="P"
DO CENTER^ABMUCUTL("CONFIDENTIAL PATIENT INFORMATIONCOVERED BY THE PRIVACY ACT")
WRITE !
+11 ;I ABMY("RTYP")'="HOS" D CENTER^ABMUCUTL("IHS Meaningful Use Patient Volume Report - Eligible Professional Page "_ABM("PG")) ;abm*2.6*8
+12 ;abm*2.6*8
IF ABMY("RTYP")="SEL"
DO CENTER^ABMUCUTL("IHS Meaningful Use Patient Volume Report - Eligible Professional Page "_ABM("PG"))
+13 ;abm*2.6*8
IF ABMY("RTYP")="GRP"
DO CENTER^ABMUCUTL("IHS Meaningful Use Patient Volume Report - Group Practice Page "_ABM("PG"))
+14 IF ABMY("RTYP")="HOS"
DO CENTER^ABMUCUTL(" IHS Meaningful Use Patient Volume Report - Hospital Page "_ABM("PG"))
+15 IF ABMY("RFMT")'="P"
IF +$GET(ABMPMET)=0
WRITE !
DO CENTER^ABMUCUTL("Minimum Patient Volume NOT Achieved")
+16 IF ABMY("RFMT")="P"
WRITE !
DO CENTER^ABMUCUTL("PATIENT LIST BY PROVIDER")
+17 WRITE !
+18 DO NOW^%DTC
+19 DO CENTER^ABMUCUTL("Report Run Date: "_$$CDT^ABMDUTL(%))
+20 WRITE !
+21 DO CENTER^ABMUCUTL("Report Generated by: "_$$GET1^DIQ(200,DUZ,.01,"E"))
+22 IF ABM("PG")=1
Begin DoDot:1
+23 IF ABMY("RTYP")'="HOS"
Begin DoDot:2
+24 WRITE !!,"Participation Year: ",ABMY("PYR")
+25 WRITE !,"Qualification Year: ",ABMY("QYR")
End DoDot:2
+26 IF ABMY("RTYP")="HOS"
Begin DoDot:2
+27 WRITE !!,"Participation Federal fiscal year: ",ABMY("PYR")
+28 WRITE !,"Qualification Federal fiscal year: ",ABMY("QYR")
End DoDot:2
+29 WRITE !,"Reporting Period Identified: ",$SELECT(ABMSDT:$$SDT^ABMDUTL(ABMSDT)_" thru "_$$SDT^ABMDUTL(ABMEDT),ABMY("SDT"):$$SDT^ABMDUTL(ABMY("SDT"))_" thru "_$$SDT^ABMDUTL(ABMEDT),1:"NONE FOUND")
+30 IF ABMY("RTYP")'="HOS"
Begin DoDot:2
+31 WRITE !,"Facility(s): ",!
+32 SET ABML=0
+33 FOR
SET ABML=$ORDER(ABMF(ABML))
IF 'ABML
QUIT
WRITE ?10,$$GET1^DIQ(9999999.06,ABML,.01,"E"),$SELECT($DATA(^ABMMUPRM(1,1,"B",ABML)):" (FQHC/RHC)",1:""),!
IF $DATA(^ABMMUPRM(1,1,"B",ABML))
SET ABMFQHC=1
End DoDot:2
End DoDot:1
+34 IF +$GET(ABMY("TVDTS"))'=0
WRITE !!,"Number of top volume dates to display if minimum thresholds are not met: ",$JUSTIFY(ABMY("TVDTS"),3),!
+35 IF ABMY("RFMT")="P"
IF ABM("PG")'=1
WRITE !
+36 ;abm*2.6*8
IF ABMY("RTYP")="SEL"
WRITE !,"Eligible Professional: ",$$GET1^DIQ(200,ABMPRV,".01")_" ("_$$GET1^DIQ(7,$$DOCLASS^ABMDVST2(ABMPRV),.01,"E")_")"
+37 ;start new code abm*2.6*8
+38 IF ABMY("RTYP")="GRP"
Begin DoDot:1
+39 ;only print on first page
IF ABM("PG")'=1
QUIT
+40 WRITE !,"Eligible Professionals: "
+41 IF '$DATA(ABMPRV("E"))
WRITE !?3,"<NONE>"
+42 SET ABMPRV=0
+43 FOR
SET ABMPRV=$ORDER(ABMPRV("E",ABMPRV))
IF 'ABMPRV
QUIT
Begin DoDot:2
+44 IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+45 WRITE !?3,$$GET1^DIQ(200,ABMPRV,".01")_" ("_$$GET1^DIQ(7,$$DOCLASS^ABMDVST2(ABMPRV),.01,"E")_")"
End DoDot:2
+46 WRITE !!,"Other Professionals: "
+47 IF '$DATA(ABMPRV("O"))
WRITE !?3,"<NONE>"
+48 SET ABMPRV=0
+49 FOR
SET ABMPRV=$ORDER(ABMPRV("O",ABMPRV))
IF 'ABMPRV
QUIT
Begin DoDot:2
+50 IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+51 WRITE !?3,$$GET1^DIQ(200,ABMPRV,".01")_" ("_$$GET1^DIQ(7,$$DOCLASS^ABMDVST2(ABMPRV),.01,"E")_")"
End DoDot:2
+52 DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:1
+53 ;end new code abm*2.6*8
+54 WRITE !
+55 IF ABMY("RFMT")="P"
Begin DoDot:1
+56 WRITE !
+57 IF ABM("PG")'=1
QUIT
+58 SET ABMU("TXT")="This Patient List is provided for Eligible "_$SELECT(ABMY("RTYP")="HOS":"Hospitals",1:"Professionals")_" to evaluate their "
+59 SET ABMU("TXT")=ABMU("TXT")_"Medicaid"_$SELECT($GET(ABMFQHC)=1:"/Needy Individual",1:"")_" Patient Volume Encounters during the Report Period"
+60 SET ABMU("TXT")=ABMU("TXT")_" for participation in the Medicaid EHR Incentive program."
+61 SET ABMU("LM")=0
SET ABMU("RM")=80
SET ABMU("LNG")=80
+62 DO ^ABMDWRAP
+63 WRITE !
End DoDot:1
+64 ;abm*2.6*8
IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+65 ;
+66 QUIT