AUM16P2 ;IHS/OIT/NKD - SCB UPDATE V16 P2 POST-INSTALL 03/07/2016 ;
;;16.0;TABLE MAINTENANCE;**2**;OCT 16,2015;Build 1
;
; INSTITUTION/STATION NUMBER CLEANUP RELATED TO XU*8.0*1018
; STEP 1: REMOVE 'ZZ DUP' FROM NAME AND RE-ACTIVATE (DELETE INACTIVE FACILITY FLAG)
; STEP 2: SAVE OR RESTORE STATION NUMBERS - PROCESS IF RESTORED
;
EN ; EP - RUN POST XU PROCESSING
D RSLT^AUMSCBD($$REPEAT^XLFSTR("-",20)),RSLT^AUMSCBD("AUM*16.0*2 Institution file cleanup - Post XU*8.0*1018 installation")
D S1,S2B
Q
;
POST ; EP FR KIDS - RUN KIDS POST-INSTALL
D RSLT^AUMSCBD($$REPEAT^XLFSTR("-",20)),RSLT^AUMSCBD("AUM*16.0*2 Institution file cleanup")
D S1,S2A
D POST^AUMSCB
Q
;
S1 ; REMOVE 'ZZ DUP' FROM INSTITUTION FILE ENTRIES AND ACTIVATE
N FDA,ERR,AUMN,AUMI,AUMFR,AUMTO
D RSLT^AUMSCBD("1) Remove 'ZZ DUP' from NAME and re-activate"),RSLT^AUMSCBD($J("",2)_"Scanning Institution file entries")
S AUMN="ZZ DUP" F S AUMN=$O(^DIC(4,"B",AUMN)) Q:'$L(AUMN)!(AUMN'["ZZ DUP") D
. S AUMI=0 F S AUMI=$O(^DIC(4,"B",AUMN,AUMI)) Q:'AUMI D
. . ; VERIFY NAME AND PROPOSED CHANGE
. . S AUMFR=$P($G(^DIC(4,AUMI,0)),"^") Q:AUMFR'["ZZ DUP"
. . S AUMTO=$P(AUMFR,"ZZ DUP ",2) Q:$L(AUMTO)<3
. . ; SET FDA AND PRINT
. . S FDA(4,AUMI,.01)=AUMTO
. . S:+$P($G(^DIC(4,AUMI,99)),"^",4) FDA(4,AUMI,101)="@"
. . D RSLT^AUMSCBD($J("",4)_$$GET1^DIQ(9999999.06,AUMI,.0799,"I")_": "_AUMFR_" => "_AUMTO)
I $D(FDA) D FILE^DIE(,"FDA"),RSLT^AUMSCBD($J("",2)_"Completed") Q
D RSLT^AUMSCBD($J("",2)_"No issues found")
Q
;
S2A ; SAVE BACKUP OF STATION NUMBERS
D RSLT^AUMSCBD("2) Save incoming STATION NUMBERS")
I $$INSTALDT^XPDUTL("XU*8.0*1018") D RSLT^AUMSCBD($J("",2)_"XU*8.0*1018 already installed - Backup not needed") Q
D RSLT^AUMSCBD($J("",2)_"XU*8.0*1018 not yet installed - Creating backup")
N AUMI,AUMT K ^AUMTMP
S AUMI=0 F S AUMI=$O(^AUMDATA(AUMI)) Q:'AUMI D
. S AUMT=$P($G(^AUMDATA(AUMI,0)),"^",2) Q:AUMT'="STNMALL"
. M ^AUMTMP(AUMI)=^AUMDATA(AUMI)
Q
;
S2B ; RESTORE BACKUP OF STATION NUMBERS
D RSLT^AUMSCBD("2) Restore STATION NUMBERS and process")
I '$$INSTALDT^XPDUTL("XU*8.0*1018") D RSLT^AUMSCBD($J("",2)_"XU*8.0*1018 not yet installed - Try again later") Q
I '$D(^AUMTMP) D RSLT^AUMSCBD($J("",2)_"XU*8.0*1018 installed - Backup not found") Q
D RSLT^AUMSCBD($J("",2)_"XU*8.0*1018 installed - Restoring backup")
D PRE^AUMSCB
M ^AUMDATA=^AUMTMP K ^AUMTMP
D RSLT^AUMSCBD($J("",2)_"Processing STATION NUMBERS")
D POST^AUMSCB
Q
;
AUM16P2 ;IHS/OIT/NKD - SCB UPDATE V16 P2 POST-INSTALL 03/07/2016 ;
+1 ;;16.0;TABLE MAINTENANCE;**2**;OCT 16,2015;Build 1
+2 ;
+3 ; INSTITUTION/STATION NUMBER CLEANUP RELATED TO XU*8.0*1018
+4 ; STEP 1: REMOVE 'ZZ DUP' FROM NAME AND RE-ACTIVATE (DELETE INACTIVE FACILITY FLAG)
+5 ; STEP 2: SAVE OR RESTORE STATION NUMBERS - PROCESS IF RESTORED
+6 ;
EN ; EP - RUN POST XU PROCESSING
+1 DO RSLT^AUMSCBD($$REPEAT^XLFSTR("-",20))
DO RSLT^AUMSCBD("AUM*16.0*2 Institution file cleanup - Post XU*8.0*1018 installation")
+2 DO S1
DO S2B
+3 QUIT
+4 ;
POST ; EP FR KIDS - RUN KIDS POST-INSTALL
+1 DO RSLT^AUMSCBD($$REPEAT^XLFSTR("-",20))
DO RSLT^AUMSCBD("AUM*16.0*2 Institution file cleanup")
+2 DO S1
DO S2A
+3 DO POST^AUMSCB
+4 QUIT
+5 ;
S1 ; REMOVE 'ZZ DUP' FROM INSTITUTION FILE ENTRIES AND ACTIVATE
+1 NEW FDA,ERR,AUMN,AUMI,AUMFR,AUMTO
+2 DO RSLT^AUMSCBD("1) Remove 'ZZ DUP' from NAME and re-activate")
DO RSLT^AUMSCBD($JUSTIFY("",2)_"Scanning Institution file entries")
+3 SET AUMN="ZZ DUP"
FOR
SET AUMN=$ORDER(^DIC(4,"B",AUMN))
IF '$LENGTH(AUMN)!(AUMN'["ZZ DUP")
QUIT
Begin DoDot:1
+4 SET AUMI=0
FOR
SET AUMI=$ORDER(^DIC(4,"B",AUMN,AUMI))
IF 'AUMI
QUIT
Begin DoDot:2
+5 ; VERIFY NAME AND PROPOSED CHANGE
+6 SET AUMFR=$PIECE($GET(^DIC(4,AUMI,0)),"^")
IF AUMFR'["ZZ DUP"
QUIT
+7 SET AUMTO=$PIECE(AUMFR,"ZZ DUP ",2)
IF $LENGTH(AUMTO)<3
QUIT
+8 ; SET FDA AND PRINT
+9 SET FDA(4,AUMI,.01)=AUMTO
+10 IF +$PIECE($GET(^DIC(4,AUMI,99)),"^",4)
SET FDA(4,AUMI,101)="@"
+11 DO RSLT^AUMSCBD($JUSTIFY("",4)_$$GET1^DIQ(9999999.06,AUMI,.0799,"I")_": "_AUMFR_" => "_AUMTO)
End DoDot:2
End DoDot:1
+12 IF $DATA(FDA)
DO FILE^DIE(,"FDA")
DO RSLT^AUMSCBD($JUSTIFY("",2)_"Completed")
QUIT
+13 DO RSLT^AUMSCBD($JUSTIFY("",2)_"No issues found")
+14 QUIT
+15 ;
S2A ; SAVE BACKUP OF STATION NUMBERS
+1 DO RSLT^AUMSCBD("2) Save incoming STATION NUMBERS")
+2 IF $$INSTALDT^XPDUTL("XU*8.0*1018")
DO RSLT^AUMSCBD($JUSTIFY("",2)_"XU*8.0*1018 already installed - Backup not needed")
QUIT
+3 DO RSLT^AUMSCBD($JUSTIFY("",2)_"XU*8.0*1018 not yet installed - Creating backup")
+4 NEW AUMI,AUMT
KILL ^AUMTMP
+5 SET AUMI=0
FOR
SET AUMI=$ORDER(^AUMDATA(AUMI))
IF 'AUMI
QUIT
Begin DoDot:1
+6 SET AUMT=$PIECE($GET(^AUMDATA(AUMI,0)),"^",2)
IF AUMT'="STNMALL"
QUIT
+7 MERGE ^AUMTMP(AUMI)=^AUMDATA(AUMI)
End DoDot:1
+8 QUIT
+9 ;
S2B ; RESTORE BACKUP OF STATION NUMBERS
+1 DO RSLT^AUMSCBD("2) Restore STATION NUMBERS and process")
+2 IF '$$INSTALDT^XPDUTL("XU*8.0*1018")
DO RSLT^AUMSCBD($JUSTIFY("",2)_"XU*8.0*1018 not yet installed - Try again later")
QUIT
+3 IF '$DATA(^AUMTMP)
DO RSLT^AUMSCBD($JUSTIFY("",2)_"XU*8.0*1018 installed - Backup not found")
QUIT
+4 DO RSLT^AUMSCBD($JUSTIFY("",2)_"XU*8.0*1018 installed - Restoring backup")
+5 DO PRE^AUMSCB
+6 MERGE ^AUMDATA=^AUMTMP
KILL ^AUMTMP
+7 DO RSLT^AUMSCBD($JUSTIFY("",2)_"Processing STATION NUMBERS")
+8 DO POST^AUMSCB
+9 QUIT
+10 ;