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

BGPD4.m

Go to the documentation of this file.
BGPD4 ; IHS/CMI/LAB - indicator 4 ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
I4A ;EP ;EP - indicator 4a
 ;Q:'$D(BGPIND(9))
 Q:'BGPDMPAT  ;not in the simple population for denominator
 S BGP4LP=$$LIPID(DFN,BGPEDATE)
 S BGP4TG=$$TRIG(DFN,BGPEDATE)
 S BGP4LDL=$$LDL(DFN,BGPEDATE)
 S BGP4HDL=$$HDL(DFN,BGPEDATE)
 S BGPL=9
NUM ;
 S V=""
 I BGP4LP="",BGP4TG="",BGP4LDL="",BGP4HDL="" S P=5,V="" D ST Q  ;none of the above E
 I BGP4LP S P=1,V="LP " D ST G LDS
 I BGP4TG,BGP4LDL,BGP4HDL S P=1,V="HDL,LDL,TG" D ST G LDS
 I BGP4LDL,(BGP4TG!(BGP4HDL)) S P=2,V="LDL & HDL/TG" D ST G LDS
 I 'BGP4LDL S P=3,V="TG or TG/HDL" D ST Q
 I BGP4LDL S P=4,V="LDL ONLY" D ST G LDS
 Q
LDS ;
 S P=6 D ST
 I $P(BGP4LDL,U,2)]"" S P=7,V=V_" "_$P(BGP4LDL,U,2) D ST
 I $P(BGP4LDL,U,2)]"",+$P(BGP4LDL,U,2)<130 S P=8 D ST
 Q
ST ;
 D S(BGPRPT,$S(BGPTIME=1:14,BGPTIME=0:44,BGPTIME=8:84,1:999),P,1)
 I $D(BGPLIST(BGPL)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",BGPL,$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(V,U)
 Q
LDSB ;
 S P=14 D ST
 I $P(BGP4LDL,U,2)]"" S P=15,V=V_" "_$P(BGP4LDL,U,2) D ST
 I $P(BGP4LDL,U,2)]"",$P(BGP4LDL,U,2)<130 S P=16 D ST
 Q
LDSC ;
 S P=22 D ST
 I $P(BGP4LDL,U,2)]"" S P=23,V=V_" "_$P(BGP4LDL,U,2) D ST
 I $P(BGP4LDL,U,2)]"",$P(BGP4LDL,U,2)<130 S P=24 D ST
 Q
I4B ;EP
 ;Q:'$D(BGPIND(10))
 Q:'BGPDMPAT  ;not in the simple population for denominator
 Q:'BGP2BD
 S BGPL=10
 S V=""
 I BGP4LP="",BGP4TG="",BGP4LDL="",BGP4HDL="" S P=13,V="" D ST Q  ;none of the above E
 I BGP4LP S P=9,V="LP " D ST G LDSB
 I BGP4TG,BGP4LDL,BGP4HDL S P=9,V="HDL,LDL,TG" D ST G LDSB
 I BGP4LDL,(BGP4TG!(BGP4HDL)) S P=10,V="LDL & HDL/TG" D ST G LDSB
 I 'BGP4LDL S P=11,V="TG or TG/HDL" D ST Q
 I BGP4LDL S P=12,V="LDL ONLY" D ST G LDSB
 K BGPL
 Q
I4C ;EP
 ;Q:'$D(BGPIND(11))
 Q:'BGPDMPAT  ;not in the simple population for denominator
 Q:'BGP2CD
 S BGPL=11
 S V=""
 I BGP4LP="",BGP4TG="",BGP4LDL="",BGP4HDL="" S P=21,V="" D ST Q  ;none of the above E
 I BGP4LP S P=17,V="LP " D ST G LDSC
 I BGP4TG,BGP4LDL,BGP4HDL S P=17,V="HDL,LDL,TG" D ST G LDSC
 I BGP4LDL,(BGP4TG!(BGP4HDL)) S P=18,V="LDL & HDL/TG" D ST G LDSC
 I 'BGP4LDL S P=19,V="TG or TG/HDL" D ST Q
 I BGP4LDL S P=20,V="LDL ONLY" D ST G LDSC
 K BGPL
 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
LIPID(P,EDATE) ;
 NEW %,E,D,BGPG
 K BGPG
 S D=$$FMADD^XLFDT(EDATE,-365)
 S %=P_"^LAST LAB [DM AUDIT LIPID PROFILE TAX;DURING "_$$FMTE^XLFDT(D)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I $D(BGPG(1)) Q 1
 S E=+$$CODEN^ICPTCOD(80061),%=$$CPTI^BGPDU(P,D,EDATE,E)
 Q %
TRIG(P,EDATE) ;
 NEW %,E,D,BGPG
 K BGPG
 S D=$$FMADD^XLFDT(EDATE,-365)
 S %=P_"^LAST LAB [DM AUDIT TRIGLYCERIDE TAX;DURING "_$$FMTE^XLFDT(D)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I $D(BGPG(1)) Q 1
 S E=+$$CODEN^ICPTCOD(84478),%=$$CPTI^BGPDU(P,D,EDATE,E)
 Q %
HDL(P,EDATE) ;
 NEW %,E,D,BGPG
 K BGPG
 S D=$$FMADD^XLFDT(EDATE,-365)
 S %=P_"^LAST LAB [DM AUDIT HDL TAX;DURING "_$$FMTE^XLFDT(D)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I $D(BGPG(1)) Q 1
 Q ""
LDL(P,EDATE) ;
 NEW %,E,D,BGPG
 K BGPG
 S D=$$FMADD^XLFDT(EDATE,-365)
 S %=P_"^LAST LAB [DM AUDIT LDL CHOLESTEROL TAX;DURING "_$$FMTE^XLFDT(D)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 S %="" I $D(BGPG(1)) D  Q %
 .S E=$P(^AUPNVLAB(+$P(BGPG(1),U,4),0),U,4)
 .I $$UP^XLFSTR(E)="COMMENT" S %=1 Q
 .I +E S %="1^"_E Q
 .S %=1
 S E=+$$CODEN^ICPTCOD(80061),%=$$CPTI^BGPDU(P,D,EDATE,E)
 Q %