Definition
Information
Section titled “Information”The Referralmanagement Taskstatus model holds descriptions of referral task statuses. Each entry records a task-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”referralmanagement.workflowtask count per referralmanagement.taskstatus
Section titled “referralmanagement.workflowtask count per referralmanagement.taskstatus”Count related referralmanagement.workflowtask records for each referralmanagement.taskstatus record, joined on taskstatus.
:::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."taskstatusid", m."description", COUNT(c."taskstatus") AS workflowtask_countFROM referralmanagement.taskstatus AS mLEFT JOIN referralmanagement.workflowtask AS c ON m."taskstatusid" = c."taskstatus" AND m."organisation" = c."organisation"GROUP BY m."taskstatusid", m."description"ORDER BY workflowtask_count DESC;referralmanagement.workflowtask records with referralmanagement.taskstatus details
Section titled “referralmanagement.workflowtask records with referralmanagement.taskstatus details”List referralmanagement.workflowtask records with the referralmanagement.taskstatus values they reference through taskstatus.
:::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 c."_primary_key", c."spinerequestdatetime", m."taskstatusid", m."description" AS "taskstatus_description"FROM referralmanagement.workflowtask AS cINNER JOIN referralmanagement.taskstatus AS m ON m."taskstatusid" = c."taskstatus" AND m."organisation" = c."organisation";referralmanagement.taskstatus records not used by referralmanagement.workflowtask
Section titled “referralmanagement.taskstatus records not used by referralmanagement.workflowtask”Find referralmanagement.taskstatus records that no referralmanagement.workflowtask record references.
:::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."taskstatusid", m."description"FROM referralmanagement.taskstatus AS mWHERE NOT EXISTS ( SELECT 1 FROM referralmanagement.workflowtask AS c WHERE m."taskstatusid" = c."taskstatus" AND m."organisation" = c."organisation");