AG6P17 ;IHS/ASDST/GTH - Patient Registration 6.0 Patch 17 ; [ 04/03/2003 11:52 AM ]
;;7.0;IHS PATIENT REGISTRATION;;MAR 28, 2003
;
; IHS/SET/GTH AG*6*17 10/11/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),!
;
NEW AGQUIT
S AGQUIT=0
I '$$VCHK("AG","6.0",2) S AGQUIT=2
;
I '$$VCHK("AUPN","99.1",2) S AGQUIT=2
;
S X=$$PATCH^XPDUTL("AUPN*99.1*9")
I X=0 W !,$$CJ^XLFSTR("AUPN v99.1 Patch 9 NOT INSTALLED",IOM) S AGQUIT=2
;
I '$$VCHK("AUT","98.1",2) S AGQUIT=2
;
S X=$$PATCH^XPDUTL("AUT*98.1*12")
I X=0 W !,$$CJ^XLFSTR("AUT v98.1 Patch 12 NOT INSTALLED",IOM) S AGQUIT=2
;
NEW DA,DIC
S X="AG",DIC="^DIC(9.4,",DIC(0)="",D="C"
D IX^DIC
I Y<0,$D(^DIC(9.4,"C","AG")) D S AGQUIT=2
. W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AG"" prefix.",IOM)
. W !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
. W !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
.Q
;
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
. D OPTSAV("AGMENU")
.Q
;
I AGQUIT D SORRY(AGQUIT) 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(AGPRE,AGVER,AGQUIT) ; Check versions needed.
;
NEW AGV
S AGV=$$VERSION^XPDUTL(AGPRE)
W !,$$CJ^XLFSTR("Need at least "_AGPRE_" v "_AGVER_"....."_AGPRE_" v "_AGV_" Present",IOM)
I AGV<AGVER W *7,!,$$CJ^XLFSTR("^^^^**NEEDS FIXED**^^^^",IOM) Q 0
Q 1
;
OPTSAV(AGM) ;
D BMES^XPDUTL("Saving the configuration of option '"_AGM_"'...")
I $D(^XTMP("AG6P17",6.17,"OPTSAV",AGM)) D BMES^XPDUTL("NOT SAVED. Option '"_AGM_"' has previously been saved.") Q
I '$D(^XTMP("AG6P17")) S ^XTMP("AG6P17",0)=$$FMADD^XLFDT(DT,30)_U_DT_U_"AG6P17 - SAVE OPTION CONFIGURATIONS."
NEW I,A
S I=$O(^DIC(19,"B",AGM,0))
I 'I D BMES^XPDUTL("NOT SAVED. Option '"_AGM_"' not found in OPTION file.") Q
S A=0
F S A=$O(^DIC(19,I,10,A)) Q:'A S ^XTMP("AG6P17",6.17,"OPTSAV",AGM,A)=$P(^DIC(19,+^DIC(19,I,10,A,0),0),U,1)_U_$P(^DIC(19,I,10,A,0),U,2,3)
Q
;
INSTALLD(AGINSTAL) ;EP - Determine if patch AGINSTAL was installed, where AGINSTAL is
; the name of the INSTALL. E.g "AG*6.0*10".
;;^DIC(9.4,D0,22,D1,PAH,D2,0)=
;;(#.01) PATCH APPLICATION HISTORY [1F] ^ (#.02)DATE APPLIED [2D] ^ (#.03) APPLIED BY [3P] ^
NEW DIC,X,Y
S X=$P(AGINSTAL,"*",1)
S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
D IX^DIC
I Y<1 Q 0
S DIC=DIC_+Y_",22,",X=$P(AGINSTAL,"*",2)
D ^DIC
I Y<1 Q 0
S DIC=DIC_+Y_",""PAH"",",X=$P(AGINSTAL,"*",3)
D ^DIC
Q $S(Y<1:0,1:1)
;
AG6P17 ;IHS/ASDST/GTH - Patient Registration 6.0 Patch 17 ; [ 04/03/2003 11:52 AM ]
+1 ;;7.0;IHS PATIENT REGISTRATION;;MAR 28, 2003
+2 ;
+3 ; IHS/SET/GTH AG*6*17 10/11/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 NEW AGQUIT
+14 SET AGQUIT=0
+15 IF '$$VCHK("AG","6.0",2)
SET AGQUIT=2
+16 ;
+17 IF '$$VCHK("AUPN","99.1",2)
SET AGQUIT=2
+18 ;
+19 SET X=$$PATCH^XPDUTL("AUPN*99.1*9")
+20 IF X=0
WRITE !,$$CJ^XLFSTR("AUPN v99.1 Patch 9 NOT INSTALLED",IOM)
SET AGQUIT=2
+21 ;
+22 IF '$$VCHK("AUT","98.1",2)
SET AGQUIT=2
+23 ;
+24 SET X=$$PATCH^XPDUTL("AUT*98.1*12")
+25 IF X=0
WRITE !,$$CJ^XLFSTR("AUT v98.1 Patch 12 NOT INSTALLED",IOM)
SET AGQUIT=2
+26 ;
+27 NEW DA,DIC
+28 SET X="AG"
SET DIC="^DIC(9.4,"
SET DIC(0)=""
SET D="C"
+29 DO IX^DIC
+30 IF Y<0
IF $DATA(^DIC(9.4,"C","AG"))
Begin DoDot:1
+31 WRITE !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AG"" prefix.",IOM)
+32 WRITE !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
+33 WRITE !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
+34 QUIT
End DoDot:1
SET AGQUIT=2
+35 ;
+36 IF $GET(XPDENV)=1
Begin DoDot:1
+37 ; The following line prevents the "Disable Options..." and "Move
+38 ; Routines..." questions from being asked during the install.
+39 SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+40 DO OPTSAV("AGMENU")
+41 QUIT
End DoDot:1
+42 ;
+43 IF AGQUIT
DO SORRY(AGQUIT)
QUIT
+44 ;
+45 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+46 ;
+47 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(2)
QUIT
+48 QUIT
+49 ;
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(AGPRE,AGVER,AGQUIT) ; Check versions needed.
+1 ;
+2 NEW AGV
+3 SET AGV=$$VERSION^XPDUTL(AGPRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_AGPRE_" v "_AGVER_"....."_AGPRE_" v "_AGV_" Present",IOM)
+5 IF AGV<AGVER
WRITE *7,!,$$CJ^XLFSTR("^^^^**NEEDS FIXED**^^^^",IOM)
QUIT 0
+6 QUIT 1
+7 ;
OPTSAV(AGM) ;
+1 DO BMES^XPDUTL("Saving the configuration of option '"_AGM_"'...")
+2 IF $DATA(^XTMP("AG6P17",6.17,"OPTSAV",AGM))
DO BMES^XPDUTL("NOT SAVED. Option '"_AGM_"' has previously been saved.")
QUIT
+3 IF '$DATA(^XTMP("AG6P17"))
SET ^XTMP("AG6P17",0)=$$FMADD^XLFDT(DT,30)_U_DT_U_"AG6P17 - SAVE OPTION CONFIGURATIONS."
+4 NEW I,A
+5 SET I=$ORDER(^DIC(19,"B",AGM,0))
+6 IF 'I
DO BMES^XPDUTL("NOT SAVED. Option '"_AGM_"' not found in OPTION file.")
QUIT
+7 SET A=0
+8 FOR
SET A=$ORDER(^DIC(19,I,10,A))
IF 'A
QUIT
SET ^XTMP("AG6P17",6.17,"OPTSAV",AGM,A)=$PIECE(^DIC(19,+^DIC(19,I,10,A,0),0),U,1)_U_$PIECE(^DIC(19,I,10,A,0),U,2,3)
+9 QUIT
+10 ;
INSTALLD(AGINSTAL) ;EP - Determine if patch AGINSTAL was installed, where AGINSTAL is
+1 ; the name of the INSTALL. E.g "AG*6.0*10".
+2 ;;^DIC(9.4,D0,22,D1,PAH,D2,0)=
+3 ;;(#.01) PATCH APPLICATION HISTORY [1F] ^ (#.02)DATE APPLIED [2D] ^ (#.03) APPLIED BY [3P] ^
+4 NEW DIC,X,Y
+5 SET X=$PIECE(AGINSTAL,"*",1)
+6 SET DIC="^DIC(9.4,"
SET DIC(0)="FM"
SET D="C"
+7 DO IX^DIC
+8 IF Y<1
QUIT 0
+9 SET DIC=DIC_+Y_",22,"
SET X=$PIECE(AGINSTAL,"*",2)
+10 DO ^DIC
+11 IF Y<1
QUIT 0
+12 SET DIC=DIC_+Y_",""PAH"","
SET X=$PIECE(AGINSTAL,"*",3)
+13 DO ^DIC
+14 QUIT $SELECT(Y<1:0,1:1)
+15 ;