diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f2a2db..04eca0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.4.10" hooks: - id: ruff args: [--fix, --show-fixes] @@ -14,6 +14,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 24.4.2 hooks: - id: black diff --git a/fhirflat/__init__.py b/fhirflat/__init__.py index d886e4c..c6d13c4 100644 --- a/fhirflat/__init__.py +++ b/fhirflat/__init__.py @@ -2,6 +2,7 @@ fhirflat is a library for transforming FHIR resources in NDJSON or native Python dictionaries to a flat structure that can be written to a Parquet file. """ + from .resources import ( Condition, Encounter, diff --git a/fhirflat/resources/extension_validators.py b/fhirflat/resources/extension_validators.py index ec2fe24..322f0b8 100644 --- a/fhirflat/resources/extension_validators.py +++ b/fhirflat/resources/extension_validators.py @@ -96,9 +96,9 @@ def fhir_model_validator( self, model_name: str, v: Union[StrBytes, dict, Path, FHIRAbstractModel] ): """ """ - model_class: Type[BaseModel] | Type[ - FHIRAbstractModel - ] = self.get_fhir_model_class(model_name) + model_class: Type[BaseModel] | Type[FHIRAbstractModel] = ( + self.get_fhir_model_class(model_name) + ) if isinstance(v, (str, bytes)): try: diff --git a/fhirflat/resources/extensions.py b/fhirflat/resources/extensions.py index b0e071c..fcc9f49 100644 --- a/fhirflat/resources/extensions.py +++ b/fhirflat/resources/extensions.py @@ -7,6 +7,7 @@ .. _FHIR resources: https://pypi.org/project/fhir.resources/ """ + from __future__ import annotations from typing import Any, Union diff --git a/fhirflat/resources/patient.py b/fhirflat/resources/patient.py index 30931c1..fa7d20e 100644 --- a/fhirflat/resources/patient.py +++ b/fhirflat/resources/patient.py @@ -14,20 +14,20 @@ class Patient(_Patient, FHIRFlatBase): - extension: list[ - Union[ageType, birthSexType, raceType, fhirtypes.ExtensionType] - ] = Field( - None, - alias="extension", - title="Additional content defined by implementations", - description=( - """ + extension: list[Union[ageType, birthSexType, raceType, fhirtypes.ExtensionType]] = ( + Field( + None, + alias="extension", + title="Additional content defined by implementations", + description=( + """ Contains the G.H 'age' and 'birthSex' extensions, and allows extensions from other implementations to be included.""" - ), - # if property is element of this resource. - element_property=True, - union_mode="smart", + ), + # if property is element of this resource. + element_property=True, + union_mode="smart", + ) ) # attributes to exclude from the flat representation