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:
- Installation - Get Fhircraft running in your environment
- Basics Tutorial - Your first FHIR models and resources
- FHIR Resources Overview - Understanding Fhircraft's approach to FHIR
Building FHIR Applications?
Follow this path for application development:
- FHIR Resources Overview - Core concepts and architecture
- Pydantic FHIR - How FHIR maps to Python types
- Resource Models - Working with FHIR resource instances
- Resource Factory - Advanced model construction patterns
Working with FHIR Data?
Focus on querying and data manipulation:
- Resource Models - Creating and validating FHIR resources
- FHIR Path - Querying resources with FHIRPath expressions
- FHIR Mapper - Transforming data between structures
Integrating Legacy Systems?
Emphasize data transformation and validation:
- FHIR Mapper - Convert legacy data to FHIR resources
- Resource Factory - Loading custom profiles and packages
- 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"
)
Querying FHIR Data
# Query using FHIRPath
family_names = patient.fhirpath_values("Patient.name.family")
has_phone = patient.fhirpath_exists("Patient.telecom.where(system='phone')")
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)
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
- Resource Models - Common validation errors and solutions
- FHIR Path - FHIRPath debugging techniques
- Resource Factory - Package loading and construction issues
Community
- GitHub Issues - Report bugs and request features
- GitHub Discussions - Ask questions and share ideas
Ready to start? Choose your learning path above or jump directly to FHIR Resources Overview to begin building with Fhircraft.