Skip to content

Commit

Permalink
little bit of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarbone committed Jan 15, 2025
1 parent 52bce9f commit e5eb09c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5eb09c

Please sign in to comment.