source: WorldVistAEHR/trunk/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSVDDE.m@ 738

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

initial load of WorldVistAEHR

File size: 1.6 KB
RevLine 
[613]1ABSVDDE ;VAMC ALTOONA/CTB - DELETE DAILY ENTRYS IN FILE 503331 ;4/13/94 11:42 AM
2V ;;4.0;VOLUNTARY TIMEKEEPING;;JULY 6, 1994
3 D ^ABSVSITE G OUT:'%
4 D NOW^ABSVQ S XDATE=X I +$E(X,4,5)=1 S XDATE=$E(X,1,3)-1_1200
5 E S MO=0_($E(X,4,5)-1),MO=$E(MO,$L(MO)-1,$L(MO)) S XDATE=$E(X,1,3)_MO_"00"
6 S ABSVXA="This option will delete ALL entries in the Daily Entry File up to the month ",ABSVXA(1)="specified. Do you wish to continue",ABSVXB="",%=1 D ^ABSVYN I %'=1 S X=" NO ACTION TAKEN" D MSG^ABSVQ G OUT
7 F ZZ=1:1 W ! S %DT("A")="Select Month/Year to end purge: ",%DT="AE" D ^%DT Q:$E(Y,4,7)'="0000" W *7," ??"
8 K ZZ I Y<0 S X=" No month selected" D MSG^ABSVQ G OUT
9 S Y=$E(Y,1,5)_"00" I Y'<XDATE W !,"You may not delete entries for: Last month, the current month or",!,"any future months using this option.",*7 G OUT
10 S MONTH=Y D D^ABSVQ S FULLMON=Y
11 S ABSVXA="ARE YOU SURE YOU WANT DELETE ALL ENTRIES TO "_Y,ABSVXB="",%=2 D ^ABSVYN I %'=1 S X=" Option terminated*" D MSG^ABSVQ G OUT
12 S ZTRTN="DQ^ABSVDDE",ZTDESC="DELETE VOLUNTARY DAILY ENTRIES TO "_FULLMON,ZTSAVE("MONTH")="",ZTSAVE("FULLMON")="",ZTSAVE("ABSV*")="" D ^ABSVQ
13OUT K %,%DT,COUNT,DA,FULLMON,I,MO,MONTH,POP,X,XDATE,Y Q
14DQ ;ENTRY POINT FROM TASK MANAGER FOR DAILY RECORD DELETION
15 D NOW^ABSVQ W "Beginning Deletion on ",ABSVXX
16 S COUNT=0,DA=0 F S DA=$O(^ABS(503331,DA)) Q:'DA I $D(^ABS(503331,DA,0)),$P(^(0),"^",2)'>MONTH,$P(^(0),"^",7)=ABSV("SITE") D DEL S COUNT=COUNT+1 W "."
17 W !!,"FINISHED DELETION PASS TO ",FULLMON,", ",COUNT," ENTRIES DELETED." D NOW^ABSVQ W !,"Deletion completed on ",ABSVXX
18 I $D(ZTQUEUED) D KILL^%ZTLOAD
19 K ABSVXX Q
20DEL ;DELETE SINGLE ENTRY IN FILE 503331
21 S DIK="^ABS(503331," D ^DIK
22 QUIT
Note: See TracBrowser for help on using the repository browser.