BGP3GAON ; IHS/CMI/LAB - AREA OTHER NATIONAL MEASURES GPRA REPORT 01 Jul 2010 1:10 PM ;
;;13.0;IHS CLINICAL REPORTING;;NOV 20, 2012;Build 81
;
;
TESTNTL ;
S ERR=""
S BGPSUL(1)=""
S BGPSUL(2)=""
D EP(.ERR,1,2522,"BGP 13 AREA OTHER NATIONAL MEASURES REPORT","A",.BGPSUL,1,3030000,3000000,1,"B",$$NOW^XLFDT)
W !,ERR
Q
EP(BGPRET,BGPUSER,BGPDUZ2,BGPOPTN,BGPRPTT,BGPSUL,BGPQTR,BGPPER,BGPVDT,BGPBEN,BGPROT,BGPRTIME,BGPHC,BGPFILE) ;EP - called from GUI to produce national gpra report (AO-AGP)
;SEE ROUTINE BGP3DAR for more info
; BGPUSER - DUZ
; BGPDUZ2 - DUZ(2)
; BGPOPTN - OPTION NAME
; BGPRPTT - A or F depending on whether site wants area or facility report, either way you need to display the entries to the user
; from BGP 13 DATA CURRENT that match the following:
; (SEE BGP3ASL or CALL ME)
; BGPSUL - array containing Iens from BGP 13 ONM DATA CURRENT that the user selected
; BGPSUL - ARRAY OF IENS FROM THE D GET^BGP3ASL(.BGPSUL,.BGPFILE,5,....... call that the user selected
; ; BGPQTR - this is equal to 1,2,3,4 or 5 depending on how the user answers the following
; DIR call:
; Select one of the following:
;
; 1 January 1 - December 31
; 2 April 1 - March 31
; 3 July 1 - June 30
; 4 October 1 - September 30
; 5 User defined date range
; Enter the date range for your report:
;
; BGPPER - this is the year they select if they answered the above question
; with a 1 through 4 e.g 305000 (fileman imprecise date for 2010)
; if they chose 5 then this will be the end date the enter
;
; BGPVDT - baseline year entered by user in internal fileman format, year only
; e.g. 3010000
;
; BGPBEN - 1 for Indians only, 2 for Not Indian, 3 for both (see reader call
; at subroutine BEN in BGP3DL
;
; BGPROT - type of output P for printed, D For Delimited, B for both
; BGPRTIME - report will be queued automatically, this variable
; contains the time it will run, internal fileman format
; must be date and time
; BGPRET - return value is ien^error message a zero (0)^NAME OF EXCEL FILE IF CHOSEN TO DO SO is
; passed as ien if error occurred, display the filename back to the user
; if they chose to export to area
;
;create entry in gui output file
;queue report to run with/GUIR
D EP1
S Y=BGPRET
;D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
S BGPRET=Y
Q
EP1 ;
S U="^"
I $G(BGPUSER)="" S BGPRET=0_"^USER NOT PASSED" Q
I $G(BGPDUZ2)="" S BGPRET=0_"^DUZ(2) NOT PASSED" Q
I $G(BGPOPTN)="" S BGPRET=0_"^OPTION NAME NOT PASSED" Q
I $G(BGPRPTT)="" S BGPRET=0_"^AREA OR FACILITY VARIABLE NOT PASSED" Q
I '$G(BGPHC),$G(BGPPER)="" S BGPRET=0_"^YEAR VARIABLE NOT PASSED" Q
I '$G(BGPHC),$G(BGPQTR)="" S BGPRET=0_"^QUARTER/DATE TYPE NOT PASSED" Q
I '$G(BGPHC),$G(BGPVDT)="" S BGPRET=0_"^BASELINE YEAR NOT PASSED" Q
I $G(BGPBEN)="" S BGPRET=0_"^BENIFICIARY TYPE NOT PASSED" Q
I "AF"'[BGPRPTT S BGPRET=0_"^AREA OR FACILTY VARIABLE INVALID" Q
I "PDB"'[$G(BGPROT) S BGPRET=0_"^REPORT OUTPUT TYPE NOT PASSED" Q
I '$D(BGPSUL) S BGPRET=0_"^FACILITY ARRAY NOT PASSED" Q
S X=0,C=0 F S X=$O(BGPSUL(X)) Q:X'=+X S C=C+1
I 0 S BGPRET=0_"^FACILITY ARRAY NOT PASSED" Q
S BGPSUCNT=0
S BGPSUCNT=C
I BGPSUCNT=1 S Y=$O(BGPSUL(0)),X=$P(^BGPGPDCH(Y,0),U,9),X=$O(^AUTTLOC("C",X,0)) I X S BGPSUNM=$P(^DIC(4,X,0),U)
S BGPRTIME=$G(BGPRTIME)
;S DUZ=BGPUSER
S DUZ(2)=BGPDUZ2
S:'$D(DT) DT=$$DT^XLFDT
D ^XBKVAR
S BGPGUI=1
S IOM=80,BGPIOSL=55
S BGPAREAA=1
S BGPRTYPE=7,BGPYRPTH=""
S BGPHOME=$P($G(^BGPSITE(DUZ(2),0)),U,2)
S X=0 F S X=$O(^BGPINDH("ON",1,X)) Q:X'=+X S BGPIND(X)=""
S BGPINDH="G"
I '$G(BGPHC) D
.I BGPQTR=1 S BGPBD=$E(BGPPER,1,3)_"0101",BGPED=$E(BGPPER,1,3)_"1231"
.I BGPQTR=2 S BGPBD=($E(BGPPER,1,3)-1)_"0401",BGPED=$E(BGPPER,1,3)_"0331"
.I BGPQTR=3 S BGPBD=($E(BGPPER,1,3)-1)_"0701",BGPED=$E(BGPPER,1,3)_"0630"
.I BGPQTR=4 S BGPBD=($E(BGPPER,1,3)-1)_"1001",BGPED=$E(BGPPER,1,3)_"0930"
.I BGPQTR=5 S BGPBD=$$FMADD^XLFDT(BGPPER,-364),BGPED=BGPPER,BGPPER=$E(BGPED,1,3)_"0000"
I ^%ZOSF("OS")["PC"!(^%ZOSF("OS")["NT")!($P($G(^AUTTSITE(1,0)),U,21)=2) S BGPUF=$S($P($G(^AUTTSITE(1,1)),U,2)]"":$P(^AUTTSITE(1,1),U,2),1:"C:\EXPORT")
I $G(BGPHC)="U" D
.S X=$E(BGPPER,1,3)-$E(BGPVDT,1,3)
.S X=X_"0000"
.S BGPBBD=BGPBD-X,BGPBBD=$E(BGPBBD,1,3)_$E(BGPBD,4,7)
.S BGPBED=BGPED-X,BGPBED=$E(BGPBED,1,3)_$E(BGPED,4,7)
.S BGPPBD=($E(BGPBD,1,3)-1)_$E(BGPBD,4,7)
.S BGPPED=($E(BGPED,1,3)-1)_$E(BGPED,4,7)
.S BGPBEN=1
S BGPASUF=$P(^AUTTLOC(DUZ(2),0),U,10)
S BGPRTC="U"
I $G(BGPHC)="H" D
.S BGPRTC="H"
.S (BGPBD,BGPED,BGPTP)=""
.S X=$O(^BGPCTRL("B",2013,0))
.S Y=^BGPCTRL(X,0)
.S BGPBD=$P(Y,U,8),BGPED=$P(Y,U,9)
.S BGPPBD=$P(Y,U,10),BGPPED=$P(Y,U,11)
.S BGPBBD=$P(Y,U,12),BGPBED=$P(Y,U,13)
.S BGPPER=$P(Y,U,14),BGPQTR=3
.S BGPBEN=1
S BGPDELT="",BGPEXCEL=1
S BGPC=0,X=0 F S X=$O(BGPSUL(X)) Q:X'=+X S BGPC=BGPC+1
S BGPNOW=$$NOW^XLFDT() S BGPNOW=$P(BGPNOW,".")_"."_$$RZERO^BGP3UTL($P(BGPNOW,".",2),6)
S BGPFONN1="CRSONMNT1"_$P(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
S BGPFONN2="CRSONMNT2"_$P(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
S BGPFONN3="CRSONMNT3"_$P(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
S BGPFONN4="CRSONMNT4"_$P(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
S BGPFONN5="CRSONMNT5"_$P(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
;create entry in GUI file
D ^XBFMK
S X=BGPFILE
S DIC="^BGPGUIH(",DIC(0)="L",DIADD=1,DLAYGO=90549.19
S DIC("DR")=".02////"_BGPUSER_";.03////"_$S(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT)_";.05///"_BGPOPTN_";.06///R;.07///"_$G(BGPROT)_";1///"_$G(BGPFONN1)_", "_$G(BGPFONN2)_", "_$G(BGPFONN3)_", "_$G(BGPFONN4) ;_", "_$G(BGPFONN5)
K DD,D0,DO D FILE^DICN K DLAYGO,DIADD,DD,D0,DO
I Y=-1 S BGPRET=0_"^UNABLE TO CREATE ENTRY IN GUI OUTPUT FILE" Q
S BGPGIEN=+Y
;SEND THE REPORT PROCESS OFF TO THE BACKGROUND USING TASKMAN CALL
D TSKMN
S BGPRET=BGPGIEN
S $P(BGPRET,"~",3)=$G(BGPFONN1)_","_$G(BGPFONN2)_","_$G(BGPFONN3)_","_$G(BGPFONN4)_","_$G(BGPFONN5)
Q
;
TSKMN ;
S ZTIO=""
K ZTSAVE S ZTSAVE("*")=""
S ZTCPU=$G(IOCPU),ZTRTN="AONM^BGP3GAON",ZTDTH=$S(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT),ZTDESC="GUI AREA ONM REPORT" D ^%ZTLOAD Q
Q
AONM ;
K ^TMP($J,"BGPGUI")
S IOM=80,BGPIOSL=55
;cmi/anch/maw added 5/12/2010 for word output
D GUIR^BGPXBLM("PRINT^BGP3PARQ","^TMP($J,""BGPGUI"",")
S X=0,C=0 F S X=$O(^TMP($J,"BGPGUI",X)) Q:X'=+X D
. S C=C+1
. N BGPDATA
. S BGPDATA=$G(^TMP($J,"BGPGUI",X))
. I BGPDATA="ZZZZZZZ" S BGPDATA=$C(12)
. S ^BGPGUIH(BGPGIEN,11,C,0)=BGPDATA
S ^BGPGUIH(BGPGIEN,11,0)="^90549.1911^"_C_"^"_C_"^"_DT
I BGPRPTT="A" D ONN1^BGP3UTL
K ^TMP($J,"BGPGUI")
;cmi/anch/maw end of mods
D ENDLOG
D XIT
Q
;
XIT ;
K ^TMP($J)
D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
K DIRUT,DUOUT,DIR,DOD
K DIADD,DLAYGO
D KILL^AUPNPAT
K X,X1,X2,X3,X4,X5,X6
K A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W,X,Y,Z
K N,N1,N2,N3,N4,N5,N6
K BD,ED
D KILL^AUPNPAT
D ^XBFMK
L -^BGPDATA
Q
;
ENDLOG ;-- UPDATE LOG AT END
S DIE="^BGPGUIH(",DA=BGPGIEN,DR=".04////"_$$NOW^XLFDT_";.06///C"
D ^DIE
K DIE,DR,DA
Q
BGP3GAON ; IHS/CMI/LAB - AREA OTHER NATIONAL MEASURES GPRA REPORT 01 Jul 2010 1:10 PM ;
+1 ;;13.0;IHS CLINICAL REPORTING;;NOV 20, 2012;Build 81
+2 ;
+3 ;
TESTNTL ;
+1 SET ERR=""
+2 SET BGPSUL(1)=""
+3 SET BGPSUL(2)=""
+4 DO EP(.ERR,1,2522,"BGP 13 AREA OTHER NATIONAL MEASURES REPORT","A",.BGPSUL,1,3030000,3000000,1,"B",$$NOW^XLFDT)
+5 WRITE !,ERR
+6 QUIT
EP(BGPRET,BGPUSER,BGPDUZ2,BGPOPTN,BGPRPTT,BGPSUL,BGPQTR,BGPPER,BGPVDT,BGPBEN,BGPROT,BGPRTIME,BGPHC,BGPFILE) ;EP - called from GUI to produce national gpra report (AO-AGP)
+1 ;SEE ROUTINE BGP3DAR for more info
+2 ; BGPUSER - DUZ
+3 ; BGPDUZ2 - DUZ(2)
+4 ; BGPOPTN - OPTION NAME
+5 ; BGPRPTT - A or F depending on whether site wants area or facility report, either way you need to display the entries to the user
+6 ; from BGP 13 DATA CURRENT that match the following:
+7 ; (SEE BGP3ASL or CALL ME)
+8 ; BGPSUL - array containing Iens from BGP 13 ONM DATA CURRENT that the user selected
+9 ; BGPSUL - ARRAY OF IENS FROM THE D GET^BGP3ASL(.BGPSUL,.BGPFILE,5,....... call that the user selected
+10 ; ; BGPQTR - this is equal to 1,2,3,4 or 5 depending on how the user answers the following
+11 ; DIR call:
+12 ; Select one of the following:
+13 ;
+14 ; 1 January 1 - December 31
+15 ; 2 April 1 - March 31
+16 ; 3 July 1 - June 30
+17 ; 4 October 1 - September 30
+18 ; 5 User defined date range
+19 ; Enter the date range for your report:
+20 ;
+21 ; BGPPER - this is the year they select if they answered the above question
+22 ; with a 1 through 4 e.g 305000 (fileman imprecise date for 2010)
+23 ; if they chose 5 then this will be the end date the enter
+24 ;
+25 ; BGPVDT - baseline year entered by user in internal fileman format, year only
+26 ; e.g. 3010000
+27 ;
+28 ; BGPBEN - 1 for Indians only, 2 for Not Indian, 3 for both (see reader call
+29 ; at subroutine BEN in BGP3DL
+30 ;
+31 ; BGPROT - type of output P for printed, D For Delimited, B for both
+32 ; BGPRTIME - report will be queued automatically, this variable
+33 ; contains the time it will run, internal fileman format
+34 ; must be date and time
+35 ; BGPRET - return value is ien^error message a zero (0)^NAME OF EXCEL FILE IF CHOSEN TO DO SO is
+36 ; passed as ien if error occurred, display the filename back to the user
+37 ; if they chose to export to area
+38 ;
+39 ;create entry in gui output file
+40 ;queue report to run with/GUIR
+41 DO EP1
+42 SET Y=BGPRET
+43 ;D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
+44 SET BGPRET=Y
+45 QUIT
EP1 ;
+1 SET U="^"
+2 IF $GET(BGPUSER)=""
SET BGPRET=0_"^USER NOT PASSED"
QUIT
+3 IF $GET(BGPDUZ2)=""
SET BGPRET=0_"^DUZ(2) NOT PASSED"
QUIT
+4 IF $GET(BGPOPTN)=""
SET BGPRET=0_"^OPTION NAME NOT PASSED"
QUIT
+5 IF $GET(BGPRPTT)=""
SET BGPRET=0_"^AREA OR FACILITY VARIABLE NOT PASSED"
QUIT
+6 IF '$GET(BGPHC)
IF $GET(BGPPER)=""
SET BGPRET=0_"^YEAR VARIABLE NOT PASSED"
QUIT
+7 IF '$GET(BGPHC)
IF $GET(BGPQTR)=""
SET BGPRET=0_"^QUARTER/DATE TYPE NOT PASSED"
QUIT
+8 IF '$GET(BGPHC)
IF $GET(BGPVDT)=""
SET BGPRET=0_"^BASELINE YEAR NOT PASSED"
QUIT
+9 IF $GET(BGPBEN)=""
SET BGPRET=0_"^BENIFICIARY TYPE NOT PASSED"
QUIT
+10 IF "AF"'[BGPRPTT
SET BGPRET=0_"^AREA OR FACILTY VARIABLE INVALID"
QUIT
+11 IF "PDB"'[$GET(BGPROT)
SET BGPRET=0_"^REPORT OUTPUT TYPE NOT PASSED"
QUIT
+12 IF '$DATA(BGPSUL)
SET BGPRET=0_"^FACILITY ARRAY NOT PASSED"
QUIT
+13 SET X=0
SET C=0
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
SET C=C+1
+14 IF 0
SET BGPRET=0_"^FACILITY ARRAY NOT PASSED"
QUIT
+15 SET BGPSUCNT=0
+16 SET BGPSUCNT=C
+17 IF BGPSUCNT=1
SET Y=$ORDER(BGPSUL(0))
SET X=$PIECE(^BGPGPDCH(Y,0),U,9)
SET X=$ORDER(^AUTTLOC("C",X,0))
IF X
SET BGPSUNM=$PIECE(^DIC(4,X,0),U)
+18 SET BGPRTIME=$GET(BGPRTIME)
+19 ;S DUZ=BGPUSER
+20 SET DUZ(2)=BGPDUZ2
+21 IF '$DATA(DT)
SET DT=$$DT^XLFDT
+22 DO ^XBKVAR
+23 SET BGPGUI=1
+24 SET IOM=80
SET BGPIOSL=55
+25 SET BGPAREAA=1
+26 SET BGPRTYPE=7
SET BGPYRPTH=""
+27 SET BGPHOME=$PIECE($GET(^BGPSITE(DUZ(2),0)),U,2)
+28 SET X=0
FOR
SET X=$ORDER(^BGPINDH("ON",1,X))
IF X'=+X
QUIT
SET BGPIND(X)=""
+29 SET BGPINDH="G"
+30 IF '$GET(BGPHC)
Begin DoDot:1
+31 IF BGPQTR=1
SET BGPBD=$EXTRACT(BGPPER,1,3)_"0101"
SET BGPED=$EXTRACT(BGPPER,1,3)_"1231"
+32 IF BGPQTR=2
SET BGPBD=($EXTRACT(BGPPER,1,3)-1)_"0401"
SET BGPED=$EXTRACT(BGPPER,1,3)_"0331"
+33 IF BGPQTR=3
SET BGPBD=($EXTRACT(BGPPER,1,3)-1)_"0701"
SET BGPED=$EXTRACT(BGPPER,1,3)_"0630"
+34 IF BGPQTR=4
SET BGPBD=($EXTRACT(BGPPER,1,3)-1)_"1001"
SET BGPED=$EXTRACT(BGPPER,1,3)_"0930"
+35 IF BGPQTR=5
SET BGPBD=$$FMADD^XLFDT(BGPPER,-364)
SET BGPED=BGPPER
SET BGPPER=$EXTRACT(BGPED,1,3)_"0000"
End DoDot:1
+36 IF ^%ZOSF("OS")["PC"!(^%ZOSF("OS")["NT")!($PIECE($GET(^AUTTSITE(1,0)),U,21)=2)
SET BGPUF=$SELECT($PIECE($GET(^AUTTSITE(1,1)),U,2)]"":$PIECE(^AUTTSITE(1,1),U,2),1:"C:\EXPORT")
+37 IF $GET(BGPHC)="U"
Begin DoDot:1
+38 SET X=$EXTRACT(BGPPER,1,3)-$EXTRACT(BGPVDT,1,3)
+39 SET X=X_"0000"
+40 SET BGPBBD=BGPBD-X
SET BGPBBD=$EXTRACT(BGPBBD,1,3)_$EXTRACT(BGPBD,4,7)
+41 SET BGPBED=BGPED-X
SET BGPBED=$EXTRACT(BGPBED,1,3)_$EXTRACT(BGPED,4,7)
+42 SET BGPPBD=($EXTRACT(BGPBD,1,3)-1)_$EXTRACT(BGPBD,4,7)
+43 SET BGPPED=($EXTRACT(BGPED,1,3)-1)_$EXTRACT(BGPED,4,7)
+44 SET BGPBEN=1
End DoDot:1
+45 SET BGPASUF=$PIECE(^AUTTLOC(DUZ(2),0),U,10)
+46 SET BGPRTC="U"
+47 IF $GET(BGPHC)="H"
Begin DoDot:1
+48 SET BGPRTC="H"
+49 SET (BGPBD,BGPED,BGPTP)=""
+50 SET X=$ORDER(^BGPCTRL("B",2013,0))
+51 SET Y=^BGPCTRL(X,0)
+52 SET BGPBD=$PIECE(Y,U,8)
SET BGPED=$PIECE(Y,U,9)
+53 SET BGPPBD=$PIECE(Y,U,10)
SET BGPPED=$PIECE(Y,U,11)
+54 SET BGPBBD=$PIECE(Y,U,12)
SET BGPBED=$PIECE(Y,U,13)
+55 SET BGPPER=$PIECE(Y,U,14)
SET BGPQTR=3
+56 SET BGPBEN=1
End DoDot:1
+57 SET BGPDELT=""
SET BGPEXCEL=1
+58 SET BGPC=0
SET X=0
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
SET BGPC=BGPC+1
+59 SET BGPNOW=$$NOW^XLFDT()
SET BGPNOW=$PIECE(BGPNOW,".")_"."_$$RZERO^BGP3UTL($PIECE(BGPNOW,".",2),6)
+60 SET BGPFONN1="CRSONMNT1"_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
+61 SET BGPFONN2="CRSONMNT2"_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
+62 SET BGPFONN3="CRSONMNT3"_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
+63 SET BGPFONN4="CRSONMNT4"_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
+64 SET BGPFONN5="CRSONMNT5"_$PIECE(^AUTTLOC(DUZ(2),0),U,10)_2010063000000000_$$D^BGP3UTL(BGPNOW)_"_"_$$LZERO^BGP3UTL(BGPC,6)_".TXT"
+65 ;create entry in GUI file
+66 DO ^XBFMK
+67 SET X=BGPFILE
+68 SET DIC="^BGPGUIH("
SET DIC(0)="L"
SET DIADD=1
SET DLAYGO=90549.19
+69 ;_", "_$G(BGPFONN5)
SET DIC("DR")=".02////"_BGPUSER_";.03////"_$SELECT(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT)_";.05///"_BGPOPTN_";.06///R;.07///"_$G(BGPROT)_";1///"_$GET(BGPFONN1)_", "_$GET(BGPFONN2)_", "_$GET(BGPFONN3)_", "_$GET(BGPFONN4)
+70 KILL DD,D0,DO
DO FILE^DICN
KILL DLAYGO,DIADD,DD,D0,DO
+71 IF Y=-1
SET BGPRET=0_"^UNABLE TO CREATE ENTRY IN GUI OUTPUT FILE"
QUIT
+72 SET BGPGIEN=+Y
+73 ;SEND THE REPORT PROCESS OFF TO THE BACKGROUND USING TASKMAN CALL
+74 DO TSKMN
+75 SET BGPRET=BGPGIEN
+76 SET $PIECE(BGPRET,"~",3)=$GET(BGPFONN1)_","_$GET(BGPFONN2)_","_$GET(BGPFONN3)_","_$GET(BGPFONN4)_","_$GET(BGPFONN5)
+77 QUIT
+78 ;
TSKMN ;
+1 SET ZTIO=""
+2 KILL ZTSAVE
SET ZTSAVE("*")=""
+3 SET ZTCPU=$GET(IOCPU)
SET ZTRTN="AONM^BGP3GAON"
SET ZTDTH=$SELECT(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT)
SET ZTDESC="GUI AREA ONM REPORT"
DO ^%ZTLOAD
QUIT
+4 QUIT
AONM ;
+1 KILL ^TMP($JOB,"BGPGUI")
+2 SET IOM=80
SET BGPIOSL=55
+3 ;cmi/anch/maw added 5/12/2010 for word output
+4 DO GUIR^BGPXBLM("PRINT^BGP3PARQ","^TMP($J,""BGPGUI"",")
+5 SET X=0
SET C=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPGUI",X))
IF X'=+X
QUIT
Begin DoDot:1
+6 SET C=C+1
+7 NEW BGPDATA
+8 SET BGPDATA=$GET(^TMP($JOB,"BGPGUI",X))
+9 IF BGPDATA="ZZZZZZZ"
SET BGPDATA=$CHAR(12)
+10 SET ^BGPGUIH(BGPGIEN,11,C,0)=BGPDATA
End DoDot:1
+11 SET ^BGPGUIH(BGPGIEN,11,0)="^90549.1911^"_C_"^"_C_"^"_DT
+12 IF BGPRPTT="A"
DO ONN1^BGP3UTL
+13 KILL ^TMP($JOB,"BGPGUI")
+14 ;cmi/anch/maw end of mods
+15 DO ENDLOG
+16 DO XIT
+17 QUIT
+18 ;
XIT ;
+1 KILL ^TMP($JOB)
+2 DO EN^XBVK("BGP")
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 KILL DIRUT,DUOUT,DIR,DOD
+4 KILL DIADD,DLAYGO
+5 DO KILL^AUPNPAT
+6 KILL X,X1,X2,X3,X4,X5,X6
+7 KILL A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W,X,Y,Z
+8 KILL N,N1,N2,N3,N4,N5,N6
+9 KILL BD,ED
+10 DO KILL^AUPNPAT
+11 DO ^XBFMK
+12 LOCK -^BGPDATA
+13 QUIT
+14 ;
ENDLOG ;-- UPDATE LOG AT END
+1 SET DIE="^BGPGUIH("
SET DA=BGPGIEN
SET DR=".04////"_$$NOW^XLFDT_";.06///C"
+2 DO ^DIE
+3 KILL DIE,DR,DA
+4 QUIT