Schema reference / Tables / view MDX source
medication_detail
Details about a medication or component of a medication, including strength, form and details of any specific constituents.
Details about a medication or component of a medication, including strength, form and details of any specific constituents.
Purpose. To record details about a medication or component of a medication, including strength, form and details of any specific constituents.
Source
| Model | Leg | Role |
|---|---|---|
openEHR-EHR-CLUSTER.medication.v2 | openEHR | defines this table |
Columns
| Column | Type | Null | Description | Source |
|---|---|---|---|---|
id | uuid primary key | no | Primary key. | — |
namename_codename_systemname_valueset_id | coded texttext, text, text, text | yes | Name | /items[at0132] |
formform_codeform_systemform_valueset_id | coded texttext, text, text, text | yes | Form | /items[at0071] |
categorycategory_codecategory_systemcategory_valueset_id | coded texttext, text, text, text | yes | Category | /items[at0142] |
strength_presentation_strength_numerator_magnitudestrength_presentation_strength_numerator_units | quantitynumeric, text | yes | Strength numerator | /items[at0152]/items[at0153] |
strength_presentation_strength_denominator_magnitudestrength_presentation_strength_denominator_units | quantitynumeric, text | yes | Strength denominator | /items[at0152]/items[at0157] |
strength_concentration_magnitudestrength_concentration_units | quantitynumeric, text | yes | Strength (concentration) | /items[at0115] |
manufacturer | text | yes | Manufacturer | /items[at0151] |
batch_id_valuebatch_id_system | text, texttext, text | yes | Batch ID | /items[at0150] |
expiry | timestamptz | yes | Expiry | /items[at0003] |
amount_magnitudeamount_units | quantitynumeric, text | yes | Amount | /items[at0139] |
alternate_amount_magnitudealternate_amount_units | quantitynumeric, text | yes | Alternate amount | /items[at0148] |
rolerole_coderole_systemrole_valueset_id | coded texttext, text, text, text | yes | Role | /items[at0127] |
description | text | yes | Description | /items[at0133] |
Constraints
check ((name_code is null and name_system is null and name_valueset_id is null) or (name is not null and name_code is not null and name_system is not null and name_valueset_id is not null))
check ((form_code is null and form_system is null and form_valueset_id is null) or (form is not null and form_code is not null and form_system is not null and form_valueset_id is not null))
check ((category_code is null and category_system is null and category_valueset_id is null) or (category is not null and category_code is not null and category_system is not null and category_valueset_id is not null))
check ((strength_presentation_strength_numerator_magnitude is null and strength_presentation_strength_numerator_units is null) or (strength_presentation_strength_numerator_magnitude is not null and strength_presentation_strength_numerator_units is not null))
check ((strength_presentation_strength_denominator_magnitude is null and strength_presentation_strength_denominator_units is null) or (strength_presentation_strength_denominator_magnitude is not null and strength_presentation_strength_denominator_units is not null))
check ((strength_concentration_magnitude is null and strength_concentration_units is null) or (strength_concentration_magnitude is not null and strength_concentration_units is not null))
check (batch_id_system is null or batch_id_value is not null)
check ((amount_magnitude is null and amount_units is null) or (amount_magnitude is not null and amount_units is not null))
check ((alternate_amount_magnitude is null and alternate_amount_units is null) or (alternate_amount_magnitude is not null and alternate_amount_units is not null))
check ((role_code is null and role_system is null and role_valueset_id is null) or (role is not null and role_code is not null and role_system is not null and role_valueset_id is not null))References
| Columns | Target | On delete |
|---|---|---|
name_valueset_id, name_code, name_system, name | valueset_code | restrict |
form_valueset_id, form_code, form_system, form | valueset_code | restrict |
category_valueset_id, category_code, category_system, category | valueset_code | restrict |
role_valueset_id, role_code, role_system, role | valueset_code | restrict |
Referenced by
adverse_reaction_monitoring_substance_detailsviamedication_detail_idmedicationviamedication_detailsmedication_detail_constituentviamedication_detail_idmedication_detail_constituentviaconstituent_idmedication_order_medication_detailsviamedication_detail_idmedication_summary_episode_additional_detailsviamedication_detail_id
Child tables
1 table hang off medication_detail, one row per repetition.
medication_detail_constituent
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|---|---|---|---|
id | uuid primary key | no | Primary key. | — |
medication_detail_id | uuid → medication_detail | no | — | — |
position | integer | no | Order of this row within its parent, from zero. | — |
constituent_id | uuid | no | Constituent | /items[at0138] |
Unique
medication_detail_id, positionmedication_detail_id, constituent_id
References
| Columns | Target | On delete |
|---|---|---|
medication_detail_id | medication_detail | cascade |
constituent_id | medication_detail | no action |
Indexes
medication_detail_constituent_constituent_id_idxonconstituent_id
Value sets
| Value set | Codes |
|---|---|
org.openehr::openEHR-EHR-CLUSTER.medication.v2/category | 5 |
org.openehr::openEHR-EHR-CLUSTER.medication.v2/role | 3 |