--- title: "spirometry_result" description: "Pulmonary function test results using a spirometer or peak flow meter." --- Pulmonary function test results using a spirometer or peak flow meter. **Purpose.** To record the results of a pulmonary function test performed using a spirometer or peak flow meter. ## Source | Model | Leg | Role | |---|---|---| | `openEHR-EHR-OBSERVATION.spirometry_result.v2` | 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. | — | | `forced_expiratory_time_fet` | `interval` | yes | Forced expiratory time (FET) | `/data[at0001]/events[at0002]/data[at0003]/items[at0013]` | | `clinical_interpretation`
`clinical_interpretation_code`
`clinical_interpretation_system`
`clinical_interpretation_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Clinical interpretation | `/data[at0001]/events[at0002]/data[at0003]/items[at0130]` | | `comment` | `text` | yes | Comment | `/data[at0001]/events[at0002]/data[at0003]/items[at0101]` | | `position`
`position_code`
`position_system`
`position_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Position | `/data[at0001]/events[at0002]/state[at0031]/items[at0115]` | | `confounding_factors` | `text` | yes | Confounding factors | `/data[at0001]/events[at0002]/state[at0031]/items[at0098]` | | `type_of_measurement`
`type_of_measurement_code`
`type_of_measurement_system`
`type_of_measurement_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Type of measurement | `/protocol[at0029]/items[at0196]` | | `method`
`method_code`
`method_system`
`method_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Method | `/protocol[at0029]/items[at0199]` | | `challenge_reversibility`
`challenge_reversibility_code`
`challenge_reversibility_system`
`challenge_reversibility_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Challenge/reversibility | `/protocol[at0029]/items[at0192]` | ## Constraints ```sql check ((clinical_interpretation_code is null and clinical_interpretation_system is null and clinical_interpretation_valueset_id is null) or (clinical_interpretation is not null and clinical_interpretation_code is not null and clinical_interpretation_system is not null and clinical_interpretation_valueset_id is not null)) check ((position_code is null and position_system is null and position_valueset_id is null and position is null) or (position is not null and position_code is not null and position_system is not null and position_valueset_id is not null)) check ((type_of_measurement_code is null and type_of_measurement_system is null and type_of_measurement_valueset_id is null and type_of_measurement is null) or (type_of_measurement is not null and type_of_measurement_code is not null and type_of_measurement_system is not null and type_of_measurement_valueset_id is not null)) check ((method_code is null and method_system is null and method_valueset_id is null) or (method is not null and method_code is not null and method_system is not null and method_valueset_id is not null)) check ((challenge_reversibility_code is null and challenge_reversibility_system is null and challenge_reversibility_valueset_id is null and challenge_reversibility is null) or (challenge_reversibility is not null and challenge_reversibility_code is not null and challenge_reversibility_system is not null and challenge_reversibility_valueset_id is not null)) ``` ## 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 | | `clinical_interpretation_valueset_id, clinical_interpretation_code, clinical_interpretation_system, clinical_interpretation` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `position_valueset_id, position_code, position_system, position` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `type_of_measurement_valueset_id, type_of_measurement_code, type_of_measurement_system, type_of_measurement` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `method_valueset_id, method_code, method_system, method` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `challenge_reversibility_valueset_id, challenge_reversibility_code, challenge_reversibility_system, challenge_reversibility` | [`valueset_code`](/docs/tables/valueset_code) | restrict | ## Referenced by - [`spirometry_result_volume`](/docs/tables/spirometry_result_volume) via `spirometry_result_id` - [`spirometry_result_flow_rate`](/docs/tables/spirometry_result_flow_rate) via `spirometry_result_id` - [`spirometry_result_pressure`](/docs/tables/spirometry_result_pressure) via `spirometry_result_id` - [`spirometry_result_ratio`](/docs/tables/spirometry_result_ratio) via `spirometry_result_id` - [`spirometry_result_multimedia_representation`](/docs/tables/spirometry_result_multimedia_representation) via `spirometry_result_id` - [`spirometry_result_device`](/docs/tables/spirometry_result_device) via `spirometry_result_id` - [`spirometry_result_predicted_results_source`](/docs/tables/spirometry_result_predicted_results_source) via `spirometry_result_id` ## Indexes - `spirometry_result_form_id_idx` on `form_id` ## Child tables 7 tables hang off `spirometry_result`, one row per repetition. ### `spirometry_result_volume` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `result_magnitude`
`result_units` | quantity
`numeric`, `text` | yes | Result | `/data[at0001]/events[at0002]/data[at0003]/items[at0052]/items[at0053]` | | `predicted_result_magnitude`
`predicted_result_units` | quantity
`numeric`, `text` | yes | Predicted result | `/data[at0001]/events[at0002]/data[at0003]/items[at0052]/items[at0054]` | | `measured_predicted_ratio_numerator`
`measured_predicted_ratio_denominator` | numeric, numeric
`numeric`, `numeric` | yes | Measured/predicted ratio | `/data[at0001]/events[at0002]/data[at0003]/items[at0052]/items[at0044]` | #### Constraints ```sql check ((result_magnitude is null and result_units is null) or (result_magnitude is not null and result_units is not null)) check (result_magnitude is null or (result_units = 'L' and result_magnitude >= 0) or (result_units = 'mL' and result_magnitude >= 0)) check ((predicted_result_magnitude is null and predicted_result_units is null) or (predicted_result_magnitude is not null and predicted_result_units is not null)) check (predicted_result_magnitude is null or (predicted_result_units = 'L' and predicted_result_magnitude >= 0) or (predicted_result_units = 'mL' and predicted_result_magnitude >= 0)) check ((measured_predicted_ratio_numerator is null and measured_predicted_ratio_denominator is null) or (measured_predicted_ratio_numerator is not null and measured_predicted_ratio_denominator is not null)) check (measured_predicted_ratio_denominator is null or measured_predicted_ratio_denominator <> 0) check (measured_predicted_ratio_denominator is null or measured_predicted_ratio_denominator = 100) check (measured_predicted_ratio_numerator is null or measured_predicted_ratio_numerator >= 0) ``` #### Unique - `spirometry_result_id, position` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | ### `spirometry_result_flow_rate` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `result_magnitude`
`result_units` | quantity
`numeric`, `text` | yes | Result | `/data[at0001]/events[at0002]/data[at0003]/items[at0057]/items[at0058]` | | `predicted_result_magnitude`
`predicted_result_units` | quantity
`numeric`, `text` | yes | Predicted result | `/data[at0001]/events[at0002]/data[at0003]/items[at0057]/items[at0008]` | | `measured_predicted_ratio_numerator`
`measured_predicted_ratio_denominator` | numeric, numeric
`numeric`, `numeric` | yes | Measured/predicted ratio | `/data[at0001]/events[at0002]/data[at0003]/items[at0057]/items[at0122]` | #### Constraints ```sql check ((result_magnitude is null and result_units is null) or (result_magnitude is not null and result_units is not null)) check (result_magnitude is null or (result_units = 'L/s' and result_magnitude >= 0) or (result_units = 'mL/s' and result_magnitude >= 0) or (result_units = 'L/min' and result_magnitude >= 0)) check ((predicted_result_magnitude is null and predicted_result_units is null) or (predicted_result_magnitude is not null and predicted_result_units is not null)) check (predicted_result_magnitude is null or (predicted_result_units = 'L/s' and predicted_result_magnitude >= 0) or (predicted_result_units = 'mL/s' and predicted_result_magnitude >= 0) or (predicted_result_units = 'L/min' and predicted_result_magnitude >= 0)) check ((measured_predicted_ratio_numerator is null and measured_predicted_ratio_denominator is null) or (measured_predicted_ratio_numerator is not null and measured_predicted_ratio_denominator is not null)) check (measured_predicted_ratio_denominator is null or measured_predicted_ratio_denominator <> 0) check (measured_predicted_ratio_denominator is null or measured_predicted_ratio_denominator = 100) check (measured_predicted_ratio_numerator is null or measured_predicted_ratio_numerator >= 0) ``` #### Unique - `spirometry_result_id, position` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | ### `spirometry_result_pressure` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `result_magnitude`
`result_units` | quantity
`numeric`, `text` | yes | Result | `/data[at0001]/events[at0002]/data[at0003]/items[at0156]/items[at0165]` | | `predicted_result_magnitude`
`predicted_result_units` | quantity
`numeric`, `text` | yes | Predicted result | `/data[at0001]/events[at0002]/data[at0003]/items[at0156]/items[at0166]` | | `measured_predicted_ratio_numerator`
`measured_predicted_ratio_denominator` | numeric, numeric
`numeric`, `numeric` | yes | Measured/predicted ratio | `/data[at0001]/events[at0002]/data[at0003]/items[at0156]/items[at0167]` | #### Constraints ```sql check ((result_magnitude is null and result_units is null) or (result_magnitude is not null and result_units is not null)) check (result_magnitude is null or (result_units = 'cm[H2O]' and result_magnitude >= 0) or (result_units = 'mm[Hg]' and result_magnitude >= 0)) check ((predicted_result_magnitude is null and predicted_result_units is null) or (predicted_result_magnitude is not null and predicted_result_units is not null)) check (predicted_result_magnitude is null or (predicted_result_units = 'cm[H2O]' and predicted_result_magnitude >= 0) or (predicted_result_units = 'mm[Hg]' and predicted_result_magnitude >= 0)) check ((measured_predicted_ratio_numerator is null and measured_predicted_ratio_denominator is null) or (measured_predicted_ratio_numerator is not null and measured_predicted_ratio_denominator is not null)) check (measured_predicted_ratio_denominator is null or measured_predicted_ratio_denominator <> 0) check (measured_predicted_ratio_denominator is null or measured_predicted_ratio_denominator = 100) check (measured_predicted_ratio_numerator is null or measured_predicted_ratio_numerator >= 0) ``` #### Unique - `spirometry_result_id, position` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | ### `spirometry_result_ratio` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `result_numerator`
`result_denominator` | numeric, numeric
`numeric`, `numeric` | yes | Result | `/data[at0001]/events[at0002]/data[at0003]/items[at0055]/items[at0056]` | | `predicted_result_numerator`
`predicted_result_denominator` | numeric, numeric
`numeric`, `numeric` | yes | Predicted result | `/data[at0001]/events[at0002]/data[at0003]/items[at0055]/items[at0018]` | #### Constraints ```sql check ((result_numerator is null and result_denominator is null) or (result_numerator is not null and result_denominator is not null)) check (result_denominator is null or result_denominator <> 0) check (result_denominator is null or result_denominator = 100) check (result_numerator is null or result_numerator >= 0) check ((predicted_result_numerator is null and predicted_result_denominator is null) or (predicted_result_numerator is not null and predicted_result_denominator is not null)) check (predicted_result_denominator is null or predicted_result_denominator <> 0) check (predicted_result_denominator is null or predicted_result_denominator = 100) check (predicted_result_numerator is null or predicted_result_numerator >= 0) ``` #### Unique - `spirometry_result_id, position` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | ### `spirometry_result_multimedia_representation` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `attachment_id` | `uuid` | no | Multimedia representation | `/data[at0001]/events[at0002]/data[at0003]/items[at0131]` | #### Unique - `spirometry_result_id, position` - `spirometry_result_id, attachment_id` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | | `attachment_id` | [`attachment`](/docs/tables/attachment) | restrict | #### Indexes - `spirometry_result_multimedia_representation_attachment_id_idx` on `attachment_id` ### `spirometry_result_device` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `device_id` | `uuid` | no | Device | `/protocol[at0029]/items[at0030]` | #### Unique - `spirometry_result_id, position` - `spirometry_result_id, device_id` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | | `device_id` | [`device`](/docs/tables/device) | no action | #### Indexes - `spirometry_result_device_device_id_idx` on `device_id` ### `spirometry_result_predicted_results_source` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `spirometry_result_id` | `uuid` → [`spirometry_result`](/docs/tables/spirometry_result) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `knowledge_base_reference_id` | `uuid` | no | Predicted results source | `/protocol[at0029]/items[at0185]` | #### Unique - `spirometry_result_id, position` - `spirometry_result_id, knowledge_base_reference_id` #### References | Columns | Target | On delete | |---|---|---| | `spirometry_result_id` | [`spirometry_result`](/docs/tables/spirometry_result) | cascade | | `knowledge_base_reference_id` | [`knowledge_base_reference`](/docs/tables/knowledge_base_reference) | no action | #### Indexes - `spirometry_result_predicted_results_source_knowledge_bas_130a06` on `knowledge_base_reference_id` ## Value sets | Value set | Codes | |---|---| | `org.openehr::openEHR-EHR-OBSERVATION.spirometry_result.v2/challenge_reversibility` | 3 | | `org.openehr::openEHR-EHR-OBSERVATION.spirometry_result.v2/position` | 4 | | `org.openehr::openEHR-EHR-OBSERVATION.spirometry_result.v2/type_of_measurement` | 2 |