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

APCM25E3.m

Go to the documentation of this file.
APCM25E3 ; IHS/CMI/LAB - IHS MU ;
 ;;1.0;MU PERFORMANCE REPORTS;**7**;MAR 26, 2012;Build 15
 ;;;;;;Build 3
DDA ;EP - CALCULATE DRUG INTERACTION CHECK MEASURE
 S F=$P(^APCM14OB(APCMIC,0),U,8)
 ;PER Chris Saddler check whole system for each provider
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.002.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.002.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
CDS ;EP - CALCULATE CDA MEASURE
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .S I=$P(^APCM25OB(APCMIC,0),U,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE(I,APCMP),APCMP,APCMRPTT,APCMTIME,F)
 .Q:$P(^APCM25OB(APCMIC,0),U,1)="S2.010.EP.1"
 .I $D(APCM100R(APCMP,APCMTIME)) S G=$P(^APCM25OB(APCMIC,0),U,11) D S^APCM25E1(APCMRPT,APCMIC,"<100",APCMP,APCMRPTT,APCMTIME,G,1)
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .S I=$P(^APCM25OB(APCMIC,0),U,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE(I,APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 .;Q:$P(^APCM25OB(APCMIC,0),U,1)="S2.010.H.1"
 .;I $D(APCM100R(APCMP,APCMTIME)) S G=$P(^APCM25OB(APCMIC,0),U,11) D S^APCM25E1(APCMRPT,APCMIC,"<100",APCMP,APCMRPTT,APCMTIME,G,1)
 Q
EKC ;EP - CALCULATE EKC MEASURE
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.013.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.012.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
PS ;EP - CALCULATE PS MEASURE
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .S V=$P(APCMATTE("S2.014.EP",APCMP),U,1)
 .D S^APCM25E1(APCMRPT,APCMIC,V,APCMP,APCMRPTT,APCMTIME,F)
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .S V=$P(APCMATTE("S2.013.H",APCMP),U,1) ;,B=$P(APCMATTE("S2.013.H",APCMP),U,2)
 .D S^APCM25E1(APCMRPT,APCMIC,V,APCMP,APCMRPTT,APCMTIME,F) Q
 Q
CQM ;EP - CALCULATE CQM MEASURE
 NEW APCMV
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .S APCMEP=$$INSTALLD("BGP*11.0*2")
 .I APCMEP="Yes",APCMATTE("S2.015.EP",APCMP)="Yes" S APCMV="Yes"
 .E  S APCMV="No"
 .D S^APCM25E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .S APCMEP=$$INSTALLD("BGP*11.0*3")
 .I APCMEP="Yes",APCMATTE("S2.014.H",APCMP)="Yes" S APCMV="Yes"
 .E  S APCMV="No"
 .D S^APCM25E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F) Q
 Q
DFC ;EP - CALCULATE DFC MEASURE
 ;always a yes
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .I $D(APCM100R(APCMP,APCMTIME)) S F=$P(^APCM25OB(APCMIC,0),U,11) D S^APCM25E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had < 100 prescriptions issued during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8) D S^APCM25E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .S F=$P(^APCM25OB(APCMIC,0),U,8) D S^APCM25E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F) Q
 Q
PL ;EP - CALCULATE EKC MEASURE
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.018.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.018.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
IR ;EP - CALCULATE IMM REG OBJECTIVE
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .I APCMATTE("S2.024.EP",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D  Q
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
 .I $D(APCMIMME(APCMP,APCMTIME)) S F=$P(^APCM25OB(APCMIC,0),U,11) D  Q
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO IMM",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8) D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.024.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .I APCMATTE("S2.022.H",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
 .I $D(APCMIMME(APCMP,APCMTIME)) S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO IMM",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8) D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.022.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
SS ;EP - SYNDROMIC SURV
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .I APCMATTE("S2.025.EP",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.025.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .I APCMATTE("S2.024.H",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"Hospital/CAH is excluded from this measure as it has no registry to send syndromic surveillance data to.",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
SR ;EP - SPEC REG
 I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 .I APCMATTE("S2.030.EP",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.030.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .I APCMATTE("S2.024.H",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"Hospital/CAH is excluded from this measure as it has no registry to send syndromic surveillance data to.",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
SLR ;EP - CALCULATE CDA MEASURE
 S F=$P(^APCM25OB(APCMIC,0),U,8)
 ;I APCMRPTT=1 S APCMP=0 F  S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP  D
 ;.D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 I APCMRPTT=2 S APCMP=APCMFAC  D
 .I APCMATTE("S2.023.H",APCMP)="N/A" S F=$P(^APCM25OB(APCMIC,0),U,11) D
 ..D S^APCM25E1(APCMRPT,APCMIC,"NO PLACE TO SEND esults to.",APCMP,APCMRPTT,APCMTIME,F,1)
 .S F=$P(^APCM25OB(APCMIC,0),U,8)
 .D S^APCM25E1(APCMRPT,APCMIC,APCMATTE("S2.023.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
 Q
INSTALLD(APCMSTAL) ;EP - Determine if patch APCMSTAL was installed, where
 ; APCLSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 ;
 NEW APCMY,DIC,X,Y
 S X=$P(APCMSTAL,"*",1)
 S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
 D IX^DIC
 I Y<1 Q 0
 S DIC=DIC_+Y_",22,",X=$P(APCMSTAL,"*",2)
 D ^DIC
 I Y<1 Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(APCMSTAL,"*",3)
 D ^DIC
 S APCMY=Y
 Q $S(APCMY<1:"No",1:"Yes")
OCPARA() ;EP
 NEW VALUE,X,Y,Z,ORK
 S VALUE=""
 S (X,Y,Z)=""
 ;first check ORK SYSTEM ENABLE/DISABLE to see that it is Enabled
 S X=$$GET^XPAR("SYS","ORK SYSTEM ENABLE/DISABLE")
 I X'="E" Q "No^ORK SYSTEM ENABLE/DISABLE NOT ENABLED FOR SYSTEM"  ;SYSTEM IS NOT CONFIGURED SO MEASURE NOT MET
 ;check for "DIV"
 S X=$$GET^XPAR("DIV","ORK SYSTEM ENABLE/DISABLE")
 I X="D" Q "No^ORK SYSTEM ENABLE/DISABLE SET TO DISABLED FOR DIVISION"
 ;now check system for ORK EDITABLE BY USER for the 9 items
 F Z=1:1:9 S Y=$T(PAR9+Z) S O=$P(Y,";;",2) S X=$$GET^XPAR("SYS","ORK EDITABLE BY USER",O,"E") I X'="NO" S VALUE=VALUE_"ORK EDITABLE BY USER NOT SET TO NO FOR SYSTEM FOR "_O_" ;"
 ;now check division for ORK EDITABLE BY USER for the 9 items, it can't say "Y"
 F Z=1:1:9 S Y=$T(PAR9+Z) S O=$P(Y,";;",2) S X=$$GET^XPAR("DIV","ORK EDITABLE BY USER",O,"E") I X="YES" S VALUE=VALUE_"ORK EDITABLE BY USER SET TO YES FOR DIVISION FOR "_O_" ;"
 ;now check ORK PROCESSING FLAG for system for the 9 items
 F Z=1:1:9 S Y=$T(PAR9+Z) S O=$P(Y,";;",2) S X=$$GET^XPAR("SYS","ORK PROCESSING FLAG",O) I X'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR SYSTEM FOR "_O_" ;"
 ;now loop through the parameter file for ORK processing flag, look for an instance of one of the 9, make sure it is set to NO
PAR1 ;
 S Y=$O(^XTV(8989.51,"B","ORK PROCESSING FLAG",0))
 I 'Y S VALUE=VALUE_"MISSING ORK PROCESSING FLAG PARAMETER" G PAR2
 S X=0 F  S X=$O(^XTV(8989.5,X)) Q:X'=+X  D
 .Q:'$D(^XTV(8989.5,X,0))
 .Q:$P(^XTV(8989.5,X,0),U,2)'=Y  ;not ork PROCESSING FLAG
 .Q:$P(^XTV(8989.5,X,0),U)["DIC(9.4"  ;not an entity we want ;IHS/OIT/CLS 02/08/2014
 .;Q:'$$INST($P(^XTV(8989.5,X,0),U,3))  ;not an instance we want
 .Q:'$$INST($$VAL^XBDIQ1(100.8,$P(^XTV(8989.5,X,0),U,3),.01))  ;IHS/OIT/CLS 02/08/2014 per Lori
 .;I $E($P($G(^XTV(8989.5,X,1)),U,1))'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR "_$P(^XTV(8989.5,X,0),U,3)_" FOR "_$$VAL^XBDIQ1(8989.5,X,.01)_"; "
 .I $E($P($G(^XTV(8989.5,X,1)),U,1))'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR "_($$VAL^XBDIQ1(100.8,$P(^XTV(8989.5,X,0),U,3),.01))_" FOR "_$$VAL^XBDIQ1(8989.5,X,.01)_"; "  ;IHS/OIT/CLS 02/08/2014 per Lori
 .Q
PAR2 ;
 I VALUE]"" Q "No^"_VALUE
 Q "Yes"
INST(I) ;
 I $G(I)="" Q 0
 I I="ESTIMATED CREATININE CLEARANCE"  Q 1
 I I="ALLERGY-DRUG INTERACTION" Q 1
 I I="ALLERGY-CONTRAST MEDIA INTERACTION" Q 1
 I I="CRITICAL DRUG INTERACTION" Q 1
 I I="RENAL FUNCTIONS OVER AGE 65" Q 1
 I I="GLUCOPHAGE-CONTRAST MEDIA" Q 1
 I I="GLUCOPHAGE-LAB RESULTS" Q 1
 I I="DANGEROUS MEDS FOR PT > 64" Q 1
 I I="NO ALLERGY ASSESSMENT" Q 1
 I I="ALLERGY UNASSESSIBLE" Q 1
 Q 0
PAR9 ;;
 ;;ESTIMATED CREATININE CLEARANCE
 ;;ALLERGY-DRUG INTERACTION
 ;;ALLERGY-CONTRAST MEDIA INTERACTION
 ;;CRITICAL DRUG INTERACTION
 ;;RENAL FUNCTIONS OVER AGE 65
 ;;GLUCOPHAGE-CONTRAST MEDIA
 ;;GLUCOPHAGE-LAB RESULTS
 ;;DANGEROUS MEDS FOR PT > 64
 ;;NO ALLERGY ASSESSMENT
 ;;ALLERGY UNASSESSIBLE
 ;;