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

ACRFPAH.m

Go to the documentation of this file.
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