Repository navigation
Release 18.0.0: update OMOP and FHIR APIs - #255
Merged
Merged
Conversation
Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 5.31.1
🌿 Generated with Fern
Patches applied (1): - patch-6516695e: Release 15.0.2: restore bundled openapi.json packaging (#169)
🌿 Generated with Fern
…6acd7f37d8c336c9 [skip ci]
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b639125. Configure here.
gavinsharp
approved these changes
Oct 8, 2026
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.

17.0.0 → 18.0.0
Adds vocabulary selection, richer FHIR-to-OMOP results, canonical implementation-guide versions, primary-patient context, and resource-review remediation reporting. Major bump for removed exported error classes; output model additions and refinements are non-breaking. The documented FHIR-to-OMOP server output changes also affect users of earlier SDK versions.
Breaking Changes
phenoml.construe.BadGatewayError,phenoml.construe.ContentTooLargeError,phenoml.fhir2omop.ServiceUnavailableError,phenoml.lang2fhir_batch.ContentTooLargeError, andphenoml.voice.ContentTooLargeError— removed exported error classes; replace their imports and catches withphenoml.core.api_error.ApiErrorand inspectstatus_code.*_source_valuefields now contain the selected bare code instead ofsystem#code; read the coding system frommappings[].source_system. ForMedicationRequest,drug_type_concept_idchanges from32817(EHR) to32838(EHR prescription). Update loaders and comparisons that depend on the previous values; these server-side changes also affect clients using older SDK versions.Added
phenoml.fhir2omop.MappingEntry.selected— identifies whether a source coding was selected for the linked row's*_source_value; returned on every mapping entry and false for alternate codings and text-only rows.client.fhir2omop.create(..., vocab_version=...)— accepts an optional OMOP vocabulary release for reproducible coded-concept resolution in sync and async clients.phenoml.fhir2omop.CreateOmopResponse.provider_role_contextsand.diagnostics— add practitioner-role provenance and reference-resolution diagnostics withProviderRoleContext, its supporting models,Coding, andReferenceDiagnostic.phenoml.fhir2omop.MappingEntry.omop_field,PersonRow,DrugExposureRow,ConditionOccurrenceRow, andProcedureOccurrenceRow— add concept-field provenance, person provider/care-site and demographic source-concept fields, drug route/refill/supply/lot/end-date fields, and condition/procedure end timestamps.client.implementation_guides.implementation_guides.create_version(...)and.get_version(...)— create and retrieve exact canonical implementation-guide packages usingFhirImplementationGuideandImplementationGuideVersionDetail, with a newphenoml.implementation_guides.ConflictErrorfor HTTP 409.phenoml.implementation_guides.ImplementationGuideSummary.canonical_urland.version_count— expose an implementation-guide family's canonical URL and retained version count.client.lang2fhir.create_multi(..., primary_patient=...)and.document_multi(..., primary_patient=...)— accept optionalPrimaryPatient/PrimaryPatientNamecontext with identifier, name, birth date, and gender to identify the primary patient.CreateRequestResource— addsfamilymemberhistory,medicationadministration, andmedicationstatementextraction targets.ResourceReviewResult.remediated,ResourceReviewRemediated, andResourceReviewFinding.unaudited— report safe coding removals and distinguish fields without an audit verdict.BaseHttpResponse.response— exposes the underlyinghttpx.Responseon raw response wrappers.phenoml.core.http_client.get_keepalive_socket_options()— returns platform-appropriate TCP keepalive socket options for custom HTTP transports.client.lang2fhir.document(...)and.document_multi(...)— now throwphenoml.lang2fhir.ForbiddenErroron HTTP 403, including dedicated-instance format restrictions; previously these responses used the generic SDK error.client.construe.codes.crosswalk(...)— now throwsphenoml.construe.InternalServerErroron HTTP 500.Changed
phenoml.fhir2omop.MappingEntryMappingStatus— describes response mapping statuses with named literal values while retaining anAnyfallback for unknown future values; this is a response typing improvement.phenoml.fhir2omop.Summary— documentation describes expanded resource coverage, source-supported dates, clinical-event eligibility, demographic resolution, and outcome-based summary counts.client.lang2fhir.create_multi(..., patient_reference=...),.document_multi(..., patient_reference=...), and Lang2FHIRdetection_effortparameters — marked deprecated with existing call sites retained; useprimary_patient.identifierfor patient identifiers and do not combine it withpatient_reference.client.lang2fhir.document(...)and.document_multi(...)— TIFF support is now restricted to dedicated instances; TIFF was already supported by the previous SDK. RTF and XML/C-CDA are also dedicated-instance formats. Documentation specifies a 20 MiB decoded-file limit and a 1 MiB extracted-text limit for RTF/XML.ResourceReview— documentation describes retaining resources after safe removal of unsupported codings and quarantining findings that cannot be safely repaired; read retained resources from the returned bundle.client.construe.codes.crosswalk(...),client.lang2fhir_batch.create(...),client.lang2fhir_batch.upload_item(...), andclient.voice.voice.transcribe(...)— removed typed status handling now falls back toApiError: crosswalk HTTP 413/501/502/503, batch create HTTP 409, and upload/transcribe HTTP 413. Batch upload still raisesphenoml.lang2fhir_batch.ConflictErroron HTTP 409; batch creation no longer documents the four-active-jobs limit.client.profiles.profiles.delete(...)andclient.profiles.versions.delete(...)— explicitly raisephenoml.profiles.ConflictErrorfor profiles pinned by an implementation-guide package.client.lang2fhir.create(...),.create_multi(...),.document(...),.document_multi(...), andclient.voice.voice.transcribe(...)— documentation now specifies a 32 MiB request-body limit, including the full JSON envelope and base64 content for document methods and the raw audio body for transcription.BatchError.kind— removesbudget_exceededfrom documented values; the field remains a string.PhenomlClient(token=...)andAsyncPhenomlClient(token=...)— type hints and documentation now include token strings alongside callable suppliers; strings already worked at runtime.aiohttpextra — loosenshttpx-aiohttpfrom exactly0.1.8to^0.1.8, allowing compatible updates before0.2.0.Fixed
PhenomlClient(base_url=..., instance_url=...)andAsyncPhenomlClient(base_url=..., instance_url=...)— preserve an explicitly supplied base URL when an instance hostname is also provided.OAuthTokenProviderandAsyncOAuthTokenProvider— credential-based token refresh explicitly sendsgrant_type=client_credentials.client.agent.chat.stream(...)— skips empty SSE events; the async usage example now calls the stream factory withoutawaitbefore iterating.Compatibility notes
client.fhir2omop.create(...)— Python validates server responses and raisesParsingErrorif a mapping lacksselected; dedicated instances must include the backend change introduced on 2026-09-30 before adopting 18.0.0.Testing
selectedraisesParsingError; addingselectedparses successfully.poetry buildproduces a wheel and sdist containing the bundled OpenAPI spec.pytest -rP .with WireMock 3.9.1: 172 pass, 4 optional aiohttp tests skip.poetry run mypy .: all 479 source files pass after restoring Pydantic 2.13.5 and pydantic-core 2.46.5 in the dependency lockfile.Dependency compatibility
Keeps Pydantic 2.13.5 and pydantic-core 2.46.5 from the previous release lockfile because Pydantic 2.14.0 exposes missing type annotations in the generated date/datetime adapters; the generated runtime remains unchanged.
Tracked upstream in Fern #18156. The pending Python generator 5.34.2 update still contains the same unannotated adapters.
Note
High Risk
Major version with breaking FHIR-to-OMOP payload semantics, required new response fields, and removed exported exception types that will break existing import/catch and loader logic on upgrade.
Overview
Release 18.0.0 regenerates the Fern Python SDK against a newer API spec (generator 5.31.1) and bumps package metadata, examples, and reference docs to match.
Breaking: Several typed HTTP errors (
BadGatewayError,ContentTooLargeError,ServiceUnavailableErrorin affected modules) are removed—callers should catchApiErrorand usestatus_code. FHIR-to-OMOP responses change semantics: clinical*_source_valuefields use bare codes (system inmappings[].source_system),MappingEntry.selectedis required on parse, andMedicationRequestusesdrug_type_concept_id32838.FHIR2OMOP:
creategains optionalvocab_version; responses addprovider_role_contexts,diagnostics, richer row/mapping models (demographics, drug route/refills, end dates,omop_field), and expanded documented conversion behavior.New APIs & params: Implementation-guide
create_version/get_versionwithConflictError; Lang2FHIRprimary_patienton multi flows (deprecatingpatient_reference/detection_effort); extra extraction resource types; resource-review remediation fields;ForbiddenErroron document endpoints for 403.Client/runtime:
tokenmay be a string; explicitbase_urlis kept wheninstance_urlis set; OAuth refresh sendsgrant_type=client_credentials; agent chat stream skips empty SSE events; HTTP layer adds optional bodyless requests,get_keepalive_socket_options(), andBaseHttpResponse.response; crosswalk maps 500 toInternalServerErrorinstead of several removed status types.Packaging: Version
18.0.0,httpx-aiohttprelaxed to^0.1.8, OpenAPI JSON still bundled in wheels/sdists.Reviewed by Cursor Bugbot for commit a9536eb. Bugbot is set up for automated code reviews on this repo. Configure here.