Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AUM14EN

AUM14EN.m

Go to the documentation of this file.
AUM14EN ;IHS/OIT/NKD - ENVIRONMENT CHECK/PRE/POST-INSTALL FOR ICD 9 CODES FY2014 08/20/13 ; 
 ;;14.0;TABLE MAINTENANCE;;AUG 20,2013;Build 1
 ;
 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)_".",IOM)
 ;
 S XPDQUIT=0,AUMQUIT=0
 I $$VCHK("XU","8.0",2)
 I $$VCHK("DI","22.0",2)
 ;
 I $$VCHK("AUM","13.0",2)
 I $$VCHK2("BCSV","1.0.3",2)
 ;
 I XPDQUIT D SORRY(XPDQUIT) Q
 ;
 W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
 ;
 Q
 ;
SORRY(X) ;
 KILL DIFQ
 S XPDQUIT=X
 W:'$D(ZTQUEUED) *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
 Q
 ;
VCHK(AUMPRE,AUMVER,AUMQUIT) ; Check version level
 ;  
 NEW AUMV
 S AUMV=$$VERSION^XPDUTL(AUMPRE)
 W !,$$CJ^XLFSTR("Need at least "_AUMPRE_" v "_AUMVER_"....."_AUMPRE_" v "_AUMV_" Present",IOM)
 I AUMV<AUMVER KILL DIFQ S XPDQUIT=AUMQUIT D SORRY(AUMQUIT) Q 0
 Q 1
VCHK2(AUMPRE,AUMVER,AUMQUIT) ; Check patch level
 NEW AUMV
 S AUMV=$$VERSION^XPDUTL(AUMPRE)
 S PTCH=+$$LAST(AUMPRE,AUMV) S:PTCH=-1 DPTCH="" S:PTCH'=-1 DPTCH="."_PTCH
 W !,$$CJ^XLFSTR("Need at least "_AUMPRE_" v "_AUMVER_"....."_AUMPRE_" v "_AUMV_DPTCH_" Present",IOM)
 I (AUMV<($P(AUMVER,".",1,2))) KILL DIFQ S XPDQUIT=AUMQUIT D SORRY(AUMQUIT) Q 0
 I (AUMV=$P(AUMVER,".",1,2))&(PTCH<$P(AUMVER,".",3)) KILL DIFQ S XPDQUIT=AUMQUIT D SORRY(AUMQUIT) Q 0
 Q 1
PCHK(AUMPAT,AUMQUIT) ; Check specific patch
 N AUMP
 S AUMP=$$PATCH^XPDUTL(AUMPAT)
 W !,$$CJ^XLFSTR("Patch "_AUMPAT_" is "_$S(AUMP<1:"*NOT* ",1:"")_"installed.",IOM)
 I 'AUMP KILL DIFQ S XPDQUIT=AUMQUIT D SORRY(AUMQUIT) Q 0
 Q 1
LAST(PKG,VER) ; EP - returns last patch applied for a Package, PATCH^DATE
 ;        Patch includes Seq # if Released
 N PKGIEN,VERIEN,LATEST,PATCH,SUBIEN
 I $G(VER)="" S VER=$$VERSION^XPDUTL(PKG) Q:'VER -1
 S PKGIEN=$O(^DIC(9.4,"C",PKG,"")) Q:'PKGIEN -1
 S VERIEN=$O(^DIC(9.4,PKGIEN,22,"B",VER,"")) Q:'VERIEN -1
 S LATEST=-1,PATCH=-1,SUBIEN=0
 F  S SUBIEN=$O(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN)) Q:SUBIEN'>0  D
 . I $P(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2)>LATEST S LATEST=$P(^(0),U,2),PATCH=$P(^(0),U)
 . I $P(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2)=LATEST,$P(^(0),U)>PATCH S PATCH=$P(^(0),U)
 Q PATCH_U_LATEST
 ;
RSLT(%,LINE) ; EP - INSTALL MESSAGES
 I $D(LINE) D BMES^XPDUTL(%)
 I '$D(LINE) D MES^XPDUTL(%)
 Q
 ;
PRE ; EP - PRE-INSTALL
 ; RE-XREF ^ICD9
 S AUMK="^ICD9(""BA"")"
 K @AUMK
 S AUMK="^ICD9(""AB"")"
 K @AUMK
 D ^XBFMK
 S DIK="^ICD9("
 S DIK(1)=".01"
 D ENALL^DIK
 ; RE-XREF ^ICD0
 S AUMK="^ICD0(""BA"")"
 K @AUMK
 S AUMK="^ICD0(""AB"")"
 K @AUMK
 D ^XBFMK
 S DIK="^ICD0("
 S DIK(1)=".01"
 D ENALL^DIK
 ; REMOVE PREVIOUS ^AUMDATA
 S CNT=0 F  S CNT=$O(^AUMDATA(CNT)) Q:'CNT  K ^AUMDATA(CNT,0)
 F CNT=3,4 S $P(^AUMDATA(0),"^",CNT)=0
 ;
 Q
POST ; EP - POST-INSTALL
 D UPDATE^AUM141
 Q