AUPN9918 ;IHS/CMI/LAB,GTH,EFG,SDR - AUPN 99.1 PATCH 18 ; [ 09/06/2007 12:37 PM ]
;;99.1;IHS DICTIONARIES (PATIENT);**18**;JUL 16, 2003;Build 9
;
;
I '$G(IOM) D HOME^%ZIS
;
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 IORVON,IORVOFF
S X="IORVON;IORVOFF"
D ENDR^%ZISS
;
I $$VCHK("AUPN","99.1",2)
;
I '$$INSTALLD("AUT*98.1*16") D SORRY(2)
I '$$INSTALLD("AUPN*99.1*17") D SORRY(2)
I '$$INSTALLD("AICD*3.51*7") D SORRY(2)
I '$D(^DIC(9.4,"C","LEX")) D SORRY(2)
;
NEW DA,DIC
S X="AUPN",DIC="^DIC(9.4,",DIC(0)="",D="C"
D IX^DIC
I Y<0,$D(^DIC(9.4,"C","AUPN")) D Q
. W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AUPN"" prefix.",IOM)
. W !,$$CJ^XLFSTR(IORVON_"One entry needs to be deleted."_IORVOFF,IOM)
. D SORRY(2)
.Q
;
I $G(XPDQUIT) W !,$$CJ^XLFSTR(IORVON_"FIX IT! Before Proceeding."_IORVOFF,IOM),!!,*7,*7,*7 Q
;
I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"),XPDDIQ("XPO1"),XPDDIQ("XPI1"))=0
;
W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
;
I '$$DIR^XBDIR("E","","","","","",1) D SORRY(3)
Q
;
SORRY(X) ;
KILL DIFQ
I X=3 S XPDQUIT=2 Q
S XPDQUIT=X
W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
Q
;
VCHK(AUPNPRE,AUPNVER,AUPNQUIT) ; Check versions needed.
;
NEW AUPNV
S AUPNV=$$VERSION^XPDUTL(AUPNPRE)
W !,$$CJ^XLFSTR("Need at least "_AUPNPRE_" v "_AUPNVER_"....."_AUPNPRE_" v "_AUPNV_" Present",IOM)
I AUPNV<AUPNVER D SORRY(AUPNQUIT) Q 0
Q 1
;
;
POST ;
REIN ;INDEX
;S AUPNX=0 F S AUPNX=$O(^AUPNVSIT(AUPNX)) Q:AUPNX'=+AUPNX D
;.S $P(^AUPNVSIT(AUPNX,11),U,14)=$$UIDV^AUPNVSIT(AUPNX)
;.Q
K ^DD(9000010.09,0,"ID",.06) ;kill id node
N DIK
S DIK="^AUPNPREF(",DIK(1)=".05^AE" D ENALL^DIK K DIK
S AUPNX=0 F S AUPNX=$O(^AUPNAPPS(AUPNX)) Q:AUPNX'=+AUPNX D
.S AUPNX1=0 F S AUPNX1=$O(^AUPNAPPS(AUPNX,11,AUPNX1)) Q:AUPNX1'=+AUPNX1 D
..S DIK(1)=".01",DIK="^AUPNAPPS("_AUPNX_",11,",DA=AUPNX1,DA(1)=AUPNX D ENALL^DIK
;queue setting of 1114 field of visit file for all visits created after 10/1/00
S ZTRTN="SETNDW^AUPN9918"
S ZTIO="",ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,,,5),ZTDESC="SET NDW ID FIELD OF VISIT" S ZTSAVE("DUZ*")=""
D ^%ZTLOAD
K ZTRTN,ZTIO,ZTDTH,ZTDESC
;
Q
;
SETNDW ;EP called from taskman
S X=$O(^AUPNVSIT("AMRG",2991231)),X=$O(^AUPNVSIT("AMRG",X,0))
S AUPNX=X F S AUPNX=$O(^AUPNVSIT(AUPNX)) Q:AUPNX'=+AUPNX D
.Q:'$D(^AUPNVSIT(AUPNX,0))
.Q:$P(^AUPNVSIT(AUPNX,0),"^",11) ;not deleted visits
.I $P($G(^AUPNVSIT(AUPNX,11)),"^",14)="" S $P(^AUPNVSIT(AUPNX,11),"^",14)=$$UIDV^AUPNVSIT(AUPNX)
K AUPNX,X
Q
;
;
D BMES^XPDUTL("Delivering AUPN*99.1*15 install message to select users...")
NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
KILL ^TMP("AUPN9915",$J)
S ^TMP("AUPN9915",$J,1)=" --- AUPN v 99.1, Patch 15, has been installed into this uci ---"
S %=0
F S %=$O(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%)) Q:'% S ^TMP("AUPN9915",$J,(%+1))=" "_^(%,0)
S XMSUB=$P($P($T(+1),";",2)," ",3,99),XMDUZ=$S($G(DUZ):DUZ,1:.5),XMTEXT="^TMP(""AUPN9915"",$J,",XMY(1)="",XMY(DUZ)=""
F %="AGZMENU","APCDZMENU","XUMGR","XUPROG","XUPROGMODE" D SINGLE(%)
D ^XMD
KILL ^TMP("AUPN9915",$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
;
INSTALLD(AUPNSTAL) ;EP - Determine if patch AUPNSTAL was installed, where
; AUPNSTAL is the name of the INSTALL. E.g "AG*6.0*11".
;
NEW AUPNY,DIC,X,Y
S X=$P(AUPNSTAL,"*",1)
S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
D IX^DIC
I Y<1 D IMES Q 0
S DIC=DIC_+Y_",22,",X=$P(AUPNSTAL,"*",2)
D ^DIC
I Y<1 D IMES Q 0
S DIC=DIC_+Y_",""PAH"",",X=$P(AUPNSTAL,"*",3)
D ^DIC
S AUPNY=Y
D IMES
Q $S(AUPNY<1:0,1:1)
IMES ;
D MES^XPDUTL($$CJ^XLFSTR("Patch """_AUPNSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
Q
;
AUPN9918 ;IHS/CMI/LAB,GTH,EFG,SDR - AUPN 99.1 PATCH 18 ; [ 09/06/2007 12:37 PM ]
+1 ;;99.1;IHS DICTIONARIES (PATIENT);**18**;JUL 16, 2003;Build 9
+2 ;
+3 ;
+4 IF '$GET(IOM)
DO HOME^%ZIS
+5 ;
+6 IF '$GET(DUZ)
WRITE !,"DUZ UNDEFINED OR 0."
DO SORRY(2)
QUIT
+7 ;
+8 IF '$LENGTH($GET(DUZ(0)))
WRITE !,"DUZ(0) UNDEFINED OR NULL."
DO SORRY(2)
QUIT
+9 ;
+10 SET X=$PIECE(^VA(200,DUZ,0),U)
+11 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+12 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" V "_$PIECE($TEXT(+2),";",3)_" Patch "_$PIECE($TEXT(+2),";",5)_".",IOM)
+13 ;
+14 NEW IORVON,IORVOFF
+15 SET X="IORVON;IORVOFF"
+16 DO ENDR^%ZISS
+17 ;
+18 IF $$VCHK("AUPN","99.1",2)
+19 ;
+20 IF '$$INSTALLD("AUT*98.1*16")
DO SORRY(2)
+21 IF '$$INSTALLD("AUPN*99.1*17")
DO SORRY(2)
+22 IF '$$INSTALLD("AICD*3.51*7")
DO SORRY(2)
+23 IF '$DATA(^DIC(9.4,"C","LEX"))
DO SORRY(2)
+24 ;
+25 NEW DA,DIC
+26 SET X="AUPN"
SET DIC="^DIC(9.4,"
SET DIC(0)=""
SET D="C"
+27 DO IX^DIC
+28 IF Y<0
IF $DATA(^DIC(9.4,"C","AUPN"))
Begin DoDot:1
+29 WRITE !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AUPN"" prefix.",IOM)
+30 WRITE !,$$CJ^XLFSTR(IORVON_"One entry needs to be deleted."_IORVOFF,IOM)
+31 DO SORRY(2)
+32 QUIT
End DoDot:1
QUIT
+33 ;
+34 IF $GET(XPDQUIT)
WRITE !,$$CJ^XLFSTR(IORVON_"FIX IT! Before Proceeding."_IORVOFF,IOM),!!,*7,*7,*7
QUIT
+35 ;
+36 IF $GET(XPDENV)=1
SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"),XPDDIQ("XPO1"),XPDDIQ("XPI1"))=0
+37 ;
+38 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+39 ;
+40 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(3)
+41 QUIT
+42 ;
SORRY(X) ;
+1 KILL DIFQ
+2 IF X=3
SET XPDQUIT=2
QUIT
+3 SET XPDQUIT=X
+4 WRITE *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
+5 QUIT
+6 ;
VCHK(AUPNPRE,AUPNVER,AUPNQUIT) ; Check versions needed.
+1 ;
+2 NEW AUPNV
+3 SET AUPNV=$$VERSION^XPDUTL(AUPNPRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_AUPNPRE_" v "_AUPNVER_"....."_AUPNPRE_" v "_AUPNV_" Present",IOM)
+5 IF AUPNV<AUPNVER
DO SORRY(AUPNQUIT)
QUIT 0
+6 QUIT 1
+7 ;
+8 ;
POST ;
REIN ;INDEX
+1 ;S AUPNX=0 F S AUPNX=$O(^AUPNVSIT(AUPNX)) Q:AUPNX'=+AUPNX D
+2 ;.S $P(^AUPNVSIT(AUPNX,11),U,14)=$$UIDV^AUPNVSIT(AUPNX)
+3 ;.Q
+4 ;kill id node
KILL ^DD(9000010.09,0,"ID",.06)
+5 NEW DIK
+6 SET DIK="^AUPNPREF("
SET DIK(1)=".05^AE"
DO ENALL^DIK
KILL DIK
+7 SET AUPNX=0
FOR
SET AUPNX=$ORDER(^AUPNAPPS(AUPNX))
IF AUPNX'=+AUPNX
QUIT
Begin DoDot:1
+8 SET AUPNX1=0
FOR
SET AUPNX1=$ORDER(^AUPNAPPS(AUPNX,11,AUPNX1))
IF AUPNX1'=+AUPNX1
QUIT
Begin DoDot:2
+9 SET DIK(1)=".01"
SET DIK="^AUPNAPPS("_AUPNX_",11,"
SET DA=AUPNX1
SET DA(1)=AUPNX
DO ENALL^DIK
End DoDot:2
End DoDot:1
+10 ;queue setting of 1114 field of visit file for all visits created after 10/1/00
+11 SET ZTRTN="SETNDW^AUPN9918"
+12 SET ZTIO=""
SET ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,,,5)
SET ZTDESC="SET NDW ID FIELD OF VISIT"
SET ZTSAVE("DUZ*")=""
+13 DO ^%ZTLOAD
+14 KILL ZTRTN,ZTIO,ZTDTH,ZTDESC
+15 ;
+16 QUIT
+17 ;
SETNDW ;EP called from taskman
+1 SET X=$ORDER(^AUPNVSIT("AMRG",2991231))
SET X=$ORDER(^AUPNVSIT("AMRG",X,0))
+2 SET AUPNX=X
FOR
SET AUPNX=$ORDER(^AUPNVSIT(AUPNX))
IF AUPNX'=+AUPNX
QUIT
Begin DoDot:1
+3 IF '$DATA(^AUPNVSIT(AUPNX,0))
QUIT
+4 ;not deleted visits
IF $PIECE(^AUPNVSIT(AUPNX,0),"^",11)
QUIT
+5 IF $PIECE($GET(^AUPNVSIT(AUPNX,11)),"^",14)=""
SET $PIECE(^AUPNVSIT(AUPNX,11),"^",14)=$$UIDV^AUPNVSIT(AUPNX)
End DoDot:1
+6 KILL AUPNX,X
+7 QUIT
+8 ;
+9 ;
+10 DO BMES^XPDUTL("Delivering AUPN*99.1*15 install message to select users...")
+11 NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
+12 KILL ^TMP("AUPN9915",$JOB)
+13 SET ^TMP("AUPN9915",$JOB,1)=" --- AUPN v 99.1, Patch 15, has been installed into this uci ---"
+14 SET %=0
+15 FOR
SET %=$ORDER(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%))
IF '%
QUIT
SET ^TMP("AUPN9915",$JOB,(%+1))=" "_^(%,0)
+16 SET XMSUB=$PIECE($PIECE($TEXT(+1),";",2)," ",3,99)
SET XMDUZ=$SELECT($GET(DUZ):DUZ,1:.5)
SET XMTEXT="^TMP(""AUPN9915"",$J,"
SET XMY(1)=""
SET XMY(DUZ)=""
+17 FOR %="AGZMENU","APCDZMENU","XUMGR","XUPROG","XUPROGMODE"
DO SINGLE(%)
+18 DO ^XMD
+19 KILL ^TMP("AUPN9915",$JOB)
+20 QUIT
+21 ;
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 ;
INSTALLD(AUPNSTAL) ;EP - Determine if patch AUPNSTAL was installed, where
+1 ; AUPNSTAL is the name of the INSTALL. E.g "AG*6.0*11".
+2 ;
+3 NEW AUPNY,DIC,X,Y
+4 SET X=$PIECE(AUPNSTAL,"*",1)
+5 SET DIC="^DIC(9.4,"
SET DIC(0)="FM"
SET D="C"
+6 DO IX^DIC
+7 IF Y<1
DO IMES
QUIT 0
+8 SET DIC=DIC_+Y_",22,"
SET X=$PIECE(AUPNSTAL,"*",2)
+9 DO ^DIC
+10 IF Y<1
DO IMES
QUIT 0
+11 SET DIC=DIC_+Y_",""PAH"","
SET X=$PIECE(AUPNSTAL,"*",3)
+12 DO ^DIC
+13 SET AUPNY=Y
+14 DO IMES
+15 QUIT $SELECT(AUPNY<1:0,1:1)
IMES ;
+1 DO MES^XPDUTL($$CJ^XLFSTR("Patch """_AUPNSTAL_""" is"_$SELECT(Y<1:" *NOT*",1:"")_" installed.",IOM))
+2 QUIT
+3 ;