Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AUM16P2

AUM16P2.m

Go to the documentation of this file.
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
 ;