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

BPMPRE.m

Go to the documentation of this file.
BPMPRE ; IHS/OIT/NKD - Pre-install for BPM - 6/26/12 ;
 ;;1.0;IHS PATIENT MERGE;**2**;MAR 01, 2010;Build 1
 ;
PRE ;
 ; CLEANUP PACKAGE FILE
 D FIXPKG
 ; CORRECT DD ACCESS FOR PATIENT MERGE FILES
 D FIXDD
 ; REMOVE ADDITIONAL ENTRIES IN THE DUPLICATE RESOLUTION FILE
 D DEL151
 ; CORRECT VA PATIENT FILE ENTRY IN THE DUPLICATE RESOLUTION FILE
 D MOD151
 ;
 Q
FIXPKG ;
 ; REMOVE INVALID 'AFFECTS RECORD MERGE' ENTRIES FROM PACKAGE FILE
 N IEN,DIK,DA
 D BMES^XPDUTL("Cleaning Package file of 'AFFECTS RECORD MERGE' multiple...")
 S IEN=0
 F  S IEN=$O(^DIC(9.4,IEN)) Q:'IEN  D
 . Q:$$GET1^DIQ(9.4,IEN,.01)="IHS PATIENT MERGE"
 . I $D(^DIC(9.4,IEN,20)) D MES^XPDUTL("Found entry in Package: "_$$GET1^DIQ(9.4,IEN,.01)) K ^DIC(9.4,IEN,20)
 ;
 ; CLEAN 'AMRG' X-REF
 K ^DIC(9.4,"AMRG")
 N DIK S DIK="^DIC(9.4,DA(1),20,",DIK(1)=".01^AMRG"
 S DA(1)=0
 F  S DA(1)=$O(^DIC(9.4,DA(1))) Q:'DA(1)  D ENALL^DIK
 Q
FIXDD ;
 ; FIX FILEMAN ACCESS ON BPM FILES
 N SECURITY
 D BMES^XPDUTL("Correcting Fileman access on Merge files...")
 ; DUPLICATE RECORD #15
 K SECURITY D SETSEC("#","@","@","@","#","@",.SECURITY)
 D FILESEC^DDMOD(15,.SECURITY)
 ; DUPLICATE RESOLUTION #15.1
 K SECURITY D SETSEC("#","@","@","@","#","@",.SECURITY)
 D FILESEC^DDMOD(15.1,.SECURITY)
 ; XDR MERGE PROCESS #15.2
 K SECURITY D SETSEC("#","@","#","#","","#",.SECURITY)
 D FILESEC^DDMOD(15.2,.SECURITY)
 ; XDR REPOINTED ENTRY #15.3
 K SECURITY D SETSEC("#","@","#","#","","#",.SECURITY)
 D FILESEC^DDMOD(15.3,.SECURITY)
 ; MERGE IMAGES #15.4
 K SECURITY D SETSEC("@","@","@","@","@","@",.SECURITY)
 D FILESEC^DDMOD(15.4,.SECURITY)
 Q
DEL151 ;
 ; REMOVE ALL FILE #15.1 ENTRIES EXCEPT FOR THE VA PATIENT FILE #2
 N BPMOUT,BPMCNT,I,DIK,DA
 D BMES^XPDUTL("Checking file 15.1 for invalid entries...")
 D LIST^DIC(15.1,,"@;.01I;.01","P",,,,,,,"BPMOUT",)
 S BPMCNT=$P(BPMOUT("DILIST",0),"^",1)
 F I=1:1:BPMCNT D
 . Q:$P(BPMOUT("DILIST",I,0),"^",2)=2
 . D BMES^XPDUTL("  Removing '"_$P(BPMOUT("DILIST",I,0),"^",3)_"'")
 . S DIK="^VA(15.1,",DA=$P(BPMOUT("DILIST",I,0),"^",2) D ^DIK
 Q
MOD151 ;
 ; CORRECT FILE #15.1 FIELDS FOR THE VA PATIENT FILE #2
 N FDA,BPMOUT,I
 D BMES^XPDUTL("Correcting VA PATIENT file entry in file 15.1...")
 S FDA(15.1,"2,",.05)="BASIC"
 S FDA(15.1,"2,",.06)="@"
 S FDA(15.1,"2,",.09)="XDRPTCAN"
 S FDA(15.1,"2,",.13)=0
 S FDA(15.1,"2,",.14)=0
 S FDA(15.1,"2,",.17)="@"
 S FDA(15.1,"2,",.25)=0
 S FDA(15.1,"2,",.26)="@"
 S FDA(15.1,"2,",.27)="@"
 S FDA(15.1,"2,",.28)="@"
 S FDA(15.1,"2,",.31)="@"
 S FDA(15.1,"2,",.32)="@"
 S FDA(15.1,"2,",.33)="@"
 S FDA(15.1,"2,",1.03)=180
 D UPDATE^DIE(,"FDA",)
 ; REMOVE ENTRIES IN THE MULTIPLE FIELD 1200
 D GETS^DIQ(15.1,2,"1200*",,"BPMOUT")
 S I=""
 F  S I=$O(BPMOUT(15.112,I)) Q:'I  D
 .S BPMOUT(15.112,I,.01)="@"
 D UPDATE^DIE(,"BPMOUT",)
 Q
SETSEC(AUDIT,DD,DEL,LAYGO,RD,WR,SECURITY) ;
 ; CREATE VARIABLE FOR FILESEC^DDMOD
 S SECURITY("AUDIT")=AUDIT
 S SECURITY("DD")=DD
 S SECURITY("DEL")=DEL
 S SECURITY("LAYGO")=LAYGO
 S SECURITY("RD")=RD
 S SECURITY("WR")=WR
 Q