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

BGPDP29.m

Go to the documentation of this file.
BGPDP29 ; IHS/CMI/LAB - IHS gpra print ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
I29 ;EP
OT ;
 S BGPN=16,BGPNP=46,BGPNB=86,BGPP1=1,BGPP2="2-5" D PRN Q:BGPQUIT
 S BGPN=16,BGPNP=46,BGPNB=86,BGPP1=2,BGPP2="6-11" D PRN Q:BGPQUIT
 S BGPN=16,BGPNP=46,BGPNB=86,BGPP1=3,BGPP2="12-19" D PRN Q:BGPQUIT
 S BGPN=16,BGPNP=46,BGPNB=86,BGPP1=4,BGPP2="20-24" D PRN Q:BGPQUIT
 S BGPN=16,BGPNP=46,BGPNB=86,BGPP1=5,BGPP2="25-34" D PRN Q:BGPQUIT
 S BGPN=20,BGPNP=50,BGPNB=90,BGPP1=3,BGPP2="35-44" D PRN Q:BGPQUIT
 S BGPN=20,BGPNP=50,BGPNB=90,BGPP1=4,BGPP2="45-54" D PRN Q:BGPQUIT
 S BGPN=20,BGPNP=50,BGPNB=90,BGPP1=5,BGPP2="55-64" D PRN Q:BGPQUIT
 S BGPN=20,BGPNP=50,BGPNB=90,BGPP1=6,BGPP2="OVER 64" D PRN Q:BGPQUIT
 Q
PRN ;
 D HEADER^BGPDPH Q:BGPQUIT
 W !,"Indicator 29:  Child Obesity",!
 W !,"Denominator is all active users "
 D H1^BGPDPH
 S BGPV=$$V(BGPRPT,BGPN,BGPP1),BGPCYD=$P($P(BGPV,"!",1),"~",1)+$P($P(BGPV,"!",2),"~",1),BGPCYN=$P($P(BGPV,"!",1),"~",2)+$P($P(BGPV,"!",2),"~",2),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98V=$$V(BGPRPT,BGPNB,BGPP1),BGP98D=$P($P(BGP98V,"!",1),"~",1)+$P($P(BGP98V,"!",2),"~",1),BGP98N=$P($P(BGP98V,"!",1),"~",2)+$P($P(BGP98V,"!",2),"~",2),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRV=$$V(BGPRPT,BGPNP,BGPP1),BGPPRD=$P($P(BGPPRV,"!",1),"~",1)+$P($P(BGPPRV,"!",2),"~",1),BGPPRN=$P($P(BGPPRV,"!",1),"~",2)+$P($P(BGPPRV,"!",2),"~",2),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# "_BGPP2_" yr olds",?22,$$C(BGP98D,0,8),?37,$$C(BGPPRD,0,8),?52,$$C(BGPCYD,0,8)
 W !,"# w/ BMI calculated"
 D H2^BGPDPH
 S BGPCYD=BGPCYN,BGPCYN=$P($P(BGPV,"!",1),"~",4)+$P($P(BGPV,"!",2),"~",4),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98D=BGP98N,BGP98N=$P($P(BGP98V,"!",1),"~",4)+$P($P(BGP98V,"!",2),"~",4),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRD=BGPPRN,BGPPRN=$P($P(BGPPRV,"!",1),"~",4)+$P($P(BGPPRV,"!",2),"~",4),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# obese"
 D H2^BGPDPH
 S BGPCYN=$P($P(BGPV,"!",1),"~",3)+$P($P(BGPV,"!",2),"~",3),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98N=$P($P(BGP98V,"!",1),"~",3)+$P($P(BGP98V,"!",2),"~",3),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRN=$P($P(BGPPRV,"!",1),"~",3)+$P($P(BGPPRV,"!",2),"~",3),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# overweight"
 D H2^BGPDPH
PRNF ;
 I $Y>(IOSL-5) D HEADER^BGPDPH Q:BGPQUIT  D H1^BGPDPH
 S BGPV=$$V(BGPRPT,BGPN,BGPP1),BGPCYD=$P($P(BGPV,"!",2),"~",1),BGPCYN=$P($P(BGPV,"!",2),"~",2),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98V=$$V(BGPRPT,BGPNB,BGPP1),BGP98D=$P($P(BGP98V,"!",2),"~",1),BGP98N=$P($P(BGP98V,"!",2),"~",2),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRV=$$V(BGPRPT,BGPNP,BGPP1),BGPPRD=$P($P(BGPPRV,"!",2),"~",1),BGPPRN=$P($P(BGPPRV,"!",2),"~",2),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !!!,"# FEMALE "_BGPP2_" yr olds",?22,$$C(BGP98D,0,8),?37,$$C(BGPPRD,0,8),?52,$$C(BGPCYD,0,8)
 W !,"# w/ BMI calculated"
 D H2^BGPDPH
 S BGPCYD=BGPCYN,BGPCYN=$P($P(BGPV,"!",2),"~",4),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98D=BGP98N,BGP98N=$P($P(BGP98V,"!",2),"~",4),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRD=BGPPRN,BGPPRN=$P($P(BGPPRV,"!",2),"~",4),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# obese"
 D H2^BGPDPH
 S BGPCYN=$P($P(BGPV,"!",2),"~",3),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98N=$P($P(BGP98V,"!",2),"~",3),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRN=$P($P(BGPPRV,"!",2),"~",3),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# overweight"
 D H2^BGPDPH
PRNM ;
 I $Y>(IOSL-5) D HEADER^BGPDPH Q:BGPQUIT  D H1^BGPDPH
 S BGPV=$$V(BGPRPT,BGPN,BGPP1),BGPCYD=$P($P(BGPV,"!",1),"~",1),BGPCYN=$P($P(BGPV,"!",1),"~",2),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98V=$$V(BGPRPT,BGPNB,BGPP1),BGP98D=$P($P(BGP98V,"!",1),"~",1),BGP98N=$P($P(BGP98V,"!",1),"~",2),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRV=$$V(BGPRPT,BGPNP,BGPP1),BGPPRD=$P($P(BGPPRV,"!",1),"~",1),BGPPRN=$P($P(BGPPRV,"!",1),"~",2),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !!!,"# MALE "_BGPP2_" yr olds",?22,$$C(BGP98D,0,8),?37,$$C(BGPPRD,0,8),?52,$$C(BGPCYD,0,8)
 W !,"# w/ BMI calculated"
 D H2^BGPDPH
 S BGPCYD=BGPCYN,BGPCYN=$P($P(BGPV,"!",1),"~",4),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98D=BGP98N,BGP98N=$P($P(BGP98V,"!",1),"~",4),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRD=BGPPRN,BGPPRN=$P($P(BGPPRV,"!",1),"~",4),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# obese"
 D H2^BGPDPH
 S BGPCYN=$P($P(BGPV,"!",1),"~",3),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
 S BGP98N=$P($P(BGP98V,"!",1),"~",3),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
 S BGPPRN=$P($P(BGPPRV,"!",1),"~",3),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
 W !,"# overweight"
 D H2^BGPDPH
 Q
 ;
V(R,N,P) ;
 NEW Y
 I $G(BGPAREAA),'$G(BGPSUMR) G VA
 Q $P($G(^BGPD(R,N)),U,P)
VA ;
 NEW X,C,V,MT,FT,M,F,B S X=0,C="" F  S X=$O(BGPSUL(X)) Q:X'=+X  D
 .S V=$P($G(^BGPD(X,N)),U,P)
 .I C="" S C=V Q
 .S MT=$P(C,"!"),FT=$P(C,"!",2),M=$P(V,"!"),F=$P(V,"!",2)
 .F B=1:1:6 S $P(MT,"~",B)=$P(MT,"~",B)+$P(M,"~",B)
 .F B=1:1:6 S $P(FT,"~",B)=$P(FT,"~",B)+$P(F,"~",B)
 .S C=MT_"!"_FT
 .Q
 Q C
C(X,X2,X3) ;
 D COMMA^%DTC
 Q X