openxtrem / fhir-core
2.2.4
2024-04-23 13:42 UTC
Requires
- php: 8.1.* | 8.2.*
- ext-ctype: *
- ext-dom: *
- ext-json: *
Requires (Dev)
- openxtrem/coding-standard: ^1.0.0
- phpstan/phpstan: 1.7.*
- phpunit/phpunit: 9.5.*
- symfony/http-client: ^5.4
- symfony/http-foundation: ^5.4
- symfony/mime: ^5.4
- dev-main
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.1
- 1.0.0
- 1.0.0-beta2.0
- 1.0.0-beta1.1
- dev-bugfix/Execution-Repetition
- dev-feature/OXI-3311-Version-R5
- dev-feature/OXI-2986-FHIR-Validator
- dev-feature/ModelOptimisation
- dev-feature/OXI-2947-ameliorations
- dev-feature/1_0_x-dev
- dev-release/v1
- dev-feature/2_0_X-dev
- dev-feature/clean-composer
- dev-test/ci
This package is auto-updated.
Last update: 2024-04-25 09:02:04 UTC
README
About
This library includes a generator for creating PHP classes from the HL7 FHIR specification, together with serializers and parsers for JSON and XML.
The project is under development
Generated classes usage example
$humanName = (new FHIRHumanName())
->setFamily('MyFamilyName')
->addGiven('MyGiven')
->addGiven('MySecondGiven');
$patient = (new FHIRPatient())
->setActive(true)
->setName($humanName);
Serializer
- Using Generated classes and structure definition (R4 FHIR version)
Example
PHP Usage
$XMLSerializer = new XMLSerializer();
$JSONSerializer = new JSONSerializer();
$XMLPatientString = $XMLSerializer->serialize($patient)
or
$XMLPatientString = (string)Serializer::serialize($patient, Serializer::FORMAT_XML)
Parser
- Using Generated classes and structure definition (R4 FHIR version)
Example
XML Patient
<?xml version="1.0" encoding="UTF-8"?>
<Patient xmlns="http://hl7.org/fhir">
<active value="true"/>
<name>
<family value="MyFamilyName"/>
<given value="MyGiven"/>
<given value="MySecondGiven"/>
</name>
</Patient>
PHP Usage
$XMLParser = new XMLParser();
$JSONParser = new JSONParser();
$patient = $XMLParser->parse($XMLPatientString)
or
$patient = Parser::parse($XMLPatientString)->getResource()