PHPackages                             ardenexal/fhir-models - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ardenexal/fhir-models

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ardenexal/fhir-models
=====================

Pre-generated FHIR model classes for R4, R4B, and R5 versions

0.2(2mo ago)1418MITPHPPHP &gt;=8.2

Since Feb 17Pushed 2mo agoCompare

[ Source](https://github.com/Ardenexal/fhir-models)[ Packagist](https://packagist.org/packages/ardenexal/fhir-models)[ Docs](https://github.com/ardenexal/fhir-tools)[ RSS](/packages/ardenexal-fhir-models/feed)WikiDiscussions main Synced 1mo ago

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

FHIR Models Component
=====================

[](#fhir-models-component)

Generated PHP model classes for FHIR resources, data types, primitives, and enums. These classes are produced by the [CodeGeneration](../CodeGeneration/README.md) component from FHIR StructureDefinitions.

Generating Models
-----------------

[](#generating-models)

Models are not committed for all FHIR versions by default. Generate them with:

```
# Generate R4 models
composer run generate-models-r4

# Generate R4B models
composer run generate-models-r4b

# Generate all versions (R4, R4B, R5)
composer run generate-models-all
```

Namespace Organization
----------------------

[](#namespace-organization)

Generated models are organized in version-specific namespaces:

```
Ardenexal\FHIRTools\Component\Models\
├── R4\
│   ├── Resource\          # FHIR Resources (FHIRPatient, FHIRObservation, etc.)
│   ├── DataType\          # Complex Data Types (FHIRHumanName, FHIRAddress, etc.)
│   ├── Primitive\         # Primitive Types (FHIRString, FHIRInteger, etc.)
│   └── Enum\              # Value Set Enums (FHIRAdministrativeGender, etc.)
├── R4B\                   # Same structure as R4
└── R5\                    # Same structure as R4

```

Backbone elements are nested within their parent resource directory:

```
R4\Resource\
├── FHIRPatient.php
├── Patient\
│   ├── FHIRPatientContact.php
│   ├── FHIRPatientCommunication.php
│   └── FHIRPatientLink.php

```

Usage
-----

[](#usage)

```
use Ardenexal\FHIRTools\Component\Models\R4\Resource\FHIRPatient;
use Ardenexal\FHIRTools\Component\Models\R4\DataType\FHIRHumanName;
use Ardenexal\FHIRTools\Component\Models\R4\Primitive\FHIRString;
use Ardenexal\FHIRTools\Component\Models\R4\Enum\FHIRAdministrativeGender;

// Create a patient
$patient = new FHIRPatient(
    id: new FHIRString('patient-123'),
    name: [
        new FHIRHumanName(
            family: new FHIRString('Doe'),
            given: [new FHIRString('John')],
        ),
    ],
);

// Access properties
echo $patient->id->value;           // 'patient-123'
echo $patient->name[0]->family->value; // 'Doe'

// Enums
$gender = FHIRAdministrativeGender::MALE;
$cases = FHIRAdministrativeGender::cases(); // all enum values
```

Version Isolation
-----------------

[](#version-isolation)

Each FHIR version has its own namespace, so multiple versions can coexist:

```
use Ardenexal\FHIRTools\Component\Models\R4\Resource\FHIRPatient as R4Patient;
use Ardenexal\FHIRTools\Component\Models\R4B\Resource\FHIRPatient as R4BPatient;
```

Requirements
------------

[](#requirements)

- **PHP**: 8.3 or higher

License
-------

[](#license)

This component is released under the MIT License. See the [LICENSE](../../../LICENSE) file for details.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~6 days

Total

6

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40bdcfdbd80eda272029a422eee67464bf9b82f26271252e9425a1d583c03d34?d=identicon)[Ardenexal](/maintainers/Ardenexal)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")[![Ardenexal](https://avatars.githubusercontent.com/u/2852475?v=4)](https://github.com/Ardenexal "Ardenexal (2 commits)")

---

Tags

phpmodelshl7fhirhealthcarer4r4br5

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ardenexal-fhir-models/health.svg)

```
[![Health](https://phpackages.com/badges/ardenexal-fhir-models/health.svg)](https://phpackages.com/packages/ardenexal-fhir-models)
```

###  Alternatives

[wsdltophp/packagebase

Contains the base classes to be used by classes generated by wsdltophp/packagegenerator

234.6M93](/packages/wsdltophp-packagebase)[dcarbone/php-fhir

Tools for creating PHP classes from the HL7 FHIR Specification

148288.8k1](/packages/dcarbone-php-fhir)[dcarbone/php-fhir-generated

Pre-generated classes from dcarbone/php-fhir

40451.6k1](/packages/dcarbone-php-fhir-generated)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)[josezenem/laravel-slugidable

A package for Laravel that creates slugs for Eloquent models based on title and ID

1159.5k](/packages/josezenem-laravel-slugidable)

PHPackages © 2026

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