ACRFODD ;IHS/OIRM/DSD/AEF - Open Document Download Processing [ 10/27/2004 4:18 PM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;**13**;NOV 05, 2001
;
REC ;EP -- ENTRY POINT TO RECEIVE ODD OBLIGATION FILE FROM CORE
;
N AP,DIC,DIR,OUT,PATH,X,Y
D ^XBKVAR
S DIC="^AUTTACPT("
S DIC(0)="AEMQ"
D ^DIC
S AP=$P(Y,U,2)
Q:'AP
;S PATH=$P($G(^ACRSYS(1,301)),U) ; ACR*2.1*13.06 IM14144
S PATH=$$ODDPATH^ACRFSYS(1) ; ACR*2.1*13.06 IM14144
Q:PATH']""
D ASKPATHO^ACRFZISH(PATH,.ACROK) ; ACR*2.1*13.06 IM14144
Q:'ACROK ; ACR*2.1*13.06 IM14144
;S DIR(0)="Y" ; ACR*2.1*13.06 IM14144
;S DIR("A")="Is this OK" ; ACR*2.1*13.06 IM14144
;S DIR("B")="YES" ; ACR*2.1*13.06 IM14144
;D ^DIR ; ACR*2.1*13.06 IM14144
;Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) ; ACR*2.1*13.06 IM14144
;I 'Y D SEL(.PATH,.OUT) ; ACR*2.1*13.06 IM14144
;I $G(OUT) W !,"DOWNLOAD ABORTED!" Q ; ACR*2.1*13.06 IM14144
;Q:PATH']"" ; ACR*2.1*13.06 IM14144
;I $E(PATH)'="/" S PATH="/"_PATH ; ACR*2.1*13.06 IM14144
;I $E(PATH,$L(PATH))'="/" S PATH=PATH_"/" ; ACR*2.1*13.06 IM14144
W !
;D TCMD^ACRFUTL("/usr/spool/afsdata/odocget "_AP_" "_PATH) ; ACR*2.1*13.06 IM14144
D TCMD^ACRFUTL(PATH_"odocget "_AP_" "_PATH) ; ACR*2.1*13.06 IM14144
;H 2 ; ACR*2.1*13.06 IM14144
;K DIR ; ACR*2.1*13.06 IM14144
;S DIR(0)="E" ; ACR*2.1*13.06 IM14144
;S DIR("A")="Enter RETURN to continue" ; ACR*2.1*13.06 IM14144
;D ^DIR ; ACR*2.1*13.06 IM14144
D PAUSE^ACRFWARN ; ACR*2.1*13.06 IM14144
Q
SEL(PATH,OUT) ; ; ACR*2.1*13.06 IM14144
;----- SELECT UNIX DIRECTORY
;
ASK ; REMOVED
Q ; ACR*2.1*13.06 IM14144
N DIR,Y
S DIR(0)="F"
S DIR("A")="Directory"
D ^DIR
I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S OUT=1 Q
S PATH=Y
D JCMD^ACRFUTL("cd "_PATH,.Y)
I Y D G ASK
. W !,"No such directory "_PATH
Q
IMP ;EP -- IMPORT ODD OBLIGATIONS INTO OPEN DOCUMENT DATABASE
;
N DIR,FILE,OUT,PATH,Y
D INFO
W !
S DIR(0)="Y"
S DIR("A")="Do you want to continue"
S DIR("B")="NO"
D ^DIR
K DIR
Q:'Y
;S PATH=$P($G(^ACRSYS(1,301)),U) ; ACR*2.1*13.06 IM14144
S PATH=$$ODDPATH^ACRFSYS(1) ; ACR*2.1*13.06 IM14144
Q:PATH']""
;I $E(PATH)'="/" S PATH="/"_PATH ; ACR*2.1*13.06 IM14144
;I $E(PATH,$L(PATH))'="/" S PATH=PATH_"/" ; ACR*2.1*13.06 IM14144
D LIST(PATH)
D PICK(.OUT,.Y)
Q:$G(OUT)
S FILE=Y
;
;----- INTERFACE TO AFSLLDO2 ROUTINE
;
D CRTSETUP^AFSLCRTS
D SETTBL^AFSLLDO1
S AFSEXFN=PATH_FILE
S AFSLAPN=+$P(FILE,".",2)
D ^AFSLLDO2
;D JCMD^ACRFUTL("rm /usr/spool/afsdata/pccodd.files") ; ACR*2.1*13.06 IM14144
;D JCMD^ACRFUTL("rm "_PATH_"pccodd.files") ; ACR*2.1*13.06 IM14144
D DEL^ACRFZISH(PATH,"pccodd.files") ; ACR*2.1*13.06 IM14144
K ^TMP("ACR",$J)
Q
PICK(OUT,Y) ;
;----- PICK WHICH FILE TO IMPORT
;
;N DIR,DTOUT,DUOUT,X
W !
S DIR(0)="F"
S DIR("A")="Select FILE for import"
S DIR("?")="Enter file name to import, or '??' for a list of files"
S DIR("??")="^D LIST^ACRFODD"
F D Q:$G(OUT) Q:$G(Y)]""
. D ^DIR
. I $D(DTOUT)!($D(DUOUT)) S OUT=1 Q
. I '$D(^TMP("ACR",$J,"FILES",Y)) D K Y
. . W !,?5,"No such file "_Y
Q
LIST(PATH) ;
;----- LIST OF ODD FILES
;
N DATA,I,FILE,QUIT,X
D ^XBKVAR
K ^TMP("ACR",$J)
;D JCMD^ACRFUTL("rm /usr/spool/afsdata/pccodd.files") ; ACR*2.1*13.06 IM14144
;D JCMD^ACRFUTL("ls -l "_PATH_"pccspc* > /usr/spool/afsdata/pccodd.files") ; ACR*2.1*13.06 IM14144
;D OPEN^%ZISH("FILE","/usr/spool/afsdata/","pccodd.files","R") ; ACR*2.1*13.06 IM14144
;D JCMD^ACRFUTL("rm "_PATH_"pccodd.files") ;ACR*2.1*13.06 IM14144
;Q:POP ;ACR*2.1*13.06 IM14144
;U IO ;ACR*2.1*13.06 IM14144
D DEL^ACRFZISH(PATH,"pccodd.files") ;ACR*2.1*13.06 IM14144
D JCMD^ACRFUTL("ls -l "_PATH_"pccspc* > "_PATH_"pccodd.files") ; ACR*2.1*13.06 IM14144
D HFS^ACRFZISH(PATH,"pccodd.files","R",.%DEV) ;ACR*2.1*13.06 IM14144
Q:$G(%DEV)']"" ;ACR*2.1*13.06 IM14144
U %DEV ;ACR*2.1*13.06 IM14144
F I=1:1 D Q:$G(QUIT)
. R X:DTIME
. I $$STATUS^%ZISH S QUIT=1 Q
. S ^TMP("ACR",$J,"DATA",I,0)=X
D CLOSE^%ZISH("FILE")
S I=0
F S I=$O(^TMP("ACR",$J,"DATA",I)) Q:'I D
. S X=^TMP("ACR",$J,"DATA",I,0)
. S X=$E(X,55,999)
. S ^TMP("ACR",$J,"FILES",$P(X,"/",$L(X,"/")),0)=$TR($E(X,30,40)," ","")_U_$E(X,42,53)_U_$P(X,"/",$L(X,"/"))
D HOME^%ZIS
W @IOF
I '$D(^TMP("ACR",$J,"FILES")) W !,"No files to import" Q
W !,"ODD files available for import into Open Document database"
W !
S FILE=""
F S FILE=$O(^TMP("ACR",$J,"FILES",FILE)) Q:FILE']"" D
. S DATA=^TMP("ACR",$J,"FILES",FILE,0)
. W !,$J($P(DATA,U),15)
. W ?18,$P(DATA,U,2)
. W ?32,$P(DATA,U,3)
Q
INFO ;----- WRITE WARNING INFORMATION
;
W !?18,"IMPORT CORE OBLIGATIONS DOWNLOAD FILE"
W !
W !?10,"This import process will completely replace all data"
W !?10,"currently stored in your local obligations document"
W !?10,"file with the current obligations data on file in the"
W !?10,"CORE Accounting System. There should have been NO"
W !?10,"payment data entered into the ARMS PAYMENT system since"
W !?10,"the last DHR Data Entry splitout & transmission to CORE."
W !?10,"Otherwise, that data must be re-entered after this"
W !?10,"import process is completed. IT IS RECOMMENDED THAT"
W !?10,"YOU REQUEST YOUR ADP SITE MANAGER SAVE THE GLOBAL"
W !?10,"^AFSLODOC BEFORE YOU CONTINUE WITH THIS PROCESS."
Q
ACRFODD ;IHS/OIRM/DSD/AEF - Open Document Download Processing [ 10/27/2004 4:18 PM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**13**;NOV 05, 2001
+2 ;
REC ;EP -- ENTRY POINT TO RECEIVE ODD OBLIGATION FILE FROM CORE
+1 ;
+2 NEW AP,DIC,DIR,OUT,PATH,X,Y
+3 DO ^XBKVAR
+4 SET DIC="^AUTTACPT("
+5 SET DIC(0)="AEMQ"
+6 DO ^DIC
+7 SET AP=$PIECE(Y,U,2)
+8 IF 'AP
QUIT
+9 ;S PATH=$P($G(^ACRSYS(1,301)),U) ; ACR*2.1*13.06 IM14144
+10 ; ACR*2.1*13.06 IM14144
SET PATH=$$ODDPATH^ACRFSYS(1)
+11 IF PATH']""
QUIT
+12 ; ACR*2.1*13.06 IM14144
DO ASKPATHO^ACRFZISH(PATH,.ACROK)
+13 ; ACR*2.1*13.06 IM14144
IF 'ACROK
QUIT
+14 ;S DIR(0)="Y" ; ACR*2.1*13.06 IM14144
+15 ;S DIR("A")="Is this OK" ; ACR*2.1*13.06 IM14144
+16 ;S DIR("B")="YES" ; ACR*2.1*13.06 IM14144
+17 ;D ^DIR ; ACR*2.1*13.06 IM14144
+18 ;Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) ; ACR*2.1*13.06 IM14144
+19 ;I 'Y D SEL(.PATH,.OUT) ; ACR*2.1*13.06 IM14144
+20 ;I $G(OUT) W !,"DOWNLOAD ABORTED!" Q ; ACR*2.1*13.06 IM14144
+21 ;Q:PATH']"" ; ACR*2.1*13.06 IM14144
+22 ;I $E(PATH)'="/" S PATH="/"_PATH ; ACR*2.1*13.06 IM14144
+23 ;I $E(PATH,$L(PATH))'="/" S PATH=PATH_"/" ; ACR*2.1*13.06 IM14144
+24 WRITE !
+25 ;D TCMD^ACRFUTL("/usr/spool/afsdata/odocget "_AP_" "_PATH) ; ACR*2.1*13.06 IM14144
+26 ; ACR*2.1*13.06 IM14144
DO TCMD^ACRFUTL(PATH_"odocget "_AP_" "_PATH)
+27 ;H 2 ; ACR*2.1*13.06 IM14144
+28 ;K DIR ; ACR*2.1*13.06 IM14144
+29 ;S DIR(0)="E" ; ACR*2.1*13.06 IM14144
+30 ;S DIR("A")="Enter RETURN to continue" ; ACR*2.1*13.06 IM14144
+31 ;D ^DIR ; ACR*2.1*13.06 IM14144
+32 ; ACR*2.1*13.06 IM14144
DO PAUSE^ACRFWARN
+33 QUIT
SEL(PATH,OUT) ; ; ACR*2.1*13.06 IM14144
+1 ;----- SELECT UNIX DIRECTORY
+2 ;
ASK ; REMOVED
+1 ; ACR*2.1*13.06 IM14144
QUIT
+2 NEW DIR,Y
+3 SET DIR(0)="F"
+4 SET DIR("A")="Directory"
+5 DO ^DIR
+6 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
SET OUT=1
QUIT
+7 SET PATH=Y
+8 DO JCMD^ACRFUTL("cd "_PATH,.Y)
+9 IF Y
Begin DoDot:1
+10 WRITE !,"No such directory "_PATH
End DoDot:1
GOTO ASK
+11 QUIT
IMP ;EP -- IMPORT ODD OBLIGATIONS INTO OPEN DOCUMENT DATABASE
+1 ;
+2 NEW DIR,FILE,OUT,PATH,Y
+3 DO INFO
+4 WRITE !
+5 SET DIR(0)="Y"
+6 SET DIR("A")="Do you want to continue"
+7 SET DIR("B")="NO"
+8 DO ^DIR
+9 KILL DIR
+10 IF 'Y
QUIT
+11 ;S PATH=$P($G(^ACRSYS(1,301)),U) ; ACR*2.1*13.06 IM14144
+12 ; ACR*2.1*13.06 IM14144
SET PATH=$$ODDPATH^ACRFSYS(1)
+13 IF PATH']""
QUIT
+14 ;I $E(PATH)'="/" S PATH="/"_PATH ; ACR*2.1*13.06 IM14144
+15 ;I $E(PATH,$L(PATH))'="/" S PATH=PATH_"/" ; ACR*2.1*13.06 IM14144
+16 DO LIST(PATH)
+17 DO PICK(.OUT,.Y)
+18 IF $GET(OUT)
QUIT
+19 SET FILE=Y
+20 ;
+21 ;----- INTERFACE TO AFSLLDO2 ROUTINE
+22 ;
+23 DO CRTSETUP^AFSLCRTS
+24 DO SETTBL^AFSLLDO1
+25 SET AFSEXFN=PATH_FILE
+26 SET AFSLAPN=+$PIECE(FILE,".",2)
+27 DO ^AFSLLDO2
+28 ;D JCMD^ACRFUTL("rm /usr/spool/afsdata/pccodd.files") ; ACR*2.1*13.06 IM14144
+29 ;D JCMD^ACRFUTL("rm "_PATH_"pccodd.files") ; ACR*2.1*13.06 IM14144
+30 ; ACR*2.1*13.06 IM14144
DO DEL^ACRFZISH(PATH,"pccodd.files")
+31 KILL ^TMP("ACR",$JOB)
+32 QUIT
PICK(OUT,Y) ;
+1 ;----- PICK WHICH FILE TO IMPORT
+2 ;
+3 ;N DIR,DTOUT,DUOUT,X
+4 WRITE !
+5 SET DIR(0)="F"
+6 SET DIR("A")="Select FILE for import"
+7 SET DIR("?")="Enter file name to import, or '??' for a list of files"
+8 SET DIR("??")="^D LIST^ACRFODD"
+9 FOR
Begin DoDot:1
+10 DO ^DIR
+11 IF $DATA(DTOUT)!($DATA(DUOUT))
SET OUT=1
QUIT
+12 IF '$DATA(^TMP("ACR",$JOB,"FILES",Y))
Begin DoDot:2
+13 WRITE !,?5,"No such file "_Y
End DoDot:2
KILL Y
End DoDot:1
IF $GET(OUT)
QUIT
IF $GET(Y)]""
QUIT
+14 QUIT
LIST(PATH) ;
+1 ;----- LIST OF ODD FILES
+2 ;
+3 NEW DATA,I,FILE,QUIT,X
+4 DO ^XBKVAR
+5 KILL ^TMP("ACR",$JOB)
+6 ;D JCMD^ACRFUTL("rm /usr/spool/afsdata/pccodd.files") ; ACR*2.1*13.06 IM14144
+7 ;D JCMD^ACRFUTL("ls -l "_PATH_"pccspc* > /usr/spool/afsdata/pccodd.files") ; ACR*2.1*13.06 IM14144
+8 ;D OPEN^%ZISH("FILE","/usr/spool/afsdata/","pccodd.files","R") ; ACR*2.1*13.06 IM14144
+9 ;D JCMD^ACRFUTL("rm "_PATH_"pccodd.files") ;ACR*2.1*13.06 IM14144
+10 ;Q:POP ;ACR*2.1*13.06 IM14144
+11 ;U IO ;ACR*2.1*13.06 IM14144
+12 ;ACR*2.1*13.06 IM14144
DO DEL^ACRFZISH(PATH,"pccodd.files")
+13 ; ACR*2.1*13.06 IM14144
DO JCMD^ACRFUTL("ls -l "_PATH_"pccspc* > "_PATH_"pccodd.files")
+14 ;ACR*2.1*13.06 IM14144
DO HFS^ACRFZISH(PATH,"pccodd.files","R",.%DEV)
+15 ;ACR*2.1*13.06 IM14144
IF $GET(%DEV)']""
QUIT
+16 ;ACR*2.1*13.06 IM14144
USE %DEV
+17 FOR I=1:1
Begin DoDot:1
+18 READ X:DTIME
+19 IF $$STATUS^%ZISH
SET QUIT=1
QUIT
+20 SET ^TMP("ACR",$JOB,"DATA",I,0)=X
End DoDot:1
IF $GET(QUIT)
QUIT
+21 DO CLOSE^%ZISH("FILE")
+22 SET I=0
+23 FOR
SET I=$ORDER(^TMP("ACR",$JOB,"DATA",I))
IF 'I
QUIT
Begin DoDot:1
+24 SET X=^TMP("ACR",$JOB,"DATA",I,0)
+25 SET X=$EXTRACT(X,55,999)
+26 SET ^TMP("ACR",$JOB,"FILES",$PIECE(X,"/",$LENGTH(X,"/")),0)=$TRANSLATE($EXTRACT(X,30,40)," ","")_U_$EXTRACT(X,42,53)_U_$PIECE(X,"/",$LENGTH(X,"/"))
End DoDot:1
+27 DO HOME^%ZIS
+28 WRITE @IOF
+29 IF '$DATA(^TMP("ACR",$JOB,"FILES"))
WRITE !,"No files to import"
QUIT
+30 WRITE !,"ODD files available for import into Open Document database"
+31 WRITE !
+32 SET FILE=""
+33 FOR
SET FILE=$ORDER(^TMP("ACR",$JOB,"FILES",FILE))
IF FILE']""
QUIT
Begin DoDot:1
+34 SET DATA=^TMP("ACR",$JOB,"FILES",FILE,0)
+35 WRITE !,$JUSTIFY($PIECE(DATA,U),15)
+36 WRITE ?18,$PIECE(DATA,U,2)
+37 WRITE ?32,$PIECE(DATA,U,3)
End DoDot:1
+38 QUIT
INFO ;----- WRITE WARNING INFORMATION
+1 ;
+2 WRITE !?18,"IMPORT CORE OBLIGATIONS DOWNLOAD FILE"
+3 WRITE !
+4 WRITE !?10,"This import process will completely replace all data"
+5 WRITE !?10,"currently stored in your local obligations document"
+6 WRITE !?10,"file with the current obligations data on file in the"
+7 WRITE !?10,"CORE Accounting System. There should have been NO"
+8 WRITE !?10,"payment data entered into the ARMS PAYMENT system since"
+9 WRITE !?10,"the last DHR Data Entry splitout & transmission to CORE."
+10 WRITE !?10,"Otherwise, that data must be re-entered after this"
+11 WRITE !?10,"import process is completed. IT IS RECOMMENDED THAT"
+12 WRITE !?10,"YOU REQUEST YOUR ADP SITE MANAGER SAVE THE GLOBAL"
+13 WRITE !?10,"^AFSLODOC BEFORE YOU CONTINUE WITH THIS PROCESS."
+14 QUIT