This file documents any backwards-incompatible changes in SDK and assists users migrating to a new version.
The Model was changed quit significantly so code wich manipulates ot introspects them will be needed to be reimplemented:
- AQL is parsed via
AqlQueryParser::parse - AQL is rendered via
AqlRenderer::render - parsing is now based on the official grammar
AqlDtohas been replaced byAqlQuery- the underlying model is now more closely aligned with the grammar
The base package path of any SDK class is now org.ehrbase.openehr.sdk followed by the artifact-id of the containing module.
Since classes have also been relocated to different modules or replaced, simple string replacement will not suffice. A reimport of the used SDK classes is recommended.
Notable changes:
- new module generator-commons:
org.ehrbase.openehr.sdk.generator.commons- shared classes used by multiple packages to be compatible with the DTO classes generated from templates
- test-jar providing test data for features making use of generated DTOs
- AQL model for generated DTOs (former
org.ehrbase.client.aql) - most classes from former
org.ehrbase.client.classgeneratorpackage
- The class
org.ehrbase.client.openehrclient.VersionUidhas been removed and replaced by the archie class it was duplicating (com.nedap.archie.rm.support.identification.ObjectVersionId)- The respective change in any generated DTOs can be done by String replacement of
VersionUidwithObjectVersionIdand same for the import or by regenerating the DTOs, if they do not include modifications - The archie class
ObjectVersionIdprovides the same basic values, but as strings using different methodsVersionUid.getUuid()(returnsjava.util.UUID) should be replaced byObjectVersionId.getObjectId().getValue()(returnsjava.lang.String) and parsed as UUID if neededVersionUid.getSystem()(returnsjava.lang.String) should be replaced byObjectVersionId.getCreatingSystemId().getValue()(returnsjava.lang.String)VersionUid.getVersion()(returnslong) should be replaced byObjectVersionId.getVersionTreeId().getValue()(returnsjava.lang.String) and parsed as long if needed (note that versions can follow the SemVer scheme and are therefore not necessarily numbers)VersionUid.toString()(returnsjava.lang.String) should be replaced byObjectVersionId.getValue()(returnsjava.lang.String)- note that system and version parts are optional and that
ObjectVersionId.getObjectId()andObjectVersionId.getVersionTreeId()throw an exception if the respective part is not present
- The respective change in any generated DTOs can be done by String replacement of
- The client for Contributions
org.ehrbase.openehr.sdk.client.openehrclient.ContributionEndpointusesjava.util.UUIDinstead oforg.ehrbase.client.openehrclient.VersionUidsince CONTRIBUTION itself does not have a version
Classes generated with the old SDK can be used with the new version
It is recommended to update the generated classes. To do this:
-
Update the sdk version
-
Rename any Name with *defningcode to *defningCode
-
replace the EnumValueSet in your local shareddefinition folder with the new from the sdk:
- Language -> org.ehrbase.client.generator.shareddefinition.Language
- CategoryDefiningcode -> org.ehrbase.client.generator.shareddefinition.Category
- MathFunctionDefiningcode -> org.ehrbase.client.generator.shareddefinition.MathFunction
- SettingDefiningcode -> org.ehrbase.client.generator.shareddefinition.Setting
- Territory -> org.ehrbase.client.generator.shareddefinition.Territory
- TransitionDefiningcode -> org.ehrbase.client.generator.shareddefinition.Transition
-
Generate your classes new with the generator using generator/src/main/resources/LegacyConfig.yaml as config
-
Delete you old classes and replaces them with the new one
-
There may be some more changes regrading the naming or the class structure which you have to change in your code.