BGP5GUPL ; IHS/CMI/LAB - GUI Upload ;
;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
;
;
EP(BGPRET,BGPUSER,BGPDUZ2,BGPOPTN,BGPDIR,BGPFILE,BGPRTIME) ;EP - called from GUI to produce COM REPORT CI05-AO-UPL
; SEE ROUTINE BGP5DL if you have questions about any of these variables
; BGPUSER - DUZ
; BGPDUZ2 - DUZ(2)
; BGPOPTN - OPTION NAME
; BGPFILE - FILE TO UPLOAD
;
;
; BGPRET - return value is ien^error message. a zero (0) is
; passed as ien if error occurred, display the filename back to the user
; if they chose to export to area
;
; I put the list of files in the BGPGUIK global in field 1100 as an output
;create entry in gui output file
;queue report to run with/GUIR
D EP1
S Y=$G(BGPRET)
;D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
I '$P($G(BGPRET),U) S BGPRET=1_"^Upload OK"
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(BGPDIR)="" S BGPRET=0_"^DIRECTORY NAME NOT PASSED" Q
I $G(BGPFILE)="" S BGPRET=0_"^FILE NAME NOT PASSED" Q
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
;SEND THE REPORT PROCESS OFF TO THE BACKGROUND USING TASKMAN CALL
AOUPL ;
READF ;EP read file
NEW Y,X,I,BGPC
S BGPC=1
S Y=$$OPEN^%ZISH(BGPDIR,BGPFILE,"R")
I Y S BGPRET="0^CANNOT OPEN (OR ACCESS) FILE '"_BGPDIR_BGPFILE_"'." D EOJ Q
KILL ^TMP("BGPUPL",$J)
F I=1:1 U IO R X:DTIME S X=$$STRIP(X) Q:X="" S ^TMP("BGPUPL",$J,BGPC,0)=X,BGPC=BGPC+1 Q:$$STATUS^%ZISH=-1
D ^%ZISC
;W !!,"All done reading file",!
PROC ;
I $P(BGPFILE,".",2)["EL" D PROCEL Q
I $P(BGPFILE,".",2)["PED" D PROCPED Q
;W !,"Processing",!
S BGP0=$P($G(^TMP("BGPUPL",$J,1,0)),"|",9)
S BGPG=$P($G(^TMP("BGPUPL",$J,1,0)),"|")
F X=1:1:14,21 S Y="BGP"_X,@Y=$P(BGP0,U,X)
I BGP21="" S BGP21="15.1"
;find existing entry and if exists, delete it
N X
S (X,BGPOIEN)=0 F S X=$O(^BGPGPDCK(X)) Q:X'=+X D
.Q:'$D(^BGPGPDCK(X,0))
.S Y=^BGPGPDCK(X,0)
.Q:$P(Y,U)'=BGP1
.Q:$P(Y,U,2)'=BGP2
.Q:$P(Y,U,3)'=BGP3
.Q:$P(Y,U,4)'=BGP4
.Q:$P(Y,U,5)'=BGP5
.Q:$P(Y,U,6)'=BGP6
.Q:$P(Y,U,8)'=BGP8
.Q:$P(Y,U,9)'=BGP9
.Q:$P(Y,U,10)'=BGP10
.Q:$P(Y,U,11)'=BGP11
.Q:$P(Y,U,12)'=BGP12
.Q:$P(Y,U,14)'=BGP14
.Q:$P(Y,U,21)'=BGP21
.S BGPOIEN=X
D ^XBFMK
I BGPOIEN S DA=BGPOIEN,DIK="^BGPGPDCK(" D ^DIK S DA=BGPOIEN,DIK="^BGPGPDPK(" D ^DIK S DA=BGPOIEN,DIK="^BGPGPDBK(" D ^DIK
;add entry
L +^BGPGPDCK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
L +^BGPGPDPK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
L +^BGPGPDBK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
D GETIEN^BGP5UTL
I 'BGPIEN S BGPRET=0_"^error in file creation...call programmer." D EOJ Q
CY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90554.03,DIC="^BGPGPDCK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPGPDCK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPGPDCK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPGPDCK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPGPDCK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPGPDCK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPGPDCK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPGPDCK(" D IX1^DIK
PY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90554.04,DIC="^BGPGPDPK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPGPDPK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPGPDPK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPGPDPK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPGPDPK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPGPDPK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPGPDPK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPGPDPK(" D IX1^DIK
BY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90554.05,DIC="^BGPGPDBK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPGPDBK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPGPDBK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPGPDBK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPGPDBK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPGPDBK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPGPDBK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPGPDBK(" D IX1^DIK
;W !,"Data uploaded."
D EOJ
Q
EOJ ;EP
L -^BGPGPDCK
L -^BGPGPDPK
L -^BGPGPDBK
L -^BGPELDCK
L -^BGPELDPK
L -^BGPELDBK
L -^BGPPEDCK
L -^BGPPEDPK
L -^BGPPEDBK
;D EOP^BGP5DH
K IOPAR
;D HOME^%ZIS
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 DIC,DA,X,Y,%Y,%,BGPJ,BGPTEXT,BGPLINE,BGP
K BGP1,BGP2,BGP3,BGP4,BGP5,BGP6,BGP7,BGP8,BGP9,BGP10,BGP11,BGP12,BGP13,BGP14,BGP21
Q
STRIP(Z) ;REMOVE CONTROLL CHARACTERS
NEW I
F I=1:1:$L(Z) I (32>$A($E(Z,I))) S Z=$E(Z,1,I-1)_""_$E(Z,I+1,999)
Q Z
PROCEL ;
;W !,"Processing",!
S BGP0=$P($G(^TMP("BGPUPL",$J,1,0)),"|",9)
S BGPG=$P($G(^TMP("BGPUPL",$J,1,0)),"|")
F X=1:1:14 S Y="BGP"_X,@Y=$P(BGP0,U,X)
;find existing entry and if exists, delete it
N X
S (X,BGPOIEN)=0 F S X=$O(^BGPELDCK(X)) Q:X'=+X S Y=^BGPELDCK(X,0) D
.Q:$P(Y,U)'=BGP1
.Q:$P(Y,U,2)'=BGP2
.Q:$P(Y,U,3)'=BGP3
.Q:$P(Y,U,4)'=BGP4
.Q:$P(Y,U,5)'=BGP5
.Q:$P(Y,U,6)'=BGP6
.Q:$P(Y,U,8)'=BGP8
.Q:$P(Y,U,9)'=BGP9
.Q:$P(Y,U,10)'=BGP10
.Q:$P(Y,U,11)'=BGP11
.Q:$P(Y,U,12)'=BGP12
.Q:$P(Y,U,14)'=BGP14
.S BGPOIEN=X
D ^XBFMK
I BGPOIEN S DA=BGPOIEN,DIK="^BGPELDCK(" D ^DIK S DA=BGPOIEN,DIK="^BGPELDPK(" D ^DIK S DA=BGPOIEN,DIK="^BGPELDBK(" D ^DIK
;add entry
L +^BGPELDCK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
L +^BGPELDPK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
L +^BGPELDBK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
D GETIEN^BGP5EUTL
I 'BGPIEN S BGPRET=0_"^error in file creation...call programmer." D EOJ Q
ELCY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90555.03,DIC="^BGPELDCK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPELDCK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPELDCK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPELDCK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPELDCK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPELDCK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPELDCK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPELDCK(" D IX1^DIK
ELPY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90555.04,DIC="^BGPELDPK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPELDPK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPELDPK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPELDPK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPELDPK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPELDPK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPELDPK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPELDPK(" D IX1^DIK
ELBY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90555.05,DIC="^BGPELDBK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
N X
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPELDBK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPELDBK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPELDBK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPELDBK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPELDBK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPELDBK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPELDBK(" D IX1^DIK
;W !,"Data uploaded."
D EOJ
Q
;
PROCPED ;
;W !,"Processing",!
S BGP0=$P($G(^TMP("BGPUPL",$J,1,0)),"|",9)
S BGPG=$P($G(^TMP("BGPUPL",$J,1,0)),"|")
F X=1:1:14 S Y="BGP"_X,@Y=$P(BGP0,U,X)
;find existing entry and if exists, delete it
N X
S (X,BGPOIEN)=0 F S X=$O(^BGPPEDCK(X)) Q:X'=+X S Y=^BGPPEDCK(X,0) D
.Q:$P(Y,U)'=BGP1
.Q:$P(Y,U,2)'=BGP2
.Q:$P(Y,U,3)'=BGP3
.Q:$P(Y,U,4)'=BGP4
.Q:$P(Y,U,5)'=BGP5
.Q:$P(Y,U,6)'=BGP6
.Q:$P(Y,U,7)'=BGP7
.Q:$P(Y,U,8)'=BGP8
.Q:$P(Y,U,9)'=BGP9
.Q:$P(Y,U,10)'=BGP10
.Q:$P(Y,U,11)'=BGP11
.Q:$P(Y,U,12)'=BGP12
.S BGPOIEN=X
D ^XBFMK
I BGPOIEN S DA=BGPOIEN,DIK="^BGPPEDCK(" D ^DIK S DA=BGPOIEN,DIK="^BGPPEDPK(" D ^DIK S DA=BGPOIEN,DIK="^BGPPEDBK(" D ^DIK
;add entry
L +^BGPPEDCK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
L +^BGPPEDPK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
L +^BGPPEDBK:10 I '$T S BGPRET=0_"^unable to lock global. TRY LATER" D EOJ Q
D GETIEN^BGP5PUTL
I 'BGPIEN S BGPRET=0_"^error in file creation...call programmer." D EOJ Q
PEDCY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90554.12,DIC="^BGPPEDCK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPPEDCK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPPEDCK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPPEDCK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPPEDCK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPPEDCK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPPEDCK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPPEDCK(" D IX1^DIK
PEDPY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90554.13,DIC="^BGPPEDPK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPPEDPK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPPEDPK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPPEDPK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPPEDPK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPPEDPK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPPEDPK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPPEDPK(" D IX1^DIK
PEDBY ;
S DINUM=BGPIEN,X=$P(BGP0,U),DLAYGO=90554.14,DIC="^BGPPEDBK(",DIC(0)="L"
K DD,D0,DO
D FILE^DICN
I Y=-1 S BGPRET=0_"^error uploading file......" G EOJ
S BGPIEN=+Y
D ^XBFMK
S X=0 F S X=$O(^TMP("BGPUPL",$J,X)) Q:X'=+X S V=^TMP("BGPUPL",$J,X,0) D
.Q:$P(V,"|")'="BGPPEDBK"
.S V=$P(V,"|",2,9999)
.S N=$P(V,"|"),N2=$P(V,"|",2),N3=$P(V,"|",3),N4=$P(V,"|",4),N5=$P(V,"|",5),D=$P(V,"|",8)
.I N5]"" S ^BGPPEDBK(BGPIEN,N,N2,N3,N4,N5)=D Q
.I N4]"" S ^BGPPEDBK(BGPIEN,N,N2,N3,N4)=D Q
.I N3]"" S ^BGPPEDBK(BGPIEN,N,N2,N3)=D Q
.I N2]"" S ^BGPPEDBK(BGPIEN,N,N2)=D Q
.I N]"" S ^BGPPEDBK(BGPIEN,N)=D
.Q
S DA=BGPIEN,DIK="^BGPPEDBK(" D IX1^DIK
;W !,"Data uploaded."
D EOJ
Q
;
BGP5GUPL ; IHS/CMI/LAB - GUI Upload ;
+1 ;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
+2 ;
+3 ;
EP(BGPRET,BGPUSER,BGPDUZ2,BGPOPTN,BGPDIR,BGPFILE,BGPRTIME) ;EP - called from GUI to produce COM REPORT CI05-AO-UPL
+1 ; SEE ROUTINE BGP5DL if you have questions about any of these variables
+2 ; BGPUSER - DUZ
+3 ; BGPDUZ2 - DUZ(2)
+4 ; BGPOPTN - OPTION NAME
+5 ; BGPFILE - FILE TO UPLOAD
+6 ;
+7 ;
+8 ; BGPRET - return value is ien^error message. a zero (0) is
+9 ; passed as ien if error occurred, display the filename back to the user
+10 ; if they chose to export to area
+11 ;
+12 ; I put the list of files in the BGPGUIK global in field 1100 as an output
+13 ;create entry in gui output file
+14 ;queue report to run with/GUIR
+15 DO EP1
+16 SET Y=$GET(BGPRET)
+17 ;D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
+18 IF '$PIECE($GET(BGPRET),U)
SET BGPRET=1_"^Upload OK"
+19 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(BGPDIR)=""
SET BGPRET=0_"^DIRECTORY NAME NOT PASSED"
QUIT
+6 IF $GET(BGPFILE)=""
SET BGPRET=0_"^FILE NAME NOT PASSED"
QUIT
+7 SET BGPRTIME=$GET(BGPRTIME)
+8 ;S DUZ=BGPUSER
+9 SET DUZ(2)=BGPDUZ2
+10 IF '$DATA(DT)
SET DT=$$DT^XLFDT
+11 DO ^XBKVAR
+12 SET BGPGUI=1
+13 SET IOM=80
SET BGPIOSL=55
+14 ;SEND THE REPORT PROCESS OFF TO THE BACKGROUND USING TASKMAN CALL
AOUPL ;
READF ;EP read file
+1 NEW Y,X,I,BGPC
+2 SET BGPC=1
+3 SET Y=$$OPEN^%ZISH(BGPDIR,BGPFILE,"R")
+4 IF Y
SET BGPRET="0^CANNOT OPEN (OR ACCESS) FILE '"_BGPDIR_BGPFILE_"'."
DO EOJ
QUIT
+5 KILL ^TMP("BGPUPL",$JOB)
+6 FOR I=1:1
USE IO
READ X:DTIME
SET X=$$STRIP(X)
IF X=""
QUIT
SET ^TMP("BGPUPL",$JOB,BGPC,0)=X
SET BGPC=BGPC+1
IF $$STATUS^%ZISH=-1
QUIT
+7 DO ^%ZISC
+8 ;W !!,"All done reading file",!
PROC ;
+1 IF $PIECE(BGPFILE,".",2)["EL"
DO PROCEL
QUIT
+2 IF $PIECE(BGPFILE,".",2)["PED"
DO PROCPED
QUIT
+3 ;W !,"Processing",!
+4 SET BGP0=$PIECE($GET(^TMP("BGPUPL",$JOB,1,0)),"|",9)
+5 SET BGPG=$PIECE($GET(^TMP("BGPUPL",$JOB,1,0)),"|")
+6 FOR X=1:1:14,21
SET Y="BGP"_X
SET @Y=$PIECE(BGP0,U,X)
+7 IF BGP21=""
SET BGP21="15.1"
+8 ;find existing entry and if exists, delete it
+9 NEW X
+10 SET (X,BGPOIEN)=0
FOR
SET X=$ORDER(^BGPGPDCK(X))
IF X'=+X
QUIT
Begin DoDot:1
+11 IF '$DATA(^BGPGPDCK(X,0))
QUIT
+12 SET Y=^BGPGPDCK(X,0)
+13 IF $PIECE(Y,U)'=BGP1
QUIT
+14 IF $PIECE(Y,U,2)'=BGP2
QUIT
+15 IF $PIECE(Y,U,3)'=BGP3
QUIT
+16 IF $PIECE(Y,U,4)'=BGP4
QUIT
+17 IF $PIECE(Y,U,5)'=BGP5
QUIT
+18 IF $PIECE(Y,U,6)'=BGP6
QUIT
+19 IF $PIECE(Y,U,8)'=BGP8
QUIT
+20 IF $PIECE(Y,U,9)'=BGP9
QUIT
+21 IF $PIECE(Y,U,10)'=BGP10
QUIT
+22 IF $PIECE(Y,U,11)'=BGP11
QUIT
+23 IF $PIECE(Y,U,12)'=BGP12
QUIT
+24 IF $PIECE(Y,U,14)'=BGP14
QUIT
+25 IF $PIECE(Y,U,21)'=BGP21
QUIT
+26 SET BGPOIEN=X
End DoDot:1
+27 DO ^XBFMK
+28 IF BGPOIEN
SET DA=BGPOIEN
SET DIK="^BGPGPDCK("
DO ^DIK
SET DA=BGPOIEN
SET DIK="^BGPGPDPK("
DO ^DIK
SET DA=BGPOIEN
SET DIK="^BGPGPDBK("
DO ^DIK
+29 ;add entry
+30 LOCK +^BGPGPDCK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+31 LOCK +^BGPGPDPK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+32 LOCK +^BGPGPDBK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+33 DO GETIEN^BGP5UTL
+34 IF 'BGPIEN
SET BGPRET=0_"^error in file creation...call programmer."
DO EOJ
QUIT
CY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90554.03
SET DIC="^BGPGPDCK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPGPDCK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPGPDCK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPGPDCK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPGPDCK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPGPDCK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPGPDCK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPGPDCK("
DO IX1^DIK
PY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90554.04
SET DIC="^BGPGPDPK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPGPDPK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPGPDPK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPGPDPK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPGPDPK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPGPDPK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPGPDPK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPGPDPK("
DO IX1^DIK
BY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90554.05
SET DIC="^BGPGPDBK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPGPDBK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPGPDBK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPGPDBK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPGPDBK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPGPDBK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPGPDBK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPGPDBK("
DO IX1^DIK
+18 ;W !,"Data uploaded."
+19 DO EOJ
+20 QUIT
EOJ ;EP
+1 LOCK -^BGPGPDCK
+2 LOCK -^BGPGPDPK
+3 LOCK -^BGPGPDBK
+4 LOCK -^BGPELDCK
+5 LOCK -^BGPELDPK
+6 LOCK -^BGPELDBK
+7 LOCK -^BGPPEDCK
+8 LOCK -^BGPPEDPK
+9 LOCK -^BGPPEDBK
+10 ;D EOP^BGP5DH
+11 KILL IOPAR
+12 ;D HOME^%ZIS
+13 KILL X,X1,X2,X3,X4,X5,X6
+14 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
+15 KILL N,N1,N2,N3,N4,N5,N6
+16 KILL DIC,DA,X,Y,%Y,%,BGPJ,BGPTEXT,BGPLINE,BGP
+17 KILL BGP1,BGP2,BGP3,BGP4,BGP5,BGP6,BGP7,BGP8,BGP9,BGP10,BGP11,BGP12,BGP13,BGP14,BGP21
+18 QUIT
STRIP(Z) ;REMOVE CONTROLL CHARACTERS
+1 NEW I
+2 FOR I=1:1:$LENGTH(Z)
IF (32>$ASCII($EXTRACT(Z,I)))
SET Z=$EXTRACT(Z,1,I-1)_""_$EXTRACT(Z,I+1,999)
+3 QUIT Z
PROCEL ;
+1 ;W !,"Processing",!
+2 SET BGP0=$PIECE($GET(^TMP("BGPUPL",$JOB,1,0)),"|",9)
+3 SET BGPG=$PIECE($GET(^TMP("BGPUPL",$JOB,1,0)),"|")
+4 FOR X=1:1:14
SET Y="BGP"_X
SET @Y=$PIECE(BGP0,U,X)
+5 ;find existing entry and if exists, delete it
+6 NEW X
+7 SET (X,BGPOIEN)=0
FOR
SET X=$ORDER(^BGPELDCK(X))
IF X'=+X
QUIT
SET Y=^BGPELDCK(X,0)
Begin DoDot:1
+8 IF $PIECE(Y,U)'=BGP1
QUIT
+9 IF $PIECE(Y,U,2)'=BGP2
QUIT
+10 IF $PIECE(Y,U,3)'=BGP3
QUIT
+11 IF $PIECE(Y,U,4)'=BGP4
QUIT
+12 IF $PIECE(Y,U,5)'=BGP5
QUIT
+13 IF $PIECE(Y,U,6)'=BGP6
QUIT
+14 IF $PIECE(Y,U,8)'=BGP8
QUIT
+15 IF $PIECE(Y,U,9)'=BGP9
QUIT
+16 IF $PIECE(Y,U,10)'=BGP10
QUIT
+17 IF $PIECE(Y,U,11)'=BGP11
QUIT
+18 IF $PIECE(Y,U,12)'=BGP12
QUIT
+19 IF $PIECE(Y,U,14)'=BGP14
QUIT
+20 SET BGPOIEN=X
End DoDot:1
+21 DO ^XBFMK
+22 IF BGPOIEN
SET DA=BGPOIEN
SET DIK="^BGPELDCK("
DO ^DIK
SET DA=BGPOIEN
SET DIK="^BGPELDPK("
DO ^DIK
SET DA=BGPOIEN
SET DIK="^BGPELDBK("
DO ^DIK
+23 ;add entry
+24 LOCK +^BGPELDCK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+25 LOCK +^BGPELDPK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+26 LOCK +^BGPELDBK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+27 DO GETIEN^BGP5EUTL
+28 IF 'BGPIEN
SET BGPRET=0_"^error in file creation...call programmer."
DO EOJ
QUIT
ELCY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90555.03
SET DIC="^BGPELDCK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPELDCK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPELDCK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPELDCK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPELDCK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPELDCK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPELDCK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPELDCK("
DO IX1^DIK
ELPY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90555.04
SET DIC="^BGPELDPK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPELDPK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPELDPK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPELDPK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPELDPK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPELDPK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPELDPK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPELDPK("
DO IX1^DIK
ELBY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90555.05
SET DIC="^BGPELDBK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 NEW X
+8 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+9 IF $PIECE(V,"|")'="BGPELDBK"
QUIT
+10 SET V=$PIECE(V,"|",2,9999)
+11 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+12 IF N5]""
SET ^BGPELDBK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+13 IF N4]""
SET ^BGPELDBK(BGPIEN,N,N2,N3,N4)=D
QUIT
+14 IF N3]""
SET ^BGPELDBK(BGPIEN,N,N2,N3)=D
QUIT
+15 IF N2]""
SET ^BGPELDBK(BGPIEN,N,N2)=D
QUIT
+16 IF N]""
SET ^BGPELDBK(BGPIEN,N)=D
+17 QUIT
End DoDot:1
+18 SET DA=BGPIEN
SET DIK="^BGPELDBK("
DO IX1^DIK
+19 ;W !,"Data uploaded."
+20 DO EOJ
+21 QUIT
+22 ;
PROCPED ;
+1 ;W !,"Processing",!
+2 SET BGP0=$PIECE($GET(^TMP("BGPUPL",$JOB,1,0)),"|",9)
+3 SET BGPG=$PIECE($GET(^TMP("BGPUPL",$JOB,1,0)),"|")
+4 FOR X=1:1:14
SET Y="BGP"_X
SET @Y=$PIECE(BGP0,U,X)
+5 ;find existing entry and if exists, delete it
+6 NEW X
+7 SET (X,BGPOIEN)=0
FOR
SET X=$ORDER(^BGPPEDCK(X))
IF X'=+X
QUIT
SET Y=^BGPPEDCK(X,0)
Begin DoDot:1
+8 IF $PIECE(Y,U)'=BGP1
QUIT
+9 IF $PIECE(Y,U,2)'=BGP2
QUIT
+10 IF $PIECE(Y,U,3)'=BGP3
QUIT
+11 IF $PIECE(Y,U,4)'=BGP4
QUIT
+12 IF $PIECE(Y,U,5)'=BGP5
QUIT
+13 IF $PIECE(Y,U,6)'=BGP6
QUIT
+14 IF $PIECE(Y,U,7)'=BGP7
QUIT
+15 IF $PIECE(Y,U,8)'=BGP8
QUIT
+16 IF $PIECE(Y,U,9)'=BGP9
QUIT
+17 IF $PIECE(Y,U,10)'=BGP10
QUIT
+18 IF $PIECE(Y,U,11)'=BGP11
QUIT
+19 IF $PIECE(Y,U,12)'=BGP12
QUIT
+20 SET BGPOIEN=X
End DoDot:1
+21 DO ^XBFMK
+22 IF BGPOIEN
SET DA=BGPOIEN
SET DIK="^BGPPEDCK("
DO ^DIK
SET DA=BGPOIEN
SET DIK="^BGPPEDPK("
DO ^DIK
SET DA=BGPOIEN
SET DIK="^BGPPEDBK("
DO ^DIK
+23 ;add entry
+24 LOCK +^BGPPEDCK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+25 LOCK +^BGPPEDPK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+26 LOCK +^BGPPEDBK:10
IF '$TEST
SET BGPRET=0_"^unable to lock global. TRY LATER"
DO EOJ
QUIT
+27 DO GETIEN^BGP5PUTL
+28 IF 'BGPIEN
SET BGPRET=0_"^error in file creation...call programmer."
DO EOJ
QUIT
PEDCY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90554.12
SET DIC="^BGPPEDCK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPPEDCK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPPEDCK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPPEDCK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPPEDCK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPPEDCK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPPEDCK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPPEDCK("
DO IX1^DIK
PEDPY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90554.13
SET DIC="^BGPPEDPK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPPEDPK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPPEDPK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPPEDPK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPPEDPK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPPEDPK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPPEDPK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPPEDPK("
DO IX1^DIK
PEDBY ;
+1 SET DINUM=BGPIEN
SET X=$PIECE(BGP0,U)
SET DLAYGO=90554.14
SET DIC="^BGPPEDBK("
SET DIC(0)="L"
+2 KILL DD,D0,DO
+3 DO FILE^DICN
+4 IF Y=-1
SET BGPRET=0_"^error uploading file......"
GOTO EOJ
+5 SET BGPIEN=+Y
+6 DO ^XBFMK
+7 SET X=0
FOR
SET X=$ORDER(^TMP("BGPUPL",$JOB,X))
IF X'=+X
QUIT
SET V=^TMP("BGPUPL",$JOB,X,0)
Begin DoDot:1
+8 IF $PIECE(V,"|")'="BGPPEDBK"
QUIT
+9 SET V=$PIECE(V,"|",2,9999)
+10 SET N=$PIECE(V,"|")
SET N2=$PIECE(V,"|",2)
SET N3=$PIECE(V,"|",3)
SET N4=$PIECE(V,"|",4)
SET N5=$PIECE(V,"|",5)
SET D=$PIECE(V,"|",8)
+11 IF N5]""
SET ^BGPPEDBK(BGPIEN,N,N2,N3,N4,N5)=D
QUIT
+12 IF N4]""
SET ^BGPPEDBK(BGPIEN,N,N2,N3,N4)=D
QUIT
+13 IF N3]""
SET ^BGPPEDBK(BGPIEN,N,N2,N3)=D
QUIT
+14 IF N2]""
SET ^BGPPEDBK(BGPIEN,N,N2)=D
QUIT
+15 IF N]""
SET ^BGPPEDBK(BGPIEN,N)=D
+16 QUIT
End DoDot:1
+17 SET DA=BGPIEN
SET DIK="^BGPPEDBK("
DO IX1^DIK
+18 ;W !,"Data uploaded."
+19 DO EOJ
+20 QUIT
+21 ;