omop-constructs 0.7.0__tar.gz → 0.9.0__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.
Files changed (140) hide show
  1. omop_constructs-0.9.0/.githooks/pre-commit +36 -0
  2. omop_constructs-0.9.0/.github/CONTRIBUTING.md +27 -0
  3. omop_constructs-0.9.0/.github/ISSUE_TEMPLATE/bug_report.yml +66 -0
  4. omop_constructs-0.9.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  5. omop_constructs-0.9.0/.github/ISSUE_TEMPLATE/feature_request.yml +32 -0
  6. omop_constructs-0.9.0/.github/ISSUE_TEMPLATE/not_working.yml +65 -0
  7. omop_constructs-0.9.0/.github/PULL_REQUEST_TEMPLATE.md +9 -0
  8. omop_constructs-0.9.0/.github/release-drafter.yml +31 -0
  9. omop_constructs-0.9.0/.github/workflows/ci.yml +35 -0
  10. omop_constructs-0.9.0/.github/workflows/docs.yml +10 -0
  11. omop_constructs-0.9.0/.github/workflows/merge.yml +13 -0
  12. omop_constructs-0.9.0/.github/workflows/publish.yml +21 -0
  13. omop_constructs-0.9.0/.gitignore +20 -0
  14. omop_constructs-0.9.0/.python-version +1 -0
  15. omop_constructs-0.9.0/CHANGELOG.md +235 -0
  16. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/PKG-INFO +19 -19
  17. omop_constructs-0.9.0/construct-contracts.toml +1438 -0
  18. omop_constructs-0.9.0/docs/architecture.md +195 -0
  19. omop_constructs-0.9.0/docs/construct-catalog.md +52 -0
  20. omop_constructs-0.9.0/docs/constructs/demography.md +35 -0
  21. omop_constructs-0.9.0/docs/constructs/episodes.md +318 -0
  22. omop_constructs-0.9.0/docs/constructs/events.md +221 -0
  23. omop_constructs-0.9.0/docs/constructs/modifiers.md +174 -0
  24. omop_constructs-0.9.0/docs/index.md +106 -0
  25. omop_constructs-0.9.0/docs/js/mermaid-init.js +6 -0
  26. omop_constructs-0.9.0/docs/usage.md +191 -0
  27. omop_constructs-0.9.0/mkdocs.yml +55 -0
  28. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/pyproject.toml +30 -7
  29. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/conditions/condition_joins.py +0 -2
  30. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/demography/demography_matview.py +2 -0
  31. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/demography/demography_queries.py +4 -0
  32. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/course_mv.py +2 -1
  33. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/episode_factories.py +1 -1
  34. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/modality_intent_mv.py +1 -2
  35. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/surgical_joins.py +0 -1
  36. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/surgical_procedure_mv.py +1 -1
  37. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/systemic_treatment_mv.py +2 -1
  38. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/treatment_envelope_mv.py +0 -3
  39. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/treatment_summary_mv.py +0 -2
  40. omop_constructs-0.9.0/src/omop_constructs/alchemy/events/event_factories.py +736 -0
  41. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/event_queries.py +16 -1
  42. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/observation_queries.py +6 -1
  43. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/procedure_queries.py +6 -1
  44. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/modifiers/condition_modifier_join.py +72 -46
  45. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/modifiers/condition_modifier_mv.py +1 -1
  46. omop_constructs-0.9.0/src/omop_constructs/alchemy/modifiers/modifier_factories.py +249 -0
  47. omop_constructs-0.9.0/src/omop_constructs/alchemy/modifiers/modifier_joins.py +93 -0
  48. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/modifiers/procedure_modifier_joins.py +0 -1
  49. omop_constructs-0.9.0/src/omop_constructs/cli.py +150 -0
  50. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/__init__.py +17 -3
  51. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/base.py +1 -1
  52. omop_constructs-0.9.0/src/omop_constructs/core/catalogue.py +279 -0
  53. omop_constructs-0.9.0/src/omop_constructs/core/contracts.py +405 -0
  54. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/registry.py +4 -5
  55. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/semantics/lookups.py +1 -2
  56. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/services/concept.py +1 -1
  57. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/typing.py +1 -2
  58. omop_constructs-0.9.0/tests/README.md +95 -0
  59. omop_constructs-0.9.0/tests/artifacts/.gitkeep +1 -0
  60. omop_constructs-0.9.0/tests/artifacts/construct_registry_schema.csv +586 -0
  61. omop_constructs-0.9.0/tests/conftest.py +335 -0
  62. omop_constructs-0.9.0/tests/test_config_and_cli.py +115 -0
  63. omop_constructs-0.9.0/tests/test_construct_catalogue_render.py +107 -0
  64. omop_constructs-0.9.0/tests/test_construct_contracts.py +455 -0
  65. omop_constructs-0.9.0/tests/test_construct_registry_compile_check.py +164 -0
  66. omop_constructs-0.9.0/tests/test_construct_registry_postgres.py +51 -0
  67. omop_constructs-0.9.0/tests/test_dx_event_window_scope.py +296 -0
  68. omop_constructs-0.9.0/tests/test_event_attachment.py +783 -0
  69. omop_constructs-0.9.0/tests/test_mapper_warnings_are_errors.py +126 -0
  70. omop_constructs-0.9.0/tests/test_modified_condition_attachment.py +231 -0
  71. omop_constructs-0.9.0/tests/test_modifier_wrapper_compatibility.py +207 -0
  72. omop_constructs-0.9.0/tests/test_narrow_consumer_imports.py +172 -0
  73. omop_constructs-0.9.0/tests/test_primary_diagnosis_condition_mv.py +291 -0
  74. omop_constructs-0.9.0/tests/test_registry_schema_artifact_postgres.py +85 -0
  75. omop_constructs-0.9.0/tests/test_registry_schema_snapshot.py +91 -0
  76. omop_constructs-0.9.0/tests/test_release_validation_sql.py +620 -0
  77. omop_constructs-0.9.0/tests/test_semantic_anchor_sets.py +56 -0
  78. omop_constructs-0.9.0/tests/test_stage_modifier_null_spine.py +113 -0
  79. omop_constructs-0.9.0/tools/release_validation/README.md +91 -0
  80. omop_constructs-0.9.0/tools/release_validation/_common.py +321 -0
  81. omop_constructs-0.9.0/tools/release_validation/_sql_normalise.py +104 -0
  82. omop_constructs-0.9.0/tools/release_validation/collect_key_metrics.py +365 -0
  83. omop_constructs-0.9.0/tools/release_validation/compare_schemas.py +542 -0
  84. omop_constructs-0.9.0/uv.lock +2740 -0
  85. omop_constructs-0.7.0/src/omop_constructs/alchemy/events/event_factories.py +0 -326
  86. omop_constructs-0.7.0/src/omop_constructs/alchemy/modifiers/modifier_factories.py +0 -128
  87. omop_constructs-0.7.0/src/omop_constructs/alchemy/modifiers/modifier_joins.py +0 -59
  88. omop_constructs-0.7.0/src/omop_constructs/cli.py +0 -59
  89. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/README.md +0 -0
  90. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/__init__.py +0 -0
  91. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/_lazy_imports.py +0 -0
  92. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/__init__.py +0 -0
  93. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/adapters.py +0 -0
  94. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/concepts/__init__.py +0 -0
  95. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/concepts/concept_mappers.py +0 -0
  96. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/concepts/concept_standardisation.py +0 -0
  97. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/conditions/__init__.py +0 -0
  98. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/conditions/condition_mappers.py +0 -0
  99. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/demography/__init__.py +0 -0
  100. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/__init__.py +0 -0
  101. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/condition_episode_mv.py +0 -0
  102. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/condition_episode_objects.py +0 -0
  103. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/consult_window_mv.py +0 -0
  104. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/consult_window_query.py +0 -0
  105. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/course_joins.py +0 -0
  106. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/cycle_join.py +0 -0
  107. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/cycle_mv.py +0 -0
  108. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/episode_joins.py +0 -0
  109. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/fraction_joins.py +0 -0
  110. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/fraction_mv.py +0 -0
  111. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/modality_intent_join.py +0 -0
  112. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/systemic_treatment_joins.py +0 -0
  113. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/treatment_envelope_query.py +0 -0
  114. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/episodes/treatment_summary_joins.py +0 -0
  115. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/__init__.py +0 -0
  116. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/dx_linked_event_mv.py +0 -0
  117. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/dx_linked_obs_mv.py +0 -0
  118. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/dx_linked_procedure_mv.py +0 -0
  119. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/dx_linked_visit_mv.py +0 -0
  120. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/events/visit_queries.py +0 -0
  121. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/modifiers/__init__.py +0 -0
  122. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/modifiers/modifier_mappers.py +0 -0
  123. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/modifiers/procedure_modifier_mv.py +0 -0
  124. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/alchemy/source_factories.py +0 -0
  125. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/bootstrap.py +0 -0
  126. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/bootstrap_modules.py +0 -0
  127. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/config.py +0 -0
  128. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/constructs.py +0 -0
  129. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/ddl.py +0 -0
  130. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/errors.py +0 -0
  131. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/materialized.py +0 -0
  132. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/plan.py +0 -0
  133. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/schema_snapshot.py +0 -0
  134. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/core/sql.py +0 -0
  135. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/py.typed +0 -0
  136. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/semantics/__init__.py +0 -0
  137. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/semantics/adapters.py +0 -0
  138. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/semantics/runtime_lookups.py +0 -0
  139. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/services/__init__.py +0 -0
  140. {omop_constructs-0.7.0 → omop_constructs-0.9.0}/src/omop_constructs/services/person.py +0 -0
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # Canonical CAVA pre-commit hook: keeps uv.lock in sync with pyproject.toml.
3
+ #
4
+ # If pyproject.toml is staged, finds the specific dependency line(s) that
5
+ # changed (added, removed, or had their version spec edited) and refreshes
6
+ # only those packages in uv.lock via `uv lock --upgrade-package`. Does not
7
+ # touch any other package -- this is a targeted sync, not a blanket
8
+ # `uv lock`, so it never pulls in an unrelated upstream release.
9
+ set -euo pipefail
10
+
11
+ if ! git diff --cached --name-only | grep -q '^pyproject\.toml$'; then
12
+ exit 0
13
+ fi
14
+
15
+ if ! command -v uv >/dev/null 2>&1; then
16
+ echo "pre-commit: uv not found on PATH, skipping uv.lock sync" >&2
17
+ exit 0
18
+ fi
19
+
20
+ changed_names=$(git diff --cached -- pyproject.toml \
21
+ | sed -nE 's/^[+-][[:space:]]*"([A-Za-z0-9][A-Za-z0-9._-]*).*/\1/p' \
22
+ | sort -u)
23
+
24
+ if [ -z "$changed_names" ]; then
25
+ exit 0
26
+ fi
27
+
28
+ upgrade_args=()
29
+ while IFS= read -r name; do
30
+ upgrade_args+=(--upgrade-package "$name")
31
+ done <<< "$changed_names"
32
+
33
+ echo "pre-commit: syncing uv.lock for changed dependencies:"
34
+ echo "$changed_names" | sed 's/^/ - /'
35
+ uv lock "${upgrade_args[@]}"
36
+ git add uv.lock
@@ -0,0 +1,27 @@
1
+ # Contributing
2
+
3
+ ## Development setup
4
+
5
+ ```bash
6
+ uv sync --all-extras --dev
7
+ uv run pytest -q
8
+ uv run ruff check .
9
+ ```
10
+
11
+ ## Opening a pull request
12
+
13
+ 1. Apply **exactly one** label before merging:
14
+
15
+ | Label | When to use |
16
+ |---|---|
17
+ | `breaking` | Public API change, backward-incompatible |
18
+ | `feature` | New functionality, backward-compatible |
19
+ | `fix` | Bug fix |
20
+ | `dependencies` | Dependency version update |
21
+ | `chore` | CI changes, refactoring, test additions, docs — anything that does not affect the public-facing package. Bypasses the label gate; excluded from the changelog and does not bump the version. |
22
+
23
+ 2. When merging (squash), write a clear extended description in the merge dialog. That text — not the PR's opening description — becomes the changelog entry for this change. Leave it blank for `chore` PRs.
24
+
25
+ ## Versioning and releases
26
+
27
+ Versions are derived from git tags; there is no version string in any source file. Releases are triggered by a maintainer publishing the standing draft release on the repository's Releases page. There is no automated commit-back to `main`.
@@ -0,0 +1,66 @@
1
+ name: "🐞 Bug Report"
2
+ description: Report a reproducible bug.
3
+ type: "Bug"
4
+ body:
5
+ - type: checkboxes
6
+ attributes:
7
+ label: Pre-flight
8
+ options:
9
+ - label: I searched existing issues and this is not a duplicate.
10
+ required: true
11
+
12
+ - type: textarea
13
+ id: summary
14
+ attributes:
15
+ label: Summary
16
+ description: One or two sentences describing the bug.
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: reproduction
22
+ attributes:
23
+ label: Reproduction
24
+ description: Steps and/or a minimal code example that reproduces the issue. Wrap code in triple backticks.
25
+ placeholder: |
26
+ 1. Import X and call Y with Z
27
+ 2. Observe error
28
+
29
+ ```python
30
+ # minimal example
31
+ ```
32
+ validations:
33
+ required: true
34
+
35
+ - type: textarea
36
+ id: actual
37
+ attributes:
38
+ label: Actual behaviour
39
+ validations:
40
+ required: true
41
+
42
+ - type: textarea
43
+ id: expected
44
+ attributes:
45
+ label: Expected behaviour
46
+ validations:
47
+ required: true
48
+
49
+ - type: textarea
50
+ id: logs
51
+ attributes:
52
+ label: Error output
53
+ description: Full traceback if applicable. Formatted automatically.
54
+ render: python-traceback
55
+
56
+ - type: textarea
57
+ id: system
58
+ attributes:
59
+ label: System info
60
+ description: |
61
+ Run this in your environment and paste the output:
62
+
63
+ ```shell
64
+ python <(curl -s https://raw.githubusercontent.com/AustralianCancerDataNetwork/cava-devops/main/scripts/cava_system_info.py)
65
+ ```
66
+ render: shell
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Discussions
4
+ url: https://github.com/orgs/AustralianCancerDataNetwork/discussions
5
+ about: Questions and general discussion about the CAVA stack.
@@ -0,0 +1,32 @@
1
+ name: "🚀 Feature Request"
2
+ description: Propose a new feature or enhancement.
3
+ type: "Feature"
4
+ body:
5
+ - type: checkboxes
6
+ attributes:
7
+ label: Pre-flight
8
+ options:
9
+ - label: I searched existing issues and this has not been requested before.
10
+ required: true
11
+
12
+ - type: textarea
13
+ id: problem
14
+ attributes:
15
+ label: Problem or motivation
16
+ description: What are you trying to do that you currently cannot?
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: proposal
22
+ attributes:
23
+ label: Proposed solution
24
+ description: How would you like this to work?
25
+ validations:
26
+ required: true
27
+
28
+ - type: textarea
29
+ id: alternatives
30
+ attributes:
31
+ label: Alternatives considered
32
+ description: Other approaches you considered and why you ruled them out.
@@ -0,0 +1,65 @@
1
+ name: "❗ Something is not working"
2
+ description: Something behaves unexpectedly but you are not sure if it is a bug.
3
+ body:
4
+ - type: checkboxes
5
+ attributes:
6
+ label: Pre-flight
7
+ options:
8
+ - label: I searched existing issues for this problem.
9
+ required: true
10
+
11
+ - type: textarea
12
+ id: summary
13
+ attributes:
14
+ label: Problem summary
15
+ description: 1-2 sentences describing what is not working.
16
+ validations:
17
+ required: true
18
+
19
+ - type: textarea
20
+ id: reproduction
21
+ attributes:
22
+ label: Reproduction
23
+ description: Steps and/or a minimal code example. Wrap code in triple backticks.
24
+ placeholder: |
25
+ 1. Import X and call Y with Z
26
+ 2. Observe unexpected behaviour
27
+
28
+ ```python
29
+ # minimal example
30
+ ```
31
+ validations:
32
+ required: true
33
+
34
+ - type: textarea
35
+ id: actual
36
+ attributes:
37
+ label: Actual outcome
38
+ validations:
39
+ required: true
40
+
41
+ - type: textarea
42
+ id: expected
43
+ attributes:
44
+ label: Expected outcome
45
+ validations:
46
+ required: true
47
+
48
+ - type: textarea
49
+ id: logs
50
+ attributes:
51
+ label: Error messages
52
+ description: Full traceback if applicable. Formatted automatically.
53
+ render: python-traceback
54
+
55
+ - type: textarea
56
+ id: system
57
+ attributes:
58
+ label: System info
59
+ description: |
60
+ Run this in your environment and paste the output:
61
+
62
+ ```shell
63
+ python <(curl -s https://raw.githubusercontent.com/AustralianCancerDataNetwork/cava-devops/main/scripts/cava_system_info.py)
64
+ ```
65
+ render: shell
@@ -0,0 +1,9 @@
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? This text becomes the changelog entry — write it for a reader who will see it months from now, not for the reviewer reading the diff. Leave blank for chore PRs. -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] Applied exactly one label (`breaking`, `feature`, `fix`, `dependencies`, or `chore`)
8
+ - [ ] Tests pass locally (`uv run pytest -q`)
9
+ - [ ] Lint passes (`uv run ruff check .`)
@@ -0,0 +1,31 @@
1
+ name-template: 'v$RESOLVED_VERSION'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+ commitish: main
4
+
5
+ categories:
6
+ - title: Breaking Changes
7
+ labels: ['breaking']
8
+ - title: Features
9
+ labels: ['feature']
10
+ - title: Fixes
11
+ labels: ['fix']
12
+ - title: Dependencies
13
+ labels: ['dependencies']
14
+
15
+ template: |
16
+ $CHANGES
17
+
18
+ change-template: '- **$TITLE** (#$NUMBER) @$AUTHOR'
19
+
20
+ version-resolver:
21
+ major:
22
+ labels: ['breaking']
23
+ minor:
24
+ labels: ['feature']
25
+ patch:
26
+ labels: ['fix', 'dependencies']
27
+ default: patch
28
+
29
+ exclude-labels: ['chore']
30
+
31
+ autolabeler: []
@@ -0,0 +1,35 @@
1
+ name: CI
2
+ on:
3
+ pull_request:
4
+ branches: [main]
5
+ types: [opened, synchronize, reopened, labeled, unlabeled]
6
+ jobs:
7
+ label-gate:
8
+ uses: AustralianCancerDataNetwork/cava-devops/.github/workflows/label-gate.yml@main
9
+ build-test-sqlite:
10
+ uses: AustralianCancerDataNetwork/cava-devops/.github/workflows/build-test.yml@main
11
+ with:
12
+ ty-src: src/omop_constructs
13
+ build-test-postgres:
14
+ uses: AustralianCancerDataNetwork/cava-devops/.github/workflows/build-test-postgres.yml@main
15
+ with:
16
+ ty-src: src/omop_constructs
17
+ postgres-db: omop_constructs_ci
18
+ # --test-only false is required, not incidental: OmopConstructsConfig.cdm_db is
19
+ # RefTo(CDMDatabaseConfig) with no is_test, and resolve_package_config rejects a
20
+ # non-test field pointing at a test_only connection. omop-alchemy's equivalent
21
+ # block uses --test-only true because its field is RefTo(..., is_test=True).
22
+ setup-commands: |
23
+ uv run omop-config connections add ci_pg \
24
+ --dialect postgresql+psycopg \
25
+ --host localhost \
26
+ --port 5432 \
27
+ --user test \
28
+ --password test \
29
+ --database-name omop_constructs_ci \
30
+ --test-only false
31
+ uv run omop-config databases add cdm_db \
32
+ --kind cdm \
33
+ --connection ci_pg \
34
+ --schema-name public \
35
+ --vocab-schema public
@@ -0,0 +1,10 @@
1
+ name: Deploy Docs
2
+ on:
3
+ push:
4
+ tags: ['v*']
5
+ workflow_dispatch:
6
+ permissions:
7
+ contents: write
8
+ jobs:
9
+ deploy:
10
+ uses: AustralianCancerDataNetwork/cava-devops/.github/workflows/deploy-docs.yml@main
@@ -0,0 +1,13 @@
1
+ name: Release Update
2
+ on:
3
+ pull_request:
4
+ types: [closed]
5
+ branches: [main]
6
+ permissions:
7
+ contents: write
8
+ pull-requests: read
9
+ jobs:
10
+ draft:
11
+ if: github.event.pull_request.merged == true
12
+ uses: AustralianCancerDataNetwork/cava-devops/.github/workflows/release-drafter.yml@main
13
+ secrets: inherit
@@ -0,0 +1,21 @@
1
+ name: Publish
2
+ on:
3
+ push:
4
+ tags: ['v*']
5
+ jobs:
6
+ build:
7
+ uses: AustralianCancerDataNetwork/cava-devops/.github/workflows/publish.yml@main
8
+ publish:
9
+ # Inline: PyPI OIDC checks job_workflow_ref, which must point to this file.
10
+ # Moving pypa/gh-action-pypi-publish into cava-devops would break the trusted publisher.
11
+ needs: build
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write
15
+ environment:
16
+ name: pypi
17
+ url: https://pypi.org/p/omop-constructs
18
+ steps:
19
+ - uses: actions/download-artifact@v4
20
+ with: { name: dist, path: dist/ }
21
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,20 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ *old*
13
+ .env
14
+ .DS_Store
15
+ _temp
16
+ notebooks/
17
+ .ipynb_checkpoints/
18
+
19
+ scripts/release_validation/
20
+ tests/test_transitional_release_scripts.py
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,235 @@
1
+ ## 0.1.1
2
+ - created services layer for functions that execute queries and return data / session-bound
3
+
4
+ ## 0.1.2
5
+ - condition modifier queries and factories
6
+
7
+ ## 0.1.3
8
+ - refactored condition modifier queries and factories
9
+
10
+ ## 0.1.4
11
+ - added in runtime lookups and support for concept resolver registry
12
+
13
+ ## 0.1.5
14
+ - typing
15
+
16
+ ## 0.1.6
17
+ - changed modifier field to correct one
18
+
19
+ ## 0.1.7
20
+ - modifier field
21
+
22
+ ## 0.1.8
23
+ - bugfix
24
+
25
+ ## 0.2.0
26
+ - bumped to beta with matview registry proper usage
27
+ - the depth of nested matview under condition mods really does need everything under it to be a matview too
28
+
29
+ ## 0.2.1
30
+ - bumped constrained versions of omop-alchemy and semantics
31
+
32
+ ## 0.2.2
33
+ - created initial episode views for disease eps
34
+
35
+ ## 0.2.3
36
+ - added eps as module
37
+
38
+ ## 0.2.4
39
+ - upversion semantics
40
+
41
+ ## 0.2.5
42
+ - treatment eps
43
+
44
+ ## 0.2.6
45
+ - update col for treatment eps
46
+
47
+ ## 0.2.7
48
+ - episode cols dynamic name correction
49
+
50
+ ## 0.2.8
51
+ - condition episode object mapper
52
+
53
+ ## 0.2.9
54
+ - measurements mat view
55
+
56
+ ## 0.2.10
57
+ - missed checkin
58
+
59
+ ## 0.2.11
60
+ - upversion semantics
61
+
62
+ ## 0.2.12
63
+ - demography
64
+
65
+ ## 0.2.13
66
+ - added cols for condition ep
67
+
68
+ ## 0.2.14
69
+ - simplified ep naming
70
+
71
+ ## 0.2.15
72
+ - fix label name
73
+
74
+ ## 0.2.16
75
+ - mets col adapt
76
+
77
+ ## 0.2.17
78
+ - mets cols thru to condition mods
79
+
80
+ ## 0.3.0
81
+ - all stage modifier mapper
82
+
83
+ ## 0.3.1
84
+ - fixed all stage cols
85
+
86
+ ## 0.3.2
87
+ - some treatment mappers
88
+
89
+ ## 0.3.3
90
+ - general case measurement mapper
91
+
92
+ ## 0.3.4
93
+ - nulltype on staging pk col
94
+
95
+ ## 0.3.5
96
+ - generic procedure mapper
97
+
98
+ ## 0.3.6
99
+ - generic observation mapper
100
+
101
+ ## 0.3.7
102
+ - fullly specified condition-treatment-summarisation mapper
103
+
104
+ ## 0.3.8
105
+ - added in condition code for substring matchers
106
+
107
+ ## 0.3.9
108
+ - condition code for mod condition and stage condition
109
+
110
+ ## 0.3.10
111
+ - sqlalchemy v2 mappings for demography columns
112
+
113
+ ## 0.3.11
114
+ - modify mv creation api
115
+
116
+ ## 0.3.12
117
+ - bugfix
118
+
119
+ ## 0.3.13
120
+ - bump
121
+
122
+ ## 0.3.14
123
+ - fix mod proc cols
124
+
125
+ ## 0.3.15
126
+ - treatment envelope
127
+
128
+ ## 0.3.16
129
+ - correcting fraction filter
130
+
131
+ ## 0.3.17
132
+ - modality treatment join
133
+
134
+ ## 0.3.18
135
+ - modailty treatment now linked to condition
136
+
137
+ ## 0.3.19
138
+ - correcting duplicated mv name
139
+
140
+ ## 0.3.20
141
+ - bugfix
142
+
143
+ ## 0.3.21
144
+ - bump
145
+
146
+ ## 0.3.22
147
+ - clashing mv names
148
+
149
+ ## 0.3.23
150
+ - country of birth not EAV
151
+
152
+ ## 0.3.24
153
+ - country of birth lookup fix
154
+
155
+ ## 0.4.0
156
+ - changed functionality for handling of date windows
157
+ - where no explicit event link exists, we now give either explicit date window of -90 < t < 365 days, or use episode window
158
+ - if episode window has no end date, we use episode start + 365 days
159
+ - date windowing can now be handled flexibly by downstream consumers
160
+
161
+ ## 0.4.1
162
+ - episode-linked specialist visit support
163
+
164
+ ## 0.4.2
165
+ - set version window for orm-loader
166
+
167
+ ## 0.4.3
168
+ - fixing the inclusion of downstream domain-specific columns in episode_relevant_window factory
169
+
170
+ ## 0.4.4
171
+ - added bootstrap-based complete registry loading and lazy package exports to reduce import fanout
172
+
173
+ ## 0.4.5
174
+ - bump version number
175
+
176
+ ## 0.4.6
177
+ - added primary diagnosis condition mv, registry compile/drift checks, postgres CI coverage, and schema snapshot artifact export
178
+
179
+ ## 0.4.7
180
+ - fixed treatment envelope window issues
181
+
182
+ ## 0.4.8
183
+ - treatment envelope should left join to death (bug fix)
184
+
185
+ ## 0.4.9
186
+ - surgery absence rule requires outer join
187
+
188
+ ## 0.4.10
189
+ - cast SACT and RT exposure dates to Date in sact_window and rt_window to prevent timestamp upcast contaminating LEAST/GREATEST results; fixes treatment_days_before_death and days_from_dx_to_treatment storing as interval instead of integer
190
+
191
+ ## 0.5.0
192
+ - integrated oa-configurator package configuration and adapted omop-constructs to current orm-loader / omop-alchemy compatibility changes
193
+
194
+ ## 0.5.2
195
+ - 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
196
+
197
+ ## 0.5.3
198
+ - adding separate distinct handling for joining surgeries in with episodes when there is an explicit link to a specific diagnosis
199
+
200
+ ## 0.5.4
201
+ - fix for episode intent - this actually modifies procedure, not episode
202
+
203
+ # 0.5.5
204
+ - actual fix for episode intent via parent
205
+
206
+ # 0.5.6
207
+ - pin oa-configurator version
208
+
209
+ # 0.6.1
210
+ - switched the four resolvers from the deprecated `.ids` accessor to `.parent_ids`
211
+ - `rt_procedures` resolves from the governed `cancer_procedures.radiotherapy` group instead of hand-assembling
212
+
213
+ # 0.7.0
214
+ - pin the resolved CDM engine URL so the oa-configurator 1.x migration can prove it did not repoint the database
215
+ - moved to omop-alchemy 1.x, oa-configurator 1.x and orm-loader 1.x
216
+ - concept resolver imports follow omop-alchemy's move from `cdm.handlers` to `toolkit.core.concepts`
217
+
218
+ # 0.7.1
219
+ - `construct-contracts.toml`: the wheel-packaged, machine-readable D3 grain catalogue. Records the grain, intended logical key, ORM identity, surrogate stability, per-input fan-out, concurrent-refresh eligibility, 1.0 inclusion, and lung-report usage of all 43 registered constructs, plus a findings register
220
+ - `omop_constructs.core.contracts` loads and validates that manifest; `omop_constructs.core.catalogue` renders it into `docs/construct-catalog.md`
221
+ - new CLI subcommands `contracts` and `render-catalogue`
222
+ - registry coverage and key-column validation tests: a construct with no declared grain, or a declared key naming a column that does not exist in both the mapper and the materialized-view select, now fails
223
+ - focused test asserting a clean construct import emits no SQLAlchemy mapper warnings, with a companion test proving the promoted filter bites
224
+ - `tools/release_validation/`: release comparison tools. `collect_key_metrics.py` measures a built schema against the declared keys in `construct-contracts.toml`; `compare_schemas.py` compares two built schemas with `EXCEPT ALL`, by construct and by person. Metadata comparisons stay database-side and optional clinical samples are bounded before transfer.
225
+ - `sact_treatment_mv` and `rt_course_mv` declare their `modified_procedure_mv` dependency, which both read but neither listed. Build order previously held only because of module import order
226
+ - reconciled the construct catalogue prose with the actual queries for surgery attribution, SACT and RT grain, the treatment envelope, and event attachment
227
+ - release validation normalises rendered SQL before checksumming: resolved concept-ID lists are emitted in hash-seed-dependent set order, and PostgreSQL stores the qualified schema name of every referenced object, so unnormalised checksums reported roughly a quarter of the registry as changed on every run
228
+
229
+ # 0.8.0
230
+ - diagnosis-linked Measurement, Observation, and Procedure Occurrence constructs now use omop-alchemy's canonical event projection and explicit-first episode attachment policy
231
+ - valid explicit links require the event ID, Field-concept discriminator, episode, and person to agree; exact duplicate links collapse and linked events no longer also enter date-window fallback
232
+ - unlinked events select one eligible episode of care deterministically: already-started episodes first, then nearest episode start, then lowest episode ID; valid explicit multi-links remain intact
233
+ - custom event factories can select an `EpisodeAttachmentPolicy` and `TemporalRankingSpec`; deprecated Boolean and direct-helper calls issue warnings that identify the policy-based replacement
234
+ - ranked date-window fallback considers episodes of care only, so an unlinked event can no longer attach to a later-starting progression or metastatic episode; those episodes receive events only through valid explicit links. All-in-window and explicit-only policies are unchanged. Requires omop-alchemy>=1.2.1 for the separate explicit-link and fallback episode sources
235
+ - deployments must rebuild the diagnosis-linked event views, leaf modifier views, `modified_conditions_mv`, `stage_modifier_mv`, and `person_demography_mv`, plus `consult_window_mv` and their dependent views in dependency order; ANALYZE each immediately after building. An in-place refresh does not replace a PostgreSQL materialized-view definition
@@ -1,28 +1,28 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.5
2
2
  Name: omop-constructs
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: For building complex constructs on top of the omop-alchemy library.
5
- Author: Georgie Kennedy
6
5
  Author-email: Georgie Kennedy <georgina.kennedy@unsw.edu.au>
7
- Requires-Dist: oa-configurator>=1.2.1,<2
8
- Requires-Dist: omop-alchemy[postgres]>=1.0,<2
6
+ Requires-Python: >=3.12
7
+ Requires-Dist: oa-configurator<2,>=1.2.1
8
+ Requires-Dist: omop-alchemy[postgres]<2,>=1.2.2
9
9
  Requires-Dist: omop-semantics>=0.6.0
10
- Requires-Dist: orm-loader>=1.0,<2
10
+ Requires-Dist: orm-loader<2,>=1.2.0
11
11
  Requires-Dist: sqlalchemy>=2.0.45
12
- Requires-Dist: ipython>=9.8.0 ; extra == 'dev'
13
- Requires-Dist: mypy>=1.19.1 ; extra == 'dev'
14
- Requires-Dist: pytest>=9.0.3 ; extra == 'dev'
15
- Requires-Dist: pytest-cov>=7.0.0 ; extra == 'dev'
16
- Requires-Dist: tornado>=6.5.5 ; extra == 'dev'
17
- Requires-Dist: mkdocs<2.0 ; extra == 'dev'
18
- Requires-Dist: mkdocs-material ; extra == 'dev'
19
- Requires-Dist: mkdocstrings[python] ; extra == 'dev'
20
- Requires-Dist: mkdocs-mermaid2-plugin ; extra == 'dev'
21
- Requires-Dist: mkdocs-table-reader-plugin ; extra == 'dev'
22
- Requires-Dist: mkdocs-macros-plugin ; extra == 'dev'
23
- Requires-Dist: pygments>=2.20.0 ; extra == 'dev'
24
- Requires-Python: >=3.12
25
12
  Provides-Extra: dev
13
+ Requires-Dist: ipython>=9.8.0; extra == 'dev'
14
+ Requires-Dist: mkdocs-macros-plugin; extra == 'dev'
15
+ Requires-Dist: mkdocs-material; extra == 'dev'
16
+ Requires-Dist: mkdocs-mermaid2-plugin; extra == 'dev'
17
+ Requires-Dist: mkdocs-table-reader-plugin; extra == 'dev'
18
+ Requires-Dist: mkdocs<2.0; extra == 'dev'
19
+ Requires-Dist: mkdocstrings[python]; extra == 'dev'
20
+ Requires-Dist: pygments>=2.20.0; extra == 'dev'
21
+ Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
22
+ Requires-Dist: pytest>=9.0.3; extra == 'dev'
23
+ Requires-Dist: ruff<0.16,>=0.15; extra == 'dev'
24
+ Requires-Dist: tornado>=6.5.5; extra == 'dev'
25
+ Requires-Dist: ty==0.0.61; extra == 'dev'
26
26
  Description-Content-Type: text/markdown
27
27
 
28
28
  # omop-constructs