Definition
Information
Section titled “Information”The Audit Careraudit model records carer audit events associated with patient associates. It holds date stamps, event and before-event XML, activity-context and mode-type identifiers, and a carer-lock flag, together with user-role display information, impersonated-user names and organisation information.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”audit.careraudit with audit.activitycontext, audit.modetype and dbo.patientassociate details
Section titled “audit.careraudit with audit.activitycontext, audit.modetype and dbo.patientassociate details”Return records alongside descriptive values from the related tables.
SELECT m."carerauditid", m."activitycontextid", p1."activitycontextdescription" AS "activitycontextdescription", m."modetypeid", p2."description" AS "modetype_description", m."patientassociateid", p3."displayname" AS "patientassociate_displayname"FROM audit.careraudit AS mLEFT JOIN audit.activitycontext AS p1 ON p1."activitycontextid" = m."activitycontextid" AND p1."organisation" = m."organisation"LEFT JOIN audit.modetype AS p2 ON p2."modetypeid" = m."modetypeid" AND p2."organisation" = m."organisation"LEFT JOIN dbo.patientassociate AS p3 ON p3."patientassociateid" = m."patientassociateid" AND p3."organisation" = m."organisation";Row count by audit.activitycontext activitycontextdescription
Section titled “Row count by audit.activitycontext activitycontextdescription”Count audit.careraudit records for each audit.activitycontext value, joined on activitycontextid.
SELECT p."activitycontextdescription" AS "activitycontextdescription", COUNT(*) AS row_countFROM audit.careraudit AS mINNER JOIN audit.activitycontext AS p ON p."activitycontextid" = m."activitycontextid" AND p."organisation" = m."organisation"GROUP BY p."activitycontextdescription"ORDER BY row_count DESC;Row count by audit.modetype description
Section titled “Row count by audit.modetype description”Count audit.careraudit records for each audit.modetype value, joined on modetypeid.
SELECT p."description" AS "modetype_description", COUNT(*) AS row_countFROM audit.careraudit AS mINNER JOIN audit.modetype AS p ON p."modetypeid" = m."modetypeid" AND p."organisation" = m."organisation"GROUP BY p."description"ORDER BY row_count DESC;