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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1XUSECAD ;SFISC/SO- TERMINATED USERS AUDIT DISPLAY ;10:59 AM 23 Apr 2004
2 ;;8.0;KERNEL;**332**;Jul 10, 1995
3EP1 ;Ask user Beginning and Ending report dates
4 W !,"Terminated User Audit Report"_$S($D(XUSECU):" Uparrow Delimited",1:"")
5 N BD,ED
6BD ;Get Beginning Date
7 N DIR,DTOUT,DUOUT,DIRUT
8 S DIR(0)="DA^2600101:"_DT_":EX"
9 S DIR("A")="Enter the Beginning Date for report: "
10 S DIR("?")="^D HELP^%DTC"
11 S DIR("??")="^D HELP^%DTC"
12 D ^DIR
13 I 'Y Q ;User Timed out, '^' out, etc.
14 S BD=",,"_Y
15ED ;Get Ending Date
16 N DIR,DTOUT,DUOUT,DIRUT
17 S DIR(0)="DA^2600101:"_DT_":EX"
18 S DIR("A")="Enter the Ending Date for report: "
19 S DIR("?")="^D HELP^%DTC"
20 S DIR("??")="^D HELP^%DTC"
21 D ^DIR
22 I 'Y Q ;User Timed out, '^' out, etc.
23 S ED=",,"_Y
24 K DIR,DTOUT,DUOUT,DIRUT
25 I $D(XUSECU) D UPARROW K XUSECU Q
26REPORT ;Do the report
27 N L,DIC,FR,TO,BY,FLDS,DIOBEG,DIOEND
28 N DIA ;Special New For AUDIT file
29 S DIOBEG="D BEG^XUSECAD"
30 S DIOEND="D END^XUSECAD"
31 S L=0
32 S DIC="^DIA(200,"
33 S FR=BD,TO=ED,(BY,FLDS)="[XUSEC TERMINATION REPORT]"
34 D EN1^DIP
35 Q
36 ;
37QUEUE ;Queued report for last 7 days
38 S BD=",,"_$$FMADD^XLFDT(DT,-8)
39 S ED=",,"_$$FMADD^XLFDT(DT,-1)
40 D REPORT
41 K BD,ED
42 Q
43BEG ; Initialize
44 ; XUSECF = 0 - User changed
45 ; 1 - Same user
46 I $G(XUSECO)="" S (XUSECF,XUSECO)=0
47 Q
48END ; Kill variables
49 K XUSECF,XUSECO
50 Q
51TEST ; Test if user changed
52 I 'XUSECO S XUSECO=DIPA("NPIEN") Q
53 I XUSECO=DIPA("NPIEN") S XUSECF=1 Q
54 S XUSECO=DIPA("NPIEN")
55 S XUSECF=0 ;User changed
56 Q
57USERH ; Stadic User Information
58 N IEN,DIERR,Z,ZERR
59 S IEN=DIPA("NPIEN"),IEN=IEN_"," ; Get IEN in file 200
60 ; Get Name (.01)
61 ; Get SSN (9)
62 ; Get Service/Section (29)
63 ; Get Date Entered (30)
64 D GETS^DIQ(200,IEN,".01;9;29;30","","Z","ZERR")
65 W !,"User: "_$G(Z(200,IEN,.01))_" SSN: "_$G(Z(200,IEN,9))
66 W !,"Date Entered: "_$G(Z(200,IEN,30))_" Service/Section: "_$G(Z(200,IEN,29))
67 K DIERR,Z,ZERR
68 D GETS^DIQ(200,IEN,"16*","","Z","ZERR") ;Get Division multiple
69 I '$D(Z(200.02)) W !?4,"Division: None Listed" Q
70 S IEN=""
71 F S IEN=$O(Z(200.02,IEN)) Q:IEN="" W !?4,"Division: "_$G(Z(200.02,IEN,.01))_" Default: "_$S($G(Z(200.02,IEN,1))["Y":"Yes",1:"No")
72 Q
73 ;
74 Q
75 ;
76TERM S X=$S(DIPA("OVALUE")="<no previous value>":"Terminated",1:"Reactivated")
77 Q
78 ;
79MENU N IEN,DIERR,Z,ZERR
80 S IEN=$$FIND1^DIC(19,"","X",DIPA("MIEN"),"B","","ZERR")
81 S IEN=IEN_","
82 D GETS^DIQ(19,IEN,".01;1","","Z","ZERR")
83 S X=$G(Z(19,IEN,1))_"["_$G(Z(19,IEN,.01))_"]"
84 Q
85 ;
86UPARROW ; Uparrow delimited report
87 N L,DIC,FR,TO,BY,FLDS
88 N DIA ;Special New For AUDIT file
89 S L=0
90 S DIC="^DIA(200,"
91 S FR=BD,TO=ED,BY="[XUSEC TERMINATION REPORT]",FLDS="[XUSEC UPARROW TERM REPORT]"
92 D EN1^DIP
93 Q
94 ;
95UPRPT ; Build Uparrow report line
96 N MIEN,NPIEN,DIERR,Z,ZERR
97 S NPIEN=DIPA("NPIEN"),NPIEN=NPIEN_"," ; Get IEN in file 200
98 D GETS^DIQ(200,NPIEN,".01;9;29;30","","Z","ZERR") ;Get New Person Info
99 S MIEN=$$FIND1^DIC(19,"","X",DIPA("MIEN"),"B","","ZERR")
100 S MIEN=MIEN_","
101 D GETS^DIQ(19,MIEN,".01;1","","Z","ZERR")
102LINE ; Build Report Line
103 N LN S LN=""
104 S LN=LN_$G(Z(200,NPIEN,.01))_U_$G(Z(200,NPIEN,9))_U_$G(Z(200,NPIEN,30))_U
105 S LN=LN_$G(Z(200,NPIEN,29))_U_$$FMTE^XLFDT(DIPA("DTR"),"1P")_U
106 S LN=LN_$S(DIPA("OVALUE")="<no previous value>":"Terminated",1:"Reactivated")_U
107 S LN=LN_DIPA("USER")_U_$G(Z(19,MIEN,1))_"["_$G(Z(19,MIEN,.01))_"]"
108 S X=LN
109 Q
Note: See TracBrowser for help on using the repository browser.