source: WorldVistAEHR/trunk/r/OCCURRENCE_SCREEN-QAO/QAOSPURG.m@ 824

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1QAOSPURG ;HISC/DAD-PURGE AUTO ENROLL RUN DATES FILE ;1/13/93 14:12
2 ;;3.0;Occurrence Screen;;09/14/1993
3 W !!!?32,"*** WARNING ***",!!?4,"This option purges the historical data that tells the Occurrence Screen",!?17,"package on what dates auto enrollment was run",*7,!
4ASK ;
5 W !,"Are you sure you want to continue" S %=2 D YN^DICN G:(%=-1)!(%=2) EXIT I '% W !!?5,"Please answer Y(es) or N(o)",! G ASK
6SCRN ;
7 W !!,"Select the screens to purge." K ^UTILITY($J,"QAO SCREEN")
8 S QAQDIC="^QA(741.1,",QAQDIC(0)="AEMNQZ",QAQDIC("A")="Select SCREEN: "
9 S QAQDIC("B")="ALL",QAQUTIL="QAO SCREEN" D ^QAQSELCT G:QAQQUIT EXIT
10DATE ;
11 W !!,"Select the date range to purge."
12 D ^QAQDATE G:QAQQUIT EXIT I QAQNBEG'<DT W !?5,"*** Beginning date must be in the past !! ***",*7 G DATE
13 S ZTRTN="ENTSK^QAOSPURG",ZTIO="",ZTDTH=$H
14 S ZTSAVE("QAQ*")="",ZTSAVE("^UTILITY($J,""QAO SCREEN"",")=""
15 S ZTDESC="Purge auto enroll run dates file"
16 D ^%ZTLOAD W !,"Deletion request queued."
17 G EXIT
18 ;
19ENTSK ; Tasked entry point
20 S QAOSDR="" K SCRNFLD,^UTILITY($J,"QAM MONITOR")
21 F QA=1:1 S X=$T(SCRNFLD+QA) Q:X="" S SCRNFLD(+X)=$P(X,";;",2)
22 F QAOSSCRN=0:0 S QAOSSCRN=$O(^UTILITY($J,"QAO SCREEN",QAOSSCRN)) Q:QAOSSCRN'>0 D
23 . S SCRNFLD=$G(SCRNFLD(10*QAOSSCRN))
24 . I SCRNFLD D
25 .. S QAOSDR=QAOSDR_$S(QAOSDR]"":";",1:"")_SCRNFLD_"///@"
26 .. K SCRNFLD(10*QAOSSCRN)
27 .. Q
28 . S QAMD0=+$P($G(^QA(741.1,QAOSSCRN,0)),"^",5)
29 . S QAM=$P($G(^QA(743,QAMD0,0)),"^")
30 . S:QAM]"" ^UTILITY($J,"QAM MONITOR",QAM,QAMD0)=""
31 . Q
32 ; Purge Monitoring System AUTO ENROLL RUN DATE file (#743.6)
33 D EN3^QAMARCH1
34 ; Purge Occurrence Screen QA OCCURRENCE AUTO RUN DATES file (#741.99)
35 S QAOSALL=$S($O(SCRNFLD(0))'>0:1,1:0)
36 F QAOS=QAQNBEG-.0000001:0 S QAOS=$O(^QA(741.99,"B",QAOS)) Q:(QAOS'>0)!(QAOS\1>QAQNEND) F QAOSD0=0:0 S QAOSD0=$O(^QA(741.99,"B",QAOS,QAOSD0)) Q:QAOSD0'>0 D
37 . I QAOSALL D
38 .. S DIK="^QA(741.99,",DA=QAOSD0 D ^DIK
39 .. Q
40 . E D
41 .. S DIE="^QA(741.99,",DA=QAOSD0,DR=QAOSDR D ^DIE
42 .. Q
43 . Q
44EXIT ;
45 K %,%DT,DA,DIK,QAOS,QAOSD0,QAOSQUIT,X,Y,D,I,Z,ZTRTN,ZTSAVE,ZTIO,ZTDESC
46 K ZTDTH,QAM,QAMD0,QAMD1,QAMDATE,QAMMON,QAMMONNM,SCRNFLD,QAOSALL,QAOSDR
47 K DIE,DR,^UTILITY($J,"QAM MONITOR"),^UTILITY($J,"QAO SCREEN")
48 D K^QAQDATE S:$D(ZTQUEUED) ZTREQ="@"
49 Q
50SCRNFLD ;;TOTAL FIELD FOR EACH SCREEN IN FILE #741.99
511010 ;;1
521011 ;;1.1
531020 ;;2
541030 ;;3
551041 ;;4.1
561042 ;;4.2
571051 ;;5.1
581052 ;;5.2
591061 ;;6.1
601062 ;;6.2
611070 ;;7
621080 ;;8
631090 ;;9
641990 ;;99
Note: See TracBrowser for help on using the repository browser.