APSPEC05 ;IHS/CIA/PLS - APSP ENVIRONMENT CHECK ROUTINE ;14-Nov-2006 09:22;SM
;;7.0;IHS PHARMACY MODIFICATIONS;**1005**;DEC 11, 2003
;
ENV ;EP
;
S X=$$GET1^DIQ(200,DUZ,.01)
W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" V "_$P($T(+2),";",3)_", Patch 1004.",IOM)
S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0 ; Suppress the Disable options and Move routines prompts
S XPDABORT=0
D:'$D(^XPD(9.7,"B","PIMS*5.3*1004")) MES("Patch PIMS*5.3*1004 is required and hasn't been installed.",2)
D:'$D(^XPD(9.7,"B","APSP*7.0*1003")) MES("Patch APSP*7.0*1004 is required and hasn't been installed.",2)
I 'XPDABORT D
.W !!,"All requirements for installation have been met...",!
E D
.W !!,"Unable to continue with the installation...",!
Q
;
MES(TXT,QUIT) ;EP
D BMES^XPDUTL(" "_$G(TXT))
S:$G(QUIT) XPDABORT=QUIT
Q
;
PRE ;EP - Pre-init
;Remove duplicate xref on field .01 of subfile 55.03.
D MES("Removing duplicate xref 9999999902 in Pharmacy Patient File.")
D DELIX^DDMOD(55.03,.01,999999902,"W")
Q
RENXPAR(OLD,NEW) ; Rename parameter
N IEN,FDA,FIL
S FIL=8989.51
Q:$$FIND1^DIC(FIL,,"X",NEW) ; New name already exists
S IEN=$$FIND1^DIC(FIL,,"X",OLD)
Q:'IEN ; Old name doesn't exist
S FDA(FIL,IEN_",",.01)=NEW
D FILE^DIE("E","FDA")
Q
;
REMXPAR(PAR) ;Remove values stored for a given parameter
N PIEN,ENT,INT,VIEN,DIK,DA
S PIEN=$O(^XPAR(8989.51,"B",PAR,0))
Q:'PIEN
S ENT=0 F S ENT=$O(^XPAR(8989.5,"AC",PIEN,ENT)) Q:ENT="" D ;Entity
.S INT=0 F S INT=$O(^XPAR(8989.5,"AC",PIEN,ENT,INT)) Q:INT="" D ;Instance
..S DA=0 F S DA=$O(^XPAR(8989.5,"AC",PIEN,ENT,INT,DA)) Q:'DA D ;Value IEN
...S DIK="^XTV(8989.5," D ^DIK
Q
POST ;EP
D REGPROT^CIAURPC("OR EVSEND PS","APSP AUTO RX",30)
Q
;
; Register a protocol to an extended action protocol
; Input: P-Parent protocol
; C-Child protocol
; SEQ-Sequence Number
REGPROT(P,C,SEQ,ERR) ;EP
N IENARY,PIEN,AIEN,FDA
D
.I '$L(P)!('$L(C)) S ERR="Missing input parameter" Q
.S IENARY(1)=$$FIND1^DIC(101,"","",P)
.S AIEN=$$FIND1^DIC(101,"","",C)
.I 'IENARY(1)!'AIEN S ERR="Unknown protocol name" Q
.S FDA(101.01,"?+2,"_IENARY(1)_",",.01)=AIEN
.S FDA(101.01,"?+2,"_IENARY(1)_",",3)=SEQ
.D UPDATE^DIE("S","FDA","IENARY","ERR")
;Q:$Q $G(ERR)=""
Q
APSPEC05 ;IHS/CIA/PLS - APSP ENVIRONMENT CHECK ROUTINE ;14-Nov-2006 09:22;SM
+1 ;;7.0;IHS PHARMACY MODIFICATIONS;**1005**;DEC 11, 2003
+2 ;
ENV ;EP
+1 ;
+2 SET X=$$GET1^DIQ(200,DUZ,.01)
+3 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+4 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" V "_$PIECE($TEXT(+2),";",3)_", Patch 1004.",IOM)
+5 ; Suppress the Disable options and Move routines prompts
SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+6 SET XPDABORT=0
+7 IF '$DATA(^XPD(9.7,"B","PIMS*5.3*1004"))
DO MES("Patch PIMS*5.3*1004 is required and hasn't been installed.",2)
+8 IF '$DATA(^XPD(9.7,"B","APSP*7.0*1003"))
DO MES("Patch APSP*7.0*1004 is required and hasn't been installed.",2)
+9 IF 'XPDABORT
Begin DoDot:1
+10 WRITE !!,"All requirements for installation have been met...",!
End DoDot:1
+11 IF '$TEST
Begin DoDot:1
+12 WRITE !!,"Unable to continue with the installation...",!
End DoDot:1
+13 QUIT
+14 ;
MES(TXT,QUIT) ;EP
+1 DO BMES^XPDUTL(" "_$GET(TXT))
+2 IF $GET(QUIT)
SET XPDABORT=QUIT
+3 QUIT
+4 ;
PRE ;EP - Pre-init
+1 ;Remove duplicate xref on field .01 of subfile 55.03.
+2 DO MES("Removing duplicate xref 9999999902 in Pharmacy Patient File.")
+3 DO DELIX^DDMOD(55.03,.01,999999902,"W")
+4 QUIT
RENXPAR(OLD,NEW) ; Rename parameter
+1 NEW IEN,FDA,FIL
+2 SET FIL=8989.51
+3 ; New name already exists
IF $$FIND1^DIC(FIL,,"X",NEW)
QUIT
+4 SET IEN=$$FIND1^DIC(FIL,,"X",OLD)
+5 ; Old name doesn't exist
IF 'IEN
QUIT
+6 SET FDA(FIL,IEN_",",.01)=NEW
+7 DO FILE^DIE("E","FDA")
+8 QUIT
+9 ;
REMXPAR(PAR) ;Remove values stored for a given parameter
+1 NEW PIEN,ENT,INT,VIEN,DIK,DA
+2 SET PIEN=$ORDER(^XPAR(8989.51,"B",PAR,0))
+3 IF 'PIEN
QUIT
+4 ;Entity
SET ENT=0
FOR
SET ENT=$ORDER(^XPAR(8989.5,"AC",PIEN,ENT))
IF ENT=""
QUIT
Begin DoDot:1
+5 ;Instance
SET INT=0
FOR
SET INT=$ORDER(^XPAR(8989.5,"AC",PIEN,ENT,INT))
IF INT=""
QUIT
Begin DoDot:2
+6 ;Value IEN
SET DA=0
FOR
SET DA=$ORDER(^XPAR(8989.5,"AC",PIEN,ENT,INT,DA))
IF 'DA
QUIT
Begin DoDot:3
+7 SET DIK="^XTV(8989.5,"
DO ^DIK
End DoDot:3
End DoDot:2
End DoDot:1
+8 QUIT
POST ;EP
+1 DO REGPROT^CIAURPC("OR EVSEND PS","APSP AUTO RX",30)
+2 QUIT
+3 ;
+4 ; Register a protocol to an extended action protocol
+5 ; Input: P-Parent protocol
+6 ; C-Child protocol
+7 ; SEQ-Sequence Number
REGPROT(P,C,SEQ,ERR) ;EP
+1 NEW IENARY,PIEN,AIEN,FDA
+2 Begin DoDot:1
+3 IF '$LENGTH(P)!('$LENGTH(C))
SET ERR="Missing input parameter"
QUIT
+4 SET IENARY(1)=$$FIND1^DIC(101,"","",P)
+5 SET AIEN=$$FIND1^DIC(101,"","",C)
+6 IF 'IENARY(1)!'AIEN
SET ERR="Unknown protocol name"
QUIT
+7 SET FDA(101.01,"?+2,"_IENARY(1)_",",.01)=AIEN
+8 SET FDA(101.01,"?+2,"_IENARY(1)_",",3)=SEQ
+9 DO UPDATE^DIE("S","FDA","IENARY","ERR")
End DoDot:1
+10 ;Q:$Q $G(ERR)=""
+11 QUIT