CIAOINIT ;MSC/IND/DKM - VueCentric Component KIDS support ;26-May-2006 18:19;DKM
;;1.1;VUECENTRIC COMPONENTS;;Oct 06, 2004;Build 51
;;Copyright 2000-2006, Medsphere Systems Corporation
;=================================================================
; Environment check
EC I $G(XPDENV)=1 D
.N X
.F X="XPI1","XPO1","XPZ1" S XPDDIQ(X)=0
.S XPDNOQUE=1
X $G(@XPDGREF@("EC"))
D OBJCHK^CIAVINIT
Q
; Generic preinit
PRE D OBJINST^CIAVINIT,INITIAL^CIAVINIT,RENPRGID^CIAVINIT,SAVEREG^CIAVINIT
Q
; Generic postinit
POST D HOME^%ZIS
X ^%ZOSF("EON"),^%ZOSF("TRMOFF")
D RESPTR^CIAVINIT,RESTREG^CIAVINIT,REGNMSP,DEFPAR^CIAVINIT,FINAL^CIAVINIT
Q
; Register namespaces
REGNMSP N X
F X="CIAV","CIAO","BEHO" D REGNMSP^CIAURPC(X,"CIAV VUECENTRIC")
Q
; Check for presence of package or patch
; NAME = Patch or package name and version
; ACTION = See CHKCMN entry point
; MSG = Message to display if check fails
CHKDEP(NAME,ACTION,MSG) ; EP
N OK,PKG,VER,NUM
S OK=$$BUILD^XPDUTL(NAME)
Q:OK
I NAME?1.E1"*"1.E1"*"1.N D
.S PKG=+$O(^DIC(9.4,"C",$P(NAME,"*"),0)),VER=$P(NAME,"*",2),NUM=$P(NAME,"*",3)
.S VER=+$O(^DIC(9.4,PKG,22,"B",VER,0)),OK=+$O(^DIC(9.4,PKG,22,VER,"PAH","B",NUM,0))
.S:'OK MSG=$G(MSG,"Patch "_NAME_" is required before installation can continue.")
E D
.S NUM=$L(NAME," "),VER=$P(NAME," ",NUM),PKG=$P(NAME," ",1,NUM-1)
.S PKG=$S('$L(PKG):0,1:+$O(^DIC(9.4,"B",PKG,0)))
.S OK=+$O(^DIC(9.4,PKG,22,"B",VER,0))
.S:'OK MSG=$G(MSG,"Package "_NAME_" is required before installation can continue.")
D:'OK CHKCMN(.ACTION,.MSG)
Q
; Check for completed installation
; NAME = Build name
; ACTION = See CHKCMN entry point
; MSG = Message to display if check fails
CHKINS(NAME,ACTION,MSG) ; EP
N IEN
S IEN=""
F S IEN=$O(^XPD(9.7,"B",NAME,IEN),-1) Q:'IEN Q:$$GET1^DIQ(9.7,IEN,.02,"I")=3
D:'IEN CHKCMN(.ACTION,$G(MSG,"Build "_NAME_" must be installed before installation can continue."))
Q
; Display message and set appropriate flags
; ACTION = Action code if check fails
; -2: Don't install build, leave in cache
; -1: Don't install build, remove from cache
; 0: Display warning only
; 1: Don't install distribution, remove from cache
; 2: Don't install distribution, leave in cache (default)
; MSG = Message to display (optional)
CHKCMN(ACTION,MSG) ;
D:$L($G(MSG)) BMES^XPDUTL(MSG)
S ACTION=+$G(ACTION,2)
I ACTION>0 S:$G(XPDABORT)<ACTION XPDABORT=ACTION K XPDQUIT
E I ACTION<0 S:'$G(XPDABORT) XPDQUIT=-ACTION
Q
CIAOINIT ;MSC/IND/DKM - VueCentric Component KIDS support ;26-May-2006 18:19;DKM
+1 ;;1.1;VUECENTRIC COMPONENTS;;Oct 06, 2004;Build 51
+2 ;;Copyright 2000-2006, Medsphere Systems Corporation
+3 ;=================================================================
+4 ; Environment check
EC IF $GET(XPDENV)=1
Begin DoDot:1
+1 NEW X
+2 FOR X="XPI1","XPO1","XPZ1"
SET XPDDIQ(X)=0
+3 SET XPDNOQUE=1
End DoDot:1
+4 XECUTE $GET(@XPDGREF@("EC"))
+5 DO OBJCHK^CIAVINIT
+6 QUIT
+7 ; Generic preinit
PRE DO OBJINST^CIAVINIT
DO INITIAL^CIAVINIT
DO RENPRGID^CIAVINIT
DO SAVEREG^CIAVINIT
+1 QUIT
+2 ; Generic postinit
POST DO HOME^%ZIS
+1 XECUTE ^%ZOSF("EON")
XECUTE ^%ZOSF("TRMOFF")
+2 DO RESPTR^CIAVINIT
DO RESTREG^CIAVINIT
DO REGNMSP
DO DEFPAR^CIAVINIT
DO FINAL^CIAVINIT
+3 QUIT
+4 ; Register namespaces
REGNMSP NEW X
+1 FOR X="CIAV","CIAO","BEHO"
DO REGNMSP^CIAURPC(X,"CIAV VUECENTRIC")
+2 QUIT
+3 ; Check for presence of package or patch
+4 ; NAME = Patch or package name and version
+5 ; ACTION = See CHKCMN entry point
+6 ; MSG = Message to display if check fails
CHKDEP(NAME,ACTION,MSG) ; EP
+1 NEW OK,PKG,VER,NUM
+2 SET OK=$$BUILD^XPDUTL(NAME)
+3 IF OK
QUIT
+4 IF NAME?1.E1"*"1.E1"*"1.N
Begin DoDot:1
+5 SET PKG=+$ORDER(^DIC(9.4,"C",$PIECE(NAME,"*"),0))
SET VER=$PIECE(NAME,"*",2)
SET NUM=$PIECE(NAME,"*",3)
+6 SET VER=+$ORDER(^DIC(9.4,PKG,22,"B",VER,0))
SET OK=+$ORDER(^DIC(9.4,PKG,22,VER,"PAH","B",NUM,0))
+7 IF 'OK
SET MSG=$GET(MSG,"Patch "_NAME_" is required before installation can continue.")
End DoDot:1
+8 IF '$TEST
Begin DoDot:1
+9 SET NUM=$LENGTH(NAME," ")
SET VER=$PIECE(NAME," ",NUM)
SET PKG=$PIECE(NAME," ",1,NUM-1)
+10 SET PKG=$SELECT('$LENGTH(PKG):0,1:+$ORDER(^DIC(9.4,"B",PKG,0)))
+11 SET OK=+$ORDER(^DIC(9.4,PKG,22,"B",VER,0))
+12 IF 'OK
SET MSG=$GET(MSG,"Package "_NAME_" is required before installation can continue.")
End DoDot:1
+13 IF 'OK
DO CHKCMN(.ACTION,.MSG)
+14 QUIT
+15 ; Check for completed installation
+16 ; NAME = Build name
+17 ; ACTION = See CHKCMN entry point
+18 ; MSG = Message to display if check fails
CHKINS(NAME,ACTION,MSG) ; EP
+1 NEW IEN
+2 SET IEN=""
+3 FOR
SET IEN=$ORDER(^XPD(9.7,"B",NAME,IEN),-1)
IF 'IEN
QUIT
IF $$GET1^DIQ(9.7,IEN,.02,"I")=3
QUIT
+4 IF 'IEN
DO CHKCMN(.ACTION,$GET(MSG,"Build "_NAME_" must be installed before installation can continue."))
+5 QUIT
+6 ; Display message and set appropriate flags
+7 ; ACTION = Action code if check fails
+8 ; -2: Don't install build, leave in cache
+9 ; -1: Don't install build, remove from cache
+10 ; 0: Display warning only
+11 ; 1: Don't install distribution, remove from cache
+12 ; 2: Don't install distribution, leave in cache (default)
+13 ; MSG = Message to display (optional)
CHKCMN(ACTION,MSG) ;
+1 IF $LENGTH($GET(MSG))
DO BMES^XPDUTL(MSG)
+2 SET ACTION=+$GET(ACTION,2)
+3 IF ACTION>0
IF $GET(XPDABORT)<ACTION
SET XPDABORT=ACTION
KILL XPDQUIT
+4 IF '$TEST
IF ACTION<0
IF '$GET(XPDABORT)
SET XPDQUIT=-ACTION
+5 QUIT