APCLPIF2 ; 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^APCLPIF2",XBRC="PROC^APCLPIF2",XBRX="EOJ^APCLPIF2",XBNS="APCL"
D ^XBDBQUE
Q
EOJ ;
D ^XBFMK
K DIC,DIR
D EN^XBVK("APCL")
Q
;
PROC ;
S APCLJ=$J,APCLH=$H
S ^XTMP("APCLPIF2",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"INFANT FEEDING REPORT"
S (APCLD1,APCLD2,APCLD3,APCLD4,APCLD5)=""
K APCLPVCD F X=1:1:5 S APCLPVCD(X)="0^0^0^0^0"
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
..;S APCLBS=$P($G(^AUPNBMSR(DFN,0)),U,15)
..;B-13
..Q:$$DEMO^APCLUTL(DFN,$G(APCLDEMO))
..S APCLBDAY=0,APCLEDAY=13,APCLI=1 D PROC1
..S APCLBDAY=14,APCLEDAY=41,APCLI=2 D PROC1
..S APCLBDAY=42,APCLEDAY=119,APCLI=3 D PROC1
..S APCLBDAY=120,APCLEDAY=179,APCLI=4 D PROC1
..S APCLBDAY=180,APCLEDAY=239,APCLI=5 D PROC1
..Q
.Q
Q
PROC1 ;
S APCLBVD=$$FMADD^XLFDT(APCLDOB,APCLBDAY)
S APCLEVD=$$FMADD^XLFDT(APCLDOB,APCLEDAY)
D PCV
I APCLGAH=1 S $P(APCLPVCD(APCLI),U,1)=$P(APCLPVCD(APCLI),U,1)+1 D
.;I $D(APCLINF)!(APCLBS]"") S $P(APCLD0,U,2)=$P(APCLD0,U,2)+1
.I $D(APCLINF) S $P(APCLPVCD(APCLI),U,2)=$P(APCLPVCD(APCLI),U,2)+1
.S (G,Y)=0 F S Y=$O(APCLINF(Y)) Q:Y'=+Y!(G) I APCLINF(Y)=1 S G=1
.;I 'G,APCLBS]"",APCLBS>1 S G=1
.I G S $P(APCLPVCD(APCLI),U,4)=$P(APCLPVCD(APCLI),U,4)+1
.S (G,Y)=0 F S Y=$O(APCLINF(Y)) Q:Y'=+Y!(G) I APCLINF(Y)'=5 S G=1 S $P(APCLPVCD(APCLI),U,3)=$P(APCLPVCD(APCLI),U,3)+1
.I 'G S (G,Y)=0 F S Y=$O(APCLINF(Y)) Q:Y'=+Y!(G) I APCLINF(Y)=5 S G=1 S $P(APCLPVCD(APCLI),U,5)=$P(APCLPVCD(APCLI),U,5)+1
.;I 'G,APCLBS]"",APCLBS>1 S G=1
.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("APCLPIF2",APCLJ,APCLH),APCLJ,APCLH
Q
;
PCV ;
;get all visits in date range
;table all infant feeding in time range
S APCLGAH=0
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 S APCLGAH=1
Q
;
PRINT ;EP - called from xbdbque
S APCLQ=0
D COVER
Q:APCLQ
D HEADER
W !,"BREASTFEEDING STATISTICS",!
W !?45,"AGE INTERVALS"
W !?25,"Birth",?37,"2-5wks",?49,"2 mos",?61,"4 mos",?71,"6 mos"
W !?14,"Days",?25,"B-13",?37,"14-41",?49,"42-119",?61,"120-179",?71,"180-239"
W !?20,$$REPEAT^XLFSTR("-",58)
W !!,"w/visit"
;S APCLPVCD(1)=1001_U_247_U_245_U_66_U_100
;S APCLPVCD(2)=1231_U_99_U_23_U_66_U_44
;S APCLPVCD(3)=13_U_11_U_3_U_9_U_9
;S APCLPVCD(4)=103_U_45_U_32_U_22_U_11
;S APCLPVCD(5)=100_U_100_U_22_U_100_U_100
W ?20,$$RJ^XLFSTR($P(APCLPVCD(1),U,1),5)
W ?33,$$RJ^XLFSTR($P(APCLPVCD(2),U,1),5)
W ?45,$$RJ^XLFSTR($P(APCLPVCD(3),U,1),5)
W ?57,$$RJ^XLFSTR($P(APCLPVCD(4),U,1),5)
W ?68,$$RJ^XLFSTR($P(APCLPVCD(5),U,1),5)
W !,"w/data recorded"
W ?20,$$RJ^XLFSTR($P(APCLPVCD(1),U,2),5)
I $P(APCLPVCD(1),U,1) S X=($P(APCLPVCD(1),U,2)/$P(APCLPVCD(1),U,1))*100 W ?27,$J(X,5,1)
I '$P(APCLPVCD(1),U,1) W ?29,$J("0.0",4,1)
W ?33,$$RJ^XLFSTR($P(APCLPVCD(2),U,2),5)
I $P(APCLPVCD(2),U,1) S X=($P(APCLPVCD(2),U,2)/$P(APCLPVCD(2),U,1))*100 W ?40,$J(X,5,1)
I '$P(APCLPVCD(2),U,1) W ?40,$J("0.0",4,1)
W ?45,$$RJ^XLFSTR($P(APCLPVCD(3),U,2),5)
I $P(APCLPVCD(3),U,1) S X=($P(APCLPVCD(3),U,2)/$P(APCLPVCD(3),U,1))*100 W ?52,$J(X,5,1)
I '$P(APCLPVCD(3),U,1) W ?52,$J("0.0",4,1)
W ?57,$$RJ^XLFSTR($P(APCLPVCD(4),U,2),5)
I $P(APCLPVCD(4),U,1) S X=($P(APCLPVCD(4),U,2)/$P(APCLPVCD(4),U,1))*100 W ?63,$J(X,5,1)
I '$P(APCLPVCD(4),U,1) W ?63,$J("0.0",4,1)
W ?68,$$RJ^XLFSTR($P(APCLPVCD(5),U,2),5)
I $P(APCLPVCD(5),U,1) S X=($P(APCLPVCD(5),U,2)/$P(APCLPVCD(5),U,1))*100 W ?75,$J(X,5,1)
I '$P(APCLPVCD(5),U,1) W ?75,$J("0.0",4,1)
W !,"Any Breastfeeding",?20,$$RJ^XLFSTR($P(APCLPVCD(1),U,3),5)
I $P(APCLPVCD(1),U,2) S X=($P(APCLPVCD(1),U,3)/$P(APCLPVCD(1),U,2))*100 W ?27,$J(X,5,1)
I '$P(APCLPVCD(1),U,2) W ?27,$J("0.0",6,1)
W ?33,$$RJ^XLFSTR($P(APCLPVCD(2),U,3),5)
I $P(APCLPVCD(2),U,2) S X=($P(APCLPVCD(2),U,3)/$P(APCLPVCD(2),U,2))*100 W ?40,$J(X,5,1)
I '$P(APCLPVCD(2),U,2) W ?40,$J("0.0",4,1)
W ?45,$$RJ^XLFSTR($P(APCLPVCD(3),U,3),5)
I $P(APCLPVCD(3),U,2) S X=($P(APCLPVCD(3),U,3)/$P(APCLPVCD(3),U,2))*100 W ?52,$J(X,5,1)
I '$P(APCLPVCD(3),U,2) W ?52,$J("0.0",4,1)
W ?57,$$RJ^XLFSTR($P(APCLPVCD(4),U,3),5)
I $P(APCLPVCD(4),U,2) S X=($P(APCLPVCD(4),U,3)/$P(APCLPVCD(4),U,2))*100 W ?63,$J(X,5,1)
I '$P(APCLPVCD(4),U,2) W ?63,$J("0.0",4,1)
W ?68,$$RJ^XLFSTR($P(APCLPVCD(5),U,3),5)
I $P(APCLPVCD(5),U,2) S X=($P(APCLPVCD(5),U,3)/$P(APCLPVCD(5),U,2))*100 W ?75,$J(X,5,1)
I '$P(APCLPVCD(5),U,2) W ?75,$J("0.0",4,1)
W !,"Excl Breastfeeding",?20,$$RJ^XLFSTR($P(APCLPVCD(1),U,4),5)
I $P(APCLPVCD(1),U,2) S X=($P(APCLPVCD(1),U,4)/$P(APCLPVCD(1),U,2))*100 W ?27,$J(X,5,1)
I '$P(APCLPVCD(1),U,2) W ?27,$J("0.0",6,1)
W ?33,$$RJ^XLFSTR($P(APCLPVCD(2),U,4),5)
I $P(APCLPVCD(2),U,2) S X=($P(APCLPVCD(2),U,4)/$P(APCLPVCD(2),U,2))*100 W ?40,$J(X,5,1)
I '$P(APCLPVCD(2),U,2) W ?40,$J("0.0",4,1)
W ?45,$$RJ^XLFSTR($P(APCLPVCD(3),U,4),5)
I $P(APCLPVCD(3),U,2) S X=($P(APCLPVCD(3),U,4)/$P(APCLPVCD(3),U,2))*100 W ?52,$J(X,5,1)
I '$P(APCLPVCD(3),U,2) W ?52,$J("0.0",4,1)
W ?57,$$RJ^XLFSTR($P(APCLPVCD(4),U,4),5)
I $P(APCLPVCD(4),U,2) S X=($P(APCLPVCD(4),U,4)/$P(APCLPVCD(4),U,2))*100 W ?63,$J(X,5,1)
I '$P(APCLPVCD(4),U,2) W ?63,$J("0.0",4,1)
W ?68,$$RJ^XLFSTR($P(APCLPVCD(5),U,4),5)
I $P(APCLPVCD(5),U,2) S X=($P(APCLPVCD(5),U,4)/$P(APCLPVCD(5),U,2))*100 W ?75,$J(X,5,1)
I '$P(APCLPVCD(5),U,2) W ?75,$J("0.0",4,1)
W !,"Formula Only",?20,$$RJ^XLFSTR($P(APCLPVCD(1),U,5),5)
I $P(APCLPVCD(1),U,2) S X=($P(APCLPVCD(1),U,5)/$P(APCLPVCD(1),U,2))*100 W ?27,$J(X,5,1)
I '$P(APCLPVCD(1),U,2) W ?27,$J("0.0",6,1)
W ?33,$$RJ^XLFSTR($P(APCLPVCD(2),U,5),5)
I $P(APCLPVCD(2),U,2) S X=($P(APCLPVCD(2),U,5)/$P(APCLPVCD(2),U,2))*100 W ?40,$J(X,5,1)
I '$P(APCLPVCD(2),U,2) W ?40,$J("0.0",4,1)
W ?45,$$RJ^XLFSTR($P(APCLPVCD(3),U,5),5)
I $P(APCLPVCD(3),U,2) S X=($P(APCLPVCD(3),U,5)/$P(APCLPVCD(3),U,2))*100 W ?52,$J(X,5,1)
I '$P(APCLPVCD(3),U,2) W ?52,$J("0.0",4,1)
W ?57,$$RJ^XLFSTR($P(APCLPVCD(4),U,5),5)
I $P(APCLPVCD(4),U,2) S X=($P(APCLPVCD(4),U,5)/$P(APCLPVCD(4),U,2))*100 W ?63,$J(X,5,1)
I '$P(APCLPVCD(4),U,2) W ?63,$J("0.0",4,1)
W ?68,$$RJ^XLFSTR($P(APCLPVCD(5),U,5),5)
I $P(APCLPVCD(5),U,2) S X=($P(APCLPVCD(5),U,5)/$P(APCLPVCD(5),U,2))*100 W ?75,$J(X,5,1)
I '$P(APCLPVCD(5),U,2) W ?75,$J("0.0",4,1)
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),?33,$$FMTE^XLFDT(DT),?68,"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)," ","-"),!
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 the following age intervals:
;; Birth-13 days, 2-4 weeks (14-41 days), 2 months (42-199 days),
;; 4 months (120-179 days) and 6 months (180-239 days)
;;
;;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.
;;
;; Breastfeeding statistics:
;;
;; Denominator: Number of Infants with a visit - patients who had at least
;; one visit to a primary care clinic during the age intervals defined above.
;;
;; Numerators:
;; 1. infants with feeding data - any patient with a visit with any infant
;; feeding choice documented during the age intervals defined above.
;; 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.
;;
;;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 during the age intervals defined above.
;;
;; Numerators:
;; 1. with feeding data - any patient with a visit with any infant
;; feeding choice documented during the age intervals defined above.
;; 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.
;;
;;
;;END
APCLPIF2 ; 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^APCLPIF2"
SET XBRC="PROC^APCLPIF2"
SET XBRX="EOJ^APCLPIF2"
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("APCLPIF2",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"INFANT FEEDING REPORT"
+3 SET (APCLD1,APCLD2,APCLD3,APCLD4,APCLD5)=""
+4 KILL APCLPVCD
FOR X=1:1:5
SET APCLPVCD(X)="0^0^0^0^0"
+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 ;S APCLBS=$P($G(^AUPNBMSR(DFN,0)),U,15)
+10 ;B-13
+11 IF $$DEMO^APCLUTL(DFN,$GET(APCLDEMO))
QUIT
+12 SET APCLBDAY=0
SET APCLEDAY=13
SET APCLI=1
DO PROC1
+13 SET APCLBDAY=14
SET APCLEDAY=41
SET APCLI=2
DO PROC1
+14 SET APCLBDAY=42
SET APCLEDAY=119
SET APCLI=3
DO PROC1
+15 SET APCLBDAY=120
SET APCLEDAY=179
SET APCLI=4
DO PROC1
+16 SET APCLBDAY=180
SET APCLEDAY=239
SET APCLI=5
DO PROC1
+17 QUIT
End DoDot:2
+18 QUIT
End DoDot:1
+19 QUIT
PROC1 ;
+1 SET APCLBVD=$$FMADD^XLFDT(APCLDOB,APCLBDAY)
+2 SET APCLEVD=$$FMADD^XLFDT(APCLDOB,APCLEDAY)
+3 DO PCV
+4 IF APCLGAH=1
SET $PIECE(APCLPVCD(APCLI),U,1)=$PIECE(APCLPVCD(APCLI),U,1)+1
Begin DoDot:1
+5 ;I $D(APCLINF)!(APCLBS]"") S $P(APCLD0,U,2)=$P(APCLD0,U,2)+1
+6 IF $DATA(APCLINF)
SET $PIECE(APCLPVCD(APCLI),U,2)=$PIECE(APCLPVCD(APCLI),U,2)+1
+7 SET (G,Y)=0
FOR
SET Y=$ORDER(APCLINF(Y))
IF Y'=+Y!(G)
QUIT
IF APCLINF(Y)=1
SET G=1
+8 ;I 'G,APCLBS]"",APCLBS>1 S G=1
+9 IF G
SET $PIECE(APCLPVCD(APCLI),U,4)=$PIECE(APCLPVCD(APCLI),U,4)+1
+10 SET (G,Y)=0
FOR
SET Y=$ORDER(APCLINF(Y))
IF Y'=+Y!(G)
QUIT
IF APCLINF(Y)'=5
SET G=1
SET $PIECE(APCLPVCD(APCLI),U,3)=$PIECE(APCLPVCD(APCLI),U,3)+1
+11 IF 'G
SET (G,Y)=0
FOR
SET Y=$ORDER(APCLINF(Y))
IF Y'=+Y!(G)
QUIT
IF APCLINF(Y)=5
SET G=1
SET $PIECE(APCLPVCD(APCLI),U,5)=$PIECE(APCLPVCD(APCLI),U,5)+1
+12 ;I 'G,APCLBS]"",APCLBS>1 S G=1
+13 QUIT
End DoDot:1
+14 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("APCLPIF2",APCLJ,APCLH),APCLJ,APCLH
+5 QUIT
+6 ;
PCV ;
+1 ;get all visits in date range
+2 ;table all infant feeding in time range
+3 SET APCLGAH=0
+4 KILL ^TMP($JOB,"A"),APCLINF
+5 SET A="^TMP($J,""A"","
SET B=DFN_"^ALL VISITS;DURING "_$$FMTE^XLFDT(APCLBVD)_"-"_$$FMTE^XLFDT(APCLEVD)
SET E=$$START1^APCLDF(B,A)
+6 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
+7 IF '$DATA(^AUPNVSIT(V,0))
QUIT
+8 IF '$PIECE(^AUPNVSIT(V,0),U,9)
QUIT
+9 IF $PIECE(^AUPNVSIT(V,0),U,11)
QUIT
+10 IF '$DATA(^AUPNVPRV("AD",V))
QUIT
+11 IF "SAHO"'[$PIECE(^AUPNVSIT(V,0),U,7)
QUIT
+12 IF "V"[$PIECE(^AUPNVSIT(V,0),U,3)
QUIT
+13 SET B=$$CLINIC^APCLV(V,"C")
+14 IF B=""
QUIT
+15 ;must be a primary clinic S G=V
IF $DATA(^BGPCTRL(3,11,"B",B))
SET G=1
+16 ;table infant feeding choice
+17 IF '$DATA(^AUPNVIF("AD",V))
QUIT
+18 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)
+19 QUIT
End DoDot:1
+20 IF G
SET APCLGAH=1
+21 QUIT
+22 ;
PRINT ;EP - called from xbdbque
+1 SET APCLQ=0
+2 DO COVER
+3 IF APCLQ
QUIT
+4 DO HEADER
+5 WRITE !,"BREASTFEEDING STATISTICS",!
+6 WRITE !?45,"AGE INTERVALS"
+7 WRITE !?25,"Birth",?37,"2-5wks",?49,"2 mos",?61,"4 mos",?71,"6 mos"
+8 WRITE !?14,"Days",?25,"B-13",?37,"14-41",?49,"42-119",?61,"120-179",?71,"180-239"
+9 WRITE !?20,$$REPEAT^XLFSTR("-",58)
+10 WRITE !!,"w/visit"
+11 ;S APCLPVCD(1)=1001_U_247_U_245_U_66_U_100
+12 ;S APCLPVCD(2)=1231_U_99_U_23_U_66_U_44
+13 ;S APCLPVCD(3)=13_U_11_U_3_U_9_U_9
+14 ;S APCLPVCD(4)=103_U_45_U_32_U_22_U_11
+15 ;S APCLPVCD(5)=100_U_100_U_22_U_100_U_100
+16 WRITE ?20,$$RJ^XLFSTR($PIECE(APCLPVCD(1),U,1),5)
+17 WRITE ?33,$$RJ^XLFSTR($PIECE(APCLPVCD(2),U,1),5)
+18 WRITE ?45,$$RJ^XLFSTR($PIECE(APCLPVCD(3),U,1),5)
+19 WRITE ?57,$$RJ^XLFSTR($PIECE(APCLPVCD(4),U,1),5)
+20 WRITE ?68,$$RJ^XLFSTR($PIECE(APCLPVCD(5),U,1),5)
+21 WRITE !,"w/data recorded"
+22 WRITE ?20,$$RJ^XLFSTR($PIECE(APCLPVCD(1),U,2),5)
+23 IF $PIECE(APCLPVCD(1),U,1)
SET X=($PIECE(APCLPVCD(1),U,2)/$PIECE(APCLPVCD(1),U,1))*100
WRITE ?27,$JUSTIFY(X,5,1)
+24 IF '$PIECE(APCLPVCD(1),U,1)
WRITE ?29,$JUSTIFY("0.0",4,1)
+25 WRITE ?33,$$RJ^XLFSTR($PIECE(APCLPVCD(2),U,2),5)
+26 IF $PIECE(APCLPVCD(2),U,1)
SET X=($PIECE(APCLPVCD(2),U,2)/$PIECE(APCLPVCD(2),U,1))*100
WRITE ?40,$JUSTIFY(X,5,1)
+27 IF '$PIECE(APCLPVCD(2),U,1)
WRITE ?40,$JUSTIFY("0.0",4,1)
+28 WRITE ?45,$$RJ^XLFSTR($PIECE(APCLPVCD(3),U,2),5)
+29 IF $PIECE(APCLPVCD(3),U,1)
SET X=($PIECE(APCLPVCD(3),U,2)/$PIECE(APCLPVCD(3),U,1))*100
WRITE ?52,$JUSTIFY(X,5,1)
+30 IF '$PIECE(APCLPVCD(3),U,1)
WRITE ?52,$JUSTIFY("0.0",4,1)
+31 WRITE ?57,$$RJ^XLFSTR($PIECE(APCLPVCD(4),U,2),5)
+32 IF $PIECE(APCLPVCD(4),U,1)
SET X=($PIECE(APCLPVCD(4),U,2)/$PIECE(APCLPVCD(4),U,1))*100
WRITE ?63,$JUSTIFY(X,5,1)
+33 IF '$PIECE(APCLPVCD(4),U,1)
WRITE ?63,$JUSTIFY("0.0",4,1)
+34 WRITE ?68,$$RJ^XLFSTR($PIECE(APCLPVCD(5),U,2),5)
+35 IF $PIECE(APCLPVCD(5),U,1)
SET X=($PIECE(APCLPVCD(5),U,2)/$PIECE(APCLPVCD(5),U,1))*100
WRITE ?75,$JUSTIFY(X,5,1)
+36 IF '$PIECE(APCLPVCD(5),U,1)
WRITE ?75,$JUSTIFY("0.0",4,1)
+37 WRITE !,"Any Breastfeeding",?20,$$RJ^XLFSTR($PIECE(APCLPVCD(1),U,3),5)
+38 IF $PIECE(APCLPVCD(1),U,2)
SET X=($PIECE(APCLPVCD(1),U,3)/$PIECE(APCLPVCD(1),U,2))*100
WRITE ?27,$JUSTIFY(X,5,1)
+39 IF '$PIECE(APCLPVCD(1),U,2)
WRITE ?27,$JUSTIFY("0.0",6,1)
+40 WRITE ?33,$$RJ^XLFSTR($PIECE(APCLPVCD(2),U,3),5)
+41 IF $PIECE(APCLPVCD(2),U,2)
SET X=($PIECE(APCLPVCD(2),U,3)/$PIECE(APCLPVCD(2),U,2))*100
WRITE ?40,$JUSTIFY(X,5,1)
+42 IF '$PIECE(APCLPVCD(2),U,2)
WRITE ?40,$JUSTIFY("0.0",4,1)
+43 WRITE ?45,$$RJ^XLFSTR($PIECE(APCLPVCD(3),U,3),5)
+44 IF $PIECE(APCLPVCD(3),U,2)
SET X=($PIECE(APCLPVCD(3),U,3)/$PIECE(APCLPVCD(3),U,2))*100
WRITE ?52,$JUSTIFY(X,5,1)
+45 IF '$PIECE(APCLPVCD(3),U,2)
WRITE ?52,$JUSTIFY("0.0",4,1)
+46 WRITE ?57,$$RJ^XLFSTR($PIECE(APCLPVCD(4),U,3),5)
+47 IF $PIECE(APCLPVCD(4),U,2)
SET X=($PIECE(APCLPVCD(4),U,3)/$PIECE(APCLPVCD(4),U,2))*100
WRITE ?63,$JUSTIFY(X,5,1)
+48 IF '$PIECE(APCLPVCD(4),U,2)
WRITE ?63,$JUSTIFY("0.0",4,1)
+49 WRITE ?68,$$RJ^XLFSTR($PIECE(APCLPVCD(5),U,3),5)
+50 IF $PIECE(APCLPVCD(5),U,2)
SET X=($PIECE(APCLPVCD(5),U,3)/$PIECE(APCLPVCD(5),U,2))*100
WRITE ?75,$JUSTIFY(X,5,1)
+51 IF '$PIECE(APCLPVCD(5),U,2)
WRITE ?75,$JUSTIFY("0.0",4,1)
+52 WRITE !,"Excl Breastfeeding",?20,$$RJ^XLFSTR($PIECE(APCLPVCD(1),U,4),5)
+53 IF $PIECE(APCLPVCD(1),U,2)
SET X=($PIECE(APCLPVCD(1),U,4)/$PIECE(APCLPVCD(1),U,2))*100
WRITE ?27,$JUSTIFY(X,5,1)
+54 IF '$PIECE(APCLPVCD(1),U,2)
WRITE ?27,$JUSTIFY("0.0",6,1)
+55 WRITE ?33,$$RJ^XLFSTR($PIECE(APCLPVCD(2),U,4),5)
+56 IF $PIECE(APCLPVCD(2),U,2)
SET X=($PIECE(APCLPVCD(2),U,4)/$PIECE(APCLPVCD(2),U,2))*100
WRITE ?40,$JUSTIFY(X,5,1)
+57 IF '$PIECE(APCLPVCD(2),U,2)
WRITE ?40,$JUSTIFY("0.0",4,1)
+58 WRITE ?45,$$RJ^XLFSTR($PIECE(APCLPVCD(3),U,4),5)
+59 IF $PIECE(APCLPVCD(3),U,2)
SET X=($PIECE(APCLPVCD(3),U,4)/$PIECE(APCLPVCD(3),U,2))*100
WRITE ?52,$JUSTIFY(X,5,1)
+60 IF '$PIECE(APCLPVCD(3),U,2)
WRITE ?52,$JUSTIFY("0.0",4,1)
+61 WRITE ?57,$$RJ^XLFSTR($PIECE(APCLPVCD(4),U,4),5)
+62 IF $PIECE(APCLPVCD(4),U,2)
SET X=($PIECE(APCLPVCD(4),U,4)/$PIECE(APCLPVCD(4),U,2))*100
WRITE ?63,$JUSTIFY(X,5,1)
+63 IF '$PIECE(APCLPVCD(4),U,2)
WRITE ?63,$JUSTIFY("0.0",4,1)
+64 WRITE ?68,$$RJ^XLFSTR($PIECE(APCLPVCD(5),U,4),5)
+65 IF $PIECE(APCLPVCD(5),U,2)
SET X=($PIECE(APCLPVCD(5),U,4)/$PIECE(APCLPVCD(5),U,2))*100
WRITE ?75,$JUSTIFY(X,5,1)
+66 IF '$PIECE(APCLPVCD(5),U,2)
WRITE ?75,$JUSTIFY("0.0",4,1)
+67 WRITE !,"Formula Only",?20,$$RJ^XLFSTR($PIECE(APCLPVCD(1),U,5),5)
+68 IF $PIECE(APCLPVCD(1),U,2)
SET X=($PIECE(APCLPVCD(1),U,5)/$PIECE(APCLPVCD(1),U,2))*100
WRITE ?27,$JUSTIFY(X,5,1)
+69 IF '$PIECE(APCLPVCD(1),U,2)
WRITE ?27,$JUSTIFY("0.0",6,1)
+70 WRITE ?33,$$RJ^XLFSTR($PIECE(APCLPVCD(2),U,5),5)
+71 IF $PIECE(APCLPVCD(2),U,2)
SET X=($PIECE(APCLPVCD(2),U,5)/$PIECE(APCLPVCD(2),U,2))*100
WRITE ?40,$JUSTIFY(X,5,1)
+72 IF '$PIECE(APCLPVCD(2),U,2)
WRITE ?40,$JUSTIFY("0.0",4,1)
+73 WRITE ?45,$$RJ^XLFSTR($PIECE(APCLPVCD(3),U,5),5)
+74 IF $PIECE(APCLPVCD(3),U,2)
SET X=($PIECE(APCLPVCD(3),U,5)/$PIECE(APCLPVCD(3),U,2))*100
WRITE ?52,$JUSTIFY(X,5,1)
+75 IF '$PIECE(APCLPVCD(3),U,2)
WRITE ?52,$JUSTIFY("0.0",4,1)
+76 WRITE ?57,$$RJ^XLFSTR($PIECE(APCLPVCD(4),U,5),5)
+77 IF $PIECE(APCLPVCD(4),U,2)
SET X=($PIECE(APCLPVCD(4),U,5)/$PIECE(APCLPVCD(4),U,2))*100
WRITE ?63,$JUSTIFY(X,5,1)
+78 IF '$PIECE(APCLPVCD(4),U,2)
WRITE ?63,$JUSTIFY("0.0",4,1)
+79 WRITE ?68,$$RJ^XLFSTR($PIECE(APCLPVCD(5),U,5),5)
+80 IF $PIECE(APCLPVCD(5),U,2)
SET X=($PIECE(APCLPVCD(5),U,5)/$PIECE(APCLPVCD(5),U,2))*100
WRITE ?75,$JUSTIFY(X,5,1)
+81 IF '$PIECE(APCLPVCD(5),U,2)
WRITE ?75,$JUSTIFY("0.0",4,1)
+82 WRITE !
+83 DO DONE
+84 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),?33,$$FMTE^XLFDT(DT),?68,"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 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 the following age intervals:
+3 ;; Birth-13 days, 2-4 weeks (14-41 days), 2 months (42-199 days),
+4 ;; 4 months (120-179 days) and 6 months (180-239 days)
+5 ;;
+6 ;;You will select the "as of" date (report end date) and the communities you
+7 ;;want to report on. The report first identifies all patients who are ages
+8 ;;12-23 months on the "as of" date you defined.
+9 ;;
+10 ;;The report calculates the infants to report on from this initial population.
+11 ;;
+12 ;; Breastfeeding statistics:
+13 ;;
+14 ;; Denominator: Number of Infants with a visit - patients who had at least
+15 ;; one visit to a primary care clinic during the age intervals defined above.
+16 ;;
+17 ;; Numerators:
+18 ;; 1. infants with feeding data - any patient with a visit with any infant
+19 ;; feeding choice documented during the age intervals defined above.
+20 ;; 2. infants breastfeeding - of the patients with feeding data (numerator
+21 ;; #1), those with ANY infant feeding choice that includes breastfeeding
+22 ;; (e.g., NOT formula only). The report looks chronologically at all visits
+23 ;; in the timeframe with feeding documentation and counts the patient as
+24 ;; meeting the numerator as soon as the first feeding choice that includes
+25 ;; breastfeeding is found.
+26 ;;
+27 ;;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 during the age intervals defined above.
+6 ;;
+7 ;; Numerators:
+8 ;; 1. with feeding data - any patient with a visit with any infant
+9 ;; feeding choice documented during the age intervals defined above.
+10 ;; 2. breastfeeding - of the patients with feeding data (numerator
+11 ;; #1), those with ANY infant feeding choice that includes breastfeeding
+12 ;; (e.g., NOT formula only). The report looks chronologically at all visits
+13 ;; in the timeframe with feeding documentation and counts the patient as
+14 ;; meeting the numerator as soon as the first feeding choice that includes
+15 ;; breastfeeding is found.
+16 ;;
+17 ;;
+18 ;;END