ABPAPI01 ;POST INITIALIZATION TASKS; [ 08/07/91 12:03 PM ]
;;1.4;AO PVT-INS TRACKING;*1*;IHS-OKC/KJR;AUGUST 6, 1991
;;PATCH 1: ADDED CMRP+4;SET 0TH NODE IF REQUIRED;IHS-OKC/KJR;07AUG91
G MAIN
;---------------------------------------------------------------------
DEVICE ;PROCEDURE TO SELECT PRINTER DEVICE FOR THE INSTALLATION GUIDE
W !!," I have some additional notes to help you complete this "
W "installation process. "
K %IS,%ZIS S %IS("A")=" Select PRINTER to use: ",%IS="N"
F I=0:0 D Q:$D(ABPAIO)=11
.K ABPAIO D ^%ZIS I POP!($E(IOST,1)'="P")!($D(IO("S"))=1) D Q
..S %IS("A")=" Select PRINTER to use: ",%IS="N" K IO("S")
..W *7," MUST SELECT A NON-SLAVED 'PRINTER' DEVICE"
.S ABPAIO=+IO,ABPAIO(0)=IO(0)
Q
;---------------------------------------------------------------------
ACCTPT ;PROCEDURE TO CHECK FOR/ESTABLISH PRIMARY ACCOUNTING POINT
W !!," Checking for a primary account..." H 1 S MSG="found!"
I $D(^ABPAFAC("B"))=0 K MSG W *7,"not found!",!,?6,"Establishing '" D
.W $P(^DIC(4,ABPASITE,0),"^"),"' as the primary account."
.K DIC,DIE,DA,DR,X,Y S DIC="^ABPAFAC(",DIC(0)="L"
.S X=$P(^DIC(4,ABPASITE,0),"^") D ^DIC
I $D(MSG)=1 W MSG
Q
;---------------------------------------------------------------------
CMRP ;PROCEDURE TO CLOSE THE REPORTING PERIOD PRIOR TO SYSTEM START-UP
S Y=$E(DT,1,3),X=$E(DT,4,5) I +X'=1 S X=X-1 S:X<10 X=0_X S Y=Y_X_"00"
E S Y=(Y-1)_1200
S ABPA("DT")=Y K DIC,DA S DA(1)=$O(^ABPAFAC(0)) Q:+DA(1)'>0
I $D(^ABPAFAC(DA(1),1,0))'=1 S ^ABPAFAC(DA(1),1,0)="^9002270.08D^^0"
S DIC="^ABPAFAC("_DA(1)_",1,",DIC(0)="L",X=ABPA("DT") D ^DIC
Q
;---------------------------------------------------------------------
XREF ;PROCEDURE TO VALIDATE CROSS REFERENCES
W !!," ...Excuse me, I insist upon checking your file indexes..."
W !," This may take awhile. Please be patient. "
K DIK,DA S DIK="^ABPVAO(" D IXALL^DIK W "all done!"
Q
;---------------------------------------------------------------------
CLOSE ;PROCEDURE TO CLOSE OUTPUT DEVICE(S) & KILL TEMPORARY VARIABLES
U IO W @IOF X ^%ZIS("C") S IOP=ABPAIO(0) D ^%ZIS
K ABPAIO,MSG,DIK,I,QFLG,ABPAIO,DIR,DIC,DIE,DR,DA,J
Q
;---------------------------------------------------------------------
MAIN ;ENTRY POINT - THE PRIMARY ROUTINE DRIVER
W *7,!!,"I HAVE TO RUN A POST-INITIALIZATION ROUTINE."
D ACCTPT,OPTS^ABPAPI02,LOCKS^ABPAPI02,KEYS^ABPAPI03,CMRP,XREF
I ABPA("CONVERT") D BEGIN^ABPADC01 ;Convert pre v1.4 data
D DEVICE U IO(0) W !," This will take 5-10 minutes. ",!
D DOCS^ABPAPI03,CLOSE W !!,"POST INITIALIZATION COMPLETE!"
Q
ABPAPI01 ;POST INITIALIZATION TASKS; [ 08/07/91 12:03 PM ]
+1 ;;1.4;AO PVT-INS TRACKING;*1*;IHS-OKC/KJR;AUGUST 6, 1991
+2 ;;PATCH 1: ADDED CMRP+4;SET 0TH NODE IF REQUIRED;IHS-OKC/KJR;07AUG91
+3 GOTO MAIN
+4 ;---------------------------------------------------------------------
DEVICE ;PROCEDURE TO SELECT PRINTER DEVICE FOR THE INSTALLATION GUIDE
+1 WRITE !!," I have some additional notes to help you complete this "
+2 WRITE "installation process. "
+3 KILL %IS,%ZIS
SET %IS("A")=" Select PRINTER to use: "
SET %IS="N"
+4 FOR I=0:0
Begin DoDot:1
+5 KILL ABPAIO
DO ^%ZIS
IF POP!($EXTRACT(IOST,1)'="P")!($DATA(IO("S"))=1)
Begin DoDot:2
+6 SET %IS("A")=" Select PRINTER to use: "
SET %IS="N"
KILL IO("S")
+7 WRITE *7," MUST SELECT A NON-SLAVED 'PRINTER' DEVICE"
End DoDot:2
QUIT
+8 SET ABPAIO=+IO
SET ABPAIO(0)=IO(0)
End DoDot:1
IF $DATA(ABPAIO)=11
QUIT
+9 QUIT
+10 ;---------------------------------------------------------------------
ACCTPT ;PROCEDURE TO CHECK FOR/ESTABLISH PRIMARY ACCOUNTING POINT
+1 WRITE !!," Checking for a primary account..."
HANG 1
SET MSG="found!"
+2 IF $DATA(^ABPAFAC("B"))=0
KILL MSG
WRITE *7,"not found!",!,?6,"Establishing '"
Begin DoDot:1
+3 WRITE $PIECE(^DIC(4,ABPASITE,0),"^"),"' as the primary account."
+4 KILL DIC,DIE,DA,DR,X,Y
SET DIC="^ABPAFAC("
SET DIC(0)="L"
+5 SET X=$PIECE(^DIC(4,ABPASITE,0),"^")
DO ^DIC
End DoDot:1
+6 IF $DATA(MSG)=1
WRITE MSG
+7 QUIT
+8 ;---------------------------------------------------------------------
CMRP ;PROCEDURE TO CLOSE THE REPORTING PERIOD PRIOR TO SYSTEM START-UP
+1 SET Y=$EXTRACT(DT,1,3)
SET X=$EXTRACT(DT,4,5)
IF +X'=1
SET X=X-1
IF X<10
SET X=0_X
SET Y=Y_X_"00"
+2 IF '$TEST
SET Y=(Y-1)_1200
+3 SET ABPA("DT")=Y
KILL DIC,DA
SET DA(1)=$ORDER(^ABPAFAC(0))
IF +DA(1)'>0
QUIT
+4 IF $DATA(^ABPAFAC(DA(1),1,0))'=1
SET ^ABPAFAC(DA(1),1,0)="^9002270.08D^^0"
+5 SET DIC="^ABPAFAC("_DA(1)_",1,"
SET DIC(0)="L"
SET X=ABPA("DT")
DO ^DIC
+6 QUIT
+7 ;---------------------------------------------------------------------
XREF ;PROCEDURE TO VALIDATE CROSS REFERENCES
+1 WRITE !!," ...Excuse me, I insist upon checking your file indexes..."
+2 WRITE !," This may take awhile. Please be patient. "
+3 KILL DIK,DA
SET DIK="^ABPVAO("
DO IXALL^DIK
WRITE "all done!"
+4 QUIT
+5 ;---------------------------------------------------------------------
CLOSE ;PROCEDURE TO CLOSE OUTPUT DEVICE(S) & KILL TEMPORARY VARIABLES
+1 USE IO
WRITE @IOF
XECUTE ^%ZIS("C")
SET IOP=ABPAIO(0)
DO ^%ZIS
+2 KILL ABPAIO,MSG,DIK,I,QFLG,ABPAIO,DIR,DIC,DIE,DR,DA,J
+3 QUIT
+4 ;---------------------------------------------------------------------
MAIN ;ENTRY POINT - THE PRIMARY ROUTINE DRIVER
+1 WRITE *7,!!,"I HAVE TO RUN A POST-INITIALIZATION ROUTINE."
+2 DO ACCTPT
DO OPTS^ABPAPI02
DO LOCKS^ABPAPI02
DO KEYS^ABPAPI03
DO CMRP
DO XREF
+3 ;Convert pre v1.4 data
IF ABPA("CONVERT")
DO BEGIN^ABPADC01
+4 DO DEVICE
USE IO(0)
WRITE !," This will take 5-10 minutes. ",!
+5 DO DOCS^ABPAPI03
DO CLOSE
WRITE !!,"POST INITIALIZATION COMPLETE!"
+6 QUIT