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

XTPMKPP.m

Go to the documentation of this file.
XTPMKPP ;OAK/BP - PATCH MONITOR PURGING; 4/13/21
 ;;7.3;TOOLKIT;**98,104,150**; Apr 25, 1995;Build 1
 ;;Per VA Directive 6402, this routine should not be modified
 ;
EN D DT^DICRW
 ; number of days to keep data in param file
 S XTBPDAYS=$P($G(^XPD(9.95,1,0)),U,2)
 I +XTBPDAYS=0 S XTBPDAYS=30 ; minimum of 30 days
 S X1=DT,X2=-XTBPDAYS D C^%DTC S XTBEND=X+.2359,XTBX=""
 F  S XTBX=$O(^XPD(9.9,"B",XTBX)) Q:XTBX=""  F XTBDA=0:0 S XTBDA=$O(^XPD(9.9,"B",XTBX,XTBDA)) Q:XTBDA=""  DO
 .S XTBDTA=$G(^XPD(9.9,XTBDA,0)) Q:XTBDTA=""
 .I $P(XTBDTA,U,10) D NONKID(XTBDA,XTBDTA,XTBEND) Q
 .S XTBINST=$P(XTBDTA,U,8) I $G(XTBINST)="" N DA S DIK="^XPD(9.9,",DA=XTBDA D ^DIK Q  ; check install name if it is NULL p752
 .S XTBCMPDT=$P(XTBDTA,U,9) ; compliance date
 .S XTBXX=$O(^XPD(9.7,"B",XTBINST,"A"),-1) I +XTBXX'>0 Q 
 .Q:$P($G(^XPD(9.7,+XTBXX,0)),U,9)'=3  ; not installed
 .I XTBCMPDT<XTBEND S DIK="^XPD(9.9,",DA=XTBDA D ^DIK
 K XTBPDAYS,X1,X2,XTBEND,XTBX,XTBXX,XTBDA,XTBCMPDT,DIK,DA,XTBINST,XTBDTA,X
 Q
NONKID(XTBDA,XTBDTA,XTBEND) ;Delete Non_Kid patches
 N DA,DIK,XTNKB,XTNKBID,XTBCMPDT
 S XTBCMPDT=$P(XTBDTA,U,9) ; compliance date
 S XTNKB=$P(XTBDTA,U,10) ; Non-Kids build
 S XTNKBID=$P(XTBDTA,U,11) ; Non-Kids build Install date
 I XTBCMPDT,XTNKBID,XTBCMPDT<XTBEND S DIK="^XPD(9.9,",DA=XTBDA D ^DIK
 Q
 ;
UNITEST ;
 N XTBX,IEN S XTBX=0 F  S XTBX=$O(^XPD(9.9,"B",XTBX)) Q:XTBX=""  S IEN=$O(^XPD(9.9,"B",XTBX,0)) W !,IEN,?15,$P($G(^XPD(9.9,IEN,0)),"^",8)
 Q