DFaudittrace

DFaudittrace — Used by the DF_ATmods report to read study journal files. DF_ATmods produces an audit trail report showing database modifications for the specified study.

Synopsis

DFaudittrace {-s #} [-d date1[-date2]] [-q] [-r] [-N] [-A] [-I subjectID] [-P #] [-V #] [-f fieldlist] [-v vfence] [-x output.xlsx]

Description

DFaudittrace reads a record from the study journal files, calculates any changes from the previous record for those keys and then outputs the differences to DF_ATmods.

The output from DFaudittrace consists of one or more ASCII records, each having 20 fields. Each field is separated by a pipe-delimiter (|). Field contents depend on:

  1. whether DFaudittrace is describing a new record (type N), a changed field (type C), or a deleted record (type D). This information is found in the first field of each record.

  2. whether DFaudittrace is describing a data record, query record or a reason record. This information is found in the 8th field of each record.

The tables describe each of the 20 fields for each record type (data, query, reason) for each type of change (new record, changed field, deleted record). Fields 1 to 7 are consistent across all records output by DFaudittrace and have been described in the first table. Fields 8 to 20 depend on the record type and the type of change, and are described in tables 2 to 4.

Table 3.3. DFaudittrace Output: Fields 1 to 7

FieldDescription
1Record type (N=new, C=changed field, D=deleted record)
2Date (yyyymmdd)
3Time (hhmmss)
4User
5Subject ID
6Visit
7Plate

Table 3.4. New Records

FieldData RecordsQuery RecordsReason Records
80>0: unique field ID of field on which query is located<0: unique field ID of field on which reason is located
90 (summary), or unique field IDfield number of Query recordfield number of Reason record
10status 1-6, 0=new missed recordstatus 1-6status 1-6
11validation levelvalidation levelvalidation level
12maximum validation level reachedmaximum validation level reachedmaximum validation level reached
13missed record reason code or blankQuery category code 1-6, 21-23 + DFqcproblem_map codesreason code
14missed record reason text or blankQuery usage code 1=internal, 2=externalreason text
15blankblankblank
16blankblankblank
17blank (summary), ordinal field positionordinal field position of data fieldordinal field position of data field
18blank (summary), field namefield name of data fieldfield name of data field
19blank (summary), old decoded label for choice/checkblankblank
20blank (summary), new decoded label for choice/checkblankblank

Table 3.5. Changed Field

FieldData RecordsQuery RecordsReason Records
80>0: unique field ID of field on which query is located<0: unique field ID of field on which reason is located
90 (summary), or unique field IDfield number of Query recordfield number of Reason record
10status 1-6status 1-6status 1-6
11validation levelvalidation levelvalidation level
12maximum validation level reachedmaximum validation level reachedmaximum validation level reached
13blankQuery Category code 1-6, 21-23 + DFqcproblem_map codesreason code
14blankQuery usage code 1=internal, 2=externalreason text
15old valueold valueold value
16new valuenew valuenew value
17ordinal field positionordinal field position of data fieldordinal field position of data field
18field namefield name of data fieldfield name of data field
19blank, old decoded label for choice/checkblankblank
20blank, new decoded label for choice/checkblankblank

Table 3.6. Deleted Record

FieldData RecordsQuery RecordsReason Records
80>0: unique field ID of field on which query is located<0: unique field ID of field on which reason is located
90 (summary), or unique field IDfield number of Query recordfield number of Reason record
10status 7status 7status 7
11validation levelvalidation levelvalidation level
12maximum validation level reachedmaximum validation level reachedmaximum validation level reached
131=missed record, 0=data recordQuery category code 1-6, 21-23 + DFqcproblem_map codesreason code
14blankQuery usage code 1=internal, 2=externalreason text
15blankblankblank
16blankblankblank
17blank (summary), ordinal field positionordinal field position of data fieldordinal field position of data field
18blank (summary), field namefield name of data fieldfield name of data field
19blankblankblank
20blankblankblank

It is also important to note the following about DFaudittrace:

  1. If a record or a query is deleted and then re-created, the re-created record or query is considered to be new record (N), not a change (C) to the previous record.

  2. In queries, the user is sometimes, but not always set when a query is created by the user. The user is never set when the query is modified or deleted, or when it is created by the report DF_QCupdate. Unknown user names appear in the output as unknown for dates before June 1, 1995 and as ?? thereafter.

  3. In queries, the validation level is set when the record is created and reset when the record is modified. The validation level of a query does not change when only the record's validation level changes.

  4. If the -v vfence option is used when running DFaudittrace, the effect is different for data records and queries. Data changes are output for records journaled after the case reached or surpassed the vfence validation level. Query changes are output for queries journaled after the query was modified at or beyond the vfence validation level.

Options

-s #

DFdiscover study number.

-d date1[-date2]

date of changes. This option restricts the output to changes made at date1, unless date2 is also specified, in which case the output is the list of changes made between date1 and date2. Dates are specified in the format yyyymmdd and may include the word today to represent the current date.

-q

include query details.

-r

include reason for change details.

-N

include all field details for type N (new) records.

-A

output the subject alias, if defined, in place of the subject ID. If there is no subject alias, output the subject ID.

-I #

Subject ID.

-P #

DFdiscover plate number.

-V #

DFdiscover visit or sequence number.

-f fieldlist

field number(s). This option restricts the output to the field numbers specified in the list. This may include a single field number, or a range or list of numbers. Range and list specifications may include a dash (-), tilde (~), or comma(,).

-v vfence

validation level. In order to be considered for output, the keys on this record must have attained or surpassed the specified validation level at least once. This is useful if the user wants to output all changes that were made to records that have existed at or above the specified validation level. Once the record keys have made it to the vfence level, further changes will be output even if the record subsequently drops to a validation level below the vfence value.

-x output.xlsx

Excel output file. Write the output, in Excel format, to the named file. The Excel file contains the same output, 20 columns per row, as the standard output. It includes one additional header row, with column names.

Exit Status

DFaudittrace exits with one of the following statuses:

0

The command was successful.

1

The command failed because the command-line arguments were not present or were incorrectly specified, the database server could not be contacted, or communication with the database server failed.

Examples

Example 3.7.  Execute DFaudittrace to output journal information for study 254 between the dates of January 1, 2001 and January 15, 2001.

% DFaudittrace -s 254 -d 20010101~20010115

Example 3.8.  Execute DFaudittrace to output journal information for study 254 between the dates of January 1, 1998 and today, for field numbers 10-13.

% DFaudittrace -s 254 -d 19980101-today -f 10-13

Example 3.9.  Execute DFaudittrace to output all journal information for study 254, for records that have existed at or above a validation level of 2 at some point during the study.

% DFaudittrace -s 254 -v 2

Example 3.10.  Execute DFaudittrace to generate an Excel file containing all changes for data related to subject 44002.

% DFaudittrace -s 254 -I 44002 -o 44002history.xlsx