oehrpy
Docs: Development

Development

oehrpy is open source (Apache-2.0) and welcomes contributions. This page covers setting up a development environment, regenerating the Reference Model classes from the openEHR specifications, the layout of the repository, and running the test suite.

Setup Development Environment

# Clone repository
git clone https://github.com/platzhersh/oehrpy.git
cd oehrpy

# Install with development dependencies
pip install -e ".[dev,generator]"

# Run tests
pytest tests/ -v

# Type checking
mypy src/oehrpy

Regenerating RM Classes

The RM classes are generated from openEHR JSON Schema specifications (RM 1.1.0):

python -m generator.generate_rm_1_1_0

Project Structure

oehrpy/
├── src/oehrpy/       # Main package
│   ├── rm/                # Generated RM + BASE classes (134 types)
│   ├── serialization/     # JSON serialization
│   ├── client/            # EHRBase REST client
│   ├── templates/         # Template builders
│   ├── validation/        # FLAT & OPT validators
│   └── aql/               # AQL query builder
├── generator/             # Code generation tools
├── tests/                 # Test suite
└── docs/                  # Documentation

Contributing: We welcome contributions! Check out the GitHub repository for guidelines.

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=oehrpy --cov-report=html

# Run specific test file
pytest tests/test_rm_types.py -v

Note: Some tests require a running EHRBase instance. Use the provided Docker Compose setup for integration tests.