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

APCM25ER.m

Go to the documentation of this file.
APCM25ER ;IHS/CMI/LAB - IHS MU REPORT; 
 ;;1.0;MU PERFORMANCE REPORTS;**7,8,10**;MAR 26, 2012;Build 31
 ;
 ;
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)
 Q:$P(^APCM25OB(APCMIC,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 ;SPDX
 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 ""
SUM ;EP - summary sheet PER PROV
 K APCMTOT
 K APCMPROV
 S APCMGPG=0
 S APCMQUIT=""
 I APCMRPTT=2 G SUMHOS
 S X=0 F  S X=$O(APCMPRV(X)) Q:X'=+X  S APCMPROV($P(^VA(200,X,0),U),X)=""
 S APCMPNAM="" F  S APCMPNAM=$O(APCMPROV(APCMPNAM)) Q:APCMPNAM=""!(APCMQUIT)  D
 .S APCMPROV=0 F  S APCMPROV=$O(APCMPROV(APCMPNAM,APCMPROV)) Q:APCMPROV=""!(APCMQUIT)  D SUM1,W^APCM25EH(" ",0,0,APCMPTYP) D
 ..D W^APCM25EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP) ;  At least one must be",0,1,APCMPTYP),W^APCM25EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM25EH(" ",0,1,APCMPTYP),W^APCM25EH(" ",0,1,APCMPTYP)
 ..D W^APCM25EH("+ Indicates Yes/No Attestation Measure.  The Yes or No displayed in the",0,1,APCMPTYP)
 ..D W^APCM25EH("  Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
 Q
SUMHOS ;
 S APCMPNAM=$P(^DIC(4,APCMFAC,0),U,1)
 S APCMPROV=APCMFAC
 D SUM1
 D W^APCM25EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
 D W^APCM25EH("+ Indicates Yes/No Attestation Measure.  The Yes or No displayed in the",0,1,APCMPTYP)
 D W^APCM25EH("  Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
 Q
 ;
SUM1 ;
 K APCMINDO
 S X=0 F  S X=$O(APCMIND(X)) Q:X'=+X  D
 .S C="A"
 .S O=$P(^APCM25OB(X,0),U,10)
 .I O="" Q  ;not on summary sheet
 .S APCMINDO(C,O,X)=""
 S APCMCM="" I APCMPTYP="P" D SUMH
 I APCMPTYP="D" D
 .D W^APCM25EH("Indian Health Service RPMS Suite (BCER) v2.0",0,2,APCMPTYP)
 .S X="MODIFIED STAGE 2 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY" D W^APCM25EH(X,0,1,APCMPTYP)
 .S X="Summary Report for "_APCMPNAM D W^APCM25EH(X,0,2,APCMPTYP)
 .S X="Performance Measure^Target^Current Rate^Num^Den^Excl Met" D W^APCM25EH(X,0,2,APCMPTYP)
 S APCMCM="" F  S APCMCM=$O(APCMINDO(APCMCM)) Q:APCMCM=""!(APCMQUIT)  D
 .I APCMCM="M" D
 ..I APCMPTYP="P" D SUMH
 ..I APCMPTYP="D" D
 .S APCMMO=0 F  S APCMMO=$O(APCMINDO(APCMCM,APCMMO)) Q:APCMMO=""!(APCMQUIT)  D
 ..S APCMIC=0 F  S APCMIC=$O(APCMINDO(APCMCM,APCMMO,APCMIC)) Q:APCMIC=""!(APCMQUIT)  D SUM2
 D W^APCM25EH(" ",0,1,APCMPTYP)
 Q
SUM2 ;
 I APCMPTYP="P",APCMGPG=0 D SUMH Q:APCMQUIT
 I APCMPTYP="P",$Y>(APCMIOSL-4) D SUMH Q:APCMQUIT
 I $P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" D SEM^APCM25EA Q  ;special printing for sem
 ;SHOULD THIS LINE BE ALL N/As?
 S F=$P(^APCM25OB(APCMIC,0),U,18)
 I F]"" D  I APCME="X" Q
 .S APCMNP=$P(^DD(9001304.0311,F,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
 .S APCME=$$V^APCM25ER(1,APCMRPT,N,P,APCMPROV,"I",APCMRPTT)
 .Q:APCME'="X"
SUM21 .;
 .I APCMPTYP="P" D
 ..I APCMMO["." D W^APCM25EH("    "_$E($P(^APCM25OB(APCMIC,0),U,14),1,28)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP) I 1
 ..E  D W^APCM25EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM25OB(APCMIC,0),U,14),1,28)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
 ..D W^APCM25EH("N/A",0,0,APCMPTYP,,36)
 ..D W^APCM25EH($$LBLK^APCLUTL("N/A",8),0,0,APCMPTYP,,43)
 ..D W^APCM25EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,55)
 ..D W^APCM25EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,65)
 ..;D W^APCM25EH("N/A",0,0,APCMPTYP,,76)
 ..S APCMEF=$P(^APCM25OB(APCMIC,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)
 ...D W^APCM25EH($S(APCMEV]"":APCMEV,1:"N/A"),0,0,APCMPTYP,,76)
 ..I APCMEF="" D W^APCM25EH("N/A",0,0,APCMPTYP,,76)
 .I APCMPTYP="D" D
 ..I APCMMO["." S APCMX="    "_$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"") I 1
 ..E  S APCMX=$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"")
 ..S APCMX=APCMX_U_"N/A"_U_"N/A"_U_"N/A"_U_"N/A"
 ..S APCMEF=$P(^APCM25OB(APCMIC,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)
 ...S APCMX=APCMX_U_$S(APCMEV]"":APCMEV,1:"N/A")
 ..I APCMEF="" S APCMX=APCMX_U_"N/A"
 ..D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
 I $P(^APCM25OB(APCMIC,0),U,19)]"" G WSUM
 S APCMDF=$P(^APCM25OB(APCMIC,0),U,8)
 ;get DENOMINATOR value
 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(APCMIC,0),U,6)="A" S (APCMPRN,APCMCYN)="" G WSUM
 S APCMNF=$P(^APCM25OB(APCMIC,0),U,9)
 ;numerator field
 S APCMNP=$P(^DD(9001304.0311,APCMNF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
 D SETN
WSUM ;write out line
 I APCMPTYP="P",$Y>(APCMIOSL-2) D SUMH Q:APCMQUIT
 I APCMPTYP="P" D
 .;LABEL
 .I APCMMO["." D W^APCM25EH("    "_$E($P(^APCM25OB(APCMIC,0),U,14),1,28)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP) I 1
 .E  D
 ..I $P($G(^APCM25OB(APCMIC,12)),U,6)]"" D
 ...D W^APCM25EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM25OB(APCMIC,12),U,6),1,28),0,2,APCMPTYP)
 ...D W^APCM25EH("    "_$E($P(^APCM25OB(APCMIC,0),U,14),1,28)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
 ..I $P($G(^APCM25OB(APCMIC,12)),U,6)="",$P(^APCM25OB(APCMIC,0),U,1)'="S2.026.EP" D W^APCM25EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM25OB(APCMIC,0),U,14),1,28)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:""),0,2,APCMPTYP)
 ..I $P($G(^APCM25OB(APCMIC,12)),U,6)="",$P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" D W^APCM25EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM25OB(APCMIC,0),U,14),1,28),0,2,APCMPTYP)
 .;if summary category then skip rest
 .Q:$P(^APCM25OB(APCMIC,0),U,19)]""
 .I $P($G(^APCM25OB(APCMIC,12)),U,4) D  Q
 ..I $E(APCMPER,1,3)=315 D W^APCM25EH($P($G(^APCM25OB(APCMIC,12)),U,1),0,0,APCMPTYP,,35) D NUMRATE
 ..I $P(^APCM25OB(APCMIC,0),U,1)'="S2.026.EP" D
 ...I $E(APCMPER,1,3)=316 D W^APCM25EH($P($G(^APCM25OB(APCMIC,12)),U,2),0,0,APCMPTYP,,35) D NUMRATE
 ...I $E(APCMPER,1,3)>316 D W^APCM25EH($P($G(^APCM25OB(APCMIC,12)),U,3),0,0,APCMPTYP,,35) D RATE
 .;TARGET
 .S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)>316:3,1:1)
 .D W^APCM25EH($P($G(^APCM25OB(APCMIC,12)),U,T),0,0,APCMPTYP,,35)
RATE .;RATE
 .I $P(^APCM25OB(APCMIC,0),U,6)="A" D W^APCM25EH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
 .I $P(^APCM25OB(APCMIC,0),U,6)'="A" D W^APCM25EH($J(APCMCYP,8,2)_"%",0,0,APCMPTYP,,42)
 .;NUMERATOR/DENOMINATOR
 .D W^APCM25EH($S($P(^APCM25OB(APCMIC,0),U,6)="A":"    N/A",APCMCYN'?.N:"    N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
 .D W^APCM25EH($S($P(^APCM25OB(APCMIC,0),U,6)="A":"    N/A",APCMCYD'?.N:"    N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
 .;EXCL MET?
 .S APCMEF=$P(^APCM25OB(APCMIC,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)
 ..D W^APCM25EH($S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
 .I APCMEF="" D W^APCM25EH("N/A",0,0,APCMPTYP,,76)
 .I $P(^APCM25OB(APCMIC,0),U,1)="S2.020.EP.1"!($P(^APCM25OB(APCMIC,0),U,1)="S2.025.H.1"),$P(APCMVDTE,U,1)=1 D
 ..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)
D I APCMPTYP="D" D
 .K R
 .I APCMMO["." S APCMX="    "_$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"") I 1
 .E  D
 ..I $P($G(^APCM25OB(APCMIC,12)),U,6)]"" D
 ...S APCMX="" S $P(APCMX,U,1)=$P(^APCM25OB(APCMIC,12),U,6) D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
 ...I $P(^APCM25OB(APCMIC,0),U,1)'="S2.026.EP" S APCMX="    "_$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"")
 ...I $P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" S APCMX="    "_$P(^APCM25OB(APCMIC,0),U,14)
 ..I $P($G(^APCM25OB(APCMIC,12)),U,6)="",$P(^APCM25OB(APCMIC,0),U,1)'="S2.026.EP" S APCMX=$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"")
 ..I $P($G(^APCM25OB(APCMIC,12)),U,6)="",$P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" S APCMX=$P(^APCM25OB(APCMIC,0),U,14)
 .;if summary category then skip rest
 .Q:$P(^APCM25OB(APCMIC,0),U,19)]""
 .;TARGet
 .I $P($G(^APCM25OB(APCMIC,12)),U,4) D  Q
 ..;D W^APCM25EH("  ",0,1,APCMPTYP,1)
 ..I $E(APCMPER,1,3)=315 S APCMX=APCMX_U_$P($G(^APCM25OB(APCMIC,12)),U,1) S R=1 D NUMRATED
 ..I $P(^APCM25OB(APCMIC,0),U,1)'="S2.026.EP" D
 ...I $E(APCMPER,1,3)=316 S APCMX=APCMX_U_$P($G(^APCM25OB(APCMIC,12)),U,2) S R=1 D NUMRATED
 ...I $E(APCMPER,1,3)=317 S APCMX=APCMX_U_$P($G(^APCM25OB(APCMIC,12)),U,3) S R=1 D RATED
 ...I $E(APCMPER,1,3)>317 S APCMX=APCMX_U_$P($G(^APCM25OB(APCMIC,12)),U,7) S R=1 D RATED
 ..I $P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" D
 ...S APCMX="" S $P(APCMX,U,1)="     2016"_U_$P($G(^APCM25OB(APCMIC,12)),U,2) S R=1
 ...F I=3,4,5 S $P(APCMX,U,I)=0
 ...D EXD
 ...S APCMX="" S $P(APCMX,U,1)="     2016"_U_$P($G(^APCM25OB(APCMIC,12)),U,2) S R=1
 ...F I=3,4,5 S $P(APCMX,U,I)=0
 ...D EXD
 .S R=2
 .S $P(APCMX,U,2)=$G(^APCM25OB(APCMIC,13,1,0))
RATED .;current rate
 .I $P(^APCM25OB(APCMIC,0),U,6)="A" S $P(APCMX,U,3)=$S(APCMCYD]"":APCMCYD,1:"N/A")
 .I $P(^APCM25OB(APCMIC,0),U,6)'="A" S $P(APCMX,U,3)=$$SB($J(APCMCYP,6,2))_"%"
 .;numerator denominator
 .S $P(APCMX,U,4)=$S($P(^APCM25OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
 .S $P(APCMX,U,5)=$S($P(^APCM25OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
 .S APCMEF=$P(^APCM25OB(APCMIC,0),U,11)
EXD .;EXCLUSION MET?
 .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)
 ..S $P(APCMX,U,6)=$S(APCMEV="N/A":APCMEV,APCMEV]"":"Yes",1:"No")   ;IHS/CMI/LAB - fix display
 .I APCMEF="" S $P(APCMX,U,6)="N/A"
 .D W^APCM25EH(APCMX,0,R,APCMPTYP,1)
 .I $P(^APCM25OB(APCMIC,0),U,1)="S2.020.EP.1"!($P(^APCM25OB(APCMIC,0),U,1)="S2.025.H.1"),$P(APCMVDTE,U,1)=1 D
 ..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
SUMH ;
 G:'APCMGPG SUMH1
 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
 ;
SUMH1 ;
 I APCMPTYP="P" W:$D(IOF) @IOF S APCMGPG=APCMGPG+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^APCM25EH(X,0,1,APCMPTYP)
 D W^APCM25EH("Indian Health Service RPMS Suite (BCER) v2.0",1,2,APCMPTYP)
 I $G(APCMPROV),APCMRPTT=1 S X="Provider Name: "_$$SN^APCM25EH($P(^VA(200,APCMPROV,0),U,1)) D W^APCM25EH(X,1,1,APCMPTYP)
 I APCMRPTT=2 S X="Method: "_$S(APCMMETH="E":"All Emergency Department",1:"Observation") D W^APCM25EH(X,1,1,APCMPTYP)
 I $G(APCMPROV),APCMRPTT=2 S X="Facility: "_$P(^DIC(4,APCMPROV,0),U,1) D W^APCM25EH(X,1,1,APCMPTYP)
 S X="Report Period:  "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED) D W^APCM25EH(X,1,1,APCMPTYP)
 S X=$$REPEAT^XLFSTR("-",80) D W^APCM25EH(X,0,1,APCMPTYP)
 D W^APCM25EH("MODIFIED STAGE 2 "_$S(APCMRPTT=1:"EP ",1:"EH ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
 S X=$$REPEAT^XLFSTR("-",80) D W^APCM25EH(X,0,1,APCMPTYP)
 S X="",$E(X,45)="Current",$E(X,76)="Excl" D W^APCM25EH(X,0,1,APCMPTYP)
 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^APCM25EH(X,0,1,APCMPTYP)
 D W^APCM25EH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
 Q
NUMRATE ;RATE
 I $P(^APCM25OB(APCMIC,0),U,6)="A" D W^APCM25EH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
 I $P(^APCM25OB(APCMIC,0),U,6)'="A" D W^APCM25EH($$C(APCMCYN,0,9),0,0,APCMPTYP,,42)
 ;NUMERATOR/DENOMINATOR
 D W^APCM25EH($S($P(^APCM25OB(APCMIC,0),U,6)="A":"    N/A",APCMCYN'?.N:"    N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
 D W^APCM25EH($S($P(^APCM25OB(APCMIC,0),U,6)="A":"    N/A",APCMCYD'?.N:"    N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
EX ;EXCL MET?
 S APCMEF=$P(^APCM25OB(APCMIC,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)
 .D W^APCM25EH($S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
 I APCMEF="" D W^APCM25EH("N/A",0,0,APCMPTYP,,76)
 Q
NUMRATED ;current rate
 D
 .I $P(^APCM25OB(APCMIC,0),U,6)="A" S $P(APCMX,U,3)=$S(APCMCYD]"":APCMCYD,1:"N/A")
 .I $P(^APCM25OB(APCMIC,0),U,6)'="A" S $P(APCMX,U,3)=$S($P(^APCM25OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
 .;numerator denominator
 .S $P(APCMX,U,4)=$S($P(^APCM25OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
 .S $P(APCMX,U,5)=$S($P(^APCM25OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
 .S APCMEF=$P(^APCM25OB(APCMIC,0),U,11)
 .;EXCLUSION MET?
 .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)
 ..S $P(APCMX,U,6)=$S(APCMEV="N/A":APCMEV,APCMEV]"":"Yes",1:"No")   ;IHS/CMI/LAB - fix display
 .I APCMEF="" S $P(APCMX,U,6)="N/A"
 .D W^APCM25EH(APCMX,0,R,APCMPTYP,1)
 Q