Definition
Information
Section titled “Information”The Carerecord Careplandetail model holds detailed patient care-plan content, including descriptions, clinician notes, consent information and recorded responsibilities. It also stores agreement, activation and review dates, start and end dates, validity dates and version information, alongside patient, care-plan and clinical-context identifiers.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”carerecord.careplandetail with carerecord.careplanchangestate, carerecord.careplan and carerecord.consultationsection details
Section titled “carerecord.careplandetail with carerecord.careplanchangestate, carerecord.careplan and carerecord.consultationsection details”Return records alongside descriptive values from the related tables.
SELECT m."careplandetailid", m."careplanchangestateid", p1."description" AS "careplanchangestate_description", m."careplanid", p2."name" AS "careplan_name", m."consultationsectionid", p3."originalheading" AS "consultationsection_originalheading"FROM carerecord.careplandetail AS mLEFT JOIN carerecord.careplanchangestate AS p1 ON p1."careplanchangestateid" = m."careplanchangestateid" AND p1."organisation" = m."organisation"LEFT JOIN carerecord.careplan AS p2 ON p2."careplanid" = m."careplanid" AND p2."organisation" = m."organisation"LEFT JOIN carerecord.consultationsection AS p3 ON p3."consultationsectionid" = m."consultationsectionid" AND p3."organisation" = m."organisation";Row count by carerecord.careplanchangestate description
Section titled “Row count by carerecord.careplanchangestate description”Count carerecord.careplandetail records for each carerecord.careplanchangestate value, joined on careplanchangestateid.
SELECT p."description" AS "careplanchangestate_description", COUNT(*) AS row_countFROM carerecord.careplandetail AS mINNER JOIN carerecord.careplanchangestate AS p ON p."careplanchangestateid" = m."careplanchangestateid" AND p."organisation" = m."organisation"GROUP BY p."description"ORDER BY row_count DESC;Row count by carerecord.careplan name
Section titled “Row count by carerecord.careplan name”Count carerecord.careplandetail records for each carerecord.careplan value, joined on careplanid.
SELECT p."name" AS "careplan_name", COUNT(*) AS row_countFROM carerecord.careplandetail AS mINNER JOIN carerecord.careplan AS p ON p."careplanid" = m."careplanid" AND p."organisation" = m."organisation"GROUP BY p."name"ORDER BY row_count DESC;