- APCLPIF1 ; IHS/CMI/LAB - INFANT FEEDING REPORT #1 ;
- ;;2.0;IHS PCC SUITE;;MAY 14, 2009
- ;
- ;
- ;
- EP ;EP - called from option interactive
- D EOJ
- W:$D(IOF) @IOF
- S APCLTEXT="INTROT" F APCLJ=1:1 S APCLX=$T(@APCLTEXT+APCLJ) Q:$P(APCLX,";;",2)="END" D
- .S APCLT=$P(APCLX,";;",2)
- .I $Y>(IOSL-2) K DIR S DIR(0)="E",DIR("A")="Press enter to continue" D ^DIR K DIR W:$D(IOF) @IOF
- .W !,APCLT
- ENDDATE ;
- S APCLED=""
- W !!
- S DIR(0)="D^::EPX",DIR("A")="Enter the As of Date to calculate the patient's age" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) D EOJ Q
- S APCLED=Y
- S APCLBDOB=$$FMADD^XLFDT(APCLED,-1)
- S APCLBDOB=($E(APCLBDOB,1,3)-2)_$E(APCLBDOB,4,7)
- S APCLEDOB=($E(APCLBDOB,1,3)+1)_$E(APCLED,4,7)
- CMMNTS ;
- K APCLCOMM S APCLCOMT=""
- S DIR(0)="S^O:One particular Community;A:All Communities;S:Selected Set of Communities (Taxonomy)",DIR("A")="List patients who live in",DIR("B")="A" K DA D ^DIR K DIR
- I $D(DIRUT) G ENDDATE
- S APCLCOMT=Y
- I APCLCOMT="A" G ZIS
- I APCLCOMT="O" D G:'$D(APCLCOMM) CMMNTS G ZIS
- .S DIC="^AUTTCOM(",DIC(0)="AEMQ",DIC("A")="Which COMMUNITY: " D ^DIC K DIC
- .Q:Y=-1
- .S APCLCOMM($P(^AUTTCOM(+Y,0),U))=""
- S X="COMMUNITY",DIC="^AMQQ(5,",DIC(0)="FM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" S APCLERR=1 Q
- D PEP^AMQQGTX0(+Y,"APCLCOMM(")
- I '$D(APCLCOMM) G CMMNTS
- I $D(APCLCOMM("*")) K APCLCOMM G CMMNTS
- ZIS ;
- DEMO ;
- D DEMOCHK^APCLUTL(.APCLDEMO)
- I APCLDEMO=-1 G CMMNTS
- W !!,"Patients with the following birthdates with be reviewed in this"
- W !,"report: ",$$FMTE^XLFDT(APCLBDOB)," - ",$$FMTE^XLFDT(APCLEDOB),!
- W !,"Patients from the following communities will be included:"
- I APCLCOMT="A" W !?5,"All communities"
- I APCLCOMT'="A" W !?3 S X=0 F S X=$O(APCLCOMM(X)) Q:X="" W " ",X
- W !! S XBRP="PRINT^APCLPIF1",XBRC="PROC^APCLPIF1",XBRX="EOJ^APCLPIF1",XBNS="APCL"
- D ^XBDBQUE
- Q
- EOJ ;
- D ^XBFMK
- K DIC,DIR
- D EN^XBVK("APCL")
- Q
- ;
- PROC ;
- S APCLJ=$J,APCLH=$H
- S ^XTMP("APCLPIF1",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"INFANT FEEDING REPORT"
- S APCLD0=""
- S APCLD6=""
- S APCLDOB=$$FMADD^XLFDT(APCLBDOB,-1),DFN=0
- F S APCLDOB=$O(^DPT("ADOB",APCLDOB)) Q:APCLDOB=""!(APCLDOB>APCLEDOB) D
- .S DFN=0 F S DFN=$O(^DPT("ADOB",APCLDOB,DFN)) Q:DFN'=+DFN D
- ..;birth stats
- ..Q:$$DEMO^APCLUTL(DFN,$G(APCLDEMO))
- ..S APCLPCV0=""
- ..S APCLBVD=APCLDOB
- ..;S APCLBS=$P($G(^AUPNBMSR(DFN,0)),U,15)
- ..S APCLEVD=$$FMADD^XLFDT(APCLDOB,179)
- ..S APCL06=0
- ..D PCV
- ..I APCLPCV0 S $P(APCLD0,U,1)=$P(APCLD0,U,1)+1 D
- ...;I $D(APCLINF)!(APCLBS]"") S $P(APCLD0,U,2)=$P(APCLD0,U,2)+1
- ...I $D(APCLINF) S $P(APCLD0,U,2)=$P(APCLD0,U,2)+1
- ...S (G,Y)=0 F S Y=$O(APCLINF(Y)) Q:Y'=+Y!(G) I APCLINF(Y)'=5 S G=1
- ...;I 'G,APCLBS]"",APCLBS>1 S G=1
- ...I G S $P(APCLD0,U,3)=$P(APCLD0,U,3)+1
- ..;SIX MONTHS
- ..S APCLPCV6=0
- ..S APCLBVD=$$FMADD^XLFDT(APCLDOB,180)
- ..S APCLEVD=$$FMADD^XLFDT(APCLDOB,365)
- ..S APCL06=6
- ..D PCV
- ..I APCLPCV6 S $P(APCLD6,U,1)=$P(APCLD6,U,1)+1 D
- ...;I $D(APCLINF)!(APCLBS]"") S $P(APCLD6,U,2)=$P(APCLD6,U,2)+1
- ...I $D(APCLINF) S $P(APCLD6,U,2)=$P(APCLD6,U,2)+1
- ...S (G,Y)=0 F S Y=$O(APCLINF(Y)) Q:Y'=+Y!(G) I APCLINF(Y)'=5 S G=1
- ...;I 'G,APCLBS]"",APCLBS>180 S G=1
- ...I G S $P(APCLD6,U,3)=$P(APCLD6,U,3)+1
- ..Q
- .Q
- Q
- DONE ;
- I $E(IOST)="C",IO=IO(0) S DIR(0)="EO",DIR("A")="End of report. PRESS ENTER" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- W:$D(IOF) @IOF
- K APCLTS,APCLS,APCLM,APCLET
- K ^XTMP("APCLPIF1",APCLJ,APCLH),APCLJ,APCLH
- Q
- ;
- PCV ;
- ;get all visits in date range
- ;table all infant feeding in time range
- K ^TMP($J,"A"),APCLINF
- S A="^TMP($J,""A"",",B=DFN_"^ALL VISITS;DURING "_$$FMTE^XLFDT(APCLBVD)_"-"_$$FMTE^XLFDT(APCLEVD),E=$$START1^APCLDF(B,A)
- S (X,G,F,S)=0 F S X=$O(^TMP($J,"A",X)) Q:X'=+X S V=$P(^TMP($J,"A",X),U,5) D
- .Q:'$D(^AUPNVSIT(V,0))
- .Q:'$P(^AUPNVSIT(V,0),U,9)
- .Q:$P(^AUPNVSIT(V,0),U,11)
- .Q:'$D(^AUPNVPRV("AD",V))
- .Q:"SAHO"'[$P(^AUPNVSIT(V,0),U,7)
- .Q:"V"[$P(^AUPNVSIT(V,0),U,3)
- .S B=$$CLINIC^APCLV(V,"C")
- .Q:B=""
- .I $D(^BGPCTRL(3,11,"B",B)) S G=1 ;must be a primary clinic S G=V
- .;table infant feeding choice
- .Q:'$D(^AUPNVIF("AD",V))
- .S Y=0 F S Y=$O(^AUPNVIF("AD",V,Y)) Q:Y'=+Y S APCLINF($P($P(^AUPNVSIT(V,0),U),"."))=$$VALI^XBDIQ1(9000010.44,Y,.01)
- .Q
- I G D
- .I APCL06=0 S APCLPCV0=1
- .I APCL06=6 S APCLPCV6=1
- .Q
- Q
- ;
- PRINT ;EP - called from xbdbque
- S APCLQ=0
- D COVER
- Q:APCLQ
- D HEADER
- W !,"BREASTFEEDING AT BIRTH",!
- W !?2,"w/visit",?30,$$C($P(APCLD0,U,1),0,6)
- W !?2,"w/data recorded",?30,$$C($P(APCLD0,U,2),0,6)
- I $P(APCLD0,U,1) S X=($P(APCLD0,U,2)/$P(APCLD0,U,1))*100 W ?39,$J(X,6,1)
- I '$P(APCLD0,U,1) W ?39,$J("0.0",6,1)
- W !?2,"Breastfeeding",?30,$$C($P(APCLD0,U,3),0,6)
- I $P(APCLD0,U,2) S X=($P(APCLD0,U,3)/$P(APCLD0,U,2))*100 W ?39,$J(X,6,1)
- I '$P(APCLD0,U,2) W ?39,$J("0.0",6,1)
- W ?55,"75%",?65,"71%",?75,"69%"
- W !!,"BREASTFEEDING AT 6 MONTHS",!
- W !?2,"w/visit",?30,$$C($P(APCLD6,U,1),0,6)
- W !?2,"w/data recorded",?30,$$C($P(APCLD6,U,2),0,6)
- I $P(APCLD6,U,1) S X=($P(APCLD6,U,2)/$P(APCLD6,U,1))*100 W ?39,$J(X,6,1)
- I '$P(APCLD6,U,1) W ?39,$J("0.0",6,1)
- W !?2,"Breastfeeding",?30,$$C($P(APCLD6,U,3),0,6)
- I $P(APCLD6,U,2) S X=($P(APCLD6,U,3)/$P(APCLD6,U,2))*100 W ?39,$J(X,6,1)
- I '$P(APCLD6,U,2) W ?39,$J("0.0",6,1)
- W ?55,"50%",?65,"36%",?75,"32%"
- W !
- D DONE
- Q
- G:'APCLPG HEADER1
- K DIR I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQ=1 Q
- W:$D(IOF) @IOF S APCLPG=APCLPG+1
- W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",APCLPG,!
- W $$CTR($P(^DIC(4,DUZ(2),0),U),80),!
- W !,$$CTR("INFANT BREASTFEEDING STATISTICS, as of "_$$FMTE^XLFDT(APCLEDOB),80),!
- S X="Patients born "_$$FMTE^XLFDT(APCLBDOB)_" - "_$$FMTE^XLFDT(APCLEDOB) W $$CTR(X,80),!
- W $TR($J("",80)," ","-"),!
- W !?30,$E($P(^DIC(4,DUZ(2),0),U),1,15),?53,"HP 2010",?63,"NATIONAL",?73,"2003",!?63,"USA RATE",?73,"AI/AN",!
- W ?32,"#",?42,"%",?55,"%",?65,"%",?75,"%",!
- W $TR($J("",80)," ","-"),!
- Q
- C(X,X2,X3) ;
- D COMMA^%DTC
- Q X
- 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.
- K DIR I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQ=1 Q
- W:$D(IOF) @IOF
- W !,$$CTR("COVER PAGE",80)
- W !!,$$CTR($P(^DIC(4,DUZ(2),0),U),80)
- W !,$$CTR("INFANT BREASTFEEDING STATISTICS, as of "_$$FMTE^XLFDT(APCLEDOB),80),!
- S X="Report Run By: "_$P(^VA(200,DUZ,0),U) W !,$$CTR(X,80)
- S X="Date Report Run: "_$$FMTE^XLFDT(DT) W !,$$CTR(X,80),!
- Q
- ;----------
- USR() ;EP - Return name of current user from ^VA(200.
- Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
- ;----------
- LOC() ;EP - Return location name from file 4 based on DUZ(2).
- Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
- ;----------
- INTROT ;
- ;;This option will produce a report of how many infants were documented as
- ;;being breast fed at birth and at age 6 months.
- ;;
- ;;You will select the "as of" date (report end date) and the communities you
- ;;want to report on. The report first identifies all patients who are ages
- ;;12-23 months on the "as of" date you defined.
- ;;
- ;;The report calculates the infants to report on from this initial population.
- ;;
- ;; BIRTH breastfeeding statistics:
- ;;
- ;; Denominator: Number of Infants with a visit - patients who had at least
- ;; one visit to a primary care clinic between birth and 6 months
- ;; (ages 1-179 days old).
- ;;
- ;; Numerators:
- ;; 1. infants with feeding data - any patient with a visit with any infant
- ;; feeding choice documented between birth and 6 months (0-179 days old)
- ;; 2. infants breastfeeding - of the patients with feeding data (numerator
- ;; #1), those with ANY infant feeding choice that includes breastfeeding
- ;; (e.g., NOT formula only). The report looks chronologically at all visits
- ;; in the timeframe with feeding documentation and counts the patient as
- ;; meeting the numerator as soon as the first feeding choice that includes
- ;; breastfeeding is found.
- ;;
- ;; 6 MONTH statistics:
- ;; same as BIRTH except the visits reviewed are those that
- ;; occured between 180-365 days old
- ;;END
- COVER ;;
- S APCLPG=0
- W !,$$CTR("COVER PAGE",80)
- W !!,$$CTR($P(^DIC(4,DUZ(2),0),U),80)
- W !,$$CTR("INFANT BREASTFEEDING STATISTICS, as of "_$$FMTE^XLFDT(APCLEDOB),80)
- S X="Report Run By: "_$P(^VA(200,DUZ,0),U) W !,$$CTR(X,80)
- S X="Date Report Run: "_$$FMTE^XLFDT(DT) W !,$$CTR(X,80)
- W !!,"Population Reviewed: All patients with birthdates ",$$FMTE^XLFDT(APCLBDOB)," to ",$$FMTE^XLFDT(APCLEDOB)
- W !,"Community of Residence: "
- I APCLCOMT="O" W " ",$O(APCLCOMM(""))
- I APCLCOMT="A" W " ","All Communities"
- I APCLCOMT="S" S C=0,X="" F S X=$O(APCLCOMM(X)) Q:X="" W:C "; " W X S C=C+1
- ;now text
- S APCLTEXT="COVERT" F APCLJ=1:1 S APCLX=$T(@APCLTEXT+APCLJ) Q:$P(APCLX,";;",2)="END"!(APCLQ) D
- .S APCLT=$P(APCLX,";;",2)
- .I $Y>(IOSL-3) D EOP Q:APCLQ
- .W !,APCLT
- .Q
- Q
- COVERT ;;
- ;;
- ;;BIRTH breastfeeding statistics:
- ;;
- ;; Denominator: Number of Infants with a visit - patients who had at least
- ;; one visit to a primary care clinic between birth and 6 months
- ;; (ages 1-179 days old).
- ;;
- ;; Numerators:
- ;; 1. with feeding data - any patient with a visit with any infant
- ;; feeding choice documented between birth and 6 months (0-179 days old)
- ;; 2. breastfeeding - of the patients with feeding data (numerator
- ;; #1), those with ANY infant feeding choice that includes breastfeeding
- ;; (e.g., NOT formula only). The report looks chronologically at all visits
- ;; in the timeframe with feeding documentation and counts the patient as
- ;; meeting the numerator as soon as the first feeding choice that includes
- ;; breastfeeding is found.
- ;;
- ;; 6 MONTH statistics:
- ;; same as BIRTH except the visits reviewed are those that
- ;; occured between 180-365 days old
- ;;
- ;;The report documents the site performance against three national performance
- ;;measures for breastfeeding; Healthy People 2010 goal; National USA rate for
- ;;[YY] from (what report); and 2003 data for American Indian and Alaska
- ;;Natives from (what report).
- ;;
- ;;END
- APCLPIF1 ; IHS/CMI/LAB - INFANT FEEDING REPORT #1 ;
- +1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
- +2 ;
- +3 ;
- +4 ;
- EP ;EP - called from option interactive
- +1 DO EOJ
- +2 IF $DATA(IOF)
- WRITE @IOF
- +3 SET APCLTEXT="INTROT"
- FOR APCLJ=1:1
- SET APCLX=$TEXT(@APCLTEXT+APCLJ)
- IF $PIECE(APCLX,";;",2)="END"
- QUIT
- Begin DoDot:1
- +4 SET APCLT=$PIECE(APCLX,";;",2)
- +5 IF $Y>(IOSL-2)
- KILL DIR
- SET DIR(0)="E"
- SET DIR("A")="Press enter to continue"
- DO ^DIR
- KILL DIR
- IF $DATA(IOF)
- WRITE @IOF
- +6 WRITE !,APCLT
- End DoDot:1
- ENDDATE ;
- +1 SET APCLED=""
- +2 WRITE !!
- +3 SET DIR(0)="D^::EPX"
- SET DIR("A")="Enter the As of Date to calculate the patient's age"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- DO EOJ
- QUIT
- +5 SET APCLED=Y
- +6 SET APCLBDOB=$$FMADD^XLFDT(APCLED,-1)
- +7 SET APCLBDOB=($EXTRACT(APCLBDOB,1,3)-2)_$EXTRACT(APCLBDOB,4,7)
- +8 SET APCLEDOB=($EXTRACT(APCLBDOB,1,3)+1)_$EXTRACT(APCLED,4,7)
- CMMNTS ;
- +1 KILL APCLCOMM
- SET APCLCOMT=""
- +2 SET DIR(0)="S^O:One particular Community;A:All Communities;S:Selected Set of Communities (Taxonomy)"
- SET DIR("A")="List patients who live in"
- SET DIR("B")="A"
- KILL DA
- DO ^DIR
- KILL DIR
- +3 IF $DATA(DIRUT)
- GOTO ENDDATE
- +4 SET APCLCOMT=Y
- +5 IF APCLCOMT="A"
- GOTO ZIS
- +6 IF APCLCOMT="O"
- Begin DoDot:1
- +7 SET DIC="^AUTTCOM("
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which COMMUNITY: "
- DO ^DIC
- KILL DIC
- +8 IF Y=-1
- QUIT
- +9 SET APCLCOMM($PIECE(^AUTTCOM(+Y,0),U))=""
- End DoDot:1
- IF '$DATA(APCLCOMM)
- GOTO CMMNTS
- GOTO ZIS
- +10 SET X="COMMUNITY"
- SET DIC="^AMQQ(5,"
- SET DIC(0)="FM"
- SET DIC("S")="I $P(^(0),U,14)"
- DO ^DIC
- KILL DIC,DA
- IF Y=-1
- WRITE "OOPS - QMAN NOT CURRENT - QUITTING"
- SET APCLERR=1
- QUIT
- +11 DO PEP^AMQQGTX0(+Y,"APCLCOMM(")
- +12 IF '$DATA(APCLCOMM)
- GOTO CMMNTS
- +13 IF $DATA(APCLCOMM("*"))
- KILL APCLCOMM
- GOTO CMMNTS
- ZIS ;
- DEMO ;
- +1 DO DEMOCHK^APCLUTL(.APCLDEMO)
- +2 IF APCLDEMO=-1
- GOTO CMMNTS
- +3 WRITE !!,"Patients with the following birthdates with be reviewed in this"
- +4 WRITE !,"report: ",$$FMTE^XLFDT(APCLBDOB)," - ",$$FMTE^XLFDT(APCLEDOB),!
- +5 WRITE !,"Patients from the following communities will be included:"
- +6 IF APCLCOMT="A"
- WRITE !?5,"All communities"
- +7 IF APCLCOMT'="A"
- WRITE !?3
- SET X=0
- FOR
- SET X=$ORDER(APCLCOMM(X))
- IF X=""
- QUIT
- WRITE " ",X
- +8 WRITE !!
- SET XBRP="PRINT^APCLPIF1"
- SET XBRC="PROC^APCLPIF1"
- SET XBRX="EOJ^APCLPIF1"
- SET XBNS="APCL"
- +9 DO ^XBDBQUE
- +10 QUIT
- EOJ ;
- +1 DO ^XBFMK
- +2 KILL DIC,DIR
- +3 DO EN^XBVK("APCL")
- +4 QUIT
- +5 ;
- PROC ;
- +1 SET APCLJ=$JOB
- SET APCLH=$HOROLOG
- +2 SET ^XTMP("APCLPIF1",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"INFANT FEEDING REPORT"
- +3 SET APCLD0=""
- +4 SET APCLD6=""
- +5 SET APCLDOB=$$FMADD^XLFDT(APCLBDOB,-1)
- SET DFN=0
- +6 FOR
- SET APCLDOB=$ORDER(^DPT("ADOB",APCLDOB))
- IF APCLDOB=""!(APCLDOB>APCLEDOB)
- QUIT
- Begin DoDot:1
- +7 SET DFN=0
- FOR
- SET DFN=$ORDER(^DPT("ADOB",APCLDOB,DFN))
- IF DFN'=+DFN
- QUIT
- Begin DoDot:2
- +8 ;birth stats
- +9 IF $$DEMO^APCLUTL(DFN,$GET(APCLDEMO))
- QUIT
- +10 SET APCLPCV0=""
- +11 SET APCLBVD=APCLDOB
- +12 ;S APCLBS=$P($G(^AUPNBMSR(DFN,0)),U,15)
- +13 SET APCLEVD=$$FMADD^XLFDT(APCLDOB,179)
- +14 SET APCL06=0
- +15 DO PCV
- +16 IF APCLPCV0
- SET $PIECE(APCLD0,U,1)=$PIECE(APCLD0,U,1)+1
- Begin DoDot:3
- +17 ;I $D(APCLINF)!(APCLBS]"") S $P(APCLD0,U,2)=$P(APCLD0,U,2)+1
- +18 IF $DATA(APCLINF)
- SET $PIECE(APCLD0,U,2)=$PIECE(APCLD0,U,2)+1
- +19 SET (G,Y)=0
- FOR
- SET Y=$ORDER(APCLINF(Y))
- IF Y'=+Y!(G)
- QUIT
- IF APCLINF(Y)'=5
- SET G=1
- +20 ;I 'G,APCLBS]"",APCLBS>1 S G=1
- +21 IF G
- SET $PIECE(APCLD0,U,3)=$PIECE(APCLD0,U,3)+1
- End DoDot:3
- +22 ;SIX MONTHS
- +23 SET APCLPCV6=0
- +24 SET APCLBVD=$$FMADD^XLFDT(APCLDOB,180)
- +25 SET APCLEVD=$$FMADD^XLFDT(APCLDOB,365)
- +26 SET APCL06=6
- +27 DO PCV
- +28 IF APCLPCV6
- SET $PIECE(APCLD6,U,1)=$PIECE(APCLD6,U,1)+1
- Begin DoDot:3
- +29 ;I $D(APCLINF)!(APCLBS]"") S $P(APCLD6,U,2)=$P(APCLD6,U,2)+1
- +30 IF $DATA(APCLINF)
- SET $PIECE(APCLD6,U,2)=$PIECE(APCLD6,U,2)+1
- +31 SET (G,Y)=0
- FOR
- SET Y=$ORDER(APCLINF(Y))
- IF Y'=+Y!(G)
- QUIT
- IF APCLINF(Y)'=5
- SET G=1
- +32 ;I 'G,APCLBS]"",APCLBS>180 S G=1
- +33 IF G
- SET $PIECE(APCLD6,U,3)=$PIECE(APCLD6,U,3)+1
- End DoDot:3
- +34 QUIT
- End DoDot:2
- +35 QUIT
- End DoDot:1
- +36 QUIT
- DONE ;
- +1 IF $EXTRACT(IOST)="C"
- IF IO=IO(0)
- SET DIR(0)="EO"
- SET DIR("A")="End of report. PRESS ENTER"
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +2 IF $DATA(IOF)
- WRITE @IOF
- +3 KILL APCLTS,APCLS,APCLM,APCLET
- +4 KILL ^XTMP("APCLPIF1",APCLJ,APCLH),APCLJ,APCLH
- +5 QUIT
- +6 ;
- PCV ;
- +1 ;get all visits in date range
- +2 ;table all infant feeding in time range
- +3 KILL ^TMP($JOB,"A"),APCLINF
- +4 SET A="^TMP($J,""A"","
- SET B=DFN_"^ALL VISITS;DURING "_$$FMTE^XLFDT(APCLBVD)_"-"_$$FMTE^XLFDT(APCLEVD)
- SET E=$$START1^APCLDF(B,A)
- +5 SET (X,G,F,S)=0
- FOR
- SET X=$ORDER(^TMP($JOB,"A",X))
- IF X'=+X
- QUIT
- SET V=$PIECE(^TMP($JOB,"A",X),U,5)
- Begin DoDot:1
- +6 IF '$DATA(^AUPNVSIT(V,0))
- QUIT
- +7 IF '$PIECE(^AUPNVSIT(V,0),U,9)
- QUIT
- +8 IF $PIECE(^AUPNVSIT(V,0),U,11)
- QUIT
- +9 IF '$DATA(^AUPNVPRV("AD",V))
- QUIT
- +10 IF "SAHO"'[$PIECE(^AUPNVSIT(V,0),U,7)
- QUIT
- +11 IF "V"[$PIECE(^AUPNVSIT(V,0),U,3)
- QUIT
- +12 SET B=$$CLINIC^APCLV(V,"C")
- +13 IF B=""
- QUIT
- +14 ;must be a primary clinic S G=V
- IF $DATA(^BGPCTRL(3,11,"B",B))
- SET G=1
- +15 ;table infant feeding choice
- +16 IF '$DATA(^AUPNVIF("AD",V))
- QUIT
- +17 SET Y=0
- FOR
- SET Y=$ORDER(^AUPNVIF("AD",V,Y))
- IF Y'=+Y
- QUIT
- SET APCLINF($PIECE($PIECE(^AUPNVSIT(V,0),U),"."))=$$VALI^XBDIQ1(9000010.44,Y,.01)
- +18 QUIT
- End DoDot:1
- +19 IF G
- Begin DoDot:1
- +20 IF APCL06=0
- SET APCLPCV0=1
- +21 IF APCL06=6
- SET APCLPCV6=1
- +22 QUIT
- End DoDot:1
- +23 QUIT
- +24 ;
- PRINT ;EP - called from xbdbque
- +1 SET APCLQ=0
- +2 DO COVER
- +3 IF APCLQ
- QUIT
- +4 DO HEADER
- +5 WRITE !,"BREASTFEEDING AT BIRTH",!
- +6 WRITE !?2,"w/visit",?30,$$C($PIECE(APCLD0,U,1),0,6)
- +7 WRITE !?2,"w/data recorded",?30,$$C($PIECE(APCLD0,U,2),0,6)
- +8 IF $PIECE(APCLD0,U,1)
- SET X=($PIECE(APCLD0,U,2)/$PIECE(APCLD0,U,1))*100
- WRITE ?39,$JUSTIFY(X,6,1)
- +9 IF '$PIECE(APCLD0,U,1)
- WRITE ?39,$JUSTIFY("0.0",6,1)
- +10 WRITE !?2,"Breastfeeding",?30,$$C($PIECE(APCLD0,U,3),0,6)
- +11 IF $PIECE(APCLD0,U,2)
- SET X=($PIECE(APCLD0,U,3)/$PIECE(APCLD0,U,2))*100
- WRITE ?39,$JUSTIFY(X,6,1)
- +12 IF '$PIECE(APCLD0,U,2)
- WRITE ?39,$JUSTIFY("0.0",6,1)
- +13 WRITE ?55,"75%",?65,"71%",?75,"69%"
- +14 WRITE !!,"BREASTFEEDING AT 6 MONTHS",!
- +15 WRITE !?2,"w/visit",?30,$$C($PIECE(APCLD6,U,1),0,6)
- +16 WRITE !?2,"w/data recorded",?30,$$C($PIECE(APCLD6,U,2),0,6)
- +17 IF $PIECE(APCLD6,U,1)
- SET X=($PIECE(APCLD6,U,2)/$PIECE(APCLD6,U,1))*100
- WRITE ?39,$JUSTIFY(X,6,1)
- +18 IF '$PIECE(APCLD6,U,1)
- WRITE ?39,$JUSTIFY("0.0",6,1)
- +19 WRITE !?2,"Breastfeeding",?30,$$C($PIECE(APCLD6,U,3),0,6)
- +20 IF $PIECE(APCLD6,U,2)
- SET X=($PIECE(APCLD6,U,3)/$PIECE(APCLD6,U,2))*100
- WRITE ?39,$JUSTIFY(X,6,1)
- +21 IF '$PIECE(APCLD6,U,2)
- WRITE ?39,$JUSTIFY("0.0",6,1)
- +22 WRITE ?55,"50%",?65,"36%",?75,"32%"
- +23 WRITE !
- +24 DO DONE
- +25 QUIT
- +1 IF 'APCLPG
- GOTO HEADER1
- +2 KILL DIR
- IF $EXTRACT(IOST)="C"
- IF IO=IO(0)
- WRITE !
- SET DIR(0)="EO"
- DO ^DIR
- KILL DIR
- IF Y=0!(Y="^")!($DATA(DTOUT))
- SET APCLQ=1
- QUIT
- +1 IF $DATA(IOF)
- WRITE @IOF
- SET APCLPG=APCLPG+1
- +2 WRITE !?3,$PIECE(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",APCLPG,!
- +3 WRITE $$CTR($PIECE(^DIC(4,DUZ(2),0),U),80),!
- +4 WRITE !,$$CTR("INFANT BREASTFEEDING STATISTICS, as of "_$$FMTE^XLFDT(APCLEDOB),80),!
- +5 SET X="Patients born "_$$FMTE^XLFDT(APCLBDOB)_" - "_$$FMTE^XLFDT(APCLEDOB)
- WRITE $$CTR(X,80),!
- +6 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
- +7 WRITE !?30,$EXTRACT($PIECE(^DIC(4,DUZ(2),0),U),1,15),?53,"HP 2010",?63,"NATIONAL",?73,"2003",!?63,"USA RATE",?73,"AI/AN",!
- +8 WRITE ?32,"#",?42,"%",?55,"%",?65,"%",?75,"%",!
- +9 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
- +10 QUIT
- C(X,X2,X3) ;
- +1 DO COMMA^%DTC
- +2 QUIT X
- CTR(X,Y) ;EP - Center X in a field Y wide.
- +1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
- +2 ;----------
- EOP ;EP - End of page.
- +1 KILL DIR
- IF $EXTRACT(IOST)="C"
- IF IO=IO(0)
- WRITE !
- SET DIR(0)="EO"
- DO ^DIR
- KILL DIR
- IF Y=0!(Y="^")!($DATA(DTOUT))
- SET APCLQ=1
- QUIT
- +2 IF $DATA(IOF)
- WRITE @IOF
- +3 WRITE !,$$CTR("COVER PAGE",80)
- +4 WRITE !!,$$CTR($PIECE(^DIC(4,DUZ(2),0),U),80)
- +5 WRITE !,$$CTR("INFANT BREASTFEEDING STATISTICS, as of "_$$FMTE^XLFDT(APCLEDOB),80),!
- +6 SET X="Report Run By: "_$PIECE(^VA(200,DUZ,0),U)
- WRITE !,$$CTR(X,80)
- +7 SET X="Date Report Run: "_$$FMTE^XLFDT(DT)
- WRITE !,$$CTR(X,80),!
- +8 QUIT
- +9 ;----------
- USR() ;EP - Return name of current user from ^VA(200.
- +1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
- +2 ;----------
- LOC() ;EP - Return location name from file 4 based on DUZ(2).
- +1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
- +2 ;----------
- INTROT ;
- +1 ;;This option will produce a report of how many infants were documented as
- +2 ;;being breast fed at birth and at age 6 months.
- +3 ;;
- +4 ;;You will select the "as of" date (report end date) and the communities you
- +5 ;;want to report on. The report first identifies all patients who are ages
- +6 ;;12-23 months on the "as of" date you defined.
- +7 ;;
- +8 ;;The report calculates the infants to report on from this initial population.
- +9 ;;
- +10 ;; BIRTH breastfeeding statistics:
- +11 ;;
- +12 ;; Denominator: Number of Infants with a visit - patients who had at least
- +13 ;; one visit to a primary care clinic between birth and 6 months
- +14 ;; (ages 1-179 days old).
- +15 ;;
- +16 ;; Numerators:
- +17 ;; 1. infants with feeding data - any patient with a visit with any infant
- +18 ;; feeding choice documented between birth and 6 months (0-179 days old)
- +19 ;; 2. infants breastfeeding - of the patients with feeding data (numerator
- +20 ;; #1), those with ANY infant feeding choice that includes breastfeeding
- +21 ;; (e.g., NOT formula only). The report looks chronologically at all visits
- +22 ;; in the timeframe with feeding documentation and counts the patient as
- +23 ;; meeting the numerator as soon as the first feeding choice that includes
- +24 ;; breastfeeding is found.
- +25 ;;
- +26 ;; 6 MONTH statistics:
- +27 ;; same as BIRTH except the visits reviewed are those that
- +28 ;; occured between 180-365 days old
- +29 ;;END
- COVER ;;
- +1 SET APCLPG=0
- +2 WRITE !,$$CTR("COVER PAGE",80)
- +3 WRITE !!,$$CTR($PIECE(^DIC(4,DUZ(2),0),U),80)
- +4 WRITE !,$$CTR("INFANT BREASTFEEDING STATISTICS, as of "_$$FMTE^XLFDT(APCLEDOB),80)
- +5 SET X="Report Run By: "_$PIECE(^VA(200,DUZ,0),U)
- WRITE !,$$CTR(X,80)
- +6 SET X="Date Report Run: "_$$FMTE^XLFDT(DT)
- WRITE !,$$CTR(X,80)
- +7 WRITE !!,"Population Reviewed: All patients with birthdates ",$$FMTE^XLFDT(APCLBDOB)," to ",$$FMTE^XLFDT(APCLEDOB)
- +8 WRITE !,"Community of Residence: "
- +9 IF APCLCOMT="O"
- WRITE " ",$ORDER(APCLCOMM(""))
- +10 IF APCLCOMT="A"
- WRITE " ","All Communities"
- +11 IF APCLCOMT="S"
- SET C=0
- SET X=""
- FOR
- SET X=$ORDER(APCLCOMM(X))
- IF X=""
- QUIT
- IF C
- WRITE "; "
- WRITE X
- SET C=C+1
- +12 ;now text
- +13 SET APCLTEXT="COVERT"
- FOR APCLJ=1:1
- SET APCLX=$TEXT(@APCLTEXT+APCLJ)
- IF $PIECE(APCLX,";;",2)="END"!(APCLQ)
- QUIT
- Begin DoDot:1
- +14 SET APCLT=$PIECE(APCLX,";;",2)
- +15 IF $Y>(IOSL-3)
- DO EOP
- IF APCLQ
- QUIT
- +16 WRITE !,APCLT
- +17 QUIT
- End DoDot:1
- +18 QUIT
- COVERT ;;
- +1 ;;
- +2 ;;BIRTH breastfeeding statistics:
- +3 ;;
- +4 ;; Denominator: Number of Infants with a visit - patients who had at least
- +5 ;; one visit to a primary care clinic between birth and 6 months
- +6 ;; (ages 1-179 days old).
- +7 ;;
- +8 ;; Numerators:
- +9 ;; 1. with feeding data - any patient with a visit with any infant
- +10 ;; feeding choice documented between birth and 6 months (0-179 days old)
- +11 ;; 2. breastfeeding - of the patients with feeding data (numerator
- +12 ;; #1), those with ANY infant feeding choice that includes breastfeeding
- +13 ;; (e.g., NOT formula only). The report looks chronologically at all visits
- +14 ;; in the timeframe with feeding documentation and counts the patient as
- +15 ;; meeting the numerator as soon as the first feeding choice that includes
- +16 ;; breastfeeding is found.
- +17 ;;
- +18 ;; 6 MONTH statistics:
- +19 ;; same as BIRTH except the visits reviewed are those that
- +20 ;; occured between 180-365 days old
- +21 ;;
- +22 ;;The report documents the site performance against three national performance
- +23 ;;measures for breastfeeding; Healthy People 2010 goal; National USA rate for
- +24 ;;[YY] from (what report); and 2003 data for American Indian and Alaska
- +25 ;;Natives from (what report).
- +26 ;;
- +27 ;;END