Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions src/omop_constructs/alchemy/events/dx_linked_event_mv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/omop_constructs/alchemy/events/event_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
29 changes: 15 additions & 14 deletions tests/artifacts/construct_registry_schema.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading