Skip to content
Partner Developer Portal

Definition

The Patientadmin Activityconfigurationhistory model records historical patient-administration activity configuration details. Each history entry holds the definition, description, API name, author details and creation date, alongside configuration, folder, organisation and status identifiers, a custom-API flag and an identifier for the history entry.

_deleted indicates whether the record has been deleted in the source system.

patientadmin.activityconfigurationhistory with patientadmin.folder, dbo.organisation and appointment.status details

Section titled “patientadmin.activityconfigurationhistory with patientadmin.folder, dbo.organisation and appointment.status details”

Return records alongside descriptive values from the related tables.

SELECT
m."_primary_key",
m."folderid",
p1."description" AS "folder_description",
m."organisationid",
p2."organisationdisplayname" AS "organisationdisplayname",
m."statusid",
p3."description" AS "status_description"
FROM patientadmin.activityconfigurationhistory AS m
LEFT JOIN patientadmin.folder AS p1
ON p1."folderid" = m."folderid"
AND p1."organisation" = m."organisation"
LEFT JOIN dbo.organisation AS p2
ON p2."organisationid" = m."organisationid"
AND p2."organisation" = m."organisation"
LEFT JOIN appointment.status AS p3
ON p3."statusid" = m."statusid"
AND p3."organisation" = m."organisation";

Row count by patientadmin.folder description

Section titled “Row count by patientadmin.folder description”

Count patientadmin.activityconfigurationhistory records for each patientadmin.folder value, joined on folderid.

SELECT
p."description" AS "folder_description",
COUNT(*) AS row_count
FROM patientadmin.activityconfigurationhistory AS m
INNER JOIN patientadmin.folder AS p
ON p."folderid" = m."folderid"
AND p."organisation" = m."organisation"
GROUP BY p."description"
ORDER BY row_count DESC;

Row count by dbo.organisation organisationdisplayname

Section titled “Row count by dbo.organisation organisationdisplayname”

Count patientadmin.activityconfigurationhistory records for each dbo.organisation value, joined on organisationid.

SELECT
p."organisationdisplayname" AS "organisationdisplayname",
COUNT(*) AS row_count
FROM patientadmin.activityconfigurationhistory AS m
INNER JOIN dbo.organisation AS p
ON p."organisationid" = m."organisationid"
AND p."organisation" = m."organisation"
GROUP BY p."organisationdisplayname"
ORDER BY row_count DESC;