--- id: fhir-core version: "1.1.10" license: BSD license license_treatment: permissive maintenance: active --- # fhir-core — FHIR Core library License: permissive · Maintenance: active · Downloads: 2.0M/mo ## What it is and what it does fhir-core is a Pydantic V2-based toolkit for constructing FHIR resource models in Python. It provides FHIRAbstractModel as a base class for any FHIR resource, along with a library of FHIR primitive datatypes (IdType, BooleanType, StringType, etc.) and factories to construct complex datatypes. The package handles validation, serialization to and from JSON, XML, and YAML, and supports FHIR-specific features like the _summary filter for selective serialization. The library was originally developed to support fhir.resources but is designed for standalone use. It integrates tightly with Pydantic's field validation and model configuration, allowing developers to define FHIR-compliant resource classes declaratively. Recent releases have focused on fixing precision issues with Decimal types, XML serialization edge cases, and multi-version FHIR support within a single process. Use it for: - Define custom FHIR resource classes (e.g., Organization, Patient, Encounter) with validated fields and type safety. - Serialize FHIR models to JSON or XML for interoperability with healthcare systems and EHR platforms. - Validate incoming FHIR data against schema constraints and FHIR-specific rules before processing. - Build healthcare data pipelines that parse and transform FHIR resources across multiple formats. - Integrate FHIR support into Python-based health IT applications without writing low-level validation logic. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Pydantic V2-based abstract base classes and primitive datatypes for building FHIR (Fast Healthcare Interoperability Resources) resource models, with support for JSON, XML, and YAML serialization. Yes. Active maintenance, no security vulnerabilities, low install friction, and permissive licensing make it a solid foundation for FHIR work in Python. Install if you are building healthcare applications that need FHIR resource modeling and serialization; skip if you only need to parse pre-built FHIR libraries without defining custom models. ## Install pip install fhir-core uv add fhir-core poetry add fhir-core ## Installing fhir-core Before you install: Low friction: pure Python wheel with only pydantic as a runtime dependency. Actively maintained with a release 20 days ago and no known vulnerabilities. Supports Python 3.8 through 3.14. License in practice: BSD license (permissive) allows use in commercial and private projects with minimal restrictions; attribution required but no copyleft obligations. Quickstart: pip install fhir-core from pydantic import Field from fhir_core.fhirabstractmodel import FHIRAbstractModel from fhir_core.types import IdType, StringType class Organization(FHIRAbstractModel): __resource_type__ = "Organization" id: IdType = Field(None, alias="id", json_schema_extra={"element_property": True}) name: StringType = Field(None, alias="name", json_schema_extra={"element_property": True}) org = Organization.model_validate({"id": "org-1", "name": "Acme Corp"}) org_json = org.model_dump_json() Verify before relying: - Whether XML/YAML serialization requires additional system dependencies beyond Python and pydantic. - Performance characteristics when handling large FHIR resource hierarchies or batch operations. - Compatibility guarantees with specific FHIR specification versions (R4, R5, etc.). ## Package facts - License: BSD license (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fhir resource model builder, healthcare data validation pydantic, fhir xml json serialization, hl7 fhir python library, fhir primitive datatypes, fhir abstract model base class, healthcare interoperability resources, healthcare-it, fhir-hl7, data-validation [View on SkillFed](https://skillfed.io/packages/fhir-core) · [View on PyPI](https://pypi.org/project/fhir-core/)