omop-constructs 0.3.2__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/PKG-INFO +1 -1
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/pyproject.toml +1 -1
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/events/__init__.py +3 -1
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/events/dx_linked_event_mv.py +17 -2
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/events/event_queries.py +17 -1
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/modifier_mappers.py +1 -1
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/README.md +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/adapters.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/concepts/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/concepts/concept_mappers.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/concepts/concept_standardisation.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/conditions/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/conditions/condition_joins.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/conditions/condition_mappers.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/demography/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/demography/demography_matview.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/demography/demography_queries.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/condition_episode_mv.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/condition_episode_objects.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/episode_factories.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/episode_joins.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/surgical_joins.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/surgical_procedure_mv.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/treatment_summary_joins.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/events/event_factories.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/condition_modifier_join.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/condition_modifier_mv.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/modifier_factories.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/modifier_joins.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/source_factories.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/base.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/constructs.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/ddl.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/errors.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/materialized.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/plan.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/core/registry.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/py.typed +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/semantics/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/semantics/adapters.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/semantics/lookups.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/semantics/runtime_lookups.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/services/__init__.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/services/concept.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/services/person.py +0 -0
- {omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/typing.py +0 -0
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/events/__init__.py
RENAMED
|
@@ -9,6 +9,7 @@ from .dx_linked_event_mv import (
|
|
|
9
9
|
DistressThermometerDxMV,
|
|
10
10
|
ECOGDxMV,
|
|
11
11
|
SmokingPYHDxMV,
|
|
12
|
+
DxMeasurementMV
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
__all__ = [
|
|
@@ -21,5 +22,6 @@ __all__ = [
|
|
|
21
22
|
"FEV1DxMV",
|
|
22
23
|
"DistressThermometerDxMV",
|
|
23
24
|
"ECOGDxMV",
|
|
24
|
-
"SmokingPYHDxMV"
|
|
25
|
+
"SmokingPYHDxMV",
|
|
26
|
+
"DxMeasurementMV"
|
|
25
27
|
]
|
|
@@ -18,9 +18,13 @@ from .event_queries import (
|
|
|
18
18
|
fev1_dx,
|
|
19
19
|
dtherm_dx,
|
|
20
20
|
ecog_dx,
|
|
21
|
-
pyh_dx
|
|
21
|
+
pyh_dx,
|
|
22
|
+
dx_all_measurements
|
|
22
23
|
)
|
|
23
24
|
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
24
28
|
class ConditionEpisodeMeasurementCols:
|
|
25
29
|
__table_args__ = {"extend_existing": True}
|
|
26
30
|
|
|
@@ -167,4 +171,15 @@ class SmokingPYHDxMV(
|
|
|
167
171
|
__mv_select__ = pyh_dx.select()
|
|
168
172
|
__mv_index__ = "person_id"
|
|
169
173
|
__deps__ = (ConditionEpisodeMV.__mv_name__,)
|
|
170
|
-
__tablename__ = __mv_name__
|
|
174
|
+
__tablename__ = __mv_name__
|
|
175
|
+
|
|
176
|
+
@register_construct
|
|
177
|
+
class DxMeasurementMV(ConditionEpisodeMeasurementCols, MaterializedViewMixin, Base):
|
|
178
|
+
# todo: the other measurement MVs could be slices of this one instead of
|
|
179
|
+
# re-creating from fresh joins every time...
|
|
180
|
+
__mv_name__ = "dx_measurement_mv"
|
|
181
|
+
__mv_select__ = dx_all_measurements.select()
|
|
182
|
+
__mv_index__ = "person_id"
|
|
183
|
+
__deps__ = (ConditionEpisodeMV.__mv_name__,)
|
|
184
|
+
__tablename__ = __mv_name__
|
|
185
|
+
value_as_concept_id: so.Mapped[Optional[int]] = so.mapped_column(sa.Integer, nullable=True)
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/events/event_queries.py
RENAMED
|
@@ -72,4 +72,20 @@ egfr_dx = episode_relevant_window(est_gfr_query, max_days_post=90, max_days_prio
|
|
|
72
72
|
fev1_dx = episode_relevant_window(fev1_query, max_days_post=90, max_days_prior=30, name="fev1_dx")
|
|
73
73
|
dtherm_dx = episode_relevant_window(distress_thermometer_query, max_days_post=90, max_days_prior=30, name="dtherm_dx")
|
|
74
74
|
ecog_dx = episode_relevant_window(ecog_query, max_days_post=90, max_days_prior=30, name="ecog_dx")
|
|
75
|
-
pyh_dx = episode_relevant_window(smoking_pyh_query, max_days_post=90, max_days_prior=30, name="pyh_dx")
|
|
75
|
+
pyh_dx = episode_relevant_window(smoking_pyh_query, max_days_post=90, max_days_prior=30, name="pyh_dx")
|
|
76
|
+
|
|
77
|
+
dx_all_measurements = episode_relevant_window(
|
|
78
|
+
measurement_attached_to_condition_episode(
|
|
79
|
+
concept_ids=None,
|
|
80
|
+
include_cols=[
|
|
81
|
+
Measurement.value_as_number,
|
|
82
|
+
Measurement.value_as_concept_id,
|
|
83
|
+
Measurement.unit_concept_id,
|
|
84
|
+
],
|
|
85
|
+
name="dx_all_measurements",
|
|
86
|
+
unlinked_only=False,
|
|
87
|
+
),
|
|
88
|
+
max_days_post=90,
|
|
89
|
+
max_days_prior=30,
|
|
90
|
+
name="dx_all_measurements_windowed",
|
|
91
|
+
)
|
|
@@ -27,7 +27,7 @@ diagnosis, bespoke queries and/or mapper objects will be necessary.
|
|
|
27
27
|
class StageColumns:
|
|
28
28
|
__table_args__ = {"extend_existing": True}
|
|
29
29
|
person_id = sa.Column(sa.Integer)
|
|
30
|
-
stage_id = sa.Column(primary_key=True)
|
|
30
|
+
stage_id = sa.Column(sa.Integer, primary_key=True)
|
|
31
31
|
stage_date = sa.Column(sa.Date)
|
|
32
32
|
stage_datetime = sa.Column(sa.DateTime)
|
|
33
33
|
stage_concept_id = sa.Column(sa.Integer)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/concepts/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/conditions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/demography/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/episodes/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/modifiers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/alchemy/source_factories.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.3.2 → omop_constructs-0.3.4}/src/omop_constructs/semantics/runtime_lookups.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|