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

ABMM2PVP.m

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