BRNPOST ; IHS/PHXAO/TMJ - Post Init Routine ;
;;2.0;RELEASE OF INFO SYSTEM;;APR 10, 2003
;Installs Package Protocols and List Templates
;
;
D CONV
;
D POST1 ;Populates the Site Parameter as Conversion Done
;
D XREF
;
D OPTION
;
D DONE
Q
;
PROT ;Protocol Install
;W !!,"I WILL NOW DO THE PROTOCOL INSTALLATION...",!!
;D ^BRNONIT
;W !,"FINISHED INSTALLING ONITS",!!
;
ONIT ;List Template Install
;W !,"I WILL NOW DO THE LIST TEMPLATE INSTALL...",!!
;D ^BRNL
;W !,"DON WITH TEMPLATE INSTALL",!
;
;
CONV ;Conversion of old Data to new BRN Globals
;
Q:'$D(^AZXAREC(0)) ;Quit if Virgin Install-No Conversion Needed
;
;
Q:'$D(^AZXAPARM) ;Quit if no previous ROI vs. 1.0
Q:'$D(^AZXAREQ) ;Quit if no previous ROI vs. 1.0
Q:'$D(^AZXAREC) ;Quit if no previous ROI vs. 1.0
;
;
S BRNIEN=$O(^BRNPARM("B",0))
I BRNIEN="" D CONV1 Q ;New Previous Site entry
;
Q ;Conversion ran already - just quit
;
;
;
CONV1 ;Run Conversion - 3 Globals
;
;Site Parameter Conversion from AZXAPARM to BRNPARM
S BRNOGBL=^AZXAPARM(0) ;Old Global
S BRNNGBL=^BRNPARM(0) ; New Global
S BRNOREC=$P($G(BRNOGBL),"^",3) ;Last IEN
I BRNOREC="" S BRNOREC=0
S BRNOCT=$P($G(BRNOGBL),"^",4) ;Number of Records
I BRNOCT="" S BRNOCT=0
;
SITE ;Site Parameter Conversion
S %X="^AZXAPARM(" S %Y="^BRNPARM(" D %XY^%RCR
;
S ^BRNPARM(0)=BRNNGBL ;Set Zero Node Back to correct Name and Number
S $P(^BRNPARM(0),"^",3)=BRNOREC ;Old Last IEN Number
S $P(^BRNPARM(0),"^",4)=BRNOCT ;Old Count of Records
W !,"Conversion of Site Parameters Completed!",!
;
;
TABLE ;Table File Conversion
;Site Parameter Conversion from AZXAREQ to BRNTREQ
S BRNOGBL=^AZXAREQ(0) ;Old Global
S BRNNGBL=^BRNTREQ(0) ; New Global
S BRNOREC=$P($G(BRNOGBL),"^",3) ;Last IEN
I BRNOREC="" S BRNOREC=0
S BRNOCT=$P($G(BRNOGBL),"^",4) ;Number of Records
I BRNOCT="" S BRNOCT=0
;
;Run Conversion of Table File
S %X="^AZXAREQ(" S %Y="^BRNTREQ(" D %XY^%RCR
;
S ^BRNTREQ(0)=BRNNGBL ;Set Zero Node Back to correct Name and Number
S $P(^BRNTREQ(0),"^",3)=BRNOREC ;Old Last IEN Number
S $P(^BRNTREQ(0),"^",4)=BRNOCT ;Number of Records
W !,"Conversion of Table File Completed!",!
;
RECORD ;Record Conversion
;
;Site Parameter Conversion from AZXAPARM to BRNPARM
S BRNOGBL=^AZXAREC(0) ;Old Global
S BRNNGBL=^BRNREC(0) ; New Global
S BRNOREC=$P($G(BRNOGBL),"^",3) ;Last IEN
I BRNOREC="" S BRNOREC=0
S BRNOCT=$P($G(BRNOGBL),"^",4) ;Number of Records
I BRNOCT="" S BRNOCT=0
;
;Run Conversion of Record File
S %X="^AZXAREC(" S %Y="^BRNREC(" D %XY^%RCR
;
S ^BRNREC(0)=BRNNGBL ;Set Zero Node Back to correct Name and Number
S $P(^BRNREC(0),"^",3)=BRNOREC ;Old Last IEN Number
S $P(^BRNREC(0),"^",4)=BRNOCT ;Old Count of Records
W !,"Conversion of Record File Completed!",!
;
;
;K ^AZXAPARM ;Kill Old Global ;Don't kill old Global yet
;K ^AZXAREQ ;Kill Old Global
;K ^AZXAREC ;Kill Old Global
;
W !,"Conversion of all 3 Globals successfully Completed",!
Q
POST1 ;Run BRNPOST1 to Populate the File Conversion Field
;
D ^BRNPOST1
Q
XREF ;REINDEX AP XREF
W !,"I WILL NOW REINDEX THE AP CROSS REFERENCE",!
K ^BRNREC("AP")
S DIK="^BRNREC(",DIK(1)=".06^AP" D ENALL^DIK K DA,DIK
W !,"FINSIHED WITH CROSS REFERENCE!",!!
Q
;
OPTION ;Delete old AZXA Namespace Menu Options & Security Keys
;
S BRNOPT=$O(^DIC(19,"B","AZXAMENU",0))
Q:BRNOPT="" ;Quit if AZXA Options non existent
;
S XBPKNSP="AZXA" S XBPKEY=1 D ^XBPKDEL
Q
DONE ;
W !,"INSTALLATION OF THE ROI PROGRAM IS SUCCESSFULL",!
W "IF FIRST TIME INSTALL THE SITE PARAMETERS MUST BE COMPLETED PRIOR TO RUNNING PROGRAM",!
K BRNIEN,BRNDFN,BRNOPT,BRNOGBL,BRNNGBL,BRNOREC,BRNOCT
Q
BRNPOST ; IHS/PHXAO/TMJ - Post Init Routine ;
+1 ;;2.0;RELEASE OF INFO SYSTEM;;APR 10, 2003
+2 ;Installs Package Protocols and List Templates
+3 ;
+4 ;
+5 DO CONV
+6 ;
+7 ;Populates the Site Parameter as Conversion Done
DO POST1
+8 ;
+9 DO XREF
+10 ;
+11 DO OPTION
+12 ;
+13 DO DONE
+14 QUIT
+15 ;
PROT ;Protocol Install
+1 ;W !!,"I WILL NOW DO THE PROTOCOL INSTALLATION...",!!
+2 ;D ^BRNONIT
+3 ;W !,"FINISHED INSTALLING ONITS",!!
+4 ;
ONIT ;List Template Install
+1 ;W !,"I WILL NOW DO THE LIST TEMPLATE INSTALL...",!!
+2 ;D ^BRNL
+3 ;W !,"DON WITH TEMPLATE INSTALL",!
+4 ;
+5 ;
CONV ;Conversion of old Data to new BRN Globals
+1 ;
+2 ;Quit if Virgin Install-No Conversion Needed
IF '$DATA(^AZXAREC(0))
QUIT
+3 ;
+4 ;
+5 ;Quit if no previous ROI vs. 1.0
IF '$DATA(^AZXAPARM)
QUIT
+6 ;Quit if no previous ROI vs. 1.0
IF '$DATA(^AZXAREQ)
QUIT
+7 ;Quit if no previous ROI vs. 1.0
IF '$DATA(^AZXAREC)
QUIT
+8 ;
+9 ;
+10 SET BRNIEN=$ORDER(^BRNPARM("B",0))
+11 ;New Previous Site entry
IF BRNIEN=""
DO CONV1
QUIT
+12 ;
+13 ;Conversion ran already - just quit
QUIT
+14 ;
+15 ;
+16 ;
CONV1 ;Run Conversion - 3 Globals
+1 ;
+2 ;Site Parameter Conversion from AZXAPARM to BRNPARM
+3 ;Old Global
SET BRNOGBL=^AZXAPARM(0)
+4 ; New Global
SET BRNNGBL=^BRNPARM(0)
+5 ;Last IEN
SET BRNOREC=$PIECE($GET(BRNOGBL),"^",3)
+6 IF BRNOREC=""
SET BRNOREC=0
+7 ;Number of Records
SET BRNOCT=$PIECE($GET(BRNOGBL),"^",4)
+8 IF BRNOCT=""
SET BRNOCT=0
+9 ;
SITE ;Site Parameter Conversion
+1 SET %X="^AZXAPARM("
SET %Y="^BRNPARM("
DO %XY^%RCR
+2 ;
+3 ;Set Zero Node Back to correct Name and Number
SET ^BRNPARM(0)=BRNNGBL
+4 ;Old Last IEN Number
SET $PIECE(^BRNPARM(0),"^",3)=BRNOREC
+5 ;Old Count of Records
SET $PIECE(^BRNPARM(0),"^",4)=BRNOCT
+6 WRITE !,"Conversion of Site Parameters Completed!",!
+7 ;
+8 ;
TABLE ;Table File Conversion
+1 ;Site Parameter Conversion from AZXAREQ to BRNTREQ
+2 ;Old Global
SET BRNOGBL=^AZXAREQ(0)
+3 ; New Global
SET BRNNGBL=^BRNTREQ(0)
+4 ;Last IEN
SET BRNOREC=$PIECE($GET(BRNOGBL),"^",3)
+5 IF BRNOREC=""
SET BRNOREC=0
+6 ;Number of Records
SET BRNOCT=$PIECE($GET(BRNOGBL),"^",4)
+7 IF BRNOCT=""
SET BRNOCT=0
+8 ;
+9 ;Run Conversion of Table File
+10 SET %X="^AZXAREQ("
SET %Y="^BRNTREQ("
DO %XY^%RCR
+11 ;
+12 ;Set Zero Node Back to correct Name and Number
SET ^BRNTREQ(0)=BRNNGBL
+13 ;Old Last IEN Number
SET $PIECE(^BRNTREQ(0),"^",3)=BRNOREC
+14 ;Number of Records
SET $PIECE(^BRNTREQ(0),"^",4)=BRNOCT
+15 WRITE !,"Conversion of Table File Completed!",!
+16 ;
RECORD ;Record Conversion
+1 ;
+2 ;Site Parameter Conversion from AZXAPARM to BRNPARM
+3 ;Old Global
SET BRNOGBL=^AZXAREC(0)
+4 ; New Global
SET BRNNGBL=^BRNREC(0)
+5 ;Last IEN
SET BRNOREC=$PIECE($GET(BRNOGBL),"^",3)
+6 IF BRNOREC=""
SET BRNOREC=0
+7 ;Number of Records
SET BRNOCT=$PIECE($GET(BRNOGBL),"^",4)
+8 IF BRNOCT=""
SET BRNOCT=0
+9 ;
+10 ;Run Conversion of Record File
+11 SET %X="^AZXAREC("
SET %Y="^BRNREC("
DO %XY^%RCR
+12 ;
+13 ;Set Zero Node Back to correct Name and Number
SET ^BRNREC(0)=BRNNGBL
+14 ;Old Last IEN Number
SET $PIECE(^BRNREC(0),"^",3)=BRNOREC
+15 ;Old Count of Records
SET $PIECE(^BRNREC(0),"^",4)=BRNOCT
+16 WRITE !,"Conversion of Record File Completed!",!
+17 ;
+18 ;
+19 ;K ^AZXAPARM ;Kill Old Global ;Don't kill old Global yet
+20 ;K ^AZXAREQ ;Kill Old Global
+21 ;K ^AZXAREC ;Kill Old Global
+22 ;
+23 WRITE !,"Conversion of all 3 Globals successfully Completed",!
+24 QUIT
POST1 ;Run BRNPOST1 to Populate the File Conversion Field
+1 ;
+2 DO ^BRNPOST1
+3 QUIT
XREF ;REINDEX AP XREF
+1 WRITE !,"I WILL NOW REINDEX THE AP CROSS REFERENCE",!
+2 KILL ^BRNREC("AP")
+3 SET DIK="^BRNREC("
SET DIK(1)=".06^AP"
DO ENALL^DIK
KILL DA,DIK
+4 WRITE !,"FINSIHED WITH CROSS REFERENCE!",!!
+5 QUIT
+6 ;
OPTION ;Delete old AZXA Namespace Menu Options & Security Keys
+1 ;
+2 SET BRNOPT=$ORDER(^DIC(19,"B","AZXAMENU",0))
+3 ;Quit if AZXA Options non existent
IF BRNOPT=""
QUIT
+4 ;
+5 SET XBPKNSP="AZXA"
SET XBPKEY=1
DO ^XBPKDEL
+6 QUIT
DONE ;
+1 WRITE !,"INSTALLATION OF THE ROI PROGRAM IS SUCCESSFULL",!
+2 WRITE "IF FIRST TIME INSTALL THE SITE PARAMETERS MUST BE COMPLETED PRIOR TO RUNNING PROGRAM",!
+3 KILL BRNIEN,BRNDFN,BRNOPT,BRNOGBL,BRNNGBL,BRNOREC,BRNOCT
+4 QUIT