HACS Healthcare Data Models - Pure Pydantic models for FHIR-compliant healthcare data
Project description
HACS Models
Pure Healthcare Data Models for AI Agent Systems
Overview
hacs-models provides pure, type-safe Pydantic data models for healthcare applications. These models are designed for AI agent communication and are fully compliant with FHIR R4/R5 standards.
Design Principles
- Pure Data Models: No business logic, just data structures
- Type Safety: Full type annotations with mypy strict mode
- FHIR Compliance: Adherent to healthcare data standards
- Zero Dependencies: Minimal dependency footprint (only Pydantic)
- Immutable Design: Designed for functional programming patterns
- AI-Optimized: Structured for AI agent communication
Features
Core Healthcare Models
Patient- Patient demographics and identifiersObservation- Clinical observations and measurementsEncounter- Healthcare encounters and visitsCondition- Medical conditions and diagnosesMedication- Medication informationMedicationRequest- Medication prescriptionsProcedure- Medical proceduresGoal- Care goals and objectives
Specialized Models
MemoryBlock- AI agent memory structuresAgentMessage- Inter-agent communicationResourceBundle- FHIR resource collectionsWorkflowDefinition- Clinical workflow definitions
Base Classes
BaseResource- Foundation for all healthcare resourcesDomainResource- Base for domain-specific resourcesBackboneElement- Reusable data structures
Installation
# Install from PyPI (when published)
pip install hacs-models
# Install in development mode
uv add -e packages/hacs-models
Quick Start
from hacs_models import Patient, Observation
from datetime import date
# Create a patient
patient = Patient(
id="patient-001",
full_name="Jane Doe",
birth_date=date(1990, 1, 15),
gender="female"
)
# Create an observation
observation = Observation(
id="obs-001",
subject_reference=f"Patient/{patient.id}",
code="85354-9", # Blood pressure
value_quantity={"value": 120, "unit": "mmHg"}
)
# Models are immutable and type-safe
print(f"Patient: {patient.full_name}")
print(f"Blood Pressure: {observation.value_quantity}")
Architecture
hacs-models/
├── base_resource.py # BaseResource, DomainResource
├── patient.py # Patient model
├── observation.py # Observation model
├── encounter.py # Encounter model
├── condition.py # Condition model
├── medication.py # Medication models
├── procedure.py # Procedure model
├── goal.py # Goal model
├── memory.py # AI memory models
├── workflow.py # Workflow models
└── types.py # Common types and enums
Development
# Run tests
uv run pytest
# Type checking
uv run mypy src/hacs_models
# Code formatting
uv run ruff format src/hacs_models
# Linting
uv run ruff check src/hacs_models
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new models
- Ensure 100% type coverage
- Submit a pull request
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hacs_models-0.4.1.tar.gz.
File metadata
- Download URL: hacs_models-0.4.1.tar.gz
- Upload date:
- Size: 46.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39c10ef3a9911df42b4094378795515086d40b6594ba6d0c541d3e11793a3de7
|
|
| MD5 |
eaa5da084d4062b7203cec95ca66a1c8
|
|
| BLAKE2b-256 |
66ebc80da01f29ee63b15e865abbb0d3b9de1db01da9a27ad506e3a3fd8791bc
|
File details
Details for the file hacs_models-0.4.1-py3-none-any.whl.
File metadata
- Download URL: hacs_models-0.4.1-py3-none-any.whl
- Upload date:
- Size: 57.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea3061a46fd3fdcaa13706874d7f840ddf026afc37656e7539734382380c637a
|
|
| MD5 |
16f833f74613c790ff8e56aa715dcd63
|
|
| BLAKE2b-256 |
08392a88c03286c160dc90d88af85b8bdc5b701c427c42bcda182ff044b10f65
|