This library includes a FHIR PHP model, together with serializers and parsers for JSON and XML. The code is generated by dcarbone/php-fhir, supplemented with tests.
- Homepage: http://hl7.org/fhir/STU3/index.html
- Resource documentation: http://hl7.org/fhir/STU3/resourcelist.html
$ composer require luscii/php-fhir-model
// src/example.php:
require_once __DIR__ . '/../vendor/autoload.php';
$parser = new \HL7\FHIR\STU3\PHPFHIRResponseParser(false);
$json = '{"resourceType":"Patient", etc...}';
$resource = $this->parser->parse($json);
// Use $resource as an object
No for all code in src/
, because this is the result of generating with
dcarbone/php-fhir and will not be directly changed. Fixes and additions should
be done in dcarbone/php-fhir and not here.
Exception: you can submit a newly generated set of classes,
see below for instructions.
Yes for all code in tests/
and the organizational files in the repository
root, those are all handwritten.
Older versions (DSTU1, DSTU2) are not suppored in this library, but you can generate the classes yourself with dcarbone/php-fhir.
When a future FHIR version gets released, we will probably add it next to the current version (separate namespace) or create a new library. We don't want to create a branch per version, because we want to support using multiple versions simultaneously in one application using Composer as a dependency manager.
For contributors/maintainers: to update the files in this repository, follow these steps.
- Clone https://github.com/dcarbone/php-fhir (the generator) and make sure it's up to date
- Run
./bin/generate.sh --versions STU3
from the root of the generator - Copy the generated classes here
- Commit
This repository is currently primarily intended for our own use. We cannot commit yet to maintain it in the future, but feel free to fork if this becomes an issue. That being said, please file issues, feedback or improvements.