APCM25EA ; IHS/CMI/LAB - IHS MU ;
;;1.0;MU PERFORMANCE REPORTS;**7,8,10**;MAR 26, 2012;Build 31
;
ET ;
W ! S APCMZ=0 F S APCMZ=$O(^APCM25OB(APCMY,N,APCMZ)) Q:APCMZ'=+APCMZ W !,^APCM25OB(APCMY,N,APCMZ,0)
W !
Q
SS ;EP
Q
SSH ;EP
Q
IMMREG ;EP - ask additional exclusion questions for IMM REG
S APCMQ=0
S APCMY=$O(^APCM25OB("B",APCMX,0))
Q:'$D(APCMIND(APCMY)) ;measure not being run
;display exclusion text/narrative
I $O(^APCM25OB(APCMY,19,0)) S N=19 W !! D ET
I APCMPLTY="SEL"!(APCMPLTY="TAX") D G:APCMIND=1 IMMIND Q
.W !!,"Do all selected providers included in this report meet this"
.S DIR(0)="Y",DIR("A")="exclusion",DIR("B")="YES" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1 Q
.I 'Y S APCMIND=1 Q
.S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP S APCMATTE(APCMX,APCMP)="N/A"
IMMIND ;ask individually
S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP!(APCMQ) D
.S APCMZ=0 F S APCMZ=$O(^APCM25OB(APCMY,24,APCMZ)) Q:APCMZ'=+APCMZ W !,^APCM25OB(APCMY,24,APCMZ,0)
.W ! S DIR(0)="Y",DIR("A")="Does "_$E($P(^VA(200,APCMP,0),U,1),1,25)_" meet this exclusion",DIR("B")="YES" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1 Q
.S APCMATTE(APCMX,APCMP)=$S(Y:"N/A",1:"")
IMM2 ;display exclusion text/narrative
S APCMP=0,E=0,T=0 F S APCMP=$O(APCMATTE(APCMX,APCMP)) Q:APCMP=""!(APCMQ) D
.S T=T+1
.I APCMATTE(APCMX,APCMP)="N/A" S E=E+1 ;excluded so don't ask
I E=T Q ;all excluded
I $O(^APCM25OB(APCMY,31,0)) S N=31 W !! D ET
;
IMMIND2 ;ask individually
S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP!(APCMQ) D
.Q:APCMATTE(APCMX,APCMP)="N/A" ;excluded
.W ! S DIR(0)="Y",DIR("A")="Does "_$E($P(^VA(200,APCMP,0),U,1),1,25)_" attest to this",DIR("B")="YES" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1 Q
.S APCMATTE(APCMX,APCMP)=$S(Y:"Yes",1:"No")
Q
SPECREG ;EP
Q
IMMREGH ;EP - ask additional exclusion questions for IMM REG
S APCMQ=0
S APCMY=$O(^APCM25OB("B",APCMX,0))
Q:'$D(APCMIND(APCMY)) ;measure not being run
;display exclusion text/narrative
I $O(^APCM25OB(APCMY,19,0)) S N=19 W !! D ET
;ask individually
S APCMP=APCMFAC D
.S APCMZ=0 F S APCMZ=$O(^APCM25OB(APCMY,24,APCMZ)) Q:APCMZ'=+APCMZ W !,^APCM25OB(APCMY,24,APCMZ,0)
.W ! S DIR(0)="Y",DIR("A")="Does "_$E($P(^DIC(4,APCMP,0),U,1),1,25)_" meet this exclusion"
.S DIR("B")="YES"
.I $P(^APCM25OB(APCMY,0),U,1)="S2.025.H.1" S DIR("B")="NO"
.KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1 Q
.S APCMATTE(APCMX,APCMP)=$S(Y:"N/A",1:"")
IMMH2 ;display exclusion text/narrative
S APCMP=0,E=0,T=0 F S APCMP=$O(APCMATTE(APCMX,APCMP)) Q:APCMP=""!(APCMQ) D
.S T=T+1
.I APCMATTE(APCMX,APCMP)="N/A" S E=E+1 ;excluded so don't ask
I E=T Q ;all excluded
I $O(^APCM25OB(APCMY,31,0)) S N=31 W !! D ET
;
IMMINDH2 ;ask individually
S APCMP=APCMFAC D
.Q:APCMATTE(APCMX,APCMP)="N/A" ;excluded
.W ! S DIR(0)="Y",DIR("A")="Does "_$E($P(^DIC(4,APCMP,0),U,1),1,25)_" attest to this",DIR("B")="YES" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1 Q
.S APCMATTE(APCMX,APCMP)=$S(Y:"Yes",1:"No")
Q
;
C(X,X2,X3) ;
S X3=""
I X'?.N Q $$LBLK^APCLUTL(X,7)
D COMMA^%DTC
S X=$$STRIP^XLFSTR(X," ")
Q $$LBLK^APCLUTL(X,7)
SEM ;EP - PRINT OUT SEM
;W !!,"measure being worked on...will let you know when it is done." Q
;write label
I APCMPTYP="P" D
.;F X=1,2,3,4 D
.S Y=$E(APCMPER,1,3)
.S X=$S(Y=315:1,Y=316:2,Y=317:3,Y=318:4,1:9)
.D
..S M=APCMIC
..I X=1 D W^APCM2AEH(" 9. Secure Messaging 2015+",0,2,APCMPTYP)
..I X>1 D W^APCM2AEH(" 9. Secure Messaging",0,2,APCMPTYP)
..;TARGET
..I X=2 S T=">=1"
..I X=1 S T="Yes"
..I X=3 S T=">5%"
..I X>3 S T=">5%"
..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
..;RATE
..I X=1 D SETND^APCM2AER
..I X=1 D W^APCM2AEH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,40)
..I X=2 D
...S (APCMCYN,APCMCYD,APCMCYP)=0
...S APCMDF=31.02,APCMNF=31.01 D SETND
...D W^APCM2AEH($$C(APCMCYN,0,9),0,0,APCMPTYP,,40) ;RATE IS NUMERATOR
..I X=3 D
...S (APCMCYN,APCMCYD,APCMCYP)=0
...S APCMDF=31.04,APCMNF=31.03 D SETND
...D WRATE
..I X>3 D
...S (APCMCYN,APCMCYD,APCMCYP)=0
...S APCMDF=31.06,APCMNF=31.05 D SETND
...D WRATE
..;NUM/DEN
..I X=1 W ?55," N/A",?65," N/A"
..I X=2!(X=3)!(X>3) D WNUMDEN
..;EXCL
..D WEXCL
.Q:'APCMSEME
.D W^APCM25EH("Note: PHR Server access failed during report generation "_$P(APCMSEME,U,2)_" which may",0,1,APCMPTYP,,0)
.D W^APCM25EH("have affected the numerator results for this measure. Contact your IT staff to",0,1,APCMPTYP,,0)
.D W^APCM25EH("resolve the error and then regenerate the report again to obtain accurate",0,1,APCMPTYP,,0)
.D W^APCM25EH("results.",0,1,APCMPTYP,,0)
I APCMPTYP="D" D
.;F X=1,2,3,4 D
.S Y=$E(APCMPER,1,3)
.S X=$S(Y=315:1,Y=316:2,Y=317:3,Y=318:4,1:9)
.D
..S M=APCMIC
..I X=1 S APCMX="Secure Messaging 2015+"
..I X>1 S APCMX="Secure Messaging "
..;TARGET
..I X=2 S T=">=1"
..I X=1 S T="Yes"
..I X>2 S T=">5%"
..S $P(APCMX,U,2)=T
..;RATE
..I X=1 D SETND^APCM2AER S $P(APCMX,U,3)=APCMCYD
..I X=2 D
...S (APCMCYN,APCMCYD,APCMCYP)=0
...S APCMDF=31.02,APCMNF=31.01 D SETND
...S $P(APCMX,U,3)=APCMCYN ;RATE IS NUMERATOR
..I X=3 D
...S (APCMCYN,APCMCYD,APCMCYP)=0
...S APCMDF=31.04,APCMNF=31.03 D SETND
...S $P(APCMX,U,3)=$$SB^APCM25ER($J(APCMCYP,8,2))_"%"
..I X>3 D
...S (APCMCYN,APCMCYD,APCMCYP)=0
...S APCMDF=31.06,APCMNF=31.05 D SETND
...S $P(APCMX,U,3)=$$SB^APCM25ER($J(APCMCYP,8,2))_"%"
..;NUM/DEN
..I X=1 S $P(APCMX,U,4)="N/A",$P(APCMX,U,5)="N/A"
..I X=2!(X=3)!(X>3) D WNUMDEN
..D WEXCL
..I X=2!(X=3)!(X>3) D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
..I X=1 D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
.Q:'APCMSEME
.D W^APCM25EH("Note: PHR Server access failed during report generation "_$P(APCMSEME,U,2)_" which may",0,1,APCMPTYP,1)
.D W^APCM25EH("have affected the numerator results for this measure. Contact your IT staff to",0,1,APCMPTYP,1)
.D W^APCM25EH("resolve the error and then regenerate the report again to obtain accurate results.",0,1,APCMPTYP,1)
Q
SETND ;
;S APCMDF=$P(^APCM25OB(M,0),U,8)
S APCMNP=$P(^DD(9001304.0311,APCMDF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
S APCMCYD=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
I $P(^APCM25OB(M,0),U,6)="A" S (APCMPRN,APCMCYN)="" Q
;S APCMNF=$P(^APCM25OB(M,0),U,9) ;numerator field
S APCMNP=$P(^DD(9001304.0311,APCMNF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
D SETN
Q
SETN ;EP - set numerator fields
S APCMCYN=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT) ;SPDX
Q:$P(^APCM25OB(APCMIC,0),U,6)="A" ;no % on attestation measures
S APCMCYP=$S(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
Q
WRATE ;
I APCMPTYP="P" D Q
.I $P(^APCM25OB(M,0),U,6)="A" D W^APCM2AEH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
.I $P(^APCM25OB(M,0),U,6)'="A" D W^APCM2AEH($J(APCMCYP,8,2)_"%",0,0,APCMPTYP,,42)
I $P(^APCM25OB(M,0),U,6)="A" S $P(APCMX,U,3)=$S(APCMCYD]"":APCMCYD,1:"N/A")
I $P(^APCM25OB(M,0),U,6)'="A" S $P(APCMX,U,3)=$S($P(^APCM25OB(M,0),U,6)="A":"N/A",1:$J(APCMCYP,8,2)_"%")
Q
WNUMDEN ;
I APCMPTYP="P" D Q
.D W^APCM2AEH($S($P(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
.D W^APCM2AEH($S($P(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
S $P(APCMX,U,4)=$S($P(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYN)
S $P(APCMX,U,5)=$S($P(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYD)
Q
WEXCL ;
S APCMEF=$P(^APCM25OB(M,0),U,11)
I APCMEF]"" D
.S APCMNP=$P(^DD(9001304.0311,APCMEF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
.S APCMEV=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
.I APCMPTYP="P" D W^APCM25EH($S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
.I APCMPTYP="D" S $P(APCMX,U,6)=$S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No")
I APCMEF="" D
.I APCMPTYP="P" D W^APCM25EH("N/A",0,0,APCMPTYP,,76)
.S $P(APCMX,U,6)="N/A"
Q
APCM25EA ; IHS/CMI/LAB - IHS MU ;
+1 ;;1.0;MU PERFORMANCE REPORTS;**7,8,10**;MAR 26, 2012;Build 31
+2 ;
ET ;
+1 WRITE !
SET APCMZ=0
FOR
SET APCMZ=$ORDER(^APCM25OB(APCMY,N,APCMZ))
IF APCMZ'=+APCMZ
QUIT
WRITE !,^APCM25OB(APCMY,N,APCMZ,0)
+2 WRITE !
+3 QUIT
SS ;EP
+1 QUIT
SSH ;EP
+1 QUIT
IMMREG ;EP - ask additional exclusion questions for IMM REG
+1 SET APCMQ=0
+2 SET APCMY=$ORDER(^APCM25OB("B",APCMX,0))
+3 ;measure not being run
IF '$DATA(APCMIND(APCMY))
QUIT
+4 ;display exclusion text/narrative
+5 IF $ORDER(^APCM25OB(APCMY,19,0))
SET N=19
WRITE !!
DO ET
+6 IF APCMPLTY="SEL"!(APCMPLTY="TAX")
Begin DoDot:1
+7 WRITE !!,"Do all selected providers included in this report meet this"
+8 SET DIR(0)="Y"
SET DIR("A")="exclusion"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+9 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+10 IF 'Y
SET APCMIND=1
QUIT
+11 SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
SET APCMATTE(APCMX,APCMP)="N/A"
End DoDot:1
IF APCMIND=1
GOTO IMMIND
QUIT
IMMIND ;ask individually
+1 SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP!(APCMQ)
QUIT
Begin DoDot:1
+2 SET APCMZ=0
FOR
SET APCMZ=$ORDER(^APCM25OB(APCMY,24,APCMZ))
IF APCMZ'=+APCMZ
QUIT
WRITE !,^APCM25OB(APCMY,24,APCMZ,0)
+3 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Does "_$EXTRACT($PIECE(^VA(200,APCMP,0),U,1),1,25)_" meet this exclusion"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+5 SET APCMATTE(APCMX,APCMP)=$SELECT(Y:"N/A",1:"")
End DoDot:1
IMM2 ;display exclusion text/narrative
+1 SET APCMP=0
SET E=0
SET T=0
FOR
SET APCMP=$ORDER(APCMATTE(APCMX,APCMP))
IF APCMP=""!(APCMQ)
QUIT
Begin DoDot:1
+2 SET T=T+1
+3 ;excluded so don't ask
IF APCMATTE(APCMX,APCMP)="N/A"
SET E=E+1
End DoDot:1
+4 ;all excluded
IF E=T
QUIT
+5 IF $ORDER(^APCM25OB(APCMY,31,0))
SET N=31
WRITE !!
DO ET
+6 ;
IMMIND2 ;ask individually
+1 SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP!(APCMQ)
QUIT
Begin DoDot:1
+2 ;excluded
IF APCMATTE(APCMX,APCMP)="N/A"
QUIT
+3 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Does "_$EXTRACT($PIECE(^VA(200,APCMP,0),U,1),1,25)_" attest to this"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+5 SET APCMATTE(APCMX,APCMP)=$SELECT(Y:"Yes",1:"No")
End DoDot:1
+6 QUIT
SPECREG ;EP
+1 QUIT
IMMREGH ;EP - ask additional exclusion questions for IMM REG
+1 SET APCMQ=0
+2 SET APCMY=$ORDER(^APCM25OB("B",APCMX,0))
+3 ;measure not being run
IF '$DATA(APCMIND(APCMY))
QUIT
+4 ;display exclusion text/narrative
+5 IF $ORDER(^APCM25OB(APCMY,19,0))
SET N=19
WRITE !!
DO ET
+6 ;ask individually
+7 SET APCMP=APCMFAC
Begin DoDot:1
+8 SET APCMZ=0
FOR
SET APCMZ=$ORDER(^APCM25OB(APCMY,24,APCMZ))
IF APCMZ'=+APCMZ
QUIT
WRITE !,^APCM25OB(APCMY,24,APCMZ,0)
+9 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Does "_$EXTRACT($PIECE(^DIC(4,APCMP,0),U,1),1,25)_" meet this exclusion"
+10 SET DIR("B")="YES"
+11 IF $PIECE(^APCM25OB(APCMY,0),U,1)="S2.025.H.1"
SET DIR("B")="NO"
+12 KILL DA
DO ^DIR
KILL DIR
+13 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+14 SET APCMATTE(APCMX,APCMP)=$SELECT(Y:"N/A",1:"")
End DoDot:1
IMMH2 ;display exclusion text/narrative
+1 SET APCMP=0
SET E=0
SET T=0
FOR
SET APCMP=$ORDER(APCMATTE(APCMX,APCMP))
IF APCMP=""!(APCMQ)
QUIT
Begin DoDot:1
+2 SET T=T+1
+3 ;excluded so don't ask
IF APCMATTE(APCMX,APCMP)="N/A"
SET E=E+1
End DoDot:1
+4 ;all excluded
IF E=T
QUIT
+5 IF $ORDER(^APCM25OB(APCMY,31,0))
SET N=31
WRITE !!
DO ET
+6 ;
IMMINDH2 ;ask individually
+1 SET APCMP=APCMFAC
Begin DoDot:1
+2 ;excluded
IF APCMATTE(APCMX,APCMP)="N/A"
QUIT
+3 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Does "_$EXTRACT($PIECE(^DIC(4,APCMP,0),U,1),1,25)_" attest to this"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+5 SET APCMATTE(APCMX,APCMP)=$SELECT(Y:"Yes",1:"No")
End DoDot:1
+6 QUIT
+7 ;
C(X,X2,X3) ;
+1 SET X3=""
+2 IF X'?.N
QUIT $$LBLK^APCLUTL(X,7)
+3 DO COMMA^%DTC
+4 SET X=$$STRIP^XLFSTR(X," ")
+5 QUIT $$LBLK^APCLUTL(X,7)
SEM ;EP - PRINT OUT SEM
+1 ;W !!,"measure being worked on...will let you know when it is done." Q
+2 ;write label
+3 IF APCMPTYP="P"
Begin DoDot:1
+4 ;F X=1,2,3,4 D
+5 SET Y=$EXTRACT(APCMPER,1,3)
+6 SET X=$SELECT(Y=315:1,Y=316:2,Y=317:3,Y=318:4,1:9)
+7 Begin DoDot:2
+8 SET M=APCMIC
+9 IF X=1
DO W^APCM2AEH(" 9. Secure Messaging 2015+",0,2,APCMPTYP)
+10 IF X>1
DO W^APCM2AEH(" 9. Secure Messaging",0,2,APCMPTYP)
+11 ;TARGET
+12 IF X=2
SET T=">=1"
+13 IF X=1
SET T="Yes"
+14 IF X=3
SET T=">5%"
+15 IF X>3
SET T=">5%"
+16 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+17 ;RATE
+18 IF X=1
DO SETND^APCM2AER
+19 IF X=1
DO W^APCM2AEH($SELECT(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,40)
+20 IF X=2
Begin DoDot:3
+21 SET (APCMCYN,APCMCYD,APCMCYP)=0
+22 SET APCMDF=31.02
SET APCMNF=31.01
DO SETND
+23 ;RATE IS NUMERATOR
DO W^APCM2AEH($$C(APCMCYN,0,9),0,0,APCMPTYP,,40)
End DoDot:3
+24 IF X=3
Begin DoDot:3
+25 SET (APCMCYN,APCMCYD,APCMCYP)=0
+26 SET APCMDF=31.04
SET APCMNF=31.03
DO SETND
+27 DO WRATE
End DoDot:3
+28 IF X>3
Begin DoDot:3
+29 SET (APCMCYN,APCMCYD,APCMCYP)=0
+30 SET APCMDF=31.06
SET APCMNF=31.05
DO SETND
+31 DO WRATE
End DoDot:3
+32 ;NUM/DEN
+33 IF X=1
WRITE ?55," N/A",?65," N/A"
+34 IF X=2!(X=3)!(X>3)
DO WNUMDEN
+35 ;EXCL
+36 DO WEXCL
End DoDot:2
+37 IF 'APCMSEME
QUIT
+38 DO W^APCM25EH("Note: PHR Server access failed during report generation "_$PIECE(APCMSEME,U,2)_" which may",0,1,APCMPTYP,,0)
+39 DO W^APCM25EH("have affected the numerator results for this measure. Contact your IT staff to",0,1,APCMPTYP,,0)
+40 DO W^APCM25EH("resolve the error and then regenerate the report again to obtain accurate",0,1,APCMPTYP,,0)
+41 DO W^APCM25EH("results.",0,1,APCMPTYP,,0)
End DoDot:1
+42 IF APCMPTYP="D"
Begin DoDot:1
+43 ;F X=1,2,3,4 D
+44 SET Y=$EXTRACT(APCMPER,1,3)
+45 SET X=$SELECT(Y=315:1,Y=316:2,Y=317:3,Y=318:4,1:9)
+46 Begin DoDot:2
+47 SET M=APCMIC
+48 IF X=1
SET APCMX="Secure Messaging 2015+"
+49 IF X>1
SET APCMX="Secure Messaging "
+50 ;TARGET
+51 IF X=2
SET T=">=1"
+52 IF X=1
SET T="Yes"
+53 IF X>2
SET T=">5%"
+54 SET $PIECE(APCMX,U,2)=T
+55 ;RATE
+56 IF X=1
DO SETND^APCM2AER
SET $PIECE(APCMX,U,3)=APCMCYD
+57 IF X=2
Begin DoDot:3
+58 SET (APCMCYN,APCMCYD,APCMCYP)=0
+59 SET APCMDF=31.02
SET APCMNF=31.01
DO SETND
+60 ;RATE IS NUMERATOR
SET $PIECE(APCMX,U,3)=APCMCYN
End DoDot:3
+61 IF X=3
Begin DoDot:3
+62 SET (APCMCYN,APCMCYD,APCMCYP)=0
+63 SET APCMDF=31.04
SET APCMNF=31.03
DO SETND
+64 SET $PIECE(APCMX,U,3)=$$SB^APCM25ER($JUSTIFY(APCMCYP,8,2))_"%"
End DoDot:3
+65 IF X>3
Begin DoDot:3
+66 SET (APCMCYN,APCMCYD,APCMCYP)=0
+67 SET APCMDF=31.06
SET APCMNF=31.05
DO SETND
+68 SET $PIECE(APCMX,U,3)=$$SB^APCM25ER($JUSTIFY(APCMCYP,8,2))_"%"
End DoDot:3
+69 ;NUM/DEN
+70 IF X=1
SET $PIECE(APCMX,U,4)="N/A"
SET $PIECE(APCMX,U,5)="N/A"
+71 IF X=2!(X=3)!(X>3)
DO WNUMDEN
+72 DO WEXCL
+73 IF X=2!(X=3)!(X>3)
DO W^APCM25EH(APCMX,0,2,APCMPTYP,1)
+74 IF X=1
DO W^APCM25EH(APCMX,0,2,APCMPTYP,1)
End DoDot:2
+75 IF 'APCMSEME
QUIT
+76 DO W^APCM25EH("Note: PHR Server access failed during report generation "_$PIECE(APCMSEME,U,2)_" which may",0,1,APCMPTYP,1)
+77 DO W^APCM25EH("have affected the numerator results for this measure. Contact your IT staff to",0,1,APCMPTYP,1)
+78 DO W^APCM25EH("resolve the error and then regenerate the report again to obtain accurate results.",0,1,APCMPTYP,1)
End DoDot:1
+79 QUIT
SETND ;
+1 ;S APCMDF=$P(^APCM25OB(M,0),U,8)
+2 SET APCMNP=$PIECE(^DD(9001304.0311,APCMDF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+3 SET APCMCYD=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+4 IF $PIECE(^APCM25OB(M,0),U,6)="A"
SET (APCMPRN,APCMCYN)=""
QUIT
+5 ;S APCMNF=$P(^APCM25OB(M,0),U,9) ;numerator field
+6 SET APCMNP=$PIECE(^DD(9001304.0311,APCMNF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+7 DO SETN
+8 QUIT
SETN ;EP - set numerator fields
+1 ;SPDX
SET APCMCYN=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+2 ;no % on attestation measures
IF $PIECE(^APCM25OB(APCMIC,0),U,6)="A"
QUIT
+3 SET APCMCYP=$SELECT(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
+4 QUIT
WRATE ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 IF $PIECE(^APCM25OB(M,0),U,6)="A"
DO W^APCM2AEH($SELECT(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
+3 IF $PIECE(^APCM25OB(M,0),U,6)'="A"
DO W^APCM2AEH($JUSTIFY(APCMCYP,8,2)_"%",0,0,APCMPTYP,,42)
End DoDot:1
QUIT
+4 IF $PIECE(^APCM25OB(M,0),U,6)="A"
SET $PIECE(APCMX,U,3)=$SELECT(APCMCYD]"":APCMCYD,1:"N/A")
+5 IF $PIECE(^APCM25OB(M,0),U,6)'="A"
SET $PIECE(APCMX,U,3)=$SELECT($PIECE(^APCM25OB(M,0),U,6)="A":"N/A",1:$JUSTIFY(APCMCYP,8,2)_"%")
+6 QUIT
WNUMDEN ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 DO W^APCM2AEH($SELECT($PIECE(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
+3 DO W^APCM2AEH($SELECT($PIECE(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
End DoDot:1
QUIT
+4 SET $PIECE(APCMX,U,4)=$SELECT($PIECE(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYN)
+5 SET $PIECE(APCMX,U,5)=$SELECT($PIECE(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYD)
+6 QUIT
WEXCL ;
+1 SET APCMEF=$PIECE(^APCM25OB(M,0),U,11)
+2 IF APCMEF]""
Begin DoDot:1
+3 SET APCMNP=$PIECE(^DD(9001304.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+4 SET APCMEV=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+5 IF APCMPTYP="P"
DO W^APCM25EH($SELECT(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
+6 IF APCMPTYP="D"
SET $PIECE(APCMX,U,6)=$SELECT(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No")
End DoDot:1
+7 IF APCMEF=""
Begin DoDot:1
+8 IF APCMPTYP="P"
DO W^APCM25EH("N/A",0,0,APCMPTYP,,76)
+9 SET $PIECE(APCMX,U,6)="N/A"
End DoDot:1
+10 QUIT