oehrpy

Python openEHR SDK

Build modern healthcare applications with the power of openEHR

Get Started View on GitHub

Why oehrpy?

🐍

Pythonic API

Intuitive, idiomatic Python interfaces that feel natural to work with. Type hints, async support, and modern Python best practices throughout.

🏥

openEHR Native

Full support for openEHR archetypes, templates (OPT), and compositions. Pre-built type-safe builders with FLAT paths sourced from Web Templates.

High Performance

Optimized for speed with minimal overhead. Built to handle real-world healthcare workloads efficiently.

🔒

Type Safe

Comprehensive type hints and runtime validation ensure your healthcare data remains consistent and reliable.

📄

OPT Parser

Parse OPT 1.4 XML files to extract template metadata. Use Web Templates from the CDR for FLAT path derivation.

Validators

Validate FLAT compositions against Web Templates and OPT files against the RM specification. Catch errors before they hit your CDR, with "did you mean?" suggestions and actionable fix recommendations.

Quick Start

# Install oehrpy
pip install oehrpy

# Use the pre-built type-safe builder
from oehrpy.templates import VitalSignsBuilder

builder = VitalSignsBuilder(composer_name="Dr. Smith")
builder.add_blood_pressure(systolic=120, diastolic=80)
builder.add_pulse(rate=72)

# Get FLAT format ready for EHRBase
flat_data = builder.build()