Concepts of Auditing |
Content |
||||||||||||||||||
|
Overview |
|
|
LabVantage provides these Auditing utilities:
• | SDC Auditing |
• | Dynamic Auditing |
• | AuditView Pages |
SDC Auditing |
|
|
Overview |
"SDC Auditing" refers to the ongoing processes that record changes made to SDIs. SDC Auditing is enabled and configured for each SDC by the "Security/Update Options" for the relevant SDC (see SDCs → SDC Primary → Security/Update Options).
Audit Tables |
When you enable Auditing for an SDC, LabVantage creates a duplicate set of data in an "Audit table". The name of the Audit table is identical to that of the table supporting the SDC, except that the Audit table name is preceded by the letter "a" followed by an underscore (such as a_s_sample). The Audit table tracks each change made to the SDI:
The original table maintains the last changes:
With regard to modification of existing records, these are the principal Auditing columns for each audited record:
• | "ModBy" is the User who last modified the SDI. |
• | "AuditSequence" shows the number of times the table has been modified. When you change an SDI, the Audit table updates by appending the new record to its list of old records. The Audit Sequence in the original SDI then increments to the next highest number. |
• | "TraceLogId" refers to the record in the TraceLog table. |
TraceLog Table |
The TraceLog table maintains a collection of reasons for each change.
TRACELOGID | TRACELOGDESC | SDCID | KEYID1 | REASON | ACTIVITY | SIGNEDFLAG |
68 | Data editing | Sample | S-091229-00001 | SampleCreated | DataEdit | N |
71 | Data editing | Sample | S-091229-00001 | Saved Sample | Save | Y |
These three columns are of particular significance:
Column | Description |
Reason | This is the reason for the change. If the change requires an ESig (Electronic Signature), this is the reason you have chosen. If the change does not require an ESig, the system generates the reason. |
Activity | This is the system-generated description of the audited event (such as "DataEdit" or "Save"). This column can be conditionally populated using the Save Button Activity property of the advancedtoolbar Element. |
SignedFlag | If the change requires an ESig (Electronic Signature), this value is "Y". If the change does not require an ESig, this value is "N". |
A number of System Actions let you pass values into these columns using their "auditreason", "auditactivity," and "auditsignedflag" properties.
When records are added or changed, Audit triggers look for a TraceLogId in the current database session. If found, all records being added or changed in that transaction are updated with the TraceLogId. This ensures that all updates in a single transaction have the same TraceLogId.
To accomplish this, the TraceLogId is set into the database session using the stored procedure lv_app.setappinfotracelog('<tracelogid>'). After the transaction is complete, the TraceLogId is unset from the database session. This prevents a TraceLogId from being used in other rows of different transactions.
Dynamic Auditing |
|
|
Overview |
"Dynamic Auditing" is a supplemental auditing feature that records changes made before saving in the "ActivityLog" table. This feature is currently supported for the items listed below, and is enabled/disabled using the property specified for each.
Element, Page Type, or Policy | Property and Description | Dynamic Auditing Example | ESig Prompt Example | ||||||||
MaintenanceForm Page Type | Dynamic Auditing is configured by the "Enable Dynamic
Audit" property:
|
SDI Maintenance Examples | ESig Prompt Examples | ||||||||
maint Element | Dynamic Auditing is configured by the "Enable Dynamic
Audit" property:
|
||||||||||
maintattribute Element | Dynamic Auditing is configured by the "Enable Dynamic
Audit" property:
|
||||||||||
MultiSDIAttributeMaint Page Type | Dynamic Auditing is configured by the "Enable Dynamic
Audit" property:
|
SDI Attributes Example | |||||||||
Data Entry Policy | Dynamic Auditing is configured by the "Enable Dynamic
Audit of Result Entry" property:
|
Data Entry Example |
NOTE: | In the examples that follow, the ActivityLog has been filtered to show columns that are relevant to each discussion. |
SDI Maintenance Examples |
When editing Elements in pages based on the MaintenanceForm Page Type, the ActivityLog can record changes made to the Element before the page is saved. To see the auditing mechanics, this example uses the sdidetailmaint (dataset) Element for the Sample Maintenance page (SampleMaint (R5)). We assume Dynamic Auditing is enabled using an appropriate combination of property values described in the Overview (such as setting "Enable Dynamic Audit" for the MaintenanceForm Page Type to "Yes" for the Sapphire Product node).
1. | Create a Sample, but do not add any details to it (such as Tests). |
2. | Add a Test to the Sample, but do not save the page. |
If you view the ActivityLog, you will see that it records the change in the "ActivityType" column ("Detail_Add") even though the page is not saved:
![]() |
Next:
1. | Save the changes. |
2. | Remove a Test, but do not save the page. |
The "ActivityType" column shows the change recorded as "Detail_Delete".
![]() |
Reload the page without saving (so the delete never actually happened). Even though the Test was never actually removed, the ActivityLog continues to show "Detail_Delete", indicating that the User did (in fact) go through the removal process in the interface.
Note that this also records changes made with the "Move Up" and "Move Down" buttons. The last row shows the result of moving a selected Test up one row:
![]() |
Note that the "ActivityGroup" column shows activities that were done together. In the example below, 3 Tests are added at once without saving, so they have the same number in the ActivityGroup column. Whenever the values in ActivityGroup are the same, this means that the changes were done in single User activity.
![]() |
Dynamic Auditing also works on field values. Changing the "Description" audits the change when you change an existing (non-null) value in a field, then move focus away from the field.
![]() |
SDI Attributes Example |
When Attribute values are entered for multiple SDIs, the ActivityLog can record each change before saving. In this example, "Enable Dynamic Audit" is set to "Yes" for the MultiSDIAttributeMaint Page Type.
![]() |
Data Entry Example |
Dynamic Auditing can also be done during Data Entry. In this example, "Enable Dynamic Audit of Result Entry" is set to "Yes" in the Data Entry Policy. During Data Entry, nothing is audited when you enter or change a data value while focus is maintained on the cell. The change is recorded in the ActivityLog when you move focus away from the cell.
![]() |
The example below shows Dynamic Auditing in response to data sent from an Instrument.
![]() |
ESig Prompt Examples |
"Yes (Prompt for Change Reason)" for the Page Types, Elements, and Policy described in the Overview issues an ESig prompt when you change an existing (non-null) value in a field (or Data Entry cell), then move focus away from the field (or cell). Answering the ESig prompt records the change and reason in the ActivityLog table. An ESig prompt is not issued if you enter a value into a blank field (or cell). When ESig Prompt is enabled for detail Elements (as indicated in the Overview), an ESig prompt is not triggered each time a row is moved up or down.
Here is an example of an ESig prompt configured in a Maintenance Form:
![]() |
Here is an example of an ESig prompt configured for Data Entry:
![]() |
AuditView Pages |
|
|
Audit information is rendered by "AuditView" pages. These open for a selected SDI when the "View Audit" button is clicked. This button is rendered only on pages that support SDC Auditing (enabled and configured for each SDC by the "Security/Update Options" for the relevant SDC (see SDCs → SDC Primary → Security/Update Options) and are configured to include this button in the page's advancedtoolbar Element.
AuditView pages show changes recorded by both the SDC Auditing and Dynamic Auditing processes (but only if Dynamic Auditing is enabled as described in the Dynamic Auditing Overview). If Dynamic Auditing is enabled, changes recorded through Dynamic Auditing are identified by the icons below. Clicking an icon shows the activity recorded by Dynamic Auditing in the ActivityLog table as shown in the examples in Dynamic Auditing.
Dynamic Auditing Icon | Type of Activity | Description of Activity |
Green double chevron | General Activity | A change made to a field was the only change recorded. For example, if you make a single change to a Sample Description and save without changing anything else, this creates a record in the Audit table (for SDC Auditing) as well as a record in the ActivityLog (for Dynamic Auditing). |
Orange double chevron | Special Activity | Several changes were made to a field before saving. For example, if you change a Sample Description several times before saving, the Audit table records the last change, but the ActivityLog records all changes made to the Description prior to the save. |
Red double chevron | Unsaved Activity | Changes were made to one or more fields but the page was exited without saving. This can convert to a Special Activity when another User (or the same User) revisits the page, makes other changes, then saves. Note that the ActivityLog records an ActivityDate value. If no record was cut after the ActivityDate, that audit activity is an Unsaved activity. |
These scenarios are shown in the example below. A new Sample is created and the following edits are made in the Sample Maintenance page:
1. | First, a "General Activity" is performed. The Description is changed from (null) to "Initial Edit", then the page is saved. |
2. | Next, a "Special Activity" is performed. The Description is changed from "Initial Edit" to "Secondary Edit". The User tabs out of the field, but re-enters and changes the Description again to "Tertiary Edit", then saves the page. |
3. | Finally, an "Unsaved Activity" is performed. The Decription is changed from "Tertiary Edit" to "Quaternary Edit". The User then navigates out of the page without saving. |
The Audit tables for SDC Auditing show the changes between saves: the initial Sample creation, the change to "Initial Edit", and the change to "Tertiary Edit". Note that the change to "Secondary Edit" in step 2 is not shown.
![]() |
Clicking the Dynamic Auditing icon shows the changes recorded in the ActivityLog:
1. | The "General Activity" resulting from the first Description change from (null) to "Initial Edit" followed by a save. |
2. | The "Special Activity" resulting from the change from "Initial Edit" to "Secondary Edit", tabbing out and back in, changing to "Tertiary Edit", then saving. |
3. | The "Unsaved Activity" resulting from the change from "Tertiary Edit" to "Quaternary Edit" and exiting page without saving. |
![]() |
The Auditview Page contains these additional features:
• | Clicking the row banner shows/hides the audit section to provide an alternative to clicking the +/- icons. |
• | Rows are highlighted onMouseOver. |
The following toolbar buttons are provided:
Toolbar Button | Description | |
Toggle View | Toggles between the view shown in the previous example
(chronological changes) to an "AuditRow" view as shown below.
Columns that have all values as (null) are ignored in this view. Changed
values between SDC Auditing recorded in the Audit table are highlighted.
|
|
Expand All Collapse All |
Expands/collapses all sections. | |
Opens a browser print dialog. | ||
Close | Closes the browser window. |
Operation Timestamps |
|
|
"Operation Timestamps" are recorded for several SDCs. These record information that identifies when a User executed a specific operation (such as transitioning an SDI to "Cancelled" state). The SDCs listed below provide the specified timestamps out-of-the-box.
SDC | Timestamp Column | Populated when transitioning to: | Cleared when: |
Batch | CancelledDt, CancelledBy | Cancelled | UnCancelled |
HoldDt, HoldBy | OnHold | Off Hold | |
Request | CancelledDt, CancelledBy | Cancelled | UnCancelled |
HoldDt, HoldBy | OnHold | Off Hold | |
DataSet (SDIData) |
StartedDt, StartedBy | InProgress | N/A |
SDIWorkitem | StartedDt, StartedBy | InProgress | N/A |
CancelledDt, CancelledBy | Cancelled | UnCancelled | |
Sample | CancelledDt, CancelledBy | Cancelled | UnCancelled |