diff --git a/CHANGELOG.md b/CHANGELOG.md index ece3bdd..7339bfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -191,3 +191,5 @@ ## 0.5.0 - integrated oa-configurator package configuration and adapted omop-constructs to current orm-loader / omop-alchemy compatibility changes +## 0.5.2 +- ecog_dx_mv now also carries value_as_concept_id: ECOG performance status is a precoordinated-concept answer (OHDSI convention), not a plain number, so downstream measure logic needs the concept alongside (or instead of) value_as_number diff --git a/pyproject.toml b/pyproject.toml index 67ca320..6ae19b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "omop-constructs" -version = "0.5.1" +version = "0.5.2" description = "For building complex constructs on top of the omop-alchemy library." readme = "README.md" authors = [ diff --git a/src/omop_constructs/alchemy/events/dx_linked_event_mv.py b/src/omop_constructs/alchemy/events/dx_linked_event_mv.py index 3a85e84..13c7938 100644 --- a/src/omop_constructs/alchemy/events/dx_linked_event_mv.py +++ b/src/omop_constructs/alchemy/events/dx_linked_event_mv.py @@ -157,6 +157,7 @@ class ECOGDxMV( __mv_index__ = "person_id" __deps__ = (ConditionEpisodeMV.__mv_name__,) __tablename__ = __mv_name__ + value_as_concept_id: so.Mapped[Optional[int]] = so.mapped_column(sa.Integer, nullable=True) @register_construct class SmokingPYHDxMV( diff --git a/src/omop_constructs/alchemy/events/event_queries.py b/src/omop_constructs/alchemy/events/event_queries.py index 7bf3a6f..218dd3d 100644 --- a/src/omop_constructs/alchemy/events/event_queries.py +++ b/src/omop_constructs/alchemy/events/event_queries.py @@ -52,7 +52,7 @@ ecog_query = measurement_attached_to_condition_episode( concept_ids=[runtime.measurements_numeric.performance_status_measurements.ecog_performance_status], # type: ignore - include_cols=[Measurement.value_as_number, Measurement.unit_concept_id], + include_cols=[Measurement.value_as_number, Measurement.value_as_concept_id, Measurement.unit_concept_id], name="ecog", ) diff --git a/tests/artifacts/construct_registry_schema.csv b/tests/artifacts/construct_registry_schema.csv index 874f999..bc7defb 100644 --- a/tests/artifacts/construct_registry_schema.csv +++ b/tests/artifacts/construct_registry_schema.csv @@ -185,20 +185,21 @@ dx_visit_mv,omop_constructs.alchemy.events.dx_linked_visit_mv,DxRelevantVisitMV, dx_visit_mv,omop_constructs.alchemy.events.dx_linked_visit_mv,DxRelevantVisitMV,materialized_view,,person_id,,11,episode_prior,INTEGER,false,false dx_visit_mv,omop_constructs.alchemy.events.dx_linked_visit_mv,DxRelevantVisitMV,materialized_view,,person_id,,12,diff_days,FLOAT,false,false dx_visit_mv,omop_constructs.alchemy.events.dx_linked_visit_mv,DxRelevantVisitMV,materialized_view,,person_id,,13,rank,INTEGER,false,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,1,mv_id,INTEGER,false,true -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,2,person_id,INTEGER,false,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,3,event_id,INTEGER,false,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,4,event_date,DATE,false,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,5,event_concept_id,INTEGER,false,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,6,event_label,VARCHAR,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,7,value_as_number,FLOAT,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,8,unit_concept_id,INTEGER,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,9,episode_id,INTEGER,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,10,episode_concept_id,INTEGER,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,11,episode_label,VARCHAR,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,12,episode_start_date,DATE,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,13,episode_end_date,DATE,true,false -ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,14,episode_delta_days,INTEGER,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,1,value_as_concept_id,INTEGER,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,2,mv_id,INTEGER,false,true +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,3,person_id,INTEGER,false,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,4,event_id,INTEGER,false,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,5,event_date,DATE,false,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,6,event_concept_id,INTEGER,false,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,7,event_label,VARCHAR,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,8,value_as_number,FLOAT,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,9,unit_concept_id,INTEGER,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,10,episode_id,INTEGER,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,11,episode_concept_id,INTEGER,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,12,episode_label,VARCHAR,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,13,episode_start_date,DATE,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,14,episode_end_date,DATE,true,false +ecog_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,ECOGDxMV,materialized_view,condition_episode_mv,person_id,,15,episode_delta_days,INTEGER,true,false egfr_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,EGFRDxMV,materialized_view,condition_episode_mv,person_id,,1,mv_id,INTEGER,false,true egfr_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,EGFRDxMV,materialized_view,condition_episode_mv,person_id,,2,person_id,INTEGER,false,false egfr_dx_mv,omop_constructs.alchemy.events.dx_linked_event_mv,EGFRDxMV,materialized_view,condition_episode_mv,person_id,,3,event_id,INTEGER,false,false