You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add FHIR resolver example script
- 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.
* Implement FHIR type interoperability and client helpers
- 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.
* Refactor examples to remove hardcoded API keys
- 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.
The resolver accepts any Coding-like input via duck typing - a plain dict, omophub's lightweight `Coding` TypedDict, or any object with `.system` / `.code` attributes (e.g. `fhir.resources.Coding`, `fhirpy` codings).
108
+
109
+
```python
110
+
from omophub.types.fhir import Coding
111
+
112
+
# omophub's TypedDict - IDE autocomplete, no extra deps
`fhir.resources` is **never** a required dependency. See [`examples/fhir_interop.py`](./examples/fhir_interop.py) for the full set of supported input shapes.
129
+
130
+
### FHIR Client Interop
131
+
132
+
Point external FHIR client libraries at OMOPHub's FHIR Terminology Service directly - useful when you need raw FHIR `Parameters` / `Bundle` responses instead of the Concept Resolver envelope.
133
+
134
+
```python
135
+
from omophub import OMOPHub, get_fhir_server_url
136
+
137
+
client = OMOPHub(api_key="oh_xxx")
138
+
139
+
# Property on the client returns the R4 base URL
140
+
print(client.fhir_server_url)
141
+
# "https://fhir.omophub.com/fhir/r4"
142
+
143
+
# Helper for other FHIR versions
144
+
print(get_fhir_server_url("r5"))
145
+
# "https://fhir.omophub.com/fhir/r5"
146
+
```
147
+
148
+
For `fhirpy`, install the optional extra and use the pre-wired client:
**When to use which**: the Concept Resolver (`client.fhir.resolve`) gives you OMOP-enriched answers - standard concept ID, CDM target table, mapping quality. Use `fhirpy` via `get_fhirpy_client()` when you need raw FHIR responses for FHIR-native tooling.
168
+
101
169
## Semantic Search
102
170
103
171
Use natural language queries to find concepts using neural embeddings:
0 commit comments