--- title: "mayo_score" description: "An assessment score used to estimate the severity of ulcerative colitis." --- An assessment score used to estimate the severity of ulcerative colitis. **Purpose.** To record an assessment of the severity of ulcerative colitis. ## Source | Model | Leg | Role | |---|---|---| | `openEHR-EHR-OBSERVATION.mayo_score.v1` | openEHR | defines this table | ## Columns | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `form_id` | `uuid` → [`form`](/docs/tables/form) | no | The form this entry was recorded on. | — | | `form_block_id` | `uuid` | yes | The block within the form, when the entry is bound to one. | — | | `stool_frequency`
`stool_frequency_code`
`stool_frequency_system`
`stool_frequency_numeric`
`stool_frequency_valueset_id` | coded text
`text`, `text`, `text`, `numeric`, `text` | yes | Stool frequency | `/data[at0001]/events[at0002]/data[at0003]/items[at0009]` | | `rectal_bleeding`
`rectal_bleeding_code`
`rectal_bleeding_system`
`rectal_bleeding_numeric`
`rectal_bleeding_valueset_id` | coded text
`text`, `text`, `text`, `numeric`, `text` | yes | Rectal bleeding | `/data[at0001]/events[at0002]/data[at0003]/items[at0014]` | | `endoscopy_findings`
`endoscopy_findings_code`
`endoscopy_findings_system`
`endoscopy_findings_numeric`
`endoscopy_findings_valueset_id` | coded text
`text`, `text`, `text`, `numeric`, `text` | yes | Endoscopy findings | `/data[at0001]/events[at0002]/data[at0003]/items[at0019]` | | `global_assessment`
`global_assessment_code`
`global_assessment_system`
`global_assessment_numeric`
`global_assessment_valueset_id` | coded text
`text`, `text`, `text`, `numeric`, `text` | yes | Global assessment | `/data[at0001]/events[at0002]/data[at0003]/items[at0024]` | | `total_mayo_score` | `integer` | yes | Total Mayo score | `/data[at0001]/events[at0002]/data[at0003]/items[at0029]` | | `partial_mayo_score` | `integer` | yes | Partial Mayo score | `/data[at0001]/events[at0002]/data[at0003]/items[at0033]` | | `simplified_mayo_score` | `integer` | yes | Simplified Mayo score | `/data[at0001]/events[at0002]/data[at0003]/items[at0034]` | ## Constraints ```sql check ((stool_frequency_code is null and stool_frequency_system is null and stool_frequency_numeric is null and stool_frequency is null) or (stool_frequency_valueset_id is not null and stool_frequency_code is not null and stool_frequency_system is not null and stool_frequency_numeric is not null and stool_frequency is not null)) check ((rectal_bleeding_code is null and rectal_bleeding_system is null and rectal_bleeding_numeric is null and rectal_bleeding is null) or (rectal_bleeding_valueset_id is not null and rectal_bleeding_code is not null and rectal_bleeding_system is not null and rectal_bleeding_numeric is not null and rectal_bleeding is not null)) check ((endoscopy_findings_code is null and endoscopy_findings_system is null and endoscopy_findings_numeric is null and endoscopy_findings is null) or (endoscopy_findings_valueset_id is not null and endoscopy_findings_code is not null and endoscopy_findings_system is not null and endoscopy_findings_numeric is not null and endoscopy_findings is not null)) check ((global_assessment_code is null and global_assessment_system is null and global_assessment_numeric is null and global_assessment is null) or (global_assessment_valueset_id is not null and global_assessment_code is not null and global_assessment_system is not null and global_assessment_numeric is not null and global_assessment is not null)) check (total_mayo_score is null or total_mayo_score between 0 and 12) check (partial_mayo_score is null or partial_mayo_score between 0 and 9) check (simplified_mayo_score is null or simplified_mayo_score between 0 and 6) ``` ## Unique - `form_block_id` ## References | Columns | Target | On delete | |---|---|---| | `form_id` | [`form`](/docs/tables/form) | cascade | | `form_id, form_block_id` | [`form_block`](/docs/tables/form_block) | cascade | | `stool_frequency_valueset_id, stool_frequency_code, stool_frequency_system, stool_frequency, stool_frequency_numeric` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `rectal_bleeding_valueset_id, rectal_bleeding_code, rectal_bleeding_system, rectal_bleeding, rectal_bleeding_numeric` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `endoscopy_findings_valueset_id, endoscopy_findings_code, endoscopy_findings_system, endoscopy_findings, endoscopy_findings_numeric` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `global_assessment_valueset_id, global_assessment_code, global_assessment_system, global_assessment, global_assessment_numeric` | [`valueset_code`](/docs/tables/valueset_code) | restrict | ## Indexes - `mayo_score_form_id_idx` on `form_id` ## Value sets | Value set | Codes | |---|---| | `org.openehr::openEHR-EHR-OBSERVATION.mayo_score.v1/endoscopy_findings` | 4 | | `org.openehr::openEHR-EHR-OBSERVATION.mayo_score.v1/global_assessment` | 4 | | `org.openehr::openEHR-EHR-OBSERVATION.mayo_score.v1/rectal_bleeding` | 4 | | `org.openehr::openEHR-EHR-OBSERVATION.mayo_score.v1/stool_frequency` | 4 |