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

PRCINAR.m

Go to the documentation of this file.
PRCINAR ;BP-OIFO/SWS-IFCAP ARCHIVE/PURGE FIX ;12/07/2005  12:16
V ;;5.1;IFCAP;**95**;Oct 20, 2000
 Q
START S (MYREC,MYPTR,SUBREC,NREC)=0
 S ^XTMP("IFCAP-PURGE-424-1",0)=$$FMADD^XLFDT(DT,7)_"^"_DT_"^RECORDS PURGED FROM FILE 424.1 BY PRC*5.1*95"
 S ^XTMP("IFCAP-PURGE-424-1-REF",0)=$$FMADD^XLFDT(DT,7)_"^"_DT_"^C CROSS REFERENCES PURGED FROM FILE 424.1 BY PRC*5.1*95"
 F  S MYPTR=$O(^PRC(424.1,"C",MYPTR)) Q:'MYPTR  D
 . I '$D(^PRC(424,MYPTR))  D
 . . S SUBREC=0
 . . F  S SUBREC=$O(^PRC(424.1,"C",MYPTR,SUBREC))  Q:'SUBREC  D
 . . . S ^XTMP("IFCAP-PURGE-424-1",SUBREC)=^PRC(424.1,SUBREC,0)
 . . . S ^XTMP("IFCAP-PURGE-424-1-REF",SUBREC)="C^"_MYPTR_"^"_SUBREC
 . . . S DA=SUBREC,DIK="^PRC(424.1," D ^DIK
 . . . K DIK
 . . . S NREC=NREC+1
 D WTOTAL,CLEAN
 D START2
 D FINDREC
 Q
WTOTAL ;
 D BMES^XPDUTL(NREC_" RECORDS DELETED FROM FILE 424.1")
 D BMES^XPDUTL("BACKUP RECORDS STORED IN THE FOLLOWING LOCATIONS FOR 7 DAYS:")
 D BMES^XPDUTL("^XTMP(""IFCAP-PURGE-424-1"")")
 D BMES^XPDUTL("^XTMP(""IFCAP-PURGE-424-1-REF"")")
 Q
 ;
CLEAN K MYREC,MYPTR,SUBREC,NREC
 Q
 ;
START2 S IPIEN=0,NREC=0,TREC=0
 S ^XTMP("IFCAP-PURGE-440-6",0)=$$FMADD^XLFDT(DT,7)_"^"_DT_"^RECORDS PURGED FROM FILE 440.6 BY PRC*5.1*95"
 S ^XTMP("IFCAP-PURGE-440-6-REF",0)=$$FMADD^XLFDT(DT,7)_"^"_DT_"^B CROSS REFERENCES PURGED FROM FILE 440.6 BY PRC*5.1*95"
 F  S IPIEN=$O(^PRCH(440.6,"PO",IPIEN)) Q:IPIEN'>0  D
 .S IEN=0
 .I '$D(^PRC(442,IPIEN)) D
 ..S TREC=TREC+1
 ..S IEN=0
 ..F  S IEN=$O(^PRCH(440.6,"PO",IPIEN,IEN)) Q:'IEN  D KILL4406
 ..Q
 .Q
 D WTOTAL2,CLEAN2
 Q
WTOTAL2 ;
 D BMES^XPDUTL(NREC_" RECORDS DELETED FROM FILE 440.6")
 D BMES^XPDUTL("BACKUP RECORDS STORED IN THE FOLLOWING LOCATIONS FOR 7 DAYS:")
 D BMES^XPDUTL("^XTMP(""IFCAP-PURGE-440-6"")")
 D BMES^XPDUTL("^XTMP(""IFCAP-PURGE-440-6-REF"")")
 Q
KILL4406 ;set temp files then kill invalid 440.6 records
 N DA
 S NREC=NREC+1
 S ^XTMP("IFCAP-PURGE-440-6",IPIEN,IEN)=^PRCH(440.6,IEN,0)
 S ^XTMP("IFCAP-PURGE-440-6-REF",IPIEN,IEN)="PO^"_IPIEN_"^"_IEN
 S DA=IEN
 S DIK="^PRCH(440.6," D ^DIK
 K DIK,DA
 Q
CLEAN2 K IEN,IPIEN,TREC,NREC
 Q
 ;
FINDREC N DIC,Y,NREC,MREC,DIE,X
 D BMES^XPDUTL("Adding new option to PRCG ARCHIVE/PURGE MENU option.")
 S DIC="^DIC(19,",X="PRCG LOAD 417 PURGMASTER"
 D ^DIC
 I Y'=-1  S NREC=+Y
FINDMNU S (DIC,Y)=""
 S DIC="^DIC(19,",X="PRCG ARCHIVE/PURGE MASTER MENU"
 D ^DIC
 I Y'=-1  S MREC=+Y
UPDMNU S (DIC,Y)=""
 S (BFLAG,NTHIS)=0
 F  S NTHIS=$O(^DIC(19,MREC,10,NTHIS))  Q:'NTHIS!(BFLAG=1)  D
 . S MYIEN=$G(^DIC(19,MREC,10,NTHIS,0))
 . I MYIEN=NREC  S BFLAG=1
 I BFLAG=0  D
 . S DIC="^DIC(19,"_MREC_",10,",DIC(0)="",DIC("P")="19.01IP"
 . S X=NREC
 . S DA(1)=MREC
 . D FILE^DICN
CLNREC K BFLAG,NTHIS,MREC,NREC
 Q