BWINIS ;IHS/ANMC/MWR - ;15-Feb-2003 21:55;PLS
;;2.0;WOMEN'S HEALTH;**8**;MAY 16, 1996
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
PAC(PKG,VER) ; called from package init (DIFROM7 created this routine)
; PKG = $T(IXF) of the INIT routine.
; VER is an array that is contained in DIFROM from the INIT routine
;
N %,%I,%H,DATE,DIFROM,NOW,PACKAGE,RUN,SERVER,SITE,START,X,XMDUZ,XMSUB,XMTEXT,XMY,Y K ^TMP("BWINIS",$J)
;
; Site tracking updates only occur if run in a VA production primary domain
; account.
I $G(^XMB("NETNAME"))'[".VA.GOV" Q
Q:'$D(^%ZOSF("UCI")) Q:'$D(^%ZOSF("PROD"))
X ^%ZOSF("UCI") I Y'=^%ZOSF("PROD") Q
;
S SERVER="S.A5CSTS@DOMAIN.NAME"
S PACKAGE=$P($P(PKG,";",3),U)
S SITE=$G(^XMB("NETNAME"))
S START=$P($G(^DIC(9.4,VER(0),"PRE")),U,2) I '$L(START) S START="Unknown"
D ; check if ok to use kernel functions
.S X="XLFDT" X ^%ZOSF("TEST") I $T D Q
..S NOW=$$HTFM^XLFDT($H)
..S RUN="Unknown" I START S RUN=$$FMDIFF^XLFDT(NOW,START,3)
..S START=$$FMTE^XLFDT(START)
..S DATE=NOW\1
..S NOW=$$FMTE^XLFDT(NOW)
.D NOW^%DTC S NOW=%,DATE=X
.S RUN="" ; don't bother to compute
.S Y=START D DD^%DT S START=Y
.S Y=NOW D DD^%DT S NOW=Y
;
; Message for server
S ^TMP("BWINIS",$J,1,0)="PACKAGE INSTALL"
S ^TMP("BWINIS",$J,2,0)="SITE: "_SITE
S ^TMP("BWINIS",$J,3,0)="PACKAGE: "_PACKAGE
S ^TMP("BWINIS",$J,4,0)="VERSION: "_VER
S ^TMP("BWINIS",$J,5,0)="Start time: "_START
S ^TMP("BWINIS",$J,6,0)="Completion time: "_NOW
S ^TMP("BWINIS",$J,7,0)="Run time: "_RUN
S ^TMP("BWINIS",$J,8,0)="DATE: "_DATE
;
; Data is sent to server on FORUM - S.A5CSTS
S XMY(SERVER)="",XMDUZ=.5,XMTEXT="^TMP(""BWINIS"",$J,",XMSUB=PACKAGE_" VERSION "_VER_" INSTALLATION"
D ^XMD
K ^TMP("BWINIS",$J)
Q
BWINIS ;IHS/ANMC/MWR - ;15-Feb-2003 21:55;PLS
+1 ;;2.0;WOMEN'S HEALTH;**8**;MAY 16, 1996
+2 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
PAC(PKG,VER) ; called from package init (DIFROM7 created this routine)
+1 ; PKG = $T(IXF) of the INIT routine.
+2 ; VER is an array that is contained in DIFROM from the INIT routine
+3 ;
+4 NEW %,%I,%H,DATE,DIFROM,NOW,PACKAGE,RUN,SERVER,SITE,START,X,XMDUZ,XMSUB,XMTEXT,XMY,Y
KILL ^TMP("BWINIS",$JOB)
+5 ;
+6 ; Site tracking updates only occur if run in a VA production primary domain
+7 ; account.
+8 IF $GET(^XMB("NETNAME"))'[".VA.GOV"
QUIT
+9 IF '$DATA(^%ZOSF("UCI"))
QUIT
IF '$DATA(^%ZOSF("PROD"))
QUIT
+10 XECUTE ^%ZOSF("UCI")
IF Y'=^%ZOSF("PROD")
QUIT
+11 ;
+12 SET SERVER="S.A5CSTS@DOMAIN.NAME"
+13 SET PACKAGE=$PIECE($PIECE(PKG,";",3),U)
+14 SET SITE=$GET(^XMB("NETNAME"))
+15 SET START=$PIECE($GET(^DIC(9.4,VER(0),"PRE")),U,2)
IF '$LENGTH(START)
SET START="Unknown"
+16 ; check if ok to use kernel functions
Begin DoDot:1
+17 SET X="XLFDT"
XECUTE ^%ZOSF("TEST")
IF $TEST
Begin DoDot:2
+18 SET NOW=$$HTFM^XLFDT($HOROLOG)
+19 SET RUN="Unknown"
IF START
SET RUN=$$FMDIFF^XLFDT(NOW,START,3)
+20 SET START=$$FMTE^XLFDT(START)
+21 SET DATE=NOW\1
+22 SET NOW=$$FMTE^XLFDT(NOW)
End DoDot:2
QUIT
+23 DO NOW^%DTC
SET NOW=%
SET DATE=X
+24 ; don't bother to compute
SET RUN=""
+25 SET Y=START
DO DD^%DT
SET START=Y
+26 SET Y=NOW
DO DD^%DT
SET NOW=Y
End DoDot:1
+27 ;
+28 ; Message for server
+29 SET ^TMP("BWINIS",$JOB,1,0)="PACKAGE INSTALL"
+30 SET ^TMP("BWINIS",$JOB,2,0)="SITE: "_SITE
+31 SET ^TMP("BWINIS",$JOB,3,0)="PACKAGE: "_PACKAGE
+32 SET ^TMP("BWINIS",$JOB,4,0)="VERSION: "_VER
+33 SET ^TMP("BWINIS",$JOB,5,0)="Start time: "_START
+34 SET ^TMP("BWINIS",$JOB,6,0)="Completion time: "_NOW
+35 SET ^TMP("BWINIS",$JOB,7,0)="Run time: "_RUN
+36 SET ^TMP("BWINIS",$JOB,8,0)="DATE: "_DATE
+37 ;
+38 ; Data is sent to server on FORUM - S.A5CSTS
+39 SET XMY(SERVER)=""
SET XMDUZ=.5
SET XMTEXT="^TMP(""BWINIS"",$J,"
SET XMSUB=PACKAGE_" VERSION "_VER_" INSTALLATION"
+40 DO ^XMD
+41 KILL ^TMP("BWINIS",$JOB)
+42 QUIT