AICD7PRE ;IHS/OIT/CLS - Pre-install routine for AICD patch 7;10/25/2006
;;3.51;IHS ICD/CPT LOOKUP & GROUPER;**7**;May 30, 1991
;;
DEL1 ; Delete earlier AICD Package file entries
N DA,DIK,AICD
S DA=$O(^DIC(9.4,"B","AICD","")) I DA S AICD=$P(^DIC(9.4,DA,0),U) D DEL
S DA=$O(^DIC(9.4,"B","IHS ICD LOOKUP SYSTEM","")) I DA S AICD=$P(^DIC(9.4,DA,0),U) D DEL
;
EN1 ; Check for previous patch
I '$$PATCH("AICD*3.51*6") D SORRY Q
Q
;
SORRY ; IHS/ITSC/CLS 04/16/2003
S XPDQUIT=1 ;don't install this transport global and kill it from ^XTMP
W !!?20,"Need AICD v 5.1, Patch 6"
W *7,!,$$C^XBFUNC("Installation of AICD*3.51*7 has been aborted.")
Q
;
PATCH(X) ;return 1 if patch X was installed, X=aaaa*nn.nn*nnnn ;IHS/ITSC/CLS 05/11/2003
Q:X'?1.4UN1"*"1.2N1"."1.2N.1(1"V",1"T").2N1"*"1.4N 0
N %,I,J
S I=$O(^DIC(9.4,"C",$P(X,"*"),0)) Q:'I 0
S J=$O(^DIC(9.4,I,22,"B",$P(X,"*",2),0)),X=$P(X,"*",3) Q:'J 0
;check if patch is just a number
Q:$O(^DIC(9.4,I,22,J,"PAH","B",X,0)) 1
S %=$O(^DIC(9.4,I,22,J,"PAH","B",X_" SEQ"))
Q (X=+%)
;
DEL S DIK="^DIC(9.4," W !,"Deleting old AICD Package file entry ",AICD,".",! D ^DIK
Q
AICD7PRE ;IHS/OIT/CLS - Pre-install routine for AICD patch 7;10/25/2006
+1 ;;3.51;IHS ICD/CPT LOOKUP & GROUPER;**7**;May 30, 1991
+2 ;;
DEL1 ; Delete earlier AICD Package file entries
+1 NEW DA,DIK,AICD
+2 SET DA=$ORDER(^DIC(9.4,"B","AICD",""))
IF DA
SET AICD=$PIECE(^DIC(9.4,DA,0),U)
DO DEL
+3 SET DA=$ORDER(^DIC(9.4,"B","IHS ICD LOOKUP SYSTEM",""))
IF DA
SET AICD=$PIECE(^DIC(9.4,DA,0),U)
DO DEL
+4 ;
EN1 ; Check for previous patch
+1 IF '$$PATCH("AICD*3.51*6")
DO SORRY
QUIT
+2 QUIT
+3 ;
SORRY ; IHS/ITSC/CLS 04/16/2003
+1 ;don't install this transport global and kill it from ^XTMP
SET XPDQUIT=1
+2 WRITE !!?20,"Need AICD v 5.1, Patch 6"
+3 WRITE *7,!,$$C^XBFUNC("Installation of AICD*3.51*7 has been aborted.")
+4 QUIT
+5 ;
PATCH(X) ;return 1 if patch X was installed, X=aaaa*nn.nn*nnnn ;IHS/ITSC/CLS 05/11/2003
+1 IF X'?1.4UN1"*"1.2N1"."1.2N.1(1"V",1"T").2N1"*"1.4N
QUIT 0
+2 NEW %,I,J
+3 SET I=$ORDER(^DIC(9.4,"C",$PIECE(X,"*"),0))
IF 'I
QUIT 0
+4 SET J=$ORDER(^DIC(9.4,I,22,"B",$PIECE(X,"*",2),0))
SET X=$PIECE(X,"*",3)
IF 'J
QUIT 0
+5 ;check if patch is just a number
+6 IF $ORDER(^DIC(9.4,I,22,J,"PAH","B",X,0))
QUIT 1
+7 SET %=$ORDER(^DIC(9.4,I,22,J,"PAH","B",X_" SEQ"))
+8 QUIT (X=+%)
+9 ;
DEL SET DIK="^DIC(9.4,"
WRITE !,"Deleting old AICD Package file entry ",AICD,".",!
DO ^DIK
+1 QUIT