Definition
Information
Section titled “Information”The Careplanresource Resource model records care-plan resources and their creation details. Each record holds a resource identifier and GUID, a resource-type identifier and an owning-organisation identifier, together with the recorded creation date and time 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”careplanresource.resource with careplanresource.type and dbo.organisation details
Section titled “careplanresource.resource with careplanresource.type and dbo.organisation details”Return records alongside descriptive values from the related tables.
:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::
SELECT m."resourceid", m."resourcetypeid", p1."description" AS "type_description", m."ownerorganisationid", p2."organisationdisplayname" AS "organisationdisplayname"FROM careplanresource.resource AS mLEFT JOIN careplanresource.type AS p1 ON p1."resourcetypeid" = m."resourcetypeid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.organisation AS p2 ON p2."organisationid" = m."ownerorganisationid" AND p2."organisation" = m."organisation";Row count by careplanresource.type description
Section titled “Row count by careplanresource.type description”Count careplanresource.resource records for each careplanresource.type value, joined on resourcetypeid.
:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::
SELECT p."description" AS "type_description", COUNT(*) AS row_countFROM careplanresource.resource AS mINNER JOIN careplanresource.type AS p ON p."resourcetypeid" = m."resourcetypeid" 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 careplanresource.resource records for each dbo.organisation value, joined on ownerorganisationid.
:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::
SELECT p."organisationdisplayname" AS "organisationdisplayname", COUNT(*) AS row_countFROM careplanresource.resource AS mINNER JOIN dbo.organisation AS p ON p."organisationid" = m."ownerorganisationid" AND p."organisation" = m."organisation"GROUP BY p."organisationdisplayname"ORDER BY row_count DESC;