Skip to content
Daniel Carbone edited this page Apr 2, 2026 · 13 revisions

php-fhir

Tools for generating PHP classes from the HL7 FHIR specification.

php-fhir reads FHIR XSD schema files and produces a fully-typed PHP library complete with models, (un)serialization, validation, and a FHIR REST client — ready to drop into any PHP 8.1+ project.

Pre-generated Code

If you don't need to customise the generation process and just want usable FHIR models, grab the pre-built package: dcarbone/php-fhir-generated

Support Matrix

PHPFHIR Version PHP Versions FHIR Versions Supported
v4 8.1+ DSTU1, DSTU2, STU3, R4, R4B, R5 Yes
v3 8.1–8.4 DSTU1, DSTU2, STU3, R4, R4B, R5 No
v2 5.4–7.4 DSTU1, DSTU2, STU3, R4 No

Wiki Contents

Page Description
Getting Started Prerequisites, installation, and downloading FHIR schemas
CLI Usage Running the generator from the command line
Configuration Reference All Config and VersionConfig options
Architecture How the generator pipeline works internally
Generated Code Understanding the output: namespaces, types, client, encoding
Testing Running tests on the generator and on generated code
Contributing Developer workflow and code-style notes

Quick Links

Clone this wiki locally