source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUSPURGE.m@ 1800

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

initial load of WorldVistAEHR

File size: 1.8 KB
RevLine 
[613]1XUSPURGE ;SFISC/STAFF - PURGE ROUTINE FOR XUSEC ;08/27/2003 15:26
2 ;;8.0;KERNEL;**180,312**;Jul 10, 1995
3SCPURG ;Purge sign-on log to 30 days
4 N XU1,XU2,XUDT,DIK,DA
5 S XUDT=$$FMADD^XLFDT(DT,-30) ;Set the limit
6 I $O(^XUSEC(0,0))'>0 G SCEXIT
7 S DIK="^XUSEC(0,"
8 F DA=0:0 S DA=$O(^XUSEC(0,DA)) Q:(DA'>0)!(DA>XUDT) D
9 . S XU1=+$G(^XUSEC(0,DA,0))
10 . D ^DIK
11 . ;Make sure the CUR X-ref is cleared.
12 . I XU1 K ^XUSEC(0,"CUR",XU1,DA)
13 . Q
14SCEXIT K DIK,DA,XUDT,X1,X2
15 Q
16 ;
17AOLD ;
18 N DIRUT,DIR,XUT,XUDAYS,XUDT,XUI,XUJ,XUK,X
19 I $D(ZTQUEUED) D Q
20 . S X=$G(ZTQPARAM),X=$S(X<270:270,1:X) D A02(X),V02(X)
21 . Q
22 W !!,"This option will purge the log of inactive access and verify codes ",!,"older than the date specified to allow for their re-use."
23 S DIR("A")="Do you wish to continue",DIR(0)="Y",DIR("B")="NO" D ^DIR G:$D(DIRUT)!(Y'=1) ENDA
24DAYS K DIR S DIR("A")="How far back do you wish to retain codes",DIR("A",1)="VHA has set the minimum time to keep old codes at 270 days.",DIR("B")=270
25 S DIR("?")="Enter the number of days indicating at what date codes should be purged.",DIR(0)="N^270:400"
26 D ^DIR Q:$D(DIRUT)
27 D A02(X),V02(X)
28 Q
29 ;
30A02(XUDAYS) ;Purge old Access codes in the AOLD x-ref.
31 N XUT,XUI,XUJ,XUK,XUDT
32 S XUT=0,XUDT=$H-XUDAYS,XUI=""
33 F S XUI=$O(^VA(200,"AOLD",XUI)) Q:XUI="" S XUJ=$O(^(XUI,0)) S XUK=^(XUJ) I XUK<XUDT K ^VA(200,"AOLD",XUI,XUJ) S XUT=XUT+1 W:'$D(ZTQUEUED) "."
34 I '$D(ZTQUEUED) W !!,$S('XUT:"No",1:XUT)," old access codes have been purged."
35 Q
36 ;
37V02(XUDAYS) ;Purge old Verify code from each users VOLD x-ref
38 N XUT,XUI,XUJ,XUK,XUDT
39 S XUT=0,XUDT=$H-XUDAYS,XUI=0
40 F S XUI=$O(^VA(200,XUI)) Q:XUI'>0 S XUK="" D
41 . F S XUK=$O(^VA(200,XUI,"VOLD",XUK)) Q:XUK="" I ^(XUK)<XUDT K ^VA(200,XUI,"VOLD",XUK) S XUT=XUT+1 W:'$D(ZTQUEUED) "."
42 I '$D(ZTQUEUED) W !!,$S('XUT:"No",1:XUT)," old verify codes have been purged."
43 Q
44ENDA K DIRUT,DIR,XUT,XUDAYS,XUDT,XUI,XUJ,XUK
45 Q
Note: See TracBrowser for help on using the repository browser.