source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DIPR120.m@ 642

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1DIPR120 ;O-OIFO/SO-Move PRIORDATE, PRIORUSER, & PRIORVALUE To FM's #;10:20 AM 12 Dec 2002
2 ;;22.0;VA FileMan;**120**;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 N COUNT,X,IEN,SADAT,SAVAL,SAUSER
5 S X="Beginning Pre-Installation..." D MES^XPDUTL(X)
6 S COUNT=0
7 D RPDATE,RPUSER,RPVAL
8 S X=" " D MES^XPDUTL(X)
9 I '$D(SADAT) D APDATE
10 I '$D(SAUSER) D APUSER
11 I '$D(SAVAL) D APVAL
12 D END
13 Q
14RPDATE ; Find & Remove PRIORDATE
15 I $D(^DD("FUNC",91,0))#2,$P(^DD("FUNC",91,0),U)="PRIORDATE",'$D(^DD("FUNC",91,1)) S SADAT=1
16 I '$D(SADAT),$D(^DD("FUNC",91,0))#2 D S SADAT=1
17 . N I S I=91 D ERRMES Q
18 S IEN=99
19 F S IEN=$O(^DD("FUNC","B","PRIORDATE",IEN)) Q:'IEN D
20 . I ^DD("FUNC",IEN,9)'="When it has an argument (Fieldname), returns as a multiple all prior Date/Times of auditing, most recent first. Without an argument, it is most recent audited Date/Time for the Entry" Q
21 . S X="Deleting Function PRIORDATE" D MES^XPDUTL(X)
22 . K ^DD("FUNC",IEN)
23 . K ^DD("FUNC","B","PRIORDATE",IEN)
24 . S COUNT=COUNT-1
25 Q
26 ;
27RPUSER ; Find & Remove PRIORUSER
28 I $D(^DD("FUNC",92,0))#2,$P(^DD("FUNC",92,0),U)="PRIORUSER",'$D(^DD("FUNC",92,1)) S SAUSER=1
29 I '$D(SAUSER),$D(^DD("FUNC",92,0))#2 D S SAUSER=1
30 . N I S I=92 D ERRMES Q
31 S IEN=99
32 F S IEN=$O(^DD("FUNC","B","PRIORUSER",IEN)) Q:'IEN D
33 . I ^DD("FUNC",IEN,9)'="When it has an argument (Fieldname), returns as a multiple all prior audited Users, most recent first. Without an argument, it is most recent audited User for the Entry" Q
34 . S X="Deleting Function PRIORUSER" D MES^XPDUTL(X)
35 . K ^DD("FUNC",IEN)
36 . K ^DD("FUNC","B","PRIORUSER",IEN)
37 . S COUNT=COUNT-1
38 Q
39 ;
40RPVAL ; Find & Remove PRIORVALUE
41 I $D(^DD("FUNC",90,0))#2,$P(^DD("FUNC",90,0),U)="PRIORVALUE",'$D(^DD("FUNC",90,1)) S SAVAL=1
42 I '$D(SAVAL),$D(^DD("FUNC",90,0))#2 D S SAVAL=1
43 . N I S I=90 D ERRMES Q
44 S IEN=99
45 F S IEN=$O(^DD("FUNC","B","PRIORVALUE",IEN)) Q:'IEN D
46 . I ^DD("FUNC",IEN,9)'="Takes name of an Audited Field. Returns as a multiple all prior values of the field, most recent first." Q
47 . S X="Deleting Function PRIORVALUE" D MES^XPDUTL(X)
48 . K ^DD("FUNC",IEN)
49 . K ^DD("FUNC","B","PRIORVALUE",IEN)
50 . S COUNT=COUNT-1
51 Q
52 ;
53APDATE ; Add PRIORDATE at IEN 91
54 S X="Installing Function PRIORDATE at #91" D MES^XPDUTL(X)
55 S ^DD("FUNC",91,0)="PRIORDATE"
56 S ^DD("FUNC",91,3)="VARIABLE"
57 S ^DD("FUNC",91,9)="When it has an argument (Fieldname), returns as a multiple all prior Date/Times of auditing, most recent first. Without an argument, it is most recent audited Date/Time for the Entry"
58 S ^DD("FUNC","B","PRIORDATE",91)=""
59 S COUNT=COUNT+1
60 Q
61 ;
62APUSER ; Add PRIORUSER at IEN 92
63 S X="Installing Function PRIORUSER at #92" D MES^XPDUTL(X)
64 S ^DD("FUNC",92,0)="PRIORUSER"
65 S ^DD("FUNC",92,3)="VARIABLE"
66 S ^DD("FUNC",92,9)="When it has an argument (Fieldname), returns as a multiple all prior audited Users, most recent first. Without an argument, it is most recent audited User for the Entry"
67 S ^DD("FUNC","B","PRIORUSER",92)=""
68 S COUNT=COUNT+1
69 Q
70 ;
71APVAL ; Add PRIORVALUE at IEN 90
72 S X="Installing Function PRIORVALUE at #90" D MES^XPDUTL(X)
73 S ^DD("FUNC",90,0)="PRIORVALUE"
74 S ^DD("FUNC",90,9)="Takes name of an Audited Field. Returns as a multiple all prior values of the field, most recent first."
75 S ^DD("FUNC","B","PRIORVALUE",90)=""
76 S COUNT=COUNT+1
77 Q
78 ;
79END I COUNT=0 D ENDMES Q ; Count piece doesn't need updating
80 ; Update 4th piece of Zeroth node
81 L +^DD("FUNC",0):5 S $P(^(0),"^",4)=$P(^DD("FUNC",0),"^",4)+COUNT I L -^DD("FUNC",0)
82 D ENDMES
83 Q
84 ;
85ENDMES ;
86 S X="Done..." D MES^XPDUTL(X)
87 Q
88ERRMES ;
89 S X="The "_$P(^DD("FUNC",I,0),U)_" Function needs to be evaluated by SD&D." D MES^XPDUTL(X)
90 Q
Note: See TracBrowser for help on using the repository browser.