AVA32P12 ;IHS/ASDST/GTH - AVA 93.2 PATCH 12 ; [ 02/13/2002 5:15 PM ]
;;93.2;VA SUPPORT FILES;**12**;JUL 01, 1993;Build 12
;
; IHS/ASDST/GTH AVA*93.2*12 02/13/2002
;
I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
;
I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
;
S X=$P(^VA(200,DUZ,0),U)
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 "_$P($T(+2),";",5)_".",IOM)
;
Q:'$$VCHK("AVA","93.2",2)
Q:'$$VCHK("DI","21.0",2)
Q:'$$VCHK("XU","8.0",2)
;
NEW DA,DIC
S X="AVA",DIC="^DIC(9.4,",DIC(0)="",D="C"
D IX^DIC
I Y<0,$D(^DIC(9.4,"C","AVA")) D Q
. W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AVA"" prefix.",IOM)
. W !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
. W !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
. D SORRY(2)
. I $$DIR^XBDIR("E")
.Q
W !,$$CJ^XLFSTR("No 'AVA' dups in PACKAGE file",IOM)
;
I $G(XPDENV)=1 D
. ; The following line prevents the "Disable Options..." and "Move
. ; Routines..." questions from being asked during the install.
. S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
.Q
;
I '(DUZ(0)["@") W !,"The dd updates require an '@' in your DUZ(0).",!,"Everything else looks OK!" D SORRY(2) Q
;
W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
;
I '$$DIR^XBDIR("E","","","","","",1) D SORRY(2) Q
Q
;
SORRY(X) ;
KILL DIFQ
S XPDQUIT=X
W:'$D(ZTQUEUED) *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
Q
;
VCHK(AVAPRE,AVAVER,AVAQUIT) ; Check versions needed.
;
NEW AVAV
S AVAV=$$VERSION^XPDUTL(AVAPRE)
W !,$$CJ^XLFSTR("Need at least "_AVAPRE_" v "_AVAVER_"....."_AVAPRE_" v "_AVAV_" Present",IOM)
I AVAV<AVAVER KILL DIFQ S XPDQUIT=AVAQUIT W *7,!,$$CJ^XLFSTR("Sorry....",IOM) S AVAV=$$DIR^XBDIR("E","Press RETURN") Q 0
Q 1
;
PRE ;EP - From KIDS.
Q
D BMES^XPDUTL("Beginning pre-install routine (PRE^AVA32P12).")
D BMES^XPDUTL("Pre-install routine is complete.")
Q
;
POST ;EP - From KIDS.
NEW AVA
D BMES^XPDUTL("Beginning post-install routine (POST^AVA32P12).")
;
D BMES^XPDUTL("Changing sub-file dictionary number in the 9999999.18 multiple...")
D SFDD
;
D BMES^XPDUTL("Delivering AVA*93.2*12 install message to select users...")
D MAIL
;
D BMES^XPDUTL("Post-install routine is complete.")
Q
;
SFDD ;
NEW I,P
S I=0,P=$P(^DD(200,9999999.18,0),U,2)
F S I=$O(^VA(200,I)) Q:'(I=+I) I $D(^VA(200,I,9999999.18,0)) S $P(^(0),U,2)=P
Q
;
MAIL ; Send install mail message.
NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
KILL ^TMP("AVAP12MS",$J)
S ^TMP("AVAP12MS",$J,1)=" --- AVA v 93.2, Patch 12, has been installed into this uci ---"
S %=0
F S %=$O(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%)) Q:'% S ^TMP("AVAP12MS",$J,(%+1))=" "_^(%,0)
S XMSUB=$P($P($T(+1),";",2)," ",4,99),XMDUZ=$S($G(DUZ):DUZ,1:.5),XMTEXT="^TMP(""AVAP12MS"",$J,",XMY(1)="",XMY(DUZ)=""
F %="XUMGR","XUPROG","XUPROGMODE" D SINGLE(%)
D ^XMD
KILL ^TMP("AVAP12MS",$J)
Q
;
SINGLE(K) ; Get holders of a single key K.
NEW Y
S Y=0
Q:'$D(^XUSEC(K))
F S Y=$O(^XUSEC(K,Y)) Q:'Y S XMY(Y)=""
Q
;
AVA32P12 ;IHS/ASDST/GTH - AVA 93.2 PATCH 12 ; [ 02/13/2002 5:15 PM ]
+1 ;;93.2;VA SUPPORT FILES;**12**;JUL 01, 1993;Build 12
+2 ;
+3 ; IHS/ASDST/GTH AVA*93.2*12 02/13/2002
+4 ;
+5 IF '$GET(DUZ)
WRITE !,"DUZ UNDEFINED OR 0."
DO SORRY(2)
QUIT
+6 ;
+7 IF '$LENGTH($GET(DUZ(0)))
WRITE !,"DUZ(0) UNDEFINED OR NULL."
DO SORRY(2)
QUIT
+8 ;
+9 SET X=$PIECE(^VA(200,DUZ,0),U)
+10 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+11 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" V "_$PIECE($TEXT(+2),";",3)_" Patch "_$PIECE($TEXT(+2),";",5)_".",IOM)
+12 ;
+13 IF '$$VCHK("AVA","93.2",2)
QUIT
+14 IF '$$VCHK("DI","21.0",2)
QUIT
+15 IF '$$VCHK("XU","8.0",2)
QUIT
+16 ;
+17 NEW DA,DIC
+18 SET X="AVA"
SET DIC="^DIC(9.4,"
SET DIC(0)=""
SET D="C"
+19 DO IX^DIC
+20 IF Y<0
IF $DATA(^DIC(9.4,"C","AVA"))
Begin DoDot:1
+21 WRITE !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AVA"" prefix.",IOM)
+22 WRITE !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
+23 WRITE !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
+24 DO SORRY(2)
+25 IF $$DIR^XBDIR("E")
+26 QUIT
End DoDot:1
QUIT
+27 WRITE !,$$CJ^XLFSTR("No 'AVA' dups in PACKAGE file",IOM)
+28 ;
+29 IF $GET(XPDENV)=1
Begin DoDot:1
+30 ; The following line prevents the "Disable Options..." and "Move
+31 ; Routines..." questions from being asked during the install.
+32 SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+33 QUIT
End DoDot:1
+34 ;
+35 IF '(DUZ(0)["@")
WRITE !,"The dd updates require an '@' in your DUZ(0).",!,"Everything else looks OK!"
DO SORRY(2)
QUIT
+36 ;
+37 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+38 ;
+39 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(2)
QUIT
+40 QUIT
+41 ;
SORRY(X) ;
+1 KILL DIFQ
+2 SET XPDQUIT=X
+3 IF '$DATA(ZTQUEUED)
WRITE *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
+4 QUIT
+5 ;
VCHK(AVAPRE,AVAVER,AVAQUIT) ; Check versions needed.
+1 ;
+2 NEW AVAV
+3 SET AVAV=$$VERSION^XPDUTL(AVAPRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_AVAPRE_" v "_AVAVER_"....."_AVAPRE_" v "_AVAV_" Present",IOM)
+5 IF AVAV<AVAVER
KILL DIFQ
SET XPDQUIT=AVAQUIT
WRITE *7,!,$$CJ^XLFSTR("Sorry....",IOM)
SET AVAV=$$DIR^XBDIR("E","Press RETURN")
QUIT 0
+6 QUIT 1
+7 ;
PRE ;EP - From KIDS.
+1 QUIT
+2 DO BMES^XPDUTL("Beginning pre-install routine (PRE^AVA32P12).")
+3 DO BMES^XPDUTL("Pre-install routine is complete.")
+4 QUIT
+5 ;
POST ;EP - From KIDS.
+1 NEW AVA
+2 DO BMES^XPDUTL("Beginning post-install routine (POST^AVA32P12).")
+3 ;
+4 DO BMES^XPDUTL("Changing sub-file dictionary number in the 9999999.18 multiple...")
+5 DO SFDD
+6 ;
+7 DO BMES^XPDUTL("Delivering AVA*93.2*12 install message to select users...")
+8 DO MAIL
+9 ;
+10 DO BMES^XPDUTL("Post-install routine is complete.")
+11 QUIT
+12 ;
SFDD ;
+1 NEW I,P
+2 SET I=0
SET P=$PIECE(^DD(200,9999999.18,0),U,2)
+3 FOR
SET I=$ORDER(^VA(200,I))
IF '(I=+I)
QUIT
IF $DATA(^VA(200,I,9999999.18,0))
SET $PIECE(^(0),U,2)=P
+4 QUIT
+5 ;
MAIL ; Send install mail message.
+1 NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
+2 KILL ^TMP("AVAP12MS",$JOB)
+3 SET ^TMP("AVAP12MS",$JOB,1)=" --- AVA v 93.2, Patch 12, has been installed into this uci ---"
+4 SET %=0
+5 FOR
SET %=$ORDER(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%))
IF '%
QUIT
SET ^TMP("AVAP12MS",$JOB,(%+1))=" "_^(%,0)
+6 SET XMSUB=$PIECE($PIECE($TEXT(+1),";",2)," ",4,99)
SET XMDUZ=$SELECT($GET(DUZ):DUZ,1:.5)
SET XMTEXT="^TMP(""AVAP12MS"",$J,"
SET XMY(1)=""
SET XMY(DUZ)=""
+7 FOR %="XUMGR","XUPROG","XUPROGMODE"
DO SINGLE(%)
+8 DO ^XMD
+9 KILL ^TMP("AVAP12MS",$JOB)
+10 QUIT
+11 ;
SINGLE(K) ; Get holders of a single key K.
+1 NEW Y
+2 SET Y=0
+3 IF '$DATA(^XUSEC(K))
QUIT
+4 FOR
SET Y=$ORDER(^XUSEC(K,Y))
IF 'Y
QUIT
SET XMY(Y)=""
+5 QUIT
+6 ;