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

XUP285R.m

Go to the documentation of this file.
XUP285R ;IHS/OIT/FBD - REPAIR MISSING RECORD FOR PATCH XU*8.0*285; May 20, 2011
 ;;8.0;KERNEL;**1017**;May 20, 2011;Build 3
 ;
 N PKG,VERSION,PATCH,RTN,INSTDATE
 D INIT
 D MAIN
 D CLEANUP
 Q
 ;
INIT ;PRIMARY MODULE INITIALIZATION
 S U="^"
 S PKG="XU"       ;PACKAGE NAMESPACE
 S VERSION="8.0"  ;PACKAGE VERSION
 S PATCH="285"    ;SPECIFIC PATCH NUMBER
 S RTN="XQALFWD"  ;ROUTINE TO TEST FOR PATCH PRESENCE
 S INSTDATE=$O(^XPD(9.7,"B","XOBS 1.5",0)),INSTDATE=$P(^XPD(9.7,INSTDATE,0),U,3)  ;INSTALL DATE OF XOBS 1.5 PATCH WILL BE USED FOR THIS PATCH RECORD
 Q
 ;
MAIN ;PRIMARY MODULE EXECUTION
 ;
 ;CHECK IF PATCH IS ALREADY RECORDED IN PATCH APPLICATON HISTORY
 ;
 I '+$O(^DIC(9.4,"C",PKG,0)) D MES^XPDUTL(PKG_" not found in PACKAGE file; aborting.") Q
 S PKG=$O(^DIC(9.4,"C",PKG,0))
 I '+$O(^DIC(9.4,PKG,22,"B",VERSION,0)) D MES^XPDUTL("Version "_VERSION_" not found in PACKAGE file entry for "_PKG_"; aborting.") Q
 S VERSION=$O(^DIC(9.4,PKG,22,"B",VERSION,0))
 I +$O(^DIC(9.4,PKG,22,VERSION,"PAH","B",PATCH,0)) D MES^XPDUTL("Patch "_PATCH_" already recorded in PACKAGE file entry for "_PKG_" v."_VERSION_" .") Q
 ;
 ;OK, THE PATCH IS VERIFIED AS NOT LOGGED - SO LOG IT IF IT IS PRESENT
 ;
 I $$PPRESENT(RTN,PATCH) D LOGPATCH
 Q
 ;
PPRESENT(RTN,PATCH) ;DETERMINE IF A PATCH IS DOCUMENTED IN A SPECIFIC ROUTINE
 N PRESENT,PPDL,SPDL
 N PTR        ;POINTER FOR INCREMENTAL PATCH SCAN
 S PPDL="**"  ;PRIMARY PATCH DELIMITER
 S SPDL=","   ;SECONDARY PATCH DELIMITER
 S PRESENT=0  ;PATCH PRESENCE FLAG
 ;
 S %="S %=$T(+2^"_RTN_")" X %  ;PULL THE VERSION LINE FROM THE ROUTINE
 S %=$P(%,PPDL,2)    ;AND EXTRACT THE PATCH LIST
 I $L(%,SPDL)>1 D    ;IF MORE THAN ONE,
 .F PTR=1:1:$L(%,SPDL) D
 ..S:$P(%,SPDL,PTR)=PATCH PRESENT=1
 .E  S:%=PATCH PRESENT=1
 Q PRESENT
 ;
LOGPATCH ;CREATE AN ENTRY IN THE PACKAGE FILE (#9.4) FOR A GIVEN VERSION/PATCH
 N DIC,DA
 N D0  ;JUST MAKING SURE THIS VARIABLE DOESN'T EXIST
 S DA(1)=VERSION,DA(2)=PKG
 S DIC="^DIC(9.4,"_DA(2)_",22,"_DA(1)_",""PAH"","
 S DIC(0)="LZ"
 S X=PATCH
 S DIC("DR")=".02///"_INSTDATE_";.03///`"_DUZ
 D FILE^DICN
 I +Y>1 D MES^XPDUTL("Patch #"_PATCH_" entry added - multiple IEN "_+Y_".")
 Q
 ;
CLEANUP ;PRIMARY MODULE CLOSEOUT
 Q