Schema reference / Tables / view MDX source
valueset_code
The codes a value set admits, with the display text that must accompany them.
The codes a value set admits, with the display text that must accompany them.
Source
| Model | Leg | Role |
|---|---|---|
valueset_code | openEHR | defines this table |
A coded column group carries a four-column foreign key into this table on (value_set_id, code, system, text). Including the text in the key is deliberate: the display string stored on the row has to be one the value set actually defines, so a row cannot claim at1001 means "standing" when the value set says "Standing".
Columns
| Column | Type | Null | Description | Source |
|---|---|---|---|---|
value_set_id | text | no | The value set this code belongs to. | — |
code | text | no | The code itself — an at-code for openEHR, a terminology code for FHIR. | — |
system | text | no | Code system the code is drawn from. | — |
text | text | no | Display text. Part of the key, so a stored row must use the text defined here. | — |
description | text | yes | — | — |
numeric | numeric | yes | Ordinal value, where the archetype defines one (scales and scores). | — |
preferred | boolean | no | Whether this is the preferred term for the code. | — |
Primary key: value_set_id, code, system, text
Unique
value_set_id, code, system, text, numeric
References
| Columns | Target | On delete |
|---|---|---|
value_set_id | valueset | cascade |
Referenced by
868 tables reference valueset_code, via reason_for_absence_valueset_id, reason_for_absence_code, reason_for_absence_system, reason_for_absence. The first 15 alphabetically:
absenceviareason_for_absence_valueset_id, reason_for_absence_code, reason_for_absence_system, reason_for_absenceacvpuviaacvpu_valueset_id, acvpu_code, acvpu_system, acvpuadvance_care_directiveviatype_of_directive_valueset_id, type_of_directive_code, type_of_directive_system, type_of_directiveadvance_care_directiveviastatus_valueset_id, status_code, status_system, statusadvance_care_directiveviacondition_valueset_id, condition_code, condition_system, conditionadvance_intervention_decisionsviaintent_of_care_valueset_id, intent_of_care_code, intent_of_care_system, intent_of_careadvance_intervention_decisionsviacpr_decision_valueset_id, cpr_decision_code, cpr_decision_system, cpr_decisionadvance_intervention_decisions_per_interventionviaintervention_valueset_id, intervention_code, intervention_system, interventionadvance_intervention_decisions_per_interventionviadecision_valueset_id, decision_code, decision_system, decisionadverse_reaction_eventviaspecific_substance_valueset_id, specific_substance_code, specific_substance_system, specific_substanceadverse_reaction_eventviacertainty_valueset_id, certainty_code, certainty_system, certaintyadverse_reaction_eventviamanifestation_valueset_id, manifestation_code, manifestation_system, manifestationadverse_reaction_eventviaseverity_of_reaction_valueset_id, severity_of_reaction_code, severity_of_reaction_system, severity_of_reactionadverse_reaction_eventviaroute_of_exposure_valueset_id, route_of_exposure_code, route_of_exposure_system, route_of_exposureadverse_reaction_monitoringviapurpose_valueset_id, purpose_code, purpose_system, purpose
Definition
create table valueset_code (
value_set_id text not null references valueset (id) on delete cascade,
code text not null,
system text not null,
text text not null,
description text,
numeric numeric,
preferred boolean not null default false,
primary key (value_set_id, code, system, text),
unique (value_set_id, code, system, text, numeric)
);