PRCPXODI ;WOIFO/CC-purge On-Demand Audit Activity ; 11/30/06 4:04pm ;;5.1;IFCAP;**98**;Oct 20, 2000;Build 37 ;Per VHA Directive 2004-038, this routine should not be modified. Q ; Called from PRCPXALL where STOPDATE and PRCP("I") are set up ; PRCP("I") is the ien of the inventory point being cleaned ; STOPDATE is the oldest date for which activity is to be kept ; ; NOTE: This program purges the On-Demand Audit records from each ; item in the inventory point. Although the program is ; designed to purge any record older than the date indicated ; in STOPDATE, it is also designed to retain the three most ; recent audit records, regardless of how old they are. ; DQ N D,DA,DIC,DIK,ITEMDA,PRCPAUDT,PRCPCNT,PRCPSTOP,X ; loop through for each item S ITEMDA=0 F S ITEMDA=$O(^PRCP(445,PRCP("I"),1,ITEMDA)) Q:+ITEMDA'>0 D . N X,PRCPKEEP . I $D(SCAN) W !,"ITEM # ",ITEMDA . S X=$O(^PRCP(445,PRCP("I"),1,ITEMDA,10,0)) Q:X="" ; no audits on file . S X=$P($G(^PRCP(445,PRCP("I"),1,ITEMDA,10,X,0)),"^",1) ; date of audit . I $D(SCAN) W !,"OLDEST AUDIT DATE: ",X . I X'