omop-constructs 0.2.5__tar.gz → 0.2.7__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.2.5 → omop_constructs-0.2.7}/PKG-INFO +1 -1
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/pyproject.toml +1 -1
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/episodes/condition_episode_mv.py +9 -9
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/episodes/episode_factories.py +12 -10
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/episodes/episode_joins.py +2 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/README.md +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/adapters.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/concepts/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/concepts/concept_mappers.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/concepts/concept_standardisation.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/conditions/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/conditions/condition_joins.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/conditions/condition_mappers.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/episodes/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/condition_modifier_join.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/condition_modifier_mv.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/modifier_factories.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/modifier_joins.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/modifier_mappers.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/source_factories.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/base.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/constructs.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/ddl.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/errors.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/materialized.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/plan.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/core/registry.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/py.typed +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/semantics/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/semantics/adapters.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/semantics/lookups.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/semantics/runtime_lookups.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/services/__init__.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/services/concept.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/services/person.py +0 -0
- {omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/typing.py +0 -0
|
@@ -39,8 +39,8 @@ class OverarchingDiseaseEpisodeMV(
|
|
|
39
39
|
extent_episode_concept_id: so.Mapped[Optional[int]] = so.mapped_column(sa.Integer, nullable=True)
|
|
40
40
|
extent_episode_label: so.Mapped[Optional[str]] = so.mapped_column(sa.String, nullable=True)
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
extent_episode_start_date: so.Mapped[Optional[date]] = so.mapped_column(sa.Date, nullable=True)
|
|
43
|
+
extent_episode_end_date: so.Mapped[Optional[date]] = so.mapped_column(sa.Date, nullable=True)
|
|
44
44
|
|
|
45
45
|
def __repr__(self) -> str:
|
|
46
46
|
if self.has_extent:
|
|
@@ -62,7 +62,7 @@ class OverarchingDiseaseEpisodeMV(
|
|
|
62
62
|
def extent_interval(self):
|
|
63
63
|
if self.extent_episode_id is None:
|
|
64
64
|
return None
|
|
65
|
-
return (self.
|
|
65
|
+
return (self.extent_episode_start_date, self.extent_episode_end_date)
|
|
66
66
|
|
|
67
67
|
@register_construct
|
|
68
68
|
class TreatmentRegimenCycleMV(
|
|
@@ -89,15 +89,15 @@ class TreatmentRegimenCycleMV(
|
|
|
89
89
|
regimen_episode_concept_id: so.Mapped[int] = so.mapped_column(sa.Integer)
|
|
90
90
|
regimen_episode_label: so.Mapped[str] = so.mapped_column(sa.String)
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
regimen_episode_start_date: so.Mapped[date] = so.mapped_column(sa.Date)
|
|
93
|
+
regimen_episode_end_date: so.Mapped[Optional[date]] = so.mapped_column(sa.Date, nullable=True)
|
|
94
94
|
|
|
95
95
|
cycle_episode_id: so.Mapped[Optional[int]] = so.mapped_column(sa.Integer, nullable=True)
|
|
96
96
|
cycle_episode_concept_id: so.Mapped[Optional[int]] = so.mapped_column(sa.Integer, nullable=True)
|
|
97
97
|
cycle_episode_label: so.Mapped[Optional[str]] = so.mapped_column(sa.String, nullable=True)
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
cycle_episode_start_date: so.Mapped[Optional[date]] = so.mapped_column(sa.Date, nullable=True)
|
|
100
|
+
cycle_episode_end_date: so.Mapped[Optional[date]] = so.mapped_column(sa.Date, nullable=True)
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
def __repr__(self) -> str:
|
|
@@ -114,10 +114,10 @@ class TreatmentRegimenCycleMV(
|
|
|
114
114
|
|
|
115
115
|
@property
|
|
116
116
|
def regimen_interval(self):
|
|
117
|
-
return (self.
|
|
117
|
+
return (self.regimen_episode_start_date, self.regimen_episode_end_date)
|
|
118
118
|
|
|
119
119
|
@property
|
|
120
120
|
def cycle_interval(self):
|
|
121
121
|
if self.cycle_episode_id is None:
|
|
122
122
|
return None
|
|
123
|
-
return (self.
|
|
123
|
+
return (self.cycle_episode_start_date, self.cycle_episode_end_date)
|
|
@@ -48,6 +48,8 @@ def get_episode_hierarchy_query(
|
|
|
48
48
|
parent_episode_subq: sa.Subquery,
|
|
49
49
|
child_episode_subq: sa.Subquery,
|
|
50
50
|
name: str = "episode_optional_children",
|
|
51
|
+
parent_label: str = 'disease_episode',
|
|
52
|
+
child_label: str = 'extent_episode'
|
|
51
53
|
) -> sa.Subquery:
|
|
52
54
|
"""
|
|
53
55
|
Expands an episode subquery to optionally include child episodes.
|
|
@@ -55,18 +57,18 @@ def get_episode_hierarchy_query(
|
|
|
55
57
|
|
|
56
58
|
return (
|
|
57
59
|
sa.select(
|
|
58
|
-
parent_episode_subq.c.episode_id.label("
|
|
60
|
+
parent_episode_subq.c.episode_id.label(f"{parent_label}_id"),
|
|
59
61
|
parent_episode_subq.c.person_id.label("person_id"),
|
|
60
|
-
parent_episode_subq.c.episode_concept_id.label("
|
|
61
|
-
parent_episode_subq.c.episode_label.label("
|
|
62
|
-
parent_episode_subq.c.episode_start_date.label("
|
|
63
|
-
parent_episode_subq.c.episode_end_date.label("
|
|
62
|
+
parent_episode_subq.c.episode_concept_id.label(f"{parent_label}_concept_id"),
|
|
63
|
+
parent_episode_subq.c.episode_label.label(f"{parent_label}_label"),
|
|
64
|
+
parent_episode_subq.c.episode_start_date.label(f"{parent_label}_start_date"),
|
|
65
|
+
parent_episode_subq.c.episode_end_date.label(f"{parent_label}_end_date"),
|
|
64
66
|
|
|
65
|
-
child_episode_subq.c.episode_id.label("
|
|
66
|
-
child_episode_subq.c.episode_concept_id.label("
|
|
67
|
-
child_episode_subq.c.episode_label.label("
|
|
68
|
-
child_episode_subq.c.episode_start_date.label("
|
|
69
|
-
child_episode_subq.c.episode_end_date.label("
|
|
67
|
+
child_episode_subq.c.episode_id.label(f"{child_label}_id"),
|
|
68
|
+
child_episode_subq.c.episode_concept_id.label(f"{child_label}_concept_id"),
|
|
69
|
+
child_episode_subq.c.episode_label.label(f"{child_label}_label"),
|
|
70
|
+
child_episode_subq.c.episode_start_date.label(f"{child_label}_start_date"),
|
|
71
|
+
child_episode_subq.c.episode_end_date.label(f"{child_label}_end_date"),
|
|
70
72
|
)
|
|
71
73
|
.join(
|
|
72
74
|
child_episode_subq,
|
|
@@ -31,4 +31,6 @@ treatment_regimen_with_cycles = get_episode_hierarchy_query(
|
|
|
31
31
|
parent_episode_subq=treatment_regimen_select,
|
|
32
32
|
child_episode_subq=treatment_cycle_select,
|
|
33
33
|
name="treatment_regimen_with_cycles",
|
|
34
|
+
parent_label="regimen_episode",
|
|
35
|
+
child_label="cycle_episode"
|
|
34
36
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/concepts/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/conditions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/episodes/__init__.py
RENAMED
|
File without changes
|
{omop_constructs-0.2.5 → omop_constructs-0.2.7}/src/omop_constructs/alchemy/modifiers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omop_constructs-0.2.5 → omop_constructs-0.2.7}/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.2.5 → omop_constructs-0.2.7}/src/omop_constructs/semantics/runtime_lookups.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|