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

PRC159P1.m

Go to the documentation of this file.
  1. PRC159P1 ;VMP/RB-PURGE ALL DUPLICATE PRC(442,"AB" ORDER DATE REFERENCES
  1. ;;5.1;IFCAP;**159**;Oct 01, 2009;Build 9
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ; Pre install routine in patch PRC*5.1*159 that will purge duplicate
  1. ; entries in cross reference ^PRC(442,"AB") that were left
  1. ; unkilled when the order was edited on a subsequent date.
  1. ;;
  1. Q
  1. START ;Kill off extraneous index xref left behind when using CHANGE EXISTING TRANSACTION NUMBER option
  1. N RMSTART,IEN442,RMEND,R0,R1,TOT,TOT1,TOT3,TOT4,TOT5,PRCODT,PRCODT0
  1. I $D(^XTMP("PRC159P1")) Q
  1. D NOW^%DTC S RMSTART=%
  1. S ^XTMP("PRC159P1","START COMPILE")=RMSTART
  1. S ^XTMP("PRC159P1","END COMPILE")="RUNNING"
  1. S ^XTMP("PRC159P1",0)=$$FMADD^XLFDT(RMSTART,120)_"^"_RMSTART
  1. S U="^",PRCODT=0,(TOT,TOT1,TOT3,TOT4,TOT5)=0
  1. 1 S PRCODT=$O(^PRC(442,"AB",PRCODT)),IEN442=0 G 5:PRCODT=""
  1. 2 S IEN442=$O(^PRC(442,"AB",PRCODT,IEN442)) G 1:IEN442=""
  1. S TOT=TOT+1
  1. I '$D(^PRC(442,IEN442,0)) D G 2
  1. . S TOT4=TOT4+1
  1. . K ^PRC(442,"AB",PRCODT,IEN442)
  1. . S ^XTMP("PRC159P1","M0",IEN442,PRCODT)=""
  1. I '$D(^PRC(442,IEN442,1)) D G 2
  1. . S TOT5=TOT5+1
  1. . K ^PRC(442,"AB",PRCODT,IEN442)
  1. . S ^XTMP("PRC159P1","M1",IEN442,PRCODT)=""
  1. S R0=$G(^PRC(442,IEN442,0)),R1=$G(^PRC(442,IEN442,1)),PRCODT0=$P(R1,U,15)
  1. I PRCODT'=PRCODT0 D
  1. . S TOT1=TOT1+1
  1. . K ^PRC(442,"AB",PRCODT,IEN442)
  1. . S ^XTMP("PRC159P1","D",IEN442,PRCODT)=PRCODT0
  1. G 2
  1. ;Insures that all file 442 entries have an 'AB' x-ref
  1. 5 S IEN442=0
  1. 6 S IEN442=$O(^PRC(442,IEN442)) G EXIT:IEN442=""
  1. I '$D(^PRC(442,IEN442,1)) G 6
  1. S R0=$G(^PRC(442,IEN442,0)),R1=$G(^PRC(442,IEN442,1)),PRCODT0=$P(R1,U,15)
  1. I 'PRCODT0 G 6
  1. I '$D(^PRC(442,"AB",PRCODT0,IEN442)) D
  1. . S TOT3=TOT3+1
  1. . S ^PRC(442,"AB",PRCODT0,IEN442)=""
  1. . S ^XTMP("PRC159P1","S",IEN442,PRCODT0)=$P(R0,U)
  1. G 6
  1. EXIT ;
  1. D NOW^%DTC S RMEND=%
  1. S ^XTMP("PRC159P1","TOTALS")=TOT_U_TOT1_U_TOT3_U_TOT4_U_TOT5
  1. S ^XTMP("PRC159P1","END COMPILE")=RMEND
  1. W !!,"Number of assigned 'AB' cross references: ",TOT
  1. W !!,"Number of purged 'AB' x-ref with undefined node 0 in file 442: ",TOT4
  1. W !!,"Number of purged 'AB' x-ref with undefined node 1 in file 442: ",TOT5
  1. W !!,"Number of purged 'AB' x-ref with diff node 1 P.O. Date: ",TOT1
  1. W !!,"Number of created 'AB' x-ref for 442 orders missing P.O. Date x-ref: ",TOT3
  1. K %
  1. Q