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

BNPENV2.m

Go to the documentation of this file.
BNPENV2 ;IHS/OIT/ENM - ENVIRONMENT CHECK 2
 ;;1.0;NATIONAL SITE TRACKING SYSTEM;**1**;07/31/2009
 ;BNP*1.0*1 11/30/2011 IHS.OIT.GAB
LAST(PKG,VER) ;returns last patch applied for a Package, PATCH^DATE
 ;        Patch includes Seq # if Released
 ;BNP*1.0*1 10/27/2011 IHS.OIT.GAB ADDED DTDIST,PKGNI,LASTP,LASTPD TO TEST FOR PACKAGE INSTALL & DT DISTRIBUTED
 N PKGIEN,VERIEN,LATEST,PATCH,SUBIEN,DTDIST
 S PKGNI="",LASTP=0,LASTPD=0
 I $G(VER)="" S VER=$$VERSION^XPDUTL(PKG) Q:'VER -1
 S PKGIEN=$O(^DIC(9.4,"B",PKG,"")) Q:'PKGIEN -1
 S VERIEN=$O(^DIC(9.4,PKGIEN,22,"B",VER,"")) Q:'VERIEN -1
 ;BNP*1.0*1 10/27/2011 IHS.OIT.GAB ADDED NEXT 2 LINES TO CK FOR PKG INSTALLED
 S PKGNI=^DIC(9.4,PKGIEN,22,0)
 Q:$D(PKGNI)=""
 S LATEST=-1,PATCH=-1,SUBIEN=0
 F  S SUBIEN=$O(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN)) Q:SUBIEN'>0  D
 . S LATEST=$P(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2),PATCH=$P(^(0),U)
 ;BNP*1.0*1 10/27/2011 IHS.OIT.GAB ADDED NEXT 3 LINES FOR DATE DISTRIBUTED FIELD
 S DTDIST=$P(^DIC(9.4,PKGIEN,22,VERIEN,0),U,2)
 D PDISTDT
 I LASTP>0 S LASTPD=$P($G(^XPD(9.6,LASTP,0)),U,4)
 Q PATCH_U_LATEST_U_DTDIST_U_LASTPD
PDISTDT ;BNP*1.0*1 11/18/2011 IHS.OIT.GAB ADDED TO FIND LAST PATCH DISTRIBUTION DATE USING BUILD GLOBAL
 S YIEN="",IEN="",PKIEN="",X="",Y="",Z="",Z1="",Z2=0
 F NA=0:0 S X=$O(^XPD(9.6,"B",X)) Q:X=""  D
 . S Y=$O(^XPD(9.6,"B",X,""))
 . Q:'Y
 . S Z=$P(^XPD(9.6,Y,0),U,2)
 . I Z'=PKGIEN Q
 . I Z=PKGIEN S Z1=Y  D PDISTCK
 ;
 I Z2>0 S LASTP=Z2
 Q
PDISTCK ;BNP*1.0*1 11/30/2011 IHS.OIT.GAB ADDED TO COMPARE PATCH DISTRIBUTION DATES
 I Z1>Z2 S Z2=Z1
 Q