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

APCM2AE6.m

Go to the documentation of this file.
APCM2AE6 ;IHS/CMI/LAB - IHS MU REPORT; 
 ;;1.0;MU PERFORMANCE REPORTS;**7,8**;MAR 26, 2012;Build 22
 ;
 ;
CALC(N,O) ;ENTRY POINT
 NEW Z
 S Z=N-O,Z=$FN(Z,"+,",1)
 Q Z
 ;
SB(X) ;EP - Strip 
 NEW %
 X ^DD("FUNC",$O(^DD("FUNC","B","STRIPBLANKS",0)),1)
 Q X
 ;
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)
 ;
CTR(X,Y) ;EP - Center X in a field Y wide.
 Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
 ;----------
EOP ;EP - End of page.
 Q:$E(IOST)'="C"
 Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
 NEW DIR
 K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
 S DIR(0)="E" D ^DIR
 Q
 ;----------
USR() ;EP - Return name .
 Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
 ;
SETN ;EP - set numerator fields
 S APCMCYN=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT) ;SPDX
 Q:$P(^APCM25OB(M,0),U,6)="A"  ;no % on attestation measures
 S APCMCYP=$S(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
 Q
 ;
V(T,R,N,P,PROV,K,RT) ;EP
 NEW X,Y,Z,I,J
 I RT=1 S I=PROV_";VA(200,"
 I RT=2 S I=PROV_";AUTTLOC("
 I T=1 D  Q X
 .S J=$O(^APCMM25C(R,11,"B",I,0))
 .I 'J S X=0 Q
 .S X=$P($G(^APCMM25C(R,11,J,N)),U,P)
 Q ""
W ;EP
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.014.EP" D PHI Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.010.EP" D CDS Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.001.EP" D CPOEM Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.001.1EP" D CPOEL Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.001.2EP" D CPOER Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.003.EP" D EPRES Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.023.EP" D SC Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.021.EP" D PTED Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.022.EP" D MEDREC^APCM2AE0 Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.020.EP" D PEA^APCM2AE0 Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" D SEM^APCM2AE0 Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.024.EP" D IMM^APCM2AE0 Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.025.EP" D SYN^APCM2AE0 Q
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.030.EP" D SR^APCM2AE0 Q
 ;
 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(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
PHI ;
 I APCMPTYP="P" D  Q
 .D W^APCM2AEH(" 1. Protect e-Health Info+",0,2,APCMPTYP)
 .;
 .S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
 .D W^APCM2AEH($P($G(^APCM25OB(APCMIC,12)),U,T),0,0,APCMPTYP,,35)
 .;
 .S M=APCMIC
 .D SETND
 .D WRATE
 .;
 .D WNUMDEN
 .;
 .D W^APCM2AEH("N/A",0,0,APCMPTYP,,71)
 .;
 .D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .S APCMX=$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"")
 .;
 .S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
 .S $P(APCMX,U,2)=$P($G(^APCM25OB(APCMIC,12)),U,T)
 .;
 .S M=APCMIC
 .D SETND
 .D WRATE
 .;
 .D WNUMDEN
 .;
 .S $P(APCMX,U,6)="N/A"
 .S $P(APCMX,U,7)="N/A"
 .D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
 Q
CDS ;
 I APCMPTYP="P" D  Q
 .D W^APCM2AEH(" 2. Clin Decision Support+",0,2,APCMPTYP)
 .D
 ..S M=$O(^APCM25OB("B","S2.010.EP.1",0))
 ..D W^APCM2AEH("    Imp 5 CDS 2016+",0,1,APCMPTYP)
 ..S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
 ..D W^APCM2AEH($P($G(^APCM25OB(M,12)),U,T),0,0,APCMPTYP,,35)
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D W^APCM2AEH("N/A",0,0,APCMPTYP,,71)
 ..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 .D W^APCM2AEH("    Drug Interaction Check+",0,1,APCMPTYP)
 .S M=$O(^APCM25OB("B","S2.010.EP.2",0))
 .S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
 .D W^APCM2AEH($P($G(^APCM25OB(M,12)),U,T),0,0,APCMPTYP,,35)
 .D SETND
 .D WRATE
 .D WNUMDEN
 .D WEXCL
 .D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .S APCMX="Clin Decision Support+" D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
 .D
 ..S M=$O(^APCM25OB("B","S2.010.EP.1",0))
 ..S APCMX="    Imp 5 CDS 2016+"
 ..S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
 ..S $P(APCMX,U,2)=$P($G(^APCM25OB(M,12)),U,T)
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..S $P(APCMX,U,6)="N/A"
 ..S $P(APCMX,U,7)="N/A"
 ..D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
 .S APCMX="    Drug Interaction Check+"
 .S M=$O(^APCM25OB("B","S2.010.EP.2",0))
 .S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
 .S $P(APCMX,U,2)=$P($G(^APCM25OB(M,12)),U,T)
 .D SETND
 .D WRATE
 .D WNUMDEN
 .D WEXCL
 .S $P(APCMX,U,7)="N/A"
 .D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
 Q
CPOEM ;
 I APCMPTYP="P" D
 .D
 ..S M=APCMIC
 ..D W^APCM2AEH(" 3. CPOE Medications 2016",0,2,APCMPTYP)
 ..S T=">60%"
 ..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D WEXCL
 ..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .D
 ..S M=APCMIC
 ..S APCMX="CPOE Medications 2016"
 ..S T=">60%"
 ..S $P(APCMX,U,2)=T
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D WEXCL
 ..S $P(APCMX,U,7)="N/A"
 ..D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
 Q
CPOEL ;
 I APCMPTYP="P" D
 .S M=APCMIC
 .D W^APCM2AEH("    CPOE Laboratory",0,1,APCMPTYP)
 .S T=">30%"
 .D W^APCM2AEH(T,0,0,APCMPTYP,,35)
 .D SETND
 .D WRATE
 .D WNUMDEN
 .D WEXCL
 .S I=$P(^APCM25OB(APCMIC,0),U,1)
 .D W^APCM2AEH($G(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .S M=APCMIC
 .S APCMX="CPOE Laboratory"
 .S T=">30%"
 .S $P(APCMX,U,2)=T
 .D SETND
 .D WRATE
 .D WNUMDEN
 .D WEXCL
 .S I=$P(^APCM25OB(APCMIC,0),U,1)
 .S $P(APCMX,U,7)=$G(APCMATTE(I,APCMPROV))
 .D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
 Q
CPOER ;
 I APCMPTYP="P" D
 .S M=APCMIC
 .D W^APCM2AEH("    CPOE Radiology",0,1,APCMPTYP)
 .S T=">30%"
 .D W^APCM2AEH(T,0,0,APCMPTYP,,35)
 .D SETND
 .D WRATE
 .D WNUMDEN
 .D WEXCL
 .S I=$P(^APCM25OB(APCMIC,0),U,1)
 .D W^APCM2AEH($G(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .S M=APCMIC
 .S APCMX="CPOE Radiology"
 .S T=">30%"
 .S $P(APCMX,U,2)=T
 .D SETND
 .D WRATE
 .D WNUMDEN
 .D WEXCL
 .S I=$P(^APCM25OB(APCMIC,0),U,1)
 .S $P(APCMX,U,7)=$G(APCMATTE(I,APCMPROV))
 .D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
 Q
EPRES ;
 I APCMPTYP="P" D
 .D
 ..S M=APCMIC
 ..D W^APCM2AEH(" 4. e-Prescribe (e-Rx) 2016",0,2,APCMPTYP)
 ..S T=">50%"
 ..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D WEXCL
 ..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .D
 ..S M=APCMIC
 ..S APCMX="e-Prescribe (e-Rx) 2016"
 ..S T=">50%"
 ..S $P(APCMX,U,2)=T
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D WEXCL
 ..S $P(APCMX,U,7)="N/A"
 ..D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
 Q
SC ;summary of care
 I APCMPTYP="P" D
 .D
 ..S M=APCMIC
 ..D W^APCM2AEH(" 5. Sum of Care (HIE) 2016",0,2,APCMPTYP)
 ..S T=">10%"
 ..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D WEXCL
 ..S I=$P(^APCM25OB(APCMIC,0),U,1)
 ..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .D
 ..S M=APCMIC
 ..S APCMX="Sum of Care (HIE) 2016"
 ..S T=">10%"
 ..S $P(APCMX,U,2)=T
 ..D SETND
 ..D WRATE
 ..D WNUMDEN
 ..D WEXCL
 ..S I=$P(^APCM25OB(APCMIC,0),U,1)
 ..S $P(APCMX,U,7)="N/A"
 ..D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
 Q
PTED ;
 I APCMPTYP="P" D
 .D
 ..S M=APCMIC
 ..D W^APCM2AEH(" 6. Patient Education 2016",0,2,APCMPTYP)
 ..;
 ..S T=">10%"
 ..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
 ..;
 ..D SETND
 ..D WRATE
 ..;
 ..D WNUMDEN
 ..;
 ..D WEXCL
 ..;
 ..S I=$P(^APCM25OB(APCMIC,0),U,1)
 ..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
 I APCMPTYP="D" D
 .D
 ..S M=APCMIC
 ..S APCMX="Patient Education 2016"
 ..;
 ..S T=">10%"
 ..S $P(APCMX,U,2)=T
 ..;
 ..D SETND
 ..D WRATE
 ..;
 ..D WNUMDEN
 ..;
 ..D WEXCL
 ..;
 ..S I=$P(^APCM25OB(APCMIC,0),U,1)
 ..S $P(APCMX,U,7)="N/A"
 ..D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
 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(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,,71)
 .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,,71)
 .S $P(APCMX,U,6)="N/A"
 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,,40)
 .I $P(^APCM25OB(M,0),U,6)'="A" D W^APCM2AEH($J(APCMCYP,8,2)_"%",0,0,APCMPTYP,,40)
 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,,51)
 .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,,61)
 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