Merged
Conversation
added 2 commits
April 10, 2026 21:39
- Introduced a new script `fhir_resolver.py` that demonstrates FHIR-to-OMOP concept resolution using the OMOPHub SDK. - The script includes examples for resolving SNOMED, ICD-10-CM, LOINC, RxNorm codes, and text-only semantic searches. - Added functionality for direct standard lookups, non-standard code mapping, and Phoebe recommendations. - Supports batch resolution and asynchronous usage for improved performance.
- Added support for FHIR type interoperability in the resolver, allowing acceptance of various Coding-like inputs (dicts, TypedDicts, and objects with .system/.code attributes). - Introduced new FHIR type definitions (`Coding`, `CodeableConcept`) and runtime-checkable protocols (`CodingLike`, `CodeableConceptLike`) for structural matching. - Implemented FHIR client interop helpers to configure external libraries (`fhirpy`, `fhir.resources`) with OMOPHub's FHIR Terminology Service. - Enhanced `Fhir.resolve`, `Fhir.resolve_batch`, and `Fhir.resolve_codeable_concept` methods to accept mixed input types. - Updated documentation and examples to reflect new functionalities and usage patterns. - Added comprehensive unit and integration tests to validate new features and ensure compatibility.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
2 issues found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/omophub/fhir_interop.py">
<violation number="1" location="src/omophub/fhir_interop.py:77">
P2: Missing `# type: ignore[import-not-found]` on the `fhirpy` import will cause MyPy checks to fail if the optional dependency is not installed in the type-checking environment.</violation>
</file>
<file name="src/omophub/resources/fhir.py">
<violation number="1" location="src/omophub/resources/fhir.py:60">
P2: Filter dict inputs down to the resolver's supported coding keys before building the request body.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Updated example scripts. - Adjusted search and resolution methods in examples to reflect the new API response structures, ensuring consistency across examples. - Improved documentation and comments in example scripts for clarity and better user guidance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds FHIR type interoperability and client helpers so you can pass Coding-like objects directly and connect external FHIR clients to OMOPHub. Examples now read
OMOPHUB_API_KEYfrom the environment and search examples reflect the flat list output.New Features
client.fhir.resolvesupportscoding=(dicts,omophub.types.fhir.Coding, or any object with.system/.code/.display); explicitsystem/codeoverridecoding.resolve_batchaccepts mixed inputs.resolve_codeable_conceptaccepts a CodeableConcept-like object or a list.Coding,CodeableConcept, and runtime protocolsCodingLike,CodeableConceptLikefor duck typing.omophub.fhir_interopaddsget_fhir_server_url(supportsr4,r4b,r5,r6),get_fhirpy_client,get_async_fhirpy_client; re-exported at top-level. NewOMOPHub.fhir_server_url/AsyncOMOPHub.fhir_server_urlreturn the R4 base URL.examples/fhir_interop.py; updated examples and README to use env API key and show flat list results fromsearch.basic.Dependencies
omophub[fhirpy]installsfhirpy>=1.4.0;omophub[fhir-resources]installsfhir.resources>=7.0.0.fhirpyis lazily imported by helpers; no new required dependencies.Written for commit 7f2014f. Summary will update on new commits.