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

BGP3EOH.m

Go to the documentation of this file.
  1. BGP3EOH ; IHS/CMI/LAB - cover page for ELDER 02 Jul 2010 9:27 AM ;
  1. ;;13.0;IHS CLINICAL REPORTING;;NOV 20, 2012;Build 81
  1. ;
  1. ;
  1. I $G(BGPAREAA) D AREACP Q
  1. ;I BGPPTYPE="P" W:$D(IOF) @IOF
  1. D W("Cover Page",1,2,BGPPTYPE)
  1. D W("*** IHS 2012 Executive Order Quality Transparency Measures Report ***",1,2,BGPPTYPE)
  1. D W($$RPTVER^BGP3BAN,1,2,BGPPTYPE)
  1. D W("Date Report Run: "_$$FMTE^XLFDT(DT),1,1,BGPPTYPE)
  1. D W("Site where Run: "_$P(^DIC(4,DUZ(2),0),U),1,1,BGPPTYPE)
  1. D W("Report Generated by: "_$$USR,1,1,BGPPTYPE)
  1. S X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) D W(X,1,1,BGPPTYPE)
  1. S X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED) D W(X,1,1,BGPPTYPE)
  1. S X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED) D W(X,1,1,BGPPTYPE)
  1. I BGPINDZ="A" D W("Measures: Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
  1. I BGPINDZ="A" D W("Order 13410 Quality Transparency Reporting",0,1,BGPPTYPE)
  1. I BGPINDZ="S" D W("Measures: Selected Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
  1. I BGPINDZ="S" D W("Order 13410 Quality Transparency Reporting (User Defined)",0,1,BGPPTYPE)
  1. 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)
  1. D ENDTIME
  1. D EOHDR
  1. I $G(BGPEXPT) D
  1. .D W("A file will be created called BG121"_$P(^AUTTLOC(DUZ(2),0),U,10)_".EO"_BGPRPT_".",0,2,BGPPTYPE)
  1. .D W("It will reside in the public/export directory.",0,1,BGPPTYPE)
  1. .D W("This file should be sent to your Area Office.",0,1,BGPPTYPE)
  1. .;D W("",0,1,BGPPTYPE)
  1. I BGPROT'="P",'$D(BGPGUI),BGPDELT="F" D W("A delimited output file called "_BGPDELF,0,2,BGPPTYPE) D
  1. .D W("has been placed in the "_$$GETDEDIR^BGP3UTL2()_" directory for your use in Excel or some",0,1,BGPPTYPE)
  1. .D W("other software package.",0,1,BGPPTYPE)
  1. .D W("See your site manager to access this file.",0,1,BGPPTYPE)
  1. .D W("",0,1,BGPPTYPE)
  1. D W("Community Taxonomy Name: "_$P(^ATXAX(BGPTAXI,0),U),0,2,BGPPTYPE,1,10)
  1. D W("The following communities are included in this report:",0,1,BGPPTYPE,1,10) D
  1. .S BGPZZ="",N=0,Y="" F S BGPZZ=$O(BGPTAX(BGPZZ)) Q:BGPZZ="" S N=N+1,Y=Y_$S(N=1:"",1:";")_BGPZZ
  1. .S BGPZZ=0,C=0 F BGPZZ=1:3:N D
  1. ..D W($E($P(Y,";",BGPZZ),1,20),0,1,BGPPTYPE,1,10)
  1. ..D W($E($P(Y,";",(BGPZZ+1)),1,20),0,0,BGPPTYPE,2,30)
  1. ..D W($E($P(Y,";",(BGPZZ+2)),1,20),0,0,BGPPTYPE,3,60)
  1. ..Q
  1. D W("",0,1,BGPPTYPE)
  1. I $G(BGPMFITI) D W("MFI Visit Location Taxonomy Name: "_$P(^ATXAX(BGPMFITI,0),U),0,1,BGPPTYPE,1,10)
  1. I $G(BGPMFITI) D W("The following locations are used for patient visits in this report:",0,2,BGPPTYPE,1,10) D
  1. .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)
  1. .S BGPZZ=0,C=0 F BGPZZ=1:3:N D
  1. ..D W($E($P(Y,";",BGPZZ),1,20),0,1,BGPPTYPE,1,10)
  1. ..D W($E($P(Y,";",(BGPZZ+1)),1,20),0,0,BGPPTYPE,2,30)
  1. ..D W($E($P(Y,";",(BGPZZ+2)),1,20),0,0,BGPPTYPE,3,60)
  1. ..Q
  1. K BGPX,BGPQUIT
  1. Q
  1. EOHDR ;
  1. D W("",0,1,BGPPTYPE) ;LORI UPDATE NODE WHEN GET AREA HEADER FOR EO REPORT
  1. ONMHDR ;
  1. I BGPCHSO G ONMHDRC
  1. S BGPTEXT="ONH1" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
  1. .S BGPT=$P(BGPX,";;",2)
  1. .D W(BGPT,0,1,BGPPTYPE)
  1. I BGPRTC="U" D
  1. .D W("3. User defines population: a) Indian/Alaska Natives Only - based on",0,1,BGPPTYPE)
  1. .D W("Classification of 01; b) Non AI/AN (not 01); or c) Both.",0,1,BGPPTYPE)
  1. I BGPRTC="H" D
  1. .D W("3. Indian/Alaska Natives Only - based on Classification of 01.",0,1,BGPPTYPE)
  1. S BGPTEXT="ONH2" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
  1. .S BGPT=$P(BGPX,";;",2)
  1. .D W(BGPT,0,1,BGPPTYPE)
  1. D W(" ",0,1,BGPPTYPE)
  1. Q
  1. ONMHDRC ;
  1. S BGPTEXT="ONH1" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
  1. .S BGPT=$P(BGPX,";;",2)
  1. .D W(BGPT,0,1,BGPPTYPE)
  1. I BGPRTC="U" D
  1. .D W("3. User defines population: a) Indian/Alaska Natives Only - based on",0,1,BGPPTYPE)
  1. .D W("Classification of 01; b) Non AI/AN (not 01); or c) Both.",0,1,BGPPTYPE)
  1. I BGPRTC="H" D
  1. .D W("3. Indian/Alaska Natives Only - based on Classification of 01.",0,1,BGPPTYPE)
  1. S BGPTEXT="ONH2C" F BGPJ1=1:1 S BGPX=$T(@BGPTEXT+BGPJ1) Q:$P(BGPX,";;",2)="QUIT" D
  1. .S BGPT=$P(BGPX,";;",2)
  1. .D W(BGPT,0,1,BGPPTYPE)
  1. D W(" ",0,1,BGPPTYPE)
  1. Q
  1. ;I $G(BGPAREAA) S BGPNODEP=$S(BGPCHSO&('BGPCHSN):66,(BGPCHSO+BGPCHSN)=2:67,1:66)
  1. ;I '$G(BGPAREAA) S BGPNODEP=$S(BGPCHSO:64,1:59)
  1. ;S BGPX=$O(^BGPCTRL("B",2012,0))
  1. ;S BGPY=0 F S BGPY=$O(^BGPCTRL(BGPX,BGPNODEP,BGPY)) Q:BGPY'=+BGPY D
  1. ;.D W(^BGPCTRL(BGPX,BGPNODEP,BGPY,0),0,1,BGPPTYPE)
  1. ;.Q
  1. ;Q
  1. ENDTIME ;
  1. 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
  1. .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)
  1. Q
  1. AREACP ;EP - area cover page
  1. ;
  1. ;I BGPPTYPE="P" W:$D(IOF) @IOF
  1. D W("Cover Page",1,2,BGPPTYPE)
  1. D W("*** IHS 2013 EXECUTIVE ORDER QUALITY TRANSPARENCY MEASURES REPORT ***",1,2,BGPPTYPE)
  1. D W("AREA AGGREGATE",1,2,BGPPTYPE)
  1. D W($$RPTVER^BGP3BAN,1,2,BGPPTYPE)
  1. D W("Date Report Run: "_$$FMTE^XLFDT(DT),1,1,BGPPTYPE)
  1. D W("Site where Run: "_$P(^DIC(4,DUZ(2),0),U),1,1,BGPPTYPE)
  1. D W("Report Generated by: "_$$USR,1,1,BGPPTYPE)
  1. S X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) D W(X,1,1,BGPPTYPE)
  1. S X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED) D W(X,1,1,BGPPTYPE)
  1. S X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED) D W(X,1,1,BGPPTYPE)
  1. D W("Measures: Key Clinical Denominators and Numerators for Executive",0,2,BGPPTYPE)
  1. D W("Order 13410 Quality Transparency Reporting",0,1,BGPPTYPE)
  1. 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)
  1. ;
  1. D ENDTIME
  1. S BGPCHSO="",X=0 F S X=$O(BGPSUL(X)) Q:X'=+X I $P(^BGPEOCB(X,0),U,17) S BGPCHSO=1
  1. S BGPCHSN="",X=0 F S X=$O(BGPSUL(X)) Q:X'=+X I '$P(^BGPEOCB(X,0),U,17) S BGPCHSN=1
  1. D EOHDR
  1. I BGPROT'="P",'$D(BGPGUI) D W("A delimited output file called "_BGPDELF,0,2,BGPPTYPE) D
  1. .D W("has been placed in the "_$$GETDEDIR^BGP3UTL2()_" directory for your use in Excel or some",0,1,BGPPTYPE)
  1. .D W("other software package.",0,1,BGPPTYPE)
  1. .D W("See your site manager to access this file.",0,1,BGPPTYPE)
  1. .D W("",0,1,BGPPTYPE)
  1. ;
  1. D W("EO National Measures filenames: ",0,1,BGPPTYPE),W(BGPFGNT1,15,1,BGPPTYPE)
  1. D W("Report includes data from the following facilities:",0,2,BGPPTYPE)
  1. NEW BGPX
  1. S BGPX="",BGPC=0 F S BGPX=$O(BGPSUL(BGPX)) Q:BGPX="" D
  1. .S X=$P(^BGPEOCB(BGPX,0),U,9),X=$O(^AUTTLOC("C",X,0)) S X=$S(X:$P(^DIC(4,X,0),U),1:"?????")
  1. .S BGPC=BGPC+1,X=BGPC_". "_$S($P(^BGPEOCB(BGPX,0),U,17):"*",1:"")_X D W(X,0,1,BGPPTYPE,1,3)
  1. .Q
  1. S X=" " D W(X,0,1,BGPPTYPE)
  1. S X="The following communities are included in this report:" D W(X,0,1,BGPPTYPE,1,1)
  1. S BGPX="",BGPC=0 F S BGPX=$O(BGPSUL(BGPX)) Q:BGPX="" D
  1. .S X=$P(^BGPEOCB(BGPX,0),U,9),X=$O(^AUTTLOC("C",X,0)) S X=$S(X:$P(^DIC(4,X,0),U),1:"?????")
  1. .S BGPC=BGPC+1,X=BGPC_". "_$S($P(^BGPEOCB(BGPX,0),U,17):"*",1:"")_X D W(X,0,1,BGPPTYPE,1,3)
  1. .;S X="Communities: " D W(X,0,1,BGPPTYPE,1,5)
  1. .S X="Community Taxonomy Name: "_$P(^BGPEOCB(BGPX,0),U,18) D W(X,0,1,BGPPTYPE,1,5)
  1. .S BGPXX=0,BGPXN=0,BGPXY="" F S BGPXX=$O(^BGPEOCB(BGPX,9999,BGPXX)) Q:BGPXX'=+BGPXX S BGPXN=BGPXN+1,BGPXY=BGPXY_$S(BGPXN=1:"",1:";")_$P(^BGPEOCB(BGPX,9999,BGPXX,0),U)
  1. .S BGPX1=0,C=0 F BGPX1=1:3:BGPXN D
  1. ..D W($E($P(BGPXY,";",BGPX1),1,20),0,1,BGPPTYPE,1,10)
  1. ..D W($E($P(BGPXY,";",(BGPX1+1)),1,20),0,0,BGPPTYPE,2,30)
  1. ..D W($E($P(BGPXY,";",(BGPX1+2)),1,20),0,0,BGPPTYPE,3,60)
  1. ..Q
  1. .I $O(^BGPEOCB(BGPX,1111,0)) D
  1. ..D W("MFI Visit Locations: ",0,2,BGPPTYPE,1,5) S BGPXX=0,BGPXN=0,BGPXY="" F S BGPXX=$O(^BGPEOCB(BGPX,1111,BGPXX)) Q:BGPXX'=+BGPXX S BGPXN=BGPXN+1,BGPXY=BGPXY_$S(BGPXN=1:"",1:";")_$P(^BGPEOCB(BGPX,1111,BGPXX,0),U)
  1. ..S BGPX1=0,C=0 F BGPX1=1:3:BGPXN D
  1. ...D W($E($P(BGPXY,";",BGPX1),1,20),0,1,BGPPTYPE,1,10)
  1. ...D W($E($P(BGPXY,";",(BGPX1+1)),1,20),0,0,BGPPTYPE,2,30)
  1. ...D W($E($P(BGPXY,";",(BGPX1+2)),1,20),0,0,BGPPTYPE,3,60)
  1. ..Q
  1. .Q
  1. D W(" ",0,1,BGPPTYPE)
  1. I BGPCHSO D
  1. .S X=" " D W(X,0,1,BGPPTYPE)
  1. .S X="* CHS-only site. Uses Active Clinical CHS Population definition vs. Active Clinical." D W(X,0,1,BGPPTYPE)
  1. S X=" " D W(X,0,1,BGPPTYPE)
  1. K BGPX,BGPQUIT
  1. Q
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. EOP ;EP - End of page.
  1. Q:$E(IOST)'="C"
  1. Q:$D(ZTQUEUED)!'(IOT["TRM")!$D(IO("S"))
  1. NEW DIR
  1. K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
  1. S DIR(0)="E",DIR("A")="Press enter to continue" D ^DIR
  1. Q
  1. ;----------
  1. USR() ;EP - Return name of current user from ^VA(200.
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. ;;
  1. W(V,C,F,M,P,T) ;EP
  1. I $G(F)="" S F=1
  1. I $G(C)="" S C=0
  1. I $G(P)="" S P=1
  1. I $G(T)="" S T=0
  1. I M="P" D Q
  1. .I $Y>(BGPIOSL-2) D EOP W:$D(IOF) @IOF
  1. .NEW X
  1. .F X=1:1:F W !
  1. .I C W $$CTR(V,80)
  1. .I 'C W ?T,V
  1. ;set up array
  1. I '$G(F) S F=0
  1. NEW %,Z
  1. S Z=""
  1. S %=$P(^TMP($J,"BGPDEL",0),U)
  1. F Z=1:1:F S %=%+1 S ^TMP($J,"BGPDEL",%)=""
  1. S $P(^TMP($J,"BGPDEL",0),U)=%
  1. I '$D(^TMP($J,"BGPDEL",%)) S ^TMP($J,"BGPDEL",%)=""
  1. S $P(^TMP($J,"BGPDEL",%),U,P)=V
  1. Q
  1. ONH1 ;;
  1. ;;Denominator Definitions used in this Report:
  1. ;;
  1. ;;ACTIVE CLINICAL POPULATION:
  1. ;;1. Must reside in a community specified in the community taxonomy used for
  1. ;;this report.
  1. ;;2. Must be alive on the last day of the Report period.
  1. ;;QUIT
  1. ;
  1. ONH2 ;;
  1. ;;4. Must have 2 visits to medical clinics in the 3 years prior to the end
  1. ;;of the Report period. At least one visit must include: 01 General,
  1. ;;06 Diabetic, 10 GYN, 12 Immunization, 13 Internal Med, 20 Pediatrics, 24
  1. ;;Well Child, 28 Family Practice, 57 EPSDT, 70 Women's Health, 80 Urgent, 89
  1. ;;Evening. See User Manual for complete description of medical clinics.
  1. ;;
  1. ;;USER POPULATION:
  1. ;;1. Definitions 1-3 above.
  1. ;;2. Must have been seen at least once in the 3 years prior to the end of
  1. ;;the Report period, regardless of the clinic type.
  1. ;;
  1. ;;See last pages of this report for Performance Summary.
  1. ;;QUIT
  1. ;;
  1. ONH2C ;;
  1. ;;4. Must have 2 CHS visits in the 3 years prior to the end of the Report period.
  1. ;;
  1. ;;USER POPULATION:
  1. ;;1. Definitions 1-3 above.
  1. ;;2. Must have been seen at least once in the 3 years prior to the end of
  1. ;;the Report period, regardless of the clinic type.
  1. ;;
  1. ;;See last pages of this report for Performance Summary.
  1. ;;QUIT
  1. ;;