aimedicalcoding 0.3.1__tar.gz → 0.3.3__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 (73) hide show
  1. {aimedicalcoding-0.3.1/aimedicalcoding.egg-info → aimedicalcoding-0.3.3}/PKG-INFO +1 -1
  2. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/README.md +13 -4
  3. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/serialize.py +24 -14
  4. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3/aimedicalcoding.egg-info}/PKG-INFO +1 -1
  5. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/GAP_SCHEMA.md +6 -4
  6. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/setup.py +1 -1
  7. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/LICENSE +0 -0
  8. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/MANIFEST.in +0 -0
  9. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/README_PYPI.md +0 -0
  10. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/__init__.py +0 -0
  11. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/__main__.py +0 -0
  12. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/__init__.py +0 -0
  13. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/base.py +0 -0
  14. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/ccda/__init__.py +0 -0
  15. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/ccda/adapter.py +0 -0
  16. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/ccda/codes.py +0 -0
  17. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/ccda/narrative.py +0 -0
  18. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/ccda/sections.py +0 -0
  19. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/custom_json/__init__.py +0 -0
  20. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/custom_json/adapter.py +0 -0
  21. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/fhir/__init__.py +0 -0
  22. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/fhir/adapter.py +0 -0
  23. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/fhir/codes.py +0 -0
  24. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/adapters/fhir/mapping.py +0 -0
  25. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/api.py +0 -0
  26. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/core/__init__.py +0 -0
  27. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/core/checkdigits.py +0 -0
  28. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/core/models.py +0 -0
  29. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/core/system_registry.py +0 -0
  30. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/pipeline/__init__.py +0 -0
  31. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/pipeline/orchestrator.py +0 -0
  32. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/recovery/__init__.py +0 -0
  33. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/recovery/engine.py +0 -0
  34. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/__init__.py +0 -0
  35. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/base.py +0 -0
  36. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/cvx/__init__.py +0 -0
  37. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/cvx/handler.py +0 -0
  38. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/cvx/normalize.py +0 -0
  39. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/cvx/patterns.py +0 -0
  40. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/icd10cm/__init__.py +0 -0
  41. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/icd10cm/handler.py +0 -0
  42. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/icd10cm/icdformat.py +0 -0
  43. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/icd10cm/patterns.py +0 -0
  44. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/loinc/__init__.py +0 -0
  45. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/loinc/axes.py +0 -0
  46. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/loinc/handler.py +0 -0
  47. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/loinc/normalize.py +0 -0
  48. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/loinc/patterns.py +0 -0
  49. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/rxnorm/__init__.py +0 -0
  50. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/rxnorm/handler.py +0 -0
  51. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/rxnorm/normalize.py +0 -0
  52. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/rxnorm/patterns.py +0 -0
  53. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/snomed/__init__.py +0 -0
  54. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/snomed/handler.py +0 -0
  55. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/snomed/hierarchy.py +0 -0
  56. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/snomed/patterns.py +0 -0
  57. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/systems/snomed/qualifiers.py +0 -0
  58. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/terminology/__init__.py +0 -0
  59. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding/terminology/service.py +0 -0
  60. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding.egg-info/SOURCES.txt +0 -0
  61. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding.egg-info/dependency_links.txt +0 -0
  62. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding.egg-info/entry_points.txt +0 -0
  63. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding.egg-info/requires.txt +0 -0
  64. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/aimedicalcoding.egg-info/top_level.txt +0 -0
  65. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/ARCHITECTURE.md +0 -0
  66. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/OUTPUT_GUIDE.md +0 -0
  67. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/patterns/CVX_pattern_analysis.md +0 -0
  68. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/patterns/ICD10CM_pattern_analysis.md +0 -0
  69. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/patterns/LOINC_pattern_analysis.md +0 -0
  70. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/patterns/RxNorm_pattern_analysis.md +0 -0
  71. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/docs/patterns/SNOMED_pattern_analysis.md +0 -0
  72. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/pyproject.toml +0 -0
  73. {aimedicalcoding-0.3.1 → aimedicalcoding-0.3.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aimedicalcoding
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Detect missing/broken clinical codes (LOINC / SNOMED CT / RxNorm / ICD-10-CM / CVX) in CCDA and FHIR documents, with recovery evidence
5
5
  Author: Aakash Kag, Vinay Shankar Miryala, Siva Karthik, Mohammed Rayaan
6
6
  License: MIT
@@ -56,11 +56,20 @@ Run tests:
56
56
  ```bash
57
57
  pytest
58
58
  ```
59
- Build distributables (version comes from the git tag):
60
- ```bash
61
- python -m build
59
+
60
+ ### Publish to PyPI
61
+
62
+ See **`PUBLISHING.md`** for the full release guide (version bump in `setup.py`,
63
+ clean build, `twine check`, upload, verify, troubleshooting). Short version:
64
+
65
+ ```powershell
66
+ # bump version in setup.py first — PyPI rejects re-uploads of the same version
67
+ Remove-Item -Recurse -Force dist; python -m build
68
+ python -m twine check dist/*
69
+ python -m twine upload dist/* # credentials from ~/.pypirc
62
70
  ```
63
- Publish privately to AWS CodeArtifact (the repo is on CodeCommit):
71
+
72
+ Alternative: private publish to AWS CodeArtifact (the repo is on CodeCommit):
64
73
  ```bash
65
74
  aws codeartifact login --tool twine --domain <domain> --repository <repo>
66
75
  twine upload --repository codeartifact dist/*
@@ -121,13 +121,18 @@ def _dedupe(items) -> list:
121
121
  return out
122
122
 
123
123
 
124
- # SNOMED search-term enrichment: sections whose gaps also get the CODE-slot
125
- # labels appended (Problems 11450-4, Allergies 48765-2, Social History 29762-2),
126
- # matched by section LOINC or by the contexts those sections route to
127
- # (FHIR resources often carry no meta.tag/section code).
128
- _SNOMED_LABEL_SECTIONS = {"11450-4", "48765-2", "29762-2"}
129
- _SNOMED_LABEL_CONTEXTS = {"problem", "allergy_substance", "allergy_reaction",
130
- "social_history"}
124
+ # SNOMED search-term enrichment (Problems 11450-4, Allergies 48765-2, Social
125
+ # History 29762-2), matched by section LOINC or by the contexts those sections
126
+ # route to (FHIR resources often carry no meta.tag/section code). Which slot's
127
+ # labels get appended differs by section:
128
+ # - Social History -> CODE tag labels (the question, e.g. "Gender identity"
129
+ # the value label is often a placeholder like "Not on file")
130
+ # - Problems / Allergies -> VALUE tag labels (the concept; the code tag is a
131
+ # generic marker like ASSERTION / "Problem" — appending it is noise)
132
+ _SNOMED_CODE_LABEL_SECTIONS = {"29762-2"}
133
+ _SNOMED_CODE_LABEL_CONTEXTS = {"social_history"}
134
+ _SNOMED_VALUE_LABEL_SECTIONS = {"11450-4", "48765-2"}
135
+ _SNOMED_VALUE_LABEL_CONTEXTS = {"problem", "allergy_substance", "allergy_reaction"}
131
136
 
132
137
 
133
138
  def _recovery(record: NormalizedRecord, slot: str, system: str) -> dict:
@@ -141,13 +146,18 @@ def _recovery(record: NormalizedRecord, slot: str, system: str) -> dict:
141
146
  terms = [stmt.display_name, stmt.original_text]
142
147
  # add any normalized term the handler produced
143
148
  terms += [ev.get("analyte_normalized"), ev.get("term_normalized"), ev.get("ingredient")]
144
- # SNOMED only, Problems/Allergies/Social History only: append the CODE
145
- # tag's displayName/originalText (never the value's) as trailing context
146
- # e.g. the question label when the value label is a placeholder.
147
- if system == System.SNOMEDCT.value and (
148
- stmt.section_code in _SNOMED_LABEL_SECTIONS
149
- or stmt.context in _SNOMED_LABEL_CONTEXTS):
150
- terms += [stmt.display_name, stmt.original_text]
149
+ # SNOMED only, Problems/Allergies/Social History only: append trailing
150
+ # label context from the section-appropriate slot (see constants above).
151
+ if system == System.SNOMEDCT.value:
152
+ if (stmt.section_code in _SNOMED_CODE_LABEL_SECTIONS
153
+ or stmt.context in _SNOMED_CODE_LABEL_CONTEXTS):
154
+ terms += [stmt.display_name, stmt.original_text]
155
+ elif (stmt.section_code in _SNOMED_VALUE_LABEL_SECTIONS
156
+ or stmt.context in _SNOMED_VALUE_LABEL_CONTEXTS):
157
+ if stmt.value:
158
+ terms += [stmt.value.coded_value.display
159
+ if stmt.value.coded_value else None,
160
+ stmt.value.original_text]
151
161
 
152
162
  rec = {
153
163
  "search_terms": _dedupe(terms),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aimedicalcoding
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Detect missing/broken clinical codes (LOINC / SNOMED CT / RxNorm / ICD-10-CM / CVX) in CCDA and FHIR documents, with recovery evidence
5
5
  Author: Aakash Kag, Vinay Shankar Miryala, Siva Karthik, Mohammed Rayaan
6
6
  License: MIT
@@ -89,10 +89,12 @@ Each record separates four concerns:
89
89
  - `target.slot = "code"` (LOINC) → search `observation.code.display_text` / `.original_text`.
90
90
  - `target.slot = "value"` (SNOMED value-slot) → search `observation.value.display_text` / `.original_text`.
91
91
  `recovery.search_terms` already gives you the right ones, deduped.
92
- For **SNOMED-CT** targets in **Problems (11450-4), Allergies (48765-2) and
93
- Social History (29762-2)**, the CODE tag's `display_text`/`original_text`
94
- are additionally appended at the end (never the value's) — search context
95
- for when the value label is a placeholder like "Not on file".
92
+ For **SNOMED-CT** targets, extra label context is appended at the end,
93
+ section-specific: **Social History (29762-2)** appends the CODE tag's
94
+ `display_text`/`original_text` (the question useful when the value label
95
+ is a placeholder like "Not on file"); **Problems (11450-4)** and
96
+ **Allergies (48765-2)** append the VALUE tag's labels (the concept — the
97
+ code tag there is a generic marker like ASSERTION/"Problem").
96
98
 
97
99
  ---
98
100
 
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="aimedicalcoding",
5
- version="0.3.1",
5
+ version="0.3.3",
6
6
  author="Aakash Kag, Vinay Shankar Miryala, Siva Karthik, Mohammed Rayaan",
7
7
  description=(
8
8
  "Detect missing/broken clinical codes (LOINC / SNOMED CT / RxNorm / "
File without changes