Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DIPR120

DIPR120.m

Go to the documentation of this file.
  1. DIPR120 ;O-OIFO/SO-Move PRIORDATE, PRIORUSER, & PRIORVALUE To FM's #;10:20 AM 12 Dec 2002 [ 12/09/2003 4:47 PM ]
  1. ;;22.0;VA FileMan;**120,1002**;Mar 30, 1999
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. N COUNT,X,IEN,SADAT,SAVAL,SAUSER
  1. S X="Beginning Pre-Installation..." D MES^XPDUTL(X)
  1. S COUNT=0
  1. D RPDATE,RPUSER,RPVAL
  1. S X=" " D MES^XPDUTL(X)
  1. I '$D(SADAT) D APDATE
  1. I '$D(SAUSER) D APUSER
  1. I '$D(SAVAL) D APVAL
  1. D END
  1. Q
  1. RPDATE ; Find & Remove PRIORDATE
  1. I $D(^DD("FUNC",91,0))#2,$P(^DD("FUNC",91,0),U)="PRIORDATE",'$D(^DD("FUNC",91,1)) S SADAT=1
  1. I '$D(SADAT),$D(^DD("FUNC",91,0))#2 D S SADAT=1
  1. . N I S I=91 D ERRMES Q
  1. S IEN=99
  1. F S IEN=$O(^DD("FUNC","B","PRIORDATE",IEN)) Q:'IEN D
  1. . 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
  1. . S X="Deleting Function PRIORDATE" D MES^XPDUTL(X)
  1. . K ^DD("FUNC",IEN)
  1. . K ^DD("FUNC","B","PRIORDATE",IEN)
  1. . S COUNT=COUNT-1
  1. Q
  1. ;
  1. RPUSER ; Find & Remove PRIORUSER
  1. I $D(^DD("FUNC",92,0))#2,$P(^DD("FUNC",92,0),U)="PRIORUSER",'$D(^DD("FUNC",92,1)) S SAUSER=1
  1. I '$D(SAUSER),$D(^DD("FUNC",92,0))#2 D S SAUSER=1
  1. . N I S I=92 D ERRMES Q
  1. S IEN=99
  1. F S IEN=$O(^DD("FUNC","B","PRIORUSER",IEN)) Q:'IEN D
  1. . 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
  1. . S X="Deleting Function PRIORUSER" D MES^XPDUTL(X)
  1. . K ^DD("FUNC",IEN)
  1. . K ^DD("FUNC","B","PRIORUSER",IEN)
  1. . S COUNT=COUNT-1
  1. Q
  1. ;
  1. RPVAL ; Find & Remove PRIORVALUE
  1. I $D(^DD("FUNC",90,0))#2,$P(^DD("FUNC",90,0),U)="PRIORVALUE",'$D(^DD("FUNC",90,1)) S SAVAL=1
  1. I '$D(SAVAL),$D(^DD("FUNC",90,0))#2 D S SAVAL=1
  1. . N I S I=90 D ERRMES Q
  1. S IEN=99
  1. F S IEN=$O(^DD("FUNC","B","PRIORVALUE",IEN)) Q:'IEN D
  1. . 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
  1. . S X="Deleting Function PRIORVALUE" D MES^XPDUTL(X)
  1. . K ^DD("FUNC",IEN)
  1. . K ^DD("FUNC","B","PRIORVALUE",IEN)
  1. . S COUNT=COUNT-1
  1. Q
  1. ;
  1. APDATE ; Add PRIORDATE at IEN 91
  1. S X="Installing Function PRIORDATE at #91" D MES^XPDUTL(X)
  1. S ^DD("FUNC",91,0)="PRIORDATE"
  1. S ^DD("FUNC",91,3)="VARIABLE"
  1. 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"
  1. S ^DD("FUNC","B","PRIORDATE",91)=""
  1. S COUNT=COUNT+1
  1. Q
  1. ;
  1. APUSER ; Add PRIORUSER at IEN 92
  1. S X="Installing Function PRIORUSER at #92" D MES^XPDUTL(X)
  1. S ^DD("FUNC",92,0)="PRIORUSER"
  1. S ^DD("FUNC",92,3)="VARIABLE"
  1. 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"
  1. S ^DD("FUNC","B","PRIORUSER",92)=""
  1. S COUNT=COUNT+1
  1. Q
  1. ;
  1. APVAL ; Add PRIORVALUE at IEN 90
  1. S X="Installing Function PRIORVALUE at #90" D MES^XPDUTL(X)
  1. S ^DD("FUNC",90,0)="PRIORVALUE"
  1. S ^DD("FUNC",90,9)="Takes name of an Audited Field. Returns as a multiple all prior values of the field, most recent first."
  1. S ^DD("FUNC","B","PRIORVALUE",90)=""
  1. S COUNT=COUNT+1
  1. Q
  1. ;
  1. END I COUNT=0 D ENDMES Q ; Count piece doesn't need updating
  1. ; Update 4th piece of Zeroth node
  1. L +^DD("FUNC",0):5 S $P(^(0),"^",4)=$P(^DD("FUNC",0),"^",4)+COUNT I L -^DD("FUNC",0)
  1. D ENDMES
  1. Q
  1. ;
  1. ENDMES ;
  1. S X="Done..." D MES^XPDUTL(X)
  1. Q
  1. ERRMES ;
  1. S X="The "_$P(^DD("FUNC",I,0),U)_" Function needs to be evaluated by SD&D." D MES^XPDUTL(X)
  1. Q