From e5eb09ccb0520e363ed90dcaa2c6ba6bba8c3138 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Wed, 15 Jan 2025 10:36:47 -0600 Subject: [PATCH] little bit of docs --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index a6da378d..51b543a4 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,33 @@ If you're looking to use the classes generated by this library, you may want th Please refer to our wiki for the latest documentation: https://github.com/dcarbone/php-fhir/wiki +# V4 Changes + +Version 4 of this libary constitutes a near-complete rewrite of the builder and resulting code. The primary goals +of this rewrite were to: + +1. Make constructing types easier / less tedious: + * Type constructors now have a parameter per field, rather than accepting an nested assocative array of values. + * Promoting use of PHP 8.0+ named parameters (https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments). +2. Improve performance of generated code. + * Type properties no longer carry a "default" value of null or empty array. They are now either set to a non-empty + value or are not set at all. + * JSON serialization in particular no longer uses `$out->{self::FIELD_ID} = $v;` syntax for setting fields, favoring setting + the field directly via `$out->id = $v;`. In general, more direct use of properties is made. +3. Separate core classes, interfaces, traits, enums, etc., from FHIR resource classes. + * "Core" classes are now present under the root namespace, with each generated version in a separate sub-namespace. + * "Version Type" classes are further sub-namespaced under each version namespace to separate them from "Version Core" classes. +4. Provide a basic API client + * This is still very much a work in progress, but the goal is to provide a simple, easy-to-use API client for FHIR servers. +5. Separate "Core" entities into their own namespace + * "Core" entities are now separated into common-purpose namespaces, such as `Encoding`, `Client`, `Validation`, etc. +6. Improve and simplify runtime configuration + * I have created two core config classes: + * `Encoding\UnserializeConfig` - Configures both JSON and XML unserialization options + * `Encoding\SerializeConfig` - Configures both JSON and XML serialization options +7. Simplify templates + * This is still a work in progress, and will probably drastically change again. + ## Parsing Example ```php