Skip to content

Fhir resolver#10

Merged
alex-omophub merged 7 commits intomainfrom
fhir-resolver
Apr 10, 2026
Merged

Fhir resolver#10
alex-omophub merged 7 commits intomainfrom
fhir-resolver

Conversation

@alex-omophub
Copy link
Copy Markdown
Member

@alex-omophub alex-omophub commented Apr 10, 2026

Summary by cubic

Adds a FHIR-to-OMOP resolver so apps can translate FHIR codings into OMOP standard concepts, target CDM tables, and optional recommendations in one call. Also unifies response parsing and fixes async pagination.

  • New Features

    • client.fhir with resolve(), resolve_batch(), and resolve_codeable_concept() for single, batch (up to 100), and CodeableConcept resolution.
    • Returns source and standard concepts, target table, domain alignment, and optional Phoebe recommendations and quality.
    • Works in both sync (OMOPHub) and async (AsyncOMOPHub) clients; new types added: FhirResolveResult, FhirResolution, FhirBatchResult, FhirBatchSummary, FhirCodeableConceptResult, ResolvedConcept, RecommendedConceptOutput.
    • README updated with usage examples.
  • Refactors

    • Consolidated JSON/error parsing into _parse_and_raise() and wired it into sync/async request paths.
    • Fixed paginate_async to require an async callable and updated AsyncSearch.semantic_iter to use paginate_async.
    • Minor housekeeping: Python 3.10+ in CONTRIBUTING, sorted __all__ in types/__init__.py.

Written for commit 4be3a32. Summary will update on new commits.

alex-omophub and others added 7 commits April 10, 2026 20:01
… handling

- Added FHIR resource access to both synchronous and asynchronous OMOPHub clients.
- Updated CHANGELOG to reflect changes in rate-limit handling, including honoring the `Retry-After` header and implementing exponential backoff with jitter for retries.
- Included new FHIR-related types in the type definitions for better integration.
* CI pipeline

* Publish action

* Refactor type hinting for vocabulary_ids to use builtins.list for consistency

* Import builtins conditionally in type checking for improved clarity

* Codecov settings in CI

* Update README.md to include Codecov badge and change License badge color

* Update CHANGELOG for v0.2.0: add parameters to `concepts.get_by_code()` for synonyms and relationships, and update User-Agent header format.

* Update CHANGELOG.md

* Add website link to README.md

* Readme updates

* Documentation

* Corrections

* v1.3.0 preparation

* Release preparation

* Integration tests

* Improved tests

* Examples update

* Downloads badge

* Sponsorship

* Add integration tests for standard concept filtering and multiple filters with pagination

* Prepare release v1.3.1

* Refactor tests for API key validation and enhance request handling tests. Updated synchronous and asynchronous client tests to use monkeypatching for API key checks. Added new tests for handling raw requests, including error parsing, rate limits, and JSON decoding issues.

* Update vocab_version in tests for consistency across mock responses and client configurations.

* Extending mapping method with source_codes option

* Add semantic and similar search functionality with corresponding types and integration tests

- Introduced `semantic` and `similar` search methods in the search resource, allowing for advanced concept searches using neural embeddings and similarity algorithms.
- Added new TypedDicts for `SemanticSearchResult`, `SemanticSearchMeta`, `SimilarConcept`, and `SimilarSearchResult` to structure the response data.
- Implemented integration tests for semantic search, including filtering and pagination, as well as tests for finding similar concepts by ID and name.
- Updated type imports and ensured compatibility with existing search functionality.

* Add semantic search examples to README

* Refactor README and integration tests to streamline result extraction

- Updated README example to reflect changes in the results structure for semantic search.
- Refactored integration tests to utilize a new `extract_data` function for consistent handling of results and similar concepts, improving code clarity and maintainability.

* Update CI workflow to support multiple branches and manual triggering

* Update minimum similarity threshold in search.py from 0.3 to 0.5 for improved filtering accuracy.

* v1.4.0 release

* Increase rate limit delay in integration tests from 1 second to 2 seconds for improved test reliability.

* Update version handling

* Prepare v1.4.1 release

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add retry logic for server errors in SyncHTTPClient and AsyncHTTPClientImpl

- Implemented retry mechanism for handling server errors (502, 503, 504) in both synchronous and asynchronous HTTP clients.
- Added exponential backoff delay for retries to improve resilience against temporary server issues.

* Refactor retry condition formatting in SyncHTTPClient and AsyncHTTPClientImpl

* Add bulk search functionality to the API

- Introduced `bulk_basic` and `bulk_semantic` methods for executing multiple lexical and semantic searches in a single API call, respectively.
- Updated the README to include examples for bulk search usage.
- Added corresponding types for bulk search inputs and responses in the type definitions.
- Implemented integration and unit tests to validate the new bulk search features.

* Update type definitions to include bulk search and semantic search types

- Added new types for bulk search and semantic search functionalities to the `__all__` exports in `__init__.py`.
- Removed previously commented sections for clarity and organization.

* Enhance integration tests for bulk search functionality

- Updated assertions in `test_bulk_basic_search` to verify that all expected search IDs are present in the results.
- Added a check in `test_bulk_semantic_search` to confirm that the SNOMED vocabulary filter is applied to the results.

* Prep for v1.5.0 release

* Examples update

* Update GitHub Actions workflows to use latest action versions

- Upgraded `actions/checkout` from v4 to v6 in both `ci.yml` and `publish.yml`.
- Updated `codecov/codecov-action` from v4 to v5 in `ci.yml`.
- Changed `actions/upload-artifact` and `actions/download-artifact` from v4 to v5 in `publish.yml`.

* Add retry logic with exponential backoff and jitter for rate limits and server errors (#6)

- Introduced a new `_calculate_retry_delay` function to handle retry delays based on the Retry-After header and exponential backoff with jitter.
- Updated `SyncHTTPClient` and `AsyncHTTPClientImpl` to utilize the new retry delay calculation for handling rate limits (429) and server errors (502, 503, 504).
- Enhanced retry mechanism to improve resilience against temporary issues.

Co-authored-by: alex-omophub <sdk@omophub.com>

* Update CHANGELOG for v1.5.1 release

---------

Co-authored-by: alex-omophub <sdk@omophub.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ment in CONTRIBUTING.md. Refactor error handling in API request processing by introducing a shared `_parse_and_raise` function to streamline JSON response parsing and error management. Enhance async search functionality with pagination support and update type exports in `__init__.py`.
…se_and_raise` to remove type ignore comment. Add tests for minimal CodeableConcept resolution and async FHIR property caching.
…or single and batch resolution of FHIR codings, and CodeableConcept handling. Refactor shared response parsing in API requests to improve maintainability. Update README with usage examples and correct Python version requirement in CONTRIBUTING.md.
…pdate test name and docstring for clarity, and change fetch_page to be an async function.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

@alex-omophub alex-omophub merged commit 87b1b88 into main Apr 10, 2026
15 checks passed
@alex-omophub alex-omophub deleted the fhir-resolver branch April 10, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant