PHPackages                             cadasto/openehr-bmm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cadasto/openehr-bmm

ActiveLibrary

cadasto/openehr-bmm
===================

Opinionated PHP library implementing the openEHR Basic Meta-Model (BMM), mostly an intermediate representation of P\_BMM specifications.

0.2.1(yesterday)116↑2525%MITPHPPHP ^8.4CI passing

Since Apr 4Pushed yesterdayCompare

[ Source](https://github.com/Cadasto/openehr-bmm)[ Packagist](https://packagist.org/packages/cadasto/openehr-bmm)[ RSS](/packages/cadasto-openehr-bmm/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (7)Used By (0)

openEHR BMM (Cadasto)
=====================

[](#openehr-bmm-cadasto)

Opinionated PHP library implementing the **openEHR Basic Meta-Model (BMM)**. It serves primarily as an intermediate representation (IR) of [P\_BMM](https://specifications.openehr.org/releases/LANG/latest/bmm_persistence.html) specifications, providing typed PHP objects for schemas, packages, classes, properties, types, and functions.

Features
--------

[](#features)

- Parse openEHR BMM JSON schemas into strongly-typed PHP objects (`BmmSchema`, `BmmClass`, `BmmPackage`, etc.)
- Serialize models back to JSON (`JsonSerializable`)
- Support for all P\_BMM class variants: classes, interfaces, enumerations (string and integer)
- Property types: single, container, generic, and open single properties
- Function definitions with parameters, pre/post-conditions, and result types
- Generic parameter definitions and generic types
- Typed collections with alias support

Installation
------------

[](#installation)

```
composer require cadasto/openehr-bmm
```

Quick start
-----------

[](#quick-start)

```
use Cadasto\OpenEHR\BMM\Model\BmmSchema;

// Load a BMM schema from a JSON file
$json = json_decode(file_get_contents('openehr_rm_1.2.0.bmm.json'), true);
$schema = BmmSchema::fromArray($json);

// Access schema metadata
echo $schema->getSchemaId(); // "openehr_rm_1.2.0"

// Navigate packages and classes
foreach ($schema->packages as $package) {
    echo $package->name . PHP_EOL;
}

// Serialize back to JSON
echo json_encode($schema, JSON_PRETTY_PRINT);
```

Development
-----------

[](#development)

### With Docker

[](#with-docker)

```
make build
make install
make ci
```

### Without Docker

[](#without-docker)

```
composer install
composer ci
```

### Composer scripts

[](#composer-scripts)

ScriptDescription`composer test`Run PHPUnit`composer test:dox`PHPUnit with testdox output`composer test:coverage`PHPUnit with HTML coverage report`composer check:lint`Parallel-lint (syntax)`composer check:cs`PHPCS (PSR-12)`composer check:phpstan`PHPStan (level 8)`composer rector`Run Rector refactoring`composer ci`Run all checks (lint, CS, PHPStan, tests)### Standards

[](#standards)

- **Style**: PSR-12 (PHPCS)
- **Static analysis**: PHPStan level 8
- **Tests**: PHPUnit 12
- **Refactoring**: Rector (local only)

See [docs/development.md](docs/development.md) for details.

Releases
--------

[](#releases)

Tag with SemVer (no `v` prefix), e.g. `git tag 1.0.0 && git push origin 1.0.0`. See [docs/releases.md](docs/releases.md).

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance100

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12683167?v=4)[Sebastian Iancu](/maintainers/sebastian-iancu)[@sebastian-iancu](https://github.com/sebastian-iancu)

---

Top Contributors

[![sebastian-iancu](https://avatars.githubusercontent.com/u/12683167?v=4)](https://github.com/sebastian-iancu "sebastian-iancu (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

bmmopenehrcadastoopenEHRBMM

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cadasto-openehr-bmm/health.svg)

```
[![Health](https://phpackages.com/badges/cadasto-openehr-bmm/health.svg)](https://phpackages.com/packages/cadasto-openehr-bmm)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
