Definition
Information
Section titled “Information”The Coding Subsetmember model records code membership within coding subsets. Each record holds code and subset identifiers, a parent-code identifier and display order, together with the recorded MKB version and organisation information associated with that subset membership 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”coding.subsetmember with dbo.codelookup and dbo.codelookup details
Section titled “coding.subsetmember with dbo.codelookup and dbo.codelookup details”Return records alongside descriptive values from the related tables.
:::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."_primary_key", m."codeid", p1."term" AS "codelookup_term", m."parentcodeid", p2."term" AS "codelookup_term"FROM coding.subsetmember AS mLEFT JOIN dbo.codelookup AS p1 ON p1."emiscodeid" = m."codeid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.codelookup AS p2 ON p2."emiscodeid" = m."parentcodeid" AND p2."organisation" = m."organisation";Row count by dbo.codelookup term
Section titled “Row count by dbo.codelookup term”Count coding.subsetmember records for each dbo.codelookup value, joined on codeid.
:::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 p."term" AS "codelookup_term", COUNT(*) AS row_countFROM coding.subsetmember AS mINNER JOIN dbo.codelookup AS p ON p."emiscodeid" = m."codeid" AND p."organisation" = m."organisation"GROUP BY p."term"ORDER BY row_count DESC;Row count by dbo.codelookup term
Section titled “Row count by dbo.codelookup term”Count coding.subsetmember records for each dbo.codelookup value, joined on parentcodeid.
:::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 p."term" AS "codelookup_term", COUNT(*) AS row_countFROM coding.subsetmember AS mINNER JOIN dbo.codelookup AS p ON p."emiscodeid" = m."parentcodeid" AND p."organisation" = m."organisation"GROUP BY p."term"ORDER BY row_count DESC;