Skip to content

Overview

Welcome to the comprehensive Fhircraft User Guide. This guide is designed for developers who want to leverage FHIR (Fast Healthcare Interoperability Resources) in Python applications using type-safe, validated Pydantic models.

What You'll Learn

Fhircraft enables you to:

  • Build Type-Safe FHIR Models from specifications and implementation guides
  • Query and Navigate FHIR resources using the standard FHIRPath language
  • Transform Data between different structures using FHIR Mapping Language
  • Validate Healthcare Data with automatic FHIR compliance checking
  • Integrate FHIR seamlessly into modern Python applications

Choose Your Learning Path

New to Fhircraft?

Start here if you're beginning your Fhircraft journey:

  1. Installation - Get Fhircraft running in your environment
  2. Basics Tutorial - Your first FHIR models and resources
  3. FHIR Resources Overview - Understanding Fhircraft's approach to FHIR

Building FHIR Applications?

Follow this path for application development:

  1. FHIR Resources Overview - Core concepts and architecture
  2. Pydantic FHIR - How FHIR maps to Python types
  3. Resource Models - Working with FHIR resource instances
  4. Resource Factory - Advanced model construction patterns

Working with FHIR Data?

Focus on querying and data manipulation:

  1. Resource Models - Creating and validating FHIR resources
  2. FHIR Path - Querying resources with FHIRPath expressions
  3. FHIR Mapper - Transforming data between structures

Integrating Legacy Systems?

Emphasize data transformation and validation:

  1. FHIR Mapper - Convert legacy data to FHIR resources
  2. Resource Factory - Loading custom profiles and packages
  3. Resource Models - Validation and error handling patterns

Feature Overview

FHIR Resources

Transform FHIR specifications into working Python code with full type safety and validation.

Feature Description Learn More
Pydantic Models FHIR resources as validated Python classes Pydantic FHIR
Resource Construction Build models from specifications and packages Resource Factory
Data Validation Automatic FHIR compliance and constraint checking Resource Models

FHIR Path

Query and navigate FHIR resources using the standard FHIRPath expression language.

Feature Description Learn More
Path Expressions Extract data using familiar path-based syntax FHIR Path
Resource Integration Built-in FHIRPath methods on all Fhircraft models FHIR Path
Complex Queries Support for filtering, aggregation, and transformation FHIR Path

FHIR Mapper

Transform data between different structures using declarative mapping rules.

Feature Description Learn More
Mapping Language Official FHIR Mapping Language implementation FHIR Mapper
Legacy Integration Convert existing data formats to FHIR resources FHIR Mapper
Validation Automatic validation of transformed data FHIR Mapper

Common Workflows

Creating Your First FHIR Resource

from fhircraft.fhir.resources.factory import factory

# Load a FHIR package
factory.load_package("hl7.fhir.us.core", "5.0.1")

# Create a Patient model
Patient = factory.construct_resource_model(
    canonical_url="http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
)

# Create and validate a patient
patient = Patient(
    name=[{"family": "Doe", "given": ["John"]}],
    gender="male",
    birthDate="1990-01-15"
)
Next: Resource Factory for advanced construction patterns

Querying FHIR Data

# Query using FHIRPath
family_names = patient.fhirpath_values("Patient.name.family")
has_phone = patient.fhirpath_exists("Patient.telecom.where(system='phone')")
Next: FHIR Path for comprehensive querying guide

Transforming Legacy Data

from fhircraft.fhir.mapper import FHIRMapper

# Transform legacy patient data to FHIR
mapper = FHIRMapper()
fhir_patient = mapper.execute_mapping(mapping_script, legacy_data)
Next: FHIR Mapper for transformation patterns

Getting Help

Documentation

  • This User Guide - Comprehensive feature documentation
  • API Reference - Detailed method and class documentation
  • Pydantic Docs - Learn about the underlying validation framework

Troubleshooting

Community


Ready to start? Choose your learning path above or jump directly to FHIR Resources Overview to begin building with Fhircraft.