BGP8PDL ; IHS/CMI/LAB - IHS gpra print 01 Jul 2010 8:02 PM ;
;;18.1;IHS CLINICAL REPORTING;**1**;MAY 25, 2018;Build 65
;
;
;
SAVEDEL ;EP
I $G(BGPSUMON) D SUMONLY Q ;NEW FOR 09, SUMMARY ONLY
I BGPDELT="S" D SCREEN,EXIT Q
;call xbgsave to create output file
S XBGL="BGPDATA"
L +^BGPDATA:300 E W:'$D(ZTQUEUED) "Unable to lock global" Q
K ^TMP($J,"SUMMARYDEL")
K ^BGPDATA ;global for saving
S X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)'="ENDCOVERPAGE" S ^BGPDATA(X)=^TMP($J,"BGPDEL",X)
I '$D(BGPGUI) D
.;I $P($G(^BGPSITE(DUZ(2),0)),U,14) S XBUF=$P(^BGPSITE(DUZ(2),0),U,14)
.S XBFLT=1,XBFN=BGPDELF_".txt",XBMED="F",XBTLE="GPRA 18.1 DELIMITED OUTPUT",XBQ="N",XBF=0
.D ^XBGSAVE
.K XBFLT,XBFN,XBMED,XBTLE,XBE,XBF
I $D(BGPGUI) D
.S (C,X)=0 F S X=$O(^BGPDATA(X)) Q:X'=+X S C=C+1,^BGPGUIR(BGPGIEN,12,C,0)=^BGPDATA(X)
.S ^BGPGUIR(BGPGIEN,12,0)="^90560.1912^"_C_"^"_C_"^"_DT
L -^BGPDATA
K ^BGPDATA ;export global
D EXIT
Q
SUMONLY ;
;if screen selected do screen
I BGPDELT="S" D SCREENSO,EXIT Q
;call xbgsave to create output file
S XBGL="BGPDATA"
L +^BGPDATA:300 E W:'$D(ZTQUEUED) "Unable to lock global" Q
K ^TMP($J,"SUMMARYDEL")
K ^BGPDATA ;global for saving
S X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X!(^TMP($J,"BGPDEL",X)="ENDCOVERPAGE") S ^BGPDATA(X)=^TMP($J,"BGPDEL",X),BGPLX=X
;GET STARTING POINT
S BGPSTP=0,X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)="GPRA DEVELOPMENTAL CLINICAL PERFORMANCE SUMMARY" S BGPSTP=X
S X=BGPSTP-1,BGPLX=BGPLX+1,BGPDEVE=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X!(BGPDEVE) S BGPLX=BGPLX+1 S ^BGPDATA(BGPLX)=^TMP($J,"BGPDEL",X) I ^TMP($J,"BGPDEL",X)="refusals with respect to GPRA Developmental measure." S BGPDEVE=X
I $G(BGPAREAA) D
.S BGPSTP=0,X=BGPDEVE F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)="refusals with respect to GPRA Developmental measure." S BGPSTP=X
.S X=BGPDEVE,BGPLX=BGPLX+1,BGPDEVE=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X!(BGPDEVE) S BGPLX=BGPLX+1 S ^BGPDATA(BGPLX)=^TMP($J,"BGPDEL",X) I ^TMP($J,"BGPDEL",X)="refusals with respect to GPRA Developmental measure." S BGPDEVE=X
S BGPSTP=0,X=BGPDEVE F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)="SELECTED NON-GPRA MEASURES CLINICAL PERFORMANCE SUMMARY" S BGPSTP=X
S X=BGPSTP-1,BGPLX=BGPLX+1,BGPDEVE=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X S BGPLX=BGPLX+1 S ^BGPDATA(BGPLX)=^TMP($J,"BGPDEL",X)
I '$D(BGPGUI) D
.;I $P($G(^BGPSITE(DUZ(2),0)),U,14) ;S XBUF=$P(^BGPSITE(DUZ(2),0),U,14)
.S XBFLT=1,XBFN=BGPDELF_".txt",XBMED="F",XBTLE="GPRA 18.1 DELIMITED OUTPUT",XBQ="N",XBF=0
.D ^XBGSAVE
.K XBFLT,XBFN,XBMED,XBTLE,XBE,XBF
I $D(BGPGUI) D
.S (C,X)=0 F S X=$O(^BGPDATA(X)) Q:X'=+X S C=C+1,^BGPGUIR(BGPGIEN,12,C,0)=^BGPDATA(X)
.S ^BGPGUIR(BGPGIEN,12,0)="^90560.1912^"_C_"^"_C_"^"_DT
L -^BGPDATA
K ^BGPDATA ;export global
D EXIT
Q
SCREENSO ;
S X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X!(^TMP($J,"BGPDEL",X)="ENDCOVERPAGE") W !,^TMP($J,"BGPDEL",X) S BGPLX=X
S BGPSTP=0,X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)["GPRA DEVELOPMENTAL CLINICAL PERFORMANCE SUMMARY" S BGPSTP=X
S X=BGPSTP-1,BGPLX=BGPLX+1,BGPDEVE=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X!(BGPDEVE) S BGPLX=BGPLX+1 W !,^TMP($J,"BGPDEL",X) I ^TMP($J,"BGPDEL",X)="refusals with respect to GPRA Developmental measure." S BGPDEVE=X
I $G(BGPAREAA) D
.S BGPSTP=0,X=BGPDEVE F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)="refusals with respect to GPRA Developmental measure." S BGPSTP=X
.S X=BGPDEVE,BGPLX=BGPLX+1,BGPDEVE=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X!(BGPDEVE) S BGPLX=BGPLX+1 W !,^TMP($J,"BGPDEL",X) I ^TMP($J,"BGPDEL",X)="refusals with respect to GPRA Developmental measure." S BGPDEVE=X
S BGPSTP=0,X=BGPDEVE F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)["SELECTED NON-GPRA MEASURES CLINICAL PERFORMANCE SUMMARY" S BGPSTP=X
S X=BGPSTP-1,BGPLX=BGPLX+1,BGPDEVE=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X S BGPLX=BGPLX+1 W !,^TMP($J,"BGPDEL",X)
Q
;
SCREEN ;
S X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X W:^TMP($J,"BGPDEL",X)'="ENDCOVERPAGE" !,^TMP($J,"BGPDEL",X)
Q
S Y=$P(^VA(200,DUZ,0),U,2),$E(Y,35)=$$FMTE^XLFDT(DT) D S(Y,1,1)
I BGPRTYPE=7 S Y="*** IHS 2018 Other National Measures Report ***" D S(Y,1,1)
I BGPRTYPE=4 S Y="*** IHS 2018 Clinical Performance Report ***" D S(Y,1,1)
I BGPRTYPE=1,'$G(BGPNGR09) S Y="*** IHS 2018 National GPRA/GPRAMA Report ***" D S(Y,1,1)
I BGPRTYPE=1,$G(BGPNGR09) S Y="*** IHS 2018 National GPRA/GPRAMA Report, Run Using 2018 Logic ***" D S(Y,1,1)
I $G(BGPAREAA) S Y="AREA AGGREGATE" D S(Y,1,1)
I '$G(BGPAREAA) S Y=$P(^DIC(4,DUZ(2),0),U) D S(Y,1,1)
;S X=$$RPTVER^BGP8BAN D S(X,1,1)
S X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) D S(X,1,1)
S X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED) D S(X,1,1)
S X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED) D S(X,1,1)
S X=" " D S(X,1,1)
Q:$G(BGPSUMP)
I BGPRTYPE=1 S X="Measures: GPRA, GPRA Developmental, and PART Denominators and Numerators and Selected Other Clinical Denominators and Numerators" D S(X,1,1)
S X=" " D S(X,1,1)
I BGPRTYPE=1 S X="Population: AI/AN Only (Classification 01)" D S(X,1,1)
S X=" " D S(X,1,1)
S BGPI=$O(^BGPCTRL("B",2018,0))
S BGPX=0 F S BGPX=$O(^BGPCTRL(BGPI,14,BGPX)) Q:BGPX'=+BGPX D
.S X=^BGPCTRL(BGPI,14,BGPX,0) D S(X,1,1)
I $G(BGPEXPT) S X="A file will be created called BG"_$$FV^BGP8BAN()_$P(^AUTTLOC(DUZ(2),0),U,10)_"."_BGPRPT_"." D S(X,1,1)
S X="It will reside in the public/export directory. This file should be sent to your Area Office." D S(X,1,1)
S X=" " D S(X,1,1)
I $G(BGPALLPT) S X="All Communities Included." D S(X,1,1)
I '$G(BGPALLPT),'$G(BGPSEAT) D
.I BGPTAXI S X="Community Taxonomy Name: "_$P(^ATXAX(BGPTAXI,0),U) D S(X,1,1)
.I $G(BGPCOMMI) S X="Community Name: "_$P(^AUTTCOM(BGPCOMMI,0),U) D S(X,1,1)
I '$G(BGPALLPT),'$G(BGPSEAT) S X="The following communities are included in this report:" D S(X,1,1) 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
..S X=$E($P(Y,";",BGPZZ),1,20),$E(X,3)=$E($P(Y,";",(BGPZZ+1)),1,20),$E(X,60)=$E($P(Y,";",(BGPZZ+2)),1,20)
..Q
K BGPX,BGPQUIT
S X=$TR($J(""," ","-"),80) D S(X,1,1)
Q
EXIT ;
K ^TMP($J)
Q
CTR(X,Y) ;EP - Center
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
USR() ;EP - Return user
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
S(Y,F,P) ;EP set up array
I '$G(F) S F=0
S %=$P(^TMP($J,"BGPDEL",0),U)+F,$P(^TMP($J,"BGPDEL",0),U)=%
I '$D(^TMP($J,"BGPDEL",%)) S ^TMP($J,"BGPDEL",%)=""
S $P(^TMP($J,"BGPDEL",%),U,P)=Y
Q
C(X,X2,X3) ;
D COMMA^%DTC
Q X
BGP8PDL ; IHS/CMI/LAB - IHS gpra print 01 Jul 2010 8:02 PM ;
+1 ;;18.1;IHS CLINICAL REPORTING;**1**;MAY 25, 2018;Build 65
+2 ;
+3 ;
+4 ;
SAVEDEL ;EP
+1 ;NEW FOR 09, SUMMARY ONLY
IF $GET(BGPSUMON)
DO SUMONLY
QUIT
+2 IF BGPDELT="S"
DO SCREEN
DO EXIT
QUIT
+3 ;call xbgsave to create output file
+4 SET XBGL="BGPDATA"
+5 LOCK +^BGPDATA:300
IF '$TEST
IF '$DATA(ZTQUEUED)
WRITE "Unable to lock global"
QUIT
+6 KILL ^TMP($JOB,"SUMMARYDEL")
+7 ;global for saving
KILL ^BGPDATA
+8 SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)'="ENDCOVERPAGE"
SET ^BGPDATA(X)=^TMP($JOB,"BGPDEL",X)
+9 IF '$DATA(BGPGUI)
Begin DoDot:1
+10 ;I $P($G(^BGPSITE(DUZ(2),0)),U,14) S XBUF=$P(^BGPSITE(DUZ(2),0),U,14)
+11 SET XBFLT=1
SET XBFN=BGPDELF_".txt"
SET XBMED="F"
SET XBTLE="GPRA 18.1 DELIMITED OUTPUT"
SET XBQ="N"
SET XBF=0
+12 DO ^XBGSAVE
+13 KILL XBFLT,XBFN,XBMED,XBTLE,XBE,XBF
End DoDot:1
+14 IF $DATA(BGPGUI)
Begin DoDot:1
+15 SET (C,X)=0
FOR
SET X=$ORDER(^BGPDATA(X))
IF X'=+X
QUIT
SET C=C+1
SET ^BGPGUIR(BGPGIEN,12,C,0)=^BGPDATA(X)
+16 SET ^BGPGUIR(BGPGIEN,12,0)="^90560.1912^"_C_"^"_C_"^"_DT
End DoDot:1
+17 LOCK -^BGPDATA
+18 ;export global
KILL ^BGPDATA
+19 DO EXIT
+20 QUIT
SUMONLY ;
+1 ;if screen selected do screen
+2 IF BGPDELT="S"
DO SCREENSO
DO EXIT
QUIT
+3 ;call xbgsave to create output file
+4 SET XBGL="BGPDATA"
+5 LOCK +^BGPDATA:300
IF '$TEST
IF '$DATA(ZTQUEUED)
WRITE "Unable to lock global"
QUIT
+6 KILL ^TMP($JOB,"SUMMARYDEL")
+7 ;global for saving
KILL ^BGPDATA
+8 SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X!(^TMP($JOB,"BGPDEL",X)="ENDCOVERPAGE")
QUIT
SET ^BGPDATA(X)=^TMP($JOB,"BGPDEL",X)
SET BGPLX=X
+9 ;GET STARTING POINT
+10 SET BGPSTP=0
SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)="GPRA DEVELOPMENTAL CLINICAL PERFORMANCE SUMMARY"
SET BGPSTP=X
+11 SET X=BGPSTP-1
SET BGPLX=BGPLX+1
SET BGPDEVE=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X!(BGPDEVE)
QUIT
SET BGPLX=BGPLX+1
SET ^BGPDATA(BGPLX)=^TMP($JOB,"BGPDEL",X)
IF ^TMP($JOB,"BGPDEL",X)="refusals with respect to GPRA Developmental measure."
SET BGPDEVE=X
+12 IF $GET(BGPAREAA)
Begin DoDot:1
+13 SET BGPSTP=0
SET X=BGPDEVE
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)="refusals with respect to GPRA Developmental measure."
SET BGPSTP=X
+14 SET X=BGPDEVE
SET BGPLX=BGPLX+1
SET BGPDEVE=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X!(BGPDEVE)
QUIT
SET BGPLX=BGPLX+1
SET ^BGPDATA(BGPLX)=^TMP($JOB,"BGPDEL",X)
IF ^TMP($JOB,"BGPDEL",X)="refusals with respect to GPRA Developmental measure."
SET BGPDEVE=X
End DoDot:1
+15 SET BGPSTP=0
SET X=BGPDEVE
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)="SELECTED NON-GPRA MEASURES CLINICAL PERFORMANCE SUMMARY"
SET BGPSTP=X
+16 SET X=BGPSTP-1
SET BGPLX=BGPLX+1
SET BGPDEVE=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
SET BGPLX=BGPLX+1
SET ^BGPDATA(BGPLX)=^TMP($JOB,"BGPDEL",X)
+17 IF '$DATA(BGPGUI)
Begin DoDot:1
+18 ;I $P($G(^BGPSITE(DUZ(2),0)),U,14) ;S XBUF=$P(^BGPSITE(DUZ(2),0),U,14)
+19 SET XBFLT=1
SET XBFN=BGPDELF_".txt"
SET XBMED="F"
SET XBTLE="GPRA 18.1 DELIMITED OUTPUT"
SET XBQ="N"
SET XBF=0
+20 DO ^XBGSAVE
+21 KILL XBFLT,XBFN,XBMED,XBTLE,XBE,XBF
End DoDot:1
+22 IF $DATA(BGPGUI)
Begin DoDot:1
+23 SET (C,X)=0
FOR
SET X=$ORDER(^BGPDATA(X))
IF X'=+X
QUIT
SET C=C+1
SET ^BGPGUIR(BGPGIEN,12,C,0)=^BGPDATA(X)
+24 SET ^BGPGUIR(BGPGIEN,12,0)="^90560.1912^"_C_"^"_C_"^"_DT
End DoDot:1
+25 LOCK -^BGPDATA
+26 ;export global
KILL ^BGPDATA
+27 DO EXIT
+28 QUIT
SCREENSO ;
+1 SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X!(^TMP($JOB,"BGPDEL",X)="ENDCOVERPAGE")
QUIT
WRITE !,^TMP($JOB,"BGPDEL",X)
SET BGPLX=X
+2 SET BGPSTP=0
SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)["GPRA DEVELOPMENTAL CLINICAL PERFORMANCE SUMMARY"
SET BGPSTP=X
+3 SET X=BGPSTP-1
SET BGPLX=BGPLX+1
SET BGPDEVE=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X!(BGPDEVE)
QUIT
SET BGPLX=BGPLX+1
WRITE !,^TMP($JOB,"BGPDEL",X)
IF ^TMP($JOB,"BGPDEL",X)="refusals with respect to GPRA Developmental measure."
SET BGPDEVE=X
+4 IF $GET(BGPAREAA)
Begin DoDot:1
+5 SET BGPSTP=0
SET X=BGPDEVE
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)="refusals with respect to GPRA Developmental measure."
SET BGPSTP=X
+6 SET X=BGPDEVE
SET BGPLX=BGPLX+1
SET BGPDEVE=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X!(BGPDEVE)
QUIT
SET BGPLX=BGPLX+1
WRITE !,^TMP($JOB,"BGPDEL",X)
IF ^TMP($JOB,"BGPDEL",X)="refusals with respect to GPRA Developmental measure."
SET BGPDEVE=X
End DoDot:1
+7 SET BGPSTP=0
SET X=BGPDEVE
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)["SELECTED NON-GPRA MEASURES CLINICAL PERFORMANCE SUMMARY"
SET BGPSTP=X
+8 SET X=BGPSTP-1
SET BGPLX=BGPLX+1
SET BGPDEVE=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
SET BGPLX=BGPLX+1
WRITE !,^TMP($JOB,"BGPDEL",X)
+9 QUIT
+10 ;
SCREEN ;
+1 SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)'="ENDCOVERPAGE"
WRITE !,^TMP($JOB,"BGPDEL",X)
+2 QUIT
+1 SET Y=$PIECE(^VA(200,DUZ,0),U,2)
SET $EXTRACT(Y,35)=$$FMTE^XLFDT(DT)
DO S(Y,1,1)
+2 IF BGPRTYPE=7
SET Y="*** IHS 2018 Other National Measures Report ***"
DO S(Y,1,1)
+3 IF BGPRTYPE=4
SET Y="*** IHS 2018 Clinical Performance Report ***"
DO S(Y,1,1)
+4 IF BGPRTYPE=1
IF '$GET(BGPNGR09)
SET Y="*** IHS 2018 National GPRA/GPRAMA Report ***"
DO S(Y,1,1)
+5 IF BGPRTYPE=1
IF $GET(BGPNGR09)
SET Y="*** IHS 2018 National GPRA/GPRAMA Report, Run Using 2018 Logic ***"
DO S(Y,1,1)
+6 IF $GET(BGPAREAA)
SET Y="AREA AGGREGATE"
DO S(Y,1,1)
+7 IF '$GET(BGPAREAA)
SET Y=$PIECE(^DIC(4,DUZ(2),0),U)
DO S(Y,1,1)
+8 ;S X=$$RPTVER^BGP8BAN D S(X,1,1)
+9 SET X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED)
DO S(X,1,1)
+10 SET X="Previous Year Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED)
DO S(X,1,1)
+11 SET X="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED)
DO S(X,1,1)
+12 SET X=" "
DO S(X,1,1)
+13 IF $GET(BGPSUMP)
QUIT
+14 IF BGPRTYPE=1
SET X="Measures: GPRA, GPRA Developmental, and PART Denominators and Numerators and Selected Other Clinical Denominators and Numerators"
DO S(X,1,1)
+15 SET X=" "
DO S(X,1,1)
+16 IF BGPRTYPE=1
SET X="Population: AI/AN Only (Classification 01)"
DO S(X,1,1)
+17 SET X=" "
DO S(X,1,1)
+18 SET BGPI=$ORDER(^BGPCTRL("B",2018,0))
+19 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPCTRL(BGPI,14,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:1
+20 SET X=^BGPCTRL(BGPI,14,BGPX,0)
DO S(X,1,1)
End DoDot:1
+21 IF $GET(BGPEXPT)
SET X="A file will be created called BG"_$$FV^BGP8BAN()_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_"."_BGPRPT_"."
DO S(X,1,1)
+22 SET X="It will reside in the public/export directory. This file should be sent to your Area Office."
DO S(X,1,1)
+23 SET X=" "
DO S(X,1,1)
+24 IF $GET(BGPALLPT)
SET X="All Communities Included."
DO S(X,1,1)
+25 IF '$GET(BGPALLPT)
IF '$GET(BGPSEAT)
Begin DoDot:1
+26 IF BGPTAXI
SET X="Community Taxonomy Name: "_$PIECE(^ATXAX(BGPTAXI,0),U)
DO S(X,1,1)
+27 IF $GET(BGPCOMMI)
SET X="Community Name: "_$PIECE(^AUTTCOM(BGPCOMMI,0),U)
DO S(X,1,1)
End DoDot:1
+28 IF '$GET(BGPALLPT)
IF '$GET(BGPSEAT)
SET X="The following communities are included in this report:"
DO S(X,1,1)
Begin DoDot:1
+29 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
+30 SET BGPZZ=0
SET C=0
FOR BGPZZ=1:3:N
Begin DoDot:2
+31 SET X=$EXTRACT($PIECE(Y,";",BGPZZ),1,20)
SET $EXTRACT(X,3)=$EXTRACT($PIECE(Y,";",(BGPZZ+1)),1,20)
SET $EXTRACT(X,60)=$EXTRACT($PIECE(Y,";",(BGPZZ+2)),1,20)
+32 QUIT
End DoDot:2
End DoDot:1
+33 KILL BGPX,BGPQUIT
+34 SET X=$TRANSLATE($JUSTIFY(""," ","-"),80)
DO S(X,1,1)
+35 QUIT
EXIT ;
+1 KILL ^TMP($JOB)
+2 QUIT
CTR(X,Y) ;EP - Center
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------
USR() ;EP - Return user
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
S(Y,F,P) ;EP set up array
+1 IF '$GET(F)
SET F=0
+2 SET %=$PIECE(^TMP($JOB,"BGPDEL",0),U)+F
SET $PIECE(^TMP($JOB,"BGPDEL",0),U)=%
+3 IF '$DATA(^TMP($JOB,"BGPDEL",%))
SET ^TMP($JOB,"BGPDEL",%)=""
+4 SET $PIECE(^TMP($JOB,"BGPDEL",%),U,P)=Y
+5 QUIT
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X