source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRARPW.m@ 1742

Last change on this file since 1742 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1LRARPW ;DALISC/CKA - PURGE WKLD DATA (64.1);2/1/95
2 ;;5.2;LAB SERVICE;**59,162**;Sep 27, 1994
3START ;
4 ;FIND ACTIVE LAB ARCHIVAL ACTIVITY
5 S LRART=64.1,LRAR=90,LRARC=0 S LRARC=$O(^LAB(95.11,"O",3,LRART,LRARC)) G:LRARC="" ERROR D FILE^LRARU G:'$D(LRARC) EXIT
6 ;UPDATE ACTION IN PROGRESS FIELDS
7 S LRAR=90 D MRK^LRARU1
8MAKE ;Ask if backup tape made
9 W !!!! S DIR(0)="Y",DIR("A")="Did you make a backup of the ARCHIVED WKLD DATA file (64.19999)" D ^DIR K DIR
10 I $D(DIRUT) D COMP^LRARU1 G EXIT
11 I 'Y W !!!!,$C(7),"Make a backup of the ARCHIVED WKLD DATA file before purging!" D COMP^LRARU1 G EXIT
12CHECK ;Ask if checked backup tape
13 W !!!! S DIR(0)="Y",DIR("A")="Did you check the backup of the ARCHIVED WKLD DATA file" D ^DIR K DIR
14 I $D(DIRUT) D COMP^LRARU1 G EXIT
15 I 'Y W !!!!,$C(7),"Check the backup before purging!" D COMP^LRARU1 G EXIT
16OKAY ;Ask if okay to delete
17 W !!!! S DIR(0)="Y",DIR("A")="Okay to delete WKLD DATA entries: " D ^DIR K DIR
18 I $D(DIRUT)!('Y) W !!!!,"No purging done." D COMP^LRARU1 G EXIT
19QUEUE ;queue purge
20 S ZTRTN="DOIT^LRARPW",ZTSAVE("LR*")="",ZTDESC="PURGE ARCHIVED WKLD DATA",ZTIO="" D ^%ZTLOAD W:$D(ZTSK) !,"TASK #",ZTSK G EXIT
21 ;
22DOIT ;Deleting dates in 64.1
23 S LRAVAR=0
24 F LRAI=0:0 S LRAVAR=$O(^LAB(95.11,LRARC,"RESULT",64.111,LRAVAR)) Q:+LRAVAR'>0 D
25 . S DA(2)=$P(LRAVAR,",",3),DA(1)=$P(LRAVAR,",",2),DA=$P(LRAVAR,","),DIK="^LRO(64.1,"_DA(2)_",1,"_DA(1)_",1," D ^DIK
26 . I '$O(^LRO(64.1,DA(2),1,DA(1),1,0)) S DA=DA(1),DA(1)=DA(2),DIK="^LRO(64.1,"_DA(1)_",1," D ^DIK
27END W !!!!,"DONE."
28 D COMP^LRARU1
29 I '$D(DIRUT) S LRAR=90 D UPDATE^LRARU1
30 W !!,"I will now CLEAR out the Archived Workload Data global."
31 S LRARX="" F LRARI=0:0 S LRARX=$O(^LAR(64.19999,LRARX)) Q:LRARX="" K ^LAR(64.19999,LRARX)
32 S ^LAR(64.19999,0)="ARCHIVED WKLD DATA^64.19999"
33 W !!,">>> DONE <<<"
34 K ^LAB(95.11,LRARC,"RESULT")
35 S ZTREQ="@"
36EXIT K DA,DIK,DIR,DIRUT,LRAVAR,LRAI,LRAIEN,LRAINST,LRAJ,LRAR,LRARC,LRARI,LRART,LRARX,Y
37 D CLN^LRARU1
38 Q
39ERROR W !!,$C(7),"I cannot find an archival activity for file 64.1 with the right archival status."
40 G EXIT
41 Q
Note: See TracBrowser for help on using the repository browser.