ACRFPAH ;IHS/OIRM/DSD/AEF - DISPLAY PATCH APPLICATION HISTORY [ 12/13/2006 2:49 PM ]
;;2.1;ADMINISTRATIVE RESOURCE MGMT SYSTEM;**22**;NOV 05, 2001
;
;
DESC ;----- ROUTINE DESCRIPTION
;;
;; This option produces a listing of all patches that have
;; been installed for the selected package and version.
;;
;;$$END
;
EN ;EP -- MAIN ENTRY POINT
;
D TXT
D SELECT
Q
CURRENT ;EP -- DISPLAY PATCH APPLICATION HISTORY FOR CURRENT VERSION OF ARMS
;
D CUR("ADMIN RESOURCE MGT SYSTEM")
Q
SELECT ;EP -- SELECT WHICH PACKAGE AND VERSION FOR PAH DISPLAY
;
N ACRPIEN,ACRVIEN,ZTSAVE
;
D HOME^%ZIS
D ^XBKVAR
;
D PKG(.ACRPIEN)
Q:ACRPIEN'>0
;
D VER(ACRPIEN,.ACRVIEN)
Q:ACRVIEN'>0
;
S ZTSAVE("ACRPIEN")=""
S ZTSAVE("ACRVIEN")=""
D QUE^ACRFUTL("DQ^ACRFPAH",.ZTSAVE,"PATCH APPLICATION HISTORY")
Q
CUR(X) ;----- DISPLAY PATCH APPLICATION HISTORY FOR CURRENT VERSION
;
; X = PACKAGE NAME
;
N ACRCVER,ACRPIEN,ACRPKG,ACRVIEN,ZTSAVE
;
D HOME^%ZIS
D ^XBKVAR
;
S ACRPIEN=$$PIEN^ACRFPAH(X)
;
S ACRCVER=$$CVER^ACRFPAH(ACRPIEN)
;
S ACRVIEN=$$VIEN^ACRFPAH(ACRCVER,ACRPIEN)
;
;BEGIN NEW CODE ACR*2.1*22.10 IM23060
I $D(ACRLPAT) D Q
. D LSTPAT
. S ACRZ="VERSION "_ACRCVER_" PATCH "_ACRPCH
;END NEW CODE ACR*2.1*22.10 IM223060
;
S ZTSAVE("PIEN")=""
S ZTSAVE("VIEN")=""
;
D QUE^ACRFUTL("DQ^ACRFPAH",.ZTSAVE,"PATCH APPLICATION HISTORY")
;
Q
PKG(ACRPIEN) ;
;----- ASKS PACKAGE AND RETURNS PACKAGE IEN
;
N DIC,X,Y
S DIC="^DIC(9.4,"
S DIC(0)="AEQ"
D ^DIC
I $D(DTOUT)!($D(DUOUT)) S Y=-1
S ACRPIEN=+Y
Q
VER(ACRPIEN,ACRVIEN) ;
;----- ASKS VERSION AND RETURNS VERSION IEN
;
N DIC,X,Y
S DA(1)=ACRPIEN
S DIC="^DIC(9.4,"_DA(1)_",22,"
S DIC(0)="AEQ"
D ^DIC
I $D(DTOUT)!($D(DUOUT)) S Y=-1
S ACRVIEN=+Y
Q
DQ ;EP -- QUEUED JOB STARTS HERE
;
; INCOMING VARIABLES:
; ACRPIEN = PACKAGE IEN
; ACRVIEN = VERSION IEN
;
D PRT(ACRPIEN,ACRVIEN)
D PAUSE^ACRFWARN
Q
PRT(ACRPIEN,ACRVIEN) ;
;----- PRINT THE REPORT
N ACRBY,ACRDATA,ACRDATE,ACRNAME,ACROUT,ACRPAGE,ACRPCH,ACRVER,X
;
S ACRVER=$P($G(^DIC(9.4,ACRPIEN,22,ACRVIEN,0)),U)
S ACRNAME=$P($G(^DIC(9.4,ACRPIEN,0)),U)
S ACRPAGE=0
S ACROUT=0
;
D HDR(ACRNAME,ACRVER,.ACRPAGE,.ACROUT)
Q:$G(ACROUT)
;
S ACROUT=0
S X=0
F S X=$O(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X)) Q:'X D Q:$G(ACROUT)
. S ACRDATA=$G(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X,0))
. S ACRPCH=$P(ACRDATA,U)
. S ACRDATE=$P(ACRDATA,U,2)
. I ACRDATE]"" S ACRDATE=$$SLDATE^ACRFUTL(ACRDATE)
. S ACRBY=$P(ACRDATA,U,3)
. I ACRBY S ACRBY=$P($G(^VA(200,ACRBY,0)),U)
. I $Y>(IOSL-5) D HDR(ACRNAME,ACRVER,.ACRPAGE,.ACROUT)
. Q:$G(ACROUT)
. W !,ACRPCH
. W ?15,ACRDATE
. W ?30,ACRBY
D ^%ZISC
Q
LSTPAT ;ONLY GET LAST PATCH # ;NEW CODE ACR*2.1*22.10 IM23060
S X=0
F S X=$O(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X)) Q:'X D Q:$G(ACROUT)
. S ACRDATA=$G(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X,0))
. S ACRPCH=$P(ACRDATA,U)
Q
HDR(ACRNAME,ACRVER,ACRPAGE,ACROUT) ;
;----- PRINT HEADER
;
N DIR,X,Y
;
I $E(IOST)="C",$G(ACRPAGE) S DIR(0)="E" D ^DIR K DIR I 'Y S ACROUT=1 Q
;
S ACRPAGE=$G(ACRPAGE)+1
W @IOF
W !,ACRNAME," VERSION ",ACRVER," PATCH APPLICATION HISTORY"
W !?49,$$NOW^ACRFUTL
W " PAGE ",ACRPAGE
W !,"PATCH"
W ?15,"DATE APPLIED"
W ?30,"APPLIED BY"
W !
F I=1:1:IOM W "-"
Q
PIEN(X) ;----- GET PACKAGE IEN
;
; X = PACKAGE NAME
;
N DIC,Y
S DIC="^DIC(9.4,"
S DIC(0)=""
D ^DIC
Q +Y
CVER(X) ;----- GET CURRENT VERSION
;
; X = PACKAGE IEN
;
N Y
S Y=""
I X S Y=$P($G(^DIC(9.4,X,"VERSION")),U)
Q Y
VIEN(X,ACRPKG) ;
;----- GET VERSION IEN
;
; ACRPKG = PACKAGE IEN
; X = VERSION NUMBER
;
N Y
S DIC="^DIC(9.4,"_ACRPKG_",22,"
S DIC(0)=""
D ^DIC
Q +Y
TXT ;----- PRINT OPTION DESCRIPTION
;
N I,X
F I=1:1 S X=$P($T(DESC+I),";",3) Q:X["$$END" W !,X
Q
ACRFPAH ;IHS/OIRM/DSD/AEF - DISPLAY PATCH APPLICATION HISTORY [ 12/13/2006 2:49 PM ]
+1 ;;2.1;ADMINISTRATIVE RESOURCE MGMT SYSTEM;**22**;NOV 05, 2001
+2 ;
+3 ;
DESC ;----- ROUTINE DESCRIPTION
+1 ;;
+2 ;; This option produces a listing of all patches that have
+3 ;; been installed for the selected package and version.
+4 ;;
+5 ;;$$END
+6 ;
EN ;EP -- MAIN ENTRY POINT
+1 ;
+2 DO TXT
+3 DO SELECT
+4 QUIT
CURRENT ;EP -- DISPLAY PATCH APPLICATION HISTORY FOR CURRENT VERSION OF ARMS
+1 ;
+2 DO CUR("ADMIN RESOURCE MGT SYSTEM")
+3 QUIT
SELECT ;EP -- SELECT WHICH PACKAGE AND VERSION FOR PAH DISPLAY
+1 ;
+2 NEW ACRPIEN,ACRVIEN,ZTSAVE
+3 ;
+4 DO HOME^%ZIS
+5 DO ^XBKVAR
+6 ;
+7 DO PKG(.ACRPIEN)
+8 IF ACRPIEN'>0
QUIT
+9 ;
+10 DO VER(ACRPIEN,.ACRVIEN)
+11 IF ACRVIEN'>0
QUIT
+12 ;
+13 SET ZTSAVE("ACRPIEN")=""
+14 SET ZTSAVE("ACRVIEN")=""
+15 DO QUE^ACRFUTL("DQ^ACRFPAH",.ZTSAVE,"PATCH APPLICATION HISTORY")
+16 QUIT
CUR(X) ;----- DISPLAY PATCH APPLICATION HISTORY FOR CURRENT VERSION
+1 ;
+2 ; X = PACKAGE NAME
+3 ;
+4 NEW ACRCVER,ACRPIEN,ACRPKG,ACRVIEN,ZTSAVE
+5 ;
+6 DO HOME^%ZIS
+7 DO ^XBKVAR
+8 ;
+9 SET ACRPIEN=$$PIEN^ACRFPAH(X)
+10 ;
+11 SET ACRCVER=$$CVER^ACRFPAH(ACRPIEN)
+12 ;
+13 SET ACRVIEN=$$VIEN^ACRFPAH(ACRCVER,ACRPIEN)
+14 ;
+15 ;BEGIN NEW CODE ACR*2.1*22.10 IM23060
+16 IF $DATA(ACRLPAT)
Begin DoDot:1
+17 DO LSTPAT
+18 SET ACRZ="VERSION "_ACRCVER_" PATCH "_ACRPCH
End DoDot:1
QUIT
+19 ;END NEW CODE ACR*2.1*22.10 IM223060
+20 ;
+21 SET ZTSAVE("PIEN")=""
+22 SET ZTSAVE("VIEN")=""
+23 ;
+24 DO QUE^ACRFUTL("DQ^ACRFPAH",.ZTSAVE,"PATCH APPLICATION HISTORY")
+25 ;
+26 QUIT
PKG(ACRPIEN) ;
+1 ;----- ASKS PACKAGE AND RETURNS PACKAGE IEN
+2 ;
+3 NEW DIC,X,Y
+4 SET DIC="^DIC(9.4,"
+5 SET DIC(0)="AEQ"
+6 DO ^DIC
+7 IF $DATA(DTOUT)!($DATA(DUOUT))
SET Y=-1
+8 SET ACRPIEN=+Y
+9 QUIT
VER(ACRPIEN,ACRVIEN) ;
+1 ;----- ASKS VERSION AND RETURNS VERSION IEN
+2 ;
+3 NEW DIC,X,Y
+4 SET DA(1)=ACRPIEN
+5 SET DIC="^DIC(9.4,"_DA(1)_",22,"
+6 SET DIC(0)="AEQ"
+7 DO ^DIC
+8 IF $DATA(DTOUT)!($DATA(DUOUT))
SET Y=-1
+9 SET ACRVIEN=+Y
+10 QUIT
DQ ;EP -- QUEUED JOB STARTS HERE
+1 ;
+2 ; INCOMING VARIABLES:
+3 ; ACRPIEN = PACKAGE IEN
+4 ; ACRVIEN = VERSION IEN
+5 ;
+6 DO PRT(ACRPIEN,ACRVIEN)
+7 DO PAUSE^ACRFWARN
+8 QUIT
PRT(ACRPIEN,ACRVIEN) ;
+1 ;----- PRINT THE REPORT
+2 NEW ACRBY,ACRDATA,ACRDATE,ACRNAME,ACROUT,ACRPAGE,ACRPCH,ACRVER,X
+3 ;
+4 SET ACRVER=$PIECE($GET(^DIC(9.4,ACRPIEN,22,ACRVIEN,0)),U)
+5 SET ACRNAME=$PIECE($GET(^DIC(9.4,ACRPIEN,0)),U)
+6 SET ACRPAGE=0
+7 SET ACROUT=0
+8 ;
+9 DO HDR(ACRNAME,ACRVER,.ACRPAGE,.ACROUT)
+10 IF $GET(ACROUT)
QUIT
+11 ;
+12 SET ACROUT=0
+13 SET X=0
+14 FOR
SET X=$ORDER(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X))
IF 'X
QUIT
Begin DoDot:1
+15 SET ACRDATA=$GET(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X,0))
+16 SET ACRPCH=$PIECE(ACRDATA,U)
+17 SET ACRDATE=$PIECE(ACRDATA,U,2)
+18 IF ACRDATE]""
SET ACRDATE=$$SLDATE^ACRFUTL(ACRDATE)
+19 SET ACRBY=$PIECE(ACRDATA,U,3)
+20 IF ACRBY
SET ACRBY=$PIECE($GET(^VA(200,ACRBY,0)),U)
+21 IF $Y>(IOSL-5)
DO HDR(ACRNAME,ACRVER,.ACRPAGE,.ACROUT)
+22 IF $GET(ACROUT)
QUIT
+23 WRITE !,ACRPCH
+24 WRITE ?15,ACRDATE
+25 WRITE ?30,ACRBY
End DoDot:1
IF $GET(ACROUT)
QUIT
+26 DO ^%ZISC
+27 QUIT
LSTPAT ;ONLY GET LAST PATCH # ;NEW CODE ACR*2.1*22.10 IM23060
+1 SET X=0
+2 FOR
SET X=$ORDER(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X))
IF 'X
QUIT
Begin DoDot:1
+3 SET ACRDATA=$GET(^DIC(9.4,ACRPIEN,22,ACRVIEN,"PAH",X,0))
+4 SET ACRPCH=$PIECE(ACRDATA,U)
End DoDot:1
IF $GET(ACROUT)
QUIT
+5 QUIT
HDR(ACRNAME,ACRVER,ACRPAGE,ACROUT) ;
+1 ;----- PRINT HEADER
+2 ;
+3 NEW DIR,X,Y
+4 ;
+5 IF $EXTRACT(IOST)="C"
IF $GET(ACRPAGE)
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF 'Y
SET ACROUT=1
QUIT
+6 ;
+7 SET ACRPAGE=$GET(ACRPAGE)+1
+8 WRITE @IOF
+9 WRITE !,ACRNAME," VERSION ",ACRVER," PATCH APPLICATION HISTORY"
+10 WRITE !?49,$$NOW^ACRFUTL
+11 WRITE " PAGE ",ACRPAGE
+12 WRITE !,"PATCH"
+13 WRITE ?15,"DATE APPLIED"
+14 WRITE ?30,"APPLIED BY"
+15 WRITE !
+16 FOR I=1:1:IOM
WRITE "-"
+17 QUIT
PIEN(X) ;----- GET PACKAGE IEN
+1 ;
+2 ; X = PACKAGE NAME
+3 ;
+4 NEW DIC,Y
+5 SET DIC="^DIC(9.4,"
+6 SET DIC(0)=""
+7 DO ^DIC
+8 QUIT +Y
CVER(X) ;----- GET CURRENT VERSION
+1 ;
+2 ; X = PACKAGE IEN
+3 ;
+4 NEW Y
+5 SET Y=""
+6 IF X
SET Y=$PIECE($GET(^DIC(9.4,X,"VERSION")),U)
+7 QUIT Y
VIEN(X,ACRPKG) ;
+1 ;----- GET VERSION IEN
+2 ;
+3 ; ACRPKG = PACKAGE IEN
+4 ; X = VERSION NUMBER
+5 ;
+6 NEW Y
+7 SET DIC="^DIC(9.4,"_ACRPKG_",22,"
+8 SET DIC(0)=""
+9 DO ^DIC
+10 QUIT +Y
TXT ;----- PRINT OPTION DESCRIPTION
+1 ;
+2 NEW I,X
+3 FOR I=1:1
SET X=$PIECE($TEXT(DESC+I),";",3)
IF X["$$END"
QUIT
WRITE !,X
+4 QUIT