Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "5.49.1",
"cliVersion": "5.50.1",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "5.14.13",
"generatorConfig": {
Expand All @@ -8,10 +8,10 @@
"enabled": true
}
},
"originGitCommit": "64f369254225bd6c2d4c58d87f59165d7e8e8dc9",
"originGitCommit": "fff9ecb3e3ee9847a86bfb09de6df7e477ecd13e",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "16.2.0"
"sdkVersion": "16.2.1"
}
25 changes: 20 additions & 5 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions code-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"metadata": {
"language": "python",
"packageName": "phenoml",
"sdkVersion": "16.2.0",
"specCommit": "64f369254225bd6c2d4c58d87f59165d7e8e8dc9",
"sdkVersion": "16.2.1",
"specCommit": "fff9ecb3e3ee9847a86bfb09de6df7e477ecd13e",
"generatorName": "fernapi/fern-python-sdk"
},
"renderRules": {
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "phenoml"
version = "16.2.0"
version = "16.2.1"
description = ""
readme = "README.md"
authors = []
Expand Down
35 changes: 32 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3526,6 +3526,32 @@ Maps a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows
(person, visit_occurrence, condition_occurrence, drug_exposure,
procedure_occurrence, measurement, observation).

Resource support is intentionally limited to the OMOP tables returned by
this endpoint:
- `Patient` -> `person`
- `Encounter` -> `visit_occurrence`
- `Condition` -> `condition_occurrence`
- `Procedure` -> `procedure_occurrence`
- `MedicationRequest`, `MedicationStatement`, and
`MedicationAdministration` -> `drug_exposure`
- `Immunization` -> `drug_exposure`
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
- non-numeric `Observation` -> `observation`
- `AllergyIntolerance` -> `observation`

`Medication` is supported only as reference data for medication
resources; it is not emitted as its own row because OMOP CDM has no
Medication table. Other reference/admin resources such as `Practitioner`,
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
`DeviceUseStatement`, are currently accepted in a Bundle but are not
shaped into OMOP rows. Unsupported resource types are ignored rather than
listed under `dropped`; `dropped` is reserved for supported resource types
that were missing the subject/patient, code, or medication reference data
needed to produce a valid row.

Each resource's primary clinical coding is resolved to a standard OMOP
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
response carries `mappings` (how each source coding resolved, linked back
Expand Down Expand Up @@ -3599,9 +3625,12 @@ client.fhir2omop.create(
**fhir_resources:** `typing.Dict[str, typing.Any]`

FHIR resources (single resource or Bundle). Must contain at least one
Patient resource. Resources are mapped to OMOP rows; standalone
Medication resources are consumed by medication references rather than
mapped to their own table.
Patient resource. Supported row-producing resources are Patient,
Encounter, Condition, Procedure, MedicationRequest,
MedicationStatement, MedicationAdministration, Immunization,
Observation, and AllergyIntolerance. Standalone Medication resources
are consumed by medication references rather than mapped to their own
table. Other resource types are accepted but ignored.

</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/phenoml/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "phenoml/16.2.0",
"User-Agent": "phenoml/16.2.1",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "phenoml",
"X-Fern-SDK-Version": "16.2.0",
"X-Fern-SDK-Version": "16.2.1",
**(self.get_custom_headers() or {}),
}
token = self._get_token()
Expand Down
70 changes: 64 additions & 6 deletions src/phenoml/fhir2omop/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ def create(
(person, visit_occurrence, condition_occurrence, drug_exposure,
procedure_occurrence, measurement, observation).

Resource support is intentionally limited to the OMOP tables returned by
this endpoint:
- `Patient` -> `person`
- `Encounter` -> `visit_occurrence`
- `Condition` -> `condition_occurrence`
- `Procedure` -> `procedure_occurrence`
- `MedicationRequest`, `MedicationStatement`, and
`MedicationAdministration` -> `drug_exposure`
- `Immunization` -> `drug_exposure`
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
- non-numeric `Observation` -> `observation`
- `AllergyIntolerance` -> `observation`

`Medication` is supported only as reference data for medication
resources; it is not emitted as its own row because OMOP CDM has no
Medication table. Other reference/admin resources such as `Practitioner`,
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
`DeviceUseStatement`, are currently accepted in a Bundle but are not
shaped into OMOP rows. Unsupported resource types are ignored rather than
listed under `dropped`; `dropped` is reserved for supported resource types
that were missing the subject/patient, code, or medication reference data
needed to produce a valid row.

Each resource's primary clinical coding is resolved to a standard OMOP
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
response carries `mappings` (how each source coding resolved, linked back
Expand Down Expand Up @@ -64,9 +90,12 @@ def create(
----------
fhir_resources : typing.Dict[str, typing.Any]
FHIR resources (single resource or Bundle). Must contain at least one
Patient resource. Resources are mapped to OMOP rows; standalone
Medication resources are consumed by medication references rather than
mapped to their own table.
Patient resource. Supported row-producing resources are Patient,
Encounter, Condition, Procedure, MedicationRequest,
MedicationStatement, MedicationAdministration, Immunization,
Observation, and AllergyIntolerance. Standalone Medication resources
are consumed by medication references rather than mapped to their own
table. Other resource types are accepted but ignored.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -170,6 +199,32 @@ async def create(
(person, visit_occurrence, condition_occurrence, drug_exposure,
procedure_occurrence, measurement, observation).

Resource support is intentionally limited to the OMOP tables returned by
this endpoint:
- `Patient` -> `person`
- `Encounter` -> `visit_occurrence`
- `Condition` -> `condition_occurrence`
- `Procedure` -> `procedure_occurrence`
- `MedicationRequest`, `MedicationStatement`, and
`MedicationAdministration` -> `drug_exposure`
- `Immunization` -> `drug_exposure`
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
- non-numeric `Observation` -> `observation`
- `AllergyIntolerance` -> `observation`

`Medication` is supported only as reference data for medication
resources; it is not emitted as its own row because OMOP CDM has no
Medication table. Other reference/admin resources such as `Practitioner`,
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
`DeviceUseStatement`, are currently accepted in a Bundle but are not
shaped into OMOP rows. Unsupported resource types are ignored rather than
listed under `dropped`; `dropped` is reserved for supported resource types
that were missing the subject/patient, code, or medication reference data
needed to produce a valid row.

Each resource's primary clinical coding is resolved to a standard OMOP
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
response carries `mappings` (how each source coding resolved, linked back
Expand Down Expand Up @@ -200,9 +255,12 @@ async def create(
----------
fhir_resources : typing.Dict[str, typing.Any]
FHIR resources (single resource or Bundle). Must contain at least one
Patient resource. Resources are mapped to OMOP rows; standalone
Medication resources are consumed by medication references rather than
mapped to their own table.
Patient resource. Supported row-producing resources are Patient,
Encounter, Condition, Procedure, MedicationRequest,
MedicationStatement, MedicationAdministration, Immunization,
Observation, and AllergyIntolerance. Standalone Medication resources
are consumed by medication references rather than mapped to their own
table. Other resource types are accepted but ignored.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down
70 changes: 64 additions & 6 deletions src/phenoml/fhir2omop/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,32 @@ def create(
(person, visit_occurrence, condition_occurrence, drug_exposure,
procedure_occurrence, measurement, observation).

Resource support is intentionally limited to the OMOP tables returned by
this endpoint:
- `Patient` -> `person`
- `Encounter` -> `visit_occurrence`
- `Condition` -> `condition_occurrence`
- `Procedure` -> `procedure_occurrence`
- `MedicationRequest`, `MedicationStatement`, and
`MedicationAdministration` -> `drug_exposure`
- `Immunization` -> `drug_exposure`
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
- non-numeric `Observation` -> `observation`
- `AllergyIntolerance` -> `observation`

`Medication` is supported only as reference data for medication
resources; it is not emitted as its own row because OMOP CDM has no
Medication table. Other reference/admin resources such as `Practitioner`,
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
`DeviceUseStatement`, are currently accepted in a Bundle but are not
shaped into OMOP rows. Unsupported resource types are ignored rather than
listed under `dropped`; `dropped` is reserved for supported resource types
that were missing the subject/patient, code, or medication reference data
needed to produce a valid row.

Each resource's primary clinical coding is resolved to a standard OMOP
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
response carries `mappings` (how each source coding resolved, linked back
Expand Down Expand Up @@ -62,9 +88,12 @@ def create(
----------
fhir_resources : typing.Dict[str, typing.Any]
FHIR resources (single resource or Bundle). Must contain at least one
Patient resource. Resources are mapped to OMOP rows; standalone
Medication resources are consumed by medication references rather than
mapped to their own table.
Patient resource. Supported row-producing resources are Patient,
Encounter, Condition, Procedure, MedicationRequest,
MedicationStatement, MedicationAdministration, Immunization,
Observation, and AllergyIntolerance. Standalone Medication resources
are consumed by medication references rather than mapped to their own
table. Other resource types are accepted but ignored.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -162,6 +191,32 @@ async def create(
(person, visit_occurrence, condition_occurrence, drug_exposure,
procedure_occurrence, measurement, observation).

Resource support is intentionally limited to the OMOP tables returned by
this endpoint:
- `Patient` -> `person`
- `Encounter` -> `visit_occurrence`
- `Condition` -> `condition_occurrence`
- `Procedure` -> `procedure_occurrence`
- `MedicationRequest`, `MedicationStatement`, and
`MedicationAdministration` -> `drug_exposure`
- `Immunization` -> `drug_exposure`
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
- non-numeric `Observation` -> `observation`
- `AllergyIntolerance` -> `observation`

`Medication` is supported only as reference data for medication
resources; it is not emitted as its own row because OMOP CDM has no
Medication table. Other reference/admin resources such as `Practitioner`,
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
`DeviceUseStatement`, are currently accepted in a Bundle but are not
shaped into OMOP rows. Unsupported resource types are ignored rather than
listed under `dropped`; `dropped` is reserved for supported resource types
that were missing the subject/patient, code, or medication reference data
needed to produce a valid row.

Each resource's primary clinical coding is resolved to a standard OMOP
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
response carries `mappings` (how each source coding resolved, linked back
Expand Down Expand Up @@ -192,9 +247,12 @@ async def create(
----------
fhir_resources : typing.Dict[str, typing.Any]
FHIR resources (single resource or Bundle). Must contain at least one
Patient resource. Resources are mapped to OMOP rows; standalone
Medication resources are consumed by medication references rather than
mapped to their own table.
Patient resource. Supported row-producing resources are Patient,
Encounter, Condition, Procedure, MedicationRequest,
MedicationStatement, MedicationAdministration, Immunization,
Observation, and AllergyIntolerance. Standalone Medication resources
are consumed by medication references rather than mapped to their own
table. Other resource types are accepted but ignored.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down
5 changes: 4 additions & 1 deletion src/phenoml/fhir2omop/types/create_omop_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class CreateOmopResponse(UniversalBaseModel):

dropped: typing.Optional[typing.List[DroppedResource]] = pydantic.Field(default=None)
"""
Resources that could not be shaped into an OMOP row (rather than emitted as blank rows).
Supported resource instances that could not be shaped into an OMOP
row because required subject/patient, code, or medication reference
data was missing. Unsupported resource types are ignored and do not
appear here.
"""

vocab_version: typing.Optional[str] = pydantic.Field(default=None)
Expand Down
Loading