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

APCM14ER.m

Go to the documentation of this file.
  1. APCM14ER ;IHS/CMI/LAB - IHS MU REPORT;
  1. ;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
  1. ;
  1. ;
  1. CALC(N,O) ;ENTRY POINT
  1. NEW Z
  1. S Z=N-O,Z=$FN(Z,"+,",1)
  1. Q Z
  1. ;
  1. SB(X) ;EP - Strip
  1. NEW %
  1. X ^DD("FUNC",$O(^DD("FUNC","B","STRIPBLANKS",0)),1)
  1. Q X
  1. ;
  1. C(X,X2,X3) ;
  1. S X3=""
  1. I X'?.N Q $$LBLK^APCLUTL(X,7)
  1. D COMMA^%DTC
  1. S X=$$STRIP^XLFSTR(X," ")
  1. Q $$LBLK^APCLUTL(X,7)
  1. ;
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. EOP ;EP - End of page.
  1. Q:$E(IOST)'="C"
  1. Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
  1. NEW DIR
  1. K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
  1. S DIR(0)="E" D ^DIR
  1. Q
  1. ;----------
  1. USR() ;EP - Return name .
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;
  1. SETN ;EP - set numerator fields
  1. S APCMCYN=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT) ;SPDX
  1. Q:$P(^APCM14OB(APCMIC,0),U,6)="A" ;no % on attestation measures
  1. S APCMCYP=$S(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
  1. Q
  1. ;
  1. V(T,R,N,P,PROV,K,RT) ;EP ;SPDX
  1. NEW X,Y,Z,I,J
  1. I RT=1 S I=PROV_";VA(200,"
  1. I RT=2 S I=PROV_";AUTTLOC("
  1. I T=1 D Q X
  1. .S J=$O(^APCMM14C(R,11,"B",I,0))
  1. .I 'J S X=0 Q
  1. .S X=$P($G(^APCMM14C(R,11,J,N)),U,P)
  1. Q ""
  1. SUM ;EP - summary sheet for each provider
  1. K APCMTOT
  1. K APCMPROV
  1. S APCMGPG=0
  1. S APCMQUIT=""
  1. I APCMRPTT=2 G SUMHOS
  1. S X=0 F S X=$O(APCMPRV(X)) Q:X'=+X S APCMPROV($P(^VA(200,X,0),U),X)=""
  1. S APCMPNAM="" F S APCMPNAM=$O(APCMPROV(APCMPNAM)) Q:APCMPNAM=""!(APCMQUIT) D
  1. .S APCMPROV=0 F S APCMPROV=$O(APCMPROV(APCMPNAM,APCMPROV)) Q:APCMPROV=""!(APCMQUIT) D SUM1,W^APCM14EH(" ",0,0,APCMPTYP) D
  1. ..D W^APCM14EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP) ; At least one must be",0,1,APCMPTYP),W^APCM14EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM14EH(" ",0,1,APCMPTYP),W^APCM14EH(" ",0,1,APCMPTYP)
  1. ..D W^APCM14EH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
  1. ..D W^APCM14EH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
  1. Q
  1. SUMHOS ;
  1. S APCMPNAM=$P(^DIC(4,APCMFAC,0),U,1)
  1. S APCMPROV=APCMFAC
  1. D SUM1
  1. D W^APCM14EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
  1. D W^APCM14EH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
  1. D W^APCM14EH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
  1. Q
  1. ;
  1. SUM1 ;
  1. K APCMINDO
  1. S X=0 F S X=$O(APCMIND(X)) Q:X'=+X D
  1. .S C=$P(^APCM14OB(X,0),U,3)
  1. .S O=$P(^APCM14OB(X,0),U,10)
  1. .I O="" Q ;not on summary sheet
  1. .S APCMINDO(C,O,X)=""
  1. S APCMCM="" I APCMPTYP="P" D SUMH
  1. I APCMPTYP="D" D
  1. .D W^APCM14EH("Indian Health Service RPMS Suite (BCER) v2.0",0,2,APCMPTYP)
  1. .S X="STAGE 1 2014/2015 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY" D W^APCM14EH(X,0,1,APCMPTYP)
  1. .S X="Summary Report for "_APCMPNAM D W^APCM14EH(X,0,2,APCMPTYP)
  1. .I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public health",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM14EH(X,0,2,APCMPTYP)
  1. .I APCMRPTT=1 S X=$S(APCMCM="M":"measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
  1. .I APCMRPTT=2 S X=$S(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public health",1:"CORE SET MEASURES (EHs/CAHs must meet all 12)") D W^APCM14EH(X,0,2,APCMPTYP)
  1. .I APCMRPTT=2 S X=$S(APCMCM="M":"measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
  1. .S X="Performance Measure^Target^Current Rate^Num^Den^Excl Met" D W^APCM14EH(X,0,2,APCMPTYP)
  1. .;S X="Performance Measure^?^Den^Num^Period^Period^Target^?" D W^APCM14EH(X,0,1,APCMPTYP)
  1. S APCMCM="" F S APCMCM=$O(APCMINDO(APCMCM)) Q:APCMCM=""!(APCMQUIT) D
  1. .I APCMCM="M" D
  1. ..I APCMPTYP="P" D SUMH ; W^APCM14EH("MENU SET MEASURES",0,2,APCMPTYP)
  1. ..I APCMPTYP="D" D
  1. ...I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM14EH(X,0,2,APCMPTYP)
  1. ...I APCMRPTT=1 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
  1. ...I APCMRPTT=2 S X=$S(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EHs/CAHs must meet all 12)") D W^APCM14EH(X,0,2,APCMPTYP)
  1. ...I APCMRPTT=2 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
  1. .S APCMMO=0 F S APCMMO=$O(APCMINDO(APCMCM,APCMMO)) Q:APCMMO=""!(APCMQUIT) D
  1. ..S APCMIC=0 F S APCMIC=$O(APCMINDO(APCMCM,APCMMO,APCMIC)) Q:APCMIC=""!(APCMQUIT) D SUM2
  1. D W^APCM14EH(" ",0,1,APCMPTYP)
  1. Q
  1. SUM2 ;
  1. I APCMPTYP="P",APCMGPG=0 D SUMH Q:APCMQUIT
  1. I APCMPTYP="P",$Y>(APCMIOSL-4) D SUMH Q:APCMQUIT
  1. ;SHOULD THIS LINE BE ALL N/As?
  1. S F=$P(^APCM14OB(APCMIC,0),U,18)
  1. I F]"" D I APCME="X" Q
  1. .S APCMNP=$P(^DD(9001302.0311,F,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. .S APCME=$$V^APCM14ER(1,APCMRPT,N,P,APCMPROV,"I",APCMRPTT)
  1. .Q:APCME'="X"
  1. SUM21 .;
  1. .I APCMPTYP="P" D
  1. ..I APCMMO["." D W^APCM14EH(" "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP) I 1
  1. ..E D W^APCM14EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
  1. ..D W^APCM14EH("N/A",0,0,APCMPTYP,,36)
  1. ..D W^APCM14EH($$LBLK^APCLUTL("N/A",8),0,0,APCMPTYP,,43)
  1. ..D W^APCM14EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,55)
  1. ..D W^APCM14EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,65)
  1. ..;D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
  1. ..S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
  1. ..I APCMEF]"" D
  1. ...S APCMNP=$P(^DD(9001302.0311,APCMEF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. ...S APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
  1. ...D W^APCM14EH($S(APCMEV]"":APCMEV,1:"N/A"),0,0,APCMPTYP,,76)
  1. ..I APCMEF="" D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
  1. .I APCMPTYP="D" D
  1. ..I APCMMO["." S APCMX=" "_$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"") I 1
  1. ..E S APCMX=$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
  1. ..S APCMX=APCMX_U_"N/A"_U_"N/A"_U_"N/A"_U_"N/A"
  1. ..S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
  1. ..I APCMEF]"" D
  1. ...S APCMNP=$P(^DD(9001302.0311,APCMEF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. ...S APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
  1. ...S APCMX=APCMX_U_$S(APCMEV]"":APCMEV,1:"N/A")
  1. ..I APCMEF="" S APCMX=APCMX_U_"N/A"
  1. ..D W^APCM14EH(APCMX,0,2,APCMPTYP,1)
  1. S APCMDF=$P(^APCM14OB(APCMIC,0),U,8)
  1. ;get DENOMINATOR value
  1. S APCMNP=$P(^DD(9001302.0311,APCMDF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. S APCMCYD=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
  1. I $P(^APCM14OB(APCMIC,0),U,6)="A" S (APCMPRN,APCMCYN)="" G WSUM
  1. S APCMNF=$P(^APCM14OB(APCMIC,0),U,9) ;numerator field
  1. S APCMNP=$P(^DD(9001302.0311,APCMNF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. D SETN
  1. WSUM ;write out line
  1. I APCMPTYP="P",$Y>(APCMIOSL-2) D SUMH Q:APCMQUIT
  1. I APCMPTYP="P" D
  1. .;LABEL
  1. .I APCMMO["." D W^APCM14EH(" "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP) I 1
  1. .E D W^APCM14EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,2,APCMPTYP)
  1. .;TARGET
  1. .D W^APCM14EH($G(^APCM14OB(APCMIC,13,1,0)),0,0,APCMPTYP,,35)
  1. .;RATE
  1. .I $P(^APCM14OB(APCMIC,0),U,6)="A" D W^APCM14EH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
  1. .I $P(^APCM14OB(APCMIC,0),U,6)'="A" D W^APCM14EH($J(APCMCYP,8,2)_"%",0,0,APCMPTYP,,42)
  1. .;NUMERATOR/DENOMINATOR
  1. .D W^APCM14EH($S($P(^APCM14OB(APCMIC,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
  1. .D W^APCM14EH($S($P(^APCM14OB(APCMIC,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
  1. .;EXCL MET?
  1. .S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
  1. .I APCMEF]"" D
  1. ..S APCMNP=$P(^DD(9001302.0311,APCMEF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. ..S APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
  1. ..D W^APCM14EH($S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
  1. .I APCMEF="" D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
  1. I APCMPTYP="D" D
  1. .I APCMMO["." S APCMX=" "_$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"") I 1
  1. .E S APCMX=$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
  1. .;TARGet
  1. .S $P(APCMX,U,2)=$G(^APCM14OB(APCMIC,13,1,0))
  1. .;current rate
  1. .I $P(^APCM14OB(APCMIC,0),U,6)="A" S $P(APCMX,U,3)=$S(APCMCYD]"":APCMCYD,1:"N/A")
  1. .I $P(^APCM14OB(APCMIC,0),U,6)'="A" S $P(APCMX,U,3)=$$SB($J(APCMCYP,6,2))_"%"
  1. .;numerator denominator
  1. .S $P(APCMX,U,4)=$S($P(^APCM14OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
  1. .S $P(APCMX,U,5)=$S($P(^APCM14OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
  1. .S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
  1. .;EXCLUSION MET?
  1. .I APCMEF]"" D
  1. ..S APCMNP=$P(^DD(9001302.0311,APCMEF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
  1. ..S APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
  1. ..S $P(APCMX,U,6)=$S(APCMEV="N/A":APCMEV,APCMEV]"":"Yes",1:"No") ;IHS/CMI/LAB - fix display
  1. .I APCMEF="" S $P(APCMX,U,6)="N/A"
  1. .D W^APCM14EH(APCMX,0,2,APCMPTYP,1)
  1. Q
  1. SUMH ;
  1. G:'APCMGPG SUMH1
  1. K DIR I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCMQUIT=1 Q
  1. ;
  1. SUMH1 ;
  1. I APCMPTYP="P" W:$D(IOF) @IOF S APCMGPG=APCMGPG+1
  1. I APCMPTYP="P" S X=$P(^VA(200,DUZ,0),U,2),$E(X,35)=$$FMTE^XLFDT(DT),$E(X,70)="Page "_APCMGPG D W^APCM14EH(X,0,1,APCMPTYP)
  1. D W^APCM14EH("Indian Health Service RPMS Suite (BCER) v2.0",1,2,APCMPTYP)
  1. I APCMRPTT=1 D W^APCM14EH("*** IHS 2014/2015 Stage 1 Meaningful Use Performance Measure Report for EPs ***",1,1,APCMPTYP)
  1. I APCMRPTT=2 D W^APCM14EH("** IHS 2014/2015 Stage 1 MU Performance Report for Eligible Hospitals/CAHs **",1,1,APCMPTYP)
  1. I $G(APCMPROV),APCMRPTT=1 S X="Provider Name: "_$$SN^APCM14EH($P(^VA(200,APCMPROV,0),U,1)) D W^APCM14EH(X,1,1,APCMPTYP)
  1. I APCMRPTT=2 S X="Method: "_$S(APCMMETH="E":"All Emergency Department",1:"Observation") D W^APCM14EH(X,1,1,APCMPTYP)
  1. I $G(APCMPROV),APCMRPTT=2 S X="Facility: "_$P(^DIC(4,APCMPROV,0),U,1) D W^APCM14EH(X,1,1,APCMPTYP)
  1. S X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED) D W^APCM14EH(X,1,1,APCMPTYP)
  1. S X=$$REPEAT^XLFSTR("-",80) D W^APCM14EH(X,0,1,APCMPTYP)
  1. D W^APCM14EH("STAGE 1 2014/2015 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
  1. I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM14EH(X,1,1,APCMPTYP)
  1. I APCMRPTT=1 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,1,1,APCMPTYP)
  1. I APCMRPTT=2 S X=$S(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EHs/CAHs must meet all 11)") D W^APCM14EH(X,1,1,APCMPTYP)
  1. I APCMRPTT=2 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,1,1,APCMPTYP)
  1. S X=$$REPEAT^XLFSTR("-",80) D W^APCM14EH(X,0,1,APCMPTYP)
  1. S X="",$E(X,45)="Current",$E(X,76)="Excl" D W^APCM14EH(X,0,1,APCMPTYP)
  1. S X="",X="Performance Measures",$E(X,35)="Target",$E(X,45)="Rate",$E(X,59)="Num",$E(X,69)="Den",$E(X,76)="Met" D W^APCM14EH(X,0,1,APCMPTYP)
  1. D W^APCM14EH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
  1. Q