Definition
Information
Section titled “Information”The Referralmanagement Urgency model holds urgency labels in the referral-management domain. Each entry records an identifier and display text, 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”carerecord.referral count per referralmanagement.urgency
Section titled “carerecord.referral count per referralmanagement.urgency”Count related carerecord.referral records for each referralmanagement.urgency record, joined on urgency.
:::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."id", m."displaytext", COUNT(c."urgency") AS referral_countFROM referralmanagement.urgency AS mLEFT JOIN carerecord.referral AS c ON m."id" = c."urgency" AND m."organisation" = c."organisation"GROUP BY m."id", m."displaytext"ORDER BY referral_count DESC;carerecord.referral records with referralmanagement.urgency details
Section titled “carerecord.referral records with referralmanagement.urgency details”List carerecord.referral records with the referralmanagement.urgency values they reference through urgency.
:::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."datedreferral", m."id", m."displaytext" AS "urgency_displaytext"FROM carerecord.referral AS cINNER JOIN referralmanagement.urgency AS m ON m."id" = c."urgency" AND m."organisation" = c."organisation";carerecord.report count per referralmanagement.urgency
Section titled “carerecord.report count per referralmanagement.urgency”Count related carerecord.report records for each referralmanagement.urgency record, joined on urgency.
:::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."id", m."displaytext", COUNT(c."urgency") AS report_countFROM referralmanagement.urgency AS mLEFT JOIN carerecord.report AS c ON m."id" = c."urgency" AND m."organisation" = c."organisation"GROUP BY m."id", m."displaytext"ORDER BY report_count DESC;