VA FileMan V. 22.0 Getting Started HTML Manual Banner


 

Main Chapter Getting Started Manual Programmer Manual

Auditing


Auditing a Data Field


Overview

The "ENTER OR EDIT FILE ENTRIES" option is used to add, change, or delete data values. For example, an admission clerk might use the Enter or Edit File Entries option to enter a Date of Birth of  'JAN 20, 1949' for patient Richard Green. Later, a nurse could use the same option to change the value to 'JAN 20, 1950'. You might like to know who made the successive changes and when; the data field audit capability is designed to record this information.

When changes like the ones mentioned above are made to an audited field, the date and time the change was made, the user's name, and the old and new data values are stored in the AUDIT file (#1.1). In other words, starting an audit on a data field provides an ongoing chronological list of who made what changes to data values of fields you are auditing.


Setting a Data Field Audit

To begin auditing data changes in a field, use the Modify File Attributes option, choose the file and fields that should be audited and answer YES or EDITED to the "AUDIT:" prompt. The possible responses to the "AUDIT:" prompt are:

Response Description
YES, ALWAYS Indicates the audit will occur when data is initially entered, changed or deleted.
EDITED OR DELETED Means that the audit only occurs when changes are made or values deleted (not when the data is initially entered).
NO Turns the audit off.
@ Deletes the current audit status (effectively turning audit off), not the field.

The following example initiates a Data Field audit on the DATE OF BIRTH field of the PATIENT file (#2). Only changes to pre-existing data will be recorded:


Select OPTION: MODIFY FILE ATTRIBUTES
DO YOU WANT TO USER THE SCREEN-MODE VERSION? Yes// N (No)

MODIFY WHAT FILE: PATIENT
Select FIELD: DATE OF BIRTH
LABEL:
TITLE:
AUDIT: EDITED EDITED OR DELETED
.
.
.

If you have programmer access, you are also presented with the "AUDIT CONDITION:" prompt. Here, you can restrict the data entries that will be audited. Enter a line of M code that must evaluate true or false. If it evaluates true, an audit record of the value change is made. Otherwise, no auditing is done for that data entry. (See the "Advanced File Definition" chapter in the "VA FileMan Programmer Manual" for more information on the audit condition.)

NOTE: If auditing is not turned on for the field with a YES or EDITED answer to the "AUDIT:" prompt, the field will not be audited, even if code is entered at the "AUDIT CONDITION:" prompt.

22.2Fields with a Data Type of COMPUTED cannot be audited, but all other types of fields, including WORD-PROCESSING fields, are auditable..

In order to initiate an audit of data fields or of a data dictionary, you must have AUDIT access to the files you want to audit. (See the "Data Security" chapter for more information about AUDIT access.)


Turning Data Field Audit On/Off

Users who do not have the Modify File Attributes option (DD access) to files can be given the Turn Data Audit On/Off option. This option is found on VA FileMan's Auditing submenu. It is used to begin or end an audit trail for fields. The user must have AUDIT access to the file to set data audits. No other access is necessary. The Turn Data Audit On/Off option is called DIAUDIT TURN ON/OFF; it can be granted to users with Kernel's menu management options. No other attributes in the field definition can be affected by use of this option.

Use of Turn Data Audit On/Off is very similar to using the Modify File Attributes option:


Select OPTION: OTHER OPTIONS 
Select OTHER OPTION: AUDITING
Select AUDITING OPTION: TURN DATA AUDIT ON/OFF
AUDIT FROM WHAT FILE: PATIENT
Select FIELD: DATE OF BIRTH
AUDIT: EDITED OR DELETED

To end the audit trail, simply re-enter the Turn Data Audit On/Off option and turn the audit off by entering NO at the "AUDIT:" prompt:


AUDIT: EDITED OR DELETED// NO  NO

Reviewing the Data Field Audit Trail

1. CAPTIONED output with audit trail

There are a number of different ways to retrieve audit information.  The simplest is to examine all the audited past values for a particular entry, or a set of entries.  Let's say we are reviewing Patient entries in the PATIENT file.  Using either the Inquire to File Entries or the Print File Entries options, we specify the [CAPTIONED] output.  If the file has audited data on record, we will be asked whether we want to see the audit trail on the patient(s) displayed.

Suppose the PATIENT file has been edited so that patient 'Green' was first assigned a DOB of 1/20/49, but that subsequently this DOB was changed to 1/20/50.


Select OPTION: INQUIRE TO FILE ENTRIES 

OUTPUT FROM WHAT FILE: PATIENT  
Select PATIENT: GREEN,RICHARD
ANOTHER ONE:

STANDARD CAPTIONED OUTPUT? Yes//  (Yes)
Include COMPUTED fields:  (N/Y/R/B): NO// 
- No record number (IEN), no Computed
 Fields
DISPLAY AUDIT TRAIL? No//
YES
NAME: GREEN, RICHARD       DOB: JAN 20, 1950

    Changed from "JAN 20, 1949" on Mar 15, 2001@16:48:53 by User #16

    Created on Mar 13, 2001@19:41:36 by User #330

22.22. Showing Changes by a Specific User

We may want to look at the audit trail by user rather than by entry.   “MONITOR A USER” is now the second auditing option. It shows every entry in a specified audited file touched by a given user. 

Suppose we want to see all entries in File 2 that have been seen by a given User since the beginning of 2016.

Select AUDIT OPTION:    MONITOR A USER

Select a USER who has signed on to this system:   TIMSON,GEORGE     GFT 

Select AUDITED File: PATIENT

START WITH DATE: FIRST// 1 1  (JAN 01, 2016)


PATIENT RECORDS ACCESSED BY TIMSON,GEORGE (DUZ=1)  SINCE JAN 1,2016     Page 1
                             EARLIEST ACCESS       LATEST ACCESS
--------------------------------------------------------------------------------
AMUFNI,THRHFGMH                
4-26-79   CLI666465289   Female
                             APR 22,2016@09:02:19
GV,XGS                         
5-13-62   CLI666315991   Female
                             JAN 28,2016@12:08:35     APR 17,2016@09:39:23
SIPOUOSH,INPNN                 
8-4-33    CLI666352931  Male
                             JAN 9,2016@09:38:23     APR 17,2016@12:00:57

3. Computed-Field FUNCTIONS for retrieving audit changes

Three powerful FUNCTIONS now allow retrieval of audit data.  As with all Computed Expressions, use of these Functions is in the context of a given entry in a given (audited) file. 
    PRIORVALUE(Field_name) returns values of the 'Field_name' field that existed before a change was made.
    PRIORDATE(Field_name) returns the corresponding date/time at which a change to the field value was made.
    PRIORUSER(Field_name) returns the corresponding user number ('DUZ') who made the change to the field value.

Each of these Functions is multi-valued, since the Field value for the entry may have been changed more than once in the past. The Functions "1ST", "2ND", "LAST", "COUNT" can be used with these multiples.  Thus, the Computed Expression COUNT(PRIORVALUE(NAME))>4 means "the NAME on this entry has been changed more than four times in the past".  To find any entry whose NAME used to contain "CLINTON", search for    PRIORVALUE(NAME)["CLINTON"].


4. The AUDIT File

A more specialized way to examine audits is to query the AUDIT file (#1.1) to obtain audit information. The set of all past audited events for a given FileMan file is itself a FileMan file, which can be queried or printed. The entries are identified first by their internal entry number in the AUDIT file, then by the internal entry number of the edited entry from the file being audited, and finally by the date/time of the audited event. Suppose 'GREEN,RICHARD' is the 355th entry in the PATIENT file.

OUTPUT FROM WHAT FILE: PATIENT// 1.1   AUDIT
AUDIT FROM WHAT FILE: PATIENT// 
 elect PATIENT AUDIT:      355      3-15-2001@16:48:53
ANOTHER ONE:  
STANDARD CAPTIONED OUTPUT? YES//  (YES) 
DISPLAY COMPUTED FIELDS? NO// Y (YES)

Responding with YES at the "DISPLAY COMPUTED FIELDS? NO//" prompt shows the AUDIT file's COMPUTED fields: ENTRY NAME, FIELD NAME, OLD VALUE, and NEW VALUE. A NO response will not show these fields.

The following output is produced:

NUMBER: 1                 
INTERNAL ENTRY NUMBER: 355
DATE/TIME RECORDED: JAN 06, 2003@12:42:08 
FIELD NUMBER: 2    USER: PHARMACY,TECH
OLD INTERNAL VALUE: 2490120 DATATYPE OF OLD VALUE: Da
NEW INTERNAL VALUE: 2500120 DATATYPE OF NEW VALUE: Da
ENTRY NAME (c): GREEN,RICHARD FIELD NAME (c): DATE
OLD VALUE (c): JAN 06, 2003 NEW VALUE (c): FEB 03, 2003

If you deleted Green's DATE OF BIRTH, the corresponding entry in File #1.1 would show the NEW VALUE as <deleted>. If the entire entry for Green were deleted, there would be no value for the ENTRY NAME field in any of the audit listings for that entry.  The last audit entry would show <deleted> for the NEW VALUE of the DATE OF BIRTH field.

Since the entries in the Audit file can be sorted just as flexibly as those in any other FileMan file, you could easily, for example, search for all audits that occurred between a range of DATE/TIME RECORDED values.


Tracking Data Field Audits

Use the Fields Being Audited option to list the audited fields from a file or a specified range of files. After selecting the Fields Being Audited option, give a file (or a range) at the "START WITH WHAT FILE:" and "GO TO WHAT FILE:" prompts. You receive a report with the file number, field number, field name, type of field being audited, and the type of audit being performed.

The listing below shows all fields flagged for auditing in a file range:

AUDITED FIELDS                   JAN 20, 2002   10:10   PAGE 1

FILE NUMBER LABEL TYPE AUDIT
---------------------------------------------------------------------

16 2 DOB DATE/TIME YES, ALWAYS
40.5 10 LOCATION POINTER EDITED OR DELETED
1036 1 SEX SET EDITED OR DELETED
1036 7 SSN FREE TEXT YES, ALWAYS

Purging a Data Field Audit Trail

Use the Purge Data Audits option to purge the audit trail. It will purge the records used for auditing data fields for a specified file. Purging audit trails is not an automatic feature; it must be done manually.

You should either 1) turn auditing off on the files you're purging while you're doing the purge, or 2) leave auditing on but purge the file when not many users are on the system. If you purge when auditing is on and people are using the file in question, it is possible that you might end up with incomplete audit records on the audited file.

NOTE: Purged audit records cannot be recovered!

The following dialogue illustrates purging selected records from the audit trail:

Select OPTION: OTHER 
Select OTHER OPTION: AUDITING
Select AUDIT OPTION: PURGE DATA AUDITS
AUDIT FROM WHAT FILE: PATIENT
DO YOU WANT TO PURGE ALL DATA AUDIT RECORDS? NO// 

Answering NO to the 

  "DO YOU WANT TO PURGE ALL DATA AUDIT RECORDS? NO//" 

prompt allows you to specify which entries to purge.

PURGE AUDIT RECORDS BY: INTERNAL ENTRY NUMBER// ??
 Choose from: .001 NUMBER
.01 INTERNAL ENTRY NUMBER
.02 DATE/TIME RECORDED
.03 FIELD NUMBER
.04 USER
.05 RECORD ADDED
.....

You can specify which records to purge by referencing any field in the AUDIT file. You can select the records by using the same criteria available at the "SORT BY:" prompt. See the "Print: How to Print Reports from Files" chapter of the "VA FileMan Getting Started Manual" for more details.

PURGE AUDIT RECORDS BY: INTERNAL ENTRY NUMBER// USER

START WITH USER: FIRST// CHIEFTAIN
GO TO USER: LAST// CHIEFTAIN
WITHIN USER, PURGE AUDIT RECORDS BY:
DEVICE:......

PURGE OF AUDIT DATA: PATIENT FEB 21, 2002 13:26 PAGE 1
 ------------------------------------------------------------------

 4 RECORDS PURGED.

The following dialogue purges all records from the PATIENT file's audit trail:

AUDIT FROM WHAT FILE: PATIENT
DO YOU WANT TO PURGE ALL DATA AUDIT RECORDS?  NO// YES 
ARE YOU SURE? NO// YES

DELETED

 


Reviewed/Updated: October 2016