BGP0EOH ; IHS/CMI/LAB - cover page for ELDER 02 Jul 2009 9:27 AM ;
;;10.0;IHS CLINICAL REPORTING;**1**;JUN 18, 2010
;
;
I $G(BGPAREAA) D AREACP Q
;I BGPPTYPE="P" W:$D(IOF) @IOF
D W("Cover Page",1,2,BGPPTYPE)
D W("*** IHS 2010 Executive Order Quality Transparency Measures Report ***",1,2,BGPPTYPE)
D W($$RPTVER^BGP0BAN,1,2,BGPPTYPE)
D W("Date Report Run: "_$$FMTE^XLFDT(DT),1,1,BGPPTYPE)
D W("Site where Run: "_$P(^DIC(4,DUZ(2),0),U),1,1,BGPPTYPE)
D W("Report Generated by: "_$$USR,1,1,BGPPTYPE)
S X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) D W(X,1,1,BGPPTYPE)
S X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED) D W(X,1,1,BGPPTYPE)
S X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED) D W(X,1,1,BGPPTYPE)
I BGPINDZ="A" D W("Measures: Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
I BGPINDZ="A" D W("Order 13410 Quality Transparency Reporting",0,1,BGPPTYPE)
I BGPINDZ="S" D W("Measures: Selected Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
I BGPINDZ="S" D W("Order 13410 Quality Transparency Reporting (User Defined)",0,1,BGPPTYPE)
S X="Population: "_$S(BGPBEN=1:"AI/AN Only (Classification 01)",BGPBEN=2:"non AI/AN Only (Classification NOT 01)",BGPBEN=3:"All (Both AI/AN and non AI/AN)",1:"") D W(X,0,1,BGPPTYPE)
D ENDTIME
D EOHDR
I $G(BGPEXPT) D
.D W("A file will be created called BG10"_$P(^AUTTLOC(DUZ(2),0),U,10)_".EO"_BGPRPT_".",0,2,BGPPTYPE)
.D W("It will reside in the public/export directory.",0,1,BGPPTYPE)
.D W("This file should be sent to your Area Office.",0,1,BGPPTYPE)
.;D W("",0,1,BGPPTYPE)
I BGPROT'="P",'$D(BGPGUI),BGPDELT="F" D W("A delimited output file called "_BGPDELF,0,2,BGPPTYPE) D
.D W("has been placed in the public directory for your use in Excel or some",0,1,BGPPTYPE)
.D W("other software package.",0,1,BGPPTYPE)
.D W("See your site manager to access this file.",0,1,BGPPTYPE)
.D W("",0,1,BGPPTYPE)
D W("Community Taxonomy Name: "_$P(^ATXAX(BGPTAXI,0),U),0,2,BGPPTYPE,1,10)
D W("The following communities are included in this report:",0,1,BGPPTYPE,1,10) D
.S BGPZZ="",N=0,Y="" F S BGPZZ=$O(BGPTAX(BGPZZ)) Q:BGPZZ="" S N=N+1,Y=Y_$S(N=1:"",1:";")_BGPZZ
.S BGPZZ=0,C=0 F BGPZZ=1:3:N D
..D W($E($P(Y,";",BGPZZ),1,20),0,1,BGPPTYPE,1,10)
..D W($E($P(Y,";",(BGPZZ+1)),1,20),0,0,BGPPTYPE,2,30)
..D W($E($P(Y,";",(BGPZZ+2)),1,20),0,0,BGPPTYPE,3,60)
..Q
D W("",0,1,BGPPTYPE)
I $G(BGPMFITI) D W("MFI Visit Location Taxonomy Name: "_$P(^ATXAX(BGPMFITI,0),U),0,1,BGPPTYPE,1,10)
I $G(BGPMFITI) D W("The following locations are used for patient visits in this report:",0,2,BGPPTYPE,1,10) D
.S BGPZZ="",N=0,Y="" F S BGPZZ=$O(^ATXAX(BGPMFITI,21,"B",BGPZZ)) Q:BGPZZ="" S N=N+1,Y=Y_$S(N=1:"",1:";")_$P($G(^DIC(4,BGPZZ,0)),U)
.S BGPZZ=0,C=0 F BGPZZ=1:3:N D
..D W($E($P(Y,";",BGPZZ),1,20),0,1,BGPPTYPE,1,10)
..D W($E($P(Y,";",(BGPZZ+1)),1,20),0,0,BGPPTYPE,2,30)
..D W($E($P(Y,";",(BGPZZ+2)),1,20),0,0,BGPPTYPE,3,60)
..Q
K BGPX,BGPQUIT
Q
EOHDR ;
D W("",0,1,BGPPTYPE) ;LORI UPDATE NODE WHEN GET AREA HEADER FOR EO REPORT
ONMHDR ;
I BGPCHSO G ONMHDRC
S BGPTEXT="ONH1" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
.S BGPT=$P(BGPX,";;",2)
.D W(BGPT,0,1,BGPPTYPE)
I BGPRTC="U" D
.D W("3. User defines population: a) Indian/Alaska Natives Only - based on",0,1,BGPPTYPE)
.D W("Classification of 01; b) Non AI/AN (not 01); or c) Both.",0,1,BGPPTYPE)
I BGPRTC="H" D
.D W("3. Indian/Alaska Natives Only - based on Classification of 01.",0,1,BGPPTYPE)
S BGPTEXT="ONH2" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
.S BGPT=$P(BGPX,";;",2)
.D W(BGPT,0,1,BGPPTYPE)
D W(" ",0,1,BGPPTYPE)
Q
ONMHDRC ;
S BGPTEXT="ONH1" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
.S BGPT=$P(BGPX,";;",2)
.D W(BGPT,0,1,BGPPTYPE)
I BGPRTC="U" D
.D W("3. User defines population: a) Indian/Alaska Natives Only - based on",0,1,BGPPTYPE)
.D W("Classification of 01; b) Non AI/AN (not 01); or c) Both.",0,1,BGPPTYPE)
I BGPRTC="H" D
.D W("3. Indian/Alaska Natives Only - based on Classification of 01.",0,1,BGPPTYPE)
S BGPTEXT="ONH2C" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
.S BGPT=$P(BGPX,";;",2)
.D W(BGPT,0,1,BGPPTYPE)
D W(" ",0,1,BGPPTYPE)
Q
;I $G(BGPAREAA) S BGPNODEP=$S(BGPCHSO&('BGPCHSN):66,(BGPCHSO+BGPCHSN)=2:67,1:66)
;I '$G(BGPAREAA) S BGPNODEP=$S(BGPCHSO:64,1:59)
;S BGPX=$O(^BGPCTRL("B",2010,0))
;S BGPY=0 F S BGPY=$O(^BGPCTRL(BGPX,BGPNODEP,BGPY)) Q:BGPY'=+BGPY D
;.D W(^BGPCTRL(BGPX,BGPNODEP,BGPY,0),0,1,BGPPTYPE)
;.Q
;Q
ENDTIME ;
I $D(BGPET) S BGPTS=(86400*($P(BGPET,",")-$P(BGPBT,",")))+($P(BGPET,",",2)-$P(BGPBT,",",2)),BGPHR=$P(BGPTS/3600,".") S:BGPHR="" BGPHR=0 D
.S BGPTS=BGPTS-(BGPHR*3600),BGPM=$P(BGPTS/60,".") S:BGPM="" BGPM=0 S BGPTS=BGPTS-(BGPM*60),BGPS=BGPTS D W("RUN TIME (H.M.S): "_BGPHR_"."_BGPM_"."_BGPS,0,2,BGPPTYPE)
Q
AREACP ;EP - area cover page
;
;I BGPPTYPE="P" W:$D(IOF) @IOF
D W("Cover Page",1,2,BGPPTYPE)
D W("*** IHS 2010 EXECUTIVE ORDER QUALITY TRANSPARENCY MEASURES REPORT ***",1,2,BGPPTYPE)
D W("AREA AGGREGATE",1,2,BGPPTYPE)
D W($$RPTVER^BGP0BAN,1,2,BGPPTYPE)
D W("Date Report Run: "_$$FMTE^XLFDT(DT),1,1,BGPPTYPE)
D W("Site where Run: "_$P(^DIC(4,DUZ(2),0),U),1,1,BGPPTYPE)
D W("Report Generated by: "_$$USR,1,1,BGPPTYPE)
S X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) D W(X,1,1,BGPPTYPE)
S X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED) D W(X,1,1,BGPPTYPE)
S X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED) D W(X,1,1,BGPPTYPE)
D W("Measures: Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
D W("Order 13410 Quality Transparency Reporting",0,1,BGPPTYPE)
D W("Population: "_$S(BGPBEN=1:"AI/AN Only (Classification 01)",BGPBEN=2:"non AI/AN Only (Classification NOT 01)",BGPBEN=3:"All (Both AI/AN and non AI/AN)",1:""),0,2,BGPPTYPE)
;
D ENDTIME
S BGPCHSO="",X=0 F S X=$O(BGPSUL(X)) Q:X'=+X I $P(^BGPEOCT(X,0),U,17) S BGPCHSO=1
S BGPCHSN="",X=0 F S X=$O(BGPSUL(X)) Q:X'=+X I '$P(^BGPEOCT(X,0),U,17) S BGPCHSN=1
D EOHDR
I BGPROT'="P",'$D(BGPGUI) D W("A delimited output file called "_BGPDELF,0,2,BGPPTYPE) D
.D W("has been placed in the public directory for your use in Excel or some",0,1,BGPPTYPE)
.D W("other software package.",0,1,BGPPTYPE)
.D W("See your site manager to access this file.",0,1,BGPPTYPE)
.D W("",0,1,BGPPTYPE)
;
D W("EO National Measures filenames: ",0,1,BGPPTYPE),W(BGPFGNT1,15,1,BGPPTYPE)
D W("Report includes data from the following facilities:",0,2,BGPPTYPE)
NEW BGPX
S BGPX="",BGPC=0 F S BGPX=$O(BGPSUL(BGPX)) Q:BGPX="" D
.S X=$P(^BGPEOCT(BGPX,0),U,9),X=$O(^AUTTLOC("C",X,0)) S X=$S(X:$P(^DIC(4,X,0),U),1:"?????")
.S BGPC=BGPC+1,X=BGPC_". "_$S($P(^BGPEOCT(BGPX,0),U,17):"*",1:"")_X D W(X,0,1,BGPPTYPE,1,3)
.Q
S X=" " D W(X,0,1,BGPPTYPE)
S X="The following communities are included in this report:" D W(X,0,1,BGPPTYPE,1,1)
S BGPX="",BGPC=0 F S BGPX=$O(BGPSUL(BGPX)) Q:BGPX="" D
.S X=$P(^BGPEOCT(BGPX,0),U,9),X=$O(^AUTTLOC("C",X,0)) S X=$S(X:$P(^DIC(4,X,0),U),1:"?????")
.S BGPC=BGPC+1,X=BGPC_". "_$S($P(^BGPEOCT(BGPX,0),U,17):"*",1:"")_X D W(X,0,1,BGPPTYPE,1,3)
.;S X="Communities: " D W(X,0,1,BGPPTYPE,1,5)
.S X="Community Taxonomy Name: "_$P(^BGPEOCT(BGPX,0),U,18) D W(X,0,1,BGPPTYPE,1,5)
.S BGPXX=0,BGPXN=0,BGPXY="" F S BGPXX=$O(^BGPEOCT(BGPX,9999,BGPXX)) Q:BGPXX'=+BGPXX S BGPXN=BGPXN+1,BGPXY=BGPXY_$S(BGPXN=1:"",1:";")_$P(^BGPEOCT(BGPX,9999,BGPXX,0),U)
.S BGPX1=0,C=0 F BGPX1=1:3:BGPXN D
..D W($E($P(BGPXY,";",BGPX1),1,20),0,1,BGPPTYPE,1,10)
..D W($E($P(BGPXY,";",(BGPX1+1)),1,20),0,0,BGPPTYPE,2,30)
..D W($E($P(BGPXY,";",(BGPX1+2)),1,20),0,0,BGPPTYPE,3,60)
..Q
.I $O(^BGPEOCT(BGPX,1111,0)) D
..D W("MFI Visit Locations: ",0,2,BGPPTYPE,1,5) S BGPXX=0,BGPXN=0,BGPXY="" F S BGPXX=$O(^BGPEOCT(BGPX,1111,BGPXX)) Q:BGPXX'=+BGPXX S BGPXN=BGPXN+1,BGPXY=BGPXY_$S(BGPXN=1:"",1:";")_$P(^BGPEOCT(BGPX,1111,BGPXX,0),U)
..S BGPX1=0,C=0 F BGPX1=1:3:BGPXN D
...D W($E($P(BGPXY,";",BGPX1),1,20),0,1,BGPPTYPE,1,10)
...D W($E($P(BGPXY,";",(BGPX1+1)),1,20),0,0,BGPPTYPE,2,30)
...D W($E($P(BGPXY,";",(BGPX1+2)),1,20),0,0,BGPPTYPE,3,60)
..Q
.Q
D W(" ",0,1,BGPPTYPE)
I BGPCHSO D
.S X=" " D W(X,0,1,BGPPTYPE)
.S X="* CHS-only site. Uses Active Clinical CHS Population definition vs. Active Clinical." D W(X,0,1,BGPPTYPE)
S X=" " D W(X,0,1,BGPPTYPE)
K BGPX,BGPQUIT
Q
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.
Q:$E(IOST)'="C"
Q:$D(ZTQUEUED)!'(IOT["TRM")!$D(IO("S"))
NEW DIR
K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
S DIR(0)="E",DIR("A")="Press enter to continue" D ^DIR
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")
;----------
;;
W(V,C,F,M,P,T) ;EP
I $G(F)="" S F=1
I $G(C)="" S C=0
I $G(P)="" S P=1
I $G(T)="" S T=0
I M="P" D Q
.I $Y>(BGPIOSL-2) D EOP W:$D(IOF) @IOF
.NEW X
.F X=1:1:F W !
.I C W $$CTR(V,80)
.I 'C W ?T,V
;set up array
I '$G(F) S F=0
NEW %,Z
S Z=""
S %=$P(^TMP($J,"BGPDEL",0),U)
F Z=1:1:F S %=%+1 S ^TMP($J,"BGPDEL",%)=""
S $P(^TMP($J,"BGPDEL",0),U)=%
I '$D(^TMP($J,"BGPDEL",%)) S ^TMP($J,"BGPDEL",%)=""
S $P(^TMP($J,"BGPDEL",%),U,P)=V
Q
ONH1 ;;
;;Denominator Definitions used in this Report:
;;
;;ACTIVE CLINICAL POPULATION:
;;1. Must reside in a community specified in the community taxonomy used for
;;this report.
;;2. Must be alive on the last day of the Report period.
;;QUIT
;
ONH2 ;;
;;4. Must have 2 visits to medical clinics in the 3 years prior to the end
;;of the Report period. At least one visit must include: 01 General,
;;06 Diabetic, 10 GYN, 12 Immunization, 13 Internal Med, 20 Pediatrics, 24
;;Well Child, 28 Family Practice, 57 EPSDT, 70 Women's Health, 80 Urgent, 89
;;Evening. See User Manual for complete description of medical clinics.
;;
;;USER POPULATION:
;;1. Definitions 1-3 above.
;;2. Must have been seen at least once in the 3 years prior to the end of
;;the Report period, regardless of the clinic type.
;;
;;See last pages of this report for Performance Summary.
;;QUIT
;;
ONH2C ;;
;;4. Must have 2 CHS visits in the 3 years prior to the end of the Report period.
;;
;;USER POPULATION:
;;1. Definitions 1-3 above.
;;2. Must have been seen at least once in the 3 years prior to the end of
;;the Report period, regardless of the clinic type.
;;
;;See last pages of this report for Performance Summary.
;;QUIT
;;
BGP0EOH ; IHS/CMI/LAB - cover page for ELDER 02 Jul 2009 9:27 AM ;
+1 ;;10.0;IHS CLINICAL REPORTING;**1**;JUN 18, 2010
+2 ;
+3 ;
+4 IF $GET(BGPAREAA)
DO AREACP
QUIT
+5 ;I BGPPTYPE="P" W:$D(IOF) @IOF
+6 DO W("Cover Page",1,2,BGPPTYPE)
+7 DO W("*** IHS 2010 Executive Order Quality Transparency Measures Report ***",1,2,BGPPTYPE)
+8 DO W($$RPTVER^BGP0BAN,1,2,BGPPTYPE)
+9 DO W("Date Report Run: "_$$FMTE^XLFDT(DT),1,1,BGPPTYPE)
+10 DO W("Site where Run: "_$PIECE(^DIC(4,DUZ(2),0),U),1,1,BGPPTYPE)
+11 DO W("Report Generated by: "_$$USR,1,1,BGPPTYPE)
+12 SET X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED)
DO W(X,1,1,BGPPTYPE)
+13 SET X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED)
DO W(X,1,1,BGPPTYPE)
+14 SET X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED)
DO W(X,1,1,BGPPTYPE)
+15 IF BGPINDZ="A"
DO W("Measures: Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
+16 IF BGPINDZ="A"
DO W("Order 13410 Quality Transparency Reporting",0,1,BGPPTYPE)
+17 IF BGPINDZ="S"
DO W("Measures: Selected Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
+18 IF BGPINDZ="S"
DO W("Order 13410 Quality Transparency Reporting (User Defined)",0,1,BGPPTYPE)
+19 SET X="Population: "_$SELECT(BGPBEN=1:"AI/AN Only (Classification 01)",BGPBEN=2:"non AI/AN Only (Classification NOT 01)",BGPBEN=3:"All (Both AI/AN and non AI/AN)",1:"")
DO W(X,0,1,BGPPTYPE)
+20 DO ENDTIME
+21 DO EOHDR
+22 IF $GET(BGPEXPT)
Begin DoDot:1
+23 DO W("A file will be created called BG10"_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_".EO"_BGPRPT_".",0,2,BGPPTYPE)
+24 DO W("It will reside in the public/export directory.",0,1,BGPPTYPE)
+25 DO W("This file should be sent to your Area Office.",0,1,BGPPTYPE)
+26 ;D W("",0,1,BGPPTYPE)
End DoDot:1
+27 IF BGPROT'="P"
IF '$DATA(BGPGUI)
IF BGPDELT="F"
DO W("A delimited output file called "_BGPDELF,0,2,BGPPTYPE)
Begin DoDot:1
+28 DO W("has been placed in the public directory for your use in Excel or some",0,1,BGPPTYPE)
+29 DO W("other software package.",0,1,BGPPTYPE)
+30 DO W("See your site manager to access this file.",0,1,BGPPTYPE)
+31 DO W("",0,1,BGPPTYPE)
End DoDot:1
+32 DO W("Community Taxonomy Name: "_$PIECE(^ATXAX(BGPTAXI,0),U),0,2,BGPPTYPE,1,10)
+33 DO W("The following communities are included in this report:",0,1,BGPPTYPE,1,10)
Begin DoDot:1
+34 SET BGPZZ=""
SET N=0
SET Y=""
FOR
SET BGPZZ=$ORDER(BGPTAX(BGPZZ))
IF BGPZZ=""
QUIT
SET N=N+1
SET Y=Y_$SELECT(N=1:"",1:";")_BGPZZ
+35 SET BGPZZ=0
SET C=0
FOR BGPZZ=1:3:N
Begin DoDot:2
+36 DO W($EXTRACT($PIECE(Y,";",BGPZZ),1,20),0,1,BGPPTYPE,1,10)
+37 DO W($EXTRACT($PIECE(Y,";",(BGPZZ+1)),1,20),0,0,BGPPTYPE,2,30)
+38 DO W($EXTRACT($PIECE(Y,";",(BGPZZ+2)),1,20),0,0,BGPPTYPE,3,60)
+39 QUIT
End DoDot:2
End DoDot:1
+40 DO W("",0,1,BGPPTYPE)
+41 IF $GET(BGPMFITI)
DO W("MFI Visit Location Taxonomy Name: "_$PIECE(^ATXAX(BGPMFITI,0),U),0,1,BGPPTYPE,1,10)
+42 IF $GET(BGPMFITI)
DO W("The following locations are used for patient visits in this report:",0,2,BGPPTYPE,1,10)
Begin DoDot:1
+43 SET BGPZZ=""
SET N=0
SET Y=""
FOR
SET BGPZZ=$ORDER(^ATXAX(BGPMFITI,21,"B",BGPZZ))
IF BGPZZ=""
QUIT
SET N=N+1
SET Y=Y_$SELECT(N=1:"",1:";")_$PIECE($GET(^DIC(4,BGPZZ,0)),U)
+44 SET BGPZZ=0
SET C=0
FOR BGPZZ=1:3:N
Begin DoDot:2
+45 DO W($EXTRACT($PIECE(Y,";",BGPZZ),1,20),0,1,BGPPTYPE,1,10)
+46 DO W($EXTRACT($PIECE(Y,";",(BGPZZ+1)),1,20),0,0,BGPPTYPE,2,30)
+47 DO W($EXTRACT($PIECE(Y,";",(BGPZZ+2)),1,20),0,0,BGPPTYPE,3,60)
+48 QUIT
End DoDot:2
End DoDot:1
+49 KILL BGPX,BGPQUIT
+50 QUIT
EOHDR ;
+1 ;LORI UPDATE NODE WHEN GET AREA HEADER FOR EO REPORT
DO W("",0,1,BGPPTYPE)
ONMHDR ;
+1 IF BGPCHSO
GOTO ONMHDRC
+2 SET BGPTEXT="ONH1"
FOR BGPJ1=1:1
SET BGPX=$TEXT(@BGPTEXT+BGPJ1)
IF $PIECE(BGPX,";;",2)="QUIT"
QUIT
Begin DoDot:1
+3 SET BGPT=$PIECE(BGPX,";;",2)
+4 DO W(BGPT,0,1,BGPPTYPE)
End DoDot:1
+5 IF BGPRTC="U"
Begin DoDot:1
+6 DO W("3. User defines population: a) Indian/Alaska Natives Only - based on",0,1,BGPPTYPE)
+7 DO W("Classification of 01; b) Non AI/AN (not 01); or c) Both.",0,1,BGPPTYPE)
End DoDot:1
+8 IF BGPRTC="H"
Begin DoDot:1
+9 DO W("3. Indian/Alaska Natives Only - based on Classification of 01.",0,1,BGPPTYPE)
End DoDot:1
+10 SET BGPTEXT="ONH2"
FOR BGPJ1=1:1
SET BGPX=$TEXT(@BGPTEXT+BGPJ1)
IF $PIECE(BGPX,";;",2)="QUIT"
QUIT
Begin DoDot:1
+11 SET BGPT=$PIECE(BGPX,";;",2)
+12 DO W(BGPT,0,1,BGPPTYPE)
End DoDot:1
+13 DO W(" ",0,1,BGPPTYPE)
+14 QUIT
ONMHDRC ;
+1 SET BGPTEXT="ONH1"
FOR BGPJ1=1:1
SET BGPX=$TEXT(@BGPTEXT+BGPJ1)
IF $PIECE(BGPX,";;",2)="QUIT"
QUIT
Begin DoDot:1
+2 SET BGPT=$PIECE(BGPX,";;",2)
+3 DO W(BGPT,0,1,BGPPTYPE)
End DoDot:1
+4 IF BGPRTC="U"
Begin DoDot:1
+5 DO W("3. User defines population: a) Indian/Alaska Natives Only - based on",0,1,BGPPTYPE)
+6 DO W("Classification of 01; b) Non AI/AN (not 01); or c) Both.",0,1,BGPPTYPE)
End DoDot:1
+7 IF BGPRTC="H"
Begin DoDot:1
+8 DO W("3. Indian/Alaska Natives Only - based on Classification of 01.",0,1,BGPPTYPE)
End DoDot:1
+9 SET BGPTEXT="ONH2C"
FOR BGPJ1=1:1
SET BGPX=$TEXT(@BGPTEXT+BGPJ1)
IF $PIECE(BGPX,";;",2)="QUIT"
QUIT
Begin DoDot:1
+10 SET BGPT=$PIECE(BGPX,";;",2)
+11 DO W(BGPT,0,1,BGPPTYPE)
End DoDot:1
+12 DO W(" ",0,1,BGPPTYPE)
+13 QUIT
+14 ;I $G(BGPAREAA) S BGPNODEP=$S(BGPCHSO&('BGPCHSN):66,(BGPCHSO+BGPCHSN)=2:67,1:66)
+15 ;I '$G(BGPAREAA) S BGPNODEP=$S(BGPCHSO:64,1:59)
+16 ;S BGPX=$O(^BGPCTRL("B",2010,0))
+17 ;S BGPY=0 F S BGPY=$O(^BGPCTRL(BGPX,BGPNODEP,BGPY)) Q:BGPY'=+BGPY D
+18 ;.D W(^BGPCTRL(BGPX,BGPNODEP,BGPY,0),0,1,BGPPTYPE)
+19 ;.Q
+20 ;Q
ENDTIME ;
+1 IF $DATA(BGPET)
SET BGPTS=(86400*($PIECE(BGPET,",")-$PIECE(BGPBT,",")))+($PIECE(BGPET,",",2)-$PIECE(BGPBT,",",2))
SET BGPHR=$PIECE(BGPTS/3600,".")
IF BGPHR=""
SET BGPHR=0
Begin DoDot:1
+2 SET BGPTS=BGPTS-(BGPHR*3600)
SET BGPM=$PIECE(BGPTS/60,".")
IF BGPM=""
SET BGPM=0
SET BGPTS=BGPTS-(BGPM*60)
SET BGPS=BGPTS
DO W("RUN TIME (H.M.S): "_BGPHR_"."_BGPM_"."_BGPS,0,2,BGPPTYPE)
End DoDot:1
+3 QUIT
AREACP ;EP - area cover page
+1 ;
+2 ;I BGPPTYPE="P" W:$D(IOF) @IOF
+3 DO W("Cover Page",1,2,BGPPTYPE)
+4 DO W("*** IHS 2010 EXECUTIVE ORDER QUALITY TRANSPARENCY MEASURES REPORT ***",1,2,BGPPTYPE)
+5 DO W("AREA AGGREGATE",1,2,BGPPTYPE)
+6 DO W($$RPTVER^BGP0BAN,1,2,BGPPTYPE)
+7 DO W("Date Report Run: "_$$FMTE^XLFDT(DT),1,1,BGPPTYPE)
+8 DO W("Site where Run: "_$PIECE(^DIC(4,DUZ(2),0),U),1,1,BGPPTYPE)
+9 DO W("Report Generated by: "_$$USR,1,1,BGPPTYPE)
+10 SET X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED)
DO W(X,1,1,BGPPTYPE)
+11 SET X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED)
DO W(X,1,1,BGPPTYPE)
+12 SET X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED)
DO W(X,1,1,BGPPTYPE)
+13 DO W("Measures: Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
+14 DO W("Order 13410 Quality Transparency Reporting",0,1,BGPPTYPE)
+15 DO W("Population: "_$SELECT(BGPBEN=1:"AI/AN Only (Classification 01)",BGPBEN=2:"non AI/AN Only (Classification NOT 01)",BGPBEN=3:"All (Both AI/AN and non AI/AN)",1:""),0,2,BGPPTYPE)
+16 ;
+17 DO ENDTIME
+18 SET BGPCHSO=""
SET X=0
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
IF $PIECE(^BGPEOCT(X,0),U,17)
SET BGPCHSO=1
+19 SET BGPCHSN=""
SET X=0
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
IF '$PIECE(^BGPEOCT(X,0),U,17)
SET BGPCHSN=1
+20 DO EOHDR
+21 IF BGPROT'="P"
IF '$DATA(BGPGUI)
DO W("A delimited output file called "_BGPDELF,0,2,BGPPTYPE)
Begin DoDot:1
+22 DO W("has been placed in the public directory for your use in Excel or some",0,1,BGPPTYPE)
+23 DO W("other software package.",0,1,BGPPTYPE)
+24 DO W("See your site manager to access this file.",0,1,BGPPTYPE)
+25 DO W("",0,1,BGPPTYPE)
End DoDot:1
+26 ;
+27 DO W("EO National Measures filenames: ",0,1,BGPPTYPE)
DO W(BGPFGNT1,15,1,BGPPTYPE)
+28 DO W("Report includes data from the following facilities:",0,2,BGPPTYPE)
+29 NEW BGPX
+30 SET BGPX=""
SET BGPC=0
FOR
SET BGPX=$ORDER(BGPSUL(BGPX))
IF BGPX=""
QUIT
Begin DoDot:1
+31 SET X=$PIECE(^BGPEOCT(BGPX,0),U,9)
SET X=$ORDER(^AUTTLOC("C",X,0))
SET X=$SELECT(X:$PIECE(^DIC(4,X,0),U),1:"?????")
+32 SET BGPC=BGPC+1
SET X=BGPC_". "_$SELECT($PIECE(^BGPEOCT(BGPX,0),U,17):"*",1:"")_X
DO W(X,0,1,BGPPTYPE,1,3)
+33 QUIT
End DoDot:1
+34 SET X=" "
DO W(X,0,1,BGPPTYPE)
+35 SET X="The following communities are included in this report:"
DO W(X,0,1,BGPPTYPE,1,1)
+36 SET BGPX=""
SET BGPC=0
FOR
SET BGPX=$ORDER(BGPSUL(BGPX))
IF BGPX=""
QUIT
Begin DoDot:1
+37 SET X=$PIECE(^BGPEOCT(BGPX,0),U,9)
SET X=$ORDER(^AUTTLOC("C",X,0))
SET X=$SELECT(X:$PIECE(^DIC(4,X,0),U),1:"?????")
+38 SET BGPC=BGPC+1
SET X=BGPC_". "_$SELECT($PIECE(^BGPEOCT(BGPX,0),U,17):"*",1:"")_X
DO W(X,0,1,BGPPTYPE,1,3)
+39 ;S X="Communities: " D W(X,0,1,BGPPTYPE,1,5)
+40 SET X="Community Taxonomy Name: "_$PIECE(^BGPEOCT(BGPX,0),U,18)
DO W(X,0,1,BGPPTYPE,1,5)
+41 SET BGPXX=0
SET BGPXN=0
SET BGPXY=""
FOR
SET BGPXX=$ORDER(^BGPEOCT(BGPX,9999,BGPXX))
IF BGPXX'=+BGPXX
QUIT
SET BGPXN=BGPXN+1
SET BGPXY=BGPXY_$SELECT(BGPXN=1:"",1:";")_$PIECE(^BGPEOCT(BGPX,9999,BGPXX,0),U)
+42 SET BGPX1=0
SET C=0
FOR BGPX1=1:3:BGPXN
Begin DoDot:2
+43 DO W($EXTRACT($PIECE(BGPXY,";",BGPX1),1,20),0,1,BGPPTYPE,1,10)
+44 DO W($EXTRACT($PIECE(BGPXY,";",(BGPX1+1)),1,20),0,0,BGPPTYPE,2,30)
+45 DO W($EXTRACT($PIECE(BGPXY,";",(BGPX1+2)),1,20),0,0,BGPPTYPE,3,60)
+46 QUIT
End DoDot:2
+47 IF $ORDER(^BGPEOCT(BGPX,1111,0))
Begin DoDot:2
+48 DO W("MFI Visit Locations: ",0,2,BGPPTYPE,1,5)
SET BGPXX=0
SET BGPXN=0
SET BGPXY=""
FOR
SET BGPXX=$ORDER(^BGPEOCT(BGPX,1111,BGPXX))
IF BGPXX'=+BGPXX
QUIT
SET BGPXN=BGPXN+1
SET BGPXY=BGPXY_$SELECT(BGPXN=1:"",1:";")_$PIECE(^BGPEOCT(BGPX,1111,BGPXX,0),U)
+49 SET BGPX1=0
SET C=0
FOR BGPX1=1:3:BGPXN
Begin DoDot:3
+50 DO W($EXTRACT($PIECE(BGPXY,";",BGPX1),1,20),0,1,BGPPTYPE,1,10)
+51 DO W($EXTRACT($PIECE(BGPXY,";",(BGPX1+1)),1,20),0,0,BGPPTYPE,2,30)
+52 DO W($EXTRACT($PIECE(BGPXY,";",(BGPX1+2)),1,20),0,0,BGPPTYPE,3,60)
End DoDot:3
+53 QUIT
End DoDot:2
+54 QUIT
End DoDot:1
+55 DO W(" ",0,1,BGPPTYPE)
+56 IF BGPCHSO
Begin DoDot:1
+57 SET X=" "
DO W(X,0,1,BGPPTYPE)
+58 SET X="* CHS-only site. Uses Active Clinical CHS Population definition vs. Active Clinical."
DO W(X,0,1,BGPPTYPE)
End DoDot:1
+59 SET X=" "
DO W(X,0,1,BGPPTYPE)
+60 KILL BGPX,BGPQUIT
+61 QUIT
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 IF $EXTRACT(IOST)'="C"
QUIT
+2 IF $DATA(ZTQUEUED)!'(IOT["TRM")!$DATA(IO("S"))
QUIT
+3 NEW DIR
+4 KILL DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
+5 SET DIR(0)="E"
SET DIR("A")="Press enter to continue"
DO ^DIR
+6 QUIT
+7 ;----------
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 ;----------
+3 ;;
W(V,C,F,M,P,T) ;EP
+1 IF $GET(F)=""
SET F=1
+2 IF $GET(C)=""
SET C=0
+3 IF $GET(P)=""
SET P=1
+4 IF $GET(T)=""
SET T=0
+5 IF M="P"
Begin DoDot:1
+6 IF $Y>(BGPIOSL-2)
DO EOP
IF $DATA(IOF)
WRITE @IOF
+7 NEW X
+8 FOR X=1:1:F
WRITE !
+9 IF C
WRITE $$CTR(V,80)
+10 IF 'C
WRITE ?T,V
End DoDot:1
QUIT
+11 ;set up array
+12 IF '$GET(F)
SET F=0
+13 NEW %,Z
+14 SET Z=""
+15 SET %=$PIECE(^TMP($JOB,"BGPDEL",0),U)
+16 FOR Z=1:1:F
SET %=%+1
SET ^TMP($JOB,"BGPDEL",%)=""
+17 SET $PIECE(^TMP($JOB,"BGPDEL",0),U)=%
+18 IF '$DATA(^TMP($JOB,"BGPDEL",%))
SET ^TMP($JOB,"BGPDEL",%)=""
+19 SET $PIECE(^TMP($JOB,"BGPDEL",%),U,P)=V
+20 QUIT
ONH1 ;;
+1 ;;Denominator Definitions used in this Report:
+2 ;;
+3 ;;ACTIVE CLINICAL POPULATION:
+4 ;;1. Must reside in a community specified in the community taxonomy used for
+5 ;;this report.
+6 ;;2. Must be alive on the last day of the Report period.
+7 ;;QUIT
+8 ;
ONH2 ;;
+1 ;;4. Must have 2 visits to medical clinics in the 3 years prior to the end
+2 ;;of the Report period. At least one visit must include: 01 General,
+3 ;;06 Diabetic, 10 GYN, 12 Immunization, 13 Internal Med, 20 Pediatrics, 24
+4 ;;Well Child, 28 Family Practice, 57 EPSDT, 70 Women's Health, 80 Urgent, 89
+5 ;;Evening. See User Manual for complete description of medical clinics.
+6 ;;
+7 ;;USER POPULATION:
+8 ;;1. Definitions 1-3 above.
+9 ;;2. Must have been seen at least once in the 3 years prior to the end of
+10 ;;the Report period, regardless of the clinic type.
+11 ;;
+12 ;;See last pages of this report for Performance Summary.
+13 ;;QUIT
+14 ;;
ONH2C ;;
+1 ;;4. Must have 2 CHS visits in the 3 years prior to the end of the Report period.
+2 ;;
+3 ;;USER POPULATION:
+4 ;;1. Definitions 1-3 above.
+5 ;;2. Must have been seen at least once in the 3 years prior to the end of
+6 ;;the Report period, regardless of the clinic type.
+7 ;;
+8 ;;See last pages of this report for Performance Summary.
+9 ;;QUIT
+10 ;;