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

BGPD5.m

Go to the documentation of this file.
BGPD5 ; IHS/CMI/LAB - indicator 5 ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
I5A ;EP ;EP - indicator 5a
 ;Q:'$D(BGPIND(12))
 Q:'BGPDMPAT  ;not in the simple population for denominator
 S BGPUP=$$POSUR(DFN,BGPEDATE)
 I BGPUP D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),1,1)
 I $D(BGPLIST(12)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",12,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=$P(BGPUP,U,2)
 Q
I5B ;EP
 ;Q:'$D(BGPIND(13))
 Q:'BGPDMPAT  ;not in the simple population for denominator
 Q:'BGP2BD
 I BGPUP D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),2,1)
 I $D(BGPLIST(13)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",13,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=$P(BGPUP,U,2)
 Q
I5C ;EP
 ;Q:'$D(BGPIND(14))
 Q:'BGPDMPAT  ;not in the simple population for denominator
 Q:'BGP2CD
 I BGPUP D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),3,1)
 I $D(BGPLIST(14)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",14,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=$P(BGPUP,U,2)
 Q
S(R,N,P,V) ;
 I 'V Q  ;no value to add
 S $P(^BGPD(R,N),U,P)=$P($G(^BGPD(R,N)),U,P)+V
 Q
POSUR(P,EDATE) ;
 NEW BGPG,X,%,E,R,V,D
 K BGPG
 S D=$$FMADD^XLFDT(EDATE,-365)
 S %=P_"^LAST LAB [DM AUDIT MICROALBUMINURIA TAX;DURING "_$$FMTE^XLFDT(D)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I $D(BGPG(1)) Q 1_"^MICROALB"
 S %=P_"^LAST LAB [DM AUDIT URINE PROTEIN TAX;DURING "_$$FMTE^XLFDT(D)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 S (%,R)="" I $D(BGPG(1)) D  Q R_"^"_%
 .S %=$P(^AUPNVLAB(+$P(BGPG(1),U,4),0),U,4)
 .S R=$S(%="":"",%["+":1,%[">":1,$E(%)="P":1,$E(%)="p":1,$E(%)="c":"",$E(%)="C":"",+%>29:1,1:"")
 .Q
 Q ""