ABMM2PVP ;IHS/SD/SDR - MU Patient Volume EP Report ;
;;2.6;IHS 3P BILLING SYSTEM;**11,12,15**;NOV 12, 2009;Build 251
;2.6*12-Updated FQHC/RHC/Tribal to include Urban
;2.6*12-Made changes for uncomp care; uncomp should be separate detail line
; and should be included in pt vol total, not separate line.
;2.6*12-Added screen on options B,C dts so it won't cross yrs.
;IHS/SD/SDR 2.6*15 - HEAT158173 - corrected check for PA led facility so it would let user select PA as a doc.
;IHS/SD/SDR - 2.6*15 - HEAT168081 - Made change for error <SUBSCR>FAC+29^ABMM2PVP; occurs when user types '^' instead of selecting first facility.
;IHS/SD/SDR - 2.6*15 - Added tag XIT and call to it in double queuer so global would get killed; it was hanging around and causing more data to print than should.
;
I $P($G(^ABMMUPRM(1,0)),U,2)="" D Q
.W !!,"Setup has not been done. Please do MUP option prior to running any reports",!
.S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
;
EN ;
K ABMF,ABMPRVDR,ABMY,ABM,ABMEFLG
D FAC Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!'$D(ABMF)
W !!,"In order for an Eligible Professional (EP) to participate in the Medicaid EHR"
W !,"Incentive program EPs have to meet a patient volume requirement of 30% or 20%"
W !,"minimum for pediatricians. This can be accomplished as an individual or as a"
W !,"group."
W !!,"The SEL report is to be used to determine patient volume for an individual EP."
W !,"The GRP report is to be used to determine patient volume for an entire group"
W !,"practice. If GRP report is utilized all EPs within the facility will need to"
W !,"utilize the GRP report."
W !!
D RTYPE
Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!$D(DIRUT)
I ABMY("RTYP")="SEL" D Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!'$D(ABMPRVDR)
.D PRVDR Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!'$D(ABMPRVDR)
D PARTYR Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
D SELINS
D 90DAY Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
I $G(ABMY("90"))=""!($G(ABMY("90"))'="A"&(+$G(ABMY("SDT"))=0)) K ABMY,ABMPRVDR,ABMF,ABMP,ABMPRV G EN
D RFORMAT Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
D SUMMARY
D ^XBFMK
S DIR(0)="S^P:Print Report;R:Return to Selection Criteria -Erases ALL previous selections"
S DIR("A")="<P> to Print or <R> to Reselect"
I ABMY("RFMT")="P" D
.S DIR(0)="S^P:Print Report;H:Print Delimited Report to the HOST FILE;R:Return to Selection Criteria -Erases ALL previous selections"
.S DIR("A")="<P> to Print, <H> to Host File, or <R> to Reselect"
D ^DIR K DIR Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
I $P(Y,U)="R" K ABMY,ABMPRVDR,ABMF,ABMP,ABMPRV G EN
I $P(Y,U)="H" D Q ;HFS; prompt for path/filename
.D ^XBFMK
.S DIR(0)="F"
.S DIR("A")="Enter Path"
.S DIR("B")=$P($G(^ABMDPARM(DUZ(2),1,4)),"^",7)
.D ^DIR K DIR
.I $G(Y)["^" S POP=1 Q
.S ABMPATH=$S($G(Y)="":ABMPATH,1:Y)
.D ^XBFMK
.S DIR(0)="F"
.S DIR("A")="Enter filename"
.D ^DIR K DIR
.I $G(Y)["^" S POP=1 Q
.S ABMFN=Y
.D COMPUTE^ABMM2PV1
W !!,"Note: This report will take a while to run based on the amount of data you have"
;S ABMQ("RX")="POUT^ABMDRUTL" ;abm*2.6*15
S ABMQ("RX")="XIT^ABMM2PVP" ;made it so report has its own exit routine ;abm*2.6*15
S ABMQ("NS")="ABM"
S ABMQ("RP")="COMPUTE^ABMM2PV1"
D ^ABMDRDBQ
Q
;start new abm*2.6*15
XIT ;EP - exit option for report
D ^XBFMK
K ^XTMP("ABM-PVP2",$J)
Q
;end new abm*2.6*15
RTYPE ;
K ^XTMP("ABM-PVP2",$J)
D ^XBFMK
S DIR(0)="SO^SEL:Encounter method for each EP;GRP:Group method for facilities"
S DIR("A")="Select report type"
D ^DIR K DIR
Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
S ABMY("RTYP")=Y
Q
PRVDR ;EP
W !
F D Q:(+Y<0)
.D ^XBFMK
.S DIC="^VA(200,"
.S DIC(0)="AEMQ"
.D ^DIC
.S ABMPRV=+Y
.I +Y<0 Q ;none selected
.I +$$GET1^DIQ(200,ABMPRV,53.5,"I")=0 D Q
..W !!,"Provider "_$$GET1^DIQ(200,ABMPRV,".01","E")_" does not have a Provider Class so they can't be"
..W !,"considered for this report"
..W !,"Please enter a different Eligible Professional's name.",!!
.;
.I '$D(^ABMMUPRM(1,2,"B",$$GET1^DIQ(200,ABMPRV,53.5,"I"))) D Q
..W !!,"Provider "_$$GET1^DIQ(200,ABMPRV,".01","E")_" ("_$$GET1^DIQ(200,ABMPRV,53.5,"E")_")"
..W !,"is not an Eligible Professional for the Medicaid MU EHR Program"
..W !,"Please enter a different Eligible Professional's name.",!!
.;
.I $$GET1^DIQ(200,ABMPRV,53.5,"E")="PHYSICIAN ASSISTANT" D
..I ABMFQHC=0 D PAMSG Q
..S ABMPAFLG=0
..S ABMFQ=0
..F S ABMFQ=$O(ABMF(ABMFQ)) Q:'ABMFQ D
...S ABMFQIEN=0
...S ABMFQIEN=+$O(^ABMMUPRM(1,1,"B",ABMFQ,0))
...Q:'ABMFQIEN
...I $P($G(^ABMMUPRM(1,1,ABMFQIEN,0)),U,2)=1 S ABMPAFLG=1
..I ABMPAFLG=0 D PAMSG Q ;abm*2.6*15 HEAT158173
.;I (+$G(ABMPAFLG)=0),ABMFQHC=1 Q ;abm*2.6*15
.I $$GET1^DIQ(200,ABMPRV,53.5,"E")="PHYSICIAN ASSISTANT",ABMFQHC=1,ABMPAFLG=0 Q
.I $$GET1^DIQ(200,ABMPRV,53.5,"E")="PHYSICIAN ASSISTANT",ABMFQHC=0 Q
.S ABMPRVDR(ABMPRV)=""
M ABMP=ABMPRVDR
Q
PAMSG ;EP
W !!,"Provider "_$$GET1^DIQ(200,ABMPRV,".01","E")_" ("_$$GET1^DIQ(200,ABMPRV,53.5,"E")_")"
W !,"can't be included because the facility has to be led by a PA for a PA"
W !,"to qualify"
Q
FAC ;
D GETFACS^ABMM2MUP ;get fac list
W !!
K ABMFANS,ABMF
S ABMFQHC=0,ABMNFQHC=0
F D Q:+$G(Y)<0!(Y=ABMTOT)!$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) ;didn't answer or ALL selected
.D ^XBFMK
.D FACLST
.S DIR(0)="SO^"_$G(ABMDIR)
.S:'$D(ABMF) DIR(0)="S^"_$G(ABMDIR)
.I ABMFQHC=1 D
..S DIR("A",1)="Note: A combination of FQHC/RHC/Tribal/Urban and non-FQHC/RHC/"
..S DIR("A",2)=" Tribal/Urban data may not be selected on this report"
..S DIR("A",3)=""
.S DIR("A")="Select one or more facilities to use for calculating patient volume"
.D ^DIR K DIR
.Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
.S ABMFANS=Y
.I ABMFANS'=ABMTOT,$D(ABMF),($G(ABMFTYP)="T"),'$D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS))) W !!,"only FQHC/RHC/Tribal/Urbans are allowed based on your first selection" H 1 Q
.I ABMFANS'=ABMTOT,$D(ABMF),($G(ABMFTYP)="I"),$D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS))) W !!,"only non-FQHC/RHC/Tribal/Urban clinics are allowed based on your first selection" H 1 Q
.;
.I ABMFANS'=ABMTOT,$D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS))) S ABMFQHC=2,ABMFTYP=$S($G(ABMFTYP)="":"T",1:$G(ABMFTYP))
.I ABMFANS'=ABMTOT,'$D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS))),($G(ABMFTYP)="") S ABMFTYP="I"
.I ABMFANS'=(ABMTOT) S ABMF($G(ABMFLIST(ABMFANS)))=""
.I ABMFANS=(ABMTOT) D
..S ABMCNT=0
..F S ABMCNT=$O(ABMFLIST(ABMCNT)) Q:'ABMCNT S ABMF($G(ABMFLIST(ABMCNT)))=""
;Q:+$G(Y)<0!(Y=ABMTOT)!$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
S ABMFQHC=0
;I $D(^ABMMUPRM(1,1,"B",$O(ABMF(0)))) S ABMFQHC=1 ;abm*2.6*15 HEAT168081
I +$G(ABMFANS)'=0,$D(^ABMMUPRM(1,1,"B",$O(ABMF(0)))) S ABMFQHC=1 ;abm*2.6*15 HEAT168081
Q
FACLST ;
S ABMCNT=0,ABMDIR="" ;abm*2.6*12
F S ABMCNT=$O(ABMFLIST(ABMCNT)) Q:'ABMCNT D
.S:ABMDIR'="" ABMDIR=ABMDIR_";"_ABMCNT_":"_$$GET1^DIQ(9999999.06,$G(ABMFLIST(ABMCNT)),.01,"E")
.S:ABMDIR="" ABMDIR=ABMCNT_":"_$$GET1^DIQ(9999999.06,$G(ABMFLIST(ABMCNT)),.01,"E")
.S ABMDIR=ABMDIR_$S($D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMCNT))):" (FQHC/RHC/Tribal/Urban)",1:"")
.S ABMDIR=ABMDIR_$S($D(ABMF($G(ABMFLIST(ABMCNT)))):" *",1:"")
.I $D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMCNT))) S ABMFQHC=1
.I '$D(^ABMMUPRM(1,1,"B",ABMFLIST(ABMCNT))) S ABMNFQHC=1
S ABMCNT=$O(ABMFLIST(99999),-1) ;get last entry#
S (ABMCNT,ABMTOT)=ABMCNT+1
I ((ABMFQHC=0&(ABMNFQHC=1))!((ABMFQHC=1)&(ABMNFQHC=0)))!(ABMCNT<2) S ABMDIR=ABMDIR_";"_ABMCNT_":All facilities"
Q
PARTYR ;
I ABMY("RTYP")="SEL"!(ABMY("RTYP")="GRP") D
.W !!!,"For EPs, the Participation year is based on a calendar year;"
.W !,"this is the same year that the EP would be demonstrating Meaningful"
.W !,"Use. (Calendar year is January 1- December 31)"
D ^XBFMK
S DIR(0)="NA^1960:2030"
S DIR("A")="Enter the Participation year for this report: "
I ABMY("RTYP")="HOS" S DIR("A")="Enter the Participation Fiscal year for this report: "
D ^DIR K DIR
Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
S ABMY("PYR")=+Y
S ABMY("QYR")=ABMY("PYR")-1
Q
90DAY ;
D 90DAY^ABMM2PP1
Q
RFORMAT ;
D ^XBFMK
S DIR(0)="S^S:Summary Report;P:Patient List" ;abm*2.6*12
S DIR("A",1)=""
S DIR("A")="Enter Report Format Choice"
D ^DIR K DIR
Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
S ABMY("RFMT")=$P(Y,U)
I ABMY("RFMT")="A" D
. D ^XBFMK
.S DIR(0)="N"
.S DIR("A",1)=""
.S DIR("A",2)="Specify the number of top volume dates to display if minimum thresholds are not met"
.S DIR("A")="Enter Number (1-275)"
.D ^DIR K DIR
.Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
.S ABMY("TVDTS")=+Y
Q
SELINS ;EP
W !!!
I ABMY("RTYP")="HOS" W "EH"
I ABMY("RTYP")'="HOS" W "EP"
W " calculations can include any SCHIP visits that are part of a Medicaid"
W !,"expansion program. Visits for stand-alone SCHIP programs cannot be included"
W !,"in the calculation. The following list of insurers will be included unless"
W !,"otherwise specified."
W !,"A breakdown of categories will be provided."
D FINDINS
I '$D(ABMI) W !!,"No SCHIP insurers found" Q
D WRTINS
S ABMFLG=0
F D Q:ABMFLG=1
.S ABMEDIT=""
.S DIR(0)="SO^A:Add Additional SCHIP Payers;R:Remove SCHIP Payers from List;N:Do NOT count any SCHIP entries in the report"
.S DIR("A")="Would you like to Add or Remove (A/R/N)"
.D ^DIR K DIR
.S ABMEDIT=Y
.I ABMEDIT="" S ABMFLG=1 Q
.Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
.I ABMEDIT="N" K ABMI S ABMFLG=1 Q
.I ABMEDIT="A"!(ABMEDIT="R") D
..I ABMEDIT="A" D
...S ABMAFLG=0
...F D Q:ABMAFLG=1
....D ^XBFMK
....S DIC="^AUTNINS("
....S DIC(0)="QEAM"
....S DIC("A")="Select Insurer: "
....;only ityp K,P and can't add an insurer that's already on list
....S DIC("S")="I (($$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,Y,"".211"",""I""),1,""I"")=""K"")!($$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,Y,"".211"",""I""),1,""I"")=""P""))&('$D(ABML(X)))"
....D ^DIC
....S ABMINS=+Y
....I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)!(Y<0) S ABMAFLG=1 W:'$D(DIRUT) !,"<NO ENTRY ADDED>" Q
....S ABMI("INS",ABMINS)=""
....S ABMI(ABMCNT,ABMINS)=""
....S ABMCNT=+$G(ABMCNT)+1
....W " <ADDED>"
..I ABMEDIT="R" D
...S ABMRFLG=0
...F D Q:ABMRFLG=1
....D WRTINS
....D ^XBFMK
....S DIR(0)="NO^1:"_(ABMCNT-1)
....S DIR("A")="Remove which entry"
....D ^DIR K DIR
....I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) S ABMRFLG=1 W:'$D(DIRUT) !,"<NO ENTRY REMOVED>" Q
....S ABMA=$O(ABMI(X,0))
....K ABMI(X,ABMA)
....K ABML(ABMA)
....W " <REMOVED>"
....D RBINSLST
I $D(ABMI) D WRTINS
I '$D(ABMI) W !!,"Insurers with SCHIP insurer type will not be included on this report"
Q
RBINSLST ;EP
S ABMCNT1=0,ABMCNT2=1
F S ABMCNT1=$O(ABMI(ABMCNT1)) Q:'ABMCNT1 D
.S ABMX=0
.F S ABMX=$O(ABMI(ABMCNT1,ABMX)) Q:'ABMX D
..S ABMK(ABMCNT2,ABMX)=""
..S ABMCNT2=ABMCNT2+1
S ABMCNT=ABMCNT2
K ABMI
M ABMI=ABMK
K ABMK
S ABMK=$O(ABMI(99),-1)
F ABM=1:1:ABMK S ABMI("INS",$O(ABMI(ABM,0)))=""
K ABMK
Q
FINDINS ;EP
S ABMINS=0
S ABMCNT=1
F S ABMINS=$O(^AUTNINS(ABMINS)) Q:'ABMINS D
.I $$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,+ABMINS,".211","I"),1,"I")'="K" Q
.S ABMI(ABMCNT,ABMINS)=""
.S ABMI("INS",ABMINS)=""
.S ABMCNT=+$G(ABMCNT)+1
Q
WRTINS ;EP
W !!,"Report will include the following insurers that hold the SCHIP Insurer Type:"
S ABMC=0
F S ABMC=$O(ABMI(ABMC)) Q:'ABMC D
.S ABMINS=$O(ABMI(ABMC,0))
.W !?5,ABMC_". "_$$GET1^DIQ(9999999.18,ABMINS,".01","E")
Q
SUMMARY ;
D SUMMARY^ABMM2PV6
Q
ABMM2PVP ;IHS/SD/SDR - MU Patient Volume EP Report ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**11,12,15**;NOV 12, 2009;Build 251
+2 ;2.6*12-Updated FQHC/RHC/Tribal to include Urban
+3 ;2.6*12-Made changes for uncomp care; uncomp should be separate detail line
+4 ; and should be included in pt vol total, not separate line.
+5 ;2.6*12-Added screen on options B,C dts so it won't cross yrs.
+6 ;IHS/SD/SDR 2.6*15 - HEAT158173 - corrected check for PA led facility so it would let user select PA as a doc.
+7 ;IHS/SD/SDR - 2.6*15 - HEAT168081 - Made change for error <SUBSCR>FAC+29^ABMM2PVP; occurs when user types '^' instead of selecting first facility.
+8 ;IHS/SD/SDR - 2.6*15 - Added tag XIT and call to it in double queuer so global would get killed; it was hanging around and causing more data to print than should.
+9 ;
+10 IF $PIECE($GET(^ABMMUPRM(1,0)),U,2)=""
Begin DoDot:1
+11 WRITE !!,"Setup has not been done. Please do MUP option prior to running any reports",!
+12 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+13 ;
EN ;
+1 KILL ABMF,ABMPRVDR,ABMY,ABM,ABMEFLG
+2 DO FAC
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)!'$DATA(ABMF)
QUIT
+3 WRITE !!,"In order for an Eligible Professional (EP) to participate in the Medicaid EHR"
+4 WRITE !,"Incentive program EPs have to meet a patient volume requirement of 30% or 20%"
+5 WRITE !,"minimum for pediatricians. This can be accomplished as an individual or as a"
+6 WRITE !,"group."
+7 WRITE !!,"The SEL report is to be used to determine patient volume for an individual EP."
+8 WRITE !,"The GRP report is to be used to determine patient volume for an entire group"
+9 WRITE !,"practice. If GRP report is utilized all EPs within the facility will need to"
+10 WRITE !,"utilize the GRP report."
+11 WRITE !!
+12 DO RTYPE
+13 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)!$DATA(DIRUT)
QUIT
+14 IF ABMY("RTYP")="SEL"
Begin DoDot:1
+15 DO PRVDR
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)!'$DATA(ABMPRVDR)
QUIT
End DoDot:1
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)!'$DATA(ABMPRVDR)
QUIT
+16 DO PARTYR
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+17 DO SELINS
+18 DO 90DAY
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+19 IF $GET(ABMY("90"))=""!($GET(ABMY("90"))'="A"&(+$GET(ABMY("SDT"))=0))
KILL ABMY,ABMPRVDR,ABMF,ABMP,ABMPRV
GOTO EN
+20 DO RFORMAT
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+21 DO SUMMARY
+22 DO ^XBFMK
+23 SET DIR(0)="S^P:Print Report;R:Return to Selection Criteria -Erases ALL previous selections"
+24 SET DIR("A")="<P> to Print or <R> to Reselect"
+25 IF ABMY("RFMT")="P"
Begin DoDot:1
+26 SET DIR(0)="S^P:Print Report;H:Print Delimited Report to the HOST FILE;R:Return to Selection Criteria -Erases ALL previous selections"
+27 SET DIR("A")="<P> to Print, <H> to Host File, or <R> to Reselect"
End DoDot:1
+28 DO ^DIR
KILL DIR
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+29 IF $PIECE(Y,U)="R"
KILL ABMY,ABMPRVDR,ABMF,ABMP,ABMPRV
GOTO EN
+30 ;HFS; prompt for path/filename
IF $PIECE(Y,U)="H"
Begin DoDot:1
+31 DO ^XBFMK
+32 SET DIR(0)="F"
+33 SET DIR("A")="Enter Path"
+34 SET DIR("B")=$PIECE($GET(^ABMDPARM(DUZ(2),1,4)),"^",7)
+35 DO ^DIR
KILL DIR
+36 IF $GET(Y)["^"
SET POP=1
QUIT
+37 SET ABMPATH=$SELECT($GET(Y)="":ABMPATH,1:Y)
+38 DO ^XBFMK
+39 SET DIR(0)="F"
+40 SET DIR("A")="Enter filename"
+41 DO ^DIR
KILL DIR
+42 IF $GET(Y)["^"
SET POP=1
QUIT
+43 SET ABMFN=Y
+44 DO COMPUTE^ABMM2PV1
End DoDot:1
QUIT
+45 WRITE !!,"Note: This report will take a while to run based on the amount of data you have"
+46 ;S ABMQ("RX")="POUT^ABMDRUTL" ;abm*2.6*15
+47 ;made it so report has its own exit routine ;abm*2.6*15
SET ABMQ("RX")="XIT^ABMM2PVP"
+48 SET ABMQ("NS")="ABM"
+49 SET ABMQ("RP")="COMPUTE^ABMM2PV1"
+50 DO ^ABMDRDBQ
+51 QUIT
+52 ;start new abm*2.6*15
XIT ;EP - exit option for report
+1 DO ^XBFMK
+2 KILL ^XTMP("ABM-PVP2",$JOB)
+3 QUIT
+4 ;end new abm*2.6*15
RTYPE ;
+1 KILL ^XTMP("ABM-PVP2",$JOB)
+2 DO ^XBFMK
+3 SET DIR(0)="SO^SEL:Encounter method for each EP;GRP:Group method for facilities"
+4 SET DIR("A")="Select report type"
+5 DO ^DIR
KILL DIR
+6 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+7 SET ABMY("RTYP")=Y
+8 QUIT
PRVDR ;EP
+1 WRITE !
+2 FOR
Begin DoDot:1
+3 DO ^XBFMK
+4 SET DIC="^VA(200,"
+5 SET DIC(0)="AEMQ"
+6 DO ^DIC
+7 SET ABMPRV=+Y
+8 ;none selected
IF +Y<0
QUIT
+9 IF +$$GET1^DIQ(200,ABMPRV,53.5,"I")=0
Begin DoDot:2
+10 WRITE !!,"Provider "_$$GET1^DIQ(200,ABMPRV,".01","E")_" does not have a Provider Class so they can't be"
+11 WRITE !,"considered for this report"
+12 WRITE !,"Please enter a different Eligible Professional's name.",!!
End DoDot:2
QUIT
+13 ;
+14 IF '$DATA(^ABMMUPRM(1,2,"B",$$GET1^DIQ(200,ABMPRV,53.5,"I")))
Begin DoDot:2
+15 WRITE !!,"Provider "_$$GET1^DIQ(200,ABMPRV,".01","E")_" ("_$$GET1^DIQ(200,ABMPRV,53.5,"E")_")"
+16 WRITE !,"is not an Eligible Professional for the Medicaid MU EHR Program"
+17 WRITE !,"Please enter a different Eligible Professional's name.",!!
End DoDot:2
QUIT
+18 ;
+19 IF $$GET1^DIQ(200,ABMPRV,53.5,"E")="PHYSICIAN ASSISTANT"
Begin DoDot:2
+20 IF ABMFQHC=0
DO PAMSG
QUIT
+21 SET ABMPAFLG=0
+22 SET ABMFQ=0
+23 FOR
SET ABMFQ=$ORDER(ABMF(ABMFQ))
IF 'ABMFQ
QUIT
Begin DoDot:3
+24 SET ABMFQIEN=0
+25 SET ABMFQIEN=+$ORDER(^ABMMUPRM(1,1,"B",ABMFQ,0))
+26 IF 'ABMFQIEN
QUIT
+27 IF $PIECE($GET(^ABMMUPRM(1,1,ABMFQIEN,0)),U,2)=1
SET ABMPAFLG=1
End DoDot:3
+28 ;abm*2.6*15 HEAT158173
IF ABMPAFLG=0
DO PAMSG
QUIT
End DoDot:2
+29 ;I (+$G(ABMPAFLG)=0),ABMFQHC=1 Q ;abm*2.6*15
+30 IF $$GET1^DIQ(200,ABMPRV,53.5,"E")="PHYSICIAN ASSISTANT"
IF ABMFQHC=1
IF ABMPAFLG=0
QUIT
+31 IF $$GET1^DIQ(200,ABMPRV,53.5,"E")="PHYSICIAN ASSISTANT"
IF ABMFQHC=0
QUIT
+32 SET ABMPRVDR(ABMPRV)=""
End DoDot:1
IF (+Y<0)
QUIT
+33 MERGE ABMP=ABMPRVDR
+34 QUIT
PAMSG ;EP
+1 WRITE !!,"Provider "_$$GET1^DIQ(200,ABMPRV,".01","E")_" ("_$$GET1^DIQ(200,ABMPRV,53.5,"E")_")"
+2 WRITE !,"can't be included because the facility has to be led by a PA for a PA"
+3 WRITE !,"to qualify"
+4 QUIT
FAC ;
+1 ;get fac list
DO GETFACS^ABMM2MUP
+2 WRITE !!
+3 KILL ABMFANS,ABMF
+4 SET ABMFQHC=0
SET ABMNFQHC=0
+5 ;didn't answer or ALL selected
FOR
Begin DoDot:1
+6 DO ^XBFMK
+7 DO FACLST
+8 SET DIR(0)="SO^"_$GET(ABMDIR)
+9 IF '$DATA(ABMF)
SET DIR(0)="S^"_$GET(ABMDIR)
+10 IF ABMFQHC=1
Begin DoDot:2
+11 SET DIR("A",1)="Note: A combination of FQHC/RHC/Tribal/Urban and non-FQHC/RHC/"
+12 SET DIR("A",2)=" Tribal/Urban data may not be selected on this report"
+13 SET DIR("A",3)=""
End DoDot:2
+14 SET DIR("A")="Select one or more facilities to use for calculating patient volume"
+15 DO ^DIR
KILL DIR
+16 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+17 SET ABMFANS=Y
+18 IF ABMFANS'=ABMTOT
IF $DATA(ABMF)
IF ($GET(ABMFTYP)="T")
IF '$DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS)))
WRITE !!,"only FQHC/RHC/Tribal/Urbans are allowed based on your first selection"
HANG 1
QUIT
+19 IF ABMFANS'=ABMTOT
IF $DATA(ABMF)
IF ($GET(ABMFTYP)="I")
IF $DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS)))
WRITE !!,"only non-FQHC/RHC/Tribal/Urban clinics are allowed based on your first selection"
HANG 1
QUIT
+20 ;
+21 IF ABMFANS'=ABMTOT
IF $DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS)))
SET ABMFQHC=2
SET ABMFTYP=$SELECT($GET(ABMFTYP)="":"T",1:$GET(ABMFTYP))
+22 IF ABMFANS'=ABMTOT
IF '$DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMFANS)))
IF ($GET(ABMFTYP)="")
SET ABMFTYP="I"
+23 IF ABMFANS'=(ABMTOT)
SET ABMF($GET(ABMFLIST(ABMFANS)))=""
+24 IF ABMFANS=(ABMTOT)
Begin DoDot:2
+25 SET ABMCNT=0
+26 FOR
SET ABMCNT=$ORDER(ABMFLIST(ABMCNT))
IF 'ABMCNT
QUIT
SET ABMF($GET(ABMFLIST(ABMCNT)))=""
End DoDot:2
End DoDot:1
IF +$GET(Y)<0!(Y=ABMTOT)!$DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+27 ;Q:+$G(Y)<0!(Y=ABMTOT)!$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
+28 SET ABMFQHC=0
+29 ;I $D(^ABMMUPRM(1,1,"B",$O(ABMF(0)))) S ABMFQHC=1 ;abm*2.6*15 HEAT168081
+30 ;abm*2.6*15 HEAT168081
IF +$GET(ABMFANS)'=0
IF $DATA(^ABMMUPRM(1,1,"B",$ORDER(ABMF(0))))
SET ABMFQHC=1
+31 QUIT
FACLST ;
+1 ;abm*2.6*12
SET ABMCNT=0
SET ABMDIR=""
+2 FOR
SET ABMCNT=$ORDER(ABMFLIST(ABMCNT))
IF 'ABMCNT
QUIT
Begin DoDot:1
+3 IF ABMDIR'=""
SET ABMDIR=ABMDIR_";"_ABMCNT_":"_$$GET1^DIQ(9999999.06,$GET(ABMFLIST(ABMCNT)),.01,"E")
+4 IF ABMDIR=""
SET ABMDIR=ABMCNT_":"_$$GET1^DIQ(9999999.06,$GET(ABMFLIST(ABMCNT)),.01,"E")
+5 SET ABMDIR=ABMDIR_$SELECT($DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMCNT))):" (FQHC/RHC/Tribal/Urban)",1:"")
+6 SET ABMDIR=ABMDIR_$SELECT($DATA(ABMF($GET(ABMFLIST(ABMCNT)))):" *",1:"")
+7 IF $DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMCNT)))
SET ABMFQHC=1
+8 IF '$DATA(^ABMMUPRM(1,1,"B",ABMFLIST(ABMCNT)))
SET ABMNFQHC=1
End DoDot:1
+9 ;get last entry#
SET ABMCNT=$ORDER(ABMFLIST(99999),-1)
+10 SET (ABMCNT,ABMTOT)=ABMCNT+1
+11 IF ((ABMFQHC=0&(ABMNFQHC=1))!((ABMFQHC=1)&(ABMNFQHC=0)))!(ABMCNT<2)
SET ABMDIR=ABMDIR_";"_ABMCNT_":All facilities"
+12 QUIT
PARTYR ;
+1 IF ABMY("RTYP")="SEL"!(ABMY("RTYP")="GRP")
Begin DoDot:1
+2 WRITE !!!,"For EPs, the Participation year is based on a calendar year;"
+3 WRITE !,"this is the same year that the EP would be demonstrating Meaningful"
+4 WRITE !,"Use. (Calendar year is January 1- December 31)"
End DoDot:1
+5 DO ^XBFMK
+6 SET DIR(0)="NA^1960:2030"
+7 SET DIR("A")="Enter the Participation year for this report: "
+8 IF ABMY("RTYP")="HOS"
SET DIR("A")="Enter the Participation Fiscal year for this report: "
+9 DO ^DIR
KILL DIR
+10 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+11 SET ABMY("PYR")=+Y
+12 SET ABMY("QYR")=ABMY("PYR")-1
+13 QUIT
90DAY ;
+1 DO 90DAY^ABMM2PP1
+2 QUIT
RFORMAT ;
+1 DO ^XBFMK
+2 ;abm*2.6*12
SET DIR(0)="S^S:Summary Report;P:Patient List"
+3 SET DIR("A",1)=""
+4 SET DIR("A")="Enter Report Format Choice"
+5 DO ^DIR
KILL DIR
+6 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+7 SET ABMY("RFMT")=$PIECE(Y,U)
+8 IF ABMY("RFMT")="A"
Begin DoDot:1
+9 DO ^XBFMK
+10 SET DIR(0)="N"
+11 SET DIR("A",1)=""
+12 SET DIR("A",2)="Specify the number of top volume dates to display if minimum thresholds are not met"
+13 SET DIR("A")="Enter Number (1-275)"
+14 DO ^DIR
KILL DIR
+15 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+16 SET ABMY("TVDTS")=+Y
End DoDot:1
+17 QUIT
SELINS ;EP
+1 WRITE !!!
+2 IF ABMY("RTYP")="HOS"
WRITE "EH"
+3 IF ABMY("RTYP")'="HOS"
WRITE "EP"
+4 WRITE " calculations can include any SCHIP visits that are part of a Medicaid"
+5 WRITE !,"expansion program. Visits for stand-alone SCHIP programs cannot be included"
+6 WRITE !,"in the calculation. The following list of insurers will be included unless"
+7 WRITE !,"otherwise specified."
+8 WRITE !,"A breakdown of categories will be provided."
+9 DO FINDINS
+10 IF '$DATA(ABMI)
WRITE !!,"No SCHIP insurers found"
QUIT
+11 DO WRTINS
+12 SET ABMFLG=0
+13 FOR
Begin DoDot:1
+14 SET ABMEDIT=""
+15 SET DIR(0)="SO^A:Add Additional SCHIP Payers;R:Remove SCHIP Payers from List;N:Do NOT count any SCHIP entries in the report"
+16 SET DIR("A")="Would you like to Add or Remove (A/R/N)"
+17 DO ^DIR
KILL DIR
+18 SET ABMEDIT=Y
+19 IF ABMEDIT=""
SET ABMFLG=1
QUIT
+20 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+21 IF ABMEDIT="N"
KILL ABMI
SET ABMFLG=1
QUIT
+22 IF ABMEDIT="A"!(ABMEDIT="R")
Begin DoDot:2
+23 IF ABMEDIT="A"
Begin DoDot:3
+24 SET ABMAFLG=0
+25 FOR
Begin DoDot:4
+26 DO ^XBFMK
+27 SET DIC="^AUTNINS("
+28 SET DIC(0)="QEAM"
+29 SET DIC("A")="Select Insurer: "
+30 ;only ityp K,P and can't add an insurer that's already on list
+31 SET DIC("S")="I (($$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,Y,"".211"",""I""),1,""I"")=""K"")!($$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,Y,"".211"",""I""),1,""I"")=""P""))&('$D(ABML(X)))"
+32 DO ^DIC
+33 SET ABMINS=+Y
+34 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)!(Y<0)
SET ABMAFLG=1
IF '$DATA(DIRUT)
WRITE !,"<NO ENTRY ADDED>"
QUIT
+35 SET ABMI("INS",ABMINS)=""
+36 SET ABMI(ABMCNT,ABMINS)=""
+37 SET ABMCNT=+$GET(ABMCNT)+1
+38 WRITE " <ADDED>"
End DoDot:4
IF ABMAFLG=1
QUIT
End DoDot:3
+39 IF ABMEDIT="R"
Begin DoDot:3
+40 SET ABMRFLG=0
+41 FOR
Begin DoDot:4
+42 DO WRTINS
+43 DO ^XBFMK
+44 SET DIR(0)="NO^1:"_(ABMCNT-1)
+45 SET DIR("A")="Remove which entry"
+46 DO ^DIR
KILL DIR
+47 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
SET ABMRFLG=1
IF '$DATA(DIRUT)
WRITE !,"<NO ENTRY REMOVED>"
QUIT
+48 SET ABMA=$ORDER(ABMI(X,0))
+49 KILL ABMI(X,ABMA)
+50 KILL ABML(ABMA)
+51 WRITE " <REMOVED>"
+52 DO RBINSLST
End DoDot:4
IF ABMRFLG=1
QUIT
End DoDot:3
End DoDot:2
End DoDot:1
IF ABMFLG=1
QUIT
+53 IF $DATA(ABMI)
DO WRTINS
+54 IF '$DATA(ABMI)
WRITE !!,"Insurers with SCHIP insurer type will not be included on this report"
+55 QUIT
RBINSLST ;EP
+1 SET ABMCNT1=0
SET ABMCNT2=1
+2 FOR
SET ABMCNT1=$ORDER(ABMI(ABMCNT1))
IF 'ABMCNT1
QUIT
Begin DoDot:1
+3 SET ABMX=0
+4 FOR
SET ABMX=$ORDER(ABMI(ABMCNT1,ABMX))
IF 'ABMX
QUIT
Begin DoDot:2
+5 SET ABMK(ABMCNT2,ABMX)=""
+6 SET ABMCNT2=ABMCNT2+1
End DoDot:2
End DoDot:1
+7 SET ABMCNT=ABMCNT2
+8 KILL ABMI
+9 MERGE ABMI=ABMK
+10 KILL ABMK
+11 SET ABMK=$ORDER(ABMI(99),-1)
+12 FOR ABM=1:1:ABMK
SET ABMI("INS",$ORDER(ABMI(ABM,0)))=""
+13 KILL ABMK
+14 QUIT
FINDINS ;EP
+1 SET ABMINS=0
+2 SET ABMCNT=1
+3 FOR
SET ABMINS=$ORDER(^AUTNINS(ABMINS))
IF 'ABMINS
QUIT
Begin DoDot:1
+4 IF $$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,+ABMINS,".211","I"),1,"I")'="K"
QUIT
+5 SET ABMI(ABMCNT,ABMINS)=""
+6 SET ABMI("INS",ABMINS)=""
+7 SET ABMCNT=+$GET(ABMCNT)+1
End DoDot:1
+8 QUIT
WRTINS ;EP
+1 WRITE !!,"Report will include the following insurers that hold the SCHIP Insurer Type:"
+2 SET ABMC=0
+3 FOR
SET ABMC=$ORDER(ABMI(ABMC))
IF 'ABMC
QUIT
Begin DoDot:1
+4 SET ABMINS=$ORDER(ABMI(ABMC,0))
+5 WRITE !?5,ABMC_". "_$$GET1^DIQ(9999999.18,ABMINS,".01","E")
End DoDot:1
+6 QUIT
SUMMARY ;
+1 DO SUMMARY^ABMM2PV6
+2 QUIT