source: WorldVistAEHR/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XTERPUR.m@ 1373

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1XTERPUR ;ISC-SF.SEA/JLI - DELETE ENTRIES FROM ERROR TRAP ; [8/19/02 10:41am]
2 ;;8.0;KERNEL;**243**;Jul 10, 1995
3 W !!,"To Remove ALL entries except the last N days, simply enter the number N at the",!,"prompt. OTHERWISE, enter return at the first prompt, and a DATE at the",!,"second prompt. If no ending date is entered at the third prompt, then only"
4 W !,"the date specified will be deleted. If an ending date is entered that range",!,"of dates INCLUSIVE will be deleted from the error log.",!!
5 ;
6 R !!,"Number of days to leave in error trap: ",X:DTIME Q:'$T!(X[U) I X'="",X'=+X W:$E(X)'="?" $C(7)," ??" W !?5,"Enter a number (zero or greater) of days to be left in the Error Log.",!,"A RETURN will result in a request for dates" G XTERPUR
7 I X=+X S X=$H-X F I=0:0 S I=$O(^%ZTER(1,I)) Q:I'<X!(I'>0) D KILLDAY(I)
8 I X=+X W !!?10,"DONE" D COUNT
9 R !,"Starting Date to DELETE ERRORS from: ",X:DTIME Q:'$T!(X[U)!(X="") S %DT="EQXP" D ^%DT G:Y'>0 XTERPUR S XTDAT=Y
10 R !,"Ending Date to DELETE ERRORS to: ",X:DTIME I '$T!(X[U) W $C(7)," ??" Q
11 S:X="" X=XTDAT D ^%DT G:Y'>0 XTERPUR S XTDAT1=Y
12 S X=XTDAT D H^%DTC S XTDAT=%H S X=XTDAT1 D H^%DTC S XTDAT1=%H I XTDAT1<XTDAT W $C(7)," ?? CAN NOT BE EARLIER" Q
13 F I=XTDAT-1:0 S I=$O(^%ZTER(1,I)) Q:I'>0!(I>XTDAT1) K ^%ZTER(1,I),^%ZTER(1,"B",I)
14COUNT S X=0,XTDAT=0 F I=0:0 S I=$O(^%ZTER(1,I)) Q:I'>0 S X=X+1,XTDAT=I
15 S $P(^%ZTER(1,0),U,3,4)=$S(X'>0:"",1:XTDAT_U_X)
16 F XTDAT=0:0 S XTDAT=$O(^%ZTER(1,"B",XTDAT)) Q:XTDAT'>0 I '$D(^%ZTER(1,XTDAT)) K ^%ZTER(1,"B",XTDAT)
17 K I,X,XTDAT,XTDAT1
18 Q
19TYPE ;To purge a type of error.
20 N %DT,XTDAT,XTSTR,IX,Y,CNT
21 S %DT="AEX" D ^%DT Q:Y'>1 S XTDAT=+$$FMTH^XLFDT(Y)
22 R !,"ERROR STRING TO LOOK FOR: ",XTSTR:DTIME
23 Q:'$L(XTSTR)
24 S CNT=0 W !
25 F IX=0:0 S IX=$O(^%ZTER(1,XTDAT,1,IX)) Q:IX'>0 D
26 . I $G(^(IX,"ZE"))[XTSTR K ^%ZTER(1,XTDAT,1,IX) W "-" Q
27 . W "." S CNT=CNT+1 Q
28 ;Full reference of ^(IX,"ZE") is ^%ZTER(1,XTDAT,1,IX,"ZE")
29 S $P(^%ZTER(1,XTDAT,0),"^",2)=CNT ;Reset count
30 Q
31AUTO ;Auto clean of error over ZTQPARAM days ago.
32 S:$G(ZTQPARAM)<1 ZTQPARAM=7 S XTDAT=$H-ZTQPARAM
33 F XTDT=0:0 S XTDT=$O(^%ZTER(1,XTDT)) Q:(XTDT'>0)!(XTDT>XTDAT) D KILLDAY(XTDT)
34 Q
35KILLDAY(%H) ;Kill all error on one day
36 L +^%ZTER(1) K ^%ZTER(1,%H),^%ZTER(1,"B",%H) L -^%ZTER(1)
37 Q
Note: See TracBrowser for help on using the repository browser.