MPIFPST ;CMC/SF-MPI VISTA build post-init ;DEC 12, 1998
;;1.0; MASTER PATIENT INDEX VISTA ;;30 Apr 99
;
EN ;
D MAIL
D MAIL2
D HL7SITE
D CHECKMPI
D REMOVE
Q
REMOVE ;
S $P(^RGSITE(991.8,1,1),"^",2)=""
S DIK="^RGSITE(991.8,",DA=36,DA(1)=991.8
D ^DIK
K DIK,DA
Q
;
CHECKMPI ; checking to see if MPI Institition is defined
N DIC,DA,DIE,DR,X,Y
S DIC="^DIC(4,",DIC(0)="XZ",X="MPI"
D ^DIC
I +Y<0 D BMES^XPDUTL("Missing MPI in Institution file, need to update before proceeding.")
Q
MAIL2 ;add mail group to 991.8
N DIC,GROUP,DIC,DA,DIE,DR,X,Y
S DIC="^XMB(3.8,",DIC(0)="XQZ",X="MPIF CMOR REQUEST"
D ^DIC
Q:+Y<0
S GROUP=+Y
S DA=1,DIE="^RGSITE(991.8,",DR=".03///^S X=GROUP" D ^DIE
D BMES^XPDUTL("Adding MPIF CMOR REQUEST mailgroup to file 991.8")
Q
;add mail group to exception file
MAIL ;
N DIC,GROUP,DIC,DA,DIE,X,Y,DR,ENT
S DIC="^XMB(3.8,",DIC(0)="XQZ",X="MPIF EXCEPTIONS"
D ^DIC
Q:+Y<0
S GROUP=+Y
F ENT=200:1:208,210:1:212,220:1:222,224 D
.S DIC="^RGHL7(991.11,",DIC(0)="XQZ",X=ENT
.D ^DIC
.Q:+Y<0
.S DA=+Y,DIE="^RGHL7(991.11,",DR="6///^S X=GROUP"
.D ^DIE
Q
;
HL7SITE ;updating Facility in the MPIF-Startup HL7 Application Parameter file
N SITE,DIE,X,Y,DR,ENT,DIC,DA,I
S SITE=$$SITE^VASITE,SITE=$P(SITE,"^",3),SITE=SITE\1
; ^ SITE is Station Number of site doing install
F I="MPIF-STARTUP","MPIF CMOR RSLT","MPIF CMOR COMP","MPIF A29 SERVER","MPIF A30 SERVER","MPIF MPI","MPIF LOC/MIS" D
. S DIC="^HL(771,",DIC(0)="XQZ",X=I
. D ^DIC
. Q:+Y<0
. S DA=+Y
. S DIE="^HL(771,",DR="3///^S X=SITE"
. D ^DIE
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMPIFPST 1607 printed Nov 22, 2024@17:21:27 Page 2
MPIFPST ;CMC/SF-MPI VISTA build post-init ;DEC 12, 1998
+1 ;;1.0; MASTER PATIENT INDEX VISTA ;;30 Apr 99
+2 ;
EN ;
+1 DO MAIL
+2 DO MAIL2
+3 DO HL7SITE
+4 DO CHECKMPI
+5 DO REMOVE
+6 QUIT
REMOVE ;
+1 SET $PIECE(^RGSITE(991.8,1,1),"^",2)=""
+2 SET DIK="^RGSITE(991.8,"
SET DA=36
SET DA(1)=991.8
+3 DO ^DIK
+4 KILL DIK,DA
+5 QUIT
+6 ;
CHECKMPI ; checking to see if MPI Institition is defined
+1 NEW DIC,DA,DIE,DR,X,Y
+2 SET DIC="^DIC(4,"
SET DIC(0)="XZ"
SET X="MPI"
+3 DO ^DIC
+4 IF +Y<0
DO BMES^XPDUTL("Missing MPI in Institution file, need to update before proceeding.")
+5 QUIT
MAIL2 ;add mail group to 991.8
+1 NEW DIC,GROUP,DIC,DA,DIE,DR,X,Y
+2 SET DIC="^XMB(3.8,"
SET DIC(0)="XQZ"
SET X="MPIF CMOR REQUEST"
+3 DO ^DIC
+4 if +Y<0
QUIT
+5 SET GROUP=+Y
+6 SET DA=1
SET DIE="^RGSITE(991.8,"
SET DR=".03///^S X=GROUP"
DO ^DIE
+7 DO BMES^XPDUTL("Adding MPIF CMOR REQUEST mailgroup to file 991.8")
+8 QUIT
+9 ;add mail group to exception file
MAIL ;
+1 NEW DIC,GROUP,DIC,DA,DIE,X,Y,DR,ENT
+2 SET DIC="^XMB(3.8,"
SET DIC(0)="XQZ"
SET X="MPIF EXCEPTIONS"
+3 DO ^DIC
+4 if +Y<0
QUIT
+5 SET GROUP=+Y
+6 FOR ENT=200:1:208,210:1:212,220:1:222,224
Begin DoDot:1
+7 SET DIC="^RGHL7(991.11,"
SET DIC(0)="XQZ"
SET X=ENT
+8 DO ^DIC
+9 if +Y<0
QUIT
+10 SET DA=+Y
SET DIE="^RGHL7(991.11,"
SET DR="6///^S X=GROUP"
+11 DO ^DIE
End DoDot:1
+12 QUIT
+13 ;
HL7SITE ;updating Facility in the MPIF-Startup HL7 Application Parameter file
+1 NEW SITE,DIE,X,Y,DR,ENT,DIC,DA,I
+2 SET SITE=$$SITE^VASITE
SET SITE=$PIECE(SITE,"^",3)
SET SITE=SITE\1
+3 ; ^ SITE is Station Number of site doing install
+4 FOR I="MPIF-STARTUP","MPIF CMOR RSLT","MPIF CMOR COMP","MPIF A29 SERVER","MPIF A30 SERVER","MPIF MPI","MPIF LOC/MIS"
Begin DoDot:1
+5 SET DIC="^HL(771,"
SET DIC(0)="XQZ"
SET X=I
+6 DO ^DIC
+7 if +Y<0
QUIT
+8 SET DA=+Y
+9 SET DIE="^HL(771,"
SET DR="3///^S X=SITE"
+10 DO ^DIE
End DoDot:1
+11 QUIT
+12 ;