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N6,BGPN7,BGPN8
S BGPD1=0
I 'BGPDMD2 S BGPSTOP=1 Q ;not active diabetic
I BGPDMD2 S BGPD1=1
I 'BGPDM1 S BGPSTOP=1 Q ;don't process this indicator, pt not diabetic
S BGPLHGB=$$HGBA1C^BGP4D2(DFN,BGP365,BGPEDATE)
S BGPN1=$P(BGPLHGB,U)
S BGPN2=$S($P(BGPLHGB,U,2)=3:1,1:0)
S BGPVALUE=""
I BGPN1 S BGPVALUE=BGPVALUE_"hgb:"_$$DATE^BGP4UTL($P(BGPLHGB,U,3))_" "_$P(BGPLHGB,U,4)
K X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P,V,S,F,J,K,G,I,L,T,BGPG
73 S BGPEYE=$$EYE^BGP4D21(DFN,BGP365,BGPEDATE)
S A=0 I $P(BGPEYE,U)=1 S A=1
S B=0 I $P(BGPEYE,U)=2 S B=1
S BGPN3=0 I A!(B) S BGPN3=1
I BGPN3 S BGPVALUE=BGPVALUE_";eye: "_$$DATE^BGP4UTL($P(BGPEYE,U,2))_" "_$P(BGPEYE,U,3)
K BGPG
K ^TMP($J,"A")
74 ;
S BGPLDL=$$LDL^BGP4D2(DFN,BGP365,BGPEDATE)
S BGPN4=$P(BGPLDL,U),BGPN5=0,BGPN6=0
I $P(BGPLDL,U,3)]"",$P(BGPLDL,U,3)'>100 S BGPN6=1
I $P(BGPLDL,U,3)]"",$P(BGPLDL,U,3)<130 S BGPN5=1
I BGPN4 S BGPVALUE=BGPVALUE_";ldl: "_$$DATE^BGP4UTL($P(BGPLDL,U,2))_" "_$P(BGPLDL,U,3)
K X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P,V,S,F,BGPLDL,BGPHDL,BGPTRI,BGPLP
77 ;
S BGPUP=$$POSUR^BGP4D21(DFN,BGP365,BGPEDATE)
;S BGPGFR=$$GFR(DFN,BGP365,BGPEDATE)
;S BGPN3=0 I $P(BGPUP,U)=1 S BGPN3=1
;S BGPN2=0 I $P(BGPGFR,U) S BGPN2=1
S BGPN7=0 I $P(BGPUP,U)=1 S BGPN7=1
I BGPN1 S BGPVALUE=BGPVALUE_";nep: "_$$DATE^BGP4UTL($P(BGPUP,U,4))_" "_$P(BGPUP,U,2)_" "_$P(BGPUP,U,3) ;_" "_$S(BGPGFR:"GFR",1:"")
S BGPN8=0 I BGPN1,BGPN3,BGPN4,BGPN7 S BGPN8=1
Q
BGP4DHE1 ; IHS/CMI/LAB - indicator HEDIS ;
+1 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
+2 ;
I1 ;EP
+1 SET (BGPN1,BGPN2,BGPN3,BGPN4,BGPN5,BGPN6,BGPD1,BGPD2,BGPD3,BGPD4,BGPD5,BGPD6,BGPD7,BGPD8,BGPD9)=0
+2 IF BGPAGEB<52
SET BGPSTOP=1
QUIT
+3 IF BGPACTCL
SET BGPD1=1
+4 IF 'BGPD1
SET BGPSTOP=1
QUIT
+5 SET BGPFOB=$$FOB^BGP4D61(DFN,BGPEDATE)
+6 SET BGPRECT=$$RECT^BGP4D61(DFN,BGPEDATE)
+7 IF BGPFOB]""
SET BGPN2=1
SET BGPN1=1
+8 IF BGPRECT]""
SET BGPN3=1
SET BGPN1=1
+9 SET BGPOTH=""
+10 IF BGPN1=0
SET BGPOTH=$$IBH^BGP4D61(DFN,BGPEDATE)
+11 IF BGPOTH]""
SET BGPN1=1
+12 SET BGPVALUE=$SELECT(BGPFOB]"":BGPFOB,BGPRECT]"":BGPRECT,1:BGPOTH)
SET BGPVALUE=$PIECE(BGPVALUE,U,2)_" "_$PIECE(BGPVALUE,U)
+13 ;S BGPDV=$S(BGPD1:"UP",1:"")_$S(BGPACTCL:",AC",1:"")
+14 ;S BGPVALUE=BGPDV_";"_BGPVALUE
+15 KILL X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P
+16 QUIT
I4 ;EP
+1 SET (BGPN1,BGPN2,BGPN3,BGPN4,BGPN5,BGPN6,BGPD1,BGPD2,BGPD3,BGPD4,BGPD5,BGPD6,BGPD7,BGPD8,BGPD9)=0
+2 IF 'BGPACTUP
SET BGPSTOP=1
QUIT
+3 IF BGPSEX'="F"
SET BGPSTOP=1
QUIT
+4 IF BGPAGEB<16
SET BGPSTOP=1
QUIT
+5 IF BGPAGEB>25
SET BGPSTOP=1
QUIT
+6 IF BGPACTUP
SET BGPD2=1
+7 IF BGPACTCL
SET BGPD1=1
+8 SET BGPN1=$$CHL^BGP4D5(DFN,BGP365,BGPEDATE)
+9 SET BGPVALUE=""
+10 KILL X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P,V,S,F,T
+11 QUIT
I7 ;EP
+1 KILL BGPN1,BGPN2,BGPN3,BGPN4,BGPVALUE,BGPLHGB,BGPN5,BGPN6,BGPN7,BGPN8
+2 SET BGPD1=0
+3 ;not active diabetic
IF 'BGPDMD2
SET BGPSTOP=1
QUIT
+4 IF BGPDMD2
SET BGPD1=1
+5 ;don't process this indicator, pt not diabetic
IF 'BGPDM1
SET BGPSTOP=1
QUIT
+6 SET BGPLHGB=$$HGBA1C^BGP4D2(DFN,BGP365,BGPEDATE)
+7 SET BGPN1=$PIECE(BGPLHGB,U)
+8 SET BGPN2=$SELECT($PIECE(BGPLHGB,U,2)=3:1,1:0)
+9 SET BGPVALUE=""
+10 IF BGPN1
SET BGPVALUE=BGPVALUE_"hgb:"_$$DATE^BGP4UTL($PIECE(BGPLHGB,U,3))_" "_$PIECE(BGPLHGB,U,4)
+11 KILL X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P,V,S,F,J,K,G,I,L,T,BGPG
73 SET BGPEYE=$$EYE^BGP4D21(DFN,BGP365,BGPEDATE)
+1 SET A=0
IF $PIECE(BGPEYE,U)=1
SET A=1
+2 SET B=0
IF $PIECE(BGPEYE,U)=2
SET B=1
+3 SET BGPN3=0
IF A!(B)
SET BGPN3=1
+4 IF BGPN3
SET BGPVALUE=BGPVALUE_";eye: "_$$DATE^BGP4UTL($PIECE(BGPEYE,U,2))_" "_$PIECE(BGPEYE,U,3)
+5 KILL BGPG
+6 KILL ^TMP($JOB,"A")
74 ;
+1 SET BGPLDL=$$LDL^BGP4D2(DFN,BGP365,BGPEDATE)
+2 SET BGPN4=$PIECE(BGPLDL,U)
SET BGPN5=0
SET BGPN6=0
+3 IF $PIECE(BGPLDL,U,3)]""
IF $PIECE(BGPLDL,U,3)'>100
SET BGPN6=1
+4 IF $PIECE(BGPLDL,U,3)]""
IF $PIECE(BGPLDL,U,3)<130
SET BGPN5=1
+5 IF BGPN4
SET BGPVALUE=BGPVALUE_";ldl: "_$$DATE^BGP4UTL($PIECE(BGPLDL,U,2))_" "_$PIECE(BGPLDL,U,3)
+6 KILL X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P,V,S,F,BGPLDL,BGPHDL,BGPTRI,BGPLP
77 ;
+1 SET BGPUP=$$POSUR^BGP4D21(DFN,BGP365,BGPEDATE)
+2 ;S BGPGFR=$$GFR(DFN,BGP365,BGPEDATE)
+3 ;S BGPN3=0 I $P(BGPUP,U)=1 S BGPN3=1
+4 ;S BGPN2=0 I $P(BGPGFR,U) S BGPN2=1
+5 SET BGPN7=0
IF $PIECE(BGPUP,U)=1
SET BGPN7=1
+6 ;_" "_$S(BGPGFR:"GFR",1:"")
IF BGPN1
SET BGPVALUE=BGPVALUE_";nep: "_$$DATE^BGP4UTL($PIECE(BGPUP,U,4))_" "_$PIECE(BGPUP,U,2)_" "_$PIECE(BGPUP,U,3)
+7 SET BGPN8=0
IF BGPN1
IF BGPN3
IF BGPN4
IF BGPN7
SET BGPN8=1
+8 QUIT