74 lines
3.6 KiB
Mathematica
74 lines
3.6 KiB
Mathematica
GMTSXPS2 ; SLC/KER - Health Summary Status ; 08/27/2002
|
|
;;2.7;Health Summary;**35,56**;Oct 20, 1995
|
|
;
|
|
; External References
|
|
; DBIA 10048 ^DIC(9.4,
|
|
; DBIA 10006 IX^DIC
|
|
; DBIA 2056 $$GET1^DIQ (file 9.4)
|
|
;
|
|
Q
|
|
INS ; Get Installations
|
|
N GMTS0,GMTSDT,GMTSEQ,GMTSI,GMTSIENS,GMTSIN,GMTSN,GMTSNM,GMTSP
|
|
N GMTSPAT,GMTSPD,GMTSPDE,GMTSPI,GMTSST,GMTSTDT,GMTSTN,GMTSTNM
|
|
N GMTSV,GMTSVD,GMTSVDE,GMTSVDS,GMTSVI,GMTSNX,X,DIC,X,Y,DTOUT
|
|
N DUOUT,DLAYGO,DINUM S GMTSI=$$PKGI Q:+GMTSI=0 S GMTSV=2.7
|
|
S GMTSVI=$$VERI(GMTSI,GMTSV) Q:GMTSVI=0
|
|
S GMTSIENS=GMTSVI_","_GMTSI_","
|
|
S GMTSVDE=$$GET1^DIQ(9.49,GMTSIENS,2,"I")
|
|
S GMTSVDS=$$GET1^DIQ(9.49,GMTSIENS,1,"I")
|
|
S GMTSVD="" S:+GMTSVDE>0 GMTSVD=+GMTSVDE
|
|
S:+GMTSVD=0&(+GMTSVDS>0) GMTSVD=+GMTSVDS S:+GMTSVD>0&(+GMTSVDE>+GMTSVD) GMTSVD=+GMTSVDE Q:+GMTSVD=0
|
|
S GMTSVDE=$$EDT^GMTSXPS1($P(GMTSVD,".",1)) K GMTSVDS S GMTSIN(1,1)="Health Summary "_GMTSV_"^"_GMTSVDE
|
|
S GMTSPI=0 F S GMTSPI=$O(^DIC(9.4,GMTSI,22,GMTSVI,"PAH",GMTSPI)) Q:+GMTSPI=0 D
|
|
. S GMTSIENS=GMTSPI_","_GMTSVI_","_GMTSI_","
|
|
. S GMTSP=$$GET1^DIQ(9.4901,GMTSIENS,.01) Q:'$L(GMTSP) Q:+GMTSP=0
|
|
. S GMTSPD=$$GET1^DIQ(9.4901,GMTSIENS,.02,"I") Q:+GMTSPD=0
|
|
. S GMTSEQ="Test" S:GMTSP["SEQ #" GMTSEQ=+($P(GMTSP,"SEQ #",2)) S:+($G(GMTSEQ))=0 GMTSEQ="Test"
|
|
. S GMTSPAT=+GMTSP,GMTSPDE=$$EDT^GMTSXPS1(GMTSPD) Q:'$L(GMTSPDE)
|
|
. S GMTSIN(2,GMTSPAT,GMTSEQ)="GMTS*"_GMTSV_"*"_GMTSP_"^"_GMTSPDE
|
|
. S:$L(GMTSEQ)&(+GMTSEQ>0) GMTSIN(2,"SEQ",GMTSEQ,GMTSPAT)="GMTS*"_GMTSV_"*"_GMTSP_"^"_GMTSPDE
|
|
. S:$L(GMTSEQ)&(GMTSEQ["Test") GMTSIN(2,"SEQT",GMTSEQ,GMTSPAT)="GMTS*"_GMTSV_"*"_GMTSP_"^"_GMTSPDE
|
|
; Package
|
|
S GMTSN=GMTSIN(1,1),GMTSNM=$P(GMTSN,"^",1),GMTSDT=$P(GMTSN,"^",2),GMTSST="" D HD,SI
|
|
; Patches Installed in Sequence
|
|
S GMTSEQ=0 F S GMTSEQ=$O(GMTSIN(2,"SEQ",GMTSEQ)) Q:+GMTSEQ=0 D
|
|
. S GMTSP=0 F S GMTSP=$O(GMTSIN(2,"SEQ",GMTSEQ,GMTSP)) Q:+GMTSP=0 D
|
|
. . S GMTSN=$G(GMTSIN(2,GMTSP,GMTSEQ)) Q:'$L(GMTSN)
|
|
. . S GMTSNM=$P(GMTSN,"^",1) Q:'$L(GMTSNM)
|
|
. . S GMTSDT=$P(GMTSN,"^",2) Q:'$L(GMTSDT)
|
|
. . S GMTSST=""
|
|
. . I $D(GMTSIN(2,"SEQT","Test",GMTSP)) D
|
|
. . . N GMTSTN,GMTSTNM,GMTSTDT S GMTSTN=$G(GMTSIN(2,GMTSP,"Test")) I '$L(GMTSTN) K GMTSIN(2,"SEQT","Test",GMTSP) Q
|
|
. . . S GMTSTNM=$P(GMTSTN,"^",1) I '$L(GMTSTNM) K GMTSIN(2,"SEQT","Test",GMTSP) Q
|
|
. . . S GMTSTDT=$P(GMTSTN,"^",2) I '$L(GMTSTDT) K GMTSIN(2,"SEQT","Test",GMTSP) Q
|
|
. . . N GMTSNM,GMTSDT,GMTSST S GMTSNM=GMTSTNM,GMTSDT=GMTSTDT,GMTSST="Test"
|
|
. . . D SI K GMTSIN(2,"SEQT","Test",GMTSP)
|
|
. . D SI
|
|
; Other Patches Installed (test patches)
|
|
I $D(GMTSIN(2,"SEQT")) D
|
|
. N GMTSP,GMTSTN,GMTSTNM,GMTSTDT
|
|
. S GMTSP=0 F S GMTSP=$O(GMTSIN(2,"SEQT","Test",GMTSP)) Q:+GMTSP=0 D
|
|
. . S GMTSTN=$G(GMTSIN(2,GMTSP,"Test")) I '$L(GMTSTN) K GMTSIN(2,"SEQT","Test",GMTSP) Q
|
|
. . S GMTSTNM=$P(GMTSTN,"^",1) I '$L(GMTSTNM) K GMTSIN(2,"SEQT","Test",GMTSP) Q
|
|
. . S GMTSTDT=$P(GMTSTN,"^",2) I '$L(GMTSTDT) K GMTSIN(2,"SEQT","Test",GMTSP) Q
|
|
. . S GMTSNM=GMTSTNM,GMTSDT=GMTSTDT,GMTSST="Test"
|
|
. . D SI K GMTSIN(2,"SEQT","Test",GMTSP)
|
|
D BL^GMTSXPS1
|
|
Q
|
|
PKGI(X) ; Package
|
|
N D,Y,DIC,DTOUT,DUOUT S DIC(0)="I",D="C"
|
|
S X="GMTS",DIC="^DIC(9.4,"
|
|
D IX^DIC S X=0 S:+Y>0 X=+Y Q X
|
|
VERI(X,Y) ; Version
|
|
N DA,D,DIC,DTOUT,DUOUT S DIC(0)="I",D="B" S DA(1)=+($G(X))
|
|
Q:DA(1)=0 0 S X=+($G(Y)) Q:X=0 0 S DIC="^DIC(9.4,"_DA(1)_",22,"
|
|
D IX^DIC S X=0 S:+Y>0 X=+Y Q X
|
|
; Report
|
|
HD ; Header
|
|
N X S X=" Install Name",X=X_$J("",28-$L(X))_"Date" D TL^GMTSXPS1(X) S X="" S $P(X,"-",42)="-",X=" "_X D TL^GMTSXPS1(X)
|
|
Q
|
|
SI ; Site Installs
|
|
S GMTSNM=$G(GMTSNM) Q:'$L(GMTSNM) S GMTSDT=$G(GMTSDT) Q:'$L(GMTSDT) S GMTSST=$G(GMTSST)
|
|
N X S X=" "_GMTSNM,X=X_$J("",28-$L(X))_GMTSDT S:$L(GMTSST) X=X_$J("",40-$L(X))_GMTSST D TL^GMTSXPS1(X)
|
|
Q
|