Definition
Information
Section titled “Information”The Episodemanagement Rttstatuscodes model holds RTT status-code information, including MKB code values and a recorded clock-impact value. It also stores status-code identifiers and active and initial flags, together with source organisation information describing the context of the code entry.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”episodemanagement.referralepisode count per episodemanagement.rttstatuscodes
Section titled “episodemanagement.referralepisode count per episodemanagement.rttstatuscodes”Count related episodemanagement.referralepisode records for each episodemanagement.rttstatuscodes record, joined on rttperiodstatuscodeid.
:::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."statuscodeid", m."impactonclock", COUNT(c."rttperiodstatuscodeid") AS referralepisode_countFROM episodemanagement.rttstatuscodes AS mLEFT JOIN episodemanagement.referralepisode AS c ON m."statuscodeid" = c."rttperiodstatuscodeid" AND m."organisation" = c."organisation"GROUP BY m."statuscodeid", m."impactonclock"ORDER BY referralepisode_count DESC;episodemanagement.referralepisode records with episodemanagement.rttstatuscodes details
Section titled “episodemanagement.referralepisode records with episodemanagement.rttstatuscodes details”List episodemanagement.referralepisode records with the episodemanagement.rttstatuscodes values they reference through rttperiodstatuscodeid.
:::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."closuredate", m."statuscodeid", m."impactonclock" AS "rttstatuscodes_impactonclock"FROM episodemanagement.referralepisode AS cINNER JOIN episodemanagement.rttstatuscodes AS m ON m."statuscodeid" = c."rttperiodstatuscodeid" AND m."organisation" = c."organisation";episodemanagement.rttperiod count per episodemanagement.rttstatuscodes
Section titled “episodemanagement.rttperiod count per episodemanagement.rttstatuscodes”Count related episodemanagement.rttperiod records for each episodemanagement.rttstatuscodes record, joined on rttstartcodeid.
:::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."statuscodeid", m."impactonclock", COUNT(c."rttstartcodeid") AS rttperiod_countFROM episodemanagement.rttstatuscodes AS mLEFT JOIN episodemanagement.rttperiod AS c ON m."statuscodeid" = c."rttstartcodeid" AND m."organisation" = c."organisation"GROUP BY m."statuscodeid", m."impactonclock"ORDER BY rttperiod_count DESC;