Definition
Information
Section titled “Information”The Dbo Caseloadpatientstatus model holds descriptions of patient statuses within the caseload domain. Each entry records a status identifier and description, together with 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”dbo.patientstatus count per dbo.caseloadpatientstatus
Section titled “dbo.patientstatus count per dbo.caseloadpatientstatus”Count related dbo.patientstatus records for each dbo.caseloadpatientstatus record, joined on caseloadpatientstatusid.
SELECT m."caseloadpatientstatusid", m."caseloadpatientstatusdescription", COUNT(c."caseloadpatientstatusid") AS patientstatus_countFROM dbo.caseloadpatientstatus AS mLEFT JOIN dbo.patientstatus AS c ON m."caseloadpatientstatusid" = c."caseloadpatientstatusid" AND m."organisation" = c."organisation"GROUP BY m."caseloadpatientstatusid", m."caseloadpatientstatusdescription"ORDER BY patientstatus_count DESC;dbo.patientstatus records with dbo.caseloadpatientstatus details
Section titled “dbo.patientstatus records with dbo.caseloadpatientstatus details”List dbo.patientstatus records with the dbo.caseloadpatientstatus values they reference through caseloadpatientstatusid.
SELECT c."patientstatusid", m."caseloadpatientstatusid", m."caseloadpatientstatusdescription" AS "caseloadpatientstatusdescription"FROM dbo.patientstatus AS cINNER JOIN dbo.caseloadpatientstatus AS m ON m."caseloadpatientstatusid" = c."caseloadpatientstatusid" AND m."organisation" = c."organisation";dbo.caseloadpatientstatus records not used by dbo.patientstatus
Section titled “dbo.caseloadpatientstatus records not used by dbo.patientstatus”Find dbo.caseloadpatientstatus records that no dbo.patientstatus record references.
SELECT m."caseloadpatientstatusid", m."caseloadpatientstatusdescription"FROM dbo.caseloadpatientstatus AS mWHERE NOT EXISTS ( SELECT 1 FROM dbo.patientstatus AS c WHERE m."caseloadpatientstatusid" = c."caseloadpatientstatusid" AND m."organisation" = c."organisation");