From 94d9fb0ea54b602c48363fae98f9e717022947bd Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 12 Jun 2025 11:30:27 +0200 Subject: [PATCH 01/60] Replace MetaModels class with MetaModelProviders (#690) * Refactor MetaModels * Replace or deprecate usages of MetaModels * Deprecate MetaModelInterface * Add SimpleMetaModelProviderTest --- README.md | 14 +- .../ADL14DefaultMultiplicitiesSetter.java | 24 +- .../archie/adl14/ADL14NodeIDConverter.java | 22 +- .../com/nedap/archie/adl14/ADL14Parser.java | 26 +- .../com/nedap/archie/adlparser/ADLParser.java | 35 ++- .../ReflectionConstraintImposer.java | 8 + .../adlparser/treewalkers/ADLListener.java | 24 +- .../treewalkers/CComplexObjectParser.java | 23 ++ .../com/nedap/archie/aom/utils/AOMUtils.java | 26 ++ .../com/nedap/archie/rminfo/MetaModel.java | 4 + .../archie/rminfo/MetaModelInterface.java | 4 + .../archie/rminfo/MetaModelProvider.java | 75 +++++ .../com/nedap/archie/rminfo/MetaModels.java | 123 ++++---- .../rminfo/NoModelSelectedException.java | 4 + .../rminfo/OverridingMetaModelProvider.java | 84 ++++++ .../rminfo/SimpleMetaModelProvider.java | 98 +++++++ referencemodels/build.gradle | 1 + .../BuiltinReferenceModels.java | 20 +- .../OverridingMetaModelProviderTest.java | 47 +++ .../rminfo/SimpleMetaModelProviderTest.java | 267 ++++++++++++++++++ .../BuiltInReferenceModelsTest.java | 1 + .../nedap/archie/adl14/ADL14Converter.java | 23 +- .../adl14/DefaultRmStructureRemover.java | 40 ++- .../ArchetypeValidation.java | 12 +- .../ArchetypeValidationBase.java | 10 +- .../ArchetypeValidator.java | 48 ++-- .../validations/AnnotationsValidation.java | 2 +- .../validations/AttributeTupleValidation.java | 2 +- .../BasicTerminologyValidation.java | 2 +- .../validations/CodeValidation.java | 2 +- .../DefinitionStructureValidation.java | 2 +- .../validations/FlatFormValidation.java | 4 +- .../validations/RmOverlayValidation.java | 2 +- .../SpecializedDefinitionValidation.java | 12 +- .../SpecializedOccurrencesValidation.java | 10 +- .../ValidateAgainstReferenceModel.java | 12 +- .../VariousStructureValidation.java | 6 +- .../ExampleJsonInstanceGenerator.java | 23 +- .../com/nedap/archie/diff/Differentiator.java | 25 +- .../nedap/archie/diff/LCSOrderingDiff.java | 12 +- .../archie/flattener/CAttributeFlattener.java | 8 +- .../com/nedap/archie/flattener/Flattener.java | 54 ++-- .../flattener/FullArchetypeRepository.java | 28 +- .../flattener/IAttributeFlattenerSupport.java | 8 + .../flattener/OperationalTemplateCreator.java | 2 +- .../FlatJsonExampleInstanceGenerator.java | 34 ++- ...ADL14DefaultOccurrencesConversionTest.java | 4 +- ...DL14ExternalTerminologyConversionTest.java | 8 +- .../adl14/ADL14InternalTerminologyTest.java | 4 +- .../adl14/ADL14TerminologyConversionTest.java | 4 +- .../adl14/ArchetypeSlotConversionTest.java | 4 +- .../adl14/AssumedValueConversionTest.java | 6 +- .../adl14/ConversionConfigurationTest.java | 6 +- .../archie/adl14/DvScaleConversionTest.java | 4 +- .../archie/adl14/LargeSetOfADL14sTest.java | 12 +- .../adl14/PreviousLogConversionTest.java | 32 +-- .../adlparser/AomUtilsPathFindingTest.java | 13 +- .../archie/adlparser/RMPathQueryTest.java | 6 +- .../archie/aom/ArchetypeTerminologyTest.java | 4 +- .../aom/TerminologyCodeConstraintsTest.java | 2 +- .../ArchetypeValidatorTest.java | 10 +- .../ArchetypeValidatorVersionsTest.java | 4 +- .../BigArchetypeValidatorTest.java | 11 +- .../CKMArchetypeValidatorTest.java | 7 +- .../TermCodeSpecializationTest.java | 14 +- .../ExampleJsonInstanceGeneratorTest.java | 8 +- .../com/nedap/archie/diff/DiffTestUtil.java | 15 +- .../OperationalTemplateCreatorTest.java | 18 +- .../flattener/RMOverlayFlattenerTest.java | 6 +- .../flattener/SiblingOrderFlattenerTest.java | 4 +- .../FlattenerExamplesFromSpecBMMTest.java | 4 +- .../FlattenerExamplesFromSpecTest.java | 35 +-- .../com/nedap/archie/json/AOMJacksonTest.java | 10 +- .../json/flat/FlatJsonGeneratorTest.java | 37 +-- .../RmObjectValidatorTest.java | 2 +- .../TerminologyCodeConstraintsTest.java | 2 +- .../ValidateArchetypedTest.java | 2 +- .../ArchetypeSlotValidationTest.java | 4 +- .../FixableAssertionsCheckerTest.java | 2 +- .../evaluation/ParsedRulesEvaluationTest.java | 6 +- ...rchetypeSerializerParserRoundtripTest.java | 8 +- .../adl/ADLArchetypeSerializerTest.java | 2 +- .../adl/DefaultValueSerializerTest.java | 12 +- .../nedap/archie/xml/JAXBRMRoundTripTest.java | 2 +- 84 files changed, 1237 insertions(+), 410 deletions(-) create mode 100644 aom/src/main/java/com/nedap/archie/rminfo/MetaModelProvider.java create mode 100644 aom/src/main/java/com/nedap/archie/rminfo/OverridingMetaModelProvider.java create mode 100644 aom/src/main/java/com/nedap/archie/rminfo/SimpleMetaModelProvider.java create mode 100644 referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java create mode 100644 referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java diff --git a/README.md b/README.md index 62224fe00..4ef89bb0f 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository for(Archetype archetype:allArchetypes) { repository.addArchetype(archetype); } -repository.compile(BuiltinReferenceModels.getMetaModels()); +repository.compile(BuiltinReferenceModels.getMetaModelProvider()); for(ValidationResult result:repository.getAllValidationResults()) { ... your code here @@ -149,7 +149,7 @@ The validation result contains the validation result, listing any errors in the ### Reference model metadata -You may have noticed a call to ```BuiltinReferenceModels.getMetaModels()```. This retrieves the metadata for the reference models, which are needed to validate and flatten archetypes. Archie contains two types of metamodels: BMM, and reflection based metadata. +You may have noticed a call to ```BuiltinReferenceModels.getMetaModelProvider()```. This retrieves the metadata for the reference models, which are needed to validate and flatten archetypes. Archie contains two types of metamodels: BMM, and reflection based metadata. The BMM models are a file containing metadata in a form defined by the openEHR specifications. The reflection based metadata contains ModelInfoLookup classes. They are derived from an implementation of a reference model. Note that the ModelInfoLookup classes are only added if you depended on them. If you depended on archie-all, you're all set. @@ -162,7 +162,7 @@ Note that ADL 2 operational templates is fundamentally different from the ADL 1. To create an Operational Template: ```java -Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels()).createOperationalTemplate(true); +Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider()).createOperationalTemplate(true); OperationalTemplate template = (OperationalTemplate) flattener.flatten(sourceArchetype); ``` @@ -221,7 +221,7 @@ The inverse operation of flattening archetypes is diffing. This is useful if you ```java Archetype flatChild, flatParent; //for how to parse and flatten, see elsewhere in the readme -Differentiator differentiator = new Differentiator(BuiltinReferenceModels.getMetaModels()); +Differentiator differentiator = new Differentiator(BuiltinReferenceModels.getMetaModelProvider()); Archetype diffed = differentiator.differentiate(flatChild, flatParent); ``` @@ -391,7 +391,7 @@ If you want to do this yourself, The RMObjectCreator creates empty reference mod Setting primitive object values works in a similar way, with ```creator.set(...)```, or by setting them explicitly on the reference model object directly. -Notice the call to ```ArchieRMInfoLookup.getInstance()```, which obtains the metadata about the reference model implementation. It can also be obtained from the result of ```BuiltinReferenceModels.getMetaModels()```, or you can define your own to make Archie work with your own reference model implementation. +Notice the call to ```ArchieRMInfoLookup.getInstance()```, which obtains the metadata about the reference model implementation. It can also be obtained from the result of ```BuiltinReferenceModels.getMetaModelProvider()```, or you can define your own to make Archie work with your own reference model implementation. ### Parsing JSON @@ -456,10 +456,10 @@ Starting from version 0.7, Archie can import ADL 1.4 files, and convert them to ```java ADL14ConversionConfiguration conversionConfiguration = new ADL14ConversionConfiguration(); -ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); +ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); List archetypes = new ArrayList<>(); -ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); +ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); for(String file:fileNames) { try(InputStream stream = new FileInputStream(file)) { diff --git a/aom/src/main/java/com/nedap/archie/adl14/ADL14DefaultMultiplicitiesSetter.java b/aom/src/main/java/com/nedap/archie/adl14/ADL14DefaultMultiplicitiesSetter.java index 80b86d0e6..095958cf7 100644 --- a/aom/src/main/java/com/nedap/archie/adl14/ADL14DefaultMultiplicitiesSetter.java +++ b/aom/src/main/java/com/nedap/archie/adl14/ADL14DefaultMultiplicitiesSetter.java @@ -4,6 +4,8 @@ import com.nedap.archie.aom.CAttribute; import com.nedap.archie.aom.CObject; import com.nedap.archie.base.MultiplicityInterval; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; /** @@ -17,24 +19,32 @@ */ public class ADL14DefaultMultiplicitiesSetter { - private final MetaModels metaModels; + private final MetaModelProvider metaModelProvider; + /** + * @deprecated Use {@link #ADL14DefaultMultiplicitiesSetter(MetaModelProvider)} instead. + */ + @Deprecated public ADL14DefaultMultiplicitiesSetter(MetaModels metaModels) { - this.metaModels = metaModels; + this((MetaModelProvider) metaModels); + } + + public ADL14DefaultMultiplicitiesSetter(MetaModelProvider metaModelProvider) { + this.metaModelProvider = metaModelProvider; } public void setDefaults(Archetype archetype) { - metaModels.selectModel(archetype); - correctItemsMultiplicities(archetype.getDefinition()); + MetaModel metaModel = metaModelProvider.selectAndGetMetaModel(archetype); + correctItemsMultiplicities(metaModel, archetype.getDefinition()); } - private void correctItemsMultiplicities(CObject cObject) { + private void correctItemsMultiplicities(MetaModel metaModel, CObject cObject) { for (CAttribute attribute : cObject.getAttributes()) { for (CObject child : attribute.getChildren()) { - if (child.getOccurrences() == null && metaModels.isMultiple(cObject.getRmTypeName(), attribute.getRmAttributeName())) { + if (child.getOccurrences() == null && metaModel.isMultiple(cObject.getRmTypeName(), attribute.getRmAttributeName())) { child.setOccurrences(new MultiplicityInterval(1, 1)); } - correctItemsMultiplicities(child); + correctItemsMultiplicities(metaModel, child); } } diff --git a/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java b/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java index 48ad8663d..aa06afe1a 100644 --- a/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java +++ b/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java @@ -13,6 +13,8 @@ import com.nedap.archie.base.Cardinality; import com.nedap.archie.paths.PathSegment; import com.nedap.archie.query.APathQuery; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; import com.nedap.archie.rules.*; @@ -33,7 +35,8 @@ public class ADL14NodeIDConverter { private final ADL14TermConstraintConverter termConstraintConverter; private final PreviousConversionApplier previousConversionApplier; private final ADL2ConversionResult conversionResult; - private final MetaModels metaModels; + private final MetaModelProvider metaModelProvider; + private final MetaModel metaModel; private IdCodeGenerator idCodeGenerator; @@ -45,8 +48,17 @@ public class ADL14NodeIDConverter { private final Map createdValueSets = new LinkedHashMap<>(); private final Map newCodeToOldCodeMap = new LinkedHashMap<>(); + /** + * @deprecated Use {@link #ADL14NodeIDConverter(MetaModelProvider, Archetype, Archetype, ADL14ConversionConfiguration, ADL2ConversionLog, ADL2ConversionResult)} instead. + */ + @Deprecated public ADL14NodeIDConverter(MetaModels metaModels, Archetype archetype, Archetype flatParentArchetype, ADL14ConversionConfiguration configuration, ADL2ConversionLog oldLog, ADL2ConversionResult conversionResult) { - this.metaModels = metaModels; + this((MetaModelProvider) metaModels, archetype, flatParentArchetype, configuration, oldLog, conversionResult); + } + + public ADL14NodeIDConverter(MetaModelProvider metaModelProvider, Archetype archetype, Archetype flatParentArchetype, ADL14ConversionConfiguration configuration, ADL2ConversionLog oldLog, ADL2ConversionResult conversionResult) { + this.metaModelProvider = metaModelProvider; + this.metaModel = metaModelProvider.getMetaModel(archetype); this.conversionConfiguration = configuration; this.archetype = archetype; this.flatParentArchetype = flatParentArchetype; @@ -61,7 +73,7 @@ public ADL14ConversionConfiguration getConversionConfiguration() { } public ADL2ConversionLog convert() { - metaModels.selectModel(archetype); + metaModelProvider.selectAndGetMetaModel(archetype); // For backwards compatibility correctItemsCardinality(archetype.getDefinition()); List unnecessaryCodes = findUnnecessaryCodes(archetype.getDefinition(), @@ -123,7 +135,7 @@ private List findUnnecessaryCodes(CObject cObject, Map seenMetaDataIdentifiers = new HashSet<>(); private Archetype archetype; - private CComplexObjectParser cComplexObjectParser; private TerminologyParser terminologyParser; - private MetaModels metaModels; + private final MetaModelProvider metaModelProvider; + /** + * @deprecated Use {@link #ADLListener(ANTLRParserErrors, MetaModelProvider)} instead. + */ + @Deprecated public ADLListener(ANTLRParserErrors errors, MetaModels metaModels) { + this(errors, (MetaModelProvider) metaModels); + } + + public ADLListener(ANTLRParserErrors errors, MetaModelProvider metaModelProvider) { this.errors = errors; - cComplexObjectParser = new CComplexObjectParser(errors, metaModels); terminologyParser = new TerminologyParser(errors); - this.metaModels = metaModels; + this.metaModelProvider = metaModelProvider; } /** top-level constructs */ @@ -110,8 +118,8 @@ private void parseArchetypeHRID(TerminalNode hrId) { if(hrId != null) { ArchetypeHRID archetypeID = new ArchetypeHRID(hrId.getText()); archetype.setArchetypeId(archetypeID); - if(metaModels != null) { - metaModels.selectModel(archetype); + if(metaModelProvider != null) { + metaModelProvider.selectAndGetMetaModel(archetype); // For backwards compatibility } } } @@ -195,6 +203,8 @@ public void enterMetaDataItem(AdlParser.MetaDataItemContext ctx) { */ @Override public void enterDefinitionSection(DefinitionSectionContext ctx) { + MetaModel metaModel = metaModelProvider == null ? null : metaModelProvider.getMetaModel(archetype); + CComplexObjectParser cComplexObjectParser = new CComplexObjectParser(errors, metaModel); CComplexObject definition = cComplexObjectParser.parseComplexObject(ctx.c_complex_object()); archetype.setDefinition(definition); } @@ -223,6 +233,8 @@ public void enterSpecializationSection(SpecializationSectionContext ctx) { @Override public void enterRulesSection(RulesSectionContext ctx) { + MetaModel metaModel = metaModelProvider == null ? null : metaModelProvider.getMetaModel(archetype); + CComplexObjectParser cComplexObjectParser = new CComplexObjectParser(errors, metaModel); archetype.setRules(cComplexObjectParser.parseRules(ctx)); } diff --git a/aom/src/main/java/com/nedap/archie/adlparser/treewalkers/CComplexObjectParser.java b/aom/src/main/java/com/nedap/archie/adlparser/treewalkers/CComplexObjectParser.java index 43bf2fbf3..1ac3c17b6 100644 --- a/aom/src/main/java/com/nedap/archie/adlparser/treewalkers/CComplexObjectParser.java +++ b/aom/src/main/java/com/nedap/archie/adlparser/treewalkers/CComplexObjectParser.java @@ -7,6 +7,7 @@ import com.nedap.archie.base.Cardinality; import com.nedap.archie.base.MultiplicityInterval; import com.nedap.archie.base.OpenEHRBase; +import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.rminfo.MetaModels; import com.nedap.archie.rules.Assertion; import com.nedap.archie.serializer.odin.AdlOdinToJsonConverter; @@ -24,12 +25,26 @@ public class CComplexObjectParser extends BaseTreeWalker { private final PrimitivesConstraintParser primitivesConstraintParser; + @Deprecated private final MetaModels metaModels; + private final MetaModel metaModel; + /** + * @deprecated Use {@link #CComplexObjectParser(ANTLRParserErrors, MetaModel)} instead. + */ + @Deprecated public CComplexObjectParser(ANTLRParserErrors errors, MetaModels metaModels) { super(errors); primitivesConstraintParser = new PrimitivesConstraintParser(errors); this.metaModels = metaModels; + this.metaModel = null; + } + + public CComplexObjectParser(ANTLRParserErrors errors, MetaModel metaModel) { + super(errors); + primitivesConstraintParser = new PrimitivesConstraintParser(errors); + this.metaModels = null; + this.metaModel = metaModel; } public RulesSection parseRules(RulesSectionContext context) { @@ -158,6 +173,10 @@ private void parseOdinDefaultValue(CComplexObject parent, Default_valueContext d } private ObjectMapper getDefaultValueJsonObjectMapper() { + if(metaModel != null) { + return metaModel.getJsonObjectMapper(); + } + // For backwards compatiblity if(metaModels == null) { return null; } @@ -168,6 +187,10 @@ private ObjectMapper getDefaultValueJsonObjectMapper() { } private ObjectMapper getDefaultValueOdinObjectMapper() { + if(metaModel != null) { + return metaModel.getOdinInputObjectMapper(); + } + // For backwards compatiblity if(metaModels == null) { return null; } diff --git a/aom/src/main/java/com/nedap/archie/aom/utils/AOMUtils.java b/aom/src/main/java/com/nedap/archie/aom/utils/AOMUtils.java index d328799dc..a1efef59e 100644 --- a/aom/src/main/java/com/nedap/archie/aom/utils/AOMUtils.java +++ b/aom/src/main/java/com/nedap/archie/aom/utils/AOMUtils.java @@ -445,7 +445,9 @@ public static boolean valueSetContainsCodeOrParent(Collection valueSetMe * Check if the parent attribute of the given CObject is a container attribute. * * @see MetaModelInterface#isMultiple(String, String) + * @deprecated Use {@link #parentIsMultiple(CObject, Archetype, MetaModel)} instead. */ + @Deprecated public static boolean parentIsMultiple(CObject cObject, Archetype flatParentArchetype, MetaModels metaModels) { if(cObject.getParent() != null) { @@ -464,4 +466,28 @@ public static boolean parentIsMultiple(CObject cObject, Archetype flatParentArch } return false; } + + /** + * Check if the parent attribute of the given CObject is a container attribute. + * + * @see MetaModel#isMultiple(String, String) + */ + public static boolean parentIsMultiple(CObject cObject, Archetype flatParentArchetype, MetaModel metaModel) { + if(cObject.getParent() != null) { + + CAttribute parent = cObject.getParent(); + CObject owningObject = parent.getParent(); + if (parent.getDifferentialPath() != null && flatParentArchetype != null) { + CAttribute attributeFromParent = (CAttribute) AOMUtils.getDifferentialPathFromParent(flatParentArchetype, parent); + if(attributeFromParent != null) { + owningObject = attributeFromParent.getParent(); + } + + } + if(owningObject != null) { + return metaModel.isMultiple(owningObject.getRmTypeName(), parent.getRmAttributeName()); + } + } + return false; + } } diff --git a/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java b/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java index 2a8bae9d4..d8277f198 100644 --- a/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java +++ b/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java @@ -111,6 +111,10 @@ public ObjectMapper getJsonObjectMapper() { return jsonObjectMapper; } + /** + * determine if a property on a type is multiple or not. If the property cannot be found, returns false. + * Works both on properties on a type, or on path based lookup. + */ @Override public boolean isMultiple(String typeName, String attributeNameOrPath) { MultiplicityInterval multiplicityInterval = referenceModelPropMultiplicity(typeName, attributeNameOrPath); diff --git a/aom/src/main/java/com/nedap/archie/rminfo/MetaModelInterface.java b/aom/src/main/java/com/nedap/archie/rminfo/MetaModelInterface.java index 1dbda1879..ac4dccb2f 100644 --- a/aom/src/main/java/com/nedap/archie/rminfo/MetaModelInterface.java +++ b/aom/src/main/java/com/nedap/archie/rminfo/MetaModelInterface.java @@ -3,6 +3,10 @@ import com.nedap.archie.aom.CPrimitiveObject; import com.nedap.archie.base.MultiplicityInterval; +/** + * @deprecated Use {@link MetaModel} instead. + */ +@Deprecated public interface MetaModelInterface { /** * determine if a property on a type is multiple or not. If the property cannot be found, returns false. diff --git a/aom/src/main/java/com/nedap/archie/rminfo/MetaModelProvider.java b/aom/src/main/java/com/nedap/archie/rminfo/MetaModelProvider.java new file mode 100644 index 000000000..a34584847 --- /dev/null +++ b/aom/src/main/java/com/nedap/archie/rminfo/MetaModelProvider.java @@ -0,0 +1,75 @@ +package com.nedap.archie.rminfo; + +import com.nedap.archie.aom.Archetype; + +/** + * A provider for meta models, which can be used to retrieve the meta model for a specific reference model based on an + * archetype or reference model publisher, package and release version. + */ +public interface MetaModelProvider { + /** + * Get a meta model based on an archetype. + * + * @param archetype the archetype to find the meta model for + * @return the meta model for the reference model that the archetype is based on + * @throws ModelNotFoundException when no BMM and no ModelInfoLookup model has been found matching the archetype + */ + public default MetaModel getMetaModel(Archetype archetype) throws ModelNotFoundException { + return getMetaModel(archetype, archetype.getRmRelease()); + } + + /** + * Get a meta model based on an archetype, but override the RM release version from the archetype with the given RM + * release version. + * + * @param archetype the archetype to find the meta model for + * @param rmRelease the release version of the reference model. This will override the RM release version in the + * archetype. + * @return the meta model for the reference model that the archetype is based on + * @throws ModelNotFoundException when no BMM and no ModelInfoLookup model has been found matching the archetype and + * RM version + */ + public default MetaModel getMetaModel(Archetype archetype, String rmRelease) throws ModelNotFoundException { + return getMetaModel( + archetype.getArchetypeId().getRmPublisher(), + archetype.getArchetypeId().getRmPackage(), + rmRelease + ); + } + + /** + * Get a model based on a reference model publisher, package and release version. + * + * @param rmPublisher the publisher of the reference model + * @param rmPackage the package of the reference model + * @param rmRelease the release version of the reference model + * @return the meta model + * @throws ModelNotFoundException when no BMM and no ModelInfoLookup model has been found matching the publisher, + * package and release version + */ + public abstract MetaModel getMetaModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException; + + /** + * @deprecated For backwards compatibility only. Use {@link #getMetaModel(Archetype)} instead. + */ + @Deprecated + public default MetaModel selectAndGetMetaModel(Archetype archetype) throws ModelNotFoundException { + return getMetaModel(archetype); + } + + /** + * @deprecated For backwards compatibility only. Use {@link #getMetaModel(Archetype, String)} instead. + */ + @Deprecated + public default MetaModel selectAndGetMetaModel(Archetype archetype, String rmVersion) throws ModelNotFoundException { + return getMetaModel(archetype, rmVersion); + } + + /** + * @deprecated For backwards compatibility only. Use {@link #getMetaModel(String, String, String)} instead. + */ + @Deprecated + public default MetaModel selectAndGetMetaModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException { + return getMetaModel(rmPublisher, rmPackage, rmRelease); + } +} diff --git a/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java b/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java index 56d80e63d..eb491715e 100644 --- a/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java +++ b/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java @@ -6,12 +6,7 @@ import com.nedap.archie.aom.profile.AomProfiles; import com.nedap.archie.base.MultiplicityInterval; import org.openehr.bmm.core.BmmModel; -import org.openehr.bmm.persistence.validation.BmmDefinitions; import org.openehr.bmm.v2.validation.BmmRepository; -import org.openehr.bmm.v2.validation.BmmValidationResult; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * MetaModel class that provides some opertaions for archetype validation and flattener that is either based on @@ -27,32 +22,28 @@ * * Note that this class is NOT thread-safe and is to be used by a single thread only. * + * @deprecated Use {@link SimpleMetaModelProvider}, {@link OverridingMetaModelProvider} or {@link MetaModel} instead. */ -public class MetaModels implements MetaModelInterface { - +@Deprecated +public class MetaModels implements MetaModelInterface, MetaModelProvider { private final ReferenceModels models; private final BmmRepository bmmRepository; - private AomProfiles aomProfiles; + private final AomProfiles aomProfiles; + private final OverridingMetaModelProvider overridingMetaModelProvider; private MetaModel selectedModel; - private AomProfile selectedAomProfile; - - /** - * Allows to set a specific RM version for a specific RM model, so that one is used instead of the one in the archetype - */ - private Map overriddenMetaModelVersions = new ConcurrentHashMap<>(); - public MetaModels(ReferenceModels models, BmmRepository repository) { - this.models = models; - this.bmmRepository = repository; - aomProfiles = new AomProfiles(); + this(models, repository, new AomProfiles()); } public MetaModels(ReferenceModels models, BmmRepository repository, AomProfiles profiles) { this.models = models; this.bmmRepository = repository; aomProfiles = profiles; + this.overridingMetaModelProvider = new OverridingMetaModelProvider( + new SimpleMetaModelProvider(models, repository, profiles) + ); } /** @@ -64,10 +55,7 @@ public MetaModels(ReferenceModels models, BmmRepository repository, AomProfiles * @param version the version that should be chosen */ public void overrideModelVersion(String rmPublisher, String rmPackage, String version) { - this.overriddenMetaModelVersions.put( - BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage), - version - ); + overridingMetaModelProvider.overrideModelVersion(rmPublisher, rmPackage, version); } /** @@ -76,12 +64,47 @@ public void overrideModelVersion(String rmPublisher, String rmPackage, String ve * @param rmPackage the RM Package to remove the model version for */ public void removeOverridenModelVersion(String rmPublisher, String rmPackage) { - this.overriddenMetaModelVersions.remove(BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage)); + overridingMetaModelProvider.removeOverridenModelVersion(rmPublisher, rmPackage); } - public String getOverriddenModelVersion(String rmPublisher, String rmPackage) { - return this.overriddenMetaModelVersions.get(BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage)); + return overridingMetaModelProvider.getOverriddenModelVersion(rmPublisher, rmPackage); + } + + @Override + public MetaModel getMetaModel(Archetype archetype) throws ModelNotFoundException { + return overridingMetaModelProvider.getMetaModel(archetype); + } + + @Override + public MetaModel getMetaModel(Archetype archetype, String rmVersion) throws ModelNotFoundException { + return overridingMetaModelProvider.getMetaModel(archetype, rmVersion); + } + + @Override + public MetaModel getMetaModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException { + return overridingMetaModelProvider.getMetaModel(rmPublisher, rmPackage, rmRelease); + } + + @Override + public MetaModel selectAndGetMetaModel(Archetype archetype) throws ModelNotFoundException { + MetaModel result = getMetaModel(archetype); + this.selectedModel = result; + return result; + } + + @Override + public MetaModel selectAndGetMetaModel(Archetype archetype, String rmVersion) throws ModelNotFoundException { + MetaModel result = getMetaModel(archetype, rmVersion); + this.selectedModel = result; + return result; + } + + @Override + public MetaModel selectAndGetMetaModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException { + MetaModel result = getMetaModel(rmPublisher, rmPackage, rmRelease); + this.selectedModel = result; + return result; } /** @@ -90,8 +113,7 @@ public String getOverriddenModelVersion(String rmPublisher, String rmPackage) { * @throws ModelNotFoundException when no BMM and no ModelInfoLookup model has been found matching the archetype */ public void selectModel(Archetype archetype) throws ModelNotFoundException { ; - String overriddenVersion = getOverriddenModelVersion(archetype.getArchetypeId().getRmPublisher(), archetype.getArchetypeId().getRmPackage()); - selectModel(archetype, overriddenVersion == null ? archetype.getRmRelease(): overriddenVersion); + selectAndGetMetaModel(archetype); } /** @@ -101,7 +123,7 @@ public String getOverriddenModelVersion(String rmPublisher, String rmPackage) { * @throws ModelNotFoundException */ public void selectModel(Archetype archetype, String rmVersion) throws ModelNotFoundException { ; - selectModel(archetype.getArchetypeId().getRmPublisher(), archetype.getArchetypeId().getRmPackage(), rmVersion); + selectAndGetMetaModel(archetype, rmVersion); } /** @@ -113,48 +135,7 @@ public String getOverriddenModelVersion(String rmPublisher, String rmPackage) { * @throws ModelNotFoundException */ public void selectModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException { - ModelInfoLookup selectedModel = null; - BmmModel selectedBmmModel = null; - RMObjectMapperProvider objectMapperProvider = null; - if(models != null) { - selectedModel = models.getModel(rmPublisher, rmPackage); - objectMapperProvider = models.getRmObjectMapperProvider(rmPublisher, rmPackage); - } - if(bmmRepository != null) { - BmmValidationResult validationResult = bmmRepository.getModelByClosure(BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage) + "_" + rmRelease); - selectedBmmModel = validationResult == null ? null : validationResult.getModel(); - } - - this.selectedAomProfile = getAomProfileWithSchemaId(selectedBmmModel); - if(this.selectedAomProfile == null) { - this.selectedAomProfile = getAomProfileOnPublisher(rmPublisher); - } - - if(selectedModel == null && selectedBmmModel == null) { - throw new ModelNotFoundException(String.format("model for %s.%s version %s not found", rmPublisher, rmPackage, rmRelease)); - } - this.selectedModel = new MetaModel(selectedModel, selectedBmmModel, selectedAomProfile, objectMapperProvider); - - } - - private AomProfile getAomProfileWithSchemaId(BmmModel selectedBmmModel) { - if(selectedBmmModel != null) { - for (AomProfile profile : aomProfiles.getProfiles()) { - if (profile.getRmSchemaPattern().stream().anyMatch(pat -> selectedBmmModel.getSchemaId().matches(pat))) { - return profile; - } - } - } - return null; - } - - private AomProfile getAomProfileOnPublisher(String rmPublisher) { - for(AomProfile profile:aomProfiles.getProfiles()) { - if(profile.getProfileName().equalsIgnoreCase(rmPublisher)) { - return profile; - } - } - return null; + selectAndGetMetaModel(rmPublisher, rmPackage, rmRelease); } public ModelInfoLookup getSelectedModelInfoLookup() { @@ -242,7 +223,7 @@ public AomProfiles getAomProfiles() { } public AomProfile getSelectedAomProfile() { - return selectedAomProfile; + return selectedModel == null ? null : selectedModel.getAomProfile(); } diff --git a/aom/src/main/java/com/nedap/archie/rminfo/NoModelSelectedException.java b/aom/src/main/java/com/nedap/archie/rminfo/NoModelSelectedException.java index 2d09f3a64..2b85122e1 100644 --- a/aom/src/main/java/com/nedap/archie/rminfo/NoModelSelectedException.java +++ b/aom/src/main/java/com/nedap/archie/rminfo/NoModelSelectedException.java @@ -1,5 +1,9 @@ package com.nedap.archie.rminfo; +/** + * @deprecated This class will be removed. + */ +@Deprecated public class NoModelSelectedException extends RuntimeException { public NoModelSelectedException(String message) { diff --git a/aom/src/main/java/com/nedap/archie/rminfo/OverridingMetaModelProvider.java b/aom/src/main/java/com/nedap/archie/rminfo/OverridingMetaModelProvider.java new file mode 100644 index 000000000..e86ac527c --- /dev/null +++ b/aom/src/main/java/com/nedap/archie/rminfo/OverridingMetaModelProvider.java @@ -0,0 +1,84 @@ +package com.nedap.archie.rminfo; + +import com.nedap.archie.aom.Archetype; +import org.openehr.bmm.persistence.validation.BmmDefinitions; + +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * A MetaModelProvider that allows to override the RM release version for a specific RM publisher and package. + *

+ * When the RM release version is overridden for a specific RM publisher and package, the overridden version will be + * used by the {@link #getMetaModel(Archetype)} method to retrieve the meta model. + */ +public class OverridingMetaModelProvider implements MetaModelProvider { + private final MetaModelProvider delegate; + + /** + * Allows to set a specific RM release version for a specific RM model, so that one is used instead of the one in + * the archetype. + */ + private final Map overriddenMetaModelVersions = new ConcurrentHashMap<>(); + + /** + * Create an OverridingMetaModelProvider that delegates to the given MetaModelProvider. + * + * @param delegate the MetaModelProvider to delegate to + */ + public OverridingMetaModelProvider(MetaModelProvider delegate) { + this.delegate = Objects.requireNonNull(delegate, "delegate must not be null"); + } + + /** + * Indicate that the model version for the given package by the given publisher should be fixed + * to a specific version. Useful for validating archetypes against new RM versions, for example OpenEHR + * RM 1.0.2 archetypes against 1.0.4. + * + * @param rmPublisher the publisher of the RM + * @param rmPackage the package of the RM to override the version for + * @param overridingRmRelease the version that should be chosen + */ + public void overrideModelVersion(String rmPublisher, String rmPackage, String overridingRmRelease) { + overriddenMetaModelVersions.put( + BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage), + overridingRmRelease + ); + } + + /** + * Remove the overriden model version for the given publisher and package. + * + * @param rmPublisher the publisher of the package + * @param rmPackage the RM Package to remove the model version for + */ + public void removeOverridenModelVersion(String rmPublisher, String rmPackage) { + overriddenMetaModelVersions.remove(BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage)); + } + + /** + * Get the overriden model version for the given package, if any. + * + * @param rmPublisher the publisher of the package + * @param rmPackage the RM Package to remove the model version for + * @return the overridden model version, or null if no override has been set + */ + public String getOverriddenModelVersion(String rmPublisher, String rmPackage) { + return overriddenMetaModelVersions.get(BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage)); + } + + @Override + public MetaModel getMetaModel(Archetype archetype) throws ModelNotFoundException { + String overriddenVersion = getOverriddenModelVersion( + archetype.getArchetypeId().getRmPublisher(), + archetype.getArchetypeId().getRmPackage() + ); + return getMetaModel(archetype, overriddenVersion == null ? archetype.getRmRelease() : overriddenVersion); + } + + @Override + public MetaModel getMetaModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException { + return delegate.getMetaModel(rmPublisher, rmPackage, rmRelease); + } +} diff --git a/aom/src/main/java/com/nedap/archie/rminfo/SimpleMetaModelProvider.java b/aom/src/main/java/com/nedap/archie/rminfo/SimpleMetaModelProvider.java new file mode 100644 index 000000000..442803619 --- /dev/null +++ b/aom/src/main/java/com/nedap/archie/rminfo/SimpleMetaModelProvider.java @@ -0,0 +1,98 @@ +package com.nedap.archie.rminfo; + +import com.nedap.archie.aom.profile.AomProfile; +import com.nedap.archie.aom.profile.AomProfiles; +import org.openehr.bmm.core.BmmModel; +import org.openehr.bmm.persistence.validation.BmmDefinitions; +import org.openehr.bmm.v2.validation.BmmRepository; +import org.openehr.bmm.v2.validation.BmmValidationResult; + +import java.util.Objects; + +/** + * A simple implementation of the MetaModelProvider interface that retrieves meta models from either a ReferenceModels + * instance or a BmmRepository. It also supports AOM profiles. + */ +public class SimpleMetaModelProvider implements MetaModelProvider { + private final ReferenceModels referenceModels; + private final BmmRepository bmmRepository; + private final AomProfiles aomProfiles; + + /** + * Create a SimpleMetaModelProvider that retrieves meta models from the given ReferenceModels and BmmRepository. + * + * @param referenceModels the ReferenceModels to use for retrieving meta models or null + * @param bmmRepository the BmmRepository to use for retrieving BMM models or null + * @throws IllegalArgumentException if both referenceModels and bmmRepository are null + */ + public SimpleMetaModelProvider(ReferenceModels referenceModels, BmmRepository bmmRepository) { + this(referenceModels, bmmRepository, new AomProfiles()); + } + + /** + * Create a SimpleMetaModelProvider that retrieves meta models from the given ReferenceModels, BmmRepository, and + * AomProfiles. + * + * @param referenceModels the ReferenceModels to use for retrieving meta models or null + * @param bmmRepository the BmmRepository to use for retrieving BMM models or null + * @param aomProfiles the AomProfiles to use for retrieving AOM profiles + * @throws IllegalArgumentException if both referenceModels and bmmRepository are null + */ + public SimpleMetaModelProvider(ReferenceModels referenceModels, BmmRepository bmmRepository, AomProfiles aomProfiles) { + if (referenceModels == null && bmmRepository == null) { + throw new IllegalArgumentException("Either referenceModels or bmmRepository must be provided"); + } + this.referenceModels = referenceModels; + this.bmmRepository = bmmRepository; + this.aomProfiles = Objects.requireNonNull(aomProfiles, "aomProfiles must not be null"); + } + + @Override + public MetaModel getMetaModel(String rmPublisher, String rmPackage, String rmRelease) throws ModelNotFoundException { + ModelInfoLookup modelInfoLookup = null; + BmmModel bmmModel = null; + RMObjectMapperProvider objectMapperProvider = null; + if (referenceModels != null) { + modelInfoLookup = referenceModels.getModel(rmPublisher, rmPackage); + objectMapperProvider = referenceModels.getRmObjectMapperProvider(rmPublisher, rmPackage); + } + if (bmmRepository != null) { + BmmValidationResult validationResult = bmmRepository.getModelByClosure( + BmmDefinitions.publisherQualifiedRmClosureName(rmPublisher, rmPackage) + "_" + rmRelease + ); + bmmModel = validationResult == null ? null : validationResult.getModel(); + } + + AomProfile aomProfile = getAomProfileWithSchemaId(bmmModel); + if (aomProfile == null) { + aomProfile = getAomProfileOnPublisher(rmPublisher); + } + + if (modelInfoLookup == null && bmmModel == null) { + throw new ModelNotFoundException( + String.format("model for %s.%s version %s not found", rmPublisher, rmPackage, rmRelease) + ); + } + return new MetaModel(modelInfoLookup, bmmModel, aomProfile, objectMapperProvider); + } + + private AomProfile getAomProfileWithSchemaId(BmmModel bmmModel) { + if (bmmModel != null) { + for (AomProfile profile : aomProfiles.getProfiles()) { + if (profile.getRmSchemaPattern().stream().anyMatch(pat -> bmmModel.getSchemaId().matches(pat))) { + return profile; + } + } + } + return null; + } + + private AomProfile getAomProfileOnPublisher(String rmPublisher) { + for (AomProfile profile : aomProfiles.getProfiles()) { + if (profile.getProfileName().equalsIgnoreCase(rmPublisher)) { + return profile; + } + } + return null; + } +} diff --git a/referencemodels/build.gradle b/referencemodels/build.gradle index b947bb68b..9fb6868ef 100644 --- a/referencemodels/build.gradle +++ b/referencemodels/build.gradle @@ -5,5 +5,6 @@ dependencies { api project(':odin') api project(':aom') testImplementation project(':openehr-rm') + testImplementation project(':test-rm') testImplementation project(':archie-utils') } \ No newline at end of file diff --git a/referencemodels/src/main/java/org/openehr/referencemodels/BuiltinReferenceModels.java b/referencemodels/src/main/java/org/openehr/referencemodels/BuiltinReferenceModels.java index 2c89cabf6..8f2e4156b 100644 --- a/referencemodels/src/main/java/org/openehr/referencemodels/BuiltinReferenceModels.java +++ b/referencemodels/src/main/java/org/openehr/referencemodels/BuiltinReferenceModels.java @@ -2,10 +2,7 @@ import com.nedap.archie.aom.profile.AomProfile; import com.nedap.archie.aom.profile.AomProfiles; -import com.nedap.archie.rminfo.MetaModels; -import com.nedap.archie.rminfo.ModelInfoLookup; -import com.nedap.archie.rminfo.RMObjectMapperProvider; -import com.nedap.archie.rminfo.ReferenceModels; +import com.nedap.archie.rminfo.*; import org.openehr.bmm.v2.persistence.odin.BmmOdinParser; import org.openehr.bmm.v2.validation.BmmRepository; import org.openehr.bmm.v2.validation.BmmSchemaConverter; @@ -34,6 +31,8 @@ public class BuiltinReferenceModels { private static BmmRepository bmmRepository; + private static MetaModelProvider metaModelProvider; + public static BmmRepository getBmmRepository() { if(bmmRepository != null) { return bmmRepository; @@ -160,11 +159,24 @@ private static void addModelInfoLookupIfExists(ReferenceModels result, String cl } } + /** + * Returns a MetaModelProvider loaded with all BMM models, ModelInfoLookups and AOM profiles that are available. + */ + public static MetaModelProvider getMetaModelProvider() { + if (metaModelProvider != null) { + return metaModelProvider; + } + metaModelProvider = new SimpleMetaModelProvider(getAvailableModelInfoLookups(), getBmmRepository(), getAomProfiles()); + return metaModelProvider; + } + /** * Returns the MetaModels loaded with all BMM, ModelInfoLookup and AOM profiles that are available. * Returns a new MetaModels instance every call! * @return + * @deprecated Use {@link #getMetaModelProvider()} instead. */ + @Deprecated public static MetaModels getMetaModels() { MetaModels metaModels = new MetaModels(getAvailableModelInfoLookups(), getBmmRepository()); for(AomProfile profile:getAomProfiles().getProfiles()) { diff --git a/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java b/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java new file mode 100644 index 000000000..0986eddc3 --- /dev/null +++ b/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java @@ -0,0 +1,47 @@ +package com.nedap.archie.rminfo; + +import com.nedap.archie.aom.Archetype; +import com.nedap.archie.aom.ArchetypeHRID; +import org.junit.Test; +import org.openehr.referencemodels.BuiltinReferenceModels; + +import static org.junit.Assert.assertEquals; + +public class OverridingMetaModelProviderTest { + @Test + public void overrideModelVersion() { + MetaModelProvider metaModelProvider = BuiltinReferenceModels.getMetaModelProvider(); + OverridingMetaModelProvider overridingMetaModelProvider = new OverridingMetaModelProvider(metaModelProvider); + + Archetype archetype = new Archetype(); + archetype.setArchetypeId(new ArchetypeHRID("openEHR-EHR-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.3"); + MetaModel metaModel = overridingMetaModelProvider.getMetaModel(archetype); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.3", metaModel.getBmmModel().getRmRelease()); + + + //now overide the version to 1.0.4, and assert + overridingMetaModelProvider.overrideModelVersion("openEHR", "EHR", "1.0.4"); + + metaModel = overridingMetaModelProvider.getMetaModel(archetype); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.4", metaModel.getBmmModel().getRmRelease()); + + //select a specific RM + metaModel = overridingMetaModelProvider.getMetaModel(archetype, "1.0.2"); + + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.2", metaModel.getBmmModel().getRmRelease()); + + //remove Override + overridingMetaModelProvider.removeOverridenModelVersion("openEHR", "EHR"); + metaModel = overridingMetaModelProvider.getMetaModel(archetype); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.3", metaModel.getBmmModel().getRmRelease()); + } +} diff --git a/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java b/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java new file mode 100644 index 000000000..6816778ee --- /dev/null +++ b/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java @@ -0,0 +1,267 @@ +package com.nedap.archie.rminfo; + +import com.nedap.archie.aom.Archetype; +import com.nedap.archie.aom.ArchetypeHRID; +import com.nedap.archie.aom.profile.AomProfiles; +import com.nedap.archie.openehrtestrm.TestRMInfoLookup; +import org.junit.Test; +import org.openehr.referencemodels.BuiltinReferenceModels; + +import static org.junit.Assert.*; + +public class SimpleMetaModelProviderTest { + + @Test + public void testConstructors() { + IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> new SimpleMetaModelProvider(null, null)); + assertEquals("Either referenceModels or bmmRepository must be provided", ex.getMessage()); + + ex = assertThrows(IllegalArgumentException.class, () -> new SimpleMetaModelProvider(null, null, new AomProfiles())); + assertEquals("Either referenceModels or bmmRepository must be provided", ex.getMessage()); + } + + @Test + public void testGetMetaModel() { + MetaModelProvider metaModelProvider = new SimpleMetaModelProvider( + BuiltinReferenceModels.getAvailableModelInfoLookups(), + BuiltinReferenceModels.getBmmRepository(), + BuiltinReferenceModels.getAomProfiles() + ); + + Archetype archetype = new Archetype(); + archetype.setArchetypeId(new ArchetypeHRID("openEHR-EHR-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.3"); + + MetaModel metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.3", metaModel.getBmmModel().getRmRelease()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.0.4"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.4", metaModel.getBmmModel().getRmRelease()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.99.1"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertNull(metaModel.getBmmModel()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("openEHR-TEST_PKG-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.2"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof TestRMInfoLookup); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("TEST_PKG", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.2", metaModel.getBmmModel().getRmRelease()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNull(metaModel.getOdinInputObjectMapper()); + assertNull(metaModel.getOdinOutputObjectMapper()); + assertNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("other-OTHER-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("0.9.0"); + + ModelNotFoundException ex = assertThrows(ModelNotFoundException.class, () -> metaModelProvider.getMetaModel(archetype)); + assertEquals("model for other.OTHER version 0.9.0 not found", ex.getMessage()); + } + + @Test + public void testGetMetaModelModelInfoLookupOnly() { + MetaModelProvider metaModelProvider = new SimpleMetaModelProvider( + BuiltinReferenceModels.getAvailableModelInfoLookups(), + null, + BuiltinReferenceModels.getAomProfiles() + ); + + Archetype archetype = new Archetype(); + archetype.setArchetypeId(new ArchetypeHRID("openEHR-EHR-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.3"); + + MetaModel metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertNull(metaModel.getBmmModel()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.0.4"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertNull(metaModel.getBmmModel()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.99.1"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertNull(metaModel.getBmmModel()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("openEHR-TEST_PKG-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.2"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof TestRMInfoLookup); + assertNull(metaModel.getBmmModel()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNull(metaModel.getOdinInputObjectMapper()); + assertNull(metaModel.getOdinOutputObjectMapper()); + assertNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("other-OTHER-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("0.9.0"); + + ModelNotFoundException ex = assertThrows(ModelNotFoundException.class, () -> metaModelProvider.getMetaModel(archetype)); + assertEquals("model for other.OTHER version 0.9.0 not found", ex.getMessage()); + } + + @Test + public void testGetMetaModelBmmOnly() { + MetaModelProvider metaModelProvider = new SimpleMetaModelProvider( + null, + BuiltinReferenceModels.getBmmRepository(), + BuiltinReferenceModels.getAomProfiles() + ); + + Archetype archetype = new Archetype(); + archetype.setArchetypeId(new ArchetypeHRID("openEHR-EHR-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.3"); + + MetaModel metaModel = metaModelProvider.getMetaModel(archetype); + assertNull(metaModel.getModelInfoLookup()); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.3", metaModel.getBmmModel().getRmRelease()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNull(metaModel.getOdinInputObjectMapper()); + assertNull(metaModel.getOdinOutputObjectMapper()); + assertNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.0.4"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertNull(metaModel.getModelInfoLookup()); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.4", metaModel.getBmmModel().getRmRelease()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNull(metaModel.getOdinInputObjectMapper()); + assertNull(metaModel.getOdinOutputObjectMapper()); + assertNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.99.1"); + + ModelNotFoundException ex = assertThrows(ModelNotFoundException.class, () -> metaModelProvider.getMetaModel(archetype)); + assertEquals("model for openEHR.EHR version 1.99.1 not found", ex.getMessage()); + + archetype.setArchetypeId(new ArchetypeHRID("openEHR-TEST_PKG-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.2"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertNull(metaModel.getModelInfoLookup()); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("TEST_PKG", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.2", metaModel.getBmmModel().getRmRelease()); + assertEquals("openEHR", metaModel.getAomProfile().getProfileName()); + assertNull(metaModel.getOdinInputObjectMapper()); + assertNull(metaModel.getOdinOutputObjectMapper()); + assertNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("other-OTHER-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("0.9.0"); + + ex = assertThrows(ModelNotFoundException.class, () -> metaModelProvider.getMetaModel(archetype)); + assertEquals("model for other.OTHER version 0.9.0 not found", ex.getMessage()); + } + + + @Test + public void testGetMetaModelNoAomProfiles() { + MetaModelProvider metaModelProvider = new SimpleMetaModelProvider( + BuiltinReferenceModels.getAvailableModelInfoLookups(), + BuiltinReferenceModels.getBmmRepository() + ); + + Archetype archetype = new Archetype(); + archetype.setArchetypeId(new ArchetypeHRID("openEHR-EHR-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.3"); + + MetaModel metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.3", metaModel.getBmmModel().getRmRelease()); + assertNull(metaModel.getAomProfile()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.0.4"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("EHR", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.4", metaModel.getBmmModel().getRmRelease()); + assertNull(metaModel.getAomProfile()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setRmRelease("1.99.1"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof ArchieRMInfoLookup); + assertNull(metaModel.getBmmModel()); + assertNull(metaModel.getAomProfile()); + assertNotNull(metaModel.getOdinInputObjectMapper()); + assertNotNull(metaModel.getOdinOutputObjectMapper()); + assertNotNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("openEHR-TEST_PKG-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("1.0.2"); + + metaModel = metaModelProvider.getMetaModel(archetype); + assertTrue(metaModel.getModelInfoLookup() instanceof TestRMInfoLookup); + assertEquals("openehr", metaModel.getBmmModel().getRmPublisher()); + assertEquals("TEST_PKG", metaModel.getBmmModel().getModelName()); + assertEquals("1.0.2", metaModel.getBmmModel().getRmRelease()); + assertNull(metaModel.getAomProfile()); + assertNull(metaModel.getOdinInputObjectMapper()); + assertNull(metaModel.getOdinOutputObjectMapper()); + assertNull(metaModel.getJsonObjectMapper()); + + archetype.setArchetypeId(new ArchetypeHRID("other-OTHER-CLUSTER.test.v1.0.0")); + archetype.setRmRelease("0.9.0"); + + ModelNotFoundException ex = assertThrows(ModelNotFoundException.class, () -> metaModelProvider.getMetaModel(archetype)); + assertEquals("model for other.OTHER version 0.9.0 not found", ex.getMessage()); + } +} diff --git a/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java b/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java index 3f403f8e5..72b0bbb3b 100644 --- a/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java +++ b/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java @@ -27,6 +27,7 @@ public void bmmRepository() throws Exception { } @Test + @Deprecated public void overrideModelVersion() throws Exception { MetaModels metaModels = BuiltinReferenceModels.getMetaModels(); Archetype archetype = new Archetype(); diff --git a/tools/src/main/java/com/nedap/archie/adl14/ADL14Converter.java b/tools/src/main/java/com/nedap/archie/adl14/ADL14Converter.java index d8c6ab2c6..b22aec7ca 100644 --- a/tools/src/main/java/com/nedap/archie/adl14/ADL14Converter.java +++ b/tools/src/main/java/com/nedap/archie/adl14/ADL14Converter.java @@ -10,6 +10,7 @@ import com.nedap.archie.diff.Differentiator; import com.nedap.archie.flattener.Flattener; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; import java.text.MessageFormat; @@ -20,12 +21,20 @@ public class ADL14Converter { - private final MetaModels metaModels; + private final MetaModelProvider metaModelProvider; private final ADL14ConversionConfiguration conversionConfiguration; private InMemoryFullArchetypeRepository existingRepository; + /** + * @deprecated Use {@link #ADL14Converter(MetaModelProvider, ADL14ConversionConfiguration)} instead. + */ + @Deprecated public ADL14Converter(MetaModels metaModels, ADL14ConversionConfiguration conversionConfiguration) { - this.metaModels = metaModels; + this((MetaModelProvider) metaModels, conversionConfiguration); + } + + public ADL14Converter(MetaModelProvider metaModelProvider, ADL14ConversionConfiguration conversionConfiguration) { + this.metaModelProvider = metaModelProvider; this.conversionConfiguration = conversionConfiguration; } @@ -73,7 +82,7 @@ public ADL2ConversionResultList convert(List archetypes, ADL2Conversi // Process the archetypes ordered by specialization level unprocessed.sort(Comparator.comparingInt(Archetype::specializationDepth)); - Differentiator differentiator = new Differentiator(metaModels); + Differentiator differentiator = new Differentiator(metaModelProvider); for (Archetype archetype : unprocessed) { ADL2ConversionResult result; try { @@ -82,7 +91,7 @@ public ADL2ConversionResultList convert(List archetypes, ADL2Conversi if (parent == null) { throw new RuntimeException(MessageFormat.format("Cannot find parent {0} for archetype {1}", archetype.getParentArchetypeId(), archetype.getArchetypeId())); } - Archetype flatParent = new Flattener(repository, metaModels).flatten(parent); + Archetype flatParent = new Flattener(repository, metaModelProvider).flatten(parent); result = convert(archetype, flatParent, previousConversion); if (result.getArchetype() != null) { if (conversionConfiguration.isApplyDiff()) { @@ -125,16 +134,16 @@ private ADL2ConversionResult convert(Archetype archetype, Archetype flatParent, convertHeader(convertedArchetype); // Correct default multiplicities - new ADL14DefaultMultiplicitiesSetter(metaModels).setDefaults(convertedArchetype); + new ADL14DefaultMultiplicitiesSetter(metaModelProvider).setDefaults(convertedArchetype); // Convert nodeId's ADL2ConversionResult result = new ADL2ConversionResult(convertedArchetype); - ADL14NodeIDConverter adl14NodeIDConverter = new ADL14NodeIDConverter(this.metaModels, convertedArchetype, flatParent, conversionConfiguration, previousLog, result); + ADL14NodeIDConverter adl14NodeIDConverter = new ADL14NodeIDConverter(metaModelProvider, convertedArchetype, flatParent, conversionConfiguration, previousLog, result); ADL2ConversionLog conversionLog = adl14NodeIDConverter.convert(); result.setConversionLog(conversionLog); // Remove structures that are not default in ADL1.4, but are default in ADL2 - new DefaultRmStructureRemover(metaModels, true).removeRMDefaults(convertedArchetype); + new DefaultRmStructureRemover(metaModelProvider, true).removeRMDefaults(convertedArchetype); // Set some values that are not directly in ODIN or ADL ArchetypeParsePostProcessor.fixArchetype(convertedArchetype); diff --git a/tools/src/main/java/com/nedap/archie/adl14/DefaultRmStructureRemover.java b/tools/src/main/java/com/nedap/archie/adl14/DefaultRmStructureRemover.java index e69eb9675..069b3674d 100644 --- a/tools/src/main/java/com/nedap/archie/adl14/DefaultRmStructureRemover.java +++ b/tools/src/main/java/com/nedap/archie/adl14/DefaultRmStructureRemover.java @@ -3,6 +3,8 @@ import com.nedap.archie.adlparser.modelconstraints.BMMConstraintImposer; import com.nedap.archie.aom.*; import com.nedap.archie.base.MultiplicityInterval; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; import java.util.ArrayList; @@ -18,43 +20,63 @@ */ public class DefaultRmStructureRemover { - private final MetaModels metaModels; + private final MetaModelProvider metaModelProvider; private final boolean removeEmptyAttributes; + + private MetaModel metaModel; private BMMConstraintImposer constraintImposer; /** * Construct a DefaultRmStructureRemover that does not remove empty attributes * @param metaModels the metamodels containing metamodel information for the preset archetypes - * Part of the public API, do not remove + * @deprecated Use {@link #DefaultRmStructureRemover(MetaModelProvider)} instead. */ + @Deprecated public DefaultRmStructureRemover(MetaModels metaModels) { this(metaModels, false); } + /** + * Construct a DefaultRmStructureRemover that does not remove empty attributes + * @param metaModelProvider the metamodel provider for the preset archetypes + */ + public DefaultRmStructureRemover(MetaModelProvider metaModelProvider) { + this(metaModelProvider, false); + } + /** * Construct a DefaultRmStructureRemover * * @param metaModels the metamodels containing metamodel information for the preset archetypes * @param removeEmptyAttributes if true, will remove empty attributes. If false, will not + * @deprecated Use {@link #DefaultRmStructureRemover(MetaModelProvider, boolean)} instead. */ + @Deprecated public DefaultRmStructureRemover(MetaModels metaModels, boolean removeEmptyAttributes) { - this.metaModels = metaModels; + this((MetaModelProvider) metaModels, removeEmptyAttributes); + } + + /** + * Construct a DefaultRmStructureRemover + * + * @param metaModelProvider the metamodel provider for the preset archetypes + * @param removeEmptyAttributes if true, will remove empty attributes. If false, will not + */ + public DefaultRmStructureRemover(MetaModelProvider metaModelProvider, boolean removeEmptyAttributes) { + this.metaModelProvider = metaModelProvider; this.removeEmptyAttributes = removeEmptyAttributes; } public void removeRMDefaults(Archetype archetype) { - this.metaModels.selectModel(archetype); - if (metaModels.getSelectedModel() == null) { - throw new IllegalArgumentException("cannot find model for argument, so cannot remove default multiplicity"); - } - this.constraintImposer = new BMMConstraintImposer(metaModels.getSelectedBmmModel()); + metaModel = this.metaModelProvider.selectAndGetMetaModel(archetype); + this.constraintImposer = new BMMConstraintImposer(metaModel.getBmmModel()); removeRMDefaults(archetype.getDefinition()); } private void removeRMDefaults(CObject object) { // Remove occurrences if they are equal to the default occurrences of the object if (object.getOccurrences() != null) { - MultiplicityInterval defaultRMOccurrences = object.getDefaultRMOccurrences(metaModels::referenceModelPropMultiplicity); + MultiplicityInterval defaultRMOccurrences = object.getDefaultRMOccurrences(metaModel::referenceModelPropMultiplicity); if (defaultRMOccurrences.equals(object.getOccurrences())) { object.setOccurrences(null); } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidation.java index b3da270dd..f62e89ba6 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidation.java @@ -2,15 +2,25 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.flattener.FullArchetypeRepository; +import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.rminfo.MetaModels; import java.util.List; +import java.util.Objects; /** * Created by pieter.bos on 31/03/2017. */ public interface ArchetypeValidation { - List validate(MetaModels models, Archetype archetype, Archetype flatParent, FullArchetypeRepository repository, ArchetypeValidationSettings settings); + /** + * @deprecated Use {@link #validate(MetaModel, Archetype, Archetype, FullArchetypeRepository, ArchetypeValidationSettings)} instead. + */ + @Deprecated + default List validate(MetaModels models, Archetype archetype, Archetype flatParent, FullArchetypeRepository repository, ArchetypeValidationSettings settings) { + return validate(Objects.requireNonNull(models.getSelectedModel(), "No MetaModel selected"), archetype, flatParent, repository, settings); + } + + List validate(MetaModel metaModel, Archetype archetype, Archetype flatParent, FullArchetypeRepository repository, ArchetypeValidationSettings settings); } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidationBase.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidationBase.java index 2cf5684a4..b5a098af5 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidationBase.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidationBase.java @@ -3,7 +3,7 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.flattener.ArchetypeRepository; import com.nedap.archie.flattener.FullArchetypeRepository; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.rminfo.ModelInfoLookup; import java.util.ArrayList; @@ -16,19 +16,19 @@ public abstract class ArchetypeValidationBase implements ArchetypeValidation { protected FullArchetypeRepository repository; protected List messages; protected ModelInfoLookup lookup; - protected MetaModels combinedModels; + protected MetaModel metaModel; protected ArchetypeValidationSettings settings; public ArchetypeValidationBase() { } @Override - public List validate(MetaModels models, Archetype archetype, Archetype flatParent, FullArchetypeRepository repository, ArchetypeValidationSettings settings) { + public List validate(MetaModel metaModel, Archetype archetype, Archetype flatParent, FullArchetypeRepository repository, ArchetypeValidationSettings settings) { this.archetype = archetype; this.flatParent = flatParent; this.repository = repository; - this.lookup = models.getSelectedModelInfoLookup(); - this.combinedModels = models; + this.lookup = metaModel.getModelInfoLookup(); + this.metaModel = metaModel; this.settings = settings; messages = new ArrayList<>(); diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java index 1b6dbe460..0336d9321 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java @@ -11,8 +11,7 @@ import com.nedap.archie.flattener.FlattenerConfiguration; import com.nedap.archie.flattener.FullArchetypeRepository; import com.nedap.archie.flattener.OverridingInMemFullArchetypeRepository; -import com.nedap.archie.rminfo.MetaModels; -import com.nedap.archie.rminfo.ReferenceModels; +import com.nedap.archie.rminfo.*; import org.openehr.utils.message.I18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +27,7 @@ public class ArchetypeValidator { private static final Logger logger = LoggerFactory.getLogger(ArchetypeValidator.class); - private MetaModels combinedModels; + private final MetaModelProvider metaModelProvider; private FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forFlattened(); //see comment on why there is a phase 0 @@ -41,11 +40,19 @@ public class ArchetypeValidator { private List validationsPhase3; public ArchetypeValidator(ReferenceModels models) { - this(new MetaModels(models, null)); + this(new SimpleMetaModelProvider(models, null)); } + /** + * @deprecated Use {@link #ArchetypeValidator(MetaModelProvider)} instead. + */ + @Deprecated public ArchetypeValidator(MetaModels models) { - this.combinedModels = models; + this((MetaModelProvider) models); + } + + public ArchetypeValidator(MetaModelProvider metaModelProvider) { + this.metaModelProvider = metaModelProvider; validationsPhase0 = new ArrayList<>(); //defined in spec, but not in three phase validator and not in grammar //eiffel checks these in the parser @@ -120,14 +127,11 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re } repository = extraRepository; - combinedModels.selectModel(archetype); + MetaModel metaModel = metaModelProvider.selectAndGetMetaModel(archetype); - if(combinedModels.getSelectedModelInfoLookup() == null && combinedModels.getSelectedBmmModel() == null) { - throw new UnsupportedOperationException("reference model unknown for archetype " + archetype.getArchetypeId()); - } //we assume we always want a new validation to be run, for example because the archetype //has been updated. Therefore, do not retrieve the old result from the repository - archetype = cloneAndPreprocess(combinedModels, archetype);//this clones the actual archetype so the source does not get changed + archetype = cloneAndPreprocess(metaModel, archetype);//this clones the actual archetype so the source does not get changed Archetype flatParent = null; if(archetype.isSpecialized()) { ValidationResult infiniteLoopResult = checkForInfiniteLoopInSpecialisation(repository, archetype); @@ -135,7 +139,7 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re return infiniteLoopResult; } ValidationResult parentValidationResult = repository.compileAndRetrieveValidationResult(archetype.getParentArchetypeId(), this); - combinedModels.selectModel(archetype); + metaModelProvider.selectAndGetMetaModel(archetype); // For backwards compatibility if(parentValidationResult != null) { if(parentValidationResult.passes()) { flatParent = parentValidationResult.getFlattened(); @@ -171,23 +175,23 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re for(TemplateOverlay overlay:((Template) archetype).getTemplateOverlays()) { //validate the overlays first, but make sure to do that only once (so don't call this same method!) extraRepository.compileAndRetrieveValidationResult(overlay.getArchetypeId().toString(), this); - combinedModels.selectModel(archetype); + metaModelProvider.selectAndGetMetaModel(archetype); // For backwards compatibility } } - List messages = runValidations(archetype, repository, settings, flatParent, validationsPhase0); + List messages = runValidations(metaModel, archetype, repository, settings, flatParent, validationsPhase0); ValidationResult result = new ValidationResult(archetype); result.setErrors(messages); if(result.passes()) { //continue running only if the basic phase 0 validation run, otherwise we get annoying exceptions - messages.addAll(runValidations(archetype, repository, settings, flatParent, validationsPhase1)); + messages.addAll(runValidations(metaModel, archetype, repository, settings, flatParent, validationsPhase1)); //the separate validations will check if the archtype is specialized and if they need this in phase 2 //because the RM validations are technically phase 2 and required to run //also the separate validations are implemented so that they can run with errors in phase 1 without exceptions //plus exceptions will nicely be logged as an OTHER error type - we can safely run it and you will get //more errors in one go - could be useful - messages.addAll(runValidations(archetype, repository, settings, flatParent, validationsPhase2)); + messages.addAll(runValidations(metaModel, archetype, repository, settings, flatParent, validationsPhase2)); } result.setErrors(messages); @@ -203,10 +207,10 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re if(result.passes() || settings.isAlwaysTryToFlatten()) { try { - Archetype flattened = new Flattener(repository, combinedModels, flattenerConfiguration).flatten(archetype); + Archetype flattened = new Flattener(repository, metaModelProvider, flattenerConfiguration).flatten(archetype); try { - OperationalTemplate operationalTemplate = (OperationalTemplate) new Flattener(repository, combinedModels).createOperationalTemplate(true).flatten(archetype); + OperationalTemplate operationalTemplate = (OperationalTemplate) new Flattener(repository, metaModelProvider).createOperationalTemplate(true).flatten(archetype); extraRepository.addExtraOperationalTemplate(operationalTemplate); } catch (Exception e) { //this is probably an error in an included archetype, so ignore it here @@ -217,7 +221,7 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re } result.setFlattened(flattened); if(result.passes()) { - messages.addAll(runValidations(flattened, repository, settings, flatParent, validationsPhase3)); + messages.addAll(runValidations(metaModel, flattened, repository, settings, flatParent, validationsPhase3)); } } catch (Exception e) { messages.add(new ValidationMessage(ErrorType.OTHER, null, "flattening failed with exception " + e)); @@ -229,18 +233,18 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re return result; } - private Archetype cloneAndPreprocess(MetaModels models, Archetype archetype) { + private Archetype cloneAndPreprocess(MetaModel metaModel, Archetype archetype) { Archetype preprocessed = archetype.clone(); - new ReflectionConstraintImposer(models).setSingleOrMultiple(preprocessed.getDefinition()); + new ReflectionConstraintImposer(metaModel).setSingleOrMultiple(preprocessed.getDefinition()); return preprocessed; } - private List runValidations(Archetype archetype, FullArchetypeRepository repository, ArchetypeValidationSettings settings, Archetype flatParent, List validations) { + private List runValidations(MetaModel metaModel, Archetype archetype, FullArchetypeRepository repository, ArchetypeValidationSettings settings, Archetype flatParent, List validations) { List messages = new ArrayList<>(); for(ArchetypeValidation validation: validations) { try { - messages.addAll(validation.validate(combinedModels, archetype, flatParent, repository, settings)); + messages.addAll(validation.validate(metaModel, archetype, flatParent, repository, settings)); } catch (Exception e) { logger.error("error running validation processor", e); e.printStackTrace(); diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AnnotationsValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AnnotationsValidation.java index 122d4a2ad..35bcae8f3 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AnnotationsValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AnnotationsValidation.java @@ -32,7 +32,7 @@ public void validate() { //apparently the operational template creation failed. Try to lookup the path anyway in the original archetype operationalTemplate = archetype; } - if(!AOMUtils.isPathInArchetypeOrRm(combinedModels.getSelectedModel(), path, operationalTemplate)) { + if(!AOMUtils.isPathInArchetypeOrRm(metaModel, path, operationalTemplate)) { addMessage(ErrorType.VRANP, I18n.t("The path {0} referenced in the annotations does not exist in the flat archetype or reference model", path)); } } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java index 5896869ef..bca9cd5ce 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java @@ -25,7 +25,7 @@ protected void validate(CComplexObject cObject) { addMessageWithPath(ErrorType.OTHER, cObject.getPath(), "An attribute tuple must have members"); } else { for(CAttribute cAttribute:tuple.getMembers()) { - if (!combinedModels.attributeExists(cObject.getRmTypeName(), cAttribute.getRmAttributeName())) { + if (!metaModel.attributeExists(cObject.getRmTypeName(), cAttribute.getRmAttributeName())) { addMessageWithPath(ErrorType.VCARM, cObject.getPath(), I18n.t("Tuple member attribute {0} is not an attribute of type {1}", cAttribute.getRmAttributeName(), cObject.getRmTypeName())); } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java index 6e4d8cc7d..35bddbcd5 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java @@ -80,7 +80,7 @@ private void validateTerminologyBindings() { //if not a valid path, fine } if (!AOMUtils.isValidCode(constraintCodeOrPath) && !( - archetypeHasPath || combinedModels.hasReferenceModelPath(archetype.getDefinition().getRmTypeName(), constraintCodeOrPath) + archetypeHasPath || metaModel.hasReferenceModelPath(archetype.getDefinition().getRmTypeName(), constraintCodeOrPath) ) ) { addMessage(ErrorType.VTTBK, I18n.t("Term binding key {0} in path format is not present in archetype", constraintCodeOrPath)); diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/CodeValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/CodeValidation.java index e1bcf560e..da52929ab 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/CodeValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/CodeValidation.java @@ -29,7 +29,7 @@ public void validate(CObject cObject) { addMessageWithPath(ErrorType.VTSD, cObject.path(), I18n.t("The code specialization depth of code {0} is {1}, which is greater than archetype specialization depth {2}", nodeId, codeSpecializationDepth, archetypeSpecializationDepth)); - } else if (cObject.isRoot() || parentIsMultiple(cObject, flatParent, combinedModels)) { + } else if (cObject.isRoot() || parentIsMultiple(cObject, flatParent, metaModel)) { if ((codeSpecializationDepth < archetypeSpecializationDepth && flatParent != null && !flatParent.getTerminology().hasIdCode(nodeId)) || (codeSpecializationDepth == archetypeSpecializationDepth && !archetype.getTerminology().hasIdCode(nodeId))) { addMessageWithPath(ErrorType.VATID, cObject.path(), diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java index c6f0818a2..42a6707e7 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java @@ -58,7 +58,7 @@ protected void validate(CAttribute cAttribute) { addPathNotFoundInParentError(cAttribute); } else { PathSegment terminalNode = pathSegments.get(pathSegments.size() - 1); - if (!combinedModels.attributeExists(parent.getRmTypeName(), terminalNode.getNodeName())) { + if (!metaModel.attributeExists(parent.getRmTypeName(), terminalNode.getNodeName())) { addPathNotFoundInParentError(cAttribute); } } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java index 010a7edbf..e68b15d8b 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java @@ -35,7 +35,7 @@ protected void validate(CComplexObjectProxy cObject) { CComplexObject replacementComplexObject = complexObjectProxyReplacement.getReplacement(); - if(!combinedModels.rmTypesConformant(replacementComplexObject.getRmTypeName(), cObject.getRmTypeName())) { + if(!metaModel.rmTypesConformant(replacementComplexObject.getRmTypeName(), cObject.getRmTypeName())) { addMessageWithPath(ErrorType.VUNT, cObject.path(), I18n.t("Use_node (C_COMPLEX_OBJECT_PROXY) points to type {0}, which does not conform to type {1}", replacementComplexObject.getRmTypeName(), cObject.getRmTypeName())); } } else { @@ -78,7 +78,7 @@ private void validateTerminologyBindings() { //if not a valid path, fine } if(!AOMUtils.isValidCode(constraintCodeOrPath) && !( - archetypeHasPath || combinedModels.hasReferenceModelPath(archetype.getDefinition().getRmTypeName(), constraintCodeOrPath) + archetypeHasPath || metaModel.hasReferenceModelPath(archetype.getDefinition().getRmTypeName(), constraintCodeOrPath) ) ) { addMessage(ErrorType.VTTBK, I18n.t("Term binding key {0} points to a path that cannot be found in the archetype", constraintCodeOrPath)); diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/RmOverlayValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/RmOverlayValidation.java index 5f618e33b..dc119dbe5 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/RmOverlayValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/RmOverlayValidation.java @@ -30,7 +30,7 @@ public void validate() { //apparently the operational template creation failed. Try to lookup the path anyway in the original archetype operationalTemplate = archetype; } - if(!AOMUtils.isPathInArchetypeOrRm(combinedModels.getSelectedModel(), path, operationalTemplate)) { + if(!AOMUtils.isPathInArchetypeOrRm(metaModel, path, operationalTemplate)) { addMessage(ErrorType.VRANP, I18n.t("The path {0} referenced in the rm visibility does not exist in the flat archetype", path)); } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedDefinitionValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedDefinitionValidation.java index e13859cba..0056af95b 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedDefinitionValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedDefinitionValidation.java @@ -139,7 +139,7 @@ private boolean hasAssertions(List assertions) { } private void validateConformsTo(CObject cObject, CObject parentCObject) { - ConformanceCheckResult conformanceCheckResult = cObject.cConformsTo(parentCObject, combinedModels::rmTypesConformant); + ConformanceCheckResult conformanceCheckResult = cObject.cConformsTo(parentCObject, metaModel::rmTypesConformant); if(!conformanceCheckResult.doesConform()) { if(conformanceCheckResult.getErrorType() != null) { @@ -156,7 +156,7 @@ private void validateConformsTo(CObject cObject, CObject parentCObject) { if(cComplexObject.getAttributeTuples() != null && parentCComplexObject.getAttributeTuples() != null) { for(CAttributeTuple tuple:cComplexObject.getAttributeTuples()) { CAttributeTuple matchingTuple = AOMUtils.findMatchingTuple(parentCComplexObject.getAttributeTuples(), tuple); - if(matchingTuple != null && ! tuple.cConformsTo(matchingTuple, combinedModels::rmTypesConformant)) { + if(matchingTuple != null && ! tuple.cConformsTo(matchingTuple, metaModel::rmTypesConformant)) { //tuple does not conform addMessageWithPath(ErrorType.VTPNC, cObject.path(), @@ -187,7 +187,7 @@ private void validateConformsTo(CObject cObject, CObject parentCObject) { private boolean hasConformingParent(CAttribute parentAttribute, CPrimitiveObject member) { for(CObject parentCObject:parentAttribute.getChildren()) { - ConformanceCheckResult result = member.cConformsTo(parentCObject, (a, b) -> combinedModels.rmTypesConformant(a, b)); + ConformanceCheckResult result = member.cConformsTo(parentCObject, (a, b) -> metaModel.rmTypesConformant(a, b)); if(result.doesConform()) { return true; } @@ -257,12 +257,12 @@ private boolean rootMatchesSlotType(ArchetypeSlot slot, CArchetypeRoot root) { String rootRmTypeName = root.getRmTypeName(); String rootReferenceRmTypeName = new ArchetypeHRID(root.getArchetypeRef()).getRmClass(); - if(!combinedModels.typeNameExists(rootRmTypeName) || !combinedModels.typeNameExists(rootReferenceRmTypeName)) { + if(!metaModel.typeNameExists(rootRmTypeName) || !metaModel.typeNameExists(rootReferenceRmTypeName)) { return false; } - else if(!combinedModels.rmTypesConformant(rootRmTypeName, slotRmTypeName)) { + else if(!metaModel.rmTypesConformant(rootRmTypeName, slotRmTypeName)) { return false; - } else if (!combinedModels.rmTypesConformant(rootReferenceRmTypeName, slotRmTypeName)) { + } else if (!metaModel.rmTypesConformant(rootReferenceRmTypeName, slotRmTypeName)) { return false; } return true; diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedOccurrencesValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedOccurrencesValidation.java index edb055089..a74619dfd 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedOccurrencesValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/SpecializedOccurrencesValidation.java @@ -81,8 +81,8 @@ private ConformanceCheckResult childNodesConformToParent(CObject childCObject, C return ConformanceCheckResult.conforms(); } - MultiplicityInterval parentNodeOccurrences = parentCObject.effectiveOccurrences(combinedModels::referenceModelPropMultiplicity); - MultiplicityInterval childNodeOccurrences = childCObject.effectiveOccurrences(combinedModels::referenceModelPropMultiplicity); + MultiplicityInterval parentNodeOccurrences = parentCObject.effectiveOccurrences(metaModel::referenceModelPropMultiplicity); + MultiplicityInterval childNodeOccurrences = childCObject.effectiveOccurrences(metaModel::referenceModelPropMultiplicity); if(parentCObject.getNodeId().equals(childCObject.getNodeId()) && parentNodeOccurrences.equals(childNodeOccurrences)) { //this is the parent node appearing in the flattened child archetype without change in occurrence. That is guaranteed to be valid @@ -97,7 +97,7 @@ private ConformanceCheckResult childNodesConformToParent(CObject childCObject, C if (allRedefinedNodeOccurrencesSummed.isOpen()) { break; } - MultiplicityInterval redefinedOccurrences = childNode.effectiveOccurrences(combinedModels::referenceModelPropMultiplicity); + MultiplicityInterval redefinedOccurrences = childNode.effectiveOccurrences(metaModel::referenceModelPropMultiplicity); if (!allRedefinedNodeOccurrencesSummed.isLowerUnbounded()) { Integer lower = allRedefinedNodeOccurrencesSummed.getLower(); if (!redefinedOccurrences.isLowerUnbounded()) { @@ -119,7 +119,7 @@ private ConformanceCheckResult childNodesConformToParent(CObject childCObject, C } MultiplicityInterval cardinality = childCObject.getParent().getCardinality() == null ? null : childCObject.getParent().getCardinality().getInterval(); if(cardinality == null) { - cardinality = combinedModels.referenceModelPropMultiplicity(childCObject.getParent().getParent().getRmTypeName(), childCObject.getParent().getRmAttributeName()); + cardinality = metaModel.referenceModelPropMultiplicity(childCObject.getParent().getParent().getRmTypeName(), childCObject.getParent().getRmAttributeName()); } if(cardinality != null && !cardinality.isUpperUnbounded() && (allRedefinedNodeOccurrencesSummed.isUpperUnbounded() || allRedefinedNodeOccurrencesSummed.getUpper() > cardinality.getUpper())) { @@ -132,7 +132,7 @@ private ConformanceCheckResult childNodesConformToParent(CObject childCObject, C } return ConformanceCheckResult.fails(ErrorType.VSONCO, I18n.t("Occurrences {0}, which is the sum of {1}, does not conform to {2}", allRedefinedNodeOccurrencesSummed, - allRedefinedNodes.stream().map(c -> c.effectiveOccurrences(combinedModels::referenceModelPropMultiplicity).toString()).collect(Collectors.joining(", ")), + allRedefinedNodes.stream().map(c -> c.effectiveOccurrences(metaModel::referenceModelPropMultiplicity).toString()).collect(Collectors.joining(", ")), parentCObject.getOccurrences())); } } diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java index c53a068b2..205abf1cc 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java @@ -24,7 +24,7 @@ protected void validate(CComplexObject cObject) { } private void validateTypes(CObject cObject) { - if (!combinedModels.typeNameExists(cObject.getRmTypeName())) { + if (!metaModel.typeNameExists(cObject.getRmTypeName())) { addMessageWithPath(ErrorType.VCORM, cObject.getPath(), I18n.t("Type name {0} does not exist", cObject.getRmTypeName())); } else { CAttribute owningAttribute = cObject.getParent(); @@ -36,7 +36,7 @@ private void validateTypes(CObject cObject) { owningObject = differentialPathFromParent == null ? null : differentialPathFromParent.getParent(); } if (owningObject != null) { - if(!combinedModels.typeConformant(owningObject.getRmTypeName(), owningAttribute.getRmAttributeName(), cObject.getRmTypeName())) { + if(!metaModel.typeConformant(owningObject.getRmTypeName(), owningAttribute.getRmAttributeName(), cObject.getRmTypeName())) { addMessageWithPath(ErrorType.VCORMT, cObject.getPath(), I18n.t("Attribute {0}.{1} cannot contain type {2}", owningObject.getRmTypeName(), owningAttribute.getRmAttributeName(), cObject.getRmTypeName())); @@ -58,7 +58,7 @@ protected void validate(CPrimitiveObject cObject) { CAttribute attribute = cObject.getParent(); if(attribute.getDifferentialPath() == null) { CObject parentConstraint = attribute.getParent(); - if(!combinedModels.validatePrimitiveType(parentConstraint.getRmTypeName(), attribute.getRmAttributeName(), cObject)) { + if(!metaModel.validatePrimitiveType(parentConstraint.getRmTypeName(), attribute.getRmAttributeName(), cObject)) { addMessageWithPath(ErrorType.VCORMT, cObject.path(), I18n.t("Attribute {0}.{1} cannot be constrained by a {2}", parentConstraint.getRmTypeName(), attribute.getRmAttributeName(), cObject == null ? null : cObject.getClass().getSimpleName())); @@ -71,7 +71,7 @@ protected void validate(CPrimitiveObject cObject) { if(differentialPathFromParent instanceof CAttribute) { CAttribute parentAttribute = (CAttribute) differentialPathFromParent; CObject parentConstraint = parentAttribute.getParent(); - if(!combinedModels.validatePrimitiveType(parentConstraint.getRmTypeName(), parentAttribute.getRmAttributeName(), cObject)) { + if(!metaModel.validatePrimitiveType(parentConstraint.getRmTypeName(), parentAttribute.getRmAttributeName(), cObject)) { I18n.t("Attribute {0}.{1} cannot be constrained by a {2}", parentConstraint.getRmTypeName(), parentAttribute.getRmAttributeName(), cObject == null ? null : cObject.getClass().getSimpleName()); } @@ -94,11 +94,11 @@ public void validate(CAttribute cAttribute) { owningObject = differentialPathFromParent == null ? null : differentialPathFromParent.getParent(); } if(owningObject != null) { - if (!combinedModels.attributeExists(owningObject.getRmTypeName(), cAttribute.getRmAttributeName())) { + if (!metaModel.attributeExists(owningObject.getRmTypeName(), cAttribute.getRmAttributeName())) { addMessageWithPath(ErrorType.VCARM, cAttribute.getPath(), I18n.t("{0} is not a known attribute of {1}", cAttribute.getRmAttributeName(), owningObject.getRmTypeName())); } else { - CAttribute defaultAttribute = new ReflectionConstraintImposer(combinedModels).getDefaultAttribute(owningObject.getRmTypeName(), cAttribute.getRmAttributeName()); + CAttribute defaultAttribute = new ReflectionConstraintImposer(metaModel).getDefaultAttribute(owningObject.getRmTypeName(), cAttribute.getRmAttributeName()); if(defaultAttribute != null) { if(cAttribute.getExistence() != null) { if(!defaultAttribute.getExistence().contains(cAttribute.getExistence())) { diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java index 3d4935d7b..aa185bc0e 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java @@ -53,12 +53,12 @@ protected void validate(CComplexObject cComplexObject) { String archetypeRootTypeName = cComplexObject.getRmTypeName(); String archetypeReferenceTypeName = hrId.getRmClass(); - if (combinedModels.typeNameExists(archetypeRootTypeName)) { + if (metaModel.typeNameExists(archetypeRootTypeName)) { //if parent type info not found will be checked later in phase 2 - if (!combinedModels.typeNameExists(archetypeReferenceTypeName)) { + if (!metaModel.typeNameExists(archetypeReferenceTypeName)) { addMessageWithPath(ErrorType.VCORM, cComplexObject.getPath(), I18n.t("Archetype referenced in use_archetype points to class {0}, which does not exist in this reference model", cComplexObject.getRmTypeName())); - } else if (!combinedModels.rmTypesConformant(archetypeReferenceTypeName, archetypeRootTypeName)) { + } else if (!metaModel.rmTypesConformant(archetypeReferenceTypeName, archetypeRootTypeName)) { addMessageWithPath(ErrorType.VARXTV, cComplexObject.getPath(), I18n.t("Use_archetype points to type {0}, which is not conformant for type {1} of the archetype root used", cComplexObject.getRmTypeName(), archetypeRootTypeName)); diff --git a/tools/src/main/java/com/nedap/archie/creation/ExampleJsonInstanceGenerator.java b/tools/src/main/java/com/nedap/archie/creation/ExampleJsonInstanceGenerator.java index d8347502f..ee302ad85 100644 --- a/tools/src/main/java/com/nedap/archie/creation/ExampleJsonInstanceGenerator.java +++ b/tools/src/main/java/com/nedap/archie/creation/ExampleJsonInstanceGenerator.java @@ -10,6 +10,8 @@ import com.nedap.archie.aom.terminology.ValueSet; import com.nedap.archie.base.Interval; import com.nedap.archie.base.MultiplicityInterval; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; import org.openehr.bmm.core.*; import org.openehr.bmm.persistence.validation.BmmDefinitions; @@ -36,9 +38,10 @@ public class ExampleJsonInstanceGenerator { public static final String MISSING_TERM_IN_ARCHETYPE_FOR_LANGUAGE = "missing term in archetype for language "; private final String language; - private final MetaModels models; + private final MetaModelProvider metaModelProvider; private OperationalTemplate archetype; private String rmRelease; + private MetaModel metaModel; private BmmModel bmm; private AomProfile aomProfile; @@ -49,9 +52,17 @@ public class ExampleJsonInstanceGenerator { OpenEhrRmInstanceGenerator openEhrRmInstanceGenerator; + /** + * @deprecated Use {@link #ExampleJsonInstanceGenerator(MetaModelProvider, String)} instead. + */ + @Deprecated public ExampleJsonInstanceGenerator(MetaModels models, String language) { + this((MetaModelProvider) models, language); + } + + public ExampleJsonInstanceGenerator(MetaModelProvider metaModelProvider, String language) { this.language = language; - this.models = models; + this.metaModelProvider = metaModelProvider; openEhrRmInstanceGenerator = new OpenEhrRmInstanceGenerator(this, typePropertyName); } @@ -63,9 +74,9 @@ public Map generate(OperationalTemplate archetype) { !(rmRelease.equalsIgnoreCase("1.0.4") || rmRelease.equalsIgnoreCase("1.1.0"))) { rmRelease = "1.1.0"; } - models.selectModel(archetype, rmRelease); - aomProfile = models.getSelectedAomProfile(); - bmm = models.getSelectedBmmModel(); + metaModel = metaModelProvider.selectAndGetMetaModel(archetype, rmRelease); + aomProfile = metaModel.getAomProfile(); + bmm = metaModel.getBmmModel(); return generate(archetype.getDefinition()); } @@ -129,7 +140,7 @@ private Map generate(CComplexObject cObject) { List children = new ArrayList<>(); for (CObject child : attribute.getChildren()) { - MultiplicityInterval multiplicityInterval = child.effectiveOccurrences(models.getSelectedModel()::referenceModelPropMultiplicity); + MultiplicityInterval multiplicityInterval = child.effectiveOccurrences(metaModel::referenceModelPropMultiplicity); int occurrences = Math.max(1, multiplicityInterval.getLower()); if(multiplicityInterval.isProhibited()) { occurrences = 0; diff --git a/tools/src/main/java/com/nedap/archie/diff/Differentiator.java b/tools/src/main/java/com/nedap/archie/diff/Differentiator.java index 1c382ba77..51337baeb 100644 --- a/tools/src/main/java/com/nedap/archie/diff/Differentiator.java +++ b/tools/src/main/java/com/nedap/archie/diff/Differentiator.java @@ -5,34 +5,43 @@ import com.nedap.archie.adlparser.modelconstraints.ModelConstraintImposer; import com.nedap.archie.adlparser.modelconstraints.ReflectionConstraintImposer; import com.nedap.archie.aom.Archetype; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; public class Differentiator { - private final MetaModels metaModels; + private final MetaModelProvider metaModelProvider; + /** + * @deprecated Use {@link #Differentiator(MetaModelProvider)} instead. + */ + @Deprecated public Differentiator(MetaModels metaModels) { - this.metaModels = metaModels; + this((MetaModelProvider) metaModels); } + public Differentiator(MetaModelProvider metaModelProvider) { + this.metaModelProvider = metaModelProvider; + } public Archetype differentiate(Archetype flatChild, Archetype flatParent) { return differentiate(flatChild, flatParent, true); } public Archetype differentiate(Archetype flatChild, Archetype flatParent, boolean addSiblingOrder) { - metaModels.selectModel(flatChild); + MetaModel metaModel = metaModelProvider.selectAndGetMetaModel(flatChild); ModelConstraintImposer constraintImposer; - if(metaModels.getSelectedBmmModel() != null) { - constraintImposer = new BMMConstraintImposer(metaModels.getSelectedBmmModel()); + if(metaModel.getBmmModel() != null) { + constraintImposer = new BMMConstraintImposer(metaModel.getBmmModel()); } else { - constraintImposer = new ReflectionConstraintImposer(metaModels.getSelectedModelInfoLookup()); + constraintImposer = new ReflectionConstraintImposer(metaModel.getModelInfoLookup()); } Archetype result = flatChild.clone(); UnconstrainedIntervalRemover.removeUnconstrainedIntervals(result); if(addSiblingOrder) { - new LCSOrderingDiff(metaModels).addSiblingOrder(result, flatChild, flatParent); + new LCSOrderingDiff(metaModel).addSiblingOrder(result, flatChild, flatParent); } new ConstraintDifferentiator(constraintImposer, flatParent).removeUnspecializedConstraints(result, flatParent); new AnnotationDifferentiator().differentiate(result, flatParent); @@ -40,7 +49,7 @@ public Archetype differentiate(Archetype flatChild, Archetype flatParent, boolea new DifferentialPathGenerator().replace(result); new TerminologyDifferentiator().differentiate(result); - new DefaultRmStructureRemover(metaModels, false).removeRMDefaults(result); + new DefaultRmStructureRemover(metaModelProvider, false).removeRMDefaults(result); result.setDifferential(true); return result; diff --git a/tools/src/main/java/com/nedap/archie/diff/LCSOrderingDiff.java b/tools/src/main/java/com/nedap/archie/diff/LCSOrderingDiff.java index da4d597db..a3984092e 100644 --- a/tools/src/main/java/com/nedap/archie/diff/LCSOrderingDiff.java +++ b/tools/src/main/java/com/nedap/archie/diff/LCSOrderingDiff.java @@ -3,7 +3,7 @@ import com.nedap.archie.aom.*; import com.nedap.archie.aom.utils.AOMUtils; import com.nedap.archie.aom.utils.CodeRedefinitionStatus; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModel; import java.util.LinkedHashMap; import java.util.List; @@ -18,10 +18,10 @@ */ public class LCSOrderingDiff { - private final MetaModels metaModels; + private final MetaModel metaModel; - LCSOrderingDiff(MetaModels metaModels) { - this.metaModels = metaModels; + LCSOrderingDiff(MetaModel metaModel) { + this.metaModel = metaModel; } public void addSiblingOrder(Archetype result, Archetype flatChild, Archetype flatParent) { @@ -68,11 +68,11 @@ public void addSiblingOrder(CComplexObject result, CComplexObject flatChild, CCo //descend into children first addSiblingOrder(resultAttribute, flatChildAttribute, parentAttribute); - if(!metaModels.isMultiple(parentAttribute.getParent().getRmTypeName(), parentAttribute.getRmAttributeName())){ + if(!metaModel.isMultiple(parentAttribute.getParent().getRmTypeName(), parentAttribute.getRmAttributeName())){ continue; } - if(!metaModels.isOrdered(parentAttribute.getParent().getRmTypeName(), parentAttribute.getRmAttributeName())){ + if(!metaModel.isOrdered(parentAttribute.getParent().getRmTypeName(), parentAttribute.getRmAttributeName())){ continue; } diff --git a/tools/src/main/java/com/nedap/archie/flattener/CAttributeFlattener.java b/tools/src/main/java/com/nedap/archie/flattener/CAttributeFlattener.java index 916867d54..c37c6c4e4 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/CAttributeFlattener.java +++ b/tools/src/main/java/com/nedap/archie/flattener/CAttributeFlattener.java @@ -315,7 +315,7 @@ private boolean shouldRemoveParent(CObject specializedChildCObject, CObject matc private boolean shouldReplaceSpecializedParent(CObject parent, List differentialNodes) { - MultiplicityInterval occurrences = parent.effectiveOccurrences(flattener.getMetaModels()::referenceModelPropMultiplicity); + MultiplicityInterval occurrences = parent.effectiveOccurrences(flattener.getMetaModel()::referenceModelPropMultiplicity); //isSingle/isMultiple is tricky and not doable just in the parser. Don't use those if(isSingle(parent.getParent())) { return true; @@ -332,9 +332,9 @@ private boolean shouldReplaceSpecializedParent(CObject parent, List dif //in the rm, data maps to an ITEM_STRUCTURE that does not have the attribute items. //in the parent archetype, that is then an ITEM_TREE. We need to use ITEM_TREE here, which is what this code accomplishes. if(parent.getParent() == null || parent.getParent().getParent() == null) { - effectiveOccurrences = differentialNodes.get(0).effectiveOccurrences(flattener.getMetaModels()::referenceModelPropMultiplicity); + effectiveOccurrences = differentialNodes.get(0).effectiveOccurrences(flattener.getMetaModel()::referenceModelPropMultiplicity); } else { - effectiveOccurrences = differentialNodes.get(0).effectiveOccurrences((s, s2) -> flattener.getMetaModels().referenceModelPropMultiplicity( + effectiveOccurrences = differentialNodes.get(0).effectiveOccurrences((s, s2) -> flattener.getMetaModel().referenceModelPropMultiplicity( parent.getParent().getParent().getRmTypeName(), parent.getParent().getRmAttributeName())); } if(effectiveOccurrences != null && effectiveOccurrences.upperIsOne()) { @@ -347,7 +347,7 @@ private boolean shouldReplaceSpecializedParent(CObject parent, List dif private boolean isSingle(CAttribute attribute) { if(attribute != null && attribute.getParent() != null && attribute.getDifferentialPath() == null) { - return !flattener.getMetaModels().isMultiple(attribute.getParent().getRmTypeName(), attribute.getRmAttributeName()); + return !flattener.getMetaModel().isMultiple(attribute.getParent().getRmTypeName(), attribute.getRmAttributeName()); } return false; } diff --git a/tools/src/main/java/com/nedap/archie/flattener/Flattener.java b/tools/src/main/java/com/nedap/archie/flattener/Flattener.java index 8f57246d0..7b56e59f3 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/Flattener.java +++ b/tools/src/main/java/com/nedap/archie/flattener/Flattener.java @@ -3,9 +3,7 @@ import com.nedap.archie.adlparser.modelconstraints.ReflectionConstraintImposer; import com.nedap.archie.aom.*; import com.nedap.archie.aom.utils.ArchetypeParsePostProcessor; -import com.nedap.archie.rminfo.MetaModels; -import com.nedap.archie.rminfo.ReferenceModels; -import org.openehr.bmm.v2.validation.BmmRepository; +import com.nedap.archie.rminfo.*; import java.util.ArrayList; import java.util.Collections; @@ -22,10 +20,12 @@ */ public class Flattener implements IAttributeFlattenerSupport { - private final MetaModels metaModels; + private final MetaModelProvider metaModelProvider; //to be able to store Template Overlays transparently during flattening private OverridingArchetypeRepository repository; + private MetaModel metaModel; + private Archetype parent; private Archetype child; @@ -43,20 +43,32 @@ public class Flattener implements IAttributeFlattenerSupport { public Flattener(ArchetypeRepository repository, ReferenceModels models) { - this.repository = new OverridingArchetypeRepository(repository); - this.metaModels = new MetaModels(models, (BmmRepository) null); - config = FlattenerConfiguration.forFlattened(); + this(repository, new SimpleMetaModelProvider(models, null)); } + /** + * @deprecated Use {@link #Flattener(ArchetypeRepository, MetaModelProvider)} instead. + */ + @Deprecated public Flattener(ArchetypeRepository repository, MetaModels models) { - this.repository = new OverridingArchetypeRepository(repository); - this.metaModels = models; - config = FlattenerConfiguration.forFlattened(); + this(repository, (MetaModelProvider) models); + } + + public Flattener(ArchetypeRepository repository, MetaModelProvider metaModelProvider) { + this(repository, metaModelProvider, FlattenerConfiguration.forFlattened()); } + /** + * @deprecated Use {@link #Flattener(ArchetypeRepository, MetaModelProvider, FlattenerConfiguration)} instead. + */ + @Deprecated public Flattener(ArchetypeRepository repository, MetaModels models, FlattenerConfiguration configuration) { + this(repository, (MetaModelProvider) models, configuration); + } + + public Flattener(ArchetypeRepository repository, MetaModelProvider metaModelProvider, FlattenerConfiguration configuration) { this.repository = new OverridingArchetypeRepository(repository); - this.metaModels = models; + this.metaModelProvider = metaModelProvider; this.config = configuration.clone(); } @@ -106,7 +118,7 @@ public Archetype flatten(Archetype toFlatten) { throw new IllegalStateException("You've used this flattener before - single use instance, please create a new one!"); } - metaModels.selectModel(toFlatten); + metaModel = metaModelProvider.selectAndGetMetaModel(toFlatten); //validate that we can legally flatten first String parentId = toFlatten.getParentArchetypeId(); @@ -234,7 +246,7 @@ public Archetype flatten(Archetype toFlatten) { ArchetypeParsePostProcessor.fixArchetype(result); //set the single/multiple attributes correctly - new ReflectionConstraintImposer(metaModels.getSelectedModel()) + new ReflectionConstraintImposer(metaModel) .setSingleOrMultiple(result.getDefinition()); return result; @@ -415,7 +427,7 @@ private void flattenCComplexObject(CComplexObject newObject, CComplexObject spec * @return */ protected Flattener getNewFlattenerForParent() { - Flattener result = new Flattener(repository, metaModels, config) + Flattener result = new Flattener(repository, metaModelProvider, config) .createOperationalTemplate(false); //do not create operational template except at the end. if(config.isRemoveZeroOccurrencesInParents()) { //remove all zero occurrences objects EXCEPT in the top level archetype @@ -433,7 +445,7 @@ protected Flattener getNewFlattenerForParent() { * @return */ protected Flattener getNewFlattener() { - return new Flattener(repository, metaModels, config); + return new Flattener(repository, metaModelProvider, config); } private Flattener useComplexObjectForArchetypeSlotReplacement(boolean useComplexObjectForArchetypeSlotReplacement) { @@ -446,8 +458,18 @@ public boolean isUseComplexObjectForArchetypeSlotReplacement() { } @Override + public MetaModel getMetaModel() { + return metaModel; + } + + @Override + @Deprecated public MetaModels getMetaModels() { - return metaModels; + if(metaModelProvider instanceof MetaModels) { + return (MetaModels) metaModelProvider; + } else { + throw new IllegalStateException("MetaModels not available"); + } } @Override diff --git a/tools/src/main/java/com/nedap/archie/flattener/FullArchetypeRepository.java b/tools/src/main/java/com/nedap/archie/flattener/FullArchetypeRepository.java index 70c020d81..09b8da517 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/FullArchetypeRepository.java +++ b/tools/src/main/java/com/nedap/archie/flattener/FullArchetypeRepository.java @@ -5,6 +5,7 @@ import com.nedap.archie.archetypevalidator.ArchetypeValidationSettings; import com.nedap.archie.archetypevalidator.ArchetypeValidator; import com.nedap.archie.archetypevalidator.ValidationResult; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; import com.nedap.archie.rminfo.ReferenceModels; @@ -40,18 +41,26 @@ default void compile(ReferenceModels models) { compile(validator); } + /** + * @deprecated Use {@link #compile(MetaModelProvider)} instead. + */ + @Deprecated default void compile(MetaModels models) { - ArchetypeValidator validator = new ArchetypeValidator(models); + compile((MetaModelProvider) models); + } + + default void compile(MetaModelProvider metaModelProvider) { + ArchetypeValidator validator = new ArchetypeValidator(metaModelProvider); compile(validator); } /** * validate the validation result if necessary, and return either the newly validated one or * the existing validation result - * @param models + * @param metaModelProvider * @return */ - default ValidationResult compileAndRetrieveValidationResult(String archetypeId, MetaModels models) { + default ValidationResult compileAndRetrieveValidationResult(String archetypeId, MetaModelProvider metaModelProvider) { Archetype archetype = getArchetype(archetypeId); if(archetype == null) { return null; @@ -63,10 +72,21 @@ default ValidationResult compileAndRetrieveValidationResult(String archetypeId, return validationResult; } - ArchetypeValidator validator = new ArchetypeValidator(models); + ArchetypeValidator validator = new ArchetypeValidator(metaModelProvider); return validator.validate(archetype, this); } + /** + * validate the validation result if necessary, and return either the newly validated one or + * the existing validation result + * @param models + * @return + */ + @Deprecated + default ValidationResult compileAndRetrieveValidationResult(String archetypeId, MetaModels models) { + return compileAndRetrieveValidationResult(archetypeId, (MetaModelProvider) models); + } + /** * validate the validation result if necessary, and return either the newly validated one or * the existing validation result diff --git a/tools/src/main/java/com/nedap/archie/flattener/IAttributeFlattenerSupport.java b/tools/src/main/java/com/nedap/archie/flattener/IAttributeFlattenerSupport.java index d9b6db9f0..1c6219649 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/IAttributeFlattenerSupport.java +++ b/tools/src/main/java/com/nedap/archie/flattener/IAttributeFlattenerSupport.java @@ -2,12 +2,20 @@ import com.nedap.archie.aom.CAttribute; import com.nedap.archie.aom.CObject; +import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.rminfo.MetaModels; public interface IAttributeFlattenerSupport { CObject createSpecializeCObject(CAttribute attribute, CObject parent, CObject specialized); + + /** + * @deprecated Use {@link #getMetaModel()} instead. + */ + @Deprecated public MetaModels getMetaModels(); + public MetaModel getMetaModel(); + public FlattenerConfiguration getConfig(); } diff --git a/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java b/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java index 92d053cd3..76e292152 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java +++ b/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java @@ -99,7 +99,7 @@ public void fillEmptyOccurrences(Archetype archetype) { CObject object = workList.pop(); if( (object instanceof CComplexObject || object instanceof ArchetypeSlot || object instanceof CComplexObjectProxy) && object.getOccurrences() == null) { - object.setOccurrences(object.effectiveOccurrences(flattener.getMetaModels()::referenceModelPropMultiplicity)); + object.setOccurrences(object.effectiveOccurrences(flattener.getMetaModel()::referenceModelPropMultiplicity)); } for (CAttribute attribute : object.getAttributes()) { diff --git a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonExampleInstanceGenerator.java b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonExampleInstanceGenerator.java index 0fd9e231e..ed090d616 100644 --- a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonExampleInstanceGenerator.java +++ b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonExampleInstanceGenerator.java @@ -5,6 +5,8 @@ import com.nedap.archie.aom.OperationalTemplate; import com.nedap.archie.base.OpenEHRBase; import com.nedap.archie.creation.ExampleJsonInstanceGenerator; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.MetaModels; import java.util.Map; @@ -21,26 +23,40 @@ public class FlatJsonExampleInstanceGenerator { * @return a flat json as generated by the FlatJsonGenerator, to be serialized with an objectmapper * @throws JsonProcessingException in case the ExampleJsonInstanceGenerator generates json that the objectmapper cannot process * @throws DuplicateKeyException in case the FlatJsonGenerator generates incorrect data for this OperationalTemplate + * @deprecated Use {@link #generateExample(OperationalTemplate, MetaModelProvider, String, FlatJsonFormatConfiguration)} instead. */ + @Deprecated public Map generateExample(OperationalTemplate template, MetaModels metaModels, String language, FlatJsonFormatConfiguration jsonFormatConfiguration) throws JsonProcessingException, DuplicateKeyException { - metaModels.selectModel(template); - if(metaModels.getSelectedModel() == null) { - throw new IllegalArgumentException("Cannot find MetaModel for archetype"); - } - if(metaModels.getSelectedModelInfoLookup() == null) { + return generateExample(template, (MetaModelProvider) metaModels, language, jsonFormatConfiguration); + } + + /** + * Generate a flat JSON example instance for the given OperationalTemplate. + * + * @param template the template for which to generate the example + * @param metaModelProvider the metamodels to use. Must contain an actual RM ModelInfoLookup and a JSON Object Mapper + * @param language the language to generate the example in + * @param jsonFormatConfiguration the configuratin of the flat format + * @return a flat json as generated by the FlatJsonGenerator, to be serialized with an objectmapper + * @throws JsonProcessingException in case the ExampleJsonInstanceGenerator generates json that the objectmapper cannot process + * @throws DuplicateKeyException in case the FlatJsonGenerator generates incorrect data for this OperationalTemplate + */ + public Map generateExample(OperationalTemplate template, MetaModelProvider metaModelProvider, String language, FlatJsonFormatConfiguration jsonFormatConfiguration) throws JsonProcessingException, DuplicateKeyException { + MetaModel metaModel = metaModelProvider.selectAndGetMetaModel(template); + if(metaModel.getModelInfoLookup() == null) { throw new IllegalArgumentException("Cannot find ModelInfoLookup for archetype"); } - if(metaModels.getSelectedModel().getJsonObjectMapper() == null) { + if(metaModel.getJsonObjectMapper() == null) { throw new IllegalArgumentException("Cannot find JSON Object mapper in selected metamodel"); } - ExampleJsonInstanceGenerator exampleJsonInstanceGenerator = new ExampleJsonInstanceGenerator(metaModels, language); + ExampleJsonInstanceGenerator exampleJsonInstanceGenerator = new ExampleJsonInstanceGenerator(metaModelProvider, language); exampleJsonInstanceGenerator.setTypePropertyName("_type"); Map generatedExample = exampleJsonInstanceGenerator.generate(template); - ObjectMapper objectMapper = metaModels.getSelectedModel().getJsonObjectMapper(); + ObjectMapper objectMapper = metaModel.getJsonObjectMapper(); String jsonRmObject = objectMapper.writeValueAsString(generatedExample); OpenEHRBase openEHRBase = objectMapper.readValue(jsonRmObject, OpenEHRBase.class); - return new FlatJsonGenerator(metaModels.getSelectedModelInfoLookup(), jsonFormatConfiguration).buildPathsAndValues(openEHRBase, template, "en"); + return new FlatJsonGenerator(metaModel.getModelInfoLookup(), jsonFormatConfiguration).buildPathsAndValues(openEHRBase, template, "en"); } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java index 3d85afb28..908cfb46d 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java @@ -19,10 +19,10 @@ public class ADL14DefaultOccurrencesConversionTest { @Test public void testDefaultOccurrencesConversion() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property try (InputStream stream = getClass().getResourceAsStream("/adl14/entry/evaluation/openEHR-EHR-EVALUATION.goal.v1.adl")) { - ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); Archetype parsed = parser.parse(stream, conversionConfiguration); ADL2ConversionResultList result = converter.convert(Lists.newArrayList(parsed)); System.out.println(ADLArchetypeSerializer.serialize(result.getConversionResults().get(0).getArchetype())); diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java index 13ebcb689..4afdae905 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java @@ -22,11 +22,11 @@ public class ADL14ExternalTerminologyConversionTest { @Test public void terminologyBindingsConverted() throws IOException, ADLParseException { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property try(InputStream stream = getClass().getResourceAsStream("/adl14/openEHR-EHR-CLUSTER.value_binding.v1.0.0.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); Archetype converted = result.getConversionResults().get(0).getArchetype(); CTerminologyCode termCodeConstraint = converted.itemAtPath("/items/value/property[1]"); String atCode = termCodeConstraint.getConstraint().get(0); @@ -43,10 +43,10 @@ public void terminologyBindingsConverted() throws IOException, ADLParseException @Test public void twoTermbindingsInOneConstraint() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.termbinding.v1.adl")) { - ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); ADL2ConversionResultList result = converter.convert( Lists.newArrayList(parser.parse(stream, conversionConfiguration))); assertFalse(parser.getErrors().hasErrors()); diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java index 3a9ac0951..b4a29b73b 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java @@ -19,11 +19,11 @@ public class ADL14InternalTerminologyTest { @Test public void internalTerminologyRemoved() throws IOException, ADLParseException { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); try(InputStream stream = getClass().getResourceAsStream("/adl14/openEHR-EHR-OBSERVATION.internal_terminology_test.v0.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); Archetype converted = result.getConversionResults().get(0).getArchetype(); // A terminology code is unnecessary if: // - The text.length < 19 diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java index 99cf29b0d..9dc1ee02d 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java @@ -16,10 +16,10 @@ public class ADL14TerminologyConversionTest { @Test public void twoTermbindingsInOneConstraint() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.termbinding.v1.adl")) { - ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); ADL2ConversionResultList result = converter.convert( Lists.newArrayList(parser.parse(stream, conversionConfiguration))); Archetype converted = result.getConversionResults().get(0).getArchetype(); diff --git a/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java index beecbad18..2f7dd51c0 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java @@ -20,12 +20,12 @@ public class ArchetypeSlotConversionTest { @Test public void testSlotConversion() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); ADL2ConversionRunLog log = null; try(InputStream stream = getClass().getResourceAsStream("/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.respiration.v1.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); Archetype archetype = result.getConversionResults().get(0).getArchetype(); ArchetypeSlot slot = archetype.itemAtPath("/data/events[1]/state[id23]/items[id56]"); String includesPattern = getPattern(slot.getIncludes().get(0)); diff --git a/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java index df7d572db..6d1b81612 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java @@ -18,11 +18,11 @@ public class AssumedValueConversionTest { @Test public void testAssumedValueConversion() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); Archetype adl14archetype; try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.height.v2.adl")) { - adl14archetype = new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration); + adl14archetype = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration); } ADL2ConversionResultList result = converter.convert( @@ -35,7 +35,7 @@ public void testAssumedValueConversion() throws Exception { assertNull(cTerminologyCode.getAssumedValue().getTerminologyId()); assertEquals("at17", cTerminologyCode.getAssumedValue().getCodeString()); - ValidationResult validationResult = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()).validate(archetype); + ValidationResult validationResult = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(archetype); assertTrue(validationResult.toString(), validationResult.passes()); } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java b/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java index a2144d322..913ba6e26 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java @@ -15,17 +15,17 @@ public class ConversionConfigurationTest { public void testRmRelease() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); try(InputStream stream = getClass().getResourceAsStream("openehr-EHR-COMPOSITION.review.v1.adl")) { - Archetype adl14 = new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration); + Archetype adl14 = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration); ADL2ConversionResultList result = converter.convert(Lists.newArrayList(adl14)); assertEquals("1.1.0", result.getConversionResults().get(0).getArchetype().getRmRelease()); conversionConfiguration.setRmRelease("1.0.4"); - converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); result = converter.convert(Lists.newArrayList(adl14)); assertEquals("1.0.4", result.getConversionResults().get(0).getArchetype().getRmRelease()); diff --git a/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java index e58ad4e4c..4dbc714a1 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java @@ -18,11 +18,11 @@ public class DvScaleConversionTest { public void testDvScale() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.ordinalandscale.v0.adl")) { - ADL14Parser adl14Parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); + ADL14Parser adl14Parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); Archetype adl14 = adl14Parser.parse(stream, conversionConfiguration); assertFalse(adl14Parser.getErrors().hasErrors()); ADL2ConversionResultList result = converter.convert(Lists.newArrayList(adl14)); diff --git a/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java b/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java index c407cf774..5d6ba295f 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java @@ -54,14 +54,14 @@ public void parseUrn() { @Test public void testRiskFamilyhistory() throws Exception { - ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); Archetype riskParent = parser.parse(getClass().getResourceAsStream("/adl14/risk_parent.adl"), conversionConfiguration); Archetype riskFamilyHistory = parser.parse(getClass().getResourceAsStream("/adl14/risk_history.adl"), conversionConfiguration); List archetypes = Arrays.asList(riskParent, riskFamilyHistory); - ADL2ConversionResultList converted = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration) + ADL2ConversionResultList converted = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration) .convert(archetypes); for(ADL2ConversionResult conversionResult:converted.getConversionResults()) { @@ -81,7 +81,7 @@ public void testRiskFamilyhistory() throws Exception { adl2Repository.addArchetype(conversionResult.getArchetype()); } } - adl2Repository.compile(BuiltinReferenceModels.getMetaModels()); + adl2Repository.compile(BuiltinReferenceModels.getMetaModelProvider()); for(ValidationResult validationResult:adl2Repository.getAllValidationResults()) { if(!validationResult.passes()) { @@ -109,7 +109,7 @@ public void parseLots() throws Exception { } } - ADL2ConversionResultList converted = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration) + ADL2ConversionResultList converted = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration) .convert(archetypes); for(ADL2ConversionResult result:converted.getConversionResults()) { if(result.getArchetype() != null) {// && result.getArchetype().getParentArchetypeId() != null) { @@ -156,7 +156,7 @@ public void parseLots() throws Exception { adl2Repository.addArchetype(conversionResult.getArchetype()); } } - adl2Repository.compile(BuiltinReferenceModels.getMetaModels()); + adl2Repository.compile(BuiltinReferenceModels.getMetaModelProvider()); int passingValidations = 0; for(ValidationResult validationResult:adl2Repository.getAllValidationResults()) { if(validationResult.passes()) { @@ -189,7 +189,7 @@ public void parseLots() throws Exception { private Archetype parse(Map exceptions, Map parseErrors, String file) { try (InputStream stream = getClass().getResourceAsStream("/" + file)) { logger.info("trying to parse " + file); - ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels()); + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); Archetype archetype = parser.parse(stream, conversionConfiguration); //logger.info(JacksonUtil.getObjectMapper().writeValueAsString(conversionResult.getConversionLog())); diff --git a/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java index 19f865a0c..950a7ecf2 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java @@ -25,12 +25,12 @@ public class PreviousLogConversionTest { public void applyConsistentConversion() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); ADL2ConversionRunLog log = null; try(InputStream stream = getClass().getResourceAsStream("openehr-EHR-COMPOSITION.review.v1.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); log = result.getConversionLog(); } @@ -38,7 +38,7 @@ public void applyConsistentConversion() throws Exception { try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-COMPOSITION.review.v1.modified.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration)), + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration)), log); CAttribute attribute = result.getConversionResults().get(0).getArchetype().itemAtPath("/category"); assertEquals(2, attribute.getChildren().size()); @@ -55,15 +55,15 @@ public void applyConsistentConversion() throws Exception { @Test public void testValueSet() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); ADL2ConversionRunLog log = null; try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.respiration.v1.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); log = result.getConversionLog(); Archetype converted = result.getConversionResults().get(0).getArchetype(); - ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()).validate(converted); + ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); assertTrue(validated.toString(), validated.passes() ); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9000")); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9001")); @@ -75,11 +75,11 @@ public void testValueSet() throws Exception { try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.respiration.v1.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration)), + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration)), log); Archetype converted = result.getConversionResults().get(0).getArchetype(); - ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()).validate(converted); + ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); assertTrue(validated.toString(), validated.passes() ); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9000")); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9001")); @@ -92,16 +92,16 @@ public void testValueSet() throws Exception { @Test public void unusedValuesAreRemoved() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); ADL2ConversionRunLog log = null; String createdAtCode = null; //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property try(InputStream stream = getClass().getResourceAsStream("/adl14/openEHR-EHR-CLUSTER.value_binding.v1.0.0.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); log = result.getConversionLog(); Archetype converted = result.getConversionResults().get(0).getArchetype(); - ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()).validate(converted); + ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); assertTrue(validated.toString(), validated.passes() ); createdAtCode = log.getConversionLog("openEHR-EHR-CLUSTER.value_binding.v1").getCreatedCodes().get("[openehr::124]").getGeneratedCode(); ArchetypeTerm termDefinition = converted.getTerminology().getTermDefinition("en", createdAtCode); @@ -113,10 +113,10 @@ public void unusedValuesAreRemoved() throws Exception { //apply the first conversion. The openehr::124 term binding is gone, and should not be present in the result, but should remain in the conversion log for future readdition try(InputStream stream = getClass().getResourceAsStream("/adl14/openEHR-EHR-CLUSTER.value_binding.v1.0.1.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration)), + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration)), log); Archetype converted = result.getConversionResults().get(0).getArchetype(); - ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()).validate(converted); + ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); assertTrue(validated.toString(), validated.passes() ); ArchetypeTerm termDefinition = converted.getTerminology().getTermDefinition("en", "at9000"); @@ -141,12 +141,12 @@ public void unusedValuesAreRemoved() throws Exception { public void acceptExplicitlySetCode() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); - ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModels(), conversionConfiguration); + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); ADL2ConversionRunLog log = null; try(InputStream stream = getClass().getResourceAsStream("openehr-EHR-COMPOSITION.review.v1.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration))); + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration))); log = result.getConversionLog(); } @@ -154,7 +154,7 @@ public void acceptExplicitlySetCode() throws Exception { try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-COMPOSITION.review.v1.codeadded.adl")) { ADL2ConversionResultList result = converter.convert( - Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModels()).parse(stream, conversionConfiguration)), + Lists.newArrayList(new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream, conversionConfiguration)), log); CAttribute attribute = result.getConversionResults().get(0).getArchetype().itemAtPath("/category"); diff --git a/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java b/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java index 149e5b259..d7cc0f0b6 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.utils.AOMUtils; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.testutil.TestUtil; import org.junit.Test; import org.openehr.referencemodels.BuiltinReferenceModels; @@ -15,15 +15,14 @@ public class AomUtilsPathFindingTest { @Test public void isPathInArchetypeOrRm() throws Exception{ Archetype archetype = TestUtil.parseFailOnErrors("/basic.adl"); - MetaModels metaModels = BuiltinReferenceModels.getMetaModels(); - metaModels.selectModel(archetype); + MetaModel metaModel = BuiltinReferenceModels.getMetaModelProvider().getMetaModel(archetype); //AOM path - assertTrue(AOMUtils.isPathInArchetypeOrRm(metaModels.getSelectedModel(), "/context[id11]", archetype)); + assertTrue(AOMUtils.isPathInArchetypeOrRm(metaModel, "/context[id11]", archetype)); //mixed aom + RM path - assertTrue(AOMUtils.isPathInArchetypeOrRm(metaModels.getSelectedModel(), "/context[id11]/health_care_facility/name", archetype)); + assertTrue(AOMUtils.isPathInArchetypeOrRm(metaModel, "/context[id11]/health_care_facility/name", archetype)); //path not in AOM, only in RM - assertTrue(AOMUtils.isPathInArchetypeOrRm(metaModels.getSelectedModel(), "/composer/external_ref", archetype)); + assertTrue(AOMUtils.isPathInArchetypeOrRm(metaModel, "/composer/external_ref", archetype)); //non-existing path - assertFalse(AOMUtils.isPathInArchetypeOrRm(metaModels.getSelectedModel(), "/doesnot_exists", archetype)); + assertFalse(AOMUtils.isPathInArchetypeOrRm(metaModel, "/doesnot_exists", archetype)); } } diff --git a/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java b/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java index 812b291fb..e3a26a967 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java @@ -121,7 +121,7 @@ public void findMatchSpecialisedNodes() throws Exception { inMemoryFullArchetypeRepository.addArchetype(archetype); Archetype archetype_specialised = TestUtil.parseFailOnErrors("/basic_specialised.adls"); inMemoryFullArchetypeRepository.addArchetype(archetype_specialised); - Flattener flattener = new Flattener(inMemoryFullArchetypeRepository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(inMemoryFullArchetypeRepository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(archetype_specialised); root = (Pathable) testUtil.constructEmptyRMObject(opt.getDefinition()); @@ -136,7 +136,7 @@ public void findListMatchSpecialisedNodes() throws Exception { inMemoryFullArchetypeRepository.addArchetype(archetype); Archetype archetype_specialised = TestUtil.parseFailOnErrors("/basic_specialised.adls"); inMemoryFullArchetypeRepository.addArchetype(archetype_specialised); - Flattener flattener = new Flattener(inMemoryFullArchetypeRepository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(inMemoryFullArchetypeRepository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(archetype_specialised); root = (Pathable) testUtil.constructEmptyRMObject(opt.getDefinition()); @@ -153,7 +153,7 @@ public void findListMatchTwiceSpecialisedNodes() throws Exception { Archetype archetype_specialised_twice = TestUtil.parseFailOnErrors("/basic_specialised2.adls"); inMemoryFullArchetypeRepository.addArchetype(archetype_specialised); inMemoryFullArchetypeRepository.addArchetype(archetype_specialised_twice); - Flattener flattener = new Flattener(inMemoryFullArchetypeRepository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(inMemoryFullArchetypeRepository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(archetype_specialised_twice); root = (Pathable) testUtil.constructEmptyRMObject(opt.getDefinition()); diff --git a/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java b/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java index 6efbfd200..2f2e31771 100644 --- a/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java @@ -31,11 +31,11 @@ public void termForUseArchetype() throws IOException, ADLParseException { repository.addArchetype(FlattenerTestUtil.parse("/com/nedap/archie/aom/openEHR-EHR-GENERIC_ENTRY.included.v1.0.0.adls")); //check that they are valid, just to be sure - repository.compile(BuiltinReferenceModels.getMetaModels()); + repository.compile(BuiltinReferenceModels.getMetaModelProvider()); repository.getAllValidationResults().forEach(s -> assertTrue(s.getErrors().toString(), s.getErrors().isEmpty())); //create operational template - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(repository.getArchetype("openEHR-EHR-COMPOSITION.parent.v1.0.0")); //and check the getTerm() functionality diff --git a/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java index 0776536c5..e33656d30 100644 --- a/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java @@ -186,7 +186,7 @@ public void validationInOptTest() throws Exception { repository.addArchetype(FlattenerTestUtil.parse("/com/nedap/archie/aom/openEHR-EHR-GENERIC_ENTRY.included.v1.0.0.adls")); //create operational template - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(repository.getArchetype("openEHR-EHR-COMPOSITION.parent.v1.0.0")); CTerminologyCode code = opt.itemAtPath("/content/data/items/value/defining_code[1]"); assertEquals(Lists.newArrayList("at4", "at5", "at6"), code.getValueSetExpanded()); diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java index bf3efb42f..e8dea76cc 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java @@ -212,7 +212,7 @@ public void parentWithDifferentRmRelease() throws IOException, ADLParseException repository.addArchetype(child); repository.addArchetype(parent); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); ValidationResult validatedChild = archetypeValidator.validate(child, repository); ValidationResult validatedParent = archetypeValidator.validate(parent, repository); @@ -224,7 +224,7 @@ public void parentWithDifferentRmRelease() throws IOException, ADLParseException repository.addArchetype(child); repository.addArchetype(parent); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); ValidationResult validatedParent = archetypeValidator.validate(parent, repository); ValidationResult validatedChild = archetypeValidator.validate(child, repository); @@ -295,7 +295,7 @@ public void infiniteSpecialisationTreeLoopTest() throws IOException, ADLParseExc repository.addArchetype(child1); repository.addArchetype(child2); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); ValidationResult result = archetypeValidator.validate(child1, repository); assertFalse(result.passes()); assertEquals("Infinite loop caused by specialising: openEHR-EHR-CLUSTER.infinite_loop_child1.v0.0.1 in openEHR-EHR-CLUSTER.infinite_loop_child2.v0.0.1", result.getErrors().get(0).getMessage()); @@ -312,7 +312,7 @@ public void specializationAfterExclusionTest() throws IOException, ADLParseExcep repository.addArchetype(parent); repository.addArchetype(childWithSpecializationAfterExclusion); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); ValidationResult result = archetypeValidator.validate(childWithSpecializationAfterExclusion, repository); assertTrue(result.passes()); assertEquals(2, result.getErrors().size()); @@ -327,7 +327,7 @@ public void incompatibleNodeIdValidationTest() throws IOException, ADLParseExcep { InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); repository.addArchetype(archetypeWithIncompatibleNodeId); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); ValidationResult result = archetypeValidator.validate(archetypeWithIncompatibleNodeId, repository); assertTrue(result.passes()); assertEquals(6, result.getErrors().size()); diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java index e018b36e0..4a706638f 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java @@ -23,7 +23,7 @@ public void testMultipleVersions() throws IOException, ADLParseException { repo.addArchetype(parentv1); repo.addArchetype(parentv11); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); //the order of validation is important for this test! //first validate the first parent, which is valid assertTrue(archetypeValidator.validate(parentv1, repo).passes()); @@ -47,7 +47,7 @@ public void testMultipleVersionsFullyCompile() throws Exception { repo.addArchetype(parentv1); repo.addArchetype(parentv11); repo.addArchetype(child); - repo.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModels())); + repo.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider())); for(ValidationResult result:repo.getAllValidationResults()) { assertTrue(result.getErrors().toString(), result.passes()); } diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java index 41563a17c..10d7a98a1 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java @@ -10,8 +10,9 @@ import com.nedap.archie.flattener.FullArchetypeRepository; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.ReferenceModels; +import com.nedap.archie.rminfo.SimpleMetaModelProvider; import org.apache.commons.io.FilenameUtils; import org.junit.Assert; import org.junit.Test; @@ -118,7 +119,7 @@ private FullArchetypeRepository parseAll() { @Test public void testFullValidityPackageBmm() { - testInner(new MetaModels(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles())); + testInner(new SimpleMetaModelProvider(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles())); } @@ -130,11 +131,11 @@ public void testFullValidityPackageModelInfoLookup() { models.registerModel(com.nedap.archie.openehrtestrm.TestRMInfoLookup.getInstance()); // access.initializeAll(schemaDirectories); - testInner(new MetaModels(models, (BmmRepository) null)); + testInner(new SimpleMetaModelProvider(models, null)); } - public void testInner(MetaModels metaModels) { + public void testInner(MetaModelProvider metaModelProvider) { Reflections reflections = new Reflections("adl2-tests.validity", Scanners.Resources); List adlFiles = new ArrayList<>(reflections.getResources(Pattern.compile(".*\\.adls"))); @@ -148,7 +149,7 @@ public void testInner(MetaModels metaModels) { int unexpectedParseErrors = 0; int wrongMessageCount = 0; List errorStrings = new ArrayList<>(); - ArchetypeValidator validator = new ArchetypeValidator(metaModels); + ArchetypeValidator validator = new ArchetypeValidator(metaModelProvider); InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); for(String file:adlFiles) { if (file.contains("legacy_adl_1.4")) { diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java index 4f4ca699f..e09dbd10a 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java @@ -2,8 +2,9 @@ import com.nedap.archie.flattener.FullArchetypeRepository; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.ReferenceModels; +import com.nedap.archie.rminfo.SimpleMetaModelProvider; import com.nedap.archie.testutil.TestUtil; import org.junit.Test; import org.openehr.referencemodels.BuiltinReferenceModels; @@ -58,11 +59,11 @@ public void fullCKMTest() { @Test public void fullCKMTestBmm() { - MetaModels bmmReferenceModels = new MetaModels(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles()); + MetaModelProvider bmmReferenceModelProvider = new SimpleMetaModelProvider(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles()); FullArchetypeRepository repository = TestUtil.parseCKM(); logger.info("archetypes parsed: " + repository.getAllArchetypes().size()); - repository.compile(bmmReferenceModels); + repository.compile(bmmReferenceModelProvider); runTest(repository); diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java index 3c3862542..49da00b3c 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java @@ -26,12 +26,12 @@ public void validRequiredBindingStrength() throws Exception { InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); repo.addArchetype(parent); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); for(ValidationResult validationResult:repo.getAllValidationResults()) { assertTrue(validationResult.toString(), validationResult.passes()); } - Flattener flattener = new Flattener(repo, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(repo, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(child); ValueSet valueSet = opt.getTerminology().getValueSets().get("ac0.2"); assertEquals(new LinkedHashSet<>(Arrays.asList("at1", "at2", "at3", "at0.1")), valueSet.getMembers()); @@ -44,7 +44,7 @@ public void invalidRequiredBindingStrength() throws Exception { InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); repo.addArchetype(parent); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_invalid_child.v1.0.0"); assertFalse(validationResult.toString(), validationResult.passes()); @@ -58,7 +58,7 @@ public void invalidConstraintStrengthRedefinition() throws Exception { InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); repo.addArchetype(parent); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_invalid_redefinition.v1.0.0"); assertFalse(validationResult.toString(), validationResult.passes()); @@ -72,7 +72,7 @@ public void valueSetCodeChanges() throws IOException, ADLParseException { InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); repo.addArchetype(parent); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_change_valueset_code.v1.0.0"); assertFalse(validationResult.toString(), validationResult.passes()); @@ -96,7 +96,7 @@ public void invalidValueSetRedefinition() throws IOException, ADLParseException InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); repo.addArchetype(parent); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_invalid_redefined_value-set.v1.0.0"); assertFalse(validationResult.toString(), validationResult.passes()); @@ -110,7 +110,7 @@ public void nonExistingParentValueSet() throws IOException, ADLParseException { InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); repo.addArchetype(parent); repo.addArchetype(child); - ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModels()); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.incorrect_parent_valueset_code.v1.0.0"); assertFalse(validationResult.toString(), validationResult.passes()); diff --git a/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java b/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java index 6087fd158..f39680895 100644 --- a/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java +++ b/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java @@ -198,7 +198,7 @@ public void generateAllCKMExamples() throws Exception { int numberCreated = 0, validationFailed = 0, generatedException = 0, jsonSchemaValidationRan = 0, jsonSchemaValidationFailed = 0; int secondJsonSchemaValidationRan = 0, reserializedJsonSchemaValidationFailed = 0; int rmObjectValidatorRan = 0, rmObjectValidatorFailed = 0; - repository.compile(BuiltinReferenceModels.getMetaModels()); + repository.compile(BuiltinReferenceModels.getMetaModelProvider()); BmmModel model = BuiltinReferenceModels.getBmmRepository().getModel("openehr_rm_1.0.4").getModel(); JsonSchemaValidator firstValidator = new JsonSchemaValidator(model, true); JsonSchemaValidator secondValidator = new JsonSchemaValidator(model,false); @@ -210,7 +210,7 @@ public void generateAllCKMExamples() throws Exception { if(result.passes()) { String json = ""; try { - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels()).createOperationalTemplate(true); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider()).createOperationalTemplate(true); OperationalTemplate template = (OperationalTemplate) flattener.flatten(result.getSourceArchetype()); Map example = structureGenerator.generate(template); json = mapper.writeValueAsString(example); @@ -282,7 +282,7 @@ public void generateAllCKMExamples() throws Exception { } private ExampleJsonInstanceGenerator createExampleJsonInstanceGenerator() { - ExampleJsonInstanceGenerator structureGenerator = new ExampleJsonInstanceGenerator(BuiltinReferenceModels.getMetaModels(), "en"); + ExampleJsonInstanceGenerator structureGenerator = new ExampleJsonInstanceGenerator(BuiltinReferenceModels.getMetaModelProvider(), "en"); structureGenerator.setTypePropertyName(TYPE_PROPERTY_NAME); return structureGenerator; } @@ -292,7 +292,7 @@ private OperationalTemplate createOPT(String s2) throws IOException, ADLParseExc Archetype archetype = parse(s2); InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); repository.addArchetype(archetype); - return (OperationalTemplate) new Flattener(repository, BuiltinReferenceModels.getMetaModels()).createOperationalTemplate(true).flatten(archetype); + return (OperationalTemplate) new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider()).createOperationalTemplate(true).flatten(archetype); } private Archetype parse(String filename) throws IOException, ADLParseException { diff --git a/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java b/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java index 5f4587c99..5e2866156 100644 --- a/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java +++ b/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java @@ -4,7 +4,8 @@ import com.nedap.archie.flattener.Flattener; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.flattener.specexamples.FlattenerTestUtil; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModelProvider; +import com.nedap.archie.rminfo.SimpleMetaModelProvider; import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; import com.nedap.archie.testutil.TestUtil; import org.openehr.bmm.v2.validation.BmmRepository; @@ -20,23 +21,23 @@ public class DiffTestUtil { private String expectationsResourceLocation; private InMemoryFullArchetypeRepository repository; - private MetaModels models; + private final MetaModelProvider metaModelProvider; public DiffTestUtil(String archetypesResourceLocation, String expectationsResourceLocation) { this.archetypesResourceLocation = archetypesResourceLocation; this.expectationsResourceLocation = expectationsResourceLocation; repository = new InMemoryFullArchetypeRepository(); - models = new MetaModels(BuiltinReferenceModels.getAvailableModelInfoLookups(), (BmmRepository) null); + metaModelProvider = new SimpleMetaModelProvider(BuiltinReferenceModels.getAvailableModelInfoLookups(), null); } public void test(String parentFileName, String childFileName) throws Exception { Archetype parent = FlattenerTestUtil.parse(archetypesResourceLocation + parentFileName); repository.addArchetype(parent); Archetype child = FlattenerTestUtil.parse(archetypesResourceLocation + childFileName); - Archetype flattened = new Flattener(repository, models).flatten(child); + Archetype flattened = new Flattener(repository, metaModelProvider).flatten(child); assertEquals(child.getParentArchetypeId(), flattened.getParentArchetypeId()); - Archetype diffed = new Differentiator(BuiltinReferenceModels.getMetaModels()).differentiate(flattened, parent); + Archetype diffed = new Differentiator(BuiltinReferenceModels.getMetaModelProvider()).differentiate(flattened, parent); child.setGenerated(true);//this is set by the diff tool :) String originalSerialized = ADLArchetypeSerializer.serialize(child); String diffedSerialized = ADLArchetypeSerializer.serialize(diffed); @@ -53,10 +54,10 @@ public void testWithExplicitExpect(String parentFileName, String childFileName) repository.addArchetype(parent); Archetype child = FlattenerTestUtil.parse(archetypesResourceLocation + childFileName); Archetype expectedDiff = FlattenerTestUtil.parse(expectationsResourceLocation + childFileName); - Archetype flattened = new Flattener(repository, models).flatten(child); + Archetype flattened = new Flattener(repository, metaModelProvider).flatten(child); assertEquals(child.getParentArchetypeId(), flattened.getParentArchetypeId()); - Archetype diffed = new Differentiator(BuiltinReferenceModels.getMetaModels()).differentiate(flattened, parent); + Archetype diffed = new Differentiator(BuiltinReferenceModels.getMetaModelProvider()).differentiate(flattened, parent); expectedDiff.setGenerated(true);//this is set by the diff tool :) String expectedSerialized = ADLArchetypeSerializer.serialize(expectedDiff); String diffedSerialized = ADLArchetypeSerializer.serialize(diffed); diff --git a/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java b/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java index f3ae2b575..d8e7d21b9 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java @@ -49,8 +49,8 @@ public void includeZeroExistence() throws Exception { @Test public void fillEmptyOccurrences() throws Exception { try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.cluster_with_annotations.v1.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); - Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); Stack workList = new Stack<>(); @@ -72,10 +72,10 @@ public void fillEmptyOccurrences() throws Exception { @Test public void dontFillEmptyOccurrencesUnlessSet() throws Exception { try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.cluster_with_annotations.v1.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forOperationalTemplate(); flattenerConfiguration.setFillEmptyOccurrences(false); - Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModels(), flattenerConfiguration); + Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModelProvider(), flattenerConfiguration); OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); Stack workList = new Stack<>(); @@ -97,9 +97,9 @@ public void dontFillEmptyOccurrencesUnlessSet() throws Exception { public void failOnMissingArchetypeEnabled() throws Exception { SimpleArchetypeRepository repository = new SimpleArchetypeRepository(); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.with_used_archetype.v1.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forOperationalTemplate(); - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels(), flattenerConfiguration); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), flattenerConfiguration); OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); fail(); } @@ -108,10 +108,10 @@ public void failOnMissingArchetypeEnabled() throws Exception { @Test public void failOnMissingArchetypeDisabled() throws Exception { try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.with_used_archetype.v1.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forOperationalTemplate(); flattenerConfiguration.setFailOnMissingUsedArchetype(false); - Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModels(), flattenerConfiguration); + Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModelProvider(), flattenerConfiguration); OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); CArchetypeRoot archetypeRoot = template.getDefinition().itemAtPath("/data[id2]/events[id3]/data[id4]/items[id8]"); @@ -163,7 +163,7 @@ private Archetype parseAndCreateOPTWithConfig(String fileName, InMemoryFullArche models.registerModel(ArchieRMInfoLookup.getInstance()); ValidationResult validationResult = new ArchetypeValidator(models).validate(result, repository); assertTrue(validationResult.getErrors().toString(), validationResult.passes()); - return new Flattener(repository, BuiltinReferenceModels.getMetaModels(), config).flatten(parse(fileName)); + return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), config).flatten(parse(fileName)); } private Archetype parse(String filePath) throws IOException, ADLParseException { diff --git a/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java index f297c67a5..24e794f17 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java @@ -19,7 +19,7 @@ public void flattenParentChild() throws Exception{ InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); repository.addArchetype(parent); repository.addArchetype(child); - repository.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModels())); + repository.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider())); repository.getAllValidationResults().forEach(v -> assertTrue(v.getErrors().toString(), !v.hasWarningsOrErrors())); Archetype flattenedChild = repository.getFlattenedArchetype("openEHR-EHR-OBSERVATION.to_flatten_child_with_overlay.v1.0.0"); @@ -39,10 +39,10 @@ public void flattenIncludedArchetype() throws Exception { InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); repository.addArchetype(parent); repository.addArchetype(composition); - repository.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModels())); + repository.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider())); repository.getAllValidationResults().forEach(v -> assertTrue(v.getErrors().toString(), !v.hasWarningsOrErrors())); - OperationalTemplate opt = (OperationalTemplate) new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()).flatten(composition); + OperationalTemplate opt = (OperationalTemplate) new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()).flatten(composition); assertEquals(VisibilityType.HIDE, opt.getRmOverlay().getRmVisibility().get("/content[id2]/subject").getVisibility()); assertEquals("at12", opt.getRmOverlay().getRmVisibility().get("/content[id2]/subject").getAlias().getCodeString()); } diff --git a/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java index b97de4458..e64653ec9 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java @@ -230,7 +230,7 @@ private Archetype parseAndCreateOPT(String fileName) throws IOException, ADLPars ValidationResult validationResult = new ArchetypeValidator(models).validate(result, repository); assertTrue(validationResult.getErrors().toString(), validationResult.passes()); - return new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()).flatten(parse(fileName)); + return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()).flatten(parse(fileName)); } private Archetype parseAndFlattenRemoveZeroOccurrences(String fileName) throws IOException, ADLParseException { @@ -241,6 +241,6 @@ private Archetype parseAndFlattenRemoveZeroOccurrences(String fileName) throws I assertTrue(validationResult.getErrors().toString(), validationResult.passes()); FlattenerConfiguration config = FlattenerConfiguration.forFlattened(); config.setRemoveZeroOccurrencesObjects(true); - return new Flattener(repository, BuiltinReferenceModels.getMetaModels(), config).flatten(parse(fileName)); + return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), config).flatten(parse(fileName)); } } diff --git a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java index 2a26a2738..0edf0dbf0 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java @@ -1,7 +1,7 @@ package com.nedap.archie.flattener.specexamples; import com.nedap.archie.flattener.SimpleArchetypeRepository; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.SimpleMetaModelProvider; import org.junit.Before; import org.openehr.referencemodels.BuiltinReferenceModels; @@ -10,6 +10,6 @@ public class FlattenerExamplesFromSpecBMMTest extends FlattenerExamplesFromSpecT @Before public void setup() throws Exception { repository = new SimpleArchetypeRepository(); - models = new MetaModels(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles()); + metaModelProvider = new SimpleMetaModelProvider(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles()); } } diff --git a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java index d208686bf..b5991cde7 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java @@ -9,7 +9,8 @@ import com.nedap.archie.base.MultiplicityInterval; import com.nedap.archie.flattener.Flattener; import com.nedap.archie.flattener.SimpleArchetypeRepository; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModelProvider; +import com.nedap.archie.rminfo.SimpleMetaModelProvider; import org.junit.Before; import org.junit.Test; import org.openehr.bmm.v2.validation.BmmRepository; @@ -26,12 +27,12 @@ public class FlattenerExamplesFromSpecTest { protected SimpleArchetypeRepository repository; - protected MetaModels models; + protected MetaModelProvider metaModelProvider; @Before public void setup() throws Exception { repository = new SimpleArchetypeRepository(); - models = new MetaModels(BuiltinReferenceModels.getAvailableModelInfoLookups(), (BmmRepository) null); + metaModelProvider = new SimpleMetaModelProvider(BuiltinReferenceModels.getAvailableModelInfoLookups(), null); } @Test @@ -39,7 +40,7 @@ public void specializationPaths() throws Exception { Archetype labTest = parse("openEHR-EHR-OBSERVATION.lab-test.v1.0.0.adls"); repository.addArchetype(labTest); Archetype specializationPaths = parse("specialization_paths.adls"); - Archetype flattened = new Flattener(repository, models).flatten(specializationPaths); + Archetype flattened = new Flattener(repository, metaModelProvider).flatten(specializationPaths); assertEquals(specializationPaths.getParentArchetypeId(), flattened.getParentArchetypeId()); CObject originalConstraint = flattened.itemAtPath("/data[id2]/events[id3]/data[id4]/items[id79]"); @@ -64,7 +65,7 @@ public void redefinitionForRefinement() throws Exception { Archetype problem = parse("problem.adls"); repository.addArchetype(problem); Archetype diagnosis = parse("diagnosis.adls"); - Archetype flattenedDiagnosis = new Flattener(repository, models).flatten(diagnosis); + Archetype flattenedDiagnosis = new Flattener(repository, metaModelProvider).flatten(diagnosis); assertEquals("Recording of diagnosis", flattenedDiagnosis.getDefinition().getTerm().getText()); @@ -101,7 +102,7 @@ public void specialisationWithCloning() throws Exception { Archetype labTestPanel = parse("openEHR-EHR-CLUSTER.laboratory_test_panel.v1.0.0.adls"); repository.addArchetype(labTestPanel); Archetype lipidStudiesPanel = parse("openEHR-EHR-CLUSTER.lipid_studies_panel.adls"); - Archetype flattenedLipidStudies = new Flattener(repository, models).flatten(lipidStudiesPanel); + Archetype flattenedLipidStudies = new Flattener(repository, metaModelProvider).flatten(lipidStudiesPanel); List itemNodes = flattenedLipidStudies.getDefinition().getAttribute("items").getChildren(); List nodeIds = itemNodes.stream().map(cObject -> cObject.getNodeId()).collect(Collectors.toList()); @@ -131,8 +132,8 @@ public void existenceRedefinition() throws Exception { Archetype mandatory = parse("openEHR-EHR-OBSERVATION.protocol_mandatory.v1.0.0.adls"); Archetype exclusion = parse("openEHR-EHR-OBSERVATION.protocol_exclusion.v1.0.0.adls"); - Archetype mandatoryFlat = new Flattener(repository, models).flatten(mandatory); - Archetype exclusionFlat = new Flattener(repository, models).flatten(exclusion); + Archetype mandatoryFlat = new Flattener(repository, metaModelProvider).flatten(mandatory); + Archetype exclusionFlat = new Flattener(repository, metaModelProvider).flatten(exclusion); CAttribute mandatoryProtocol = mandatoryFlat.getDefinition().getAttribute("protocol"); assertTrue(mandatoryProtocol.getExistence().isMandatory()); @@ -150,7 +151,7 @@ public void cardinalityRedefinition() throws Exception { repository.addArchetype(cardinalityParent); Archetype specialized = parse("openEHR-EHR-CLUSTER.cardinality_specialized.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); CAttribute items = flat.getDefinition().getAttribute("items").getChildren().get(0).getAttribute("items"); assertEquals(new Cardinality(3, 10), items.getCardinality()); @@ -173,7 +174,7 @@ public void exclusionRemoval() throws Exception { Archetype occurrencesSpecialized = parse("openEHR-EHR-CLUSTER.occurrences_specialized.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).removeZeroOccurrencesConstraints(true).flatten(occurrencesSpecialized); + Archetype flat = new Flattener(repository, metaModelProvider).removeZeroOccurrencesConstraints(true).flatten(occurrencesSpecialized); CAttribute attribute = flat.itemAtPath("/items[id3]/value"); assertNotNull(flat.itemAtPath("/items[id3]/value[id5]")); assertNotNull(flat.itemAtPath("/items[id3]/value[id6]")); @@ -190,7 +191,7 @@ public void exclusionDefault() throws Exception { Archetype occurrencesSpecialized = parse("openEHR-EHR-CLUSTER.occurrences_specialized.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(occurrencesSpecialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(occurrencesSpecialized); CAttribute attribute = flat.itemAtPath("/items[id3]/value"); assertNotNull(flat.itemAtPath("/items[id3]/value[id5]")); assertNotNull(flat.itemAtPath("/items[id3]/value[id6]")); @@ -214,7 +215,7 @@ public void RMTypeRefinement() throws Exception { Archetype specialized = parse("openEHR-EHR-ELEMENT.type_refinement_specialized.v1.0.0.adls"); repository.addArchetype(rmTypeRefinement); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); CAttribute value = flat.itemAtPath("/value"); assertEquals(3, value.getChildren().size()); @@ -241,7 +242,7 @@ public void internalReferenceRedefinition() throws Exception { repository.addArchetype(parent); Archetype specialized = parse("openEHR-EHR-ENTRY.reference_redefinition_specialized.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); assertNotNull(flat.itemAtPath("/data[id3]/items[id4]")); assertNotNull(flat.itemAtPath("/data[id3]/items[id0.1]")); assertNull(flat.itemAtPath("/data[id2]/items[id0.1]")); @@ -254,7 +255,7 @@ public void internalReferenceRedefinitionNoReplacement() throws Exception { Archetype parent = parse("openEHR-EHR-ENTRY.reference_redefinition_parent.v1.0.0.adls"); repository.addArchetype(parent); Archetype specialized = parse("openEHR-EHR-ENTRY.reference_redefinition_no_replacement.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); ArchetypeModelObject cluster = flat.itemAtPath("/data[id3]"); assertEquals(CComplexObjectProxy.class, cluster.getClass()); @@ -267,7 +268,7 @@ public void numericPrimitiveRedefinition() throws Exception { Archetype parent = parse("openEHR-EHR-ELEMENT.numeric_primitive_parent.v1.0.0.adls"); repository.addArchetype(parent); Archetype specialized = parse("openEHR-EHR-ELEMENT.numeric_primitive_specialized.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); CReal flatConstraint = flat.itemAtPath("/value[id3]/magnitude[1]"); assertEquals(4.0d, flatConstraint.getConstraint().get(0).getLower(), 0.0001d); @@ -283,7 +284,7 @@ public void tupleRedefinition() throws Exception { Archetype parent = parse("openEHR-EHR-ELEMENT.tuple_parent.v1.0.0.adls"); repository.addArchetype(parent); Archetype specialized = parse("openEHR-EHR-ELEMENT.tuple_specialized.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); //the tuple should be completely replaced with the new tuple //the attributes should be correct CComplexObject dvQuantity = flat.itemAtPath("/value[1]"); @@ -311,7 +312,7 @@ public void addTuple() throws Exception { Archetype parent = parse("openEHR-EHR-ELEMENT.type_refinement_parent.v1.0.0.adls"); repository.addArchetype(parent); Archetype specialized = parse("openEHR-EHR-ELEMENT.add_tuple.v1.0.0.adls"); - Archetype flat = new Flattener(repository, models).flatten(specialized); + Archetype flat = new Flattener(repository, metaModelProvider).flatten(specialized); //the tuple should be completely replaced with the new tuple //the attributes should be correct CComplexObject dvQuantity = flat.itemAtPath("/value[1]"); diff --git a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java index 11d036810..9d416eff5 100644 --- a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java +++ b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java @@ -74,7 +74,7 @@ public void roundTripDeliriumObservationScreening() throws Exception { @Test public void motricityIndex() throws Exception { try(InputStream stream = getClass().getResourceAsStream( "/com/nedap/archie/rules/evaluation/openEHR-EHR-OBSERVATION.motricity_index.v1.0.0.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); String serialized = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createStandardsCompliant()).writeValueAsString(archetype); //System.out.println(serialized); assertTrue(serialized.contains("EXPR_BINARY_OPERATOR")); @@ -116,7 +116,7 @@ public void motricityIndexRulesOldFormatAsList() throws Exception { @Test public void motriciyIndexJavascriptFormat() throws Exception { try(InputStream stream = getClass().getResourceAsStream( "/com/nedap/archie/rules/evaluation/openEHR-EHR-OBSERVATION.motricity_index.v1.0.0.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); String serialized = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createConfigForJavascriptUsage()).writeValueAsString(archetype); //System.out.println(serialized); assertTrue(serialized.contains("EXPR_BINARY_OPERATOR")); @@ -136,7 +136,7 @@ public void motriciyIndexJavascriptFormat() throws Exception { @Test public void motricityIndexOldFormat() throws Exception { try(InputStream stream = getClass().getResourceAsStream( "/com/nedap/archie/rules/evaluation/openEHR-EHR-OBSERVATION.motricity_index.v1.0.0.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); ArchieJacksonConfiguration config = ArchieJacksonConfiguration.createStandardsCompliant(); config.setStandardsCompliantExpressions(false); String serialized = JacksonUtil.getObjectMapper(config).writeValueAsString(archetype); @@ -155,7 +155,7 @@ public void motricityIndexOldFormat() throws Exception { @Test public void archetypeSlot() throws Exception { try(InputStream stream = getClass().getResourceAsStream( "/basic.adl")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); ObjectMapper objectMapper = new ObjectMapper(); JacksonUtil.configureObjectMapper(objectMapper, ArchieJacksonConfiguration.createStandardsCompliant()); objectMapper.disable(SerializationFeature.INDENT_OUTPUT); @@ -181,7 +181,7 @@ private void assertArchetypeSlot(ObjectMapper objectMapper, String serialized) t @Test public void archetypeSlotOldExpressionClassNames() throws Exception { try(InputStream stream = getClass().getResourceAsStream( "/basic.adl")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); ArchieJacksonConfiguration config = ArchieJacksonConfiguration.createStandardsCompliant(); config.setStandardsCompliantExpressions(false); ObjectMapper objectMapper = JacksonUtil.getObjectMapper(config); diff --git a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java index ad6f38389..bf1664362 100644 --- a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java +++ b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java @@ -19,7 +19,8 @@ import com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia; import com.nedap.archie.rm.datavalues.quantity.DvCount; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import com.nedap.archie.rminfo.MetaModels; +import com.nedap.archie.rminfo.MetaModel; +import com.nedap.archie.rminfo.MetaModelProvider; import org.junit.After; import org.junit.Test; import org.openehr.referencemodels.BuiltinReferenceModels; @@ -181,7 +182,7 @@ public void dontSerializeNames() throws Exception { config.setFilterNames(true); config.setFilterTypes(false); //config.getIgnoredAttributes().add(new AttributeReference("LOCATABLE", "name")); - Map stringObjectMap = new FlatJsonExampleInstanceGenerator().generateExample(bloodPressureOpt, BuiltinReferenceModels.getMetaModels(), "en", config); + Map stringObjectMap = new FlatJsonExampleInstanceGenerator().generateExample(bloodPressureOpt, BuiltinReferenceModels.getMetaModelProvider(), "en", config); System.out.println(JacksonUtil.getObjectMapper().writeValueAsString(stringObjectMap)); @@ -210,13 +211,13 @@ public void dontSerializeTypes() throws Exception { config.setFilterNames(true); config.setFilterTypes(true); //config.getIgnoredAttributes().add(new AttributeReference("LOCATABLE", "name")); - MetaModels metaModels = BuiltinReferenceModels.getMetaModels(); - metaModels.selectModel(bloodPressureOpt); + MetaModelProvider metaModelProvider = BuiltinReferenceModels.getMetaModelProvider(); + MetaModel metaModel = metaModelProvider.getMetaModel(bloodPressureOpt); - ExampleJsonInstanceGenerator exampleJsonInstanceGenerator = new ExampleJsonInstanceGenerator(metaModels, "en"); + ExampleJsonInstanceGenerator exampleJsonInstanceGenerator = new ExampleJsonInstanceGenerator(metaModelProvider, "en"); exampleJsonInstanceGenerator.setTypePropertyName("_type"); Map generatedExample = exampleJsonInstanceGenerator.generate(bloodPressureOpt); - ObjectMapper objectMapper = metaModels.getSelectedModel().getJsonObjectMapper(); + ObjectMapper objectMapper = metaModel.getJsonObjectMapper(); String jsonRmObject = objectMapper.writeValueAsString(generatedExample); Observation bloodPressure = objectMapper.readValue(jsonRmObject, Observation.class); //set the name to be different from the archetype, so it will be added here @@ -224,7 +225,7 @@ public void dontSerializeTypes() throws Exception { - Map stringObjectMap = new FlatJsonGenerator(metaModels.getSelectedModelInfoLookup(), config).buildPathsAndValues(bloodPressure, bloodPressureOpt, "en"); + Map stringObjectMap = new FlatJsonGenerator(metaModel.getModelInfoLookup(), config).buildPathsAndValues(bloodPressure, bloodPressureOpt, "en"); System.out.println(JacksonUtil.getObjectMapper().writeValueAsString(stringObjectMap)); @@ -259,19 +260,19 @@ public void restoresThreadLocalDescriptiongAndMeaningLanguage() throws Exceptio OperationalTemplate bloodPressureOpt = parseBloodPressure(); FlatJsonFormatConfiguration config = FlatJsonFormatConfiguration.nedapInternalFormat(); - MetaModels metaModels = BuiltinReferenceModels.getMetaModels(); - metaModels.selectModel(bloodPressureOpt); + MetaModelProvider metaModelProvider = BuiltinReferenceModels.getMetaModelProvider(); + MetaModel metaModel = metaModelProvider.getMetaModel(bloodPressureOpt); - ExampleJsonInstanceGenerator exampleJsonInstanceGenerator = new ExampleJsonInstanceGenerator(metaModels, "en"); + ExampleJsonInstanceGenerator exampleJsonInstanceGenerator = new ExampleJsonInstanceGenerator(metaModelProvider, "en"); exampleJsonInstanceGenerator.setTypePropertyName("_type"); Map generatedExample = exampleJsonInstanceGenerator.generate(bloodPressureOpt); - ObjectMapper objectMapper = metaModels.getSelectedModel().getJsonObjectMapper(); + ObjectMapper objectMapper = metaModel.getJsonObjectMapper(); String jsonRmObject = objectMapper.writeValueAsString(generatedExample); Observation bloodPressure = objectMapper.readValue(jsonRmObject, Observation.class); ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("nl"); - new FlatJsonGenerator(metaModels.getSelectedModelInfoLookup(), config).buildPathsAndValues(bloodPressure, bloodPressureOpt, "en"); + new FlatJsonGenerator(metaModel.getModelInfoLookup(), config).buildPathsAndValues(bloodPressure, bloodPressureOpt, "en"); // The ThreadLocalDescriptiongAndMeaningLanguage should be restored to nl after the buildPathsAndValues call. assertEquals("nl", ArchieLanguageConfiguration.getThreadLocalDescriptiongAndMeaningLanguage()); @@ -287,7 +288,7 @@ public void filterTypesWithAlternatives() throws Exception { config.setFilterNames(true); config.setFilterTypes(true); //config.getIgnoredAttributes().add(new AttributeReference("LOCATABLE", "name")); - Map stringObjectMap = new FlatJsonExampleInstanceGenerator().generateExample(bloodPressureOpt, BuiltinReferenceModels.getMetaModels(), "en", config); + Map stringObjectMap = new FlatJsonExampleInstanceGenerator().generateExample(bloodPressureOpt, BuiltinReferenceModels.getMetaModelProvider(), "en", config); System.out.println(JacksonUtil.getObjectMapper().writeValueAsString(stringObjectMap)); @@ -303,21 +304,21 @@ public void filterTypesWithAlternatives() throws Exception { private OperationalTemplate parseBloodPressure() throws IOException, ADLParseException { try (InputStream stream = getClass().getResourceAsStream(BLOOD_PRESSURE_PATH)) { - Archetype bloodPressure = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); - Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Archetype bloodPressure = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); return (OperationalTemplate) flattener.flatten(bloodPressure); } } private OperationalTemplate parseTypeAlternatives() throws IOException, ADLParseException { try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.element_with_two_dv_types.v1.0.0.adls")) { - Archetype typeAlternatives = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(stream); - Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Archetype typeAlternatives = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + Flattener flattener = new Flattener(new SimpleArchetypeRepository(), BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); return (OperationalTemplate) flattener.flatten(typeAlternatives); } } private Map createExampleInstance(OperationalTemplate bloodPressureOpt, FlatJsonFormatConfiguration config) throws IOException, DuplicateKeyException { - return new FlatJsonExampleInstanceGenerator().generateExample(bloodPressureOpt, BuiltinReferenceModels.getMetaModels(), "en", config); + return new FlatJsonExampleInstanceGenerator().generateExample(bloodPressureOpt, BuiltinReferenceModels.getMetaModelProvider(), "en", config); } } diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java index 569fc5820..7f965e921 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java @@ -86,7 +86,7 @@ public void cardinalityMismatchValidation() throws Exception { } private OperationalTemplate createOpt(Archetype archetype) { - return (OperationalTemplate) new Flattener(emptyRepo, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()).flatten(archetype); + return (OperationalTemplate) new Flattener(emptyRepo, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()).flatten(archetype); } @Test diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java index 04d8afb9b..03d2eaa4a 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java @@ -213,7 +213,7 @@ public void validationInOptTest() throws Exception { repository.addArchetype(FlattenerTestUtil.parse("/com/nedap/archie/aom/openEHR-EHR-GENERIC_ENTRY.included.v1.0.0.adls")); //create operational template - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(repository.getArchetype("openEHR-EHR-COMPOSITION.parent.v1.0.0")); CTerminologyCode code = opt.itemAtPath("/content/data/items/value/defining_code[1]"); assertEquals(Lists.newArrayList("at4", "at5", "at6"), code.getValueSetExpanded()); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java index b6524cee0..7fe9e1799 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java @@ -87,7 +87,7 @@ public void testArchetypedOtherDetails() { } private OperationalTemplate createOpt(Archetype archetype) { - return (OperationalTemplate) new Flattener(repo, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()).flatten(archetype); + return (OperationalTemplate) new Flattener(repo, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()).flatten(archetype); } private Archetype parse(String filename) throws IOException, ADLParseException { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java index ac17ccaea..07c3d80aa 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java @@ -62,14 +62,14 @@ public void setup() throws IOException, ADLParseException { repository.setOperationalTemplate(includedOpt); repository.setOperationalTemplate(parentOfIncludedOpt); - generator = new ExampleJsonInstanceGenerator(BuiltinReferenceModels.getMetaModels(), "en"); + generator = new ExampleJsonInstanceGenerator(BuiltinReferenceModels.getMetaModelProvider(), "en"); Map generated = generator.generate(parentOpt); example = JacksonUtil.getObjectMapper().readValue(JacksonUtil.getObjectMapper().writeValueAsString(generated), Section.class); rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), repository, new ValidationConfiguration.Builder().build()); } private Flattener createFlattener() { - return new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); } @Test diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java index b6f611fe1..3fa41d240 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java @@ -38,7 +38,7 @@ public class FixableAssertionsCheckerTest { public void setup() { testUtil = new TestUtil(); rmObjectCreator = new RMObjectCreator(ArchieRMInfoLookup.getInstance()); - parser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); ArchieLanguageConfiguration.setThreadLocalLogicalPathLanguage("en"); ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("en"); } diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java index 65ea42b23..75d177bf8 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java @@ -50,7 +50,7 @@ public abstract class ParsedRulesEvaluationTest { @Before public void setup() { testUtil = new TestUtil(); - parser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); } public Archetype getArchetype() { @@ -781,9 +781,9 @@ public void flattenedRules() throws IOException, ADLParseException { InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); repository.addArchetype(parent); repository.addArchetype(valueSet); - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels(), FlattenerConfiguration.forOperationalTemplate()); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(parent); - ExampleJsonInstanceGenerator generator = new ExampleJsonInstanceGenerator(BuiltinReferenceModels.getMetaModels(), "en"); + ExampleJsonInstanceGenerator generator = new ExampleJsonInstanceGenerator(BuiltinReferenceModels.getMetaModelProvider(), "en"); Map exampleInstance = generator.generate(opt); Cluster cluster = JacksonUtil.getObjectMapper().readValue(JacksonUtil.getObjectMapper().writeValueAsString(exampleInstance), Cluster.class); //correct case first diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java index 915be2668..42eff84ce 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java @@ -154,7 +154,7 @@ private Archetype roundtrip(Archetype archetype, RMObjectMapperProvider rmObject String serialized = ADLArchetypeSerializer.serialize(archetype, null, rmObjectMapperProvider); logger.info(serialized); - ADLParser parser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); Archetype result = parser.parse(serialized); assertTrue("roundtrip parsing should never cause errors: " + parser.getErrors().toString(), parser.getErrors().hasNoErrors()); @@ -166,11 +166,11 @@ private Archetype roundtrip(Archetype archetype, RMObjectMapperProvider rmObject } private Archetype load(String resourceName) throws IOException, ADLParseException { - return new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(ADLArchetypeSerializerTest.class.getResourceAsStream(resourceName)); + return new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(ADLArchetypeSerializerTest.class.getResourceAsStream(resourceName)); } private Archetype loadRoot(String resourceName) throws IOException, ADLParseException { - return new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(ADLArchetypeSerializerTest.class.getClassLoader().getResourceAsStream(resourceName)); + return new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(ADLArchetypeSerializerTest.class.getClassLoader().getResourceAsStream(resourceName)); } @Test @@ -245,7 +245,7 @@ public void operationalTemplate() throws Exception { repository.addArchetype(height); repository.addArchetype(heightTemplate); - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModels()).createOperationalTemplate(true); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider()).createOperationalTemplate(true); Archetype operationalTemplate = flattener.flatten(bloodPressureComposition); Archetype parsed = roundtrip(operationalTemplate); TestUtil.assertCObjectEquals(operationalTemplate.getDefinition(), parsed.getDefinition()); diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java index a176da12d..30f281725 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java @@ -119,7 +119,7 @@ public void rmOverlay() throws Exception { " >\n" + " >")); - Archetype parsed = new ADLParser(BuiltinReferenceModels.getMetaModels()).parse(serialized); + Archetype parsed = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(serialized); assertEquals(VisibilityType.HIDE, parsed.getRmOverlay().getRmVisibility().get("/subject").getVisibility()); assertEquals("at12", parsed.getRmOverlay().getRmVisibility().get("/subject").getAlias().getCodeString()); } diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java index 21ed50106..313227fda 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java @@ -22,7 +22,7 @@ public class DefaultValueSerializerTest { @Test public void serializeDvTextOdin() throws Exception { - ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.simple.v1.adls")) { Archetype archetype = adlParser.parse(stream); CComplexObject cComplexObject = archetype.itemAtPath("/items[id2]/value[id21]"); @@ -46,7 +46,7 @@ public void serializeDvTextOdin() throws Exception { @Test public void serializeDvTextJson() throws Exception { - ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.simple.v1.adls")) { Archetype archetype = adlParser.parse(stream); CComplexObject cComplexObject = archetype.itemAtPath("/items[id2]/value[id21]"); @@ -72,7 +72,7 @@ public void serializeDvTextJson() throws Exception { @Test public void serializeDvCodedTextJson() throws Exception { - ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.simple.v1.adls")) { Archetype archetype = adlParser.parse(stream); CComplexObject cComplexObject = archetype.itemAtPath("/items[id2]/value[id21]"); @@ -99,7 +99,7 @@ public void serializeDvCodedTextJson() throws Exception { @Test public void serializeDvCodedTextOdin() throws Exception { - ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.simple.v1.adls")) { Archetype archetype = adlParser.parse(stream); CComplexObject cComplexObject = archetype.itemAtPath("/items[id2]/value[id21]"); @@ -126,7 +126,7 @@ public void serializeDvCodedTextOdin() throws Exception { @Test public void serializeClusterJson() throws Exception { - ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.simple.v1.adls")) { Archetype archetype = adlParser.parse(stream); CComplexObject cComplexObject = archetype.getDefinition(); @@ -155,7 +155,7 @@ public void serializeClusterJson() throws Exception { @Test public void serializeClusterOdin() throws Exception { - ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + ADLParser adlParser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.simple.v1.adls")) { Archetype archetype = adlParser.parse(stream); CComplexObject cComplexObject = archetype.getDefinition(); diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java index 97c5fb38b..9ee8a65dd 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java @@ -40,7 +40,7 @@ public class JAXBRMRoundTripTest { @Before public void setup() { testUtil = new TestUtil(); - parser = new ADLParser(BuiltinReferenceModels.getMetaModels()); + parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); } @Test From 8160ea7d369e85205e0e04cbcf4ee163c8679aab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:29:59 +0200 Subject: [PATCH 02/60] Bump jacksonVersion from 2.19.0 to 2.19.1 (#691) Bumps `jacksonVersion` from 2.19.0 to 2.19.1. Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.19.0 to 2.19.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.19.0 to 2.19.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.19.0 to 2.19.1 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-version: 2.19.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.19.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.19.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f0be9f514..42dd58613 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ subprojects { } ext.reflectionsVersion = '0.10.2' - ext.jacksonVersion = '2.19.0' + ext.jacksonVersion = '2.19.1' java { From f2e883fcc7ba53a13fac6d0e32abe121eeb132a7 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Thu, 3 Jul 2025 16:06:50 +0200 Subject: [PATCH 03/60] Correctly flatten TemporalAmount (#692) --- .../archie/json/flat/FlatJsonGenerator.java | 4 ++-- .../json/flat/FlatJsonGeneratorTest.java | 19 +++++++++++++++++++ .../archie/datetime/DateTimeParserTest.java | 3 +++ .../DateTimeSerializerFormattersTest.java | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java index 06a2242dc..ef0f30dc7 100644 --- a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java +++ b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java @@ -293,8 +293,8 @@ private void addAttribute(Map result, String pathSoFar, OpenEHRB storeValue(result, newPath, DateTimeSerializerFormatters.ISO_8601_TIME.format(t)); } } else if (child instanceof TemporalAmount) { - //duration or period. now just a toString, should this be a specific formatter? - storeValue(result, newPath, child); + // Serialize using DateTimeSerializerFormatters.serializeDuration to correctly handle negative durations + storeValue(result, newPath, DateTimeSerializerFormatters.serializeDuration((TemporalAmount) child)); } else if(child instanceof byte[]) { storeValue(result, newPath, Base64.getEncoder().encodeToString((byte[]) child)); } else { diff --git a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java index bf1664362..ba6961ae0 100644 --- a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java +++ b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java @@ -18,15 +18,19 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia; import com.nedap.archie.rm.datavalues.quantity.DvCount; +import com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.rminfo.MetaModelProvider; import org.junit.After; import org.junit.Test; import org.openehr.referencemodels.BuiltinReferenceModels; +import org.threeten.extra.PeriodDuration; import java.io.IOException; import java.io.InputStream; +import java.time.Duration; +import java.time.Period; import java.util.LinkedHashMap; import java.util.Map; @@ -132,6 +136,21 @@ public void testNedapInternalFormat() throws Exception { assertEquals("Systolic", stringObjectMap.get("/data[id2]/events[id7,2]/data[id4]/items[id5,1]/name/value")); } + @Test + public void testDurationFlattening() throws Exception { + FlatJsonGenerator flatJsonGenerator = new FlatJsonGenerator(ArchieRMInfoLookup.getInstance(), FlatJsonFormatConfiguration.nedapInternalFormat()); + + // Test a positive duration, make sure the value is a String and not a Duration object + DvDuration duration = new DvDuration(PeriodDuration.of(Period.of(1,0,0), Duration.ofHours(13))); + Map pathsAndValues = flatJsonGenerator.buildPathsAndValues(duration); + assertEquals("P1YT13H", pathsAndValues.get("/value")); + + // Also test a negative duration + DvDuration negativeDuration = new DvDuration(PeriodDuration.of(Period.of(-1,-2,-4), Duration.ofSeconds(-5736))); + Map secondPathsAndValues = flatJsonGenerator.buildPathsAndValues(negativeDuration); + assertEquals("-P1Y2M4DT1H35M36S", secondPathsAndValues.get("/value")); + } + @Test public void continuesIndices() throws Exception { Cluster cluster = new Cluster(); diff --git a/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java b/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java index ae5b55de0..b2ab9e3d0 100644 --- a/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java +++ b/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java @@ -82,6 +82,9 @@ public void negativeDurations() { TemporalAmount minusOneYear2Hours = DateTimeParsers.parseDurationValue("-P1YT2H"); assertEquals(PeriodDuration.of(Period.of(-1 ,0, 0), Duration.of(-2, ChronoUnit.HOURS)), minusOneYear2Hours); + + TemporalAmount minusMultiplePeriodDuration = DateTimeParsers.parseDurationValue("-P1Y2M4DT1H35M36S"); + assertEquals(PeriodDuration.of(Period.of(-1,-2,-4), Duration.ofSeconds(-5736)), minusMultiplePeriodDuration); } } diff --git a/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java b/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java index 6c7cef698..24b2483d1 100644 --- a/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java +++ b/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java @@ -57,6 +57,7 @@ public void serializeNegativeDurations() { TemporalAmount minusOneYearOneHour = PeriodDuration.of(Period.of(-1 ,0, 0), Duration.of(-2, ChronoUnit.HOURS)); TemporalAmount minusTwoHoursPeriodDuration = PeriodDuration.of(Period.ZERO, Duration.of(-2, ChronoUnit.HOURS)); TemporalAmount minusOneYearPeriodDuration = PeriodDuration.of(Period.of(-1 ,0, 0), Duration.ZERO); + TemporalAmount minusMultiplePeriodDuration = PeriodDuration.of(Period.of(-1,-2,-4), Duration.ofSeconds(-5736)); assertEquals("-PT2S", DateTimeSerializerFormatters.serializeDuration(minusTwoSeconds)); assertEquals("-P2Y", DateTimeSerializerFormatters.serializeDuration(minusTwoYears)); @@ -64,6 +65,7 @@ public void serializeNegativeDurations() { assertEquals("-P1YT2H", DateTimeSerializerFormatters.serializeDuration(minusOneYearOneHour)); assertEquals("-PT2H", DateTimeSerializerFormatters.serializeDuration(minusTwoHoursPeriodDuration)); assertEquals("-P1Y", DateTimeSerializerFormatters.serializeDuration(minusOneYearPeriodDuration)); + assertEquals("-P1Y2M4DT1H35M36S", DateTimeSerializerFormatters.serializeDuration(minusMultiplePeriodDuration)); } From 3011de22c62e3930ae5277787e9c5e78106b5d29 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Thu, 3 Jul 2025 16:16:18 +0200 Subject: [PATCH 04/60] Update Archie to v3.15.0 (#693) --- README.md | 6 +++--- build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ef89bb0f..890ebee27 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can depend on parts of Archie, or the entire library at once. If you want th ```gradle dependencies { - compile 'com.nedap.healthcare.archie:archie-all:3.14.0' + compile 'com.nedap.healthcare.archie:archie-all:3.15.0' } ``` @@ -28,11 +28,11 @@ or if you use maven, in your pom.xml com.nedap.healthcare.archie archie-all - 3.14.0 + 3.15.0 ``` -If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.14.0 and com.nedap.healthcare.archie:referencemodels:3.14.0 instead +If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.15.0 and com.nedap.healthcare.archie:referencemodels:3.15.0 instead ## Build diff --git a/build.gradle b/build.gradle index 42dd58613..f457ccd47 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ wrapper { } allprojects { - version = '3.14.0' + version = '3.15.0' group = 'com.nedap.healthcare.archie' ext.gradleScriptDir = "${rootProject.projectDir}/gradle" //archivesBaseName = 'archie' From 29a0b0c214589a5f772b76e83a2a13386876ae4f Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Mon, 21 Jul 2025 12:55:37 +0200 Subject: [PATCH 05/60] Fix NullPointerException in FlatJsonGenerator.buildPathsAndValuesInner (#699) --- .../com/nedap/archie/json/flat/FlatJsonGenerator.java | 2 +- .../nedap/archie/json/flat/FlatJsonGeneratorTest.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java index ef0f30dc7..841f8293f 100644 --- a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java +++ b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java @@ -121,7 +121,7 @@ private void buildPathsAndValuesInner(Map result, RMTypeInfo rmA CAttribute cAttribute = cObject == null ? null : cObject.getAttribute(attributeName); RMAttributeInfo attributeInfo = typeInfo.getAttributes().get(attributeName); if(!attributeInfo.isComputed() && !isIgnored(typeInfo, attributeName) && attributeInfo.getGetMethod() != null) { - if(filterNames && cObject != null && isNameAttribute(typeInfo, attributeName)) { + if(filterNames && name != null && cObject != null && isNameAttribute(typeInfo, attributeName)) { ArchetypeTerm term = cObject.getTerm(); if(term != null && name.equals(term.getText())) { continue; diff --git a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java index ba6961ae0..2f7d24dce 100644 --- a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java +++ b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java @@ -34,6 +34,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import static junit.framework.Assert.assertTrue; import static junit.framework.TestCase.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -78,7 +79,15 @@ public void testBloodPressureExample() throws Exception { } + @Test + public void testBloodPressureEmpty() throws Exception { + OperationalTemplate bloodPressureOpt = parseBloodPressure(); + FlatJsonGenerator flatJsonGenerator = new FlatJsonGenerator(ArchieRMInfoLookup.getInstance(), FlatJsonFormatConfiguration.nedapInternalFormat()); + Map pathsAndValues = flatJsonGenerator.buildPathsAndValues(new Observation(), bloodPressureOpt, "en"); + + assertTrue(pathsAndValues.isEmpty()); + } @Test public void testBloodPressureExampleWithPipesForFinalFields() throws Exception { From 10fd6525b0c553a43d8e306e6ec1908318842b8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 13:14:44 +0200 Subject: [PATCH 06/60] Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0 (#695) Bumps org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.18.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f457ccd47..03c7e9dab 100644 --- a/build.gradle +++ b/build.gradle @@ -71,7 +71,7 @@ subprojects { exclude group: 'commons-logging', module: 'commons-logging' } implementation 'org.apache.commons:commons-text:1.13.1' - implementation 'org.apache.commons:commons-lang3:3.17.0' + implementation 'org.apache.commons:commons-lang3:3.18.0' //java 10 no longer has these included by default, so explicit dependency is needed. api 'javax.xml.bind:jaxb-api:2.3.1' From b3119e0547298a2d65af7b8c662a2dfe4431588b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 13:14:53 +0200 Subject: [PATCH 07/60] Bump jacksonVersion from 2.19.1 to 2.19.2 (#700) Bumps `jacksonVersion` from 2.19.1 to 2.19.2. Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.19.1 to 2.19.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.19.1 to 2.19.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.19.1 to 2.19.2 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-version: 2.19.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.19.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.19.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 03c7e9dab..407b58c52 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ subprojects { } ext.reflectionsVersion = '0.10.2' - ext.jacksonVersion = '2.19.1' + ext.jacksonVersion = '2.19.2' java { From 07c01117e9a963f3470d179943903f0eb6b8b941 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 13:15:01 +0200 Subject: [PATCH 08/60] Bump commons-io:commons-io from 2.19.0 to 2.20.0 (#701) Bumps [commons-io:commons-io](https://github.com/apache/commons-io) from 2.19.0 to 2.20.0. - [Changelog](https://github.com/apache/commons-io/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-io/compare/rel/commons-io-2.19.0...rel/commons-io-2.20.0) --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-version: 2.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 407b58c52..d885c2fc4 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,7 @@ subprojects { implementation "org.reflections:reflections:${reflectionsVersion}" implementation 'com.esotericsoftware.kryo:kryo5:5.6.2' - implementation('commons-io:commons-io:2.19.0'){ + implementation('commons-io:commons-io:2.20.0'){ exclude group: 'commons-logging', module: 'commons-logging' } implementation 'org.apache.commons:commons-text:1.13.1' From 84717b19b5bee6349b20bfb399980ca8a2e071ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:13:20 +0200 Subject: [PATCH 09/60] Bump org.apache.commons:commons-text from 1.13.1 to 1.14.0 (#703) Bumps [org.apache.commons:commons-text](https://github.com/apache/commons-text) from 1.13.1 to 1.14.0. - [Changelog](https://github.com/apache/commons-text/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-text/compare/rel/commons-text-1.13.1...rel/commons-text-1.14.0) --- updated-dependencies: - dependency-name: org.apache.commons:commons-text dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d885c2fc4..6ef0d897d 100644 --- a/build.gradle +++ b/build.gradle @@ -70,7 +70,7 @@ subprojects { implementation('commons-io:commons-io:2.20.0'){ exclude group: 'commons-logging', module: 'commons-logging' } - implementation 'org.apache.commons:commons-text:1.13.1' + implementation 'org.apache.commons:commons-text:1.14.0' implementation 'org.apache.commons:commons-lang3:3.18.0' //java 10 no longer has these included by default, so explicit dependency is needed. From 9cadbc533fcc864ce0f477289a0b12f179d8a667 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Fri, 8 Aug 2025 10:54:20 +0200 Subject: [PATCH 10/60] Update release configuration for central.sonatype (#694) --- build.gradle | 4 ++++ gradle/publish-maven.gradle | 21 ++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 6ef0d897d..882a3b156 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" +} + repositories { mavenCentral() } diff --git a/gradle/publish-maven.gradle b/gradle/publish-maven.gradle index 33a94ffa0..1306fac7b 100644 --- a/gradle/publish-maven.gradle +++ b/gradle/publish-maven.gradle @@ -8,25 +8,20 @@ if(gradle.ext.shouldSign) { } } } -//define the repositories on global level, not per project, or you get many of them -publishing { + +nexusPublishing { repositories { - maven { - name = "ossrh" - // OSSRH URLS - def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' - def snapshotsRepoUrl = 'ttps://oss.sonatype.org/content/repositories/snapshots/' - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration + sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) - credentials { - username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user" - password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password" - } + username = project.hasProperty("centralTokenUsername") ? centralTokenUsername : "Unknown username" + password = project.hasProperty("centralTokenPassword") ? centralTokenPassword : "Unknown password" } } } - //now uploading will have to be configured on a per subproject basis subprojects { From b554cb350f821f30676a77d9c1f6f80f7e134cd7 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Mon, 8 Sep 2025 11:16:07 +0200 Subject: [PATCH 11/60] Add GitHub Actions to Dependabot configuration (#713) --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 25474490e..caf73180b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,9 @@ updates: interval: daily time: "11:00" open-pull-requests-limit: 10 +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 From 33f986837bed7c3d9e9710f02b56a26a21da1a17 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Mon, 15 Sep 2025 16:10:51 +0200 Subject: [PATCH 12/60] Update Gradle to version 8.14.3 and fix deprecated features (#715) * Remove Gradle wrapper version from build.gradle * Update Gradle to version 8.14.3 * Use Toolchains for JVM projects to set Java version * Assign properties using the 'propName = value' syntax Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated. * Remove --add-opens arguments for tests The --add-opens arguments are not needed anymore since #443 and are causing issues with Toolchains on newer JVM versions. * Add Foojay Toolchains Plugin to automatically download JDK 8 if needed --- build.gradle | 26 ++++++----------------- gradle/jacoco.gradle | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 43764 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 10 +++++---- gradlew.bat | 6 ++++-- settings.gradle | 4 ++++ 7 files changed, 22 insertions(+), 28 deletions(-) diff --git a/build.gradle b/build.gradle index 882a3b156..347493351 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,6 @@ repositories { } -wrapper { - gradleVersion = '5.6.4' -} - allprojects { version = '3.15.0' group = 'com.nedap.healthcare.archie' @@ -38,15 +34,12 @@ subprojects { // id 'com.github.ben-manes.versions' version '0.13.0' // } - sourceCompatibility = '1.8' - targetCompatibility = '1.8' - compileJava.options.encoding = "UTF-8" compileTestJava.options.encoding = "UTF-8" repositories { mavenCentral() - maven { url 'https://jitpack.io' } + maven { url = 'https://jitpack.io' } } ext.reflectionsVersion = '0.10.2' @@ -54,6 +47,10 @@ subprojects { java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + withJavadocJar() withSourcesJar() } @@ -101,20 +98,9 @@ subprojects { test { - if(JavaVersion.current() != JavaVersion.VERSION_1_8) { - jvmArgs = ['--add-opens', 'java.base/java.lang=ALL-UNNAMED' - , '--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED' - , '--add-opens', 'java.base/java.net=ALL-UNNAMED' - , '--add-opens', 'java.base/java.nio=ALL-UNNAMED' - , '--add-opens', 'java.base/java.time=ALL-UNNAMED' - , '--add-opens', 'java.base/java.util=ALL-UNNAMED' - , '--add-opens', 'java.base/java.util.concurrent.atomic=ALL-UNNAMED' - , '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED' - , '--add-opens', 'java.base/sun.util.calendar=ALL-UNNAMED'] - } testLogging { events "failed" - exceptionFormat "full" + exceptionFormat = "full" } } diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle index 9c7a71049..9e7373cce 100644 --- a/gradle/jacoco.gradle +++ b/gradle/jacoco.gradle @@ -14,7 +14,7 @@ subprojects { test { testLogging { events "failed" - exceptionFormat "full" + exceptionFormat = "full" } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f3d4ba8a0da8d277868979cfbc8ad796..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch delta 35073 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 delta 34912 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

Gn4F+B~IivciU9^t0j-Mgao3 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 dDuazZG^u*-) zCV{{p$D*4m=Z;!QJ0C3EBfaUv#@3CmRgS-#a4+Uk9LtR(mzdSt-?*B-Q{Jgs!F;+_ zT&Jc~{N951OskjVtnWOLnfUacmSEkQ#fQojqa=HN?aN#ubFA){K&TrfoSnBphJ<43S zS5?OUrqPYpEqf;(zc;IIty0d`-n-Ke%PlArJt^DN>ZYW)ZS5z$Rnx=cxbM1#zPRNS1N0u>c z*gpBeTvyKAjdr#Uz%$J3C+p2~l9`-P6`=_1Y83#nAp`Kd5jfb*H#u;=%w#=&g~|Q% z1!N9S7n+#|tj#t98*^$X3S9)i3I*n?N+YghXJ9Z!QN%wvV7|W$;;Lx|1{)Ol%c4L- zlz|txtAK4ozLL`xMPZR7Sm6grRj@+Db&BXF9#sG|gMywm=IO1O01imHv3 zFjX9ri>su;HX}wK85k5$R0A&?fdtA5_Q_vX$jc(elo%M~QB>A-K~#2igOjH$d^80Z zC8#NjzZarXrcVZJJEF73z+ix4=7c`5N>TJt7>~rfl$^E}UAMlP2$P)vS26{cE?ONf_&Vd@-E2?PMU+S~pB diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4413138c..d4081da47 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf133..23d15a936 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -203,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 7101f8e46..5eed7ee84 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -68,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index 806003fdf..ba34972aa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,7 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0' +} + rootProject.name = 'archie' include 'base', 'aom', 'grammars', 'tools', 'odin', 'openehr-rm', 'archie-utils' From c8f059b8d940a289c72292ebeea600aec66ce897 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Tue, 16 Sep 2025 11:27:37 +0200 Subject: [PATCH 13/60] Use Gradle Version Catalog (#716) * Use Version Catalog for main build.gradle file * Use Version Catalog for grammars build.gradle file * Use Version Catalog for tools build.gradle file * Remove non-working exclusion of commons-logging commons-logging is not a dependency of commons-io, so this exclude does nothing. --- build.gradle | 48 +++++++++++++---------------------- gradle/libs.versions.toml | 53 +++++++++++++++++++++++++++++++++++++++ grammars/build.gradle | 6 ++--- tools/build.gradle | 4 +-- 4 files changed, 74 insertions(+), 37 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle b/build.gradle index 347493351..7c3b9e39c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id("io.github.gradle-nexus.publish-plugin") version "2.0.0" + alias(libs.plugins.nexus.publish) } repositories { @@ -30,10 +30,6 @@ apply from: "${gradleScriptDir}/publish-maven.gradle" subprojects { apply plugin: 'java-library' - // plugins { - // id 'com.github.ben-manes.versions' version '0.13.0' - // } - compileJava.options.encoding = "UTF-8" compileTestJava.options.encoding = "UTF-8" @@ -42,10 +38,6 @@ subprojects { maven { url = 'https://jitpack.io' } } - ext.reflectionsVersion = '0.10.2' - ext.jacksonVersion = '2.19.2' - - java { toolchain { languageVersion = JavaLanguageVersion.of(8) @@ -57,37 +49,31 @@ subprojects { dependencies { - api 'org.slf4j:slf4j-api:1.7.36' + api(libs.slf4j.api) - api "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}" - api "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" - api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}" + api(libs.bundles.jackson) - implementation 'com.google.guava:guava:33.4.8-jre' + implementation(libs.guava) - implementation "org.reflections:reflections:${reflectionsVersion}" - implementation 'com.esotericsoftware.kryo:kryo5:5.6.2' + implementation(libs.reflections) + implementation(libs.kryo) - implementation('commons-io:commons-io:2.20.0'){ - exclude group: 'commons-logging', module: 'commons-logging' - } - implementation 'org.apache.commons:commons-text:1.14.0' - implementation 'org.apache.commons:commons-lang3:3.18.0' + implementation(libs.commons.io) + implementation(libs.commons.text) + implementation(libs.commons.lang3) //java 10 no longer has these included by default, so explicit dependency is needed. - api 'javax.xml.bind:jaxb-api:2.3.1' - api 'com.sun.xml.bind:jaxb-core:2.3.0.1' - runtimeOnly 'com.sun.xml.bind:jaxb-impl:2.3.9' - api 'javax.activation:activation:1.1.1' - - api 'org.threeten:threeten-extra:1.8.0' - - testImplementation 'junit:junit:4.+' - testImplementation 'org.slf4j:slf4j-simple:1.7.36' + api(libs.jaxb.api) + api(libs.jaxb.core) + runtimeOnly(libs.jaxb.impl) + api(libs.activation) - api 'com.github.zafarkhaja:java-semver:0.10.2' + api(libs.threeten.extra) + testImplementation(libs.junit4) + testImplementation(libs.slf4j.simple) + api(libs.zafarkhaja.semver) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..e958d1d6f --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,53 @@ +[versions] +antlr = "4.13.2" + +jackson = "2.19.2" + +slf4j = "1.7.36" + +[plugins] +nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" } + +[bundles] +jackson = ["jackson-annotations", "jackson-databind", "jackson-datatype-jsr310"] + +[libraries] +activation = { module = "javax.activation:activation", version = "1.1.1" } + +antlr4 = { module = "org.antlr:antlr4", version.ref = "antlr" } +antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" } + +commons-io = { module = "commons-io:commons-io", version = "2.20.0" } + +commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.18.0" } + +commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" } + +guava = { module = "com.google.guava:guava", version = "33.4.8-jre" } + +jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" } +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } +jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" } + +jakarta-json = { module = "org.glassfish:jakarta.json", version = "2.0.1" } + +jaxb-api = { module = "javax.xml.bind:jaxb-api", version = "2.3.1" } + +jaxb-core = { module = "com.sun.xml.bind:jaxb-core", version = "2.3.0.1" } + +jaxb-impl = { module = "com.sun.xml.bind:jaxb-impl", version = "2.3.9" } + +junit4 = { module = "junit:junit", version = "4.+" } + +kryo = { module = "com.esotericsoftware.kryo:kryo5", version = "5.6.2" } + +leadpony-justify = { module = "org.leadpony.justify:justify", version = "3.1.0" } + +reflections = { module = "org.reflections:reflections", version = "0.10.2" } + +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } + +threeten-extra = { module = "org.threeten:threeten-extra", version = "1.8.0" } + +zafarkhaja-semver = { module = "com.github.zafarkhaja:java-semver", version = "0.10.2" } diff --git a/grammars/build.gradle b/grammars/build.gradle index dd44333be..fbe1f5185 100644 --- a/grammars/build.gradle +++ b/grammars/build.gradle @@ -1,8 +1,6 @@ description = "grammars for parsing ADL, ODIN and xpath" apply plugin: 'antlr' -ext.antlrVersion = '4.13.2' - generateGrammarSource { //antlr4 outputDirectory = new File("${project.buildDir}/generated-src/antlr/main/com/nedap/archie/adlparser/antlr".toString()) arguments = ['-visitor', '-package', 'com.nedap.archie.adlparser.antlr', '-encoding', 'utf-8'] + arguments @@ -18,6 +16,6 @@ classes { dependencies { - antlr "org.antlr:antlr4:${antlrVersion}" - api "org.antlr:antlr4-runtime:${antlrVersion}" + antlr(libs.antlr4) + api(libs.antlr4.runtime) } diff --git a/tools/build.gradle b/tools/build.gradle index 615f06c8a..69b9f1c73 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -14,6 +14,6 @@ dependencies { testImplementation project(':test-rm') testImplementation project(':referencemodels') - api 'org.leadpony.justify:justify:3.1.0' - api 'org.glassfish:jakarta.json:2.0.1:module' + api(libs.leadpony.justify) + api(variantOf(libs.jakarta.json) {classifier("module") }) } From 8566fd37c30006c2475ca20164f8ba6ac249cba2 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 18 Sep 2025 10:22:23 +0200 Subject: [PATCH 14/60] Don't include exception information in validation errors (#719) * Improve exception handling in ArchetypeValidator * Improve exception handling in RMObjectValidator --- i18n/po/i18n_en.po | 125 +++++++++--------- i18n/po/i18n_nl.po | 125 +++++++++--------- i18n/po/keys.pot | 125 +++++++++--------- .../ArchetypeValidator.java | 14 +- .../rmobjectvalidator/RMObjectValidator.java | 11 +- 5 files changed, 198 insertions(+), 202 deletions(-) diff --git a/i18n/po/i18n_en.po b/i18n/po/i18n_en.po index 40eb0a4b1..8e0c8d573 100644 --- a/i18n/po/i18n_en.po +++ b/i18n/po/i18n_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-11 10:35+0100\n" +"POT-Creation-Date: 2025-09-17 15:14+0200\n" "PO-Revision-Date: \n" "Last-Translator: Pieter Bos \n" "Language-Team: \n" @@ -65,12 +65,12 @@ msgstr "" msgid "An object with the new node id {0} cannot be prohibited" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:65 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:60 #, java-format msgid "Archetype referenced in use_archetype points to class {0}, which does not exist in this reference model" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:75 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:70 msgid "Archetype root must have an archetype reference or be prohibited (occurrences matches 0)" msgstr "" @@ -86,7 +86,7 @@ msgstr "" msgid "Archetype terminology not defined" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:54 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:49 #, java-format msgid "Archetype with id {0} used in use_archetype, but it was not found" msgstr "" @@ -136,13 +136,13 @@ msgstr "" msgid "Attribute {0} of class {1} does not match existence {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:70 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:82 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:63 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:75 #, java-format msgid "Attribute {0}.{1} cannot be constrained by a {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:48 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:41 #, java-format msgid "Attribute {0}.{1} cannot contain type {2}" msgstr "" @@ -190,7 +190,7 @@ msgstr "" msgid "Code {0} from the C_TERMINOLOGY_CODE constraint is not defined in the terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:161 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:164 #, java-format msgid "Code {0} is in the terminology, but not used in the archetype" msgstr "" @@ -242,30 +242,23 @@ msgstr "" msgid "Error" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:153 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:156 #, java-format msgid "Error in parent archetype. Fix those errors before continuing with this archetype: {0}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:130 -#, java-format -msgid "" -"Exception {0} invoking invariant {1} on {2}: {3}\n" -"{4}" -msgstr "" - -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:39 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:42 #, java-format msgid "Id code {0} in terminology is not a valid term code, should be id, ac or at, followed by digits" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:43 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:47 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:46 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:50 #, java-format msgid "Id code {0} in terminology is of a different specialization depth than the archetype" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:38 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:36 #, java-format msgid "In the attribute tuple {0} members were specified, but the primitive tuple has {1} members instead" msgstr "" @@ -275,7 +268,7 @@ msgstr "" msgid "Incorrect root node id {0}: it must match the specialization depth of the archetype, which is {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:125 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:168 #, java-format msgid "Invariant {0} failed on type " msgstr "" @@ -314,7 +307,7 @@ msgstr "" msgid "No Reference Model schema found for package ''{0}''" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CString.java:112 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CString.java:114 #, java-format msgid "No matching constraint found in parent for contraint {0}" msgstr "" @@ -328,7 +321,7 @@ msgstr "" msgid "Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:175 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:178 #, java-format msgid "Node id {0} already used in archetype as {1} with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4" msgstr "" @@ -338,7 +331,7 @@ msgstr "" msgid "Node id {0} already used in path {1}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:281 +#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:282 #, java-format msgid "Node id {0} does not conform to {1}" msgstr "" @@ -373,7 +366,7 @@ msgstr "" msgid "Object with node id {0} should be specialized before excluding the parent node" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:127 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:129 #, java-format msgid "Occurrences {0} does not conform to {1}" msgstr "" @@ -694,7 +687,7 @@ msgstr "" msgid "Sibling order {0} refers to missing node id" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:151 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:144 msgid "Single valued attributes can not have a cardinality" msgstr "" @@ -715,27 +708,27 @@ msgstr "" msgid "Syntax error: terminology not specified" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:199 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:202 #, java-format msgid "Template overlay {0} had validation errors" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:83 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:86 #, java-format msgid "Term binding key {0} in path format is not present in archetype" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:88 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:91 #, java-format msgid "Term binding key {0} is not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:88 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:91 #, java-format msgid "Term binding key {0} is not present in the terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:81 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:84 #, java-format msgid "Term binding key {0} points to a path that cannot be found in the archetype" msgstr "" @@ -758,7 +751,7 @@ msgstr "" msgid "The attribute cardinality interval has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:55 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:58 #, java-format msgid "The attribute contains {0} objects that are required, but only has an upper cardinality of {1}" msgstr "" @@ -768,12 +761,12 @@ msgstr "" msgid "The attribute {0} of type {1} can only have a single value, but the occurrences of the C_OBJECTS below has an upper limit of more than 1" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:135 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 #, java-format msgid "The cardinality of Attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict multiplicities validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:143 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 #, java-format msgid "The cardinality {0} of attribute {2}.{3} does not match cardinality {1} of the reference model" msgstr "" @@ -793,12 +786,12 @@ msgstr "" msgid "The constraint interval for this {0} has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:116 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:109 #, java-format msgid "The existence of attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict existence validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:124 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:117 #, java-format msgid "The existence {0} of attribute {2}.{3} does not match existence {1} of the reference model" msgstr "" @@ -816,7 +809,7 @@ msgstr "" msgid "The occurrences interval has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:52 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:55 #, java-format msgid "The occurrences of all C_OBJECTS under this attributes is at least {0}, which does not fit in the upper limit of the cardinality of the attribute, {1}" msgstr "" @@ -836,12 +829,12 @@ msgstr "" msgid "The path {0} referenced in the rm visibility does not exist in the flat archetype" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:134 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:136 #, java-format msgid "The primitive object of type {0} does not conform null" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:136 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:138 #, java-format msgid "The primitive object of type {0} does not conform to non-primitive object with type {1}" msgstr "" @@ -887,16 +880,21 @@ msgstr "" msgid "Translation details language {0} has an incorrect key: {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:32 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:30 #, java-format msgid "Tuple member attribute {0} is not an attribute of type {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:35 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:28 #, java-format msgid "Type name {0} does not exist" msgstr "" +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:173 +#, java-format +msgid "Unexpected error validating invariant {0} on {1}" +msgstr "" + #: ../bmm/src/main/java/org/openehr/bmm/persistence/validation/BmmMessageIds.java:54 #, java-format msgid "Unknown Reference Model ''{0}'' mentioned in ''rm_schemas_load_list'' config setting (ignored)" @@ -910,7 +908,7 @@ msgstr "" msgid "Unknown exception processing RM schemas" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:68 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:63 #, java-format msgid "Use_archetype points to type {0}, which is not conformant for type {1} of the archetype root used" msgstr "" @@ -931,21 +929,21 @@ msgstr "" msgid "Use_archetype {0} does not match the expression of the archetype slot it specialized in the parent" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:42 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:45 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) must point to a C_COMPLEX_OBJECT, but points to a {0}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:24 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:27 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to a path that cannot be found: {0}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:26 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:29 msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to a path that resolves to more than one object" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:36 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:39 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to type {0}, which does not conform to type {1}" msgstr "" @@ -1041,22 +1039,22 @@ msgstr "" msgid "cardinality/occurrences upper bound validity: where a cardinality with a finite upper bound is stated on an attribute, for all immediate child objects for which an occurrences constraint is stated, the occurrences must either have an open upper bound (i.e. n..*) which is interpreted as the maximum value allowed within the cardinality, or else a finite upper bound which is ⇐ the cardinality upper bound." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:234 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:235 #, java-format msgid "child CTerminology code contains more than one constraint, that is not valid. Constraints are: {0}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:279 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:280 #, java-format msgid "child terminology constraint value code {0} does not conform to parent constraint with value code {1}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:263 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:264 #, java-format msgid "child terminology constraint value code {0} is not contained in {1}, or a direct specialization of one of its values" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:259 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:260 #, java-format msgid "child terminology constraint value set code {0} does not conform to parent constraint with value set code {1}" msgstr "" @@ -1069,7 +1067,8 @@ msgstr "" msgid "constraint code validity. Each value set code (ac-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidation.java:59 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidator.java:60 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidation.java:71 msgid "empty" msgstr "" @@ -1136,7 +1135,7 @@ msgstr "" msgid "original language specified. An original_language section containing the meta-data of the original authoring language must exist." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:237 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:238 #, java-format msgid "parent CTerminology code contains more than one constraint, that is not valid. Constraints are: {0}" msgstr "" @@ -1217,7 +1216,7 @@ msgstr "" msgid "specialised object node occurrences validity: the sum of the lower occurrences and the sum of the upper occurrences of all objects redefining a node in a specialised archetype, must be contained in the occurrences interval of the corresponding node in the flat parent archetype." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:243 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:244 #, java-format msgid "specialized CTerminology code constraint status {0} is wider more than parent contraint status {1}" msgstr "" @@ -1238,8 +1237,8 @@ msgstr "" msgid "translations key does not match translations item language" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:130 -#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:284 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:132 +#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:285 #, java-format msgid "type name {0} does not conform to {1}" msgstr "" @@ -1260,13 +1259,13 @@ msgstr "" msgid "value code validity. Each value code (at-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the flattened form of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:140 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:143 #, java-format msgid "value code {0} is used in redefined value set {1}, but not present in its parent value set with members {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:118 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:122 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:121 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:125 #, java-format msgid "value code {0} is used in value set {1}, but not present in terminology" msgstr "" @@ -1275,18 +1274,18 @@ msgstr "" msgid "value set assumed value code validity. Each value code (at-code) used as an assumed_value for a value set in a term constraint in the archetype definition must exist in the value set definition in the terminology for the identified value set." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:103 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 #, java-format msgid "value set code {0} is not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:109 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:113 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:112 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:116 #, java-format msgid "value set code {0} is used in value set {1}, but not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:135 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:138 #, java-format msgid "value set {0} has a specialized code, but the valueset it specialized cannot be found in the flat parent" msgstr "" @@ -1308,7 +1307,7 @@ msgstr "" msgid "{0} and {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:106 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:99 #, java-format msgid "{0} is not a known attribute of {1}" msgstr "" diff --git a/i18n/po/i18n_nl.po b/i18n/po/i18n_nl.po index ddaffbefa..c1308e77b 100644 --- a/i18n/po/i18n_nl.po +++ b/i18n/po/i18n_nl.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-11 10:35+0100\n" +"POT-Creation-Date: 2025-09-17 15:14+0200\n" "PO-Revision-Date: \n" "Last-Translator: Pieter Bos \n" "Language-Team: \n" @@ -65,12 +65,12 @@ msgstr "Een archetype slot is gebruikt in het archetype, maar er is geen archety msgid "An object with the new node id {0} cannot be prohibited" msgstr "Een object met een nieuw node id {0} mag geen occurrences van maximaal 0 hebben" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:65 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:60 #, java-format msgid "Archetype referenced in use_archetype points to class {0}, which does not exist in this reference model" msgstr "Het archetype waarnaar use_archetype verwijst, verwijst naar klasse {0}. Deze klasse bestaat niet in het referentiemodel" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:75 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:70 msgid "Archetype root must have an archetype reference or be prohibited (occurrences matches 0)" msgstr "Use_archetype moet verwijzen naar een archetype, of beperkt zijn tot occurrences 0" @@ -86,7 +86,7 @@ msgstr "De terminologie van dit archetype bevat geen termdefinities" msgid "Archetype terminology not defined" msgstr "Archetype terminology ontbreekt" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:54 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:49 #, java-format msgid "Archetype with id {0} used in use_archetype, but it was not found" msgstr "Archetype met id {0} is gebruikt met use_archetype, maar het archetype kon niet worden gevonden" @@ -136,13 +136,13 @@ msgstr "Attribuut {0} is geen tuple in het archetype dat gespecializeerd wordt, msgid "Attribute {0} of class {1} does not match existence {2}" msgstr "Attribuut {0} van class {1} komt niet overeen met existence {2}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:70 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:82 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:63 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:75 #, java-format msgid "Attribute {0}.{1} cannot be constrained by a {2}" msgstr "Attribuut {0}.{1} kan niet worden beperkt met een {2}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:48 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:41 #, java-format msgid "Attribute {0}.{1} cannot contain type {2}" msgstr "Attribuut {0}.{1} mag geen type {2} bevatten" @@ -190,7 +190,7 @@ msgstr "Code {0} van de C_TERMINOLOGY_CODE heeft specialization depth {1}, maar msgid "Code {0} from the C_TERMINOLOGY_CODE constraint is not defined in the terminology" msgstr "Code {0} van deze C_TERMINOLOGY_CODE bestaat niet in de terminology" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:161 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:164 #, java-format msgid "Code {0} is in the terminology, but not used in the archetype" msgstr "Code {0} uit de terminologie is niet gebruikt in de definitie van het archetype" @@ -242,30 +242,23 @@ msgstr "" msgid "Error" msgstr "Fout" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:153 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:156 #, java-format msgid "Error in parent archetype. Fix those errors before continuing with this archetype: {0}" msgstr "Fout in het gespecialiseerde archetype. Los deze fout in het bovenliggende archetype eerst op, alvorens verder te gaan met dit archetype. De gevonden fouten: {0}" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:130 -#, java-format -msgid "" -"Exception {0} invoking invariant {1} on {2}: {3}\n" -"{4}" -msgstr "" - -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:39 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:42 #, java-format msgid "Id code {0} in terminology is not a valid term code, should be id, ac or at, followed by digits" msgstr "Id code {0} in de terminology is geen geldige term-code. De code zou moeten beginnen met id, ac of at, gevolgd door getallen" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:43 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:47 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:46 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:50 #, java-format msgid "Id code {0} in terminology is of a different specialization depth than the archetype" msgstr "Id code {0} uit de terminologie heeft een andere specialization depth dan het archetype" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:38 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:36 #, java-format msgid "In the attribute tuple {0} members were specified, but the primitive tuple has {1} members instead" msgstr "In het attribuut tupel zijn {0} members opgenomen, maar het primitive tuple heeft {1} members. Dit moet gelijk zijn" @@ -275,7 +268,7 @@ msgstr "In het attribuut tupel zijn {0} members opgenomen, maar het primitive tu msgid "Incorrect root node id {0}: it must match the specialization depth of the archetype, which is {1}" msgstr "Fout in root node id {0}: Dit moet kloppen met de specialization depth van het archetype, {1}" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:125 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:168 #, java-format msgid "Invariant {0} failed on type " msgstr "" @@ -314,7 +307,7 @@ msgstr "" msgid "No Reference Model schema found for package ''{0}''" msgstr "Geen referentiemodel-schema gevonden voor package “{0}”" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CString.java:112 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CString.java:114 #, java-format msgid "No matching constraint found in parent for contraint {0}" msgstr "" @@ -328,7 +321,7 @@ msgstr "De specialization depth van node id {0} klopt niet bij de specialization msgid "Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4" msgstr "Node id nummers moeten uniek zijn zonder hun ac, at of id-prefix, om conversie van het archetype naar ADL 1.4 mogelijk te maken" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:175 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:178 #, java-format msgid "Node id {0} already used in archetype as {1} with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4" msgstr "Node id {0} wordt al gebruikt in het archetype als {1} met een andere at, id of ac prefix. Het archetype kan niet naar ADL 1.4 geconverteerd worden" @@ -338,7 +331,7 @@ msgstr "Node id {0} wordt al gebruikt in het archetype als {1} met een andere at msgid "Node id {0} already used in path {1}" msgstr "Node id {0} is al gebruikt in pad {1}" -#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:281 +#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:282 #, java-format msgid "Node id {0} does not conform to {1}" msgstr "Node id {0} komt niet overeen met {1}" @@ -373,7 +366,7 @@ msgstr "Object moet van type {0} zijn, maar is van type {1}" msgid "Object with node id {0} should be specialized before excluding the parent node" msgstr "Object met node id {0} moet gespecialiseerd worden voordat de parent node excluded wordt" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:127 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:129 #, java-format msgid "Occurrences {0} does not conform to {1}" msgstr "Occurrences {0} komt niet overeen met {1}" @@ -694,7 +687,7 @@ msgstr "" msgid "Sibling order {0} refers to missing node id" msgstr "Sibling order {0} verwijst naar een ontbrekende node id" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:151 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:144 msgid "Single valued attributes can not have a cardinality" msgstr "Attributen die maar één waarde kunnen bevatten mogen geen cardinaliteit hebben" @@ -715,27 +708,27 @@ msgstr "Syntaxfout: existence moet een van 0..0, 0..1 of 1..1 zijn, maar was {0} msgid "Syntax error: terminology not specified" msgstr "Syntaxfout: terminologie ontbreekt" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:199 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:202 #, java-format msgid "Template overlay {0} had validation errors" msgstr "Template overlay {0} heeft validatiefouten" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:83 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:86 #, java-format msgid "Term binding key {0} in path format is not present in archetype" msgstr "Het pad {0} uit een term binding kan niet worden gevonden in het archetype" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:88 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:91 #, java-format msgid "Term binding key {0} is not present in terminology" msgstr "De code {0} van een term binding bestaat niet in de terminologie" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:88 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:91 #, java-format msgid "Term binding key {0} is not present in the terminology" msgstr "De code {0} van een term binding bestaat niet in de terminologie" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:81 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:84 #, java-format msgid "Term binding key {0} points to a path that cannot be found in the archetype" msgstr "Het pad {0} uit een term binding kan niet worden gevonden in het archetype" @@ -758,7 +751,7 @@ msgstr "Het archetype id {0} komt niet overeen met de mogelijke archetype ids" msgid "The attribute cardinality interval has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:55 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:58 #, java-format msgid "The attribute contains {0} objects that are required, but only has an upper cardinality of {1}" msgstr "Het attribuut bevat {0} waarden die verplicht zijn, maar heeft een maximale cardinaliteit van {1}" @@ -768,12 +761,12 @@ msgstr "Het attribuut bevat {0} waarden die verplicht zijn, maar heeft een maxim msgid "The attribute {0} of type {1} can only have a single value, but the occurrences of the C_OBJECTS below has an upper limit of more than 1" msgstr "Het attribuut {0} van type {1} kan maar één waarde hebben, maar de occurrences van de C_OBJECTS in dit attibuut heeft een maximale limiet van meer dan 1" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:135 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 #, java-format msgid "The cardinality of Attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict multiplicities validation being enabled" msgstr "De cardinaliteit van attribuut {0}.{1} is hetzelfde als in het referentiemodel. Dit is niet toegestaan als strikte validatie is ingeschakeld" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:143 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 #, java-format msgid "The cardinality {0} of attribute {2}.{3} does not match cardinality {1} of the reference model" msgstr "De cardinaliteit {0} van attribuut {2}.{3} klopt niet met de cardinaliteit {1} uit het referentiemodel" @@ -793,12 +786,12 @@ msgstr "" msgid "The constraint interval for this {0} has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:116 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:109 #, java-format msgid "The existence of attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict existence validation being enabled" msgstr "De existence van attribuut {0}.{1} is hetzelfde als in het referentiemodel. Dit is niet toegestaan als strikte validatie ingeschakeld is" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:124 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:117 #, java-format msgid "The existence {0} of attribute {2}.{3} does not match existence {1} of the reference model" msgstr "De existence {0} van attribuut {2}.{3} klopt niet bij existence {1} van het referentiemodel" @@ -816,7 +809,7 @@ msgstr "De node id van het bovenste object van het archetype moet van de form id msgid "The occurrences interval has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:52 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:55 #, java-format msgid "The occurrences of all C_OBJECTS under this attributes is at least {0}, which does not fit in the upper limit of the cardinality of the attribute, {1}" msgstr "De occurrences van alle C_OBJECTS onder dit attribuut is ten minste {0}. Dat past niet in de maximale cardinaliteit van het attibruut {1}" @@ -836,12 +829,12 @@ msgstr "Het pad {0} gebruikt in de annotations bestaat niet in het flattened arc msgid "The path {0} referenced in the rm visibility does not exist in the flat archetype" msgstr "Het pad {0} gebruikt in de rm zichtbaarheid bestaat niet in het flattened archetype" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:134 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:136 #, java-format msgid "The primitive object of type {0} does not conform null" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:136 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:138 #, java-format msgid "The primitive object of type {0} does not conform to non-primitive object with type {1}" msgstr "Het primitieve object van type {0} komt niet overeen met het niet-primitieve object met type {1}" @@ -887,16 +880,21 @@ msgstr "De waarde {0} moet {1} zijn" msgid "Translation details language {0} has an incorrect key: {1}" msgstr "De beschrijving van de vertaling {0} zou een gelijke sleutelwaarde als de taal moeten hebben, maar heeft de waarde {1}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:32 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:30 #, java-format msgid "Tuple member attribute {0} is not an attribute of type {1}" msgstr "Onderdeel van tupel {0} is geen attribuut van type {1}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:35 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:28 #, java-format msgid "Type name {0} does not exist" msgstr "Type met naam {0} bestaat niet" +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:173 +#, fuzzy, java-format +msgid "Unexpected error validating invariant {0} on {1}" +msgstr "Onverwachte fout bij het valideren van invariant {0} van {1}" + #: ../bmm/src/main/java/org/openehr/bmm/persistence/validation/BmmMessageIds.java:54 #, java-format msgid "Unknown Reference Model ''{0}'' mentioned in ''rm_schemas_load_list'' config setting (ignored)" @@ -910,7 +908,7 @@ msgstr "" msgid "Unknown exception processing RM schemas" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:68 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:63 #, java-format msgid "Use_archetype points to type {0}, which is not conformant for type {1} of the archetype root used" msgstr "Use_archetype verwijst naar een pad met type {0}. Dit komt niet overeen met type {1} zoals opgegeven in use_archetype" @@ -931,21 +929,21 @@ msgstr "Use_archetype {1} specialiseert een andere use_archetype die verwijst na msgid "Use_archetype {0} does not match the expression of the archetype slot it specialized in the parent" msgstr "Use_archetype {0} komt niet overeen met de restricties van het archetype slot dat het specialiseert" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:42 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:45 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) must point to a C_COMPLEX_OBJECT, but points to a {0}" msgstr "Use_node, hergebruik van een deel van het archetype, moet naar een C_COMPLEX_OBJECT verwijzen, maar verwijst naar een {0}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:24 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:27 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to a path that cannot be found: {0}" msgstr "Use_node, hergebruik van een deel van het archetype, verwijst naar een pad dat niet kan worden gevonden: {0}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:26 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:29 msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to a path that resolves to more than one object" msgstr "Use_node, hergebruik van een deel van het archetype, verwijst naar een pad dat verwijst naar meer dan één object" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:36 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:39 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to type {0}, which does not conform to type {1}" msgstr "Use_node, hergebruik van een deel van het archetype, verwijst naar type {0}, maar dat klopt niet met type {1} zoals gevonden uit het pad" @@ -1041,22 +1039,22 @@ msgstr "" msgid "cardinality/occurrences upper bound validity: where a cardinality with a finite upper bound is stated on an attribute, for all immediate child objects for which an occurrences constraint is stated, the occurrences must either have an open upper bound (i.e. n..*) which is interpreted as the maximum value allowed within the cardinality, or else a finite upper bound which is ⇐ the cardinality upper bound." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:234 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:235 #, java-format msgid "child CTerminology code contains more than one constraint, that is not valid. Constraints are: {0}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:279 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:280 #, java-format msgid "child terminology constraint value code {0} does not conform to parent constraint with value code {1}" msgstr "child terminology constraint value code {0} komt niet overeen met dat van de parent constraint met value code {1}" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:263 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:264 #, java-format msgid "child terminology constraint value code {0} is not contained in {1}, or a direct specialization of one of its values" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:259 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:260 #, java-format msgid "child terminology constraint value set code {0} does not conform to parent constraint with value set code {1}" msgstr "child terminology constraint value set code {0} komt niet overeen de parent constraint met value set code {1}" @@ -1069,7 +1067,8 @@ msgstr "code uit terminologie is niet gebruikt in de definitie van het archetype msgid "constraint code validity. Each value set code (ac-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidation.java:59 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidator.java:60 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidation.java:71 msgid "empty" msgstr "leeg" @@ -1136,7 +1135,7 @@ msgstr "" msgid "original language specified. An original_language section containing the meta-data of the original authoring language must exist." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:237 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:238 #, java-format msgid "parent CTerminology code contains more than one constraint, that is not valid. Constraints are: {0}" msgstr "" @@ -1217,7 +1216,7 @@ msgstr "" msgid "specialised object node occurrences validity: the sum of the lower occurrences and the sum of the upper occurrences of all objects redefining a node in a specialised archetype, must be contained in the occurrences interval of the corresponding node in the flat parent archetype." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:243 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:244 #, java-format msgid "specialized CTerminology code constraint status {0} is wider more than parent contraint status {1}" msgstr "" @@ -1238,8 +1237,8 @@ msgstr "de gegeven id code is niet geldig" msgid "translations key does not match translations item language" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:130 -#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:284 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:132 +#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:285 #, java-format msgid "type name {0} does not conform to {1}" msgstr "Naam type {0} komt niet overeen met {1}" @@ -1260,13 +1259,13 @@ msgstr "" msgid "value code validity. Each value code (at-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the flattened form of the current archetype." msgstr "Geldigheid van een value code. Elke value code (at-code) gebruikt in een term constraint in de definitie van het archetype moet in de term definities van de flat form van dit archetype opgenomen zijn." -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:140 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:143 #, java-format msgid "value code {0} is used in redefined value set {1}, but not present in its parent value set with members {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:118 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:122 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:121 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:125 #, java-format msgid "value code {0} is used in value set {1}, but not present in terminology" msgstr "de code {0} is gebruikt in value set {1}, maar bestaat niet in de terminologie" @@ -1275,18 +1274,18 @@ msgstr "de code {0} is gebruikt in value set {1}, maar bestaat niet in de termin msgid "value set assumed value code validity. Each value code (at-code) used as an assumed_value for a value set in a term constraint in the archetype definition must exist in the value set definition in the terminology for the identified value set." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:103 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 #, java-format msgid "value set code {0} is not present in terminology" msgstr "de code {0} van een value set bestaat niet in de terminologie" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:109 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:113 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:112 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:116 #, java-format msgid "value set code {0} is used in value set {1}, but not present in terminology" msgstr "de value set code {0} is gebruikt in value set {1}, maar bestaat niet in de terminologie" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:135 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:138 #, java-format msgid "value set {0} has a specialized code, but the valueset it specialized cannot be found in the flat parent" msgstr "" @@ -1308,7 +1307,7 @@ msgstr "value-set waardes uniek. Elke waarde mag maar één keer gebruikt worden msgid "{0} and {1}" msgstr "{0} en {1}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:106 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:99 #, java-format msgid "{0} is not a known attribute of {1}" msgstr "{0} is niet een bekend attribuut van {1}" diff --git a/i18n/po/keys.pot b/i18n/po/keys.pot index 82b49724b..5ca873152 100644 --- a/i18n/po/keys.pot +++ b/i18n/po/keys.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-14 13:44+0100\n" +"POT-Creation-Date: 2025-09-17 15:14+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,12 +70,12 @@ msgstr "" msgid "An object with the new node id {0} cannot be prohibited" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:65 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:60 #, java-format msgid "Archetype referenced in use_archetype points to class {0}, which does not exist in this reference model" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:75 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:70 msgid "Archetype root must have an archetype reference or be prohibited (occurrences matches 0)" msgstr "" @@ -91,7 +91,7 @@ msgstr "" msgid "Archetype terminology not defined" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:54 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:49 #, java-format msgid "Archetype with id {0} used in use_archetype, but it was not found" msgstr "" @@ -141,13 +141,13 @@ msgstr "" msgid "Attribute {0} of class {1} does not match existence {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:70 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:82 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:63 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:75 #, java-format msgid "Attribute {0}.{1} cannot be constrained by a {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:48 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:41 #, java-format msgid "Attribute {0}.{1} cannot contain type {2}" msgstr "" @@ -195,7 +195,7 @@ msgstr "" msgid "Code {0} from the C_TERMINOLOGY_CODE constraint is not defined in the terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:161 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:164 #, java-format msgid "Code {0} is in the terminology, but not used in the archetype" msgstr "" @@ -247,30 +247,23 @@ msgstr "" msgid "Error" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:153 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:156 #, java-format msgid "Error in parent archetype. Fix those errors before continuing with this archetype: {0}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:130 -#, java-format -msgid "" -"Exception {0} invoking invariant {1} on {2}: {3}\n" -"{4}" -msgstr "" - -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:39 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:42 #, java-format msgid "Id code {0} in terminology is not a valid term code, should be id, ac or at, followed by digits" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:43 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:47 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:46 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:50 #, java-format msgid "Id code {0} in terminology is of a different specialization depth than the archetype" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:38 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:36 #, java-format msgid "In the attribute tuple {0} members were specified, but the primitive tuple has {1} members instead" msgstr "" @@ -280,7 +273,7 @@ msgstr "" msgid "Incorrect root node id {0}: it must match the specialization depth of the archetype, which is {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:125 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:168 #, java-format msgid "Invariant {0} failed on type " msgstr "" @@ -319,7 +312,7 @@ msgstr "" msgid "No Reference Model schema found for package ''{0}''" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CString.java:112 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CString.java:114 #, java-format msgid "No matching constraint found in parent for contraint {0}" msgstr "" @@ -333,7 +326,7 @@ msgstr "" msgid "Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:175 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:178 #, java-format msgid "Node id {0} already used in archetype as {1} with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4" msgstr "" @@ -343,7 +336,7 @@ msgstr "" msgid "Node id {0} already used in path {1}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:281 +#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:282 #, java-format msgid "Node id {0} does not conform to {1}" msgstr "" @@ -378,7 +371,7 @@ msgstr "" msgid "Object with node id {0} should be specialized before excluding the parent node" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:127 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:129 #, java-format msgid "Occurrences {0} does not conform to {1}" msgstr "" @@ -699,7 +692,7 @@ msgstr "" msgid "Sibling order {0} refers to missing node id" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:151 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:144 msgid "Single valued attributes can not have a cardinality" msgstr "" @@ -720,27 +713,27 @@ msgstr "" msgid "Syntax error: terminology not specified" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:199 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java:202 #, java-format msgid "Template overlay {0} had validation errors" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:83 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:86 #, java-format msgid "Term binding key {0} in path format is not present in archetype" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:88 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:91 #, java-format msgid "Term binding key {0} is not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:88 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:91 #, java-format msgid "Term binding key {0} is not present in the terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:81 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:84 #, java-format msgid "Term binding key {0} points to a path that cannot be found in the archetype" msgstr "" @@ -763,7 +756,7 @@ msgstr "" msgid "The attribute cardinality interval has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:55 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:58 #, java-format msgid "The attribute contains {0} objects that are required, but only has an upper cardinality of {1}" msgstr "" @@ -773,12 +766,12 @@ msgstr "" msgid "The attribute {0} of type {1} can only have a single value, but the occurrences of the C_OBJECTS below has an upper limit of more than 1" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:135 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 #, java-format msgid "The cardinality of Attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict multiplicities validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:143 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 #, java-format msgid "The cardinality {0} of attribute {2}.{3} does not match cardinality {1} of the reference model" msgstr "" @@ -798,12 +791,12 @@ msgstr "" msgid "The constraint interval for this {0} has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:116 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:109 #, java-format msgid "The existence of attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict existence validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:124 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:117 #, java-format msgid "The existence {0} of attribute {2}.{3} does not match existence {1} of the reference model" msgstr "" @@ -821,7 +814,7 @@ msgstr "" msgid "The occurrences interval has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:52 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:55 #, java-format msgid "The occurrences of all C_OBJECTS under this attributes is at least {0}, which does not fit in the upper limit of the cardinality of the attribute, {1}" msgstr "" @@ -841,12 +834,12 @@ msgstr "" msgid "The path {0} referenced in the rm visibility does not exist in the flat archetype" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:134 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:136 #, java-format msgid "The primitive object of type {0} does not conform null" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:136 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:138 #, java-format msgid "The primitive object of type {0} does not conform to non-primitive object with type {1}" msgstr "" @@ -892,16 +885,21 @@ msgstr "" msgid "Translation details language {0} has an incorrect key: {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:32 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/AttributeTupleValidation.java:30 #, java-format msgid "Tuple member attribute {0} is not an attribute of type {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:35 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:28 #, java-format msgid "Type name {0} does not exist" msgstr "" +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java:173 +#, java-format +msgid "Unexpected error validating invariant {0} on {1}" +msgstr "" + #: ../bmm/src/main/java/org/openehr/bmm/persistence/validation/BmmMessageIds.java:54 #, java-format msgid "Unknown Reference Model ''{0}'' mentioned in ''rm_schemas_load_list'' config setting (ignored)" @@ -915,7 +913,7 @@ msgstr "" msgid "Unknown exception processing RM schemas" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:68 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/VariousStructureValidation.java:63 #, java-format msgid "Use_archetype points to type {0}, which is not conformant for type {1} of the archetype root used" msgstr "" @@ -936,21 +934,21 @@ msgstr "" msgid "Use_archetype {0} does not match the expression of the archetype slot it specialized in the parent" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:42 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:45 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) must point to a C_COMPLEX_OBJECT, but points to a {0}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:24 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:27 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to a path that cannot be found: {0}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:26 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:29 msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to a path that resolves to more than one object" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:36 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/FlatFormValidation.java:39 #, java-format msgid "Use_node (C_COMPLEX_OBJECT_PROXY) points to type {0}, which does not conform to type {1}" msgstr "" @@ -1046,22 +1044,22 @@ msgstr "" msgid "cardinality/occurrences upper bound validity: where a cardinality with a finite upper bound is stated on an attribute, for all immediate child objects for which an occurrences constraint is stated, the occurrences must either have an open upper bound (i.e. n..*) which is interpreted as the maximum value allowed within the cardinality, or else a finite upper bound which is ⇐ the cardinality upper bound." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:234 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:235 #, java-format msgid "child CTerminology code contains more than one constraint, that is not valid. Constraints are: {0}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:279 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:280 #, java-format msgid "child terminology constraint value code {0} does not conform to parent constraint with value code {1}" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:263 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:264 #, java-format msgid "child terminology constraint value code {0} is not contained in {1}, or a direct specialization of one of its values" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:259 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:260 #, java-format msgid "child terminology constraint value set code {0} does not conform to parent constraint with value set code {1}" msgstr "" @@ -1074,7 +1072,8 @@ msgstr "" msgid "constraint code validity. Each value set code (ac-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidation.java:59 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidator.java:60 +#: ../tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidation.java:71 msgid "empty" msgstr "" @@ -1141,7 +1140,7 @@ msgstr "" msgid "original language specified. An original_language section containing the meta-data of the original authoring language must exist." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:237 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:238 #, java-format msgid "parent CTerminology code contains more than one constraint, that is not valid. Constraints are: {0}" msgstr "" @@ -1222,7 +1221,7 @@ msgstr "" msgid "specialised object node occurrences validity: the sum of the lower occurrences and the sum of the upper occurrences of all objects redefining a node in a specialised archetype, must be contained in the occurrences interval of the corresponding node in the flat parent archetype." msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:243 +#: ../aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java:244 #, java-format msgid "specialized CTerminology code constraint status {0} is wider more than parent contraint status {1}" msgstr "" @@ -1243,8 +1242,8 @@ msgstr "" msgid "translations key does not match translations item language" msgstr "" -#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:130 -#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:284 +#: ../aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java:132 +#: ../aom/src/main/java/com/nedap/archie/aom/CObject.java:285 #, java-format msgid "type name {0} does not conform to {1}" msgstr "" @@ -1265,13 +1264,13 @@ msgstr "" msgid "value code validity. Each value code (at-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the flattened form of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:140 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:143 #, java-format msgid "value code {0} is used in redefined value set {1}, but not present in its parent value set with members {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:118 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:122 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:121 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:125 #, java-format msgid "value code {0} is used in value set {1}, but not present in terminology" msgstr "" @@ -1280,18 +1279,18 @@ msgstr "" msgid "value set assumed value code validity. Each value code (at-code) used as an assumed_value for a value set in a term constraint in the archetype definition must exist in the value set definition in the terminology for the identified value set." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:103 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 #, java-format msgid "value set code {0} is not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:109 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:113 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:112 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:116 #, java-format msgid "value set code {0} is used in value set {1}, but not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:135 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:138 #, java-format msgid "value set {0} has a specialized code, but the valueset it specialized cannot be found in the flat parent" msgstr "" @@ -1313,7 +1312,7 @@ msgstr "" msgid "{0} and {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:106 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:99 #, java-format msgid "{0} is not a known attribute of {1}" msgstr "" diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java index 0336d9321..cd6f1997a 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/ArchetypeValidator.java @@ -1,6 +1,5 @@ package com.nedap.archie.archetypevalidator; -import com.google.common.base.Joiner; import com.nedap.archie.adlparser.modelconstraints.ReflectionConstraintImposer; import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.OperationalTemplate; @@ -215,17 +214,18 @@ public ValidationResult validate(Archetype archetype, FullArchetypeRepository re } catch (Exception e) { //this is probably an error in an included archetype, so ignore it here //the other archetype will not validate - ValidationMessage message = new ValidationMessage(ErrorType.OTHER, null, "Error during Operational template creation. This does not necessarily mean the current archetype has a problem, but perhaps one that is included with use_archetype: " + e); + ValidationMessage message = new ValidationMessage(ErrorType.OTHER, null, "Error during operational template creation. This does not necessarily mean the current archetype has a problem, but perhaps one that is included with use_archetype."); message.setWarning(true); messages.add(message); + logger.debug("Error during operational template creation", e); } result.setFlattened(flattened); if(result.passes()) { messages.addAll(runValidations(metaModel, flattened, repository, settings, flatParent, validationsPhase3)); } } catch (Exception e) { - messages.add(new ValidationMessage(ErrorType.OTHER, null, "flattening failed with exception " + e)); - logger.error("error during validation", e); + messages.add(new ValidationMessage(ErrorType.OTHER, null, "Unexpected error during flattening")); + logger.error("Unexpected error during flattening", e); } } @@ -246,10 +246,8 @@ private List runValidations(MetaModel metaModel, Archetype ar try { messages.addAll(validation.validate(metaModel, archetype, flatParent, repository, settings)); } catch (Exception e) { - logger.error("error running validation processor", e); - e.printStackTrace(); - messages.add(new ValidationMessage(ErrorType.OTHER, null, "error running validator : " + e.getClass().getSimpleName() + - Joiner.on("\n").join(e.getStackTrace()))); + logger.error("Unexpected error running validation processor", e); + messages.add(new ValidationMessage(ErrorType.OTHER, null, "Unexpected error running validation processor")); } } return messages; diff --git a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java index 230501039..e34e4737f 100644 --- a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java +++ b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RMObjectValidator.java @@ -13,6 +13,8 @@ import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.rminfo.RMTypeInfo; import org.openehr.utils.message.I18n; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -26,6 +28,7 @@ * Created by pieter.bos on 15/02/16. */ public class RMObjectValidator extends RMObjectValidatingProcessor { + private static final Logger logger = LoggerFactory.getLogger(RMObjectValidator.class); private final MetaModel metaModel; private final OperationalTemplateProvider operationalTemplateProvider; @@ -167,13 +170,11 @@ private List validateInvariants(RMObjectWithPath obje } } catch (IllegalAccessException | InvocationTargetException e) { result.add(new RMObjectValidationMessage(null, joinPaths(pathSoFar, objectWithPath.getPath()), - I18n.t("Exception {0} invoking invariant {1} on {2}: {3}\n{4}", - e.getCause() == null ? e.getClass().getSimpleName() : e.getCause().getClass().getSimpleName(), + I18n.t("Unexpected error validating invariant {0} on {1}", invariantMethod.getAnnotation().value(), - typeInfo.getRmName(), - e.getCause() == null ? e.getMessage() : e.getCause().getMessage(), - Joiner.on("\n\t").join(e.getStackTrace())), + typeInfo.getRmName()), RMObjectValidationMessageType.EXCEPTION)); + logger.error("Unexpected error validating invariant {} on {}", invariantMethod.getAnnotation().value(), typeInfo.getRmName(), e); } } } From 828713d0cbafa959435bccbcd3278237d4989324 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Mon, 22 Sep 2025 13:02:19 +0200 Subject: [PATCH 15/60] Reformat Gradle files (#721) * Reformat Gradle files * Fix missing imports * Fix comments * Have a single newline at the end of each Gradle file --- adlchecker/build.gradle | 2 +- aom/build.gradle | 14 ++-- archie-utils/build.gradle | 8 +-- base/build.gradle | 6 +- bmm/build.gradle | 12 ++-- build.gradle | 102 ++++++++++++++--------------- gradle/jacoco.gradle | 57 ++++++++-------- gradle/publish-maven.gradle | 122 +++++++++++++++++------------------ grammars/build.gradle | 10 +-- json-schema/build.gradle | 28 ++++---- odin/build.gradle | 6 +- openehr-rm/build.gradle | 13 ++-- path-queries/build.gradle | 12 ++-- referencemodels/build.gradle | 14 ++-- test-rm/build.gradle | 15 +++-- tools/build.gradle | 28 ++++---- utils/build.gradle | 4 +- 17 files changed, 225 insertions(+), 228 deletions(-) diff --git a/adlchecker/build.gradle b/adlchecker/build.gradle index ef07c4738..d6f0e1815 100644 --- a/adlchecker/build.gradle +++ b/adlchecker/build.gradle @@ -15,4 +15,4 @@ run { args = ['archetypes', '--lint']//, '--outputFlat'] } -mainClassName='com.nedap.archie.adlchecker.AdlChecker' +mainClassName = 'com.nedap.archie.adlchecker.AdlChecker' diff --git a/aom/build.gradle b/aom/build.gradle index 2de9ebe81..675fb909f 100644 --- a/aom/build.gradle +++ b/aom/build.gradle @@ -1,10 +1,10 @@ description = "An OpenEHR archetype object model implementation, plus parser" dependencies { - api project(':grammars') - api project(':base') - api project(':odin') - api project(':utils') - api project(':bmm') - api project(':openehr-terminology') -} \ No newline at end of file + api project(':grammars') + api project(':base') + api project(':odin') + api project(':utils') + api project(':bmm') + api project(':openehr-terminology') +} diff --git a/archie-utils/build.gradle b/archie-utils/build.gradle index 64817f40d..99f013084 100644 --- a/archie-utils/build.gradle +++ b/archie-utils/build.gradle @@ -1,7 +1,7 @@ description = "Utils for the Archie OpenEHR library" dependencies { - api project(':base') - api project(':aom') - api project(':openehr-rm') -} \ No newline at end of file + api project(':base') + api project(':aom') + api project(':openehr-rm') +} diff --git a/base/build.gradle b/base/build.gradle index db69568f7..4c72910bb 100644 --- a/base/build.gradle +++ b/base/build.gradle @@ -1,6 +1,6 @@ description = "Base classes for an OpenEHR implementation" dependencies { - //only for the xpath grammar. perhaps include it here? - api project(':grammars') -} \ No newline at end of file + //only for the xpath grammar. perhaps include it here? + api project(':grammars') +} diff --git a/bmm/build.gradle b/bmm/build.gradle index 91063ab94..991adac95 100644 --- a/bmm/build.gradle +++ b/bmm/build.gradle @@ -1,8 +1,8 @@ - description = "A basic metadata model implementation" +description = "A basic metadata model implementation" dependencies { - api project(':base') - api project(':utils') - api project(':odin') - testImplementation project(':i18n') -} \ No newline at end of file + api project(':base') + api project(':utils') + api project(':odin') + testImplementation project(':i18n') +} diff --git a/build.gradle b/build.gradle index 7c3b9e39c..c02ab8097 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,21 @@ plugins { - alias(libs.plugins.nexus.publish) + alias(libs.plugins.nexus.publish) } repositories { - mavenCentral() + mavenCentral() } allprojects { - version = '3.15.0' - group = 'com.nedap.healthcare.archie' - ext.gradleScriptDir = "${rootProject.projectDir}/gradle" - //archivesBaseName = 'archie' - - tasks.withType(Javadoc) { - options.addStringOption('Xdoclint:all', '-quiet') - } + version = '3.15.0' + group = 'com.nedap.healthcare.archie' + ext.gradleScriptDir = "${rootProject.projectDir}/gradle" + //archivesBaseName = 'archie' + + tasks.withType(Javadoc) { + options.addStringOption('Xdoclint:all', '-quiet') + } } gradle.ext.ossrhUsernameSafe = hasProperty('ossrhUsername') ? ossrhUsername : "" @@ -26,69 +26,67 @@ gradle.ext.isParallel = hasProperty('org.gradle.parallel') ? project.property('o apply from: "${gradleScriptDir}/publish-maven.gradle" - subprojects { - apply plugin: 'java-library' - - compileJava.options.encoding = "UTF-8" - compileTestJava.options.encoding = "UTF-8" + apply plugin: 'java-library' - repositories { - mavenCentral() - maven { url = 'https://jitpack.io' } - } + compileJava.options.encoding = "UTF-8" + compileTestJava.options.encoding = "UTF-8" - java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) + repositories { + mavenCentral() + maven { url = 'https://jitpack.io' } } - withJavadocJar() - withSourcesJar() - } + java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + withJavadocJar() + withSourcesJar() + } - dependencies { - api(libs.slf4j.api) - api(libs.bundles.jackson) + dependencies { + api(libs.slf4j.api) - implementation(libs.guava) + api(libs.bundles.jackson) - implementation(libs.reflections) - implementation(libs.kryo) + implementation(libs.guava) - implementation(libs.commons.io) - implementation(libs.commons.text) - implementation(libs.commons.lang3) + implementation(libs.reflections) + implementation(libs.kryo) - //java 10 no longer has these included by default, so explicit dependency is needed. - api(libs.jaxb.api) - api(libs.jaxb.core) - runtimeOnly(libs.jaxb.impl) - api(libs.activation) + implementation(libs.commons.io) + implementation(libs.commons.text) + implementation(libs.commons.lang3) - api(libs.threeten.extra) + //java 10 no longer has these included by default, so explicit dependency is needed. + api(libs.jaxb.api) + api(libs.jaxb.core) + runtimeOnly(libs.jaxb.impl) + api(libs.activation) - testImplementation(libs.junit4) - testImplementation(libs.slf4j.simple) + api(libs.threeten.extra) - api(libs.zafarkhaja.semver) - } + testImplementation(libs.junit4) + testImplementation(libs.slf4j.simple) + api(libs.zafarkhaja.semver) + } - javadoc { - options.encoding = 'UTF-8' - } + javadoc { + options.encoding = 'UTF-8' + } - test { - testLogging { - events "failed" - exceptionFormat = "full" + test { + testLogging { + events "failed" + exceptionFormat = "full" + } } - } } diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle index 9e7373cce..e89d29674 100644 --- a/gradle/jacoco.gradle +++ b/gradle/jacoco.gradle @@ -1,47 +1,46 @@ - //the generated ANTLR sources plus the OpenEHR Test RM implementation do not need coverage def excludedPaths = ["**/nedap/archie/adlparser/antlr**", "**/nedap/archie/openehrtestrm/**"] allprojects { - apply plugin: 'jacoco' + apply plugin: 'jacoco' } subprojects { - jacoco { - toolVersion = "0.8.7" - } + jacoco { + toolVersion = "0.8.7" + } - test { - testLogging { - events "failed" - exceptionFormat = "full" + test { + testLogging { + events "failed" + exceptionFormat = "full" + } } - } - jacocoTestReport { - reports { - xml.required = true - html.required = true - } - additionalSourceDirs.from = sourceSets.main.allSource.srcDirs - sourceDirectories.from = sourceSets.main.allSource.srcDirs - classDirectories.from = sourceSets.main.output - afterEvaluate { - classDirectories.from = classDirectories.files.collect { - fileTree(dir: it, excludes: excludedPaths) + jacocoTestReport { + reports { + xml.required = true + html.required = true } - } - } + additionalSourceDirs.from = sourceSets.main.allSource.srcDirs + sourceDirectories.from = sourceSets.main.allSource.srcDirs + classDirectories.from = sourceSets.main.output + afterEvaluate { + classDirectories.from = classDirectories.files.collect { + fileTree(dir: it, excludes: excludedPaths) + } + } + } - check.dependsOn jacocoTestReport + check.dependsOn jacocoTestReport } task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { dependsOn = subprojects.test additionalSourceDirs.from = subprojects.sourceSets.main.allSource.srcDirs sourceDirectories.from = subprojects.sourceSets.main.allSource.srcDirs - classDirectories.from = subprojects.sourceSets.main.output - executionData.from = subprojects.findAll {!it.sourceSets.test.java.isEmpty()}.jacocoTestReport.executionData + classDirectories.from = subprojects.sourceSets.main.output + executionData.from = subprojects.findAll { !it.sourceSets.test.java.isEmpty() }.jacocoTestReport.executionData reports { html.required = true xml.required = true @@ -49,8 +48,8 @@ task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { } afterEvaluate { - classDirectories.from = files(classDirectories.files.collect { - fileTree(dir: it, excludes: excludedPaths) - }) + classDirectories.from = files(classDirectories.files.collect { + fileTree(dir: it, excludes: excludedPaths) + }) } } diff --git a/gradle/publish-maven.gradle b/gradle/publish-maven.gradle index 1306fac7b..89f37d9a3 100644 --- a/gradle/publish-maven.gradle +++ b/gradle/publish-maven.gradle @@ -1,82 +1,82 @@ apply plugin: 'maven-publish' -if(gradle.ext.shouldSign) { - apply plugin: 'signing' - signing { - afterEvaluate { project -> - useGpgCmd() - sign publishing.publications +if (gradle.ext.shouldSign) { + apply plugin: 'signing' + signing { + afterEvaluate { project -> + useGpgCmd() + sign publishing.publications + } } - } } nexusPublishing { - repositories { - // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration - sonatype { - nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) - snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + repositories { + // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration + sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) - username = project.hasProperty("centralTokenUsername") ? centralTokenUsername : "Unknown username" - password = project.hasProperty("centralTokenPassword") ? centralTokenPassword : "Unknown password" + username = project.hasProperty("centralTokenUsername") ? centralTokenUsername : "Unknown username" + password = project.hasProperty("centralTokenPassword") ? centralTokenPassword : "Unknown password" + } } - } } //now uploading will have to be configured on a per subproject basis subprojects { - publishing { + publishing { - publications { - "$project.name"(MavenPublication) { + publications { + "$project.name"(MavenPublication) { - afterEvaluate { - from components.java - artifactId = project.name - pom { - name = project.name - description = project.description - } - } + afterEvaluate { + from components.java + artifactId = project.name + pom { + name = project.name + description = project.description + } + } - pom { + pom { - url = "https://github.com/openEHR/archie" - organization { - name = "Nedap Healthcare" - url = "http://www.nedap-healthcare.com" - } - licenses { - license { - name = "Apache License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0" - distribution = "repo" - } - } - scm { - url = "https://github.com/openEHR/archie" - connection = "scm:git:git://github.com/openEHR/archie" - developerConnection = "scm:git:git://github.com/openEHR/archie" - } - developers { - developer { - id = "pieterbos" - name = "Pieter Bos" - email = "pieter.bos@nedap.com" - } - developer { - id = "tanja.dejong" - name = "Tanja de Jong" - email = "tanja.dejong@nedap.com" + url = "https://github.com/openEHR/archie" + organization { + name = "Nedap Healthcare" + url = "http://www.nedap-healthcare.com" + } + licenses { + license { + name = "Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0" + distribution = "repo" + } + } + scm { + url = "https://github.com/openEHR/archie" + connection = "scm:git:git://github.com/openEHR/archie" + developerConnection = "scm:git:git://github.com/openEHR/archie" + } + developers { + developer { + id = "pieterbos" + name = "Pieter Bos" + email = "pieter.bos@nedap.com" + } + developer { + id = "tanja.dejong" + name = "Tanja de Jong" + email = "tanja.dejong@nedap.com" + } + } + issueManagement { + system = "Github" + url = "https://github.com/openEHR/archie/issues" + } + } } - } - issueManagement { - system = "Github" - url = "https://github.com/openEHR/archie/issues" - } } - } } - } } diff --git a/grammars/build.gradle b/grammars/build.gradle index fbe1f5185..8d2143cb2 100644 --- a/grammars/build.gradle +++ b/grammars/build.gradle @@ -2,20 +2,20 @@ description = "grammars for parsing ADL, ODIN and xpath" apply plugin: 'antlr' generateGrammarSource { //antlr4 - outputDirectory = new File("${project.buildDir}/generated-src/antlr/main/com/nedap/archie/adlparser/antlr".toString()) + outputDirectory = new File("${project.buildDir}/generated-src/antlr/main/com/nedap/archie/adlparser/antlr".toString()) arguments = ['-visitor', '-package', 'com.nedap.archie.adlparser.antlr', '-encoding', 'utf-8'] + arguments } sourcesJar { - dependsOn generateGrammarSource + dependsOn generateGrammarSource } classes { - dependsOn generateGrammarSource + dependsOn generateGrammarSource } dependencies { - antlr(libs.antlr4) - api(libs.antlr4.runtime) + antlr(libs.antlr4) + api(libs.antlr4.runtime) } diff --git a/json-schema/build.gradle b/json-schema/build.gradle index 86f89c413..5d5e1be12 100644 --- a/json-schema/build.gradle +++ b/json-schema/build.gradle @@ -13,15 +13,15 @@ plugins { description = "A tool that generates the official ITS-JSON json schema from the BMM files" -import com.nedap.archie.json.OpenEHRRmJSONSchemaCreator; -import com.nedap.archie.json.JsonSchemaUriProvider; -import com.nedap.archie.json.JsonSchemaUri; -import com.nedap.archie.json.ItsJsonUriProvider; -import org.openehr.referencemodels.BuiltinReferenceModels; -import jakarta.json.*; -import jakarta.json.stream.JsonGenerator; -import org.openehr.bmm.core.BmmClass; +import com.nedap.archie.json.ItsJsonUriProvider +import com.nedap.archie.json.JsonSchemaUri +import com.nedap.archie.json.OpenEHRRmJSONSchemaCreator +import jakarta.json.Json +import jakarta.json.JsonObject +import jakarta.json.JsonWriterFactory +import jakarta.json.stream.JsonGenerator +import org.openehr.referencemodels.BuiltinReferenceModels abstract class JsonSchemaCreationTask extends DefaultTask { @@ -81,23 +81,23 @@ abstract class JsonSchemaCreationTask extends DefaultTask { } def printSchemas(String version, Map schemas, JsonWriterFactory jsonWriterFactory) { - for(JsonSchemaUri name:schemas.keySet()) { + for (JsonSchemaUri name : schemas.keySet()) { def schema = schemas.get(name); def versionDir = getOutputDir().get().dir(version) - if(!versionDir.getAsFile().exists()) { + if (!versionDir.getAsFile().exists()) { versionDir.getAsFile().mkdir(); } System.out.println(name.getFilename()); def split = name.getFilename().split("/"); def fileName = null; - for(int i = 0; i < split.length-1;i++) { + for (int i = 0; i < split.length - 1; i++) { String dir = split[i]; versionDir = versionDir.dir(dir); - if(!versionDir.getAsFile().exists()) { + if (!versionDir.getAsFile().exists()) { versionDir.getAsFile().mkdir(); } } - fileName = split[split.length-1]; + fileName = split[split.length - 1]; versionDir.file(fileName).getAsFile().withWriter { writer -> jsonWriterFactory.createWriter(writer).write(schema); } @@ -109,5 +109,3 @@ abstract class JsonSchemaCreationTask extends DefaultTask { tasks.register('generateJsonSchema', JsonSchemaCreationTask) { outputDir = file(layout.buildDirectory.dir('schemaOutput')) } - - diff --git a/odin/build.gradle b/odin/build.gradle index 6ee48ea32..55875080b 100644 --- a/odin/build.gradle +++ b/odin/build.gradle @@ -1,6 +1,6 @@ description = "An odin implementation" dependencies { - api project(':grammars') - api project(':base') -} \ No newline at end of file + api project(':grammars') + api project(':base') +} diff --git a/openehr-rm/build.gradle b/openehr-rm/build.gradle index b9427b505..2866e4c89 100644 --- a/openehr-rm/build.gradle +++ b/openehr-rm/build.gradle @@ -1,9 +1,10 @@ description = "An implementation of the openehr reference model" dependencies { - api project(':base') - api project(':aom') //modelInfoLookup depends on CPrimitiveObject to convert from AOM objects to RM objects. So we need this dependency, at least for now - api project(':path-queries') - api project(':utils') - testImplementation project(':archie-utils') -} \ No newline at end of file + api project(':base') + //modelInfoLookup depends on CPrimitiveObject to convert from AOM objects to RM objects. So we need the AOM dependency, at least for now + api project(':aom') + api project(':path-queries') + api project(':utils') + testImplementation project(':archie-utils') +} diff --git a/path-queries/build.gradle b/path-queries/build.gradle index c2132c65f..3eaaa9512 100644 --- a/path-queries/build.gradle +++ b/path-queries/build.gradle @@ -1,9 +1,9 @@ description = "An implementation of openehr path queries" dependencies { - //only for the xpath grammar. perhaps include it here? - api project(':grammars') - api project(':base') - api project(':aom') //modelInfoLookup is here and should be split and moved - testImplementation project(':openehr-rm') -} \ No newline at end of file + //only for the xpath grammar. perhaps include it here? + api project(':grammars') + api project(':base') + api project(':aom') //modelInfoLookup is here and should be split and moved + testImplementation project(':openehr-rm') +} diff --git a/referencemodels/build.gradle b/referencemodels/build.gradle index 9fb6868ef..ab534c052 100644 --- a/referencemodels/build.gradle +++ b/referencemodels/build.gradle @@ -1,10 +1,10 @@ description = "tools to access OpenEHR reference model metadata" dependencies { - api project(':bmm') - api project(':odin') - api project(':aom') - testImplementation project(':openehr-rm') - testImplementation project(':test-rm') - testImplementation project(':archie-utils') -} \ No newline at end of file + api project(':bmm') + api project(':odin') + api project(':aom') + testImplementation project(':openehr-rm') + testImplementation project(':test-rm') + testImplementation project(':archie-utils') +} diff --git a/test-rm/build.gradle b/test-rm/build.gradle index d9a293192..76e32b58f 100644 --- a/test-rm/build.gradle +++ b/test-rm/build.gradle @@ -1,8 +1,9 @@ -description="OpenEHR Test RM package" +description = "OpenEHR Test RM package" dependencies { - api project(':base') - api project(':aom') //modelInfoLookup depends on CPrimitiveObject to convert from AOM objects to RM objects. So we need this dependency, at least for now - api project(':path-queries') - api project(':utils') - api project(':openehr-rm') -} \ No newline at end of file + api project(':base') + //modelInfoLookup depends on CPrimitiveObject to convert from AOM objects to RM objects. So we need the AOM dependency, at least for now + api project(':aom') + api project(':path-queries') + api project(':utils') + api project(':openehr-rm') +} diff --git a/tools/build.gradle b/tools/build.gradle index 69b9f1c73..24265b5e4 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -1,19 +1,19 @@ description = "tools that operate on the archie reference models and archetype object model" dependencies { - api project(':grammars') - api project(':base') - api project(':aom') - api project(':bmm') - api project(':path-queries') - api project(':utils') - api project(':openehr-terminology') - testImplementation project(':openehr-rm') - testImplementation project(':archie-utils') - testImplementation project(':i18n') - testImplementation project(':test-rm') - testImplementation project(':referencemodels') + api project(':grammars') + api project(':base') + api project(':aom') + api project(':bmm') + api project(':path-queries') + api project(':utils') + api project(':openehr-terminology') + testImplementation project(':openehr-rm') + testImplementation project(':archie-utils') + testImplementation project(':i18n') + testImplementation project(':test-rm') + testImplementation project(':referencemodels') - api(libs.leadpony.justify) - api(variantOf(libs.jakarta.json) {classifier("module") }) + api(libs.leadpony.justify) + api(variantOf(libs.jakarta.json) { classifier("module") }) } diff --git a/utils/build.gradle b/utils/build.gradle index 89a836df2..e2c0cd38d 100644 --- a/utils/build.gradle +++ b/utils/build.gradle @@ -1,5 +1,5 @@ description = "Basic utilities for use in the archie library" dependencies { - api project(':base') -} \ No newline at end of file + api project(':base') +} From d86be8bba776d4dfd49c7ae61b6f2e7342ca625f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 13:15:57 +0200 Subject: [PATCH 16/60] Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0 (#722) Bumps org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.19.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e958d1d6f..f4500287f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,7 @@ antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" } commons-io = { module = "commons-io:commons-io", version = "2.20.0" } -commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.18.0" } +commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.19.0" } commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" } From 72d239054755093a86ce498cbfcf1b0d16428990 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 13:16:05 +0200 Subject: [PATCH 17/60] Bump com.google.guava:guava from 33.4.8-jre to 33.5.0-jre (#720) Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.4.8-jre to 33.5.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-version: 33.5.0-jre dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f4500287f..f988013aa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -23,7 +23,7 @@ commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.19.0 commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" } -guava = { module = "com.google.guava:guava", version = "33.4.8-jre" } +guava = { module = "com.google.guava:guava", version = "33.5.0-jre" } jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } From 57a60720b13ac1f2085356c96102d701e5fd0b00 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:02:41 +0100 Subject: [PATCH 18/60] Forwards compatibility of ResourceDescription.lifecycleState: also deserialize from String (#725) * Initial forwards compatibility and tests * Remove some comments * Correct documentation --- .../adapters/LifecycleStateXmlAdapter.java | 86 +++++ .../xml/types/XmlResourceDescription.java | 3 + .../com/nedap/archie/json/AOMJacksonTest.java | 37 ++ .../com/nedap/archie/xml/JAXBAOMTest.java | 41 +++ ...th_overlay_empty_lifecycle_state_block.xml | 329 +++++++++++++++++ ...nt_with_overlay_lifecycle_state_string.xml | 329 +++++++++++++++++ ...with_overlay_lifecycle_state_term_code.xml | 331 ++++++++++++++++++ ..._overlay_newline_lifecycle_state_block.xml | 331 ++++++++++++++++++ 8 files changed, 1487 insertions(+) create mode 100644 aom/src/main/java/com/nedap/archie/xml/adapters/LifecycleStateXmlAdapter.java create mode 100644 tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_empty_lifecycle_state_block.xml create mode 100644 tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_string.xml create mode 100644 tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_term_code.xml create mode 100644 tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_newline_lifecycle_state_block.xml diff --git a/aom/src/main/java/com/nedap/archie/xml/adapters/LifecycleStateXmlAdapter.java b/aom/src/main/java/com/nedap/archie/xml/adapters/LifecycleStateXmlAdapter.java new file mode 100644 index 000000000..8aa02a030 --- /dev/null +++ b/aom/src/main/java/com/nedap/archie/xml/adapters/LifecycleStateXmlAdapter.java @@ -0,0 +1,86 @@ +package com.nedap.archie.xml.adapters; + +import com.nedap.archie.base.terminology.TerminologyCode; +import org.w3c.dom.Element; + +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.adapters.XmlAdapter; +import java.util.List; + +/** + * JAXB adapter for deserializing lifecycle_state from XML. + *

+ * Supports two XML representations: + * 1. Future/simple text form: {@code published} + * 2. Current form of type terminology_code with a code_string: {@code published} + * + * The adapter always returns the lifecycle state value as a terminology_code with a code_string value, regardless of the input format. + */ +public class LifecycleStateXmlAdapter extends XmlAdapter { + + /** + * Unmarshalls a lifecycle_state element to a terminology_code. + * + * @param holder the mixed content holder containing the element's content + * @return the lifecycle_state value as a terminology_code, or null if no value is found + */ + @Override + public TerminologyCode unmarshal(MixedHolder holder) { + if (holder == null || holder.content == null || holder.content.isEmpty()) { + return null; + } + + TerminologyCode resultTerminologyCode = new TerminologyCode(); + + for (Object o : holder.content) { + if (o instanceof Element) { + Element element = (Element) o; + String elementName = element.getLocalName() != null ? element.getLocalName() : element.getNodeName(); + + if ("code_string".equals(elementName)) { + String text = element.getTextContent(); + if (text != null) { + resultTerminologyCode.setCodeString(text.trim()); + return resultTerminologyCode; + } + } + } + } + + for (Object o : holder.content) { + if (o instanceof String) { + String text = ((String) o).trim(); + if (!text.isEmpty()) { + resultTerminologyCode.setCodeString(text.trim()); + return resultTerminologyCode; + } + } + } + + return null; + } + + /** + * Not implemented for this adapter as marshaling is not required. + */ + @Override + public MixedHolder marshal(TerminologyCode v) { + return null; + } + + /** + * Holder class for mixed XML content (text and elements). + *

+ * Used by JAXB to capture both text nodes and child elements within the + * lifecycle_state element. The content list may include whitespace strings + * (from XML formatting) and Element objects. + */ + @XmlRootElement(name = "lifecycle_state") + public static class MixedHolder { + @XmlMixed + @XmlAnyElement(lax = true) + public List content; + } +} \ No newline at end of file diff --git a/aom/src/main/java/com/nedap/archie/xml/types/XmlResourceDescription.java b/aom/src/main/java/com/nedap/archie/xml/types/XmlResourceDescription.java index 976ed0321..8fb5d8c7f 100644 --- a/aom/src/main/java/com/nedap/archie/xml/types/XmlResourceDescription.java +++ b/aom/src/main/java/com/nedap/archie/xml/types/XmlResourceDescription.java @@ -1,11 +1,13 @@ package com.nedap.archie.xml.types; import com.nedap.archie.base.terminology.TerminologyCode; +import com.nedap.archie.xml.adapters.LifecycleStateXmlAdapter; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.util.List; /** @@ -24,6 +26,7 @@ public class XmlResourceDescription { @XmlElement(name = "other_contributors") private List otherContributors; @XmlElement(name = "lifecycle_state", required = true) + @XmlJavaTypeAdapter(LifecycleStateXmlAdapter.class) private TerminologyCode lifecycleState; @XmlElement(name="custodian_namespace") private String custodianNamespace; diff --git a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java index 9d416eff5..4f1b7f1d0 100644 --- a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java +++ b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java @@ -8,6 +8,7 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.ArchetypeSlot; import com.nedap.archie.aom.CComplexObject; +import com.nedap.archie.aom.ResourceDescription; import com.nedap.archie.aom.primitives.CDuration; import com.nedap.archie.aom.primitives.CString; import com.nedap.archie.aom.primitives.CTerminologyCode; @@ -71,6 +72,42 @@ public void roundTripDeliriumObservationScreening() throws Exception { } } + @Test + public void parseLifecycleStateStringTest() throws Exception { + ObjectMapper objectMapper = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createLegacyConfiguration()); + String resourceDescriptionJson = "{ \"lifecycle_state\" :\"unmanaged\" }"; + ResourceDescription resourceDescription = objectMapper.readValue(resourceDescriptionJson, ResourceDescription.class); + // assert that the lifecycle state is set to unmanaged + assertEquals("unmanaged", resourceDescription.getLifecycleState().getCodeString()); + } + + @Test + public void parseLifecycleStateTerminologyCodeTest() throws Exception { + ObjectMapper objectMapper = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createLegacyConfiguration()); + String resourceDescriptionJson = "{ \"lifecycle_state\" : { \"code_string\" : \"unmanaged\" }}"; + ResourceDescription resourceDescription = objectMapper.readValue(resourceDescriptionJson, ResourceDescription.class); + // assert that the lifecycle state is set to unmanaged + assertEquals("unmanaged", resourceDescription.getLifecycleState().getCodeString()); + } + + @Test + public void parseLifecycleStateTerminologyCodeCodeStringNullTest() throws Exception { + ObjectMapper objectMapper = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createLegacyConfiguration()); + String resourceDescriptionJson = "{ \"lifecycle_state\" : { \"code_string\" : null }}"; + ResourceDescription resourceDescription = objectMapper.readValue(resourceDescriptionJson, ResourceDescription.class); + // assert that the lifecycle state is set to unmanaged + assertNull(resourceDescription.getLifecycleState().getCodeString()); + } + + @Test + public void parseLifecycleStateTerminologyCodeNoCodeStringTest() throws Exception { + ObjectMapper objectMapper = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createLegacyConfiguration()); + String resourceDescriptionJson = "{ \"lifecycle_state\" : { \"placeholder\" : \"placeholder\" }}"; + ResourceDescription resourceDescription = objectMapper.readValue(resourceDescriptionJson, ResourceDescription.class); + // assert that the lifecycle state is set to unmanaged + assertNull(resourceDescription.getLifecycleState().getCodeString()); + } + @Test public void motricityIndex() throws Exception { try(InputStream stream = getClass().getResourceAsStream( "/com/nedap/archie/rules/evaluation/openEHR-EHR-OBSERVATION.motricity_index.v1.0.0.adls")) { diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java index f18b63052..316f91d96 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java @@ -17,6 +17,7 @@ import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; +import java.io.InputStream; import java.io.StringReader; import java.io.StringWriter; import java.time.temporal.TemporalAmount; @@ -285,4 +286,44 @@ public void templateXml() throws Exception { } + @Test + public void parseWithLifecycleStateString() throws Exception { + try(InputStream stream = getClass().getResourceAsStream("to_flatten_parent_with_overlay_lifecycle_state_string.xml")) { + Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); + Archetype unmarshalled = (Archetype) unmarshaller.unmarshal(stream); + // assert that the lifecycle state is set to published + assertEquals("published", unmarshalled.getDescription().getLifecycleState().getCodeString()); + } + } + + @Test + public void parseWithLifecycleStateTerminologyCode() throws Exception { + try(InputStream stream = getClass().getResourceAsStream("to_flatten_parent_with_overlay_lifecycle_state_term_code.xml")) { + Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); + Archetype unmarshalled = (Archetype) unmarshaller.unmarshal(stream); + // assert that the lifecycle state is set to published + assertEquals("published", unmarshalled.getDescription().getLifecycleState().getCodeString()); + } + } + + @Test + public void parseWithEmptyLifecycleStateBlock() throws Exception { + try(InputStream stream = getClass().getResourceAsStream("to_flatten_parent_with_overlay_empty_lifecycle_state_block.xml")) { + Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); + Archetype unmarshalled = (Archetype) unmarshaller.unmarshal(stream); + // assert that the lifecycle state is set to published + assertEquals(null, unmarshalled.getDescription().getLifecycleState()); + } + } + + @Test + public void parseWithNewlineLifecycleStateBlock() throws Exception { + try(InputStream stream = getClass().getResourceAsStream("to_flatten_parent_with_overlay_newline_lifecycle_state_block.xml")) { + Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); + Archetype unmarshalled = (Archetype) unmarshaller.unmarshal(stream); + // assert that the lifecycle state is set to published + assertEquals(null, unmarshalled.getDescription().getLifecycleState()); + } + } + } diff --git a/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_empty_lifecycle_state_block.xml b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_empty_lifecycle_state_block.xml new file mode 100644 index 000000000..04a638191 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_empty_lifecycle_state_block.xml @@ -0,0 +1,329 @@ + + + + Pieter Bos + + copyright © 2004 openEHR Foundation <http://www.openEHR.org> +
+ + ISO_639-1 + en + + Test for flattening + ADL + test +
+
+ + ISO_639-1 + en + + + + + false + + + true + + false + false + + 1 + + + + + 1 + + + false + + + true + + false + false + + 3 + 3 + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + + + + + + + + id1 + + + The local measurement of arterial blood pressure which is a surrogate for arterial. pressure in the systemic circulation. Most commonly, use of the term 'blood pressure' refers to measurement of brachial artery pressure in the upper arm. + Blood Pressure + + + any event + any event + + + Systolic Pressure + systolic + + + -- diastolic pressure + diastolic pressure + + + testing 1 2 3 + pressure difference + + + ingocnito mode activated + some subject + + + + + + /subject + hide + + local + at12 + + + + /data[id2]/events[id3]/data[id4]/items[id5] + show + + + /data[id2]/events[id3]/data[id4]/items[id6] + show + + +
diff --git a/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_string.xml b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_string.xml new file mode 100644 index 000000000..1393c0900 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_string.xml @@ -0,0 +1,329 @@ + + + + Pieter Bos + published + copyright © 2004 openEHR Foundation <http://www.openEHR.org> +
+ + ISO_639-1 + en + + Test for flattening + ADL + test +
+
+ + ISO_639-1 + en + + + + + false + + + true + + false + false + + 1 + + + + + 1 + + + false + + + true + + false + false + + 3 + 3 + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + + + + + + + + id1 + + + The local measurement of arterial blood pressure which is a surrogate for arterial. pressure in the systemic circulation. Most commonly, use of the term 'blood pressure' refers to measurement of brachial artery pressure in the upper arm. + Blood Pressure + + + any event + any event + + + Systolic Pressure + systolic + + + -- diastolic pressure + diastolic pressure + + + testing 1 2 3 + pressure difference + + + ingocnito mode activated + some subject + + + + + + /subject + hide + + local + at12 + + + + /data[id2]/events[id3]/data[id4]/items[id5] + show + + + /data[id2]/events[id3]/data[id4]/items[id6] + show + + +
diff --git a/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_term_code.xml b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_term_code.xml new file mode 100644 index 000000000..54845877b --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_lifecycle_state_term_code.xml @@ -0,0 +1,331 @@ + + + + Pieter Bos + + published + + copyright © 2004 openEHR Foundation <http://www.openEHR.org> +
+ + ISO_639-1 + en + + Test for (de)serialization + ADL + test +
+
+ + ISO_639-1 + en + + + + + false + + + true + + false + false + + 1 + + + + + 1 + + + false + + + true + + false + false + + 3 + 3 + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + + + + + + + + id1 + + + The local measurement of arterial blood pressure which is a surrogate for arterial. pressure in the systemic circulation. Most commonly, use of the term 'blood pressure' refers to measurement of brachial artery pressure in the upper arm. + Blood Pressure + + + any event + any event + + + Systolic Pressure + systolic + + + -- diastolic pressure + diastolic pressure + + + testing 1 2 3 + pressure difference + + + ingocnito mode activated + some subject + + + + + + /subject + hide + + local + at12 + + + + /data[id2]/events[id3]/data[id4]/items[id5] + show + + + /data[id2]/events[id3]/data[id4]/items[id6] + show + + +
diff --git a/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_newline_lifecycle_state_block.xml b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_newline_lifecycle_state_block.xml new file mode 100644 index 000000000..c1ce5877d --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/xml/to_flatten_parent_with_overlay_newline_lifecycle_state_block.xml @@ -0,0 +1,331 @@ + + + + Pieter Bos + + + + copyright © 2004 openEHR Foundation <http://www.openEHR.org> +
+ + ISO_639-1 + en + + Test for flattening + ADL + test +
+
+ + ISO_639-1 + en + + + + + false + + + true + + false + false + + 1 + + + + + 1 + + + false + + + true + + false + false + + 3 + 3 + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + false + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + false + + + 0.0 + 1000.0 + + + + + false + + mmHg + + + + false + + + 1 + 1 + + + + + + + 0.0 + 1000.0 + + + + mmHg + + + + 1 + 1 + + + + + + + + + + + + + + + + + id1 + + + The local measurement of arterial blood pressure which is a surrogate for arterial. pressure in the systemic circulation. Most commonly, use of the term 'blood pressure' refers to measurement of brachial artery pressure in the upper arm. + Blood Pressure + + + any event + any event + + + Systolic Pressure + systolic + + + -- diastolic pressure + diastolic pressure + + + testing 1 2 3 + pressure difference + + + ingocnito mode activated + some subject + + + + + + /subject + hide + + local + at12 + + + + /data[id2]/events[id3]/data[id4]/items[id5] + show + + + /data[id2]/events[id3]/data[id4]/items[id6] + show + + +
From a3ac4e69c8be7349a2d81c9eff10c93f684948ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:20:00 +0700 Subject: [PATCH 19/60] Bump jacksonVersion from 2.19.2 to 2.20.0 (#705) * Bump jacksonVersion from 2.19.2 to 2.20.0 Bumps `jacksonVersion` from 2.19.2 to 2.20.0. Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.19.2 to 2.20.0 Updates `com.fasterxml.jackson.core:jackson-databind` from 2.19.2 to 2.20.0 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.19.2 to 2.20.0 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-version: 2.20.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.20.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Jackson 2.20* deprecation fixes --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mattijs Kuhlmann --- .../nedap/archie/json/ArchieRMObjectMapperProvider.java | 2 +- .../src/main/java/com/nedap/archie/json/JacksonUtil.java | 2 +- .../openehr/bmm/v2/persistence/jackson/BmmJacksonUtil.java | 2 +- gradle/libs.versions.toml | 5 +++-- .../archie/serializer/odin/AdlOdinToJsonConverter.java | 2 +- .../nedap/archie/serializer/odin/OdinToJsonConverter.java | 4 ++-- .../src/main/java/org/openehr/odin/jackson/ODINMapper.java | 7 ++----- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/archie-utils/src/main/java/com/nedap/archie/json/ArchieRMObjectMapperProvider.java b/archie-utils/src/main/java/com/nedap/archie/json/ArchieRMObjectMapperProvider.java index 91396bd48..eee93c7f6 100644 --- a/archie-utils/src/main/java/com/nedap/archie/json/ArchieRMObjectMapperProvider.java +++ b/archie-utils/src/main/java/com/nedap/archie/json/ArchieRMObjectMapperProvider.java @@ -22,7 +22,7 @@ public class ArchieRMObjectMapperProvider implements RMObjectMapperProvider { public ObjectMapper getInputOdinObjectMapper() { ObjectMapper odinMapper = new ObjectMapper(); JacksonUtil.configureObjectMapper(odinMapper); - odinMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + odinMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE); //keywords = <"value"> is indistinguishable from keywords = <"value1", "value2"> odinMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); //odin sometimes does <> where it can mean either an empty array OR a null object. Nastyness diff --git a/archie-utils/src/main/java/com/nedap/archie/json/JacksonUtil.java b/archie-utils/src/main/java/com/nedap/archie/json/JacksonUtil.java index 1506253e0..886483f6a 100644 --- a/archie-utils/src/main/java/com/nedap/archie/json/JacksonUtil.java +++ b/archie-utils/src/main/java/com/nedap/archie/json/JacksonUtil.java @@ -69,7 +69,7 @@ public static void configureObjectMapper(ObjectMapper objectMapper, ArchieJackso objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.disable(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE); objectMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); objectMapper.enable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS); objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS, true); diff --git a/bmm/src/main/java/org/openehr/bmm/v2/persistence/jackson/BmmJacksonUtil.java b/bmm/src/main/java/org/openehr/bmm/v2/persistence/jackson/BmmJacksonUtil.java index a4b2a4ae5..0b452c42f 100644 --- a/bmm/src/main/java/org/openehr/bmm/v2/persistence/jackson/BmmJacksonUtil.java +++ b/bmm/src/main/java/org/openehr/bmm/v2/persistence/jackson/BmmJacksonUtil.java @@ -45,7 +45,7 @@ public static ObjectMapper getObjectMapper() { * @param objectMapper */ public static void configureObjectMapper(ObjectMapper objectMapper) { - objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE); //keywords = <"value"> is indistinguishable from keywords = <"value1", "value2"> objectMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); objectMapper.enable(JsonParser.Feature.STRICT_DUPLICATE_DETECTION); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f988013aa..593b7ada5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,8 @@ [versions] antlr = "4.13.2" -jackson = "2.19.2" +jackson = "2.20.0" +jackson_annotations = "2.20" slf4j = "1.7.36" @@ -25,7 +26,7 @@ commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" guava = { module = "com.google.guava:guava", version = "33.5.0-jre" } -jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" } +jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson_annotations" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" } diff --git a/odin/src/main/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverter.java b/odin/src/main/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverter.java index a8a67f28a..ff0ea97d7 100644 --- a/odin/src/main/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverter.java +++ b/odin/src/main/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverter.java @@ -38,7 +38,7 @@ public static ObjectMapper getObjectMapper() { } public static void configureObjectMapper(ObjectMapper objectMapper, boolean allowDuplicates) { - objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE); //keywords = <"value"> is indistinguishable from keywords = <"value1", "value2"> objectMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); //odin sometimes does <> where it can mean either an empty array OR a null object. Nastyness diff --git a/odin/src/main/java/com/nedap/archie/serializer/odin/OdinToJsonConverter.java b/odin/src/main/java/com/nedap/archie/serializer/odin/OdinToJsonConverter.java index 1624d1aa1..c93fd1cbe 100644 --- a/odin/src/main/java/com/nedap/archie/serializer/odin/OdinToJsonConverter.java +++ b/odin/src/main/java/com/nedap/archie/serializer/odin/OdinToJsonConverter.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.nedap.archie.adlparser.antlr.odinParser.*; import org.apache.commons.text.StringEscapeUtils; @@ -29,7 +29,7 @@ public class OdinToJsonConverter { private StringBuilder output = new StringBuilder(); static { - objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE); //keywords = <"value"> is indistinguishable from keywords = <"value1", "value2"> objectMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); objectMapper.enable(JsonParser.Feature.STRICT_DUPLICATE_DETECTION); diff --git a/odin/src/main/java/org/openehr/odin/jackson/ODINMapper.java b/odin/src/main/java/org/openehr/odin/jackson/ODINMapper.java index fc963ab4e..d051e4442 100644 --- a/odin/src/main/java/org/openehr/odin/jackson/ODINMapper.java +++ b/odin/src/main/java/org/openehr/odin/jackson/ODINMapper.java @@ -2,10 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.MappingJsonFactory; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.module.SimpleModule; import com.nedap.archie.base.Interval; import com.nedap.archie.base.terminology.TerminologyCode; @@ -44,7 +41,7 @@ public ODINMapper(ODINMapper base) { private void setup() { - setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE); disable(SerializationFeature.WRITE_NULL_MAP_VALUES); disable(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS); enable(SerializationFeature.INDENT_OUTPUT); From f0d815421e6fc8f55566ef34c5ab35c6bcfb4de2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:26:19 +0700 Subject: [PATCH 20/60] Bump jackson from 2.20.0 to 2.20.1 (#728) Bumps `jackson` from 2.20.0 to 2.20.1. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.20.0 to 2.20.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.20.0 to 2.20.1 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.20.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.20.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 593b7ada5..ceced0b7a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] antlr = "4.13.2" -jackson = "2.20.0" +jackson = "2.20.1" jackson_annotations = "2.20" slf4j = "1.7.36" From 0732ba9c1716a81dc07248dc2a5ed4dbbc4a6195 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:26:28 +0700 Subject: [PATCH 21/60] Bump org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0 (#727) Bumps org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ceced0b7a..04a6bf445 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" } commons-io = { module = "commons-io:commons-io", version = "2.20.0" } -commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.19.0" } +commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.20.0" } commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" } From b11af702fce0c4b4b1706398e0c65e8fd38f298d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:26:36 +0700 Subject: [PATCH 22/60] Bump commons-io:commons-io from 2.20.0 to 2.21.0 (#726) Bumps [commons-io:commons-io](https://github.com/apache/commons-io) from 2.20.0 to 2.21.0. - [Changelog](https://github.com/apache/commons-io/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-io/compare/rel/commons-io-2.20.0...rel/commons-io-2.21.0) --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-version: 2.21.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 04a6bf445..5b4f66cbb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ activation = { module = "javax.activation:activation", version = "1.1.1" } antlr4 = { module = "org.antlr:antlr4", version.ref = "antlr" } antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" } -commons-io = { module = "commons-io:commons-io", version = "2.20.0" } +commons-io = { module = "commons-io:commons-io", version = "2.21.0" } commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.20.0" } From cc04a765ed73b448ba1e0102dfc74bef05391afd Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:04:32 +0700 Subject: [PATCH 23/60] Update Archie to 3.16.0 (#729) --- README.md | 6 +++--- build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 890ebee27..4ef0362f6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can depend on parts of Archie, or the entire library at once. If you want th ```gradle dependencies { - compile 'com.nedap.healthcare.archie:archie-all:3.15.0' + compile 'com.nedap.healthcare.archie:archie-all:3.16.0' } ``` @@ -28,11 +28,11 @@ or if you use maven, in your pom.xml com.nedap.healthcare.archie archie-all - 3.15.0 + 3.16.0 ``` -If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.15.0 and com.nedap.healthcare.archie:referencemodels:3.15.0 instead +If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.16.0 and com.nedap.healthcare.archie:referencemodels:3.16.0 instead ## Build diff --git a/build.gradle b/build.gradle index c02ab8097..f47bcc2f9 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ repositories { allprojects { - version = '3.15.0' + version = '3.16.0' group = 'com.nedap.healthcare.archie' ext.gradleScriptDir = "${rootProject.projectDir}/gradle" //archivesBaseName = 'archie' From 9e735cb08a33d23b2e5e90d89f29bd40e589eaff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 11:30:17 +0100 Subject: [PATCH 24/60] Bump org.apache.commons:commons-text from 1.14.0 to 1.15.0 (#730) Bumps [org.apache.commons:commons-text](https://github.com/apache/commons-text) from 1.14.0 to 1.15.0. - [Changelog](https://github.com/apache/commons-text/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-text/compare/rel/commons-text-1.14.0...rel/commons-text-1.15.0) --- updated-dependencies: - dependency-name: org.apache.commons:commons-text dependency-version: 1.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5b4f66cbb..e61e1dfbb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ commons-io = { module = "commons-io:commons-io", version = "2.21.0" } commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.20.0" } -commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" } +commons-text = { module = "org.apache.commons:commons-text", version = "1.15.0" } guava = { module = "com.google.guava:guava", version = "33.5.0-jre" } From 60b8d3f5a8c65ae5c3ccedcb23b31f884e4a07bd Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 8 Jan 2026 16:56:27 +0100 Subject: [PATCH 25/60] Create AttributeAccessor utility class (#732) * Create AttributeAccessor utility class * Deprecate RMObjectAttributes and RMObjectCreator set/add methods * Replace deprecated RMObjectAttributes and RMObjectCreator usages * Use AttributeAccessor where possible * Apply suggestions from code review Co-authored-by: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> * Fix documentation --------- Co-authored-by: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> --- .../com/nedap/archie/aom/CAttributeTuple.java | 19 +- .../archie/rminfo/AttributeAccessor.java | 304 +++++ .../archie/rminfo/AttributeAccessorTest.java | 1021 +++++++++++++++++ .../com/nedap/archie/rmutil/PathableUtil.java | 8 +- .../archie/query/RMObjectAttributes.java | 6 + .../com/nedap/archie/query/RMPathQuery.java | 206 ++-- .../archie/creation/RMObjectCreator.java | 18 +- .../archie/json/flat/FlatJsonGenerator.java | 12 +- .../nedap/archie/query/RMQueryContext.java | 14 +- .../rmobjectvalidator/RmTupleValidator.java | 8 +- .../rmobjectvalidator/ValidationHelper.java | 19 +- .../validations/RMTupleValidation.java | 5 +- .../rules/evaluation/AssertionsFixer.java | 46 +- .../rules/evaluation/RuleEvaluation.java | 6 +- .../archie/creation/RMObjectCreatorTest.java | 11 + .../archie/query/RMObjectAttributesTest.java | 1 + .../com/nedap/archie/testutil/TestUtil.java | 7 +- 17 files changed, 1518 insertions(+), 193 deletions(-) create mode 100644 aom/src/main/java/com/nedap/archie/rminfo/AttributeAccessor.java create mode 100644 aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java diff --git a/aom/src/main/java/com/nedap/archie/aom/CAttributeTuple.java b/aom/src/main/java/com/nedap/archie/aom/CAttributeTuple.java index 5618be9ff..3be731f89 100644 --- a/aom/src/main/java/com/nedap/archie/aom/CAttributeTuple.java +++ b/aom/src/main/java/com/nedap/archie/aom/CAttributeTuple.java @@ -1,12 +1,11 @@ package com.nedap.archie.aom; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; -import com.nedap.archie.rminfo.RMAttributeInfo; import javax.annotation.Nullable; import javax.xml.bind.annotation.XmlType; -import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -96,18 +95,14 @@ private boolean isValid(ModelInfoLookup lookup, CPrimitiveTuple tuple, HashMap members = new HashMap<>(); for(CAttribute attribute:getMembers()) { - RMAttributeInfo attributeInfo = lookup.getAttributeInfo(value.getClass(), attribute.getRmAttributeName()); - try { - if (attributeInfo != null && attributeInfo.getGetMethod() != null) { - members.put(attribute.getRmAttributeName(), attributeInfo.getGetMethod().invoke(value)); - } else { - //warn? throw exception? - } - } catch (InvocationTargetException | IllegalAccessException e) { - throw new RuntimeException(e); + String attributeName = attribute.getRmAttributeName(); + if (attributeAccessor.hasAttribute(value, attributeName)) { + members.put(attributeName, attributeAccessor.getValue(value, attributeName)); + } else { + //warn? throw exception? } } return isValid(lookup, members); diff --git a/aom/src/main/java/com/nedap/archie/rminfo/AttributeAccessor.java b/aom/src/main/java/com/nedap/archie/rminfo/AttributeAccessor.java new file mode 100644 index 000000000..f67f57439 --- /dev/null +++ b/aom/src/main/java/com/nedap/archie/rminfo/AttributeAccessor.java @@ -0,0 +1,304 @@ +package com.nedap.archie.rminfo; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Objects; + +/** + * This class provides access to the attributes of AOM and RM objects. + *

+ * In this class, attributes of type array (e.g. {@code byte[]}) are treated as single valued attributes. + */ +public class AttributeAccessor { + private final ModelInfoLookup modelInfoLookup; + + public AttributeAccessor(ModelInfoLookup modelInfoLookup) { + this.modelInfoLookup = Objects.requireNonNull(modelInfoLookup); + } + + /** + * Add value(s) to the given attribute in the given object. + *

+ * Will add the given value or values to the attribute using the {@link RMAttributeInfo#getAddMethod() add method} + * of the attribute if available. If the attribute does not have an add method, the value will be added by adding it + * to the collection obtained via the {@link RMAttributeInfo#getGetMethod() get method} or a new collection will be + * created via the {@link RMAttributeInfo#getSetMethod() set method} if the attribute is null. + * + * @param object Object to add the values to + * @param attributeName Name of the attribute of the object + * @param value A single value or {@link Collection} of values to add + * @throws IllegalArgumentException if the attribute is not a valid attribute of the object, the attribute is not + * a multiple valued attribute or the type of the value does not match the type of + * the attribute. + * @throws RuntimeException if the underlying add, get or set method throws an exception. + */ + public void addValue(Object object, String attributeName, Object value) throws IllegalArgumentException { + RMAttributeInfo attributeInfo = getAttributeInfo(object, attributeName); + + if (!attributeInfo.isMultipleValued() || attributeInfo.getType().isArray()) { + throw new IllegalArgumentException("Attribute " + attributeName + " of object " + object.getClass().getSimpleName() + " is not a multiple valued attribute"); + } + + Collection convertedValue = handleCollection(object, attributeInfo, Objects.requireNonNull(value, "value must not be null")); + + Method addMethod = attributeInfo.getAddMethod(); + if (addMethod != null) { + try { + for (Object v : convertedValue) { + addMethod.invoke(object, v); + } + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException( + "Error adding value to attribute " + attributeName + " of object " + object.getClass().getSimpleName(), + e + ); + } + } else { + @SuppressWarnings("unchecked") Collection attributeCollection = (Collection) getValue(object, attributeName); + if (attributeCollection == null) { + attributeCollection = newCollectionInstance(attributeInfo); + setValue(object, attributeName, attributeCollection); + } + attributeCollection.addAll(convertedValue); + } + } + + /** + * Add or set attribute value(s) in the given object. + *

+ * For single valued attributes, the value will be set, overwriting any existing value. This is equivalent to + * calling {@link #setValue(Object, String, Object)}. + *

+ * For multiple valued attributes, the value will be added to the existing values. This is equivalent to calling + * {@link #addValue(Object, String, Object)}. + * + * @param object Object to add the values to or set the attribute value of + * @param attributeName Name of the attribute of the object + * @param value Value(s) to add or set, or null to remove the value + * @throws IllegalArgumentException if the attribute is not a valid attribute of the object, the attribute is a + * read-only attribute, the type of the value does not match the type of the + * attribute or multiple values are assigned to a single valued attribute. + * @throws RuntimeException if the underlying add, get or set method throws an exception. + */ + public void addOrSetValue(Object object, String attributeName, Object value) throws IllegalArgumentException { + RMAttributeInfo attributeInfo = getAttributeInfo(object, attributeName); + + if (attributeInfo.isMultipleValued() && !attributeInfo.getType().isArray()) { + addValue(object, attributeName, value); + } else { + setValue(object, attributeName, value); + } + } + + /** + * Get attribute value in the given object. + *

+ * Will get the given value of the attribute using the {@link RMAttributeInfo#getGetMethod() get method} + * of the attribute. + * + * @param object Object to get the attribute value of + * @param attributeName Name of the attribute of the object + * @throws IllegalArgumentException if the attribute is not a valid attribute of the object. + * @throws RuntimeException if the underlying get method throws an exception. + */ + public Object getValue(Object object, String attributeName) throws IllegalArgumentException { + RMAttributeInfo attributeInfo = getAttributeInfo(object, attributeName); + + try { + return attributeInfo.getGetMethod().invoke(object); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException( + "Error getting value of attribute " + attributeName + " of object " + object.getClass().getSimpleName(), + e + ); + } + } + + /** + * Check that given object has an attribute of the given name. + * + * @param object Object to check the attribute of + * @param attributeName Name of the attribute of the object + * @return True if the given object has an attribute of the given name + */ + public boolean hasAttribute(Object object, String attributeName) { + return modelInfoLookup.getAttributeInfo( + Objects.requireNonNull(object, "object must not be null").getClass(), + Objects.requireNonNull(attributeName, "attributeName must not be null") + ) != null; + } + + /** + * Set attribute value(s) in the given object. + *

+ * Will set the given value or values to the attribute using the {@link RMAttributeInfo#getSetMethod() set method} + * of the attribute, overwriting any existing value. + *

+ * For single valued attributes, this method unwraps single values from a given {@link Collection}. + *

+ * For multiple valued attributes, this method wraps a single value in a new instance of the collection type. + * + * @param object Object to set the attribute value of + * @param attributeName Name of the attribute of the object + * @param value Value(s) to set, or null to remove the value + * @throws IllegalArgumentException if the attribute is not a valid attribute of the object, the attribute is a + * read-only attribute, the type of the value does not match the type of the + * attribute or multiple values are assigned to a single valued attribute. + * @throws RuntimeException if the underlying set method throws an exception. + */ + public void setValue(Object object, String attributeName, Object value) throws IllegalArgumentException { + RMAttributeInfo attributeInfo = getAttributeInfo(object, attributeName); + + Method setMethod = attributeInfo.getSetMethod(); + if (setMethod == null) { + throw new IllegalArgumentException( + "Attribute " + attributeName + " of object " + object.getClass().getSimpleName() + " is a read-only attribute" + ); + } + + Object convertedValue; + if (attributeInfo.isMultipleValued() && !attributeInfo.getType().isArray()) { + convertedValue = handleCollection(object, attributeInfo, value); + } else { + // Handle arrays (byte[]) as a single value + convertedValue = handleSingleValue(object, attributeInfo, value); + } + + try { + setMethod.invoke(object, convertedValue); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException( + "Error setting value on attribute " + attributeName + " of object " + object.getClass().getSimpleName(), + e + ); + } + } + + /** + * Get attribute info for the given object and attribute name. + * + * @param object Object to get the attribute info of + * @param attributeName Name of the attribute of the object + * @return Attribute info object + * @throws NullPointerException if the object or attribute name is null. + * @throws IllegalArgumentException if the attribute is not a valid attribute of the object. + */ + private RMAttributeInfo getAttributeInfo(Object object, String attributeName) { + RMAttributeInfo attributeInfo = modelInfoLookup.getAttributeInfo( + Objects.requireNonNull(object, "object must not be null").getClass(), + Objects.requireNonNull(attributeName, "attributeName must not be null") + ); + if (attributeInfo == null) { + throw new IllegalArgumentException( + "Attribute " + attributeName + " of object " + object.getClass().getSimpleName() + " is not a valid attribute" + ); + } + return attributeInfo; + } + + /** + * Validate and convert the given value for assignment to a multiple valued (collection) attribute. + *

+ * Non-collection values will be wrapped in a collection. + * + * @param object Object to set the attribute value of (for exception message) + * @param attributeInfo Attribute info object + * @param value value to validate and convert + * @return converted value or null if the given value is null + * @throws IllegalArgumentException if the given value is not assignable to the attribute type or multiple values + * are assigned to a single valued attribute + */ + private Collection handleCollection(Object object, RMAttributeInfo attributeInfo, Object value) + throws IllegalArgumentException { + String attributeName = attributeInfo.getRmName(); + Class typeInCollection = attributeInfo.getTypeInCollection(); + Collection collection; + + if (value == null) { + collection = null; + } else if (value instanceof Collection) { + collection = (Collection) value; + validateType(object, attributeName, collection, attributeInfo.getType()); + + for (Object element : collection) { + validateType(object, attributeName, element, typeInCollection); + } + } else { + validateType(object, attributeName, value, typeInCollection); + List newCollection = newCollectionInstance(attributeInfo); + newCollection.add(value); + collection = newCollection; + } + + return collection; + } + + /** + * Validate and convert the given value for assignment to a single valued attribute. + *

+ * Single valued attributes include byte arrays. + *

+ * This will unpack a collection with zero or one elements. + * + * @param object Object to set the attribute value of (for exception message) + * @param attributeInfo Attribute info object + * @param value value to validate and convert + * @return converted value or null if the given value is null or an empty collection + * @throws IllegalArgumentException if the given value is not assignable to the attribute type or the value is a + * collection with multiple elements. + */ + private Object handleSingleValue(Object object, RMAttributeInfo attributeInfo, Object value) + throws IllegalArgumentException { + if (value instanceof Collection) { + Collection collection = (Collection) value; + if (collection.size() > 1) { + throw new IllegalArgumentException( + "Attribute " + attributeInfo.getRmName() + " of object " + object.getClass().getSimpleName() + " does not support multiple values" + ); + } + value = collection.isEmpty() ? null : collection.iterator().next(); + } + + validateType(object, attributeInfo.getRmName(), value, attributeInfo.getType()); + return value; + } + + /** + * Validate that the given value is assignable to the given type. + * + * @param object Object to set the attribute value of (for exception message) + * @param attributeName Name of the attribute of the object (for exception message) + * @param value Value to check the type of + * @param type The required type for the value + * @throws IllegalArgumentException if the given value is not assignable to the given type. + */ + private void validateType(Object object, String attributeName, Object value, Class type) + throws IllegalArgumentException { + if (value != null && !type.isAssignableFrom(value.getClass())) { + throw new IllegalArgumentException( + "Value type " + value.getClass().getTypeName() + " is not a valid type for attribute " + attributeName + " of object " + object.getClass().getSimpleName() + ); + } + } + + /** + * Create new collection instance for the given attribute. + *

+ * Assumes the collection type is List. + * + * @param attributeInfo Attribute info object + * @return Empty list + * @throws IllegalArgumentException if the attribute type is not List. + */ + private List newCollectionInstance(RMAttributeInfo attributeInfo) throws IllegalArgumentException { + Class type = attributeInfo.getType(); + if (type.equals(List.class)) { + return new ArrayList<>(); + } else { + throw new IllegalArgumentException("Unknown collection type " + type.getTypeName()); + } + } +} diff --git a/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java b/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java new file mode 100644 index 000000000..21c773487 --- /dev/null +++ b/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java @@ -0,0 +1,1021 @@ +package com.nedap.archie.rminfo; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.nedap.archie.aom.Archetype; +import com.nedap.archie.aom.CObject; +import com.nedap.archie.aom.CPrimitiveObject; +import org.junit.Test; + +import java.util.*; + +import static org.junit.Assert.*; + +public class AttributeAccessorTest { + private static final ModelInfoLookup modelInfoLookup = new LocalClassInfoLookup(); + private static final AttributeAccessor attributeAccessor = new AttributeAccessor(modelInfoLookup); + + private static class Dummy { + } + + @SuppressWarnings("unused") + private static class Thing { + private String name; + + private byte[] data; + + public Thing() { + } + + public Thing(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + + public int getFour() { + // Read-only attribute + return 4; + } + } + + @SuppressWarnings("unused") + private static class Group { + private List subgroups = new ArrayList<>(); + + private List things = new ArrayList<>(); + + private Thing mainThing; + + public List getSubgroups() { + return subgroups; + } + + public void setSubgroups(List subgroups) { + this.subgroups = subgroups; + } + + public List getThings() { + return things; + } + + public void setThings(List things) { + this.things = things; + } + + public void addThing(Thing thing) { + if (things == null) { + things = new ArrayList<>(); + } + this.things.add(thing); + } + + public Thing getMainThing() { + return mainThing; + } + + public void setMainThing(Thing mainThing) { + this.mainThing = mainThing; + } + } + + @SuppressWarnings({"unused", "FieldMayBeFinal"}) + private static class BrokenClass { + // This single valued attribute throws an exception when accessed + private BrokenClass child; + + // This multiple valued attribute throws an exception when accessed + private List items = new ArrayList<>(); + + private Set someSet = new HashSet<>(); + + public BrokenClass getChild() { + throw new RuntimeException("Some exception"); + } + + public void setChild(BrokenClass child) { + throw new RuntimeException("Some exception"); + } + + public List getItems() { + throw new RuntimeException("Some exception"); + } + + public void setItems(List values) { + throw new RuntimeException("Some exception"); + } + + public void addItem(BrokenClass value) { + throw new RuntimeException("Some exception"); + } + + public Set getSomeSet() { + return someSet; + } + + public void setSomeSet(Set values) { + this.someSet = values; + } + + public void addSomeSet(BrokenClass value) { + this.someSet.add(value); + } + } + + public static class LocalClassInfoLookup extends ReflectionModelInfoLookup { + private LocalClassInfoLookup() { + super(new ArchieModelNamingStrategy(), Object.class); + } + + @Override + protected void addTypes(Class baseClass) { + addClass(Thing.class); + addClass(Group.class); + addClass(BrokenClass.class); + } + + @Override + public void processCreatedObject(Object createdObject, CObject constraint) { + // Do nothing + } + + @Override + public String getArchetypeNodeIdFromRMObject(Object rmObject) { + return null; + } + + @Override + public String getArchetypeIdFromArchetypedRmObject(Object rmObject) { + return null; + } + + @Override + public String getNameFromRMObject(Object rmObject) { + return null; + } + + @Override + public Object clone(Object rmObject) { + throw new UnsupportedOperationException(); + } + + @Override + public Map pathHasBeenUpdated(Object rmObject, Archetype archetype, String pathOfParent, Object parent) { + return new HashMap<>(); + } + + @Override + public boolean validatePrimitiveType(String rmTypeName, String rmAttributeName, CPrimitiveObject cObject) { + return false; + } + + @Override + public Collection getId() { + return Lists.newArrayList(new RMPackageId("openEHR", "BROKEN")); + } + } + + public static class AddValue { + + @Test + public void testMultipleValuedSingle() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + Thing thing3 = new Thing(); + + attributeAccessor.addValue(group, "things", thing3); + + assertEquals(3, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + assertSame(thing3, group.getThings().get(2)); + } + + @Test + public void testMultipleValuedNull() { + Group group = new Group(); + group.setThings(Lists.newArrayList(new Thing(), new Thing())); + + NullPointerException exception = assertThrows(NullPointerException.class, () -> attributeAccessor.addValue(group, "things", null)); + assertEquals("value must not be null", exception.getMessage()); + + assertEquals(2, group.getThings().size()); + } + + @Test + public void testMultipleValuedListIntialEmpty() { + Group group = new Group(); + + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + List newThings = Lists.newArrayList(thing1, thing2); + + attributeAccessor.addValue(group, "things", newThings); + + assertNotSame("A new collection should be created", newThings, group.getThings()); + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListIntialNull() { + Group group = new Group(); + group.setThings(null); + + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + List newThings = Lists.newArrayList(thing1, thing2); + + attributeAccessor.addValue(group, "things", newThings); + + assertNotSame("A new collection should be created", newThings, group.getThings()); + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListIntialFilled() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + Thing thing3 = new Thing(); + Thing thing4 = new Thing(); + List newThings = Lists.newArrayList(thing3, thing4); + + attributeAccessor.addValue(group, "things", newThings); + + assertEquals(4, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + assertSame(thing3, group.getThings().get(2)); + assertSame(thing4, group.getThings().get(3)); + } + + @Test + public void testMultipleValuedListEmpty() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + attributeAccessor.addValue(group, "things", Collections.emptyList()); + + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListNull() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + attributeAccessor.addValue(group, "things", Collections.singletonList(null)); + + assertEquals(3, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + assertNull(group.getThings().get(2)); + } + + @Test + public void testMultipleValuedFallback() { + // Group has no addSubgroup method + Group group = new Group(); + group.setSubgroups(null); + + Group subgroup1 = new Group(); + Group subgroup2 = new Group(); + List newSubgroups = Lists.newArrayList(subgroup1, subgroup2); + + attributeAccessor.addValue(group, "subgroups", newSubgroups); + + assertNotSame("A new collection should be created", newSubgroups, group.getSubgroups()); + assertEquals(2, group.getSubgroups().size()); + assertSame(subgroup1, group.getSubgroups().get(0)); + assertSame(subgroup2, group.getSubgroups().get(1)); + } + + @Test + public void testMultipleValuedWrongCollection() { + Group group = new Group(); + Set things = new HashSet<>(); + things.add(new Thing()); + things.add(new Thing()); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(group, "things", things)); + assertEquals("Value type java.util.HashSet is not a valid type for attribute things of object Group", throwable.getMessage()); + } + + @Test + public void testMultipleValuedWrongType() { + Group group = new Group(); + List newThings = Lists.newArrayList(new Thing(), new Dummy()); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(group, "things", newThings)); + assertEquals("Value type com.nedap.archie.rminfo.AttributeAccessorTest$Dummy is not a valid type for attribute things of object Group", throwable.getMessage()); + } + + @Test + public void testMultipleValuedException() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + RuntimeException throwable = assertThrows(RuntimeException.class, () -> attributeAccessor.addValue(brokenClass, "items", new BrokenClass())); + assertEquals("Error adding value to attribute items of object BrokenClass", throwable.getMessage()); + } + + @Test + public void testMultipleValuedSetType() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(brokenClass, "some_set", new BrokenClass())); + assertEquals("Unknown collection type java.util.Set", throwable.getMessage()); + } + + @Test + public void testSingleValued() { + Thing thing = new Thing("old value"); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(thing, "name", "new value")); + assertEquals("Attribute name of object Thing is not a multiple valued attribute", throwable.getMessage()); + + assertEquals("old value", thing.getName()); + } + + @Test + public void testByteArray() { + Thing thing = new Thing(); + byte[] bytes = new byte[]{33, 42}; + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(thing, "data", bytes)); + assertEquals("Attribute data of object Thing is not a multiple valued attribute", throwable.getMessage()); + + assertNull(thing.getData()); + } + + @Test + public void testUnknownAttribute() { + Thing thing = new Thing(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(thing, "unknown", "test string")); + assertEquals("Attribute unknown of object Thing is not a valid attribute", throwable.getMessage()); + } + + @Test + public void testNonRmObject() { + Dummy dummy = new Dummy(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addValue(dummy, "value", 12345)); + assertEquals("Attribute value of object Dummy is not a valid attribute", throwable.getMessage()); + } + } + + public static class AddOrSetValue { + + @Test + public void testMultipleValuedSingle() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + Thing thing3 = new Thing(); + + attributeAccessor.addOrSetValue(group, "things", thing3); + + assertEquals(3, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + assertSame(thing3, group.getThings().get(2)); + } + + @Test + public void testMultipleValuedNull() { + Group group = new Group(); + group.setThings(Lists.newArrayList(new Thing(), new Thing())); + + NullPointerException exception = assertThrows(NullPointerException.class, () -> attributeAccessor.addOrSetValue(group, "things", null)); + assertEquals("value must not be null", exception.getMessage()); + + assertEquals(2, group.getThings().size()); + } + + @Test + public void testMultipleValuedListIntialEmpty() { + Group group = new Group(); + + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + List newThings = Lists.newArrayList(thing1, thing2); + + attributeAccessor.addOrSetValue(group, "things", newThings); + + assertNotSame("A new collection should be created", newThings, group.getThings()); + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListIntialNull() { + // Group has no addRow method + Group group = new Group(); + group.setThings(null); + + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + List newThings = Lists.newArrayList(thing1, thing2); + + attributeAccessor.addOrSetValue(group, "things", newThings); + + assertNotSame("A new collection should be created", newThings, group.getThings()); + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListIntialFilled() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + Thing thing3 = new Thing(); + Thing thing4 = new Thing(); + List newThings = Lists.newArrayList(thing3, thing4); + + attributeAccessor.addOrSetValue(group, "things", newThings); + + assertEquals(4, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + assertSame(thing3, group.getThings().get(2)); + assertSame(thing4, group.getThings().get(3)); + } + + @Test + public void testMultipleValuedListEmpty() { + Group group = new Group(); + group.setThings(Lists.newArrayList(new Thing(), new Thing())); + + attributeAccessor.addOrSetValue(group, "things", Collections.emptyList()); + + assertEquals(2, group.getThings().size()); + } + + @Test + public void testMultipleValuedListNull() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + attributeAccessor.addOrSetValue(group, "things", Collections.singletonList(null)); + + assertEquals(3, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + assertNull(group.getThings().get(2)); + } + + @Test + public void testMultipleValuedFallback() { + // Group has no addRow method + Group group = new Group(); + + Group subgroup1 = new Group(); + Group subgroup2 = new Group(); + List newSubgroups = Lists.newArrayList(subgroup1, subgroup2); + + attributeAccessor.addOrSetValue(group, "subgroups", newSubgroups); + + assertNotSame("A new collection should be created", newSubgroups, group.getSubgroups()); + assertEquals(2, group.getSubgroups().size()); + assertSame(subgroup1, group.getSubgroups().get(0)); + assertSame(subgroup2, group.getSubgroups().get(1)); + } + + @Test + public void testMultipleValuedWrongCollection() { + Group group = new Group(); + Set things = new HashSet<>(); + things.add(new Thing()); + things.add(new Thing()); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(group, "things", things)); + assertEquals("Value type java.util.HashSet is not a valid type for attribute things of object Group", throwable.getMessage()); + } + + @Test + public void testMultipleValuedWrongType() { + Group group = new Group(); + List newThings = Lists.newArrayList(new Thing(), new Dummy()); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(group, "things", newThings)); + assertEquals("Value type com.nedap.archie.rminfo.AttributeAccessorTest$Dummy is not a valid type for attribute things of object Group", throwable.getMessage()); + } + + @Test + public void testMultipleValuedException() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + RuntimeException throwable = assertThrows(RuntimeException.class, () -> attributeAccessor.addOrSetValue(brokenClass, "items", new BrokenClass())); + assertEquals("Error adding value to attribute items of object BrokenClass", throwable.getMessage()); + } + + @Test + public void testMultipleValuedSetType() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(brokenClass, "some_set", new BrokenClass())); + assertEquals("Unknown collection type java.util.Set", throwable.getMessage()); + } + + @Test + public void testSingleValued() { + Thing thing = new Thing("old value"); + attributeAccessor.addOrSetValue(thing, "name", "new value"); + assertEquals("new value", thing.getName()); + } + + @Test + public void testSingleValuedNull() { + Thing thing = new Thing("old value"); + attributeAccessor.addOrSetValue(thing, "name", null); + assertNull(thing.getName()); + } + + @Test + public void testSingleValuedList() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList("new value"); + attributeAccessor.addOrSetValue(thing, "name", newValue); + assertEquals("new value", thing.getName()); + } + + @Test + public void testSingleValuedListEmpty() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList(); + attributeAccessor.addOrSetValue(thing, "name", newValue); + assertNull(thing.getName()); + } + + @Test + public void testSingleValuedListNull() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList(); + newValue.add(null); + attributeAccessor.addOrSetValue(thing, "name", newValue); + assertNull(thing.getName()); + } + + @Test + public void testSingleValuedListMultiple() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList(); + newValue.add("first string"); + newValue.add("second string"); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(thing, "name", newValue)); + assertEquals("Attribute name of object Thing does not support multiple values", throwable.getMessage()); + + assertEquals("old value", thing.getName()); + } + + @Test + public void testSingleValuedSet() { + Thing thing = new Thing("old value"); + Set newValue = Sets.newHashSet("new value"); + attributeAccessor.addOrSetValue(thing, "name", newValue); + assertEquals("new value", thing.getName()); + } + + @Test + public void testSingleValuedReadOnlyAttribute() { + Thing thing = new Thing(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(thing, "four", 5)); + assertEquals("Attribute four of object Thing is a read-only attribute", throwable.getMessage()); + } + + @Test + public void testSingleValuedWrongType() { + Thing thing = new Thing("old value"); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(thing, "name", 12345)); + assertEquals("Value type java.lang.Integer is not a valid type for attribute name of object Thing", throwable.getMessage()); + + assertEquals("old value", thing.getName()); + } + + @Test + public void testSingleValuedObject() { + Group group = new Group(); + Thing thing = new Thing(); + attributeAccessor.addOrSetValue(group, "main_thing", thing); + assertSame(thing, group.getMainThing()); + } + + @Test + public void testSingleValuedException() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + RuntimeException throwable = assertThrows(RuntimeException.class, () -> attributeAccessor.addOrSetValue(brokenClass, "child", new BrokenClass())); + assertEquals("Error setting value on attribute child of object BrokenClass", throwable.getMessage()); + } + + @Test + public void testByteArray() { + Thing thing = new Thing(); + byte[] bytes = new byte[]{33, 42}; + attributeAccessor.addOrSetValue(thing, "data", bytes); + assertSame(bytes, thing.getData()); + } + + @Test + public void testByteArrayByte() { + Thing thing = new Thing(); + byte singleByte = 42; + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(thing, "data", singleByte)); + assertEquals("Value type java.lang.Byte is not a valid type for attribute data of object Thing", throwable.getMessage()); + } + + @Test + public void testByteArrayIntArray() { + Thing thing = new Thing(); + int[] ints = new int[]{33, 42}; + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(thing, "data", ints)); + assertEquals("Value type int[] is not a valid type for attribute data of object Thing", throwable.getMessage()); + } + + @Test + public void testUnknownAttribute() { + Thing thing = new Thing(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(thing, "unknown", "test string")); + assertEquals("Attribute unknown of object Thing is not a valid attribute", throwable.getMessage()); + } + + @Test + public void testNonRmObject() { + Dummy dummy = new Dummy(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.addOrSetValue(dummy, "value", 12345)); + assertEquals("Attribute value of object Dummy is not a valid attribute", throwable.getMessage()); + } + } + + public static class GetValue { + @Test + public void testNormal() { + Thing thing = new Thing("test string"); + assertEquals("test string", attributeAccessor.getValue(thing, "name")); + } + + @Test + public void testNull() { + Thing thing = new Thing(); + assertNull(attributeAccessor.getValue(thing, "name")); + } + + @Test + public void testUnknownAttribute() { + Thing thing = new Thing(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.getValue(thing, "unknown")); + assertEquals("Attribute unknown of object Thing is not a valid attribute", throwable.getMessage()); + } + + @Test + public void testNonRmObject() { + Dummy dummy = new Dummy(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.getValue(dummy, "value")); + assertEquals("Attribute value of object Dummy is not a valid attribute", throwable.getMessage()); + } + + @Test + public void testException() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + RuntimeException throwable = assertThrows(RuntimeException.class, () -> attributeAccessor.getValue(brokenClass, "items")); + assertEquals("Error getting value of attribute items of object BrokenClass", throwable.getMessage()); + } + } + + public static class HasAttribute { + @Test + public void testHasAttribute() { + assertTrue(attributeAccessor.hasAttribute(new Thing(), "name")); + assertFalse(attributeAccessor.hasAttribute(new Thing(), "unknown")); + assertFalse(attributeAccessor.hasAttribute(new Dummy(), "value")); + } + } + + public static class SetValue { + @Test + public void testMultipleValuedSingle() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + Thing thing3 = new Thing(); + + attributeAccessor.setValue(group, "things", thing3); + + assertEquals(1, group.getThings().size()); + assertSame(thing3, group.getThings().get(0)); + } + + @Test + public void testMultipleValuedNull() { + Group group = new Group(); + group.setThings(Lists.newArrayList(new Thing(), new Thing())); + + attributeAccessor.setValue(group, "things", null); + + assertNull(group.getThings()); + } + + @Test + public void testMultipleValuedListIntialEmpty() { + Group group = new Group(); + + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + List newThings = Lists.newArrayList(thing1, thing2); + + attributeAccessor.setValue(group, "things", newThings); + + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListIntialNull() { + Group group = new Group(); + group.setThings(null); + + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + List newThings = Lists.newArrayList(thing1, thing2); + + attributeAccessor.setValue(group, "things", newThings); + + assertEquals(2, group.getThings().size()); + assertSame(thing1, group.getThings().get(0)); + assertSame(thing2, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListIntialFilled() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + Thing thing3 = new Thing(); + Thing thing4 = new Thing(); + List newThings = Lists.newArrayList(thing3, thing4); + + attributeAccessor.setValue(group, "things", newThings); + + assertEquals(2, group.getThings().size()); + assertSame(thing3, group.getThings().get(0)); + assertSame(thing4, group.getThings().get(1)); + } + + @Test + public void testMultipleValuedListEmpty() { + Group group = new Group(); + group.setThings(Lists.newArrayList(new Thing(), new Thing())); + + attributeAccessor.setValue(group, "things", Collections.emptyList()); + + assertEquals(0, group.getThings().size()); + } + + @Test + public void testMultipleValuedListNull() { + Group group = new Group(); + Thing thing1 = new Thing(); + Thing thing2 = new Thing(); + group.setThings(Lists.newArrayList(thing1, thing2)); + + attributeAccessor.setValue(group, "things", Collections.singletonList(null)); + + assertEquals(1, group.getThings().size()); + assertNull(group.getThings().get(0)); + } + + @Test + public void testMultipleValuedWrongCollection() { + Group group = new Group(); + Set things = new HashSet<>(); + things.add(new Thing()); + things.add(new Thing()); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(group, "things", things)); + assertEquals("Value type java.util.HashSet is not a valid type for attribute things of object Group", throwable.getMessage()); + } + + @Test + public void testMultipleValuedWrongType() { + Group group = new Group(); + List newThings = Lists.newArrayList(new Thing(), new Dummy()); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(group, "things", newThings)); + assertEquals("Value type com.nedap.archie.rminfo.AttributeAccessorTest$Dummy is not a valid type for attribute things of object Group", throwable.getMessage()); + } + + @Test + public void testMultipleValuedException() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + RuntimeException throwable = assertThrows(RuntimeException.class, () -> attributeAccessor.setValue(brokenClass, "items", new BrokenClass())); + assertEquals("Error setting value on attribute items of object BrokenClass", throwable.getMessage()); + } + + @Test + public void testMultipleValuedSetType() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(brokenClass, "some_set", new BrokenClass())); + assertEquals("Unknown collection type java.util.Set", throwable.getMessage()); + } + + @Test + public void testSingleValued() { + Thing thing = new Thing("old value"); + attributeAccessor.setValue(thing, "name", "new value"); + assertEquals("new value", thing.getName()); + } + + @Test + public void testSingleValuedNull() { + Thing thing = new Thing("old value"); + attributeAccessor.setValue(thing, "name", null); + assertNull(thing.getName()); + } + + @Test + public void testSingleValuedList() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList("new value"); + attributeAccessor.setValue(thing, "name", newValue); + assertEquals("new value", thing.getName()); + } + + @Test + public void testSingleValuedListEmpty() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList(); + attributeAccessor.setValue(thing, "name", newValue); + assertNull(thing.getName()); + } + + @Test + public void testSingleValuedListNull() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList(); + newValue.add(null); + attributeAccessor.setValue(thing, "name", newValue); + assertNull(thing.getName()); + } + + @Test + public void testSingleValuedListMultiple() { + Thing thing = new Thing("old value"); + List newValue = Lists.newArrayList(); + newValue.add("first string"); + newValue.add("second string"); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(thing, "name", newValue)); + assertEquals("Attribute name of object Thing does not support multiple values", throwable.getMessage()); + + assertEquals("old value", thing.getName()); + } + + @Test + public void testSingleValuedSet() { + Thing thing = new Thing("old value"); + Set newValue = Sets.newHashSet("new value"); + attributeAccessor.setValue(thing, "name", newValue); + assertEquals("new value", thing.getName()); + } + + @Test + public void testSingleValuedReadOnlyAttribute() { + Thing thing = new Thing(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(thing, "four", 5)); + assertEquals("Attribute four of object Thing is a read-only attribute", throwable.getMessage()); + } + + @Test + public void testSingleValuedWrongType() { + Thing thing = new Thing("old value"); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(thing, "name", 12345)); + assertEquals("Value type java.lang.Integer is not a valid type for attribute name of object Thing", throwable.getMessage()); + + assertEquals("old value", thing.getName()); + } + + @Test + public void testSingleValuedObject() { + Group group = new Group(); + Thing thing = new Thing(); + attributeAccessor.setValue(group, "main_thing", thing); + assertSame(thing, group.getMainThing()); + } + + @Test + public void testSingleValuedException() { + AttributeAccessor attributeAccessor = new AttributeAccessor(new LocalClassInfoLookup()); + BrokenClass brokenClass = new BrokenClass(); + + RuntimeException throwable = assertThrows(RuntimeException.class, () -> attributeAccessor.setValue(brokenClass, "child", new BrokenClass())); + assertEquals("Error setting value on attribute child of object BrokenClass", throwable.getMessage()); + } + + @Test + public void testByteArray() { + Thing thing = new Thing(); + byte[] bytes = new byte[]{33, 42}; + attributeAccessor.setValue(thing, "data", bytes); + assertSame(bytes, thing.getData()); + } + + @Test + public void testByteArrayByte() { + Thing thing = new Thing(); + byte singleByte = 42; + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(thing, "data", singleByte)); + assertEquals("Value type java.lang.Byte is not a valid type for attribute data of object Thing", throwable.getMessage()); + } + + @Test + public void testByteArrayIntArray() { + Thing thing = new Thing(); + int[] ints = new int[]{33, 42}; + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(thing, "data", ints)); + assertEquals("Value type int[] is not a valid type for attribute data of object Thing", throwable.getMessage()); + } + + @Test + public void testUnknownAttribute() { + Thing thing = new Thing(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(thing, "unknown", "test string")); + assertEquals("Attribute unknown of object Thing is not a valid attribute", throwable.getMessage()); + } + + @Test + public void testNonRmObject() { + Dummy dummy = new Dummy(); + + IllegalArgumentException throwable = assertThrows(IllegalArgumentException.class, () -> attributeAccessor.setValue(dummy, "value", 12345)); + assertEquals("Attribute value of object Dummy is not a valid attribute", throwable.getMessage()); + } + } +} diff --git a/openehr-rm/src/main/java/com/nedap/archie/rmutil/PathableUtil.java b/openehr-rm/src/main/java/com/nedap/archie/rmutil/PathableUtil.java index 79e68914e..cd918df8b 100644 --- a/openehr-rm/src/main/java/com/nedap/archie/rmutil/PathableUtil.java +++ b/openehr-rm/src/main/java/com/nedap/archie/rmutil/PathableUtil.java @@ -2,16 +2,17 @@ import com.nedap.archie.paths.PathSegment; import com.nedap.archie.paths.PathUtil; -import com.nedap.archie.query.RMObjectAttributes; import com.nedap.archie.rm.archetyped.Pathable; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import com.nedap.archie.rminfo.ModelInfoLookup; +import com.nedap.archie.rminfo.AttributeAccessor; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class PathableUtil { + private static final AttributeAccessor attributeAccessor = new AttributeAccessor(ArchieRMInfoLookup.getInstance()); + /** * Determine the unique path segments from the toplevel-RM object. *

@@ -36,8 +37,7 @@ private static PathSegment getUniquePathSegment(Pathable pathable) { Pathable parent = pathable.getParent(); String parentAttributeName = unindexedPathSegment.getNodeName(); - ModelInfoLookup modelInfoLookup = ArchieRMInfoLookup.getInstance(); - Object attributeValue = RMObjectAttributes.getAttributeValueFromRMObject(parent, parentAttributeName, modelInfoLookup); + Object attributeValue = attributeAccessor.getValue(parent, parentAttributeName); Integer index = null; if (attributeValue instanceof Collection) { diff --git a/path-queries/src/main/java/com/nedap/archie/query/RMObjectAttributes.java b/path-queries/src/main/java/com/nedap/archie/query/RMObjectAttributes.java index afe8e5bd6..091905053 100644 --- a/path-queries/src/main/java/com/nedap/archie/query/RMObjectAttributes.java +++ b/path-queries/src/main/java/com/nedap/archie/query/RMObjectAttributes.java @@ -5,6 +5,10 @@ import java.lang.reflect.InvocationTargetException; +/** + * @deprecated Use {@link com.nedap.archie.rminfo.AttributeAccessor} + */ +@Deprecated public class RMObjectAttributes { /** * Get the value of an attribute of a RM object. @@ -13,7 +17,9 @@ public class RMObjectAttributes { * @param attributeName The name of the attribute. * @return The value of the attribute. * @throws IllegalArgumentException When no attribute exists with the given attribute name. + * @deprecated Use {@link com.nedap.archie.rminfo.AttributeAccessor#getValue(Object, String)} */ + @Deprecated public static Object getAttributeValueFromRMObject(Object object, String attributeName, ModelInfoLookup modelInfoLookup) { Object result; diff --git a/path-queries/src/main/java/com/nedap/archie/query/RMPathQuery.java b/path-queries/src/main/java/com/nedap/archie/query/RMPathQuery.java index 4f98b3a39..254c33090 100644 --- a/path-queries/src/main/java/com/nedap/archie/query/RMPathQuery.java +++ b/path-queries/src/main/java/com/nedap/archie/query/RMPathQuery.java @@ -5,13 +5,11 @@ import com.nedap.archie.aom.utils.AOMUtils; import com.nedap.archie.definitions.AdlCodeDefinitions; import com.nedap.archie.paths.PathSegment; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; -import com.nedap.archie.rminfo.RMAttributeInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -46,152 +44,138 @@ public RMPathQuery(String query, boolean matchSpecialisedNodes) { //TODO: get diagnostic information about where the finder stopped in the path - could be very useful! public T find(ModelInfoLookup lookup, Object root) { + AttributeAccessor attributeAccessor = new AttributeAccessor(lookup); Object currentObject = root; - try { - for (PathSegment segment : pathSegments) { - if (currentObject == null) { - return null; + for (PathSegment segment : pathSegments) { + if (currentObject == null) { + return null; + } + if (!attributeAccessor.hasAttribute(currentObject, segment.getNodeName())) { + return null; + } + currentObject = attributeAccessor.getValue(currentObject, segment.getNodeName()); + if (currentObject == null) { + return null; + } + + String archetypeNodeIdFromObject = lookup.getArchetypeNodeIdFromRMObject(currentObject); + if (currentObject instanceof Collection) { + Collection collection = (Collection) currentObject; + if (!segment.hasExpressions()) { + //TODO: check if this is correct + currentObject = collection; + } else { + currentObject = findRMObject(lookup, segment, collection); } - RMAttributeInfo attributeInfo = lookup.getAttributeInfo(currentObject.getClass(), segment.getNodeName()); - if (attributeInfo == null) { - return null; + } else if (archetypeNodeIdFromObject != null) { + + if (segment.hasExpressions()) { + if (segment.hasIdCode()) { + if (!archetypeNodeIdFromObject.equals(segment.getNodeId())) { + return null; + } + } else if (segment.hasNumberIndex()) { + int number = segment.getIndex(); + if (number != 1) { + return null; + } + } else if (segment.hasArchetypeRef()) { + //operational templates in RM Objects have their archetype node ID set to an archetype ref. That + //we support. Other things not so much + if (!archetypeNodeIdFromObject.equals(segment.getNodeId())) { + throw new IllegalArgumentException("cannot handle RM-queries with node names or archetype references yet"); + } + + } } - Method method = attributeInfo.getGetMethod(); - currentObject = method.invoke(currentObject); - if (currentObject == null) { + } else if (segment.hasNumberIndex()) { + int number = segment.getIndex(); + if (number != 1) { return null; } + } else { + //not a locatable, but that's fine + //in openehr, in archetypes everythign has node ids. Datavalues do not in the rm. a bit ugly if you ask + //me, but that's why there's no 'if there's a nodeId set, this won't match!' code here. + } + } + return (T) currentObject; + } + /** + * You will want to use RMQueryContext in many cases. For perforamnce reasons, this could still be useful + */ + public List findList(ModelInfoLookup lookup, Object root) { + AttributeAccessor attributeAccessor = new AttributeAccessor(lookup); + List currentObjects = Lists.newArrayList(new RMObjectWithPath(root, "/")); + for (PathSegment segment : pathSegments) { + if(currentObjects.isEmpty()){ + return Collections.emptyList(); + } + List newCurrentObjects = new ArrayList<>(); + + for(int i = 0; i < currentObjects.size(); i++) { + RMObjectWithPath currentObject = currentObjects.get(i); + Object currentRMObject = currentObject.getObject(); + if (!attributeAccessor.hasAttribute(currentRMObject, segment.getNodeName())) { + continue; + } + currentRMObject = attributeAccessor.getValue(currentRMObject, segment.getNodeName()); + String pathSeparator = "/"; + if(currentObject.getPath().endsWith("/")) { + pathSeparator = ""; + } + String newPath = currentObject.getPath() + pathSeparator + segment.getNodeName(); + + if (currentRMObject == null) { + continue; + } String archetypeNodeIdFromObject = lookup.getArchetypeNodeIdFromRMObject(currentObject); - if (currentObject instanceof Collection) { - Collection collection = (Collection) currentObject; + if (currentRMObject instanceof Collection) { + Collection collection = (Collection) currentRMObject; if (!segment.hasExpressions()) { - //TODO: check if this is correct - currentObject = collection; + addAllFromCollection(lookup, newCurrentObjects, collection, newPath); } else { - currentObject = findRMObject(lookup, segment, collection); + //TODO + newCurrentObjects.addAll(findRMObjectsWithPathCollection(lookup, segment, collection, newPath)); } } else if (archetypeNodeIdFromObject != null) { if (segment.hasExpressions()) { if (segment.hasIdCode()) { if (!archetypeNodeIdFromObject.equals(segment.getNodeId())) { - return null; + continue; } } else if (segment.hasNumberIndex()) { int number = segment.getIndex(); if (number != 1) { - return null; + continue; } } else if (segment.hasArchetypeRef()) { //operational templates in RM Objects have their archetype node ID set to an archetype ref. That //we support. Other things not so much if (!archetypeNodeIdFromObject.equals(segment.getNodeId())) { - throw new IllegalArgumentException("cannot handle RM-queries with node names or archetype references yet"); + continue; } } + newCurrentObjects.add(createRMObjectWithPath(lookup, currentRMObject, newPath)); } } else if (segment.hasNumberIndex()) { int number = segment.getIndex(); if (number != 1) { - return null; + continue; } } else { - //not a locatable, but that's fine + //The object does not have an archetypeNodeId //in openehr, in archetypes everythign has node ids. Datavalues do not in the rm. a bit ugly if you ask //me, but that's why there's no 'if there's a nodeId set, this won't match!' code here. + newCurrentObjects.add(createRMObjectWithPath(lookup, currentRMObject, newPath)); } } - return (T) currentObject; - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - } - - /** - * You will want to use RMQueryContext in many cases. For perforamnce reasons, this could still be useful - */ - public List findList(ModelInfoLookup lookup, Object root) { - List currentObjects = Lists.newArrayList(new RMObjectWithPath(root, "/")); - try { - for (PathSegment segment : pathSegments) { - if(currentObjects.isEmpty()){ - return Collections.emptyList(); - } - List newCurrentObjects = new ArrayList<>(); - - for(int i = 0; i < currentObjects.size(); i++) { - RMObjectWithPath currentObject = currentObjects.get(i); - Object currentRMObject = currentObject.getObject(); - RMAttributeInfo attributeInfo = lookup.getAttributeInfo(currentRMObject.getClass(), segment.getNodeName()); - if (attributeInfo == null) { - continue; - } - Method method = attributeInfo.getGetMethod(); - currentRMObject = method.invoke(currentRMObject); - String pathSeparator = "/"; - if(currentObject.getPath().endsWith("/")) { - pathSeparator = ""; - } - String newPath = currentObject.getPath() + pathSeparator + segment.getNodeName(); - - if (currentRMObject == null) { - continue; - } - String archetypeNodeIdFromObject = lookup.getArchetypeNodeIdFromRMObject(currentObject); - if (currentRMObject instanceof Collection) { - Collection collection = (Collection) currentRMObject; - if (!segment.hasExpressions()) { - addAllFromCollection(lookup, newCurrentObjects, collection, newPath); - } else { - //TODO - newCurrentObjects.addAll(findRMObjectsWithPathCollection(lookup, segment, collection, newPath)); - } - } else if (archetypeNodeIdFromObject != null) { - - if (segment.hasExpressions()) { - if (segment.hasIdCode()) { - if (!archetypeNodeIdFromObject.equals(segment.getNodeId())) { - continue; - } - } else if (segment.hasNumberIndex()) { - int number = segment.getIndex(); - if (number != 1) { - continue; - } - } else if (segment.hasArchetypeRef()) { - //operational templates in RM Objects have their archetype node ID set to an archetype ref. That - //we support. Other things not so much - if (!archetypeNodeIdFromObject.equals(segment.getNodeId())) { - continue; - } - - } - newCurrentObjects.add(createRMObjectWithPath(lookup, currentRMObject, newPath)); - } - } else if (segment.hasNumberIndex()) { - int number = segment.getIndex(); - if (number != 1) { - continue; - } - } else { - //The object does not have an archetypeNodeId - //in openehr, in archetypes everythign has node ids. Datavalues do not in the rm. a bit ugly if you ask - //me, but that's why there's no 'if there's a nodeId set, this won't match!' code here. - newCurrentObjects.add(createRMObjectWithPath(lookup, currentRMObject, newPath)); - } - } - currentObjects = newCurrentObjects; - } - return currentObjects; - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); + currentObjects = newCurrentObjects; } + return currentObjects; } diff --git a/tools/src/main/java/com/nedap/archie/creation/RMObjectCreator.java b/tools/src/main/java/com/nedap/archie/creation/RMObjectCreator.java index 7d8661daa..512305e6b 100644 --- a/tools/src/main/java/com/nedap/archie/creation/RMObjectCreator.java +++ b/tools/src/main/java/com/nedap/archie/creation/RMObjectCreator.java @@ -11,8 +11,7 @@ import java.util.*; /** - * Utility to create Reference model objects based on their RM name. Also can set attribute values on RM Objects based - * on their RM Attribute name. + * Utility to create Reference model objects based on their RM name. * * Created by pieter.bos on 03/02/16. */ @@ -39,6 +38,10 @@ public T create(CObject constraint) { } } + /** + * @deprecated Use {@link com.nedap.archie.rminfo.AttributeAccessor#setValue(Object, String, Object)} + */ + @Deprecated public void set(Object object, String rmAttributeName, List values) { try { RMAttributeInfo attributeInfo = modelInfoLookup.getAttributeInfo(object.getClass(), rmAttributeName); @@ -69,6 +72,7 @@ public void set(Object object, String rmAttributeName, List values) { } + @Deprecated private void setSingleValuedAttribute(Object object, String rmAttributeName, List values, RMAttributeInfo attributeInfo) throws InvocationTargetException, IllegalAccessException { if(values == null || values.isEmpty()) { setField(object, attributeInfo, null); @@ -81,6 +85,7 @@ private void setSingleValuedAttribute(Object object, String rmAttributeName, Lis } } + @Deprecated private Object newInstance(RMAttributeInfo attributeInfo) throws InstantiationException, IllegalAccessException { if(attributeInfo.getType().equals(List.class)) { return new ArrayList<>(); @@ -93,6 +98,7 @@ private Object newInstance(RMAttributeInfo attributeInfo) throws InstantiationEx } } + @Deprecated private void setField(Object object, RMAttributeInfo field, Object value) throws InvocationTargetException, IllegalAccessException { Method setMethod = field.getSetMethod(); if(setMethod == null) { @@ -106,6 +112,10 @@ private void setField(Object object, RMAttributeInfo field, Object value) throws } } + /** + * @deprecated Use {@link com.nedap.archie.rminfo.AttributeAccessor#addValue(Object, String, Object)} + */ + @Deprecated public void addElementToList(Object object, RMAttributeInfo attributeInfo, Object element) { try { if(attributeInfo.getAddMethod() != null) { @@ -132,6 +142,10 @@ public void addElementToList(Object object, RMAttributeInfo attributeInfo, Objec } } + /** + * @deprecated Use {@link com.nedap.archie.rminfo.AttributeAccessor#addOrSetValue(Object, String, Object)} + */ + @Deprecated public void addElementToListOrSetSingleValues(Object object, String rmAttributeName, Object element) { RMAttributeInfo attributeInfo = this.modelInfoLookup.getAttributeInfo(object.getClass(), rmAttributeName); if(attributeInfo == null) { diff --git a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java index 841f8293f..f2538027e 100644 --- a/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java +++ b/tools/src/main/java/com/nedap/archie/json/flat/FlatJsonGenerator.java @@ -7,11 +7,11 @@ import com.nedap.archie.aom.terminology.ArchetypeTerm; import com.nedap.archie.base.OpenEHRBase; import com.nedap.archie.datetime.DateTimeSerializerFormatters; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.rminfo.RMAttributeInfo; import com.nedap.archie.rminfo.RMTypeInfo; -import java.lang.reflect.InvocationTargetException; import java.time.temporal.ChronoUnit; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; @@ -31,6 +31,7 @@ public class FlatJsonGenerator { private final ModelInfoLookup modelInfoLookup; + private final AttributeAccessor attributeAccessor; private final List ignoredAttributes; @@ -51,6 +52,7 @@ public class FlatJsonGenerator { */ public FlatJsonGenerator(ModelInfoLookup modelInfoLookup, FlatJsonFormatConfiguration config) { this.modelInfoLookup = modelInfoLookup; + this.attributeAccessor = new AttributeAccessor(modelInfoLookup); this.writePipesForPrimitiveTypes = config.isWritePipesForPrimitiveTypes(); this.humanReadableFormat = false;//TODO: this is quite a bit of work to do properly, so definately not doing this now. this.indexNotation = config.getIndexNotation(); @@ -127,12 +129,8 @@ private void buildPathsAndValuesInner(Map result, RMTypeInfo rmA continue; } } - try { - Object child = attributeInfo.getGetMethod().invoke(rmObject); - addAttribute(result, pathSoFar, rmObject, child, attributeName,null, cAttribute); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e);//TODO: fine for now... - } + Object child = attributeAccessor.getValue(rmObject, attributeName); + addAttribute(result, pathSoFar, rmObject, child, attributeName,null, cAttribute); } } diff --git a/tools/src/main/java/com/nedap/archie/query/RMQueryContext.java b/tools/src/main/java/com/nedap/archie/query/RMQueryContext.java index e04101b24..d9fa70c45 100644 --- a/tools/src/main/java/com/nedap/archie/query/RMQueryContext.java +++ b/tools/src/main/java/com/nedap/archie/query/RMQueryContext.java @@ -1,7 +1,7 @@ package com.nedap.archie.query; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; -import com.nedap.archie.rminfo.RMAttributeInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -19,7 +19,6 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; @@ -34,7 +33,7 @@ public class RMQueryContext { private final XPathFactory xPathFactory; - private final ModelInfoLookup modelInfoLooup; + private final AttributeAccessor attributeAccessor; private Binder binder; private Document domForQueries; private Object rootNode; @@ -55,7 +54,7 @@ public class RMQueryContext { public RMQueryContext(ModelInfoLookup lookup, Object rootNode, JAXBContext jaxbContext) { try { this.rootNode = rootNode; - this.modelInfoLooup = lookup; + this.attributeAccessor = new AttributeAccessor(lookup); this.binder = jaxbContext.createBinder(); domForQueries = createBlankDOMDocument(true); @@ -129,12 +128,7 @@ private T getJAXBNode(Node node) { logger.error("trying to get a node without a parent"); return null; } - RMAttributeInfo attributeInfo = modelInfoLooup.getAttributeInfo(parent.getClass(), nodeName); - try { - return (T) attributeInfo.getGetMethod().invoke(parent); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e); - } + return (T) attributeAccessor.getValue(parent, nodeName); } } diff --git a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmTupleValidator.java b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmTupleValidator.java index f35860830..f60290d45 100644 --- a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmTupleValidator.java +++ b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/RmTupleValidator.java @@ -1,20 +1,20 @@ package com.nedap.archie.rmobjectvalidator; import com.nedap.archie.aom.*; -import com.nedap.archie.query.RMObjectAttributes; import com.nedap.archie.query.RMObjectWithPath; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; import java.util.ArrayList; import java.util.List; class RmTupleValidator { - private final ModelInfoLookup lookup; + private final AttributeAccessor attributeAccessor; private final ValidationHelper validationHelper; private final RmPrimitiveObjectValidator rmPrimitiveObjectValidator; RmTupleValidator(ModelInfoLookup lookup, ValidationHelper validationHelper, RmPrimitiveObjectValidator rmPrimitiveObjectValidator) { - this.lookup = lookup; + this.attributeAccessor = new AttributeAccessor(lookup); this.validationHelper = validationHelper; this.rmPrimitiveObjectValidator = rmPrimitiveObjectValidator; } @@ -56,7 +56,7 @@ private List validateSingleTuple(String pathSoFar, Ob for(CAttribute attribute:attributeTuple.getMembers()) { String attributeName = attribute.getRmAttributeName(); CPrimitiveObject cPrimitiveObject = tuple.getMembers().get(index); - Object value = RMObjectAttributes.getAttributeValueFromRMObject(rmObject, attributeName, lookup); + Object value = attributeAccessor.getValue(rmObject, attributeName); String path = pathSoFar + "/" + attributeName + "[" + cPrimitiveObject.getNodeId() + "]"; result.addAll(rmPrimitiveObjectValidator.validate_inner(value, path, cPrimitiveObject)); diff --git a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/ValidationHelper.java b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/ValidationHelper.java index 5d5ab4bdb..522719689 100644 --- a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/ValidationHelper.java +++ b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/ValidationHelper.java @@ -4,10 +4,9 @@ import com.nedap.archie.aom.CAttributeTuple; import com.nedap.archie.aom.CPrimitiveObject; import com.nedap.archie.aom.CPrimitiveTuple; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; -import com.nedap.archie.rminfo.RMAttributeInfo; -import java.lang.reflect.InvocationTargetException; import java.util.HashMap; /** @@ -15,10 +14,12 @@ */ public class ValidationHelper { private final ModelInfoLookup lookup; + private final AttributeAccessor attributeAccessor; private final PrimitiveObjectConstraintHelper primitiveObjectConstraintHelper; public ValidationHelper(ModelInfoLookup lookup, ValidationConfiguration validationConfiguration) { this.lookup = lookup; + this.attributeAccessor = new AttributeAccessor(lookup); this.primitiveObjectConstraintHelper = new PrimitiveObjectConstraintHelper(validationConfiguration); } @@ -84,15 +85,11 @@ boolean isValid(CAttributeTuple cAttributeTuple, Object value) { HashMap members = new HashMap<>(); for(CAttribute attribute:cAttributeTuple.getMembers()) { - RMAttributeInfo attributeInfo = lookup.getAttributeInfo(value.getClass(), attribute.getRmAttributeName()); - try { - if (attributeInfo != null && attributeInfo.getGetMethod() != null) { - members.put(attribute.getRmAttributeName(), attributeInfo.getGetMethod().invoke(value)); - } else { - //warn? throw exception? - } - } catch (InvocationTargetException | IllegalAccessException e) { - throw new RuntimeException(e); + String attributeName = attribute.getRmAttributeName(); + if (attributeAccessor.hasAttribute(value, attributeName)) { + members.put(attributeName, attributeAccessor.getValue(value, attributeName)); + } else { + //warn? throw exception? } } return isValid(cAttributeTuple, members); diff --git a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidation.java b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidation.java index 696dffcb0..ea109e54d 100644 --- a/tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidation.java +++ b/tools/src/main/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidation.java @@ -1,8 +1,8 @@ package com.nedap.archie.rmobjectvalidator.validations; import com.nedap.archie.aom.*; -import com.nedap.archie.query.RMObjectAttributes; import com.nedap.archie.query.RMObjectWithPath; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.rmobjectvalidator.RMObjectValidationMessage; import com.nedap.archie.rmobjectvalidator.RMObjectValidationMessageIds; @@ -48,6 +48,7 @@ public static List validate(ModelInfoLookup lookup, C * This will check each attribute in the tuple individually to get more specific validation messages. */ private static List validateSingleTuple(ModelInfoLookup lookup, String pathSoFar, Object rmObject, CAttributeTuple attributeTuple) { + AttributeAccessor attributeAccessor = new AttributeAccessor(lookup); List result = new ArrayList<>(); CPrimitiveTuple tuple = attributeTuple.getTuples().get(0); @@ -56,7 +57,7 @@ private static List validateSingleTuple(ModelInfoLook for(CAttribute attribute:attributeTuple.getMembers()) { String attributeName = attribute.getRmAttributeName(); CPrimitiveObject cPrimitiveObject = tuple.getMembers().get(index); - Object value = RMObjectAttributes.getAttributeValueFromRMObject(rmObject, attributeName, lookup); + Object value = attributeAccessor.getValue(rmObject, attributeName); String path = pathSoFar + "/" + attributeName + "[" + cPrimitiveObject.getNodeId() + "]"; result.addAll(RMPrimitiveObjectValidation.validate_inner(lookup, value, path, cPrimitiveObject)); diff --git a/tools/src/main/java/com/nedap/archie/rules/evaluation/AssertionsFixer.java b/tools/src/main/java/com/nedap/archie/rules/evaluation/AssertionsFixer.java index 166ca264c..6924f536e 100644 --- a/tools/src/main/java/com/nedap/archie/rules/evaluation/AssertionsFixer.java +++ b/tools/src/main/java/com/nedap/archie/rules/evaluation/AssertionsFixer.java @@ -1,16 +1,15 @@ package com.nedap.archie.rules.evaluation; -import com.google.common.collect.Lists; import com.nedap.archie.aom.*; import com.nedap.archie.creation.RMObjectCreator; import com.nedap.archie.query.RMObjectWithPath; import com.nedap.archie.query.RMPathQuery; +import com.nedap.archie.rminfo.AttributeAccessor; import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.rminfo.RMAttributeInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -24,17 +23,25 @@ public class AssertionsFixer { private static final Logger logger = LoggerFactory.getLogger(AssertionsFixer.class); - private final RMObjectCreator creator; private final RuleEvaluation ruleEvaluation; private final RMObjectCreator rmObjectCreator; private ModelInfoLookup modelInfoLookup; + private final AttributeAccessor attributeAccessor; + /** + * @deprecated Not intended for direct usage. Use RuleEvaluation instead. + */ + @Deprecated public AssertionsFixer(RuleEvaluation evaluation, RMObjectCreator creator) { - this.creator = creator; + this(evaluation); + } + + AssertionsFixer(RuleEvaluation evaluation) { this.ruleEvaluation = evaluation; this.modelInfoLookup = ruleEvaluation.getModelInfoLookup(); rmObjectCreator = new RMObjectCreator(evaluation.getModelInfoLookup()); + this.attributeAccessor = new AttributeAccessor(modelInfoLookup); } public Map fixSetPathAssertions(Archetype archetype, AssertionResult assertionResult) { @@ -63,15 +70,15 @@ public Map fixSetPathAssertions(Archetype archetype, AssertionRe throw new IllegalStateException("attribute " + lastPathSegment + " does not exist on type " + parent.getClass()); } if (value.getValue() == null) { - creator.set(parent, lastPathSegment, Lists.newArrayList(value.getValue())); + attributeAccessor.setValue(parent, lastPathSegment, value.getValue()); } else if (attributeInfo.getType().equals(Long.class) && value.getValue().getClass().equals(Double.class)) { Long convertedValue = ((Double) value.getValue()).longValue(); //TODO or should this round? - creator.set(parent, lastPathSegment, Lists.newArrayList(convertedValue)); + attributeAccessor.setValue(parent, lastPathSegment, convertedValue); } else if (attributeInfo.getType().equals(Double.class) && value.getValue().getClass().equals(Long.class)) { Double convertedValue = ((Long) value.getValue()).doubleValue(); //TODO or should this round? - creator.set(parent, lastPathSegment, Lists.newArrayList(convertedValue)); + attributeAccessor.setValue(parent, lastPathSegment, convertedValue); } else { - creator.set(parent, lastPathSegment, Lists.newArrayList(value.getValue())); + attributeAccessor.setValue(parent, lastPathSegment, value.getValue()); } result.putAll(modelInfoLookup.pathHasBeenUpdated(ruleEvaluation.getRMRoot(), archetype, pathOfParent, parent)); @@ -107,7 +114,7 @@ private void constructMissingStructure(Archetype archetype, String pathOfParent, Object newEmptyObject = null; newEmptyObject = constructEmptySimpleObject(newLastPathSegment, object, newEmptyObject); - creator.addElementToListOrSetSingleValues(object, newLastPathSegment, Lists.newArrayList(newEmptyObject)); + attributeAccessor.addOrSetValue(object, newLastPathSegment, newEmptyObject); ruleEvaluation.refreshQueryContext(); } else { CObject constraint = getCObjectFromResult(constraints); @@ -127,7 +134,7 @@ private void constructMissingStructure(Archetype archetype, String pathOfParent, attributeName = newLastPathSegment.substring(0, bracketIndex); } - creator.addElementToListOrSetSingleValues(object, attributeName, Lists.newArrayList(newEmptyObject)); + attributeAccessor.addOrSetValue(object, attributeName, newEmptyObject); ruleEvaluation.refreshQueryContext(); } @@ -202,18 +209,13 @@ private void removeObject(ObjectToRemove objectToRemove) { Object parent = objectToRemove.getParent(); Object object = objectToRemove.getObject(); - RMAttributeInfo attributeInfo = modelInfoLookup.getAttributeInfo(parent.getClass(), objectToRemove.getAttributeName()); - try { - Object attributeValue = attributeInfo.getGetMethod().invoke(parent); - if (attributeValue instanceof List) { - ((List) attributeValue).remove(object); - } else if (attributeValue == object) { - attributeInfo.getSetMethod().invoke(parent, (Object) null); - } else { - throw new IllegalStateException("Attribute value is not a list and not the object to remove"); - } - } catch (IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e); + Object attributeValue = attributeAccessor.getValue(parent, objectToRemove.getAttributeName()); + if (attributeValue instanceof List) { + ((List) attributeValue).remove(object); + } else if (attributeValue == object) { + attributeAccessor.setValue(parent, objectToRemove.getAttributeName(), null); + } else { + throw new IllegalStateException("Attribute value is not a list and not the object to remove"); } } diff --git a/tools/src/main/java/com/nedap/archie/rules/evaluation/RuleEvaluation.java b/tools/src/main/java/com/nedap/archie/rules/evaluation/RuleEvaluation.java index b03e79c30..1066d9879 100644 --- a/tools/src/main/java/com/nedap/archie/rules/evaluation/RuleEvaluation.java +++ b/tools/src/main/java/com/nedap/archie/rules/evaluation/RuleEvaluation.java @@ -2,7 +2,6 @@ import com.google.common.collect.ArrayListMultimap; import com.nedap.archie.aom.Archetype; -import com.nedap.archie.creation.RMObjectCreator; import com.nedap.archie.query.RMObjectWithPath; import com.nedap.archie.query.RMQueryContext; import com.nedap.archie.rminfo.ModelInfoLookup; @@ -47,8 +46,6 @@ public class RuleEvaluation { private ModelInfoLookup modelInfoLookup; - private RMObjectCreator creator; - private final JAXBContext jaxbContext; private RMQueryContext rmQueryContext; private APathQueryCache queryCache = new APathQueryCache(); @@ -96,8 +93,7 @@ public RuleEvaluation(ModelInfoLookup modelInfoLookup, JAXBContext jaxbContext, private RuleEvaluation(ModelInfoLookup modelInfoLookup, ValidationConfiguration validationConfiguration, JAXBContext jaxbContext, Archetype archetype) { this.jaxbContext = jaxbContext; this.modelInfoLookup = modelInfoLookup; - this.creator = new RMObjectCreator(modelInfoLookup); - this.assertionsFixer = new AssertionsFixer(this, creator); + this.assertionsFixer = new AssertionsFixer(this); this.archetype = archetype; this.functionEvaluator = new FunctionEvaluator(); add(new VariableDeclarationEvaluator()); diff --git a/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java b/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java index 846748f51..142830d81 100644 --- a/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java +++ b/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java @@ -87,6 +87,7 @@ public void createUnknownType() { } @Test + @Deprecated public void setSingleValuedValue() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); @@ -95,6 +96,7 @@ public void setSingleValuedValue() { } @Test + @Deprecated public void setSingleValuedValuePrimitive() { DvBoolean booleanValue = new DvBoolean(); creator.set(booleanValue, "value", Lists.newArrayList(true)); @@ -102,6 +104,7 @@ public void setSingleValuedValuePrimitive() { } @Test(expected = IllegalArgumentException.class) + @Deprecated public void setSingleValuedValueIncorrectly() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); @@ -110,6 +113,7 @@ public void setSingleValuedValueIncorrectly() { } @Test(expected = IllegalArgumentException.class) + @Deprecated public void setSingleValuedValueUnknownArgument() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); @@ -117,6 +121,7 @@ public void setSingleValuedValueUnknownArgument() { } @Test + @Deprecated public void setMultiValuedValue() { Cluster cluster = new Cluster(); Element element = new Element(); @@ -125,6 +130,7 @@ public void setMultiValuedValue() { } @Test + @Deprecated public void setMultiValuedValue2() { Cluster cluster = new Cluster(); Element element = new Element(); @@ -134,6 +140,7 @@ public void setMultiValuedValue2() { } @Test + @Deprecated public void addToListOrSetSingleValue() { Cluster cluster = new Cluster(); Element element = new Element(); @@ -144,6 +151,7 @@ public void addToListOrSetSingleValue() { } @Test + @Deprecated public void addToListOrSetSingleValue2() { Cluster cluster = new Cluster(); Element element = new Element(); @@ -155,6 +163,7 @@ public void addToListOrSetSingleValue2() { } @Test + @Deprecated public void addToListOrSetSingleValueWithSingleValue() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); @@ -163,6 +172,7 @@ public void addToListOrSetSingleValueWithSingleValue() { } @Test + @Deprecated public void addToListOrSetSingleValueWithSingleValue2() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); @@ -171,6 +181,7 @@ public void addToListOrSetSingleValueWithSingleValue2() { } @Test(expected = IllegalArgumentException.class) + @Deprecated public void addToListOrSetSingleValueWithSingleValueIncorrect() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); diff --git a/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java b/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java index f9e641619..8ade2073c 100644 --- a/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java +++ b/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java @@ -23,6 +23,7 @@ import static com.nedap.archie.query.RMObjectAttributes.getAttributeValueFromRMObject; import static org.junit.Assert.assertSame; +@Deprecated public class RMObjectAttributesTest { private TestUtil testUtil; diff --git a/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java b/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java index 55e04ffde..21228970f 100644 --- a/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java +++ b/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java @@ -1,6 +1,5 @@ package com.nedap.archie.testutil; -import com.google.common.collect.Lists; import com.nedap.archie.adlparser.ADLParseException; import com.nedap.archie.adlparser.ADLParser; import com.nedap.archie.antlr.errors.ANTLRParserErrors; @@ -10,6 +9,7 @@ import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.rm.RMObject; import com.nedap.archie.rminfo.ArchieRMInfoLookup; +import com.nedap.archie.rminfo.AttributeAccessor; import org.reflections.Reflections; import org.reflections.scanners.Scanners; import org.slf4j.Logger; @@ -34,6 +34,7 @@ public class TestUtil { private static final Logger logger = LoggerFactory.getLogger(TestUtil.class); private RMObjectCreator creator = new RMObjectCreator(ArchieRMInfoLookup.getInstance()); + private final AttributeAccessor attributeAccessor = new AttributeAccessor(ArchieRMInfoLookup.getInstance()); /** * Creates an empty RM Object, fully nested, one object per CObject found. @@ -61,10 +62,10 @@ public RMObject constructEmptyRMObject(CObject object) { } if(!children.isEmpty()) { if(attribute.isMultiple()) { - creator.set(result, attribute.getRmAttributeName(), children); + attributeAccessor.setValue(result, attribute.getRmAttributeName(), children); } else if(!children.isEmpty()){ //set the first possible result in case of multiple children for a single valued value - creator.set(result, attribute.getRmAttributeName(), Lists.newArrayList(children.get(0))); + attributeAccessor.setValue(result, attribute.getRmAttributeName(), children.get(0)); } } } From d8cd7a4155bc437eac26a096f1703d71ae392e38 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Mon, 26 Jan 2026 13:42:12 +0100 Subject: [PATCH 26/60] Update Gradle wrapper to version 8.14.4 (#737) --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d4081da47..aaaabb3cb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From ff0f32ddc077c0c413075e0db208365b667e75c5 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 5 Feb 2026 17:01:46 +0100 Subject: [PATCH 27/60] Update Semaphore CI configuration to use Ubuntu 24.04 (#743) --- .semaphore/semaphore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 8c5a27f9b..e26d696d8 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -3,7 +3,7 @@ name: Java agent: machine: type: e1-standard-2 - os_image: ubuntu2004 + os_image: ubuntu2404 blocks: - name: Gradle task: From dcae8ab325b16a060f6157583658736c39829e7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 10:57:17 +0100 Subject: [PATCH 28/60] Bump com.fasterxml.jackson.core:jackson-annotations from 2.20 to 2.21 (#735) Bumps [com.fasterxml.jackson.core:jackson-annotations](https://github.com/FasterXML/jackson) from 2.20 to 2.21. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-version: '2.21' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e61e1dfbb..801c4500f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ antlr = "4.13.2" jackson = "2.20.1" -jackson_annotations = "2.20" +jackson_annotations = "2.21" slf4j = "1.7.36" From 7ebb3885096c478398d602d8c9f4bfdd82ad9b47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 11:00:24 +0100 Subject: [PATCH 29/60] Bump jackson from 2.20.1 to 2.21.0 (#734) Bumps `jackson` from 2.20.1 to 2.21.0. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.20.1 to 2.21.0 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.20.1 to 2.21.0 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.21.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 801c4500f..cca8d065e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] antlr = "4.13.2" -jackson = "2.20.1" +jackson = "2.21.0" jackson_annotations = "2.21" slf4j = "1.7.36" From 933217ddf2d727a4a9e38ea5b2cc71d7bbeeca97 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Wed, 11 Feb 2026 12:00:42 +0100 Subject: [PATCH 30/60] Deserialize empty string as null for date, datetime, time and duration (#747) --- .../rm/datavalues/quantity/datetime/DvDate.java | 2 +- .../datavalues/quantity/datetime/DvDateTest.java | 14 +++++++++++--- .../quantity/datetime/DvDateTimeTest.java | 14 +++++++++++--- .../quantity/datetime/DvDurationTest.java | 13 ++++++++++--- .../datavalues/quantity/datetime/DvTimeTest.java | 14 +++++++++++--- .../com/nedap/archie/json/DateDeserializer.java | 2 +- .../nedap/archie/json/DateTimeDeserializer.java | 2 +- .../nedap/archie/json/DurationDeserializer.java | 2 +- .../com/nedap/archie/json/TimeDeserializer.java | 2 +- 9 files changed, 48 insertions(+), 17 deletions(-) diff --git a/openehr-rm/src/main/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDate.java b/openehr-rm/src/main/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDate.java index b4a905741..de25ed5a5 100644 --- a/openehr-rm/src/main/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDate.java +++ b/openehr-rm/src/main/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDate.java @@ -88,7 +88,7 @@ public Temporal getValue() { @Override public void setValue(Temporal value) { - if(value.isSupported(ChronoField.HOUR_OF_DAY)) { + if(value != null && value.isSupported(ChronoField.HOUR_OF_DAY)) { //TODO: do we really need this validation? throw new IllegalArgumentException("value must only have a year, month or date, but this supports hours: " + value); } diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java index 8378f5742..d7c45a97c 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java @@ -1,9 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.nedap.archie.json.JacksonUtil; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.*; public class DvDateTest { @@ -25,4 +26,11 @@ public void testEquals() { assertEquals(dvDateFour, dvDateFive); assertEquals(dvDateSix, dvDateSeven); } -} \ No newline at end of file + + @Test + public void deserializeValueEmptyString() throws JsonProcessingException { + String json = "{\"value\":\"\"}"; + DvDate actual = JacksonUtil.getObjectMapper().readValue(json, DvDate.class); + assertNull(actual.getValue()); + } +} diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java index 067c067c8..a3ea3e1c4 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java @@ -1,9 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.nedap.archie.json.JacksonUtil; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.*; public class DvDateTimeTest { @@ -33,4 +34,11 @@ public void testPartialDateTime(){ assertEquals("2019-01", new DvDateTime("2019-01").getValue().toString()); assertEquals("2019", new DvDateTime("2019").getValue().toString()); } -} \ No newline at end of file + + @Test + public void deserializeValueEmptyString() throws JsonProcessingException { + String json = "{\"value\":\"\"}"; + DvDateTime actual = JacksonUtil.getObjectMapper().readValue(json, DvDateTime.class); + assertNull(actual.getValue()); + } +} diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java index da6ef6155..2f2c1fc2b 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java @@ -1,9 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.nedap.archie.json.JacksonUtil; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.*; public class DvDurationTest { @@ -21,4 +22,10 @@ public void testEquals() { assertEquals(dvDurationFour, dvDurationFive); } -} \ No newline at end of file + @Test + public void deserializeValueEmptyString() throws JsonProcessingException { + String json = "{\"value\":\"\"}"; + DvDuration actual = JacksonUtil.getObjectMapper().readValue(json, DvDuration.class); + assertNull(actual.getValue()); + } +} diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java index 71f676468..dcf6fea63 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java @@ -1,9 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.nedap.archie.json.JacksonUtil; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.*; public class DvTimeTest { @@ -22,4 +23,11 @@ public void testEquals() { assertEquals(dvTimeFour, dvTimeFive); } -} \ No newline at end of file + + @Test + public void deserializeValueEmptyString() throws JsonProcessingException { + String json = "{\"value\":\"\"}"; + DvDuration actual = JacksonUtil.getObjectMapper().readValue(json, DvDuration.class); + assertNull(actual.getValue()); + } +} diff --git a/utils/src/main/java/com/nedap/archie/json/DateDeserializer.java b/utils/src/main/java/com/nedap/archie/json/DateDeserializer.java index c13fb2bf5..214c0ffe1 100644 --- a/utils/src/main/java/com/nedap/archie/json/DateDeserializer.java +++ b/utils/src/main/java/com/nedap/archie/json/DateDeserializer.java @@ -17,7 +17,7 @@ public class DateDeserializer extends JsonDeserializer { @Override public Temporal deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { String valueAsString = p.getValueAsString(); - if(valueAsString == null) { + if(valueAsString == null || valueAsString.isEmpty()) { return null; } return DateTimeParsers.parseDateValue(valueAsString); diff --git a/utils/src/main/java/com/nedap/archie/json/DateTimeDeserializer.java b/utils/src/main/java/com/nedap/archie/json/DateTimeDeserializer.java index 84dbfe40b..310fbe72a 100644 --- a/utils/src/main/java/com/nedap/archie/json/DateTimeDeserializer.java +++ b/utils/src/main/java/com/nedap/archie/json/DateTimeDeserializer.java @@ -16,7 +16,7 @@ public class DateTimeDeserializer extends JsonDeserializer{ @Override public TemporalAccessor deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { String valueAsString = p.getValueAsString(); - if(valueAsString == null) { + if(valueAsString == null || valueAsString.isEmpty()) { return null; } return DateTimeParsers.parseDateTimeValue(valueAsString); diff --git a/utils/src/main/java/com/nedap/archie/json/DurationDeserializer.java b/utils/src/main/java/com/nedap/archie/json/DurationDeserializer.java index 848c0f7ff..1d5d01b3f 100644 --- a/utils/src/main/java/com/nedap/archie/json/DurationDeserializer.java +++ b/utils/src/main/java/com/nedap/archie/json/DurationDeserializer.java @@ -16,7 +16,7 @@ public class DurationDeserializer extends JsonDeserializer { @Override public TemporalAmount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { String valueAsString = p.getValueAsString(); - if(valueAsString == null) { + if(valueAsString == null || valueAsString.isEmpty()) { return null; } return DateTimeParsers.parseDurationValue(valueAsString); diff --git a/utils/src/main/java/com/nedap/archie/json/TimeDeserializer.java b/utils/src/main/java/com/nedap/archie/json/TimeDeserializer.java index 187e30e76..190e0ded9 100644 --- a/utils/src/main/java/com/nedap/archie/json/TimeDeserializer.java +++ b/utils/src/main/java/com/nedap/archie/json/TimeDeserializer.java @@ -16,7 +16,7 @@ public class TimeDeserializer extends JsonDeserializer { @Override public TemporalAccessor deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { String valueAsString = p.getValueAsString(); - if(valueAsString == null) { + if(valueAsString == null || valueAsString.isEmpty()) { return null; } return DateTimeParsers.parseTimeValue(valueAsString); From b89f2a5b09291c17aedb3ee6cab70dbd63557dde Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 12 Feb 2026 14:36:22 +0100 Subject: [PATCH 31/60] Refactor KryoUtil to CloneUtil (#742) This allows us to remove Kryo from our public API and remove some code duplication. --- .../archie/aom/ArchetypeModelObject.java | 12 ++---- .../openehr/bmm/v2/persistence/PBmmBase.java | 13 ++---- .../java/com/nedap/archie/rm/RMObject.java | 12 ++---- .../flattener/FlattenerConfiguration.java | 12 ++---- .../com/nedap/archie/kryo/URISerializer.java | 3 ++ .../java/com/nedap/archie/util/CloneUtil.java | 41 +++++++++++++++++++ .../java/com/nedap/archie/util/KryoUtil.java | 3 ++ .../com/nedap/archie/util/URISerializer.java | 25 +++++++++++ .../com/nedap/archie/util/CloneUtilTest.java | 23 +++++++++++ 9 files changed, 107 insertions(+), 37 deletions(-) create mode 100644 utils/src/main/java/com/nedap/archie/util/CloneUtil.java create mode 100644 utils/src/main/java/com/nedap/archie/util/URISerializer.java create mode 100644 utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java diff --git a/aom/src/main/java/com/nedap/archie/aom/ArchetypeModelObject.java b/aom/src/main/java/com/nedap/archie/aom/ArchetypeModelObject.java index e65d05aef..9b90cab79 100644 --- a/aom/src/main/java/com/nedap/archie/aom/ArchetypeModelObject.java +++ b/aom/src/main/java/com/nedap/archie/aom/ArchetypeModelObject.java @@ -1,8 +1,7 @@ package com.nedap.archie.aom; -import com.esotericsoftware.kryo.kryo5.Kryo; import com.nedap.archie.base.OpenEHRBase; -import com.nedap.archie.util.KryoUtil; +import com.nedap.archie.util.CloneUtil; import java.io.Serializable; @@ -13,14 +12,9 @@ //@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class") public abstract class ArchetypeModelObject extends OpenEHRBase implements Serializable, Cloneable { + @SuppressWarnings("MethodDoesntCallSuperMethod") public ArchetypeModelObject clone() { - Kryo kryo = null; - try { - kryo = KryoUtil.getPool().obtain(); - return kryo.copy(this); - } finally { - KryoUtil.getPool().free(kryo); - } + return CloneUtil.clone(this); } } diff --git a/bmm/src/main/java/org/openehr/bmm/v2/persistence/PBmmBase.java b/bmm/src/main/java/org/openehr/bmm/v2/persistence/PBmmBase.java index 9c6ae3683..90bde6fe3 100644 --- a/bmm/src/main/java/org/openehr/bmm/v2/persistence/PBmmBase.java +++ b/bmm/src/main/java/org/openehr/bmm/v2/persistence/PBmmBase.java @@ -1,20 +1,13 @@ package org.openehr.bmm.v2.persistence; -import com.esotericsoftware.kryo.kryo5.Kryo; import com.nedap.archie.base.OpenEHRBase; -import com.nedap.archie.util.KryoUtil; +import com.nedap.archie.util.CloneUtil; public class PBmmBase extends OpenEHRBase { + @SuppressWarnings("MethodDoesntCallSuperMethod") public PBmmBase clone() { - Kryo kryo = null; - try { - kryo = KryoUtil.getPool().obtain(); - return kryo.copy(this); - } - finally { - KryoUtil.getPool().free(kryo); - } + return CloneUtil.clone(this); } protected boolean nullToFalse(Boolean value) { diff --git a/openehr-rm/src/main/java/com/nedap/archie/rm/RMObject.java b/openehr-rm/src/main/java/com/nedap/archie/rm/RMObject.java index d14092f27..6f323b534 100644 --- a/openehr-rm/src/main/java/com/nedap/archie/rm/RMObject.java +++ b/openehr-rm/src/main/java/com/nedap/archie/rm/RMObject.java @@ -1,8 +1,7 @@ package com.nedap.archie.rm; -import com.esotericsoftware.kryo.kryo5.Kryo; import com.nedap.archie.base.OpenEHRBase; -import com.nedap.archie.util.KryoUtil; +import com.nedap.archie.util.CloneUtil; import java.io.Serializable; @@ -13,14 +12,9 @@ */ public abstract class RMObject extends OpenEHRBase implements Serializable, Cloneable { + @SuppressWarnings("MethodDoesntCallSuperMethod") public RMObject clone() { - Kryo kryo = null; - try { - kryo = KryoUtil.getPool().obtain(); - return kryo.copy(this); - } finally { - KryoUtil.getPool().free(kryo); - } + return CloneUtil.clone(this); } } diff --git a/tools/src/main/java/com/nedap/archie/flattener/FlattenerConfiguration.java b/tools/src/main/java/com/nedap/archie/flattener/FlattenerConfiguration.java index f17f4010e..84788f7ce 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/FlattenerConfiguration.java +++ b/tools/src/main/java/com/nedap/archie/flattener/FlattenerConfiguration.java @@ -1,7 +1,6 @@ package com.nedap.archie.flattener; -import com.esotericsoftware.kryo.kryo5.Kryo; -import com.nedap.archie.util.KryoUtil; +import com.nedap.archie.util.CloneUtil; public class FlattenerConfiguration { @@ -128,14 +127,9 @@ public void setLanguagesToKeep(String[] languagesToKeep) { this.languagesToKeep = languagesToKeep; } + @SuppressWarnings("MethodDoesntCallSuperMethod") public FlattenerConfiguration clone() { - Kryo kryo = null; - try { - kryo = KryoUtil.getPool().obtain(); - return kryo.copy(this); - } finally { - KryoUtil.getPool().free(kryo); - } + return CloneUtil.clone(this); } public boolean isReplaceUseNode() { diff --git a/utils/src/main/java/com/nedap/archie/kryo/URISerializer.java b/utils/src/main/java/com/nedap/archie/kryo/URISerializer.java index 5961123ee..49b54a202 100644 --- a/utils/src/main/java/com/nedap/archie/kryo/URISerializer.java +++ b/utils/src/main/java/com/nedap/archie/kryo/URISerializer.java @@ -11,7 +11,10 @@ * A safe serializer for java.net.URI to better support cloning of a DvUri RMObject. * This implementation is functionally correct, but irrelevant because we only clone objects. * Should be removed in Kryo 6 where it will be registered by default. + * + * @deprecated This class will be removed. Use {@link com.nedap.archie.util.CloneUtil} instead. */ +@Deprecated public class URISerializer extends ImmutableSerializer { @Override diff --git a/utils/src/main/java/com/nedap/archie/util/CloneUtil.java b/utils/src/main/java/com/nedap/archie/util/CloneUtil.java new file mode 100644 index 000000000..417cd4009 --- /dev/null +++ b/utils/src/main/java/com/nedap/archie/util/CloneUtil.java @@ -0,0 +1,41 @@ +package com.nedap.archie.util; + +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.util.Pool; + +import java.net.URI; + +/** + * Utility class for cloning objects. + */ +public class CloneUtil { + private static final Pool pool = new Pool(true, false) { + protected Kryo create() { + Kryo kryo = new Kryo(); + kryo.setRegistrationRequired(false); + kryo.setReferences(true); + kryo.setCopyReferences(true); + kryo.addDefaultSerializer(URI.class, new URISerializer()); + return kryo; + } + }; + + /** + * Returns a deep copy of the object. + * + * @param original Object to copy. May be null. + * @return Deep copy of the object, or null if the original was null. + */ + public static T clone(T original) { + Kryo kryo = pool.obtain(); + try { + return kryo.copy(original); + } finally { + pool.free(kryo); + } + } + + private CloneUtil() { + // Not allowed. + } +} diff --git a/utils/src/main/java/com/nedap/archie/util/KryoUtil.java b/utils/src/main/java/com/nedap/archie/util/KryoUtil.java index 131de8448..b79edb854 100644 --- a/utils/src/main/java/com/nedap/archie/util/KryoUtil.java +++ b/utils/src/main/java/com/nedap/archie/util/KryoUtil.java @@ -8,7 +8,10 @@ /** * Created by pieter.bos on 03/11/15. + * + * @deprecated This class will be removed. Use {@link CloneUtil} instead. */ +@Deprecated public class KryoUtil { // Build pool with SoftReferences enabled (optional) diff --git a/utils/src/main/java/com/nedap/archie/util/URISerializer.java b/utils/src/main/java/com/nedap/archie/util/URISerializer.java new file mode 100644 index 000000000..b1325bd3c --- /dev/null +++ b/utils/src/main/java/com/nedap/archie/util/URISerializer.java @@ -0,0 +1,25 @@ +package com.nedap.archie.util; + +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; +import com.esotericsoftware.kryo.kryo5.serializers.ImmutableSerializer; + +import java.net.URI; + +/** + * A safe serializer for java.net.URI to better support cloning of a DvUri RMObject. + * This implementation is functionally correct, but irrelevant because we only clone objects. + * Should be removed in Kryo 6 where it will be registered by default. + */ +class URISerializer extends ImmutableSerializer { + @Override + public void write(final Kryo kryo, final Output output, final URI uri) { + output.writeString(uri.toString()); + } + + @Override + public URI read(final Kryo kryo, final Input input, final Class uriClass) { + return URI.create(input.readString()); + } +} diff --git a/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java b/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java new file mode 100644 index 000000000..c765592da --- /dev/null +++ b/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java @@ -0,0 +1,23 @@ +package com.nedap.archie.util; + +import com.nedap.archie.base.Cardinality; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class CloneUtilTest { + @Test + public void testClone() { + Cardinality original = new Cardinality(1, 5); + Cardinality clone = CloneUtil.clone(original); + assertNotSame(original, clone); + assertEquals(original, clone); + } + + @Test + public void testCloneNull() { + Cardinality original = null; + Cardinality clone = CloneUtil.clone(original); + assertNull(clone); + } +} From f2e8f5716f1d16a0c2308263da862df4b523872e Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 12 Feb 2026 14:36:49 +0100 Subject: [PATCH 32/60] Deprecate various classes and methods (#744) * Deprecate FileAndDirUtils and related classes as they are unused This allows us to remove Apache Commons IO from our public API. * Deprecate NamingUtil as it is unused * Deprecate CustomVersionComparator to make it non-public This allows us to remove zafarkhaja SemVer from our public API. * Deprecate ReflectionModelInfoLookup.addRMAttributeInfo This method will become private so we can remove the Google Guava from our public API. --- .../rminfo/ReflectionModelInfoLookup.java | 4 ++ .../flattener/CustomVersionComparator.java | 3 ++ .../com/nedap/archie/util/NamingUtil.java | 31 +++++++++++++++ .../openehr/utils/file/FileAndDirUtils.java | 39 +++++++++++++++++++ .../utils/operation/OperationOutcome.java | 15 +++++++ .../operation/OperationOutcomeStatus.java | 2 + .../utils/file/FileAndDirUtilsTest.java | 2 +- 7 files changed, 95 insertions(+), 1 deletion(-) diff --git a/aom/src/main/java/com/nedap/archie/rminfo/ReflectionModelInfoLookup.java b/aom/src/main/java/com/nedap/archie/rminfo/ReflectionModelInfoLookup.java index 0e12ad1f7..5f7609ab6 100644 --- a/aom/src/main/java/com/nedap/archie/rminfo/ReflectionModelInfoLookup.java +++ b/aom/src/main/java/com/nedap/archie/rminfo/ReflectionModelInfoLookup.java @@ -205,6 +205,10 @@ protected boolean shouldAdd(Method method) { return Modifier.isPublic(method.getModifiers()) && method.getAnnotation(RMPropertyIgnore.class) == null; } + /** + * @deprecated This method will become private. + */ + @Deprecated protected void addRMAttributeInfo(Class clazz, RMTypeInfo typeInfo, TypeToken typeToken, Method getMethod, Map fieldsByName) { String javaFieldName = null; if(getMethod.getName().startsWith("is")) { diff --git a/tools/src/main/java/com/nedap/archie/flattener/CustomVersionComparator.java b/tools/src/main/java/com/nedap/archie/flattener/CustomVersionComparator.java index 4191517ee..501ec85f4 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/CustomVersionComparator.java +++ b/tools/src/main/java/com/nedap/archie/flattener/CustomVersionComparator.java @@ -7,7 +7,10 @@ /** * @author vera.prinsen * Created on 10/06/2020 + * + * @deprecated This class will become non-public. Use {@link ArchetypeHRIDMap} instead. */ +@Deprecated public class CustomVersionComparator implements Comparator { Comparator versionComparator = Comparator.comparingInt(Version::getMajorVersion) diff --git a/utils/src/main/java/com/nedap/archie/util/NamingUtil.java b/utils/src/main/java/com/nedap/archie/util/NamingUtil.java index 0cc3f3f8b..846e52d33 100644 --- a/utils/src/main/java/com/nedap/archie/util/NamingUtil.java +++ b/utils/src/main/java/com/nedap/archie/util/NamingUtil.java @@ -6,33 +6,64 @@ * Converts java names to openEHR names and vice versa * * Created by pieter.bos on 10/11/15. + * + * @deprecated This class is unused and will be removed. */ +@Deprecated public class NamingUtil { + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String typeIdToClassName(String typeId) { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, typeId); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String classNameToTypeId(String className) { return CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, className); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String attributeToField(String attributeName) { return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, attributeName); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String fieldToAttributeName(String fieldName) { return CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, fieldName); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String attributeNameToTypeId(String attributeName) { return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, attributeName); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String attributeNameToGetMethod(String snakeCased) { return "get" + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, snakeCased); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static String attributeNameToSetMethod(String snakeCased) { return "set" + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, snakeCased); } diff --git a/utils/src/main/java/org/openehr/utils/file/FileAndDirUtils.java b/utils/src/main/java/org/openehr/utils/file/FileAndDirUtils.java index bb0e2bbfc..ea264a395 100644 --- a/utils/src/main/java/org/openehr/utils/file/FileAndDirUtils.java +++ b/utils/src/main/java/org/openehr/utils/file/FileAndDirUtils.java @@ -32,7 +32,10 @@ /** * File utility class + * + * @deprecated This class is unused and will be removed. */ +@Deprecated public class FileAndDirUtils { /** @@ -43,7 +46,9 @@ public class FileAndDirUtils { * * @param directories * @return + * @deprecated This class is unused and will be removed. */ + @Deprecated public static List> loadDirectories(List directories) { List> loadedDirectories = new ArrayList<>(); directories.forEach( directoryPath -> { @@ -64,7 +69,9 @@ public static List> loadDirectories(List director * @param fileFilter The filtering criterion * @param recursive Flag indicating whether to recurse down directories * @return + * @deprecated This class is unused and will be removed. */ + @Deprecated public static List filterFilesFromDirectories(List directories, IOFileFilter fileFilter, boolean recursive) { List loadedFiles = new ArrayList<>(); directories.forEach( dir -> { @@ -73,6 +80,10 @@ public static List filterFilesFromDirectories(List directories, IOFi return loadedFiles; } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static List loadFilesWithExtensionFromDirectoryPaths(List directories, String extension, boolean recursive) { IOFileFilter filter = new IOFileFilter() { @Override @@ -88,6 +99,10 @@ public boolean accept(File file, String s) { return filterFilesFromDirectories(directories, filter, recursive); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static List loadFilesWithExtensionFromDirectories(List directoryPaths, String extension, boolean recursive) { List directories = new ArrayList<>(); List> loadedDirectories = FileAndDirUtils.loadDirectories(directoryPaths); @@ -99,6 +114,10 @@ public static List loadFilesWithExtensionFromDirectories(List dire return loadFilesWithExtensionFromDirectoryPaths(directories, extension, recursive); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static void copyStreamToTargetFile(String sourceClassPath, String destinationFilePath) { InputStream is = FileAndDirUtils.class.getResourceAsStream(sourceClassPath); File destination = new File(destinationFilePath); @@ -110,6 +129,10 @@ public static void copyStreamToTargetFile(String sourceClassPath, String destina } } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static void copyFileToDirectory(String filePath, String dirPath) { File source = new File(filePath); File dest = new File(dirPath); @@ -121,6 +144,10 @@ public static void copyFileToDirectory(String filePath, String dirPath) { } } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static void copyFileToDirectory(File fileToCopy, String dirPath) { File dest = new File(dirPath); try { @@ -131,6 +158,10 @@ public static void copyFileToDirectory(File fileToCopy, String dirPath) { } } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static void copyFileToDirectory(File fileToCopy, File destination) { try { FileUtils.copyFileToDirectory(fileToCopy, destination); @@ -140,6 +171,10 @@ public static void copyFileToDirectory(File fileToCopy, File destination) { } } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static void copyDirectoryAndContent(String sourceDirPath, String destDirPath) { File source = new File(sourceDirPath); File dest = new File(destDirPath); @@ -151,6 +186,10 @@ public static void copyDirectoryAndContent(String sourceDirPath, String destDirP } } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public static File getResourceAsFile(String resourcePath) { try { InputStream in = FileAndDirUtils.class.getResourceAsStream(resourcePath); diff --git a/utils/src/main/java/org/openehr/utils/operation/OperationOutcome.java b/utils/src/main/java/org/openehr/utils/operation/OperationOutcome.java index d4336a94d..c65d5b606 100644 --- a/utils/src/main/java/org/openehr/utils/operation/OperationOutcome.java +++ b/utils/src/main/java/org/openehr/utils/operation/OperationOutcome.java @@ -22,21 +22,36 @@ * Class representing the outcome of an operation including the return value, * a flag indicating success or failure, and the exception thrown by the operation * if any. + * + * @deprecated This class is unused and will be removed. */ +@Deprecated public class OperationOutcome { private T result; private OperationOutcomeStatus status; private Exception exception; + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public OperationOutcome(T result) { this(result, OperationOutcomeStatus.SUCCESS, null); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public OperationOutcome(T result, OperationOutcomeStatus status) { this(result, status, null); } + /** + * @deprecated This class is unused and will be removed. + */ + @Deprecated public OperationOutcome(T result, OperationOutcomeStatus status, Exception exception) { this.result = result; this.status = status; diff --git a/utils/src/main/java/org/openehr/utils/operation/OperationOutcomeStatus.java b/utils/src/main/java/org/openehr/utils/operation/OperationOutcomeStatus.java index be20a50e2..dc187ab6c 100644 --- a/utils/src/main/java/org/openehr/utils/operation/OperationOutcomeStatus.java +++ b/utils/src/main/java/org/openehr/utils/operation/OperationOutcomeStatus.java @@ -16,8 +16,10 @@ * limitations under the License. *

* Created by cnanjo on 1/17/17. + * @deprecated This class is unused and will be removed. */ +@Deprecated public enum OperationOutcomeStatus { SUCCESS, FAILURE diff --git a/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java b/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java index f85ced331..a300afc45 100644 --- a/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java +++ b/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java @@ -29,7 +29,7 @@ *

* Created by cnanjo on 1/17/17. */ - +@Deprecated public class FileAndDirUtilsTest { @Test public void loadDirectories() throws Exception { From 6b30eb96039edc13645ebfcbd78ee7acdb753a58 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:24:16 +0100 Subject: [PATCH 33/60] Update Archie to version 3.17.0 (#749) --- README.md | 6 +++--- build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ef0362f6..1370b266c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can depend on parts of Archie, or the entire library at once. If you want th ```gradle dependencies { - compile 'com.nedap.healthcare.archie:archie-all:3.16.0' + compile 'com.nedap.healthcare.archie:archie-all:3.17.0' } ``` @@ -28,11 +28,11 @@ or if you use maven, in your pom.xml com.nedap.healthcare.archie archie-all - 3.16.0 + 3.17.0 ``` -If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.16.0 and com.nedap.healthcare.archie:referencemodels:3.16.0 instead +If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.17.0 and com.nedap.healthcare.archie:referencemodels:3.17.0 instead ## Build diff --git a/build.gradle b/build.gradle index f47bcc2f9..a1f3c2276 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ repositories { allprojects { - version = '3.16.0' + version = '3.17.0' group = 'com.nedap.healthcare.archie' ext.gradleScriptDir = "${rootProject.projectDir}/gradle" //archivesBaseName = 'archie' From f798e44f90470e7a0f5e6e9dd805e30020cca2a2 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Tue, 17 Feb 2026 11:19:40 +0100 Subject: [PATCH 34/60] In rule prefixes, replaces dashes and convert to lower case (#748) --- .../com/nedap/archie/flattener/Flattener.java | 4 +- .../flattener/OperationalTemplateCreator.java | 4 +- .../archie/flattener/RulesFlattenerTest.java | 9 +- ...R-EHR-COMPOSITION.containing_rules.v1.adls | 1 + ...ATION.With-rules-Mixed-case-dashes.v1.adls | 94 +++++++++++++++++++ 5 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.adls diff --git a/tools/src/main/java/com/nedap/archie/flattener/Flattener.java b/tools/src/main/java/com/nedap/archie/flattener/Flattener.java index 7b56e59f3..8e880716a 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/Flattener.java +++ b/tools/src/main/java/com/nedap/archie/flattener/Flattener.java @@ -198,7 +198,9 @@ public Archetype flatten(Archetype toFlatten) { prohibitZeroOccurrencesConstraints(result); } - String prefix = child.getArchetypeId().getConceptId() + "_"; + // Replaces dashes and convert to lower case, as dashes and variables starting with an upper case letter + // aren't allowed everywhere. + String prefix = child.getArchetypeId().getConceptId().replace("-", "_").toLowerCase() + "_"; //Use empty tagPrefix here. If not empty, overridden rules in specialized archetype will not overwrite base rules, //but be added to the rules section additionally to the base rules. rulesFlattener.combineRules(child, result, prefix, "", "", true /* override statements with same tag */); diff --git a/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java b/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java index 76e292152..807db5728 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java +++ b/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java @@ -248,7 +248,9 @@ private void fillArchetypeRoot(CArchetypeRoot root, OperationalTemplate result) result.addComponentTerminology(newNodeId, terminology); - String prefix = archetype.getArchetypeId().getConceptId() + "_"; + // Replaces dashes and convert to lower case, as dashes and variables starting with an upper case letter + // aren't allowed everywhere. + String prefix = archetype.getArchetypeId().getConceptId().replace("-", "_").toLowerCase() + "_"; flattener.getRulesFlattener().combineRules(archetype, root.getArchetype(), prefix, prefix, rootToFill.getPath(), false); flattener.getAnnotationsAndOverlaysFlattener().addAnnotationsWithPathPrefix(rootToFill.getPath(), archetype, result); flattener.getAnnotationsAndOverlaysFlattener().addVisibilityWithPathPrefix(rootToFill.getPath(), archetype, result); diff --git a/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java index e076ebe3b..bf085f358 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java @@ -32,11 +32,13 @@ public void setup() throws Exception { models = BuiltinReferenceModels.getAvailableModelInfoLookups(); withRules = new ADLParser().parse(FlattenerTest.class.getResourceAsStream("openEHR-EHR-OBSERVATION.with_rules.v1.adls")); + Archetype withRulesMixedCaseDashes = new ADLParser().parse(FlattenerTest.class.getResourceAsStream("openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.adls")); specializedRules = new ADLParser().parse(FlattenerTest.class.getResourceAsStream("openEHR-EHR-OBSERVATION.specialized_rules.v1.adls")); containingRules = new ADLParser().parse(FlattenerTest.class.getResourceAsStream("openEHR-EHR-COMPOSITION.containing_rules.v1.adls")); repository = new SimpleArchetypeRepository(); repository.addArchetype(withRules); + repository.addArchetype(withRulesMixedCaseDashes); repository.addArchetype(specializedRules); repository.addArchetype(containingRules); @@ -75,7 +77,7 @@ public void flattenedRules() throws Exception { CObject systolicCObject = flattened.itemAtPath("/content[id5]/data/events/data/items[id5]"); assertEquals("systolic", systolicCObject.getTerm().getText()); - assertEquals(5, flattened.getRules().getRules().size()); //specialized rules, prefixed with the content[id5] path + assertEquals(9, flattened.getRules().getRules().size()); //specialized rules, prefixed with the content[id5] path ExpressionVariable systolic = (ExpressionVariable) flattened.getRules().getRules().get(0); ExpressionVariable diastolic = (ExpressionVariable) flattened.getRules().getRules().get(1); @@ -91,6 +93,11 @@ public void flattenedRules() throws Exception { assertEquals("/content[id5]/data[id2]/events[id3]/data[id4]/items[id6]/value/magnitude", ((ModelReference) ((Function) flattenedPathArguments.getExpression()).getArguments().get(1)).getPath()); assertEquals("/content[id5]", ((ModelReference)((ForAllStatement)biggerThan90.getExpression()).getPathExpression()).getPath()); + assertEquals("with_rules_mixed_case_dashes_systolic", ((ExpressionVariable) flattened.getRules().getRules().get(5)).getName()); + assertEquals("with_rules_mixed_case_dashes_Diastolic", ((ExpressionVariable) flattened.getRules().getRules().get(6)).getName()); + assertEquals("with_rules_mixed_case_dashes_Blood_Pressure", ((Assertion) flattened.getRules().getRules().get(7)).getTag()); + assertEquals("with_rules_mixed_case_dashes_flattened_path_arguments", ((ExpressionVariable) flattened.getRules().getRules().get(8)).getName()); + //test that we can actually parse the output ADLParser parser = new ADLParser(); parser.parse(ADLArchetypeSerializer.serialize(flattened)); diff --git a/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-COMPOSITION.containing_rules.v1.adls b/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-COMPOSITION.containing_rules.v1.adls index 4487f1c19..410f8ef63 100644 --- a/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-COMPOSITION.containing_rules.v1.adls +++ b/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-COMPOSITION.containing_rules.v1.adls @@ -26,6 +26,7 @@ definition COMPOSITION[id1] matches { -- Blood pressure result content matches { use_archetype OBSERVATION[id5, openEHR-EHR-OBSERVATION.specialized_rules.v1.0.0] + use_archetype OBSERVATION[id6, openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.0.0] } } diff --git a/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.adls b/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.adls new file mode 100644 index 000000000..fec33468d --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/flattener/openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.adls @@ -0,0 +1,94 @@ +archetype (adl_version=2.0.5; rm_release=1.0.2; generated) + openEHR-EHR-OBSERVATION.With-rules-Mixed-case-dashes.v1.0.0 + +language + original_language = <[ISO_639-1::en]> + +description + original_author = < + ["name"] = <"Pieter Bos"> + > + details = < + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"Test for rules, simple constant arithmetics"> + keywords = <"ADL", "test"> + > + > + lifecycle_state = <"published"> + other_details = < + ["regression"] = <"PASS"> + > + copyright = <"copyright © 2004 openEHR Foundation "> + +definition + OBSERVATION[id1] matches { -- Body mass index + data matches { + HISTORY[id2] matches { + events cardinality matches {1..*; unordered} matches { + EVENT[id3] occurrences matches {1..*} matches { -- Any event + data matches { + ITEM_TREE[id4] matches { + items cardinality matches {3; unordered} matches { + ELEMENT[id5] matches { -- systolic pressure + value matches { + DV_QUANTITY[id13] matches { + [magnitude, units, precision] matches { + [{|0.0..<1000.0|}, {"mmHg"}, {1}] + } + } + } + } + ELEMENT[id6] matches { -- diastolic pressure + value matches { + DV_QUANTITY[id14] matches { + [magnitude, units, precision] matches { + [{|0.0..<1000.0|}, {"mmHg"}, {1}] + } + } + } + } + ELEMENT[id7] matches { -- difference between systolic and diastolic. For testing purposes :) + value matches { + DV_QUANTITY[id15] matches { + [magnitude, units, precision] matches { + [{|0.0..<1000.0|}, {"mmHg"}, {1}] + } + } + } + } + } + } + } + } + } + } + } + } + +rules + $systolic:Real ::= /data[id2]/events[id3]/data[id4]/items[id5]/value/magnitude + + $Diastolic:Real ::= /data[id2]/events[id3]/data[id4]/items[id6]/value/magnitude + + Blood_Pressure: /data[id2]/events[id3]/data[id4]/items[id7]/value/magnitude = $systolic - $Diastolic + + $flattened_path_arguments:Real ::= min( + /data[id2]/events[id3]/data[id4]/items[id5]/value/magnitude, + /data[id2]/events[id3]/data[id4]/items[id6]/value/magnitude + ) + +terminology + term_definitions = < + ["en"] = < + ["id1"] = < + text = <"Blood Pressure"> + description = <"The local measurement of arterial blood pressure which is a surrogate for arterial. pressure in the systemic circulation. Most commonly, use of the term 'blood pressure' refers to measurement of brachial artery pressure in the upper arm."> + > + ["id5"] = < + text = <"systolic"> + description = <"Systolic Pressure"> + > + > + > + From 53253e5ede381dba183df938408f2d5279e3b5b5 Mon Sep 17 00:00:00 2001 From: JoshuaForssmanNedap Date: Mon, 23 Feb 2026 09:32:59 +0100 Subject: [PATCH 35/60] Upgrade from JUnit 4 to JUnit 5 (#745) * Upgrading to junit 5 initial steps * Upgrade version * Revert version * Revert version * Changes for migrating to junit 5 * Remove vintage Junit5 dependency * Changes for migrating to junit 5, removal of all deprecated junit4 code. * Adding relevant imports --- .../nedap/archie/aom/ArchetypeHRIDTest.java | 4 +- .../com/nedap/archie/aom/ArchetypeTest.java | 4 +- .../nedap/archie/aom/utils/AOMUtilsTest.java | 4 +- .../archie/rminfo/AttributeAccessorTest.java | 32 +++--- .../rminfo/SpecificMethodSelectorTest.java | 6 +- .../archie/base/IntervalOfPeriodTest.java | 6 +- .../archie/base/MultiplicityIntervalTest.java | 4 +- .../bmm/core/BmmPackageContainerTest.java | 6 +- .../validation/BmmMessageIdsTest.java | 8 +- .../utils/ReferenceModelVersionUtilsTest.java | 6 +- .../converters/BmmParseRoundtripTest.java | 2 +- .../converters/ConversionTest.java | 18 ++-- .../converters/PBmmEqualsAssertions.java | 2 +- .../converters/RM102ConversionTest.java | 52 ++++----- .../persistence/odin/BmmOdinParserTest.java | 2 +- .../BasicSchemaValidationsTest.java | 4 +- .../validation/ClassesValidatorTest.java | 4 +- .../CreatedSchemaValidationTest.java | 4 +- .../validation/IncludesValidatorTest.java | 4 +- .../validation/PropertyValidatorTest.java | 4 +- build.gradle | 3 +- gradle/libs.versions.toml | 3 +- .../openehr/utils/message/I18nFilesTest.java | 4 +- .../odin/AdlOdinToJsonConverterTest.java | 8 +- .../odin/OdinToJsonConverterBaseTest.java | 2 +- .../odin/OdinToJsonConverterTest.java | 8 +- .../archie/serializer/odin/URIParserTest.java | 4 +- .../antlr/OdinBaseVisitorReferencingTest.java | 6 +- .../odin/antlr/OdinBaseVisitorTest.java | 100 +++++++++--------- .../odin/antlr/OdinBaseVisitorTest2.java | 14 +-- .../odin/jackson/OdinSerializeTest.java | 2 +- .../utils/OdinSerializationUtilsTest.java | 4 +- .../rm/changecontrol/ContributionTest.java | 4 +- .../rm/composition/CompositionTest.java | 4 +- .../rm/composition/ObservationTest.java | 4 +- .../archie/rm/datastructures/ClusterTest.java | 6 +- .../rm/datastructures/ItemListTest.java | 6 +- .../rm/datastructures/ItemTableTest.java | 4 +- .../rm/datastructures/ItemTreeTest.java | 6 +- .../archie/rm/datatypes/CodePhraseTest.java | 12 +-- .../archie/rm/datavalues/DvBooleanTest.java | 6 +- .../archie/rm/datavalues/DvCodedTextTest.java | 6 +- .../archie/rm/datavalues/DvParsableTest.java | 4 +- .../nedap/archie/rm/datavalues/DvURITest.java | 6 +- .../quantity/datetime/DvDateTest.java | 4 +- .../quantity/datetime/DvDateTimeTest.java | 4 +- .../quantity/datetime/DvDurationTest.java | 4 +- .../quantity/datetime/DvTimeTest.java | 4 +- .../datetime/TimeDefinitionsTest.java | 4 +- .../nedap/archie/rm/directory/FolderTest.java | 6 +- .../nedap/archie/rm/ehr/EhrStatusTest.java | 6 +- .../java/com/nedap/archie/rm/ehr/EhrTest.java | 4 +- .../identification/ArchetypeIDTest.java | 4 +- .../identification/HierObjectIdTest.java | 4 +- .../identification/ObjectVersionIdTest.java | 4 +- .../identification/TerminologyIdTest.java | 6 +- .../identification/VersionTreeIdTest.java | 6 +- .../OpenEHRTerminologyAccessTest.java | 14 +-- .../nedap/archie/query/RMPathQueryTest.java | 8 +- .../OverridingMetaModelProviderTest.java | 4 +- .../rminfo/SimpleMetaModelProviderTest.java | 4 +- .../AOMComparedWithBmmTest.java | 14 +-- .../BuiltInReferenceModelsTest.java | 4 +- .../RMComparedWithBmmTest.java | 10 +- ...ADL14DefaultOccurrencesConversionTest.java | 18 ++-- ...DL14ExternalTerminologyConversionTest.java | 38 +++---- .../adl14/ADL14InternalTerminologyTest.java | 18 ++-- .../adl14/ADL14TerminologyConversionTest.java | 18 ++-- .../adl14/ArchetypeSlotConversionTest.java | 4 +- .../adl14/AssumedValueConversionTest.java | 7 +- .../adl14/ConversionConfigurationTest.java | 4 +- .../archie/adl14/DvScaleConversionTest.java | 8 +- .../archie/adl14/LargeSetOfADL14sTest.java | 10 +- .../adl14/PreviousLogConversionTest.java | 18 ++-- .../archie/adlparser/AOMPathQueryTest.java | 45 ++++---- .../adlparser/AomUtilsPathFindingTest.java | 6 +- .../archie/adlparser/CStringParserTest.java | 6 +- .../ComponentTerminologiesParseTest.java | 4 +- .../archie/adlparser/DefinitionTest.java | 8 +- .../archie/adlparser/LargeSetOfADLsTest.java | 4 +- .../nedap/archie/adlparser/MetadataTest.java | 4 +- .../adlparser/NumberConstraintParserTest.java | 6 +- .../com/nedap/archie/adlparser/PathTest.java | 12 +-- .../PrimitivesConstraintParserTest.java | 4 +- .../archie/adlparser/RMPathQueryTest.java | 10 +- .../com/nedap/archie/adlparser/RegexTest.java | 4 +- .../TemporalConstraintParserTest.java | 8 +- .../archie/adlparser/TerminologyTest.java | 10 +- .../RMConstraintImposerTest.java | 8 +- .../nedap/archie/aom/ArchetypeCloneTest.java | 13 ++- .../nedap/archie/aom/ArchetypeSlotTest.java | 4 +- .../archie/aom/ArchetypeTerminologyTest.java | 13 +-- .../aom/AttributeTupleConstraintsTest.java | 8 +- .../archie/aom/BooleanConstraintsTest.java | 6 +- .../com/nedap/archie/aom/CAttributeTest.java | 4 +- .../archie/aom/CComplexObjectProxyTest.java | 4 +- .../nedap/archie/aom/CComplexObjectTest.java | 6 +- .../com/nedap/archie/aom/CObjectTest.java | 10 +- .../archie/aom/CPrimitiveObjectTest.java | 4 +- .../nedap/archie/aom/DateConstraintsTest.java | 6 +- .../archie/aom/MultiplicityIntervalTest.java | 6 +- .../archie/aom/NumberConstraintsTest.java | 6 +- .../archie/aom/StringConstraintsTest.java | 6 +- .../aom/TerminologyCodeConstraintsTest.java | 12 +-- .../nedap/archie/aom/TimeConstraintsTest.java | 6 +- .../ArchetypeValidatorTest.java | 45 ++++---- .../ArchetypeValidatorVersionsTest.java | 9 +- .../BigArchetypeValidatorTest.java | 8 +- .../CKMArchetypeValidatorTest.java | 7 +- .../ComplexArchetypeValidatorTest.java | 8 +- .../TermCodeSpecializationTest.java | 25 ++--- .../ExampleJsonInstanceGeneratorTest.java | 20 ++-- .../archie/creation/RMObjectCreatorTest.java | 29 ++--- .../diff/AnnotationDifferentiatorTest.java | 8 +- .../com/nedap/archie/diff/DiffTestUtil.java | 2 +- .../com/nedap/archie/diff/NodeIdLCSTest.java | 4 +- .../archie/diff/SiblingOrderDiffTest.java | 6 +- .../DifferentiatorExamplesFromSpecTest.java | 6 +- .../flattener/AnnotationsFlattenerTest.java | 10 +- .../flattener/ArchetypeHRIDMapTest.java | 6 +- .../nedap/archie/flattener/FlattenerTest.java | 12 +-- .../InMemoryFullArchetypeRepositoryTest.java | 8 +- .../OperationalTemplateCreatorTest.java | 28 ++--- .../flattener/RMOverlayFlattenerTest.java | 8 +- .../archie/flattener/RulesFlattenerTest.java | 10 +- .../flattener/SiblingOrderFlattenerTest.java | 18 ++-- .../FlattenerExamplesFromSpecBMMTest.java | 4 +- .../FlattenerExamplesFromSpecTest.java | 50 +++++---- .../specexamples/FlattenerTestUtil.java | 7 +- .../TerminologyFlattenerExamplesFromSpec.java | 10 +- .../com/nedap/archie/json/AOMJacksonTest.java | 9 +- .../archie/json/JSONSchemaCreatorTest.java | 2 +- .../archie/json/JacksonRMRoundTripTest.java | 10 +- .../com/nedap/archie/json/RMJacksonTest.java | 9 +- .../flat/ArchetypeParsePostProcessorTest.java | 4 +- .../json/flat/FlatJsonGeneratorTest.java | 11 +- .../nedap/archie/kryo/URISerializerTest.java | 6 +- .../nedap/archie/paths/PathSegmentTest.java | 4 +- .../query/APathToXPathConverterTest.java | 4 +- .../archie/query/RMObjectAttributesTest.java | 8 +- .../archie/query/RMQueryContextTest.java | 10 +- .../com/nedap/archie/rm/LocatableTest.java | 4 +- .../archie/rminfo/ArchieRMInfoLookupTest.java | 9 +- .../AttributeTupleConstraintsTest.java | 8 +- .../ConstraintToStringUtilTest.java | 4 +- .../PrimitiveObjectConstraintHelperTest.java | 6 +- .../RmObjectValidatorTest.java | 37 +++---- .../RmPrimitiveObjectValidatorTest.java | 4 +- .../RmTupleValidatorTest.java | 4 +- .../TerminologyCodeConstraintsTest.java | 12 +-- .../ValidateArchetypedTest.java | 12 +-- .../invariants/EventContextInvariantTest.java | 2 +- .../FeederAuditDetailsInvariantTest.java | 2 +- .../invariants/FolderInvariantTest.java | 2 +- .../invariants/IntervalInvariantTest.java | 2 +- .../invariants/InvariantTestUtil.java | 9 +- .../ParticipationInvariantTest.java | 2 +- .../invariants/PartyRelatedInvariantTest.java | 2 +- .../invariants/TermMappingInvariantTest.java | 2 +- .../base/PartyRefInvariantTest.java | 2 +- .../invariants/base/UIDInvariantTest.java | 2 +- .../base/VersionTreeIdInvariantTest.java | 2 +- .../AuditDetailsInvariantTest.java | 2 +- .../OriginalVersionInvariantTest.java | 2 +- .../datastructures/ElementInvariantTest.java | 2 +- .../ItemTableInvariantTest.java | 2 +- .../datavalues/CodePhraseInvariantTest.java | 2 +- .../datavalues/DvDurationInvariantTest.java | 2 +- .../datavalues/DvEhrUriInvariantTest.java | 6 +- .../datavalues/DvIdentifierInvariantTest.java | 2 +- .../datavalues/DvIntervalInvariantTest.java | 2 +- .../datavalues/DvMultimediaInvariantTest.java | 2 +- .../datavalues/DvParsableInvariantTest.java | 2 +- ...eriodicTimeSpecificationInvariantTest.java | 2 +- .../datavalues/DvProportionInvariantTest.java | 2 +- .../datavalues/DvQuantityInvariantTest.java | 2 +- .../datavalues/DvTextInvariantTest.java | 2 +- .../datavalues/DvUriInvariantTest.java | 2 +- .../invariants/ehr/ActionInvariantTest.java | 2 +- .../ehr/CompositionInvariantTest.java | 2 +- .../invariants/ehr/EhrInvariantTest.java | 2 +- .../ehr/InstructionInvariantTest.java | 2 +- .../ehr/IsmTransitionInvariantTest.java | 2 +- .../ehr/ObservationInvariantTest.java | 2 +- .../ArchetypeSlotValidationTest.java | 18 ++-- .../RMPrimitiveObjectValidationTest.java | 8 +- .../validations/RMTupleValidationTest.java | 8 +- .../nedap/archie/rmutil/PathableUtilTest.java | 8 +- .../rules/evaluation/BinaryOperatorTest.java | 4 +- .../FixableAssertionsCheckerTest.java | 20 ++-- .../rules/evaluation/FunctionUtilTest.java | 4 +- .../rules/evaluation/FunctionsTest.java | 40 +++---- .../ParsedRulesEvaluationJaxbTest.java | 8 +- .../ParsedRulesEvaluationPathQueryTest.java | 4 +- .../evaluation/ParsedRulesEvaluationTest.java | 33 +++--- ...rchetypeSerializerParserRoundtripTest.java | 27 +++-- .../adl/ADLArchetypeSerializerTest.java | 5 +- .../adl/ADLDefinitionSerializerTest.java | 10 +- .../adl/DefaultValueSerializerTest.java | 7 +- .../rules/ADLRulesSerializerTest.java | 4 +- .../com/nedap/archie/testutil/TestUtil.java | 14 +-- .../archie/xml/JAXBAOMRoundTripTest.java | 8 +- .../com/nedap/archie/xml/JAXBAOMTest.java | 19 ++-- .../nedap/archie/xml/JAXBRMRoundTripTest.java | 13 +-- .../java/com/nedap/archie/xml/JAXBRMTest.java | 11 +- .../archie/datetime/DateTimeParserTest.java | 4 +- .../DateTimeSerializerFormattersTest.java | 4 +- .../utils/error/ErrorAccumulatorTest.java | 8 +- .../utils/file/FileAndDirUtilsTest.java | 6 +- 209 files changed, 915 insertions(+), 898 deletions(-) diff --git a/aom/src/test/java/com/nedap/archie/aom/ArchetypeHRIDTest.java b/aom/src/test/java/com/nedap/archie/aom/ArchetypeHRIDTest.java index 75eff3d54..3b51cbe11 100644 --- a/aom/src/test/java/com/nedap/archie/aom/ArchetypeHRIDTest.java +++ b/aom/src/test/java/com/nedap/archie/aom/ArchetypeHRIDTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.aom; import com.nedap.archie.definitions.VersionStatus; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ArchetypeHRIDTest { diff --git a/aom/src/test/java/com/nedap/archie/aom/ArchetypeTest.java b/aom/src/test/java/com/nedap/archie/aom/ArchetypeTest.java index 7abf13235..f34097833 100644 --- a/aom/src/test/java/com/nedap/archie/aom/ArchetypeTest.java +++ b/aom/src/test/java/com/nedap/archie/aom/ArchetypeTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.aom; import com.google.common.collect.Sets; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ArchetypeTest { diff --git a/aom/src/test/java/com/nedap/archie/aom/utils/AOMUtilsTest.java b/aom/src/test/java/com/nedap/archie/aom/utils/AOMUtilsTest.java index cdf6b45ab..79087796d 100644 --- a/aom/src/test/java/com/nedap/archie/aom/utils/AOMUtilsTest.java +++ b/aom/src/test/java/com/nedap/archie/aom/utils/AOMUtilsTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.aom.utils; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class AOMUtilsTest { diff --git a/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java b/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java index 21c773487..73f546295 100644 --- a/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java +++ b/aom/src/test/java/com/nedap/archie/rminfo/AttributeAccessorTest.java @@ -5,11 +5,12 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.CObject; import com.nedap.archie.aom.CPrimitiveObject; -import org.junit.Test; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.util.*; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class AttributeAccessorTest { private static final ModelInfoLookup modelInfoLookup = new LocalClassInfoLookup(); @@ -189,7 +190,8 @@ public Collection getId() { } } - public static class AddValue { + @Nested + class AddValue { @Test public void testMultipleValuedSingle() { @@ -229,7 +231,7 @@ public void testMultipleValuedListIntialEmpty() { attributeAccessor.addValue(group, "things", newThings); - assertNotSame("A new collection should be created", newThings, group.getThings()); + assertNotSame(newThings, group.getThings(),"A new collection should be created"); assertEquals(2, group.getThings().size()); assertSame(thing1, group.getThings().get(0)); assertSame(thing2, group.getThings().get(1)); @@ -246,7 +248,7 @@ public void testMultipleValuedListIntialNull() { attributeAccessor.addValue(group, "things", newThings); - assertNotSame("A new collection should be created", newThings, group.getThings()); + assertNotSame(newThings, group.getThings(), "A new collection should be created"); assertEquals(2, group.getThings().size()); assertSame(thing1, group.getThings().get(0)); assertSame(thing2, group.getThings().get(1)); @@ -313,7 +315,7 @@ public void testMultipleValuedFallback() { attributeAccessor.addValue(group, "subgroups", newSubgroups); - assertNotSame("A new collection should be created", newSubgroups, group.getSubgroups()); + assertNotSame(newSubgroups, group.getSubgroups(), "A new collection should be created"); assertEquals(2, group.getSubgroups().size()); assertSame(subgroup1, group.getSubgroups().get(0)); assertSame(subgroup2, group.getSubgroups().get(1)); @@ -395,7 +397,8 @@ public void testNonRmObject() { } } - public static class AddOrSetValue { + @Nested + class AddOrSetValue { @Test public void testMultipleValuedSingle() { @@ -435,7 +438,7 @@ public void testMultipleValuedListIntialEmpty() { attributeAccessor.addOrSetValue(group, "things", newThings); - assertNotSame("A new collection should be created", newThings, group.getThings()); + assertNotSame(newThings, group.getThings(), "A new collection should be created"); assertEquals(2, group.getThings().size()); assertSame(thing1, group.getThings().get(0)); assertSame(thing2, group.getThings().get(1)); @@ -453,7 +456,7 @@ public void testMultipleValuedListIntialNull() { attributeAccessor.addOrSetValue(group, "things", newThings); - assertNotSame("A new collection should be created", newThings, group.getThings()); + assertNotSame(newThings, group.getThings(), "A new collection should be created"); assertEquals(2, group.getThings().size()); assertSame(thing1, group.getThings().get(0)); assertSame(thing2, group.getThings().get(1)); @@ -515,7 +518,7 @@ public void testMultipleValuedFallback() { attributeAccessor.addOrSetValue(group, "subgroups", newSubgroups); - assertNotSame("A new collection should be created", newSubgroups, group.getSubgroups()); + assertNotSame(newSubgroups, group.getSubgroups(), "A new collection should be created"); assertEquals(2, group.getSubgroups().size()); assertSame(subgroup1, group.getSubgroups().get(0)); assertSame(subgroup2, group.getSubgroups().get(1)); @@ -697,7 +700,8 @@ public void testNonRmObject() { } } - public static class GetValue { + @Nested + class GetValue { @Test public void testNormal() { Thing thing = new Thing("test string"); @@ -736,7 +740,8 @@ public void testException() { } } - public static class HasAttribute { + @Nested + class HasAttribute { @Test public void testHasAttribute() { assertTrue(attributeAccessor.hasAttribute(new Thing(), "name")); @@ -745,7 +750,8 @@ public void testHasAttribute() { } } - public static class SetValue { + @Nested + class SetValue { @Test public void testMultipleValuedSingle() { Group group = new Group(); diff --git a/aom/src/test/java/com/nedap/archie/rminfo/SpecificMethodSelectorTest.java b/aom/src/test/java/com/nedap/archie/rminfo/SpecificMethodSelectorTest.java index 3524fcf71..0c34ddb35 100644 --- a/aom/src/test/java/com/nedap/archie/rminfo/SpecificMethodSelectorTest.java +++ b/aom/src/test/java/com/nedap/archie/rminfo/SpecificMethodSelectorTest.java @@ -1,11 +1,11 @@ package com.nedap.archie.rminfo; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.lang.reflect.Method; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class SpecificMethodSelectorTest { diff --git a/base/src/test/java/com/nedap/archie/base/IntervalOfPeriodTest.java b/base/src/test/java/com/nedap/archie/base/IntervalOfPeriodTest.java index 607d2fab4..1a712393e 100644 --- a/base/src/test/java/com/nedap/archie/base/IntervalOfPeriodTest.java +++ b/base/src/test/java/com/nedap/archie/base/IntervalOfPeriodTest.java @@ -1,14 +1,14 @@ package com.nedap.archie.base; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.Duration; import java.time.Period; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAmount; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class IntervalOfPeriodTest { diff --git a/base/src/test/java/com/nedap/archie/base/MultiplicityIntervalTest.java b/base/src/test/java/com/nedap/archie/base/MultiplicityIntervalTest.java index e0b5d3a1a..d225eb16d 100644 --- a/base/src/test/java/com/nedap/archie/base/MultiplicityIntervalTest.java +++ b/base/src/test/java/com/nedap/archie/base/MultiplicityIntervalTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.base; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class MultiplicityIntervalTest { @Test diff --git a/bmm/src/test/java/org/openehr/bmm/core/BmmPackageContainerTest.java b/bmm/src/test/java/org/openehr/bmm/core/BmmPackageContainerTest.java index f052baa18..a4f60de8e 100644 --- a/bmm/src/test/java/org/openehr/bmm/core/BmmPackageContainerTest.java +++ b/bmm/src/test/java/org/openehr/bmm/core/BmmPackageContainerTest.java @@ -21,10 +21,10 @@ * Author: Claude Nanjo */ -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class BmmPackageContainerTest { @Test diff --git a/bmm/src/test/java/org/openehr/bmm/persistence/validation/BmmMessageIdsTest.java b/bmm/src/test/java/org/openehr/bmm/persistence/validation/BmmMessageIdsTest.java index a9988b586..4667700b9 100644 --- a/bmm/src/test/java/org/openehr/bmm/persistence/validation/BmmMessageIdsTest.java +++ b/bmm/src/test/java/org/openehr/bmm/persistence/validation/BmmMessageIdsTest.java @@ -1,12 +1,12 @@ package org.openehr.bmm.persistence.validation; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.openehr.utils.message.I18n; import java.util.Locale; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Test i18n of the BmmMessageIds @@ -14,7 +14,7 @@ public class BmmMessageIdsTest { - @After + @AfterEach public void tearDown() { I18n.setCurrentLocale(null); } diff --git a/bmm/src/test/java/org/openehr/bmm/utils/ReferenceModelVersionUtilsTest.java b/bmm/src/test/java/org/openehr/bmm/utils/ReferenceModelVersionUtilsTest.java index 0bbde7424..9d681db27 100644 --- a/bmm/src/test/java/org/openehr/bmm/utils/ReferenceModelVersionUtilsTest.java +++ b/bmm/src/test/java/org/openehr/bmm/utils/ReferenceModelVersionUtilsTest.java @@ -21,10 +21,10 @@ * Author: Claude Nanjo */ -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ReferenceModelVersionUtilsTest { @Test diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/BmmParseRoundtripTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/BmmParseRoundtripTest.java index af774f28f..62b6f955c 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/BmmParseRoundtripTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/BmmParseRoundtripTest.java @@ -1,7 +1,7 @@ package org.openehr.bmm.v2.persistence.converters; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.v2.persistence.PBmmSchema; import org.openehr.bmm.v2.persistence.odin.BmmOdinParser; import org.openehr.bmm.v2.persistence.odin.BmmOdinSerializer; diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/ConversionTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/ConversionTest.java index 8889fab07..4922c07be 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/ConversionTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/ConversionTest.java @@ -1,6 +1,6 @@ package org.openehr.bmm.v2.persistence.converters; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.core.BmmClass; import org.openehr.bmm.core.BmmGenericType; import org.openehr.bmm.core.BmmModel; @@ -14,8 +14,8 @@ import java.util.Arrays; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.openehr.bmm.v2.persistence.converters.BmmTestUtil.parse; public class ConversionTest { @@ -31,20 +31,20 @@ public void testAdlTestSchema() throws Exception { converter.validateAndConvertRepository(); for (BmmValidationResult validationResult:repo.getModels()) { System.out.println(validationResult.getLogger()); - assertTrue("the OpenEHR ADL Test 1.0.0 BMM files should pass validation", validationResult.passes()); + assertTrue(validationResult.passes(), "the OpenEHR ADL Test 1.0.0 BMM files should pass validation"); } BmmModel adlTestModel = repo.getModel("openehr_adltest_1.0.0").getModel(); // Descendant relations - assertTrue ("\"GENERIC_CHILD_CLOSED\" descendant of \"GENERIC_PARENT\"", - adlTestModel.descendantOf("GENERIC_CHILD_CLOSED", "GENERIC_PARENT")); + assertTrue (adlTestModel.descendantOf("GENERIC_CHILD_CLOSED", "GENERIC_PARENT"), + "\"GENERIC_CHILD_CLOSED\" descendant of \"GENERIC_PARENT\""); // Ancestor relations List testResult = adlTestModel.getAllAncestorClasses("GENERIC_CHILD_OPEN_T"); // conformance result from ADL Workbench List conformanceResult = Arrays.asList("GENERIC_PARENT"); - assertEquals ("\"GENERIC_CHILD_CLOSED\" descendant of \"GENERIC_PARENT\")", testResult, conformanceResult); + assertEquals(testResult, conformanceResult, "\"GENERIC_CHILD_CLOSED\" descendant of \"GENERIC_PARENT\")"); } @@ -66,7 +66,7 @@ public void generateGenericParametersTest() throws Exception { converter.validateAndConvertRepository(); for (BmmValidationResult validationResult:repo.getModels()) { System.out.println(validationResult.getLogger()); - assertTrue("the OpenEHR RM 1.1.0 Base file should pass validation", validationResult.passes()); + assertTrue(validationResult.passes(), "the OpenEHR RM 1.1.0 Base file should pass validation"); } //RESOURCE_DESCRIPTION_ITEM.original_resource_uri should be a LIST> BmmModel baseModel = repo.getModel("openehr_base_1.1.0").getModel(); @@ -85,7 +85,7 @@ public void aomParseAndConvertTest() throws Exception { converter.validateAndConvertRepository(); for (BmmValidationResult validationResult:repo.getModels()) { System.out.println(validationResult.getLogger()); - assertTrue("the AOM schema must be valid", validationResult.passes()); + assertTrue(validationResult.passes(), "the AOM schema must be valid"); } //RESOURCE_DESCRIPTION_ITEM.original_resource_uri should be a LIST> BmmModel baseModel = repo.getModel("openehr_aom_2.0.6").getModel(); diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/PBmmEqualsAssertions.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/PBmmEqualsAssertions.java index c8a5c6212..c6224c310 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/PBmmEqualsAssertions.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/PBmmEqualsAssertions.java @@ -2,7 +2,7 @@ import org.openehr.bmm.v2.persistence.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class PBmmEqualsAssertions { diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/RM102ConversionTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/RM102ConversionTest.java index ebe2005d0..a55c32f6a 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/RM102ConversionTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/converters/RM102ConversionTest.java @@ -1,8 +1,8 @@ package org.openehr.bmm.v2.persistence.converters; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.openehr.bmm.core.BmmContainerType; import org.openehr.bmm.core.BmmGenericType; import org.openehr.bmm.core.BmmModel; @@ -15,7 +15,7 @@ import java.util.LinkedHashSet; import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.openehr.bmm.v2.persistence.converters.BmmTestUtil.parse; public class RM102ConversionTest { @@ -23,7 +23,7 @@ public class RM102ConversionTest { private static BmmModel rm102Model; private static BmmRepository repo; - @BeforeClass + @BeforeAll public static void setup() throws Exception { repo = new BmmRepository(); repo.addPersistentSchema(parse("/openehr/openehr_basic_types_102.bmm")); @@ -39,7 +39,7 @@ public static void setup() throws Exception { rm102Model = repo.getModel("openehr_ehr_1.0.2").getModel(); } - @AfterClass + @AfterAll public static void tearDown() { //not very important, but frees up some memory rm102Model = null; @@ -51,40 +51,40 @@ public void testRm102Valid() throws Exception { for (BmmValidationResult validationResult:repo.getModels()) { System.out.println(validationResult.getLogger()); - assertTrue("the OpenEHR RM 1.0.2 BMM files should pass validation", validationResult.passes()); + assertTrue(validationResult.passes(), "the OpenEHR RM 1.0.2 BMM files should pass validation"); } } @Test public void testRm102ModelPaths() throws Exception { // check some paths through the model - assertTrue ("property defined in class: (\"CARE_ENTRY\", \"/protocol\")", rm102Model.hasPropertyAtPath("CARE_ENTRY", "/protocol")); - assertTrue ("property defined in descendant: (\"CARE_ENTRY\", \"/data/events/data\")", rm102Model.hasPropertyAtPath("CARE_ENTRY", "/data/events/data")); - assertTrue ("property defined in ancestor: (\"OBSERVATION\", \"/protocol\")", rm102Model.hasPropertyAtPath("OBSERVATION", "/protocol")); - assertTrue ("property defined in class: (\"OBSERVATION\", \"/data/events/data\")", rm102Model.hasPropertyAtPath("OBSERVATION", "/data/events/data")); - assertTrue ("property defined in descendant: (\"OBSERVATION\", \"/data/events/data/items\")", rm102Model.hasPropertyAtPath("OBSERVATION", "/data/events/data/items")); - assertFalse ("non-existent property: (\"OBSERVATION\", \"/data/events/data/xxx\")", rm102Model.hasPropertyAtPath("OBSERVATION", "/data/events/data/xxx")); - assertTrue ("property defined in class: (\"COMPOSITION\", \"/context\")", rm102Model.hasPropertyAtPath("COMPOSITION", "/context")); - assertTrue ("property defined in descendant: (\"CLUSTER\", \"/items/items/items\")", rm102Model.hasPropertyAtPath("CLUSTER", "/items/items/items")); - assertTrue ("property defined in class: (\"DV_QUANTITY\", \"/normal_range\")", rm102Model.hasPropertyAtPath("DV_QUANTITY", "/normal_range")); + assertTrue (rm102Model.hasPropertyAtPath("CARE_ENTRY", "/protocol"), "property defined in class: (\"CARE_ENTRY\", \"/protocol\")"); + assertTrue (rm102Model.hasPropertyAtPath("CARE_ENTRY", "/data/events/data"),"property defined in descendant: (\"CARE_ENTRY\", \"/data/events/data\")"); + assertTrue (rm102Model.hasPropertyAtPath("OBSERVATION", "/protocol"),"property defined in ancestor: (\"OBSERVATION\", \"/protocol\")"); + assertTrue (rm102Model.hasPropertyAtPath("OBSERVATION", "/data/events/data"),"property defined in class: (\"OBSERVATION\", \"/data/events/data\")"); + assertTrue (rm102Model.hasPropertyAtPath("OBSERVATION", "/data/events/data/items"),"property defined in descendant: (\"OBSERVATION\", \"/data/events/data/items\")"); + assertFalse (rm102Model.hasPropertyAtPath("OBSERVATION", "/data/events/data/xxx"),"non-existent property: (\"OBSERVATION\", \"/data/events/data/xxx\")"); + assertTrue (rm102Model.hasPropertyAtPath("COMPOSITION", "/context"),"property defined in class: (\"COMPOSITION\", \"/context\")"); + assertTrue (rm102Model.hasPropertyAtPath("CLUSTER", "/items/items/items"), "property defined in descendant: (\"CLUSTER\", \"/items/items/items\")"); + assertTrue (rm102Model.hasPropertyAtPath("DV_QUANTITY", "/normal_range"), "property defined in class: (\"DV_QUANTITY\", \"/normal_range\")"); } @Test public void testRm102PropertyMetatypes() throws Exception { // check meta-types of some properties at paths - assertTrue ("BmmSimpleType at path: (\"OBSERVATION\", \"/protocol\")", rm102Model.propertyAtPath("OBSERVATION", "/protocol").getType() instanceof BmmSimpleType); - assertTrue ("BmmContainerType at path: (\"OBSERVATION\", \"/data/events/data/items\")", rm102Model.propertyAtPath("OBSERVATION", "/data/events/data/items").getType() instanceof BmmContainerType); - assertTrue ("BmmGenericType at path: (\"DV_QUANTITY\", \"/normal_range\")", rm102Model.propertyAtPath("DV_QUANTITY", "/normal_range").getType() instanceof BmmGenericType); - assertTrue ("BmmGSimpleType at path: (\"CARE_ENTRY\", \"/subject\")", rm102Model.propertyAtPath("CARE_ENTRY", "/subject").getType() instanceof BmmSimpleType); + assertTrue (rm102Model.propertyAtPath("OBSERVATION", "/protocol").getType() instanceof BmmSimpleType, "BmmSimpleType at path: (\"OBSERVATION\", \"/protocol\")"); + assertTrue (rm102Model.propertyAtPath("OBSERVATION", "/data/events/data/items").getType() instanceof BmmContainerType, "BmmContainerType at path: (\"OBSERVATION\", \"/data/events/data/items\")"); + assertTrue (rm102Model.propertyAtPath("DV_QUANTITY", "/normal_range").getType() instanceof BmmGenericType, "BmmGenericType at path: (\"DV_QUANTITY\", \"/normal_range\")"); + assertTrue (rm102Model.propertyAtPath("CARE_ENTRY", "/subject").getType() instanceof BmmSimpleType, "BmmGSimpleType at path: (\"CARE_ENTRY\", \"/subject\")"); } @Test public void testRm102ModelDescendants() throws Exception { // test descendant relations - assertTrue ("\"OBSERVATION\" descendant of \"LOCATABLE\")", rm102Model.descendantOf("OBSERVATION", "LOCATABLE")); - assertFalse ("\"LOCATABLE\" not descendant of \"COMPOSITION\")", rm102Model.descendantOf("LOCATABLE", "COMPOSITION")); - assertTrue ("\"ITEM_TREE\" descendant of \"ITEM_STRUCTURE\")", rm102Model.descendantOf("ITEM_TREE", "ITEM_STRUCTURE")); - assertTrue ("\"DV_DURATION\" descendant of \"DV_ORDERED\")", rm102Model.descendantOf("DV_DURATION", "DV_ORDERED")); + assertTrue (rm102Model.descendantOf("OBSERVATION", "LOCATABLE"), "\"OBSERVATION\" descendant of \"LOCATABLE\")"); + assertFalse (rm102Model.descendantOf("LOCATABLE", "COMPOSITION"), "\"LOCATABLE\" not descendant of \"COMPOSITION\")"); + assertTrue (rm102Model.descendantOf("ITEM_TREE", "ITEM_STRUCTURE"), "\"ITEM_TREE\" descendant of \"ITEM_STRUCTURE\")"); + assertTrue (rm102Model.descendantOf("DV_DURATION", "DV_ORDERED"), "\"DV_DURATION\" descendant of \"DV_ORDERED\")"); } @Test @@ -100,7 +100,7 @@ public void testRm102CompositionImmediateSuppliers() throws Exception { "PARTY_IDENTIFIED", "PARTY_SELF", "EVENT_CONTEXT", "CONTENT_ITEM", "SECTION", "ENTRY", "GENERIC_ENTRY" ) ); - assertEquals ("\"COMPOSITION\" has suppliers {\"CODE_PHRASE\", \"DV_TEXT\", ...})", testResult, conformanceResult); + assertEquals (testResult, conformanceResult, "\"COMPOSITION\" has suppliers {\"CODE_PHRASE\", \"DV_TEXT\", ...})"); } public void testRm102PartyIdentifiedSuppliers() throws Exception { @@ -115,7 +115,7 @@ public void testRm102PartyIdentifiedSuppliers() throws Exception { ) ); - assertEquals ("\"PARTY_IDENTIFIED\" has suppliers {\"String\", \"PARTY_REF\", ...})", testResult, conformanceResult); + assertEquals (testResult, conformanceResult, "\"PARTY_IDENTIFIED\" has suppliers {\"String\", \"PARTY_REF\", ...})"); } } diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/odin/BmmOdinParserTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/odin/BmmOdinParserTest.java index cf3d2d0f7..92542ce0a 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/odin/BmmOdinParserTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/odin/BmmOdinParserTest.java @@ -1,6 +1,6 @@ package org.openehr.bmm.v2.persistence.odin; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.v2.persistence.PBmmSchema; import org.openehr.bmm.v2.persistence.jackson.BmmJacksonUtil; diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/BasicSchemaValidationsTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/BasicSchemaValidationsTest.java index 4fbff0e82..213626835 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/BasicSchemaValidationsTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/BasicSchemaValidationsTest.java @@ -1,11 +1,11 @@ package org.openehr.bmm.v2.persistence.validation; import com.google.common.collect.Lists; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.persistence.validation.BmmMessageIds; import org.openehr.bmm.v2.validation.BmmValidationResult; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class BasicSchemaValidationsTest extends AbstractSchemaValidationsTest { diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/ClassesValidatorTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/ClassesValidatorTest.java index f9c64820e..efcc8d748 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/ClassesValidatorTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/ClassesValidatorTest.java @@ -1,11 +1,11 @@ package org.openehr.bmm.v2.persistence.validation; import com.google.common.collect.Lists; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.persistence.validation.BmmMessageIds; import org.openehr.bmm.v2.validation.BmmValidationResult; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ClassesValidatorTest extends AbstractSchemaValidationsTest { diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/CreatedSchemaValidationTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/CreatedSchemaValidationTest.java index 9a2441a23..c47bdd9f0 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/CreatedSchemaValidationTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/CreatedSchemaValidationTest.java @@ -1,11 +1,11 @@ package org.openehr.bmm.v2.persistence.validation; import com.google.common.collect.Lists; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.persistence.validation.BmmMessageIds; import org.openehr.bmm.v2.validation.BmmValidationResult; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class CreatedSchemaValidationTest extends AbstractSchemaValidationsTest { diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/IncludesValidatorTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/IncludesValidatorTest.java index 14e3b85e0..929ef106f 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/IncludesValidatorTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/IncludesValidatorTest.java @@ -1,11 +1,11 @@ package org.openehr.bmm.v2.persistence.validation; import com.google.common.collect.Lists; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.persistence.validation.BmmMessageIds; import org.openehr.bmm.v2.validation.BmmValidationResult; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class IncludesValidatorTest extends AbstractSchemaValidationsTest { diff --git a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/PropertyValidatorTest.java b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/PropertyValidatorTest.java index 8c940bdba..c28c3e4a3 100644 --- a/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/PropertyValidatorTest.java +++ b/bmm/src/test/java/org/openehr/bmm/v2/persistence/validation/PropertyValidatorTest.java @@ -1,11 +1,11 @@ package org.openehr.bmm.v2.persistence.validation; import com.google.common.collect.Lists; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.persistence.validation.BmmMessageIds; import org.openehr.bmm.v2.validation.BmmValidationResult; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class PropertyValidatorTest extends AbstractSchemaValidationsTest { diff --git a/build.gradle b/build.gradle index a1f3c2276..8fef18d96 100644 --- a/build.gradle +++ b/build.gradle @@ -69,7 +69,8 @@ subprojects { api(libs.threeten.extra) - testImplementation(libs.junit4) + testImplementation(libs.junit5.jupiter) + testImplementation(libs.hamcrest) testImplementation(libs.slf4j.simple) api(libs.zafarkhaja.semver) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cca8d065e..0d6892f9e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -38,7 +38,8 @@ jaxb-core = { module = "com.sun.xml.bind:jaxb-core", version = "2.3.0.1" } jaxb-impl = { module = "com.sun.xml.bind:jaxb-impl", version = "2.3.9" } -junit4 = { module = "junit:junit", version = "4.+" } +junit5-jupiter = { module = "org.junit.jupiter:junit-jupiter-api", version = "5.14.2" } +hamcrest = { module = "org.hamcrest:hamcrest", version = "2.2" } kryo = { module = "com.esotericsoftware.kryo:kryo5", version = "5.6.2" } diff --git a/i18n/src/test/java/org/openehr/utils/message/I18nFilesTest.java b/i18n/src/test/java/org/openehr/utils/message/I18nFilesTest.java index ec9c39888..4afd93860 100644 --- a/i18n/src/test/java/org/openehr/utils/message/I18nFilesTest.java +++ b/i18n/src/test/java/org/openehr/utils/message/I18nFilesTest.java @@ -1,12 +1,12 @@ package org.openehr.utils.message; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.text.MessageFormat; import java.util.Locale; import java.util.ResourceBundle; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; /** * Test to check if the syntax of the translations are correct. diff --git a/odin/src/test/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverterTest.java b/odin/src/test/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverterTest.java index d3d752d09..759764c31 100644 --- a/odin/src/test/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverterTest.java +++ b/odin/src/test/java/com/nedap/archie/serializer/odin/AdlOdinToJsonConverterTest.java @@ -7,8 +7,8 @@ import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class AdlOdinToJsonConverterTest extends OdinToJsonConverterBaseTest { @@ -21,8 +21,8 @@ public void assertConvertedEqual(String odin, String json) { parser.addErrorListener(errorListener); AdlOdinToJsonConverter converter = new AdlOdinToJsonConverter(); String result = converter.convert(parser.odin_text()); - assertTrue(errorListener.getErrors().toString(), errorListener.getErrors().hasNoErrors()); + assertTrue(errorListener.getErrors().hasNoErrors(), errorListener.getErrors().toString()); - assertEquals("the converted json should be equal to the expected", json, result); + assertEquals(json, result, "the converted json should be equal to the expected"); } } diff --git a/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterBaseTest.java b/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterBaseTest.java index fe9f04087..02720fd45 100644 --- a/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterBaseTest.java +++ b/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterBaseTest.java @@ -1,6 +1,6 @@ package com.nedap.archie.serializer.odin; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * class that contains the tests for the two ODIN converters - that should be exactly the same, they just use a different diff --git a/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterTest.java b/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterTest.java index af2c3592c..7ded2bd33 100644 --- a/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterTest.java +++ b/odin/src/test/java/com/nedap/archie/serializer/odin/OdinToJsonConverterTest.java @@ -6,8 +6,8 @@ import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class OdinToJsonConverterTest extends OdinToJsonConverterBaseTest { @@ -20,8 +20,8 @@ public void assertConvertedEqual(String odin, String json) { parser.addErrorListener(errorListener); OdinToJsonConverter converter = new OdinToJsonConverter(); String result = converter.convert(parser.odin_text()); - assertTrue(errorListener.getErrors().toString(), errorListener.getErrors().hasNoErrors()); + assertTrue(errorListener.getErrors().hasNoErrors(), errorListener.getErrors().toString()); - assertEquals("the converted json should be equal to the expected", json, result); + assertEquals(json, result, "the converted json should be equal to the expected"); } } diff --git a/odin/src/test/java/com/nedap/archie/serializer/odin/URIParserTest.java b/odin/src/test/java/com/nedap/archie/serializer/odin/URIParserTest.java index 34aac823a..5f2fd73b9 100644 --- a/odin/src/test/java/com/nedap/archie/serializer/odin/URIParserTest.java +++ b/odin/src/test/java/com/nedap/archie/serializer/odin/URIParserTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.serializer.odin; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class URIParserTest { diff --git a/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorReferencingTest.java b/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorReferencingTest.java index 7d27dba42..f7aa6311a 100644 --- a/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorReferencingTest.java +++ b/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorReferencingTest.java @@ -1,10 +1,10 @@ package org.openehr.odin.antlr; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.odin.CompositeOdinObject; import org.openehr.odin.loader.OdinLoaderImpl; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OdinBaseVisitorReferencingTest { @@ -12,7 +12,7 @@ public class OdinBaseVisitorReferencingTest { public void loadOdinNestedAttributeStructures1() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_test.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); } } diff --git a/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest.java b/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest.java index e57e1d20a..bcf0918b0 100644 --- a/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest.java +++ b/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest.java @@ -21,21 +21,21 @@ * Author: Claude Nanjo */ -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.odin.*; import org.openehr.odin.loader.OdinLoaderImpl; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class OdinBaseVisitorTest { - @Before + @BeforeEach public void setUp() throws Exception { } - @After + @AfterEach public void tearDown() throws Exception { } @@ -44,7 +44,7 @@ public void tearDown() throws Exception { public void loadReferenceModel() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/CIMI-RM-3.0.5.bmm")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validateRootLevelAttributes(root); } @@ -53,7 +53,7 @@ public void loadReferenceModel() throws Exception { public void loadOdinNestedAttributeStructures1() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_nested_attribute_structure1.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validateNestedAttributeStructures(root); } @@ -62,7 +62,7 @@ public void loadOdinNestedAttributeStructures1() throws Exception { public void loadOdinKeyedObject() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_keyed_object.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validateKeyedObjects(root); } @@ -71,7 +71,7 @@ public void loadOdinKeyedObject() throws Exception { public void testOdinTypes() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_types.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validateOdinTypes(root); } @@ -80,7 +80,7 @@ public void testOdinTypes() throws Exception { public void testOdinNestedKeyedObjects() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_nested_keyed_object.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validateOdinNestedKeyedObject(root); } @@ -89,7 +89,7 @@ public void testOdinNestedKeyedObjects() throws Exception { public void testOdinTermBindingTestObjects() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_term_binding_test.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validateOdinTermBindingTest(root); } @@ -98,7 +98,7 @@ public void testOdinTermBindingTestObjects() throws Exception { public void testOdinPrimitives() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_primitive_types.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals( 1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); validatePrimitiveType(root, "a_string_attribute", "a string value"); validatePrimitiveType(root, "a_boolean_attribute", false); @@ -119,7 +119,7 @@ public void testOdinPrimitives() throws Exception { public void testOdinLists() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_primitive_lists.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals( 1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); OdinAttribute attribute = validatePrimitiveList(root, "a_string_list_attribute", 3); attribute = validatePrimitiveList(root, "a_string_list_attribute", 3); @@ -137,7 +137,7 @@ public void testOdinLists() throws Exception { public void testOdinIntervals() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest.class.getResourceAsStream("/odin/odin_primitive_intervals.txt")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals( 1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); OdinAttribute attribute = validateInterval(root, "a_integer_interval_attribute1"); assertEquals(1, attribute.getChildCount()); @@ -219,7 +219,7 @@ private void validateKeyedObjects(CompositeOdinObject root) { } public void validateRootLevelAttributes(CompositeOdinObject root) { - assertEquals("Root element should have 11 attributes", 11, root.getAttributeCount()); + assertEquals(11, root.getAttributeCount(), "Root element should have 11 attributes"); assertEquals("bmm_version", root.getAttributeAtIndex(0).getName()); assertEquals(1, root.getAttributeAtIndex(0).getChildCount()); assertEquals("2.0", root.getAttributeAtIndex(0).getStringObject().getValue()); @@ -259,14 +259,14 @@ public void validateRootLevelAttributes(CompositeOdinObject root) { } public void validatePackages(CompositeOdinObject packages) { - assertEquals("Packages should have exactly 1 keyed object", 1, packages.getKeyedObjectCount()); - assertEquals("Packages should have exactly 0 attributes", 0, packages.getAttributeCount()); + assertEquals(1, packages.getKeyedObjectCount(), "Packages should have exactly 1 keyed object"); + assertEquals(0, packages.getAttributeCount(), "Packages should have exactly 0 attributes"); validateCimiReferenceModelKeyedObject((CompositeOdinObject) packages.getKeyedObject(new StringObject("CIMI_Reference_Model"))); } public void validateCimiReferenceModelKeyedObject(CompositeOdinObject cimiReferenceModelKO) { - assertEquals("Packages should have exactly 0 keyed object", 0, cimiReferenceModelKO.getKeyedObjectCount()); - assertEquals("Packages should have exactly 2 attributes: 'name' and 'packages'", 2, cimiReferenceModelKO.getAttributeCount()); + assertEquals(0, cimiReferenceModelKO.getKeyedObjectCount(), "Packages should have exactly 0 keyed object"); + assertEquals(2, cimiReferenceModelKO.getAttributeCount(),"Packages should have exactly 2 attributes: 'name' and 'packages'"); //Validate name assertEquals("name", cimiReferenceModelKO.getAttributeAtIndex(0).getName()); @@ -282,8 +282,8 @@ public void validateCimiReferenceModelKeyedObject(CompositeOdinObject cimiRefere //Validate package."Core" CompositeOdinObject core = (CompositeOdinObject) packagesAttr.getSoleCompositeObjectBody().getKeyedObject("Core"); assertNotNull(core); - assertEquals("Core has two attributes: 'name' and 'classes':", 2, core.getAttributeCount()); - assertEquals("Core has no keyed objects:", 0, core.getKeyedObjectCount()); + assertEquals(2, core.getAttributeCount(), "Core has two attributes: 'name' and 'classes':"); + assertEquals(0, core.getKeyedObjectCount(), "Core has no keyed objects:"); OdinAttribute coreName = core.getAttributeAtIndex(0); OdinAttribute coreClasses = core.getAttributeAtIndex(1); assertEquals("name", coreName.getName()); @@ -296,8 +296,8 @@ public void validateCimiReferenceModelKeyedObject(CompositeOdinObject cimiRefere //Validate package."Data_Value_Types" CompositeOdinObject dataValueTypes = (CompositeOdinObject) packagesAttr.getSoleCompositeObjectBody().getKeyedObject("Data_Value_Types"); assertNotNull(dataValueTypes); - assertEquals("Data_Value_Types has two attributes: 'name' and 'classes':", 2, dataValueTypes.getAttributeCount()); - assertEquals("Data_Value_Types has no keyed objects:", 0, dataValueTypes.getKeyedObjectCount()); + assertEquals(2, dataValueTypes.getAttributeCount(), "Data_Value_Types has two attributes: 'name' and 'classes':"); + assertEquals(0, dataValueTypes.getKeyedObjectCount(), "Data_Value_Types has no keyed objects:"); OdinAttribute dataValueTypesName = dataValueTypes.getAttributeAtIndex(0); OdinAttribute dataValueTypesClasses = dataValueTypes.getAttributeAtIndex(1); assertEquals("name", dataValueTypesName.getName()); @@ -310,8 +310,8 @@ public void validateCimiReferenceModelKeyedObject(CompositeOdinObject cimiRefere //Validate package."Party" CompositeOdinObject party = (CompositeOdinObject) packagesAttr.getSoleCompositeObjectBody().getKeyedObject("Party"); assertNotNull(party); - assertEquals("Party has two attributes: 'name' and 'classes':", 2, party.getAttributeCount()); - assertEquals("Party has no keyed objects:", 0, party.getKeyedObjectCount()); + assertEquals(2, party.getAttributeCount(), "Party has two attributes: 'name' and 'classes':"); + assertEquals(0, party.getKeyedObjectCount(), "Party has no keyed objects:"); OdinAttribute partyName = party.getAttributeAtIndex(0); OdinAttribute partyClasses = party.getAttributeAtIndex(1); assertEquals("name", partyName.getName()); @@ -324,8 +324,8 @@ public void validateCimiReferenceModelKeyedObject(CompositeOdinObject cimiRefere //Validate package."Primitive_types" CompositeOdinObject primitiveTypes = (CompositeOdinObject) packagesAttr.getSoleCompositeObjectBody().getKeyedObject("Primitive_Types"); assertNotNull(primitiveTypes); - assertEquals("Primitive_Types has two attributes: 'name' and 'classes':", 2, primitiveTypes.getAttributeCount()); - assertEquals("Primitive_Types has no keyed objects:", 0, primitiveTypes.getKeyedObjectCount()); + assertEquals(2, primitiveTypes.getAttributeCount(), "Primitive_Types has two attributes: 'name' and 'classes':"); + assertEquals(0, primitiveTypes.getKeyedObjectCount(), "Primitive_Types has no keyed objects:"); OdinAttribute primitiveTypesName = primitiveTypes.getAttributeAtIndex(0); OdinAttribute primitiveTypesClasses = primitiveTypes.getAttributeAtIndex(1); assertEquals("name", primitiveTypesName.getName()); @@ -337,19 +337,19 @@ public void validateCimiReferenceModelKeyedObject(CompositeOdinObject cimiRefere } public void validatePackageAttributeType(CompositeOdinObject packagesAttribute) { - assertEquals("Packages should have exactly 4 keyed object", 4, packagesAttribute.getKeyedObjectCount()); - assertEquals("Packages should have exactly 0 attributes", 0, packagesAttribute.getAttributeCount()); + assertEquals(4, packagesAttribute.getKeyedObjectCount(), "Packages should have exactly 4 keyed object"); + assertEquals(0, packagesAttribute.getAttributeCount(), "Packages should have exactly 0 attributes"); } public void validateClassDefinitions(CompositeOdinObject classDefinitions) { - assertEquals("Class Definitions should have exactly 36 keyed object", 35, classDefinitions.getKeyedObjectCount()); - assertEquals("Class Definitions should have exactly 0 attributes", 0, classDefinitions.getAttributeCount()); + assertEquals(35, classDefinitions.getKeyedObjectCount(), "Class Definitions should have exactly 36 keyed object"); + assertEquals(0, classDefinitions.getAttributeCount(), "Class Definitions should have exactly 0 attributes"); validateClassDefinitionItemGroupKeyedObject((CompositeOdinObject) classDefinitions.getKeyedObject("ITEM_GROUP")); } public void validateClassDefinitionItemGroupKeyedObject(CompositeOdinObject itemGroupKO) { - assertEquals("Packages should have exactly 3 attributes: 'name', 'ancestors' and 'properties'", 3, itemGroupKO.getAttributeCount()); - assertEquals("Packages should have exactly 0 keyed object", 0, itemGroupKO.getKeyedObjectCount()); + assertEquals(3, itemGroupKO.getAttributeCount(), "Packages should have exactly 3 attributes: 'name', 'ancestors' and 'properties'"); + assertEquals(0, itemGroupKO.getKeyedObjectCount(), "Packages should have exactly 0 keyed object"); //Validate name assertEquals("name", itemGroupKO.getAttributeAtIndex(0).getName()); @@ -363,14 +363,14 @@ public void validateClassDefinitionItemGroupKeyedObject(CompositeOdinObject item //Validate properties OdinAttribute properties = itemGroupKO.getAttributeAtIndex(2); assertEquals("properties", properties.getName()); - assertEquals("Properties should have exactly 2 keyed object", 2, properties.getSoleCompositeObjectBody().getKeyedObjectCount()); - assertEquals("Properties should have exactly 0 attributes", 0, properties.getSoleCompositeObjectBody().getAttributeCount()); + assertEquals(2, properties.getSoleCompositeObjectBody().getKeyedObjectCount(), "Properties should have exactly 2 keyed object"); + assertEquals(0, properties.getSoleCompositeObjectBody().getAttributeCount(), "Properties should have exactly 0 attributes"); //Validate properties."item" CompositeOdinObject item = (CompositeOdinObject) properties.getSoleCompositeObjectBody().getKeyedObject("item"); - assertEquals("Item should have exactly 4 attributes: 'name', 'type_def', 'cardinality', 'is_mandatory'", 4, item.getAttributeCount()); - assertEquals("Item should have exactly 0 keyed object", 0, item.getKeyedObjectCount()); - assertEquals("Item should have a type of P_BMM_CONTAINER_PROPERTY", "P_BMM_CONTAINER_PROPERTY", item.getType()); + assertEquals(4, item.getAttributeCount(), "Item should have exactly 4 attributes: 'name', 'type_def', 'cardinality', 'is_mandatory'"); + assertEquals(0, item.getKeyedObjectCount(), "Item should have exactly 0 keyed object"); + assertEquals("P_BMM_CONTAINER_PROPERTY", item.getType(), "Item should have a type of P_BMM_CONTAINER_PROPERTY"); //Validate properties."item".name OdinAttribute itemName = item.getAttributeAtIndex(0); @@ -381,8 +381,8 @@ public void validateClassDefinitionItemGroupKeyedObject(CompositeOdinObject item OdinAttribute typeDef = item.getAttributeAtIndex(1); CompositeOdinObject typeDefType = typeDef.getSoleCompositeObjectBody(); assertEquals("type_def", typeDef.getName()); - assertEquals("Item should have exactly 2 attributes: 'container_type', 'type'", 2, typeDef.getSoleCompositeObjectBody().getAttributeCount()); - assertEquals("Item should have exactly 0 keyed object", 0, typeDef.getSoleCompositeObjectBody().getKeyedObjectCount()); + assertEquals(2, typeDef.getSoleCompositeObjectBody().getAttributeCount(), "Item should have exactly 2 attributes: 'container_type', 'type'"); + assertEquals(0, typeDef.getSoleCompositeObjectBody().getKeyedObjectCount(), "Item should have exactly 0 keyed object"); //Validate properties."item".type_def.container_type OdinAttribute containerTypeAttribute = typeDefType.getAttributeAtIndex(0); @@ -408,9 +408,9 @@ public void validateClassDefinitionItemGroupKeyedObject(CompositeOdinObject item //Validate properties."participation" CompositeOdinObject participation = (CompositeOdinObject) properties.getSoleCompositeObjectBody().getKeyedObject("participation"); - assertEquals("Participation should have exactly 3 attributes: 'name', 'type_def', 'cardinality'", 3, participation.getAttributeCount()); - assertEquals("Participation should have exactly 0 keyed object", 0, participation.getKeyedObjectCount()); - assertEquals("Participation should have a type of P_BMM_CONTAINER_PROPERTY", "P_BMM_CONTAINER_PROPERTY", participation.getType()); + assertEquals(3, participation.getAttributeCount(), "Participation should have exactly 3 attributes: 'name', 'type_def', 'cardinality'"); + assertEquals(0, participation.getKeyedObjectCount(), "Participation should have exactly 0 keyed object"); + assertEquals("P_BMM_CONTAINER_PROPERTY", participation.getType(), "Participation should have a type of P_BMM_CONTAINER_PROPERTY"); //Validate properties."participation".name OdinAttribute participationName = participation.getAttributeAtIndex(0); @@ -421,8 +421,8 @@ public void validateClassDefinitionItemGroupKeyedObject(CompositeOdinObject item OdinAttribute participationTypeDef = participation.getAttributeAtIndex(1); CompositeOdinObject participationTypeDefType = participationTypeDef.getSoleCompositeObjectBody(); assertEquals("type_def", participationTypeDef.getName()); - assertEquals("Item should have exactly 2 attributes: 'container_type', 'type'", 2, participationTypeDefType.getAttributeCount()); - assertEquals("Item should have exactly 0 keyed object", 0, participationTypeDefType.getKeyedObjectCount()); + assertEquals(2, participationTypeDefType.getAttributeCount(), "Item should have exactly 2 attributes: 'container_type', 'type'"); + assertEquals(0, participationTypeDefType.getKeyedObjectCount(), "Item should have exactly 0 keyed object"); assertTrue(participationTypeDefType instanceof CompositeOdinObject); //Validate properties."participation".type_def.container_type @@ -444,13 +444,13 @@ public void validateClassDefinitionItemGroupKeyedObject(CompositeOdinObject item } public void validatePrimitiveTypes(CompositeOdinObject primitiveTypes) { - assertEquals("Primitive Types should have exactly 10 keyed object", 10, primitiveTypes.getKeyedObjectCount()); - assertEquals("Primitive Types should have exactly 0 attributes", 0, primitiveTypes.getAttributeCount()); + assertEquals(10, primitiveTypes.getKeyedObjectCount(), "Primitive Types should have exactly 10 keyed object"); + assertEquals(0, primitiveTypes.getAttributeCount(), "Primitive Types should have exactly 0 attributes"); //Validate Boolean CompositeOdinObject booleanType = (CompositeOdinObject) primitiveTypes.getKeyedObject("Boolean"); assertNotNull(booleanType); - assertEquals("Boolean keyed object specifies a single attribute", 1, booleanType.getAttributeCount()); + assertEquals(1, booleanType.getAttributeCount(), "Boolean keyed object specifies a single attribute"); OdinAttribute booleanTypeName = booleanType.getAttributeAtIndex(0); assertEquals("name", booleanTypeName.getName()); assertEquals("Boolean", booleanTypeName.getStringObject().getValue()); @@ -458,7 +458,7 @@ public void validatePrimitiveTypes(CompositeOdinObject primitiveTypes) { //Validate List.name CompositeOdinObject listType = (CompositeOdinObject) primitiveTypes.getKeyedObject("List"); assertNotNull(listType); - assertEquals("List keyed object specifies two attribute: 'name' and 'generic_parameter_defs'", 2, listType.getAttributeCount()); + assertEquals(2, listType.getAttributeCount(), "List keyed object specifies two attribute: 'name' and 'generic_parameter_defs'"); OdinAttribute listTypeName = listType.getAttributeAtIndex(0); assertEquals("name", listType.getAttributeAtIndex(0).getName()); assertEquals("List", listType.getAttributeAtIndex(0).getStringObject().getValue()); diff --git a/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest2.java b/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest2.java index 86c5cb90b..e6404fd41 100644 --- a/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest2.java +++ b/odin/src/test/java/org/openehr/odin/antlr/OdinBaseVisitorTest2.java @@ -21,21 +21,21 @@ * Author: Claude Nanjo */ -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.openehr.odin.CompositeOdinObject; import org.openehr.odin.loader.OdinLoaderImpl; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OdinBaseVisitorTest2 { - @Before + @BeforeEach public void setUp() throws Exception { } - @After + @AfterEach public void tearDown() throws Exception { } @@ -52,7 +52,7 @@ public void tearDown() throws Exception { public void loadReferenceModel2() throws Exception { OdinLoaderImpl loader = new OdinLoaderImpl(); OdinVisitorImpl visitor = loader.loadOdinFile(OdinBaseVisitorTest2.class.getResourceAsStream("/odin/CIMI_RM_CLINICAL.v.0.0.1.bmm")); - assertEquals("Stack should consist of a single item", 1, visitor.getStack().size()); + assertEquals(1, visitor.getStack().size(), "Stack should consist of a single item"); CompositeOdinObject root = visitor.getAstRootNode(); } // diff --git a/odin/src/test/java/org/openehr/odin/jackson/OdinSerializeTest.java b/odin/src/test/java/org/openehr/odin/jackson/OdinSerializeTest.java index f2455bcb2..ec4aaff54 100644 --- a/odin/src/test/java/org/openehr/odin/jackson/OdinSerializeTest.java +++ b/odin/src/test/java/org/openehr/odin/jackson/OdinSerializeTest.java @@ -1,6 +1,6 @@ package org.openehr.odin.jackson; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.odin.jackson.testclasses.ContainerWithList; import org.openehr.odin.jackson.testclasses.TestObject; diff --git a/odin/src/test/java/org/openehr/odin/utils/OdinSerializationUtilsTest.java b/odin/src/test/java/org/openehr/odin/utils/OdinSerializationUtilsTest.java index 6247ad2f4..81d6b2cbe 100644 --- a/odin/src/test/java/org/openehr/odin/utils/OdinSerializationUtilsTest.java +++ b/odin/src/test/java/org/openehr/odin/utils/OdinSerializationUtilsTest.java @@ -21,12 +21,12 @@ * Author: Claude Nanjo */ -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OdinSerializationUtilsTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/changecontrol/ContributionTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/changecontrol/ContributionTest.java index 2a49ea60f..5ad40cd52 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/changecontrol/ContributionTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/changecontrol/ContributionTest.java @@ -6,14 +6,14 @@ import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.ObjectId; import com.nedap.archie.rm.support.identification.ObjectRef; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ContributionTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/composition/CompositionTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/composition/CompositionTest.java index 0deacf10e..d20327c50 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/composition/CompositionTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/composition/CompositionTest.java @@ -4,14 +4,14 @@ import com.nedap.archie.json.ArchieJacksonConfiguration; import com.nedap.archie.json.JacksonUtil; import com.nedap.archie.xml.JAXBUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import java.io.IOException; import java.io.StringWriter; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class CompositionTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/composition/ObservationTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/composition/ObservationTest.java index 1120bf6fe..4f265924e 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/composition/ObservationTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/composition/ObservationTest.java @@ -5,12 +5,12 @@ import com.nedap.archie.json.JacksonUtil; import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.ObjectRef; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.StringWriter; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ObservationTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ClusterTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ClusterTest.java index d20c8afc2..aea0722a0 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ClusterTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ClusterTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.rm.datastructures; import com.nedap.archie.rm.datavalues.DvText; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class ClusterTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemListTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemListTest.java index 03ee68124..22d36cca7 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemListTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemListTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.rm.datastructures; import com.nedap.archie.rm.datavalues.DvText; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class ItemListTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTableTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTableTest.java index a7917b780..208808e67 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTableTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTableTest.java @@ -1,11 +1,11 @@ package com.nedap.archie.rm.datastructures; import com.nedap.archie.rm.datavalues.DvText; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ItemTableTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTreeTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTreeTest.java index 28a250c1e..594e71673 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTreeTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datastructures/ItemTreeTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.rm.datastructures; import com.nedap.archie.rm.datavalues.DvText; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class ItemTreeTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datatypes/CodePhraseTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datatypes/CodePhraseTest.java index 81dc04ac7..48add2884 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datatypes/CodePhraseTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datatypes/CodePhraseTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.rm.datatypes; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class CodePhraseTest { @@ -14,10 +14,10 @@ public void testEquals() { CodePhrase codePhraseThree = new CodePhrase("hl2::gender"); CodePhrase codePhraseFour = new CodePhrase("hl7::color"); - Assert.assertEquals(codePhraseOne, codePhraseTwo); + assertEquals(codePhraseOne, codePhraseTwo); - Assert.assertNotEquals(codePhraseOne, codePhraseThree); - Assert.assertNotEquals(codePhraseOne, codePhraseFour); + assertNotEquals(codePhraseOne, codePhraseThree); + assertNotEquals(codePhraseOne, codePhraseFour); } @Test diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvBooleanTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvBooleanTest.java index 462b64927..9fe9a039e 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvBooleanTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvBooleanTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.rm.datavalues; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class DvBooleanTest { @Test diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvCodedTextTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvCodedTextTest.java index 49a2695e7..1e628e21a 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvCodedTextTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvCodedTextTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.rm.datavalues; import com.nedap.archie.rm.datatypes.CodePhrase; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class DvCodedTextTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvParsableTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvParsableTest.java index 49c7895ad..ad46ac824 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvParsableTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvParsableTest.java @@ -3,9 +3,9 @@ import com.nedap.archie.rm.datatypes.CodePhrase; import com.nedap.archie.rm.datavalues.encapsulated.DvParsable; import com.nedap.archie.rm.support.identification.TerminologyId; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class DvParsableTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvURITest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvURITest.java index 6c9bb624d..7ca87dd63 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvURITest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/DvURITest.java @@ -1,9 +1,9 @@ package com.nedap.archie.rm.datavalues; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class DvURITest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java index d7c45a97c..86923b225 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import org.junit.jupiter.api.Test; import com.fasterxml.jackson.core.JsonProcessingException; import com.nedap.archie.json.JacksonUtil; -import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class DvDateTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java index a3ea3e1c4..c04ef080d 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDateTimeTest.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.nedap.archie.json.JacksonUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class DvDateTimeTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java index 2f2c1fc2b..a75deaf10 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvDurationTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import org.junit.jupiter.api.Test; import com.fasterxml.jackson.core.JsonProcessingException; import com.nedap.archie.json.JacksonUtil; -import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class DvDurationTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java index dcf6fea63..2b57ec312 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/DvTimeTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; +import org.junit.jupiter.api.Test; import com.fasterxml.jackson.core.JsonProcessingException; import com.nedap.archie.json.JacksonUtil; -import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class DvTimeTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/TimeDefinitionsTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/TimeDefinitionsTest.java index 1caec89d5..5b7d1b726 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/TimeDefinitionsTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/datavalues/quantity/datetime/TimeDefinitionsTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.rm.datavalues.quantity.datetime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; import java.time.Duration; import java.time.Period; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TimeDefinitionsTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/directory/FolderTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/directory/FolderTest.java index b0c7d0133..6ed7bb79a 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/directory/FolderTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/directory/FolderTest.java @@ -6,14 +6,14 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.ObjectRef; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class FolderTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrStatusTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrStatusTest.java index d2725c238..fd6f4bfb7 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrStatusTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrStatusTest.java @@ -2,14 +2,14 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.nedap.archie.json.JacksonUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.StringWriter; import java.util.Map; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class EhrStatusTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrTest.java index 9428e2019..913bf7100 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/ehr/EhrTest.java @@ -5,14 +5,14 @@ import com.nedap.archie.json.JacksonUtil; import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.ObjectRef; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class EhrTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ArchetypeIDTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ArchetypeIDTest.java index f0d30f66e..8d73420f5 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ArchetypeIDTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ArchetypeIDTest.java @@ -1,11 +1,11 @@ package com.nedap.archie.rm.support.identification; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ArchetypeIDTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/HierObjectIdTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/HierObjectIdTest.java index b01996cbd..e6044c260 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/HierObjectIdTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/HierObjectIdTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.rm.support.identification; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class HierObjectIdTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ObjectVersionIdTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ObjectVersionIdTest.java index c17421835..829c2fb49 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ObjectVersionIdTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/ObjectVersionIdTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.rm.support.identification; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ObjectVersionIdTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/TerminologyIdTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/TerminologyIdTest.java index 8cad3f02e..28a22f804 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/TerminologyIdTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/TerminologyIdTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.rm.support.identification; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class TerminologyIdTest { diff --git a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/VersionTreeIdTest.java b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/VersionTreeIdTest.java index cafa031fe..a5b384b72 100644 --- a/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/VersionTreeIdTest.java +++ b/openehr-rm/src/test/java/com/nedap/archie/rm/support/identification/VersionTreeIdTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.rm.support.identification; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class VersionTreeIdTest { diff --git a/openehr-terminology/src/test/java/com/nedap/archie/terminology/OpenEHRTerminologyAccessTest.java b/openehr-terminology/src/test/java/com/nedap/archie/terminology/OpenEHRTerminologyAccessTest.java index 75cc33663..cbd376a10 100644 --- a/openehr-terminology/src/test/java/com/nedap/archie/terminology/OpenEHRTerminologyAccessTest.java +++ b/openehr-terminology/src/test/java/com/nedap/archie/terminology/OpenEHRTerminologyAccessTest.java @@ -3,26 +3,26 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.apache.commons.io.IOUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OpenEHRTerminologyAccessTest { private OpenEHRTerminologyAccess termAccess; - @Before + @BeforeEach public void getInstance() { termAccess = OpenEHRTerminologyAccess.getInstance();//should not throw an exception from parsing } - @After + @AfterEach public void reset() { OpenEHRTerminologyAccess.READ_FROM_JSON = true; OpenEHRTerminologyAccess.instance = null; @@ -42,7 +42,7 @@ public void writeToJson() throws Exception { //System.out.println(json); try(InputStream stream = getClass().getResourceAsStream("/openEHR_RM/fullTermFile.json")) { String includedJson = IOUtils.toString(stream, StandardCharsets.UTF_8); - assertEquals("XML and included terminology have gone out of sync. please regenerate json file!", json, includedJson); + assertEquals(json, includedJson, "XML and included terminology have gone out of sync. please regenerate json file!"); } } diff --git a/path-queries/src/test/java/com/nedap/archie/query/RMPathQueryTest.java b/path-queries/src/test/java/com/nedap/archie/query/RMPathQueryTest.java index fa35bfb9a..dedfef504 100644 --- a/path-queries/src/test/java/com/nedap/archie/query/RMPathQueryTest.java +++ b/path-queries/src/test/java/com/nedap/archie/query/RMPathQueryTest.java @@ -2,13 +2,13 @@ import com.nedap.archie.rm.datastructures.Cluster; import com.nedap.archie.rm.datastructures.Element; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class RMPathQueryTest { @@ -22,7 +22,7 @@ public class RMPathQueryTest { private Element elementNoId_2; private Element elementArchetypeId; - @Before + @BeforeEach public void setup() { cluster = new Cluster(); cluster.setArchetypeNodeId("id1"); diff --git a/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java b/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java index 0986eddc3..a773a044a 100644 --- a/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java +++ b/referencemodels/src/test/java/com/nedap/archie/rminfo/OverridingMetaModelProviderTest.java @@ -2,10 +2,10 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.ArchetypeHRID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OverridingMetaModelProviderTest { @Test diff --git a/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java b/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java index 6816778ee..7cc40d859 100644 --- a/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java +++ b/referencemodels/src/test/java/com/nedap/archie/rminfo/SimpleMetaModelProviderTest.java @@ -4,10 +4,10 @@ import com.nedap.archie.aom.ArchetypeHRID; import com.nedap.archie.aom.profile.AomProfiles; import com.nedap.archie.openehrtestrm.TestRMInfoLookup; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class SimpleMetaModelProviderTest { diff --git a/referencemodels/src/test/java/org/openehr/referencemodels/AOMComparedWithBmmTest.java b/referencemodels/src/test/java/org/openehr/referencemodels/AOMComparedWithBmmTest.java index c0cbc6e69..a18a3fe61 100644 --- a/referencemodels/src/test/java/org/openehr/referencemodels/AOMComparedWithBmmTest.java +++ b/referencemodels/src/test/java/org/openehr/referencemodels/AOMComparedWithBmmTest.java @@ -3,8 +3,8 @@ import com.google.common.base.Joiner; import com.google.common.collect.Sets; import com.nedap.archie.rminfo.ArchieAOMInfoLookup; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openehr.bmm.core.BmmClass; import org.openehr.bmm.core.BmmModel; import org.openehr.bmm.v2.persistence.PBmmSchema; @@ -16,8 +16,8 @@ import java.io.InputStream; import java.util.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Compares the AOM with the official BMM. @@ -28,7 +28,7 @@ public class AOMComparedWithBmmTest { @Test - @Ignore + @Disabled public void testAOM() throws Exception{ Map typeMap = new HashMap<>(); typeMap.put("Any", "OPEN_EHRBASE"); @@ -97,9 +97,9 @@ public void testAOM() throws Exception{ noLongerFoundErrors.add(difference); } } - assertTrue("unexpected model differences: "+ Joiner.on("\n").join(foundErrors), foundErrors.isEmpty()); + assertTrue(foundErrors.isEmpty(), "unexpected model differences: "+ Joiner.on("\n").join(foundErrors)); - assertTrue("difference was in known difference, but is actually not a problem anymore: "+ Joiner.on("\n").join(noLongerFoundErrors), noLongerFoundErrors.isEmpty()); + assertTrue(noLongerFoundErrors.isEmpty(),"difference was in known difference, but is actually not a problem anymore: "+ Joiner.on("\n").join(noLongerFoundErrors)); assertEquals(knownDifferences.size(), compared.size()); } } diff --git a/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java b/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java index 72b0bbb3b..e59842d6b 100644 --- a/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java +++ b/referencemodels/src/test/java/org/openehr/referencemodels/BuiltInReferenceModelsTest.java @@ -3,11 +3,11 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.ArchetypeHRID; import com.nedap.archie.rminfo.MetaModels; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.v2.validation.BmmRepository; import org.openehr.bmm.v2.validation.BmmValidationResult; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class BuiltInReferenceModelsTest { diff --git a/referencemodels/src/test/java/org/openehr/referencemodels/RMComparedWithBmmTest.java b/referencemodels/src/test/java/org/openehr/referencemodels/RMComparedWithBmmTest.java index ae050c142..8069bf74d 100644 --- a/referencemodels/src/test/java/org/openehr/referencemodels/RMComparedWithBmmTest.java +++ b/referencemodels/src/test/java/org/openehr/referencemodels/RMComparedWithBmmTest.java @@ -3,7 +3,7 @@ import com.google.common.base.Joiner; import com.google.common.collect.Sets; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.core.BmmClass; import org.openehr.bmm.core.BmmModel; import org.openehr.bmm.v2.validation.BmmRepository; @@ -12,8 +12,8 @@ import java.util.*; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class RMComparedWithBmmTest { @@ -167,9 +167,9 @@ public void compareBmmWithRM() { noLongerFoundErrors.add(difference); } } - assertTrue("unexpected model differences: "+ Joiner.on("\n").join(foundErrors), foundErrors.isEmpty()); + assertTrue( foundErrors.isEmpty(), "unexpected model differences: "+ Joiner.on("\n").join(foundErrors)); - assertTrue("difference was in known difference, but is actually not a problem anymore: "+ Joiner.on("\n").join(noLongerFoundErrors), noLongerFoundErrors.isEmpty()); + assertTrue(noLongerFoundErrors.isEmpty(), "difference was in known difference, but is actually not a problem anymore: "+ Joiner.on("\n").join(noLongerFoundErrors)); assertEquals(knownDifferences.size(), compared.size()); } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java index 908cfb46d..c6c256445 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14DefaultOccurrencesConversionTest.java @@ -6,18 +6,16 @@ import com.nedap.archie.aom.CComplexObject; import com.nedap.archie.base.MultiplicityInterval; import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -public class ADL14DefaultOccurrencesConversionTest { +class ADL14DefaultOccurrencesConversionTest { @Test - public void testDefaultOccurrencesConversion() throws Exception { + void testDefaultOccurrencesConversion() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property @@ -29,15 +27,15 @@ public void testDefaultOccurrencesConversion() throws Exception { Archetype converted = result.getConversionResults().get(0).getArchetype(); CAttribute evaluationData = converted.itemAtPath("/data"); //these two should NOT be mandated if left empty in the CKM - assertNull(evaluationData.getCardinality()); - assertNull(evaluationData.getExistence()); + Assertions.assertNull(evaluationData.getCardinality()); + Assertions.assertNull(evaluationData.getExistence()); CComplexObject goalName = converted.itemAtPath("/data[id2]/items[id3]"); //was null in ADL 1.4. Should be set to 1..1 by default during conversion - assertEquals(new MultiplicityInterval(1, 1), goalName.getOccurrences()); + Assertions.assertEquals(new MultiplicityInterval(1, 1), goalName.getOccurrences()); CComplexObject goalNameValueText = converted.itemAtPath("/data[id2]/items[id3]/value[1]"); //was null in ADL 1.4. Because parent is single valued, this should be left null - assertNull(goalNameValueText.getOccurrences()); + Assertions.assertNull(goalNameValueText.getOccurrences()); } } } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java index 4afdae905..8ef00be52 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14ExternalTerminologyConversionTest.java @@ -5,7 +5,8 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.primitives.CTerminologyCode; import com.nedap.archie.aom.utils.AOMUtils; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; @@ -13,14 +14,10 @@ import java.net.URI; import java.util.List; -import static junit.framework.TestCase.assertFalse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class ADL14ExternalTerminologyConversionTest { +class ADL14ExternalTerminologyConversionTest { @Test - public void terminologyBindingsConverted() throws IOException, ADLParseException { + void terminologyBindingsConverted() throws IOException, ADLParseException { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property @@ -30,18 +27,18 @@ public void terminologyBindingsConverted() throws IOException, ADLParseException Archetype converted = result.getConversionResults().get(0).getArchetype(); CTerminologyCode termCodeConstraint = converted.itemAtPath("/items/value/property[1]"); String atCode = termCodeConstraint.getConstraint().get(0); - assertTrue("code must be a value, not a value set", AOMUtils.isValueCode(atCode)); - assertEquals("Mass", converted.getTerminology().getTermDefinition("en", atCode).getText()); - assertEquals("Mass", converted.getTerminology().getTermDefinition("en", atCode).getDescription()); + Assertions.assertTrue(AOMUtils.isValueCode(atCode), "code must be a value, not a value set"); + Assertions.assertEquals("Mass", converted.getTerminology().getTermDefinition("en", atCode).getText()); + Assertions.assertEquals("Mass", converted.getTerminology().getTermDefinition("en", atCode).getDescription()); - assertEquals("* Mass (en)", converted.getTerminology().getTermDefinition("no-bk", atCode).getText()); - assertEquals("* Mass (en)", converted.getTerminology().getTermDefinition("no-bk", atCode).getDescription()); + Assertions.assertEquals("* Mass (en)", converted.getTerminology().getTermDefinition("no-bk", atCode).getText()); + Assertions.assertEquals("* Mass (en)", converted.getTerminology().getTermDefinition("no-bk", atCode).getDescription()); } } @Test - public void twoTermbindingsInOneConstraint() throws Exception { + void twoTermbindingsInOneConstraint() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property @@ -49,19 +46,18 @@ public void twoTermbindingsInOneConstraint() throws Exception { ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); ADL2ConversionResultList result = converter.convert( Lists.newArrayList(parser.parse(stream, conversionConfiguration))); - assertFalse(parser.getErrors().hasErrors()); + Assertions.assertFalse(parser.getErrors().hasErrors()); Archetype converted = result.getConversionResults().get(0).getArchetype(); CTerminologyCode termCodeConstraint = converted.itemAtPath("/items/value/defining_code[1]"); String acCode = termCodeConstraint.getConstraint().get(0); - assertTrue("the code should have been converted to a value set", AOMUtils.isValueSetCode(acCode)); + Assertions.assertTrue(AOMUtils.isValueSetCode(acCode), "the code should have been converted to a value set"); List atCodes = termCodeConstraint.getValueSetExpanded(); - assertEquals(atCodes.toString(), 2, atCodes.size()); - assertEquals(new URI("http://openehr.org/id/123"), converted.getTerminology().getTermBinding("openehr", atCodes.get(0))); - assertEquals(new URI("http://openehr.org/id/234"), converted.getTerminology().getTermBinding("openehr", atCodes.get(1))); - assertEquals("Loudness", converted.getTerminology().getTermDefinition("en", atCodes.get(0)).getText()); - assertEquals("secondary allied health care", converted.getTerminology().getTermDefinition("en", atCodes.get(1)).getText()); - + Assertions.assertEquals(2, atCodes.size(), atCodes.toString()); + Assertions.assertEquals(new URI("http://openehr.org/id/123"), converted.getTerminology().getTermBinding("openehr", atCodes.get(0))); + Assertions.assertEquals(new URI("http://openehr.org/id/234"), converted.getTerminology().getTermBinding("openehr", atCodes.get(1))); + Assertions.assertEquals("Loudness", converted.getTerminology().getTermDefinition("en", atCodes.get(0)).getText()); + Assertions.assertEquals("secondary allied health care", converted.getTerminology().getTermDefinition("en", atCodes.get(1)).getText()); } } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java index b4a29b73b..687478acf 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14InternalTerminologyTest.java @@ -4,20 +4,18 @@ import com.nedap.archie.adlparser.ADLParseException; import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.terminology.ArchetypeTerm; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.io.InputStream; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class ADL14InternalTerminologyTest { +class ADL14InternalTerminologyTest { @Test - public void internalTerminologyRemoved() throws IOException, ADLParseException { + void internalTerminologyRemoved() throws IOException, ADLParseException { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); @@ -31,10 +29,10 @@ public void internalTerminologyRemoved() throws IOException, ADLParseException { // - AND If the term is NOT a root node // - AND parent is NOT a container attribute Map adl2Terminology = converted.getTerminology().getTermDefinitions().get("en"); - assertEquals(3, adl2Terminology.size()); - assertNotNull(adl2Terminology.get("id1")); // Should exist because it's a root node - assertNotNull(adl2Terminology.get("id3")); // Exists because its parent is a container attribute - assertNotNull(adl2Terminology.get("id8")); // Exists because the text is longer than 19 characters + Assertions.assertEquals(3, adl2Terminology.size()); + Assertions.assertNotNull(adl2Terminology.get("id1")); // Should exist because it's a root node + Assertions.assertNotNull(adl2Terminology.get("id3")); // Exists because its parent is a container attribute + Assertions.assertNotNull(adl2Terminology.get("id8")); // Exists because the text is longer than 19 characters } } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java index 9dc1ee02d..51948903e 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14TerminologyConversionTest.java @@ -3,18 +3,16 @@ import com.google.common.collect.Lists; import com.nedap.archie.aom.Archetype; import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class ADL14TerminologyConversionTest { +class ADL14TerminologyConversionTest { @Test - public void twoTermbindingsInOneConstraint() throws Exception { + void twoTermbindingsInOneConstraint() throws Exception { ADL14ConversionConfiguration conversionConfiguration = ConversionConfigForTest.getConfig(); ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), conversionConfiguration); //apply the first conversion and store the log. It has created an at code to bind to [openehr::124], used in a DV_QUANTITY.property @@ -24,11 +22,11 @@ public void twoTermbindingsInOneConstraint() throws Exception { Lists.newArrayList(parser.parse(stream, conversionConfiguration))); Archetype converted = result.getConversionResults().get(0).getArchetype(); - assertEquals("extra_value", converted.getTerminology().getTermDefinition("en", "id1").getOtherItems().get("extra_item")); - assertEquals("extra_value", converted.getTerminology().getTermDefinition("en", "id1").getOtherItems().get("Extra_item_2")); - assertEquals("extra_value", converted.getTerminology().getTermDefinition("en", "id1").getOtherItems().get("_Extra_item_2")); + Assertions.assertEquals("extra_value", converted.getTerminology().getTermDefinition("en", "id1").getOtherItems().get("extra_item")); + Assertions.assertEquals("extra_value", converted.getTerminology().getTermDefinition("en", "id1").getOtherItems().get("Extra_item_2")); + Assertions.assertEquals("extra_value", converted.getTerminology().getTermDefinition("en", "id1").getOtherItems().get("_Extra_item_2")); String serialized = ADLArchetypeSerializer.serialize(converted); - assertTrue(serialized.contains("extra_item = <\"extra_value\">")); + Assertions.assertTrue(serialized.contains("extra_item = <\"extra_value\">")); } } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java index 2f7dd51c0..84f7e96a9 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ArchetypeSlotConversionTest.java @@ -8,12 +8,12 @@ import com.nedap.archie.rules.Assertion; import com.nedap.archie.rules.BinaryOperator; import com.nedap.archie.rules.Constraint; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static junit.framework.TestCase.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ArchetypeSlotConversionTest { diff --git a/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java index 6d1b81612..6883150ed 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/AssumedValueConversionTest.java @@ -6,12 +6,12 @@ import com.nedap.archie.aom.primitives.CTerminologyCode; import com.nedap.archie.archetypevalidator.ArchetypeValidator; import com.nedap.archie.archetypevalidator.ValidationResult; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class AssumedValueConversionTest { @@ -37,6 +37,7 @@ public void testAssumedValueConversion() throws Exception { ValidationResult validationResult = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(archetype); - assertTrue(validationResult.toString(), validationResult.passes()); + assertNotNull(validationResult.toString()); + assertTrue(validationResult.passes()); } } diff --git a/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java b/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java index 913ba6e26..4abb3ee5c 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/ConversionConfigurationTest.java @@ -2,12 +2,12 @@ import com.google.common.collect.Lists; import com.nedap.archie.aom.Archetype; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static junit.framework.TestCase.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ConversionConfigurationTest { diff --git a/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java index 4dbc714a1..7fe09a018 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/DvScaleConversionTest.java @@ -3,14 +3,14 @@ import com.google.common.collect.Lists; import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.CComplexObject; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class DvScaleConversionTest { diff --git a/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java b/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java index 5d6ba295f..f79446af1 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/LargeSetOfADL14sTest.java @@ -7,8 +7,8 @@ import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CodePointCharStream; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.reflections.Reflections; import org.reflections.scanners.Scanners; @@ -19,8 +19,8 @@ import java.util.*; import java.util.regex.Pattern; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 16/10/15. @@ -30,7 +30,7 @@ public class LargeSetOfADL14sTest { private static Logger logger = LoggerFactory.getLogger(LargeSetOfADL14sTest.class); private ADL14ConversionConfiguration conversionConfiguration; - @Before + @BeforeEach public void setup() throws Exception { conversionConfiguration = ConversionConfigForTest.getConfig(); } diff --git a/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java b/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java index 950a7ecf2..cf81a1867 100644 --- a/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java +++ b/tools/src/test/java/com/nedap/archie/adl14/PreviousLogConversionTest.java @@ -8,7 +8,7 @@ import com.nedap.archie.aom.terminology.ArchetypeTerm; import com.nedap.archie.archetypevalidator.ArchetypeValidator; import com.nedap.archie.archetypevalidator.ValidationResult; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.openehr.utils.message.MessageDescriptor; import org.openehr.utils.message.MessageSeverity; @@ -16,8 +16,7 @@ import java.io.InputStream; import java.util.List; -import static junit.framework.TestCase.*; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class PreviousLogConversionTest { @@ -64,7 +63,8 @@ public void testValueSet() throws Exception { log = result.getConversionLog(); Archetype converted = result.getConversionResults().get(0).getArchetype(); ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); - assertTrue(validated.toString(), validated.passes() ); + assertNotNull(validated.toString()); + assertTrue(validated.passes()); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9000")); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9001")); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9002")); @@ -80,7 +80,8 @@ public void testValueSet() throws Exception { Archetype converted = result.getConversionResults().get(0).getArchetype(); ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); - assertTrue(validated.toString(), validated.passes() ); + assertNotNull(validated.toString()); + assertTrue(validated.passes()); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9000")); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9001")); assertTrue(converted.getTerminology().getTermDefinitions().get("nl").containsKey("ac9002")); @@ -102,7 +103,8 @@ public void unusedValuesAreRemoved() throws Exception { log = result.getConversionLog(); Archetype converted = result.getConversionResults().get(0).getArchetype(); ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); - assertTrue(validated.toString(), validated.passes() ); + assertNotNull(validated.toString()); + assertTrue(validated.passes()); createdAtCode = log.getConversionLog("openEHR-EHR-CLUSTER.value_binding.v1").getCreatedCodes().get("[openehr::124]").getGeneratedCode(); ArchetypeTerm termDefinition = converted.getTerminology().getTermDefinition("en", createdAtCode); assertNotNull(termDefinition); @@ -117,11 +119,11 @@ public void unusedValuesAreRemoved() throws Exception { log); Archetype converted = result.getConversionResults().get(0).getArchetype(); ValidationResult validated = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()).validate(converted); - assertTrue(validated.toString(), validated.passes() ); + assertTrue(validated.passes(), validated.toString()); ArchetypeTerm termDefinition = converted.getTerminology().getTermDefinition("en", "at9000"); assertNull(termDefinition); - assertFalse(validated.toString(), validated.hasWarningsOrErrors() ); + assertFalse(validated.hasWarningsOrErrors(), validated.toString()); ADL2ConversionRunLog log2 = result.getConversionLog(); //the code should still be present in the conversion log, should it be added later on diff --git a/tools/src/test/java/com/nedap/archie/adlparser/AOMPathQueryTest.java b/tools/src/test/java/com/nedap/archie/adlparser/AOMPathQueryTest.java index c90e6b392..658df6b10 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/AOMPathQueryTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/AOMPathQueryTest.java @@ -9,11 +9,12 @@ import com.nedap.archie.query.AOMPathQuery; import com.nedap.archie.query.PartialMatch; import com.nedap.archie.testutil.TestUtil; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; /** * Test APath queries with archetype model objects @@ -24,14 +25,14 @@ public class AOMPathQueryTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/basic.adl"); ArchieLanguageConfiguration.setThreadLocalLogicalPathLanguage("en"); ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("en"); } - @After + @AfterEach public void tearDown() throws Exception { ArchieLanguageConfiguration.setThreadLocalLogicalPathLanguage(null); ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage(null); @@ -124,32 +125,32 @@ public void findPartial() { String queryString = "/context[id11]/other_context[id2]/items[qualification]/items[4]/value[1]"; AOMPathQuery query = new AOMPathQuery(queryString); PartialMatch fullMatch = query.findPartial(archetype.getDefinition()); - assertTrue("this should be a full match", fullMatch.isFullMatch()); - assertEquals("only one object should be found", 1, fullMatch.getFoundObjects().size()); - assertEquals("the matched string should be equal to the query", queryString, fullMatch.getPathMatched()); - assertEquals("the remainder should be '/'", "/", fullMatch.getRemainingPath()); + assertTrue(fullMatch.isFullMatch(), "this should be a full match"); + assertEquals(1, fullMatch.getFoundObjects().size(), "only one object should be found"); + assertEquals(queryString, fullMatch.getPathMatched(), "the matched string should be equal to the query"); + assertEquals("/", fullMatch.getRemainingPath(), "the remainder should be '/'"); queryString = "/context[id11]/health_care_facility/name"; query = new AOMPathQuery(queryString); PartialMatch partialMatch = query.findPartial(archetype.getDefinition()); - assertFalse("this should be a partial match", partialMatch.isFullMatch()); - assertEquals("only one object should be found", 1, partialMatch.getFoundObjects().size()); + assertFalse(partialMatch.isFullMatch(), "this should be a partial match"); + assertEquals(1, partialMatch.getFoundObjects().size(), "only one object should be found"); assertEquals(archetype.getDefinition().getAttribute("context").getChildren().get(0), partialMatch.getFoundObjects().get(0)); - assertEquals("the matched string should be equal to the first part of the query", - "/context[id11]", partialMatch.getPathMatched()); - assertEquals("the remainder should contain the last part", - "/health_care_facility/name", partialMatch.getRemainingPath()); + assertEquals("/context[id11]", partialMatch.getPathMatched(), + "the matched string should be equal to the first part of the query"); + assertEquals("/health_care_facility/name", partialMatch.getRemainingPath(), + "the remainder should contain the last part"); queryString = "/non_existing_path/with_extras"; query = new AOMPathQuery(queryString); PartialMatch noMatch = query.findPartial(archetype.getDefinition()); - assertFalse("this should be a partial match", noMatch.isFullMatch()); - assertEquals("the root node should be found", 1, noMatch.getFoundObjects().size()); + assertFalse(noMatch.isFullMatch(), "this should be a partial match"); + assertEquals(1, noMatch.getFoundObjects().size(), "the root node should be found"); assertEquals(archetype.getDefinition(), noMatch.getFoundObjects().get(0)); - assertEquals("the matched string should be empty", - "/", noMatch.getPathMatched()); - assertEquals("the remainder should contain the full query", - queryString, noMatch.getRemainingPath()); + assertEquals("/", noMatch.getPathMatched(), + "the matched string should be empty"); + assertEquals(queryString, noMatch.getRemainingPath(), + "the remainder should contain the full query"); } } diff --git a/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java b/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java index d7cc0f0b6..fe0055bd8 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/AomUtilsPathFindingTest.java @@ -4,11 +4,11 @@ import com.nedap.archie.aom.utils.AOMUtils; import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class AomUtilsPathFindingTest { diff --git a/tools/src/test/java/com/nedap/archie/adlparser/CStringParserTest.java b/tools/src/test/java/com/nedap/archie/adlparser/CStringParserTest.java index f06931cb9..40e500d63 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/CStringParserTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/CStringParserTest.java @@ -4,10 +4,10 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.CAttribute; import com.nedap.archie.aom.primitives.CString; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; /** * Test CString parsing. Does not test regexpes, see @RegexTest for that diff --git a/tools/src/test/java/com/nedap/archie/adlparser/ComponentTerminologiesParseTest.java b/tools/src/test/java/com/nedap/archie/adlparser/ComponentTerminologiesParseTest.java index c696c8b92..86c3f9190 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/ComponentTerminologiesParseTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/ComponentTerminologiesParseTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.adlparser; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ComponentTerminologiesParseTest { diff --git a/tools/src/test/java/com/nedap/archie/adlparser/DefinitionTest.java b/tools/src/test/java/com/nedap/archie/adlparser/DefinitionTest.java index d25565123..2ccdd1dcb 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/DefinitionTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/DefinitionTest.java @@ -4,13 +4,13 @@ import com.nedap.archie.aom.primitives.CString; import com.nedap.archie.aom.primitives.CTerminologyCode; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 19/10/15. @@ -19,7 +19,7 @@ public class DefinitionTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/basic.adl");; } diff --git a/tools/src/test/java/com/nedap/archie/adlparser/LargeSetOfADLsTest.java b/tools/src/test/java/com/nedap/archie/adlparser/LargeSetOfADLsTest.java index ff5e6bfc1..723da9a0f 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/LargeSetOfADLsTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/LargeSetOfADLsTest.java @@ -1,7 +1,7 @@ package com.nedap.archie.adlparser; import com.nedap.archie.antlr.errors.ANTLRParserErrors; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reflections.Reflections; import org.reflections.scanners.Scanners; import org.slf4j.Logger; @@ -14,7 +14,7 @@ import java.util.Map; import java.util.regex.Pattern; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 16/10/15. diff --git a/tools/src/test/java/com/nedap/archie/adlparser/MetadataTest.java b/tools/src/test/java/com/nedap/archie/adlparser/MetadataTest.java index 6400bdff5..1571212ee 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/MetadataTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/MetadataTest.java @@ -4,13 +4,13 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.CComplexObject; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.List; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** diff --git a/tools/src/test/java/com/nedap/archie/adlparser/NumberConstraintParserTest.java b/tools/src/test/java/com/nedap/archie/adlparser/NumberConstraintParserTest.java index f7648d928..527f48138 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/NumberConstraintParserTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/NumberConstraintParserTest.java @@ -3,10 +3,10 @@ import com.nedap.archie.aom.primitives.CInteger; import com.nedap.archie.aom.primitives.CReal; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; /** * Created by pieter.bos on 01/11/15. diff --git a/tools/src/test/java/com/nedap/archie/adlparser/PathTest.java b/tools/src/test/java/com/nedap/archie/adlparser/PathTest.java index 9b2d0028f..d407d5a06 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/PathTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/PathTest.java @@ -5,11 +5,11 @@ import com.nedap.archie.aom.CAttribute; import com.nedap.archie.aom.CObject; import com.nedap.archie.testutil.TestUtil; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Created by pieter.bos on 20/10/15. @@ -18,13 +18,13 @@ public class PathTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/basic.adl"); ArchieLanguageConfiguration.setThreadLocalLogicalPathLanguage("en"); } - @After + @AfterEach public void tearDown() throws Exception { ArchieLanguageConfiguration.setThreadLocalLogicalPathLanguage(null); } diff --git a/tools/src/test/java/com/nedap/archie/adlparser/PrimitivesConstraintParserTest.java b/tools/src/test/java/com/nedap/archie/adlparser/PrimitivesConstraintParserTest.java index 353a793d9..a273313dd 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/PrimitivesConstraintParserTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/PrimitivesConstraintParserTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; /** * Created by pieter.bos on 31/10/15. @@ -11,7 +11,7 @@ public abstract class PrimitivesConstraintParserTest { protected Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/adl2-tests/features/aom_structures/basic/openehr-TEST_PKG-WHOLE.primitive_types.v1.0.0.adls"); } diff --git a/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java b/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java index e3a26a967..200cc7063 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/RMPathQueryTest.java @@ -16,14 +16,14 @@ import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** * Test APath query with RM Objects @@ -36,7 +36,7 @@ public class RMPathQueryTest { private Archetype archetype; private Pathable root; - @Before + @BeforeEach public void setup() throws Exception { testUtil = new TestUtil(); archetype = TestUtil.parseFailOnErrors("/basic.adl"); diff --git a/tools/src/test/java/com/nedap/archie/adlparser/RegexTest.java b/tools/src/test/java/com/nedap/archie/adlparser/RegexTest.java index ef39061a8..7ea7c9c5b 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/RegexTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/RegexTest.java @@ -4,11 +4,11 @@ import com.nedap.archie.aom.primitives.CString; import com.nedap.archie.rules.*; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Created by pieter.bos on 31/10/15. diff --git a/tools/src/test/java/com/nedap/archie/adlparser/TemporalConstraintParserTest.java b/tools/src/test/java/com/nedap/archie/adlparser/TemporalConstraintParserTest.java index bd41b945e..eadb4ad69 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/TemporalConstraintParserTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/TemporalConstraintParserTest.java @@ -3,8 +3,8 @@ import com.nedap.archie.aom.primitives.CDate; import com.nedap.archie.aom.primitives.CDuration; import com.nedap.archie.base.Interval; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Duration; import java.time.Period; @@ -12,7 +12,7 @@ import java.time.temporal.TemporalAmount; import java.util.Locale; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 30/10/15. @@ -20,7 +20,7 @@ public class TemporalConstraintParserTest extends PrimitivesConstraintParserTest { - @Before + @BeforeEach public void setup() throws Exception { Locale.setDefault(Locale.US); super.setup(); diff --git a/tools/src/test/java/com/nedap/archie/adlparser/TerminologyTest.java b/tools/src/test/java/com/nedap/archie/adlparser/TerminologyTest.java index 9f10c11a5..bb73ee4d5 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/TerminologyTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/TerminologyTest.java @@ -3,13 +3,13 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.terminology.ArchetypeTerm; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.net.URI; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; /** * Created by pieter.bos on 19/10/15. @@ -18,7 +18,7 @@ public class TerminologyTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/basic.adl");; } diff --git a/tools/src/test/java/com/nedap/archie/adlparser/modelconstraints/RMConstraintImposerTest.java b/tools/src/test/java/com/nedap/archie/adlparser/modelconstraints/RMConstraintImposerTest.java index 58adbdf0b..cffc08656 100644 --- a/tools/src/test/java/com/nedap/archie/adlparser/modelconstraints/RMConstraintImposerTest.java +++ b/tools/src/test/java/com/nedap/archie/adlparser/modelconstraints/RMConstraintImposerTest.java @@ -5,10 +5,10 @@ import com.nedap.archie.aom.CAttribute; import com.nedap.archie.base.Cardinality; import com.nedap.archie.base.MultiplicityInterval; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 04/11/15. @@ -17,7 +17,7 @@ public class RMConstraintImposerTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = new ADLParser(new RMConstraintImposer()).parse(getClass().getResourceAsStream("/adl2-tests/features/alternatives/openEHR-EHR-ADMIN_ENTRY.dependency_choice.v1.0.0.adls")); } diff --git a/tools/src/test/java/com/nedap/archie/aom/ArchetypeCloneTest.java b/tools/src/test/java/com/nedap/archie/aom/ArchetypeCloneTest.java index 7a1d0ca5c..692826e4e 100644 --- a/tools/src/test/java/com/nedap/archie/aom/ArchetypeCloneTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/ArchetypeCloneTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.aom; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotSame; /** * Created by pieter.bos on 21/10/15. @@ -13,7 +13,7 @@ public class ArchetypeCloneTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/basic.adl"); } @@ -21,9 +21,8 @@ public void setup() throws Exception { @Test public void cloneArchetype() { Archetype cloned = archetype.clone(); - assertFalse(cloned == archetype); - assertFalse(archetype.getDefinition().getAttributes().get(0) == - cloned.getDefinition().getAttributes().get(0)); + assertNotSame(cloned, archetype); + assertNotSame(archetype.getDefinition().getAttributes().get(0), cloned.getDefinition().getAttributes().get(0)); } diff --git a/tools/src/test/java/com/nedap/archie/aom/ArchetypeSlotTest.java b/tools/src/test/java/com/nedap/archie/aom/ArchetypeSlotTest.java index c5222d5a1..4e9cf69f0 100644 --- a/tools/src/test/java/com/nedap/archie/aom/ArchetypeSlotTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/ArchetypeSlotTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.aom; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ArchetypeSlotTest { diff --git a/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java b/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java index 2f2e31771..220746df1 100644 --- a/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/ArchetypeTerminologyTest.java @@ -6,18 +6,19 @@ import com.nedap.archie.flattener.FlattenerConfiguration; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.flattener.specexamples.FlattenerTestUtil; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ArchetypeTerminologyTest { - @After + @AfterEach public void tearDown() { ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage(null); } @@ -32,7 +33,7 @@ public void termForUseArchetype() throws IOException, ADLParseException { //check that they are valid, just to be sure repository.compile(BuiltinReferenceModels.getMetaModelProvider()); - repository.getAllValidationResults().forEach(s -> assertTrue(s.getErrors().toString(), s.getErrors().isEmpty())); + repository.getAllValidationResults().forEach(s -> assertThat(s.getErrors().toString(), s.getErrors().isEmpty())); //create operational template Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); diff --git a/tools/src/test/java/com/nedap/archie/aom/AttributeTupleConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/AttributeTupleConstraintsTest.java index 922666c53..2081cfb78 100644 --- a/tools/src/test/java/com/nedap/archie/aom/AttributeTupleConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/AttributeTupleConstraintsTest.java @@ -3,12 +3,12 @@ import com.nedap.archie.rm.datavalues.quantity.DvQuantity; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.HashMap; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 21/03/16. @@ -18,7 +18,7 @@ public class AttributeTupleConstraintsTest { private static CAttributeTuple attributeTuple; - @BeforeClass + @BeforeAll public static void setup() throws Exception { Archetype archetype = TestUtil.parseFailOnErrors("/basic.adl"); CComplexObject valueObject = archetype.getDefinition().itemAtPath("/context[id11]/other_context[id2]/items[id3]/items[id7]/value[id16]"); diff --git a/tools/src/test/java/com/nedap/archie/aom/BooleanConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/BooleanConstraintsTest.java index edef90706..f27d24fa9 100644 --- a/tools/src/test/java/com/nedap/archie/aom/BooleanConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/BooleanConstraintsTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.aom; import com.nedap.archie.aom.primitives.CBoolean; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 23/02/16. diff --git a/tools/src/test/java/com/nedap/archie/aom/CAttributeTest.java b/tools/src/test/java/com/nedap/archie/aom/CAttributeTest.java index f11fab799..e8f99594e 100644 --- a/tools/src/test/java/com/nedap/archie/aom/CAttributeTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/CAttributeTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.aom; import com.nedap.archie.base.MultiplicityInterval; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 14/04/2017. diff --git a/tools/src/test/java/com/nedap/archie/aom/CComplexObjectProxyTest.java b/tools/src/test/java/com/nedap/archie/aom/CComplexObjectProxyTest.java index f1258369e..587e53a8a 100644 --- a/tools/src/test/java/com/nedap/archie/aom/CComplexObjectProxyTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/CComplexObjectProxyTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.aom; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class CComplexObjectProxyTest { diff --git a/tools/src/test/java/com/nedap/archie/aom/CComplexObjectTest.java b/tools/src/test/java/com/nedap/archie/aom/CComplexObjectTest.java index a42cc4e68..1d32269a7 100644 --- a/tools/src/test/java/com/nedap/archie/aom/CComplexObjectTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/CComplexObjectTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.aom; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class CComplexObjectTest { diff --git a/tools/src/test/java/com/nedap/archie/aom/CObjectTest.java b/tools/src/test/java/com/nedap/archie/aom/CObjectTest.java index dc4f925a1..aaf896b8f 100644 --- a/tools/src/test/java/com/nedap/archie/aom/CObjectTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/CObjectTest.java @@ -4,13 +4,13 @@ import com.nedap.archie.base.Cardinality; import com.nedap.archie.base.MultiplicityInterval; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.function.BiFunction; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; /** * Created by pieter.bos on 20/04/16. @@ -19,7 +19,7 @@ public class CObjectTest { private Archetype archetype; - @Before + @BeforeEach public void setup() throws Exception { archetype = TestUtil.parseFailOnErrors("/basic.adl"); } diff --git a/tools/src/test/java/com/nedap/archie/aom/CPrimitiveObjectTest.java b/tools/src/test/java/com/nedap/archie/aom/CPrimitiveObjectTest.java index f77573f0e..64f14f5d4 100644 --- a/tools/src/test/java/com/nedap/archie/aom/CPrimitiveObjectTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/CPrimitiveObjectTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.aom; import com.nedap.archie.aom.primitives.CBoolean; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class CPrimitiveObjectTest { diff --git a/tools/src/test/java/com/nedap/archie/aom/DateConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/DateConstraintsTest.java index 6ff7da09f..79a9e1481 100644 --- a/tools/src/test/java/com/nedap/archie/aom/DateConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/DateConstraintsTest.java @@ -2,13 +2,13 @@ import com.nedap.archie.aom.primitives.CDate; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.Month; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 23/02/16. diff --git a/tools/src/test/java/com/nedap/archie/aom/MultiplicityIntervalTest.java b/tools/src/test/java/com/nedap/archie/aom/MultiplicityIntervalTest.java index 6bc050654..946f15eaf 100644 --- a/tools/src/test/java/com/nedap/archie/aom/MultiplicityIntervalTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/MultiplicityIntervalTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.aom; import com.nedap.archie.base.MultiplicityInterval; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 14/04/2017. diff --git a/tools/src/test/java/com/nedap/archie/aom/NumberConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/NumberConstraintsTest.java index 5ce5a4f33..4441495b1 100644 --- a/tools/src/test/java/com/nedap/archie/aom/NumberConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/NumberConstraintsTest.java @@ -3,10 +3,10 @@ import com.nedap.archie.aom.primitives.CInteger; import com.nedap.archie.aom.primitives.CReal; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 01/11/15. diff --git a/tools/src/test/java/com/nedap/archie/aom/StringConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/StringConstraintsTest.java index 504309462..e414b3f16 100644 --- a/tools/src/test/java/com/nedap/archie/aom/StringConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/StringConstraintsTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.aom; import com.nedap.archie.aom.primitives.CString; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 23/02/16. diff --git a/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java index e33656d30..68982fd44 100644 --- a/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/TerminologyCodeConstraintsTest.java @@ -16,16 +16,16 @@ import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rules.evaluation.DummyRulesPrimitiveObjectParent; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.net.URI; import java.util.*; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 23/02/16. @@ -35,7 +35,7 @@ public class TerminologyCodeConstraintsTest { private Archetype archetype; - @Before + @BeforeEach public void setupArchetype() { archetype = new AuthoredArchetype(); diff --git a/tools/src/test/java/com/nedap/archie/aom/TimeConstraintsTest.java b/tools/src/test/java/com/nedap/archie/aom/TimeConstraintsTest.java index e3ad86013..c26938c8d 100644 --- a/tools/src/test/java/com/nedap/archie/aom/TimeConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/aom/TimeConstraintsTest.java @@ -2,12 +2,12 @@ import com.nedap.archie.aom.primitives.CTime; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalTime; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 23/02/16. diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java index e8dea76cc..2f5950087 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java @@ -7,14 +7,15 @@ import com.nedap.archie.openehrtestrm.TestRMInfoLookup; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ReferenceModels; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.util.List; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 05/04/2017. @@ -26,7 +27,7 @@ public class ArchetypeValidatorTest { private ReferenceModels models; - @Before + @BeforeEach public void setup() { parser = new ADLParser(); models = new ReferenceModels(); @@ -56,7 +57,7 @@ public void VCARMNonExistantType() throws Exception { ValidationResult validationResult = new ArchetypeValidator(models).validate(archetype); List messages = validationResult.getErrors(); System.out.println(messages); - assertEquals(messages.toString(), 1, messages.size()); + assertEquals(1, messages.size(), messages.toString()); assertEquals(ErrorType.VCARM, messages.get(0).getType()); assertNull(validationResult.getFlattened()); } @@ -80,7 +81,7 @@ public void VCORMTNonConformingType2() throws Exception { ValidationResult validationResult = new ArchetypeValidator(models).validate(archetype); List messages = validationResult.getErrors(); System.out.println(messages); - assertEquals(messages.toString(), 1, messages.size()); + assertEquals(1, messages.size(), messages.toString()); assertEquals(ErrorType.VCORMT, messages.get(0).getType()); } @@ -93,11 +94,11 @@ public void VACDFidCodeNotPresent() throws Exception { } private void assertOneError(ValidationResult validationResult, ErrorType vacdf) { - assertFalse(validationResult.toString(), validationResult.passes()); + assertFalse(validationResult.passes(), validationResult.toString()); List messages = validationResult.getErrors(); - assertEquals(validationResult.toString(), 1, messages.size()); - assertEquals(validationResult.toString(), vacdf, messages.get(0).getType()); + assertEquals(1, messages.size(), validationResult.toString()); + assertEquals(vacdf, messages.get(0).getType(), validationResult.toString()); } @Test @@ -116,7 +117,7 @@ public void tupleMemberSizeMismatch() throws Exception { System.out.println(messages); assertEquals(2, messages.size()); assertEquals(ErrorType.OTHER, messages.get(0).getType()); - assertTrue("message should complain about tuple members being incorrect", messages.get(0).getMessage().contains("In the attribute tuple 3 members were specified, but the primitive tuple has 2 members instead")); + assertThat("message should complain about tuple members being incorrect", messages.get(0).getMessage().contains("In the attribute tuple 3 members were specified, but the primitive tuple has 2 members instead")); } @Test @@ -154,7 +155,7 @@ public void slotFillerWithIncludes() throws Exception { } { ValidationResult validationResult = new ArchetypeValidator(models).validate(childArchetype, repository); - assertTrue(validationResult.toString(), validationResult.passes()); + assertThat(validationResult.toString(), validationResult.passes()); } } @@ -172,7 +173,7 @@ public void correctSlotFiller() throws Exception { repository.addArchetype(parse("/adl2-tests/features/reference_model/generic_types/openEHR-EHR-OBSERVATION.rm_correct_generic.v1.0.0.adls")); ValidationResult validationResult = new ArchetypeValidator(models).validate(childArchetype, repository); - assertTrue(validationResult.toString(), validationResult.passes()); + assertThat(validationResult.toString(), validationResult.passes()); } @Test @@ -190,7 +191,7 @@ public void slotFillerWithExcludes() throws Exception { repository.addArchetype(parse("/adl2-tests/features/reference_model/generic_types/openEHR-EHR-OBSERVATION.rm_correct_generic.v1.0.0.adls")); { ValidationResult validationResult = new ArchetypeValidator(models).validate(childArchetype, repository); - assertTrue(validationResult.toString(), validationResult.passes()); + assertTrue(validationResult.passes(), validationResult.toString()); } { @@ -216,8 +217,8 @@ public void parentWithDifferentRmRelease() throws IOException, ADLParseException ValidationResult validatedChild = archetypeValidator.validate(child, repository); ValidationResult validatedParent = archetypeValidator.validate(parent, repository); - assertTrue(validatedChild.getErrors().toString(), validatedChild.passes()); - assertTrue(validatedParent.getErrors().toString(), validatedParent.passes()); + assertThat(validatedChild.getErrors().toString(), validatedChild.passes()); + assertThat(validatedParent.getErrors().toString(), validatedParent.passes()); } { InMemoryFullArchetypeRepository repository = new InMemoryFullArchetypeRepository(); @@ -228,8 +229,8 @@ public void parentWithDifferentRmRelease() throws IOException, ADLParseException ValidationResult validatedParent = archetypeValidator.validate(parent, repository); ValidationResult validatedChild = archetypeValidator.validate(child, repository); - assertTrue(validatedChild.getErrors().toString(), validatedChild.passes()); - assertTrue(validatedParent.getErrors().toString(), validatedParent.passes()); + assertThat(validatedChild.getErrors().toString(), validatedChild.passes()); + assertThat(validatedParent.getErrors().toString(), validatedParent.passes()); } } @@ -246,11 +247,11 @@ public void specialisationWithRedefinedAndExcludedMandatoryMultiNode() throws Ex { ValidationResult validationResult = new ArchetypeValidator(models).validate(childArchetype, repository); - assertTrue(validationResult.toString(), validationResult.passes()); + assertThat(validationResult.toString(), validationResult.passes()); } { ValidationResult validationResult = new ArchetypeValidator(models).validate(grandchildArchetype, repository); - assertTrue(validationResult.toString(), validationResult.passes()); + assertThat(validationResult.toString(), validationResult.passes()); } } @@ -265,7 +266,7 @@ public void specialisationWithRedefinedAndExcludedMandatoryMultiNodeFails() thro { ValidationResult validationResult = new ArchetypeValidator(models).validate(childArchetype, repository); - assertFalse(validationResult.toString(), validationResult.passes()); + assertFalse(validationResult.passes(), validationResult.toString()); assertEquals("Occurrences 3..5, which is the sum of 2..3, 1..2, 0..0, does not conform to 1..4", validationResult.getErrors().get(0).getMessage()); } } @@ -281,7 +282,7 @@ public void specialisationOfDvTextToDvTextAndDvCodedText() throws Exception { { ValidationResult validationResult = new ArchetypeValidator(models).validate(childArchetype, repository); - assertTrue(validationResult.toString(), validationResult.passes()); + assertThat(validationResult.toString(), validationResult.passes()); } } @@ -342,7 +343,7 @@ public void incompatibleNodeIdValidationTest() throws IOException, ADLParseExcep private Archetype parse(String filename) throws IOException, ADLParseException { archetype = parser.parse(ArchetypeValidatorTest.class.getResourceAsStream(filename)); - assertTrue(parser.getErrors().toString(), parser.getErrors().hasNoErrors()); + assertThat(parser.getErrors().toString(), parser.getErrors().hasNoErrors()); return archetype; } diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java index 4a706638f..2a1d9651e 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorVersionsTest.java @@ -4,12 +4,13 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ArchetypeValidatorVersionsTest { @@ -31,7 +32,7 @@ public void testMultipleVersions() throws IOException, ADLParseException { //the validator should automatically detect that v1.1 is newer, and should be used as the parent, not not parentv1 //and create a new ValidationResult instead of reusing parent v1 ValidationResult childValidation = archetypeValidator.validate(child, repo); - assertTrue(childValidation.getErrors().toString(), childValidation.passes()); + assertThat(childValidation.getErrors().toString(), childValidation.passes()); //and of course this should be valid as well. assertTrue(archetypeValidator.validate(parentv11, repo).passes()); @@ -49,7 +50,7 @@ public void testMultipleVersionsFullyCompile() throws Exception { repo.addArchetype(child); repo.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider())); for(ValidationResult result:repo.getAllValidationResults()) { - assertTrue(result.getErrors().toString(), result.passes()); + assertThat(result.getErrors().toString(), result.passes()); } } } diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java index 10d7a98a1..f8ad7eef2 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/BigArchetypeValidatorTest.java @@ -14,9 +14,7 @@ import com.nedap.archie.rminfo.ReferenceModels; import com.nedap.archie.rminfo.SimpleMetaModelProvider; import org.apache.commons.io.FilenameUtils; -import org.junit.Assert; -import org.junit.Test; -import org.openehr.bmm.v2.validation.BmmRepository; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.reflections.Reflections; import org.reflections.scanners.Scanners; @@ -28,6 +26,8 @@ import java.util.*; import java.util.regex.Pattern; +import static org.junit.jupiter.api.Assertions.fail; + /** * //TODO: add list of errortypes NOT tested by the testset, so we can add files for that * @@ -266,7 +266,7 @@ public void testInner(MetaModelProvider metaModelProvider) { } } if(errorCount > 0) { - Assert.fail(String.format("%s errors, %s wrong messages, %s validated but should not, %s correct, %s did not validate but should, %s not yet implemented, %s unexpected parser errors: \n%s", + fail(String.format("%s errors, %s wrong messages, %s validated but should not, %s correct, %s did not validate but should, %s not yet implemented, %s unexpected parser errors: \n%s", errorCount, wrongMessageCount, correctButShouldBeInvalid, correctCount, shouldBeFineButWasinvalid, notImplemented, unexpectedParseErrors, Joiner.on(", ").join(errorStrings))); } log.info(String.format("%s errors, %s wrong messages, %s validated but should not, %s correct, %s did not validate but should, %s not yet implemented, %s unexpected parser errors: \n%s", diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java index e09dbd10a..1e37d9734 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/CKMArchetypeValidatorTest.java @@ -6,7 +6,7 @@ import com.nedap.archie.rminfo.ReferenceModels; import com.nedap.archie.rminfo.SimpleMetaModelProvider; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,7 +16,8 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * False positive test for the archetype validator: @@ -82,7 +83,7 @@ private void runTest(FullArchetypeRepository repository) { error.append("\n\n"); } - assertTrue(error.toString(), resultWithErrors.isEmpty()); + assertThat(error.toString(), resultWithErrors.isEmpty()); } diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ComplexArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ComplexArchetypeValidatorTest.java index 31d40ba70..b5fab92bd 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ComplexArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ComplexArchetypeValidatorTest.java @@ -4,13 +4,13 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.rminfo.ReferenceModels; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ComplexArchetypeValidatorTest { private ReferenceModels models; @@ -22,7 +22,7 @@ public class ComplexArchetypeValidatorTest { private static InMemoryFullArchetypeRepository repository; - @Before + @BeforeEach public void setup() throws Exception { models = BuiltinReferenceModels.getAvailableModelInfoLookups(); diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java index 49da00b3c..f55fbe8f1 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java @@ -8,14 +8,15 @@ import com.nedap.archie.flattener.FlattenerConfiguration; import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.util.Arrays; import java.util.LinkedHashSet; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; public class TermCodeSpecializationTest { @@ -29,7 +30,7 @@ public void validRequiredBindingStrength() throws Exception { ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); for(ValidationResult validationResult:repo.getAllValidationResults()) { - assertTrue(validationResult.toString(), validationResult.passes()); + assertThat(validationResult.toString(), validationResult.passes()); } Flattener flattener = new Flattener(repo, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()); OperationalTemplate opt = (OperationalTemplate) flattener.flatten(child); @@ -47,8 +48,8 @@ public void invalidRequiredBindingStrength() throws Exception { ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_invalid_child.v1.0.0"); - assertFalse(validationResult.toString(), validationResult.passes()); - assertTrue("VPOV error should be present", validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VPOV).findFirst().isPresent()); + assertFalse(validationResult.passes(), validationResult.toString()); + assertTrue(validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VPOV).findFirst().isPresent(), "VPOV error should be present"); } @Test @@ -61,8 +62,8 @@ public void invalidConstraintStrengthRedefinition() throws Exception { ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_invalid_redefinition.v1.0.0"); - assertFalse(validationResult.toString(), validationResult.passes()); - assertEquals("one VPOV error should be present", 1, validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VPOV).count()); + assertFalse(validationResult.passes(), validationResult.toString()); + assertEquals(1, validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VPOV).count(), "one VPOV error should be present"); } @Test @@ -75,7 +76,7 @@ public void valueSetCodeChanges() throws IOException, ADLParseException { ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_change_valueset_code.v1.0.0"); - assertFalse(validationResult.toString(), validationResult.passes()); + assertFalse(validationResult.passes(), validationResult.toString()); assertEquals(ErrorType.VPOV, validationResult.getErrors().get(0).getType()); assertEquals("/items[id2]/value[id3]/defining_code", validationResult.getErrors().get(0).getPathInArchetype()); @@ -99,8 +100,8 @@ public void invalidValueSetRedefinition() throws IOException, ADLParseException ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.constraint_strength_invalid_redefined_value-set.v1.0.0"); - assertFalse(validationResult.toString(), validationResult.passes()); - assertTrue("VALUESET_REDEFINITION_ERROR error should be present in " + validationResult, validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VALUESET_REDEFINITION_ERROR).findFirst().isPresent()); + assertFalse(validationResult.passes(), validationResult.toString()); + assertTrue(validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VALUESET_REDEFINITION_ERROR).findFirst().isPresent(), "VALUESET_REDEFINITION_ERROR error should be present in " + validationResult); } @Test @@ -113,7 +114,7 @@ public void nonExistingParentValueSet() throws IOException, ADLParseException { ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); repo.compile(archetypeValidator); ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.incorrect_parent_valueset_code.v1.0.0"); - assertFalse(validationResult.toString(), validationResult.passes()); - assertTrue("VALUESET_REDEFINITION_ERROR error should be present in " + validationResult, validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VALUESET_REDEFINITION_ERROR).findFirst().isPresent()); + assertFalse(validationResult.passes(), validationResult.toString()); + assertTrue(validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VALUESET_REDEFINITION_ERROR).findFirst().isPresent(), "VALUESET_REDEFINITION_ERROR error should be present in " + validationResult); } } diff --git a/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java b/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java index f39680895..facbc1729 100644 --- a/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java +++ b/tools/src/test/java/com/nedap/archie/creation/ExampleJsonInstanceGeneratorTest.java @@ -25,7 +25,7 @@ import com.nedap.archie.rmobjectvalidator.ValidationConfiguration; import com.nedap.archie.testutil.DummyOperationalTemplateProvider; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.leadpony.justify.api.Problem; import org.openehr.bmm.core.BmmModel; import org.openehr.referencemodels.BuiltinReferenceModels; @@ -40,8 +40,8 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ExampleJsonInstanceGeneratorTest { @@ -73,7 +73,7 @@ public void bloodPressure() throws Exception { Map encoding = (Map) structure.get("encoding"); assertEquals("CODE_PHRASE", encoding.get(TYPE_PROPERTY_NAME)); Map terminologyId = (Map) encoding.get("terminology_id"); - assertEquals("the default value for a terminology id encoding should be \"IANA_character-sets\"", "IANA_character-sets", terminologyId.get("value")); + assertEquals("IANA_character-sets", terminologyId.get("value"), "the default value for a terminology id encoding should be \"IANA_character-sets\""); List events = (List) data.get("events"); assertEquals(3, events.size()); assertEquals("POINT_EVENT", ((Map) events.get(0)).get(TYPE_PROPERTY_NAME)); @@ -272,12 +272,12 @@ public void generateAllCKMExamples() throws Exception { logger.info("failed validation " + jsonSchemaValidationFailed + " of " + jsonSchemaValidationRan); logger.info("failed validation of reserialized json " + reserializedJsonSchemaValidationFailed + " of " + secondJsonSchemaValidationRan); logger.info("failed validation of RM Objects+invariants " + rmObjectValidatorFailed + " of " + rmObjectValidatorRan); - assertEquals("Example JSON schema should not fail", 0, jsonSchemaValidationFailed); - assertEquals("Example JSON schema serialized from RM implementation should not fail", 0, reserializedJsonSchemaValidationFailed); - assertEquals("RMObjectValidator should not fail", 0, rmObjectValidatorFailed); - assertEquals("no exceptions should occur during schema validation", 0, generatedException); - assertEquals("example data from all archetypes should be validated", 403, jsonSchemaValidationRan); - assertEquals("example data from all archetypes should be validated from the rm", 403, secondJsonSchemaValidationRan); + assertEquals(0, jsonSchemaValidationFailed, "Example JSON schema should not fail"); + assertEquals(0, reserializedJsonSchemaValidationFailed, "Example JSON schema serialized from RM implementation should not fail"); + assertEquals(0, rmObjectValidatorFailed, "RMObjectValidator should not fail"); + assertEquals(0, generatedException, "no exceptions should occur during schema validation"); + assertEquals(403, jsonSchemaValidationRan, "example data from all archetypes should be validated"); + assertEquals(403, secondJsonSchemaValidationRan, "example data from all archetypes should be validated from the rm"); } diff --git a/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java b/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java index 142830d81..27f8b47ae 100644 --- a/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java +++ b/tools/src/test/java/com/nedap/archie/creation/RMObjectCreatorTest.java @@ -10,12 +10,11 @@ import com.nedap.archie.rm.datastructures.Element; import com.nedap.archie.rm.datavalues.DvBoolean; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.LinkedHashMap; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 10/05/2017. @@ -70,7 +69,7 @@ public void createdArchetypedObject() { assertEquals("1.1.0", archetypeDetails.getRmVersion()); } - @Test(expected=IllegalArgumentException.class) + @Test public void createUnknownType() { Archetype archetype = new AuthoredArchetype(); archetype.setTerminology(new ArchetypeTerminology()); @@ -83,7 +82,7 @@ public void createUnknownType() { elementConstraint.setNodeId("id6"); archetype.setDefinition(elementConstraint); - Object o = creator.create(elementConstraint); + assertThrows(IllegalArgumentException.class, ()-> creator.create(elementConstraint)); } @Test @@ -103,21 +102,21 @@ public void setSingleValuedValuePrimitive() { assertEquals(true, booleanValue.getValue()); } - @Test(expected = IllegalArgumentException.class) + @Test @Deprecated public void setSingleValuedValueIncorrectly() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); DvBoolean booleanValue2 = new DvBoolean(); - creator.set(element, "value", Lists.newArrayList(booleanValue, booleanValue2)); + assertThrows(IllegalArgumentException.class, () -> creator.set(element, "value", Lists.newArrayList(booleanValue, booleanValue2))); } - @Test(expected = IllegalArgumentException.class) + @Test @Deprecated public void setSingleValuedValueUnknownArgument() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); - creator.set(element, "values", Lists.newArrayList(booleanValue)); + assertThrows(IllegalArgumentException.class, () -> creator.set(element, "values", Lists.newArrayList(booleanValue))); } @Test @@ -180,14 +179,20 @@ public void addToListOrSetSingleValueWithSingleValue2() { assertEquals(booleanValue, element.getValue()); } - @Test(expected = IllegalArgumentException.class) + @Test @Deprecated public void addToListOrSetSingleValueWithSingleValueIncorrect() { Element element = new Element(); DvBoolean booleanValue = new DvBoolean(); DvBoolean booleanValue2 = new DvBoolean(); - creator.addElementToListOrSetSingleValues(element, "value", Lists.newArrayList(booleanValue, booleanValue2)); - assertEquals(booleanValue, element.getValue()); + + assertThrows(IllegalArgumentException.class, () -> + creator.addElementToListOrSetSingleValues( + element, + "value", + Lists.newArrayList(booleanValue, booleanValue2) + ) + ); } diff --git a/tools/src/test/java/com/nedap/archie/diff/AnnotationDifferentiatorTest.java b/tools/src/test/java/com/nedap/archie/diff/AnnotationDifferentiatorTest.java index 5bbde1b98..d6318bffb 100644 --- a/tools/src/test/java/com/nedap/archie/diff/AnnotationDifferentiatorTest.java +++ b/tools/src/test/java/com/nedap/archie/diff/AnnotationDifferentiatorTest.java @@ -2,20 +2,20 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class AnnotationDifferentiatorTest { private Archetype flatParent; private Archetype child; - @Before + @BeforeEach public void setup() throws Exception { flatParent = TestUtil.parseFailOnErrors("/com/nedap/archie/diff/openEHR-EHR-OBSERVATION.basic_annotations.v1.0.0.adls"); child = TestUtil.parseFailOnErrors("/com/nedap/archie/diff/openEHR-EHR-OBSERVATION.annotations_specialised_flattened.v1.0.0.adls"); diff --git a/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java b/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java index 5e2866156..6da4cdd7c 100644 --- a/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java +++ b/tools/src/test/java/com/nedap/archie/diff/DiffTestUtil.java @@ -11,7 +11,7 @@ import org.openehr.bmm.v2.validation.BmmRepository; import org.openehr.referencemodels.BuiltinReferenceModels; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class DiffTestUtil { diff --git a/tools/src/test/java/com/nedap/archie/diff/NodeIdLCSTest.java b/tools/src/test/java/com/nedap/archie/diff/NodeIdLCSTest.java index c1022793c..6f156b6dc 100644 --- a/tools/src/test/java/com/nedap/archie/diff/NodeIdLCSTest.java +++ b/tools/src/test/java/com/nedap/archie/diff/NodeIdLCSTest.java @@ -1,11 +1,11 @@ package com.nedap.archie.diff; import com.google.common.collect.Lists; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class NodeIdLCSTest { diff --git a/tools/src/test/java/com/nedap/archie/diff/SiblingOrderDiffTest.java b/tools/src/test/java/com/nedap/archie/diff/SiblingOrderDiffTest.java index 6308fef17..0afc1e3b8 100644 --- a/tools/src/test/java/com/nedap/archie/diff/SiblingOrderDiffTest.java +++ b/tools/src/test/java/com/nedap/archie/diff/SiblingOrderDiffTest.java @@ -1,13 +1,13 @@ package com.nedap.archie.diff; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class SiblingOrderDiffTest { private DiffTestUtil diffTestUtil; - @Before + @BeforeEach public void setup() throws Exception { diffTestUtil = new DiffTestUtil("/com/nedap/archie/flattener/siblingorder/", "/com/nedap/archie/diff/siblingorderexpectations/"); } diff --git a/tools/src/test/java/com/nedap/archie/diff/specexamples/DifferentiatorExamplesFromSpecTest.java b/tools/src/test/java/com/nedap/archie/diff/specexamples/DifferentiatorExamplesFromSpecTest.java index 439723c1b..1cb75dfdd 100644 --- a/tools/src/test/java/com/nedap/archie/diff/specexamples/DifferentiatorExamplesFromSpecTest.java +++ b/tools/src/test/java/com/nedap/archie/diff/specexamples/DifferentiatorExamplesFromSpecTest.java @@ -1,14 +1,14 @@ package com.nedap.archie.diff.specexamples; import com.nedap.archie.diff.DiffTestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class DifferentiatorExamplesFromSpecTest { private DiffTestUtil diffTestUtil; - @Before + @BeforeEach public void setup() throws Exception { diffTestUtil = new DiffTestUtil("/com/nedap/archie/flattener/specexamples/", "/com/nedap/archie/diff/specexamples/"); } diff --git a/tools/src/test/java/com/nedap/archie/flattener/AnnotationsFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/AnnotationsFlattenerTest.java index 515b60a60..c40f66201 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/AnnotationsFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/AnnotationsFlattenerTest.java @@ -4,14 +4,14 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.ResourceAnnotations; import com.nedap.archie.rminfo.ReferenceModels; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.HashMap; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class AnnotationsFlattenerTest { @@ -26,7 +26,7 @@ public class AnnotationsFlattenerTest { private ReferenceModels models; - @Before + @BeforeEach public void setup() throws Exception { models = BuiltinReferenceModels.getAvailableModelInfoLookups(); diff --git a/tools/src/test/java/com/nedap/archie/flattener/ArchetypeHRIDMapTest.java b/tools/src/test/java/com/nedap/archie/flattener/ArchetypeHRIDMapTest.java index 251effe7c..eb0a1df53 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/ArchetypeHRIDMapTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/ArchetypeHRIDMapTest.java @@ -1,10 +1,10 @@ package com.nedap.archie.flattener; import com.nedap.archie.aom.ArchetypeHRID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; /** * @author vera.prinsen diff --git a/tools/src/test/java/com/nedap/archie/flattener/FlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/FlattenerTest.java index 197f9b760..b3c0bcd82 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/FlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/FlattenerTest.java @@ -8,14 +8,14 @@ import com.nedap.archie.json.JacksonUtil; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ReferenceModels; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.List; import java.util.Stack; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * High level tests of the flattener on a relatively large set of archetypes with many features. @@ -41,7 +41,7 @@ public class FlattenerTest { private Flattener flattener; - @Before + @BeforeEach public void setup() throws Exception { models = BuiltinReferenceModels.getAvailableModelInfoLookups(); @@ -155,7 +155,7 @@ public void useNodeReplacement() throws Exception { worklist.addAll(attr.getChildren()); } } - assertTrue("a prox object should have been found", proxyFound); + assertTrue(proxyFound, "a prox object should have been found"); } @Test @@ -269,7 +269,7 @@ public void validate() { models.registerModel(com.nedap.archie.openehrtestrm.TestRMInfoLookup.getInstance()); ((InMemoryFullArchetypeRepository) repository).compile(models); for(ValidationResult result:((InMemoryFullArchetypeRepository) repository).getAllValidationResults()) { - assertTrue(result.getArchetypeId() + " had errors or warnings: " + result.getErrors(), result.passes()); + assertTrue(result.passes(),result.getArchetypeId() + " had errors or warnings: " + result.getErrors()); } System.out.println(repository); } diff --git a/tools/src/test/java/com/nedap/archie/flattener/InMemoryFullArchetypeRepositoryTest.java b/tools/src/test/java/com/nedap/archie/flattener/InMemoryFullArchetypeRepositoryTest.java index 649ec98c8..3fc35c291 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/InMemoryFullArchetypeRepositoryTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/InMemoryFullArchetypeRepositoryTest.java @@ -5,21 +5,21 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.OperationalTemplate; import com.nedap.archie.archetypevalidator.ValidationResult; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class InMemoryFullArchetypeRepositoryTest { InMemoryFullArchetypeRepository inMemoryFullArchetypeRepository; - @Before + @BeforeEach public void setup() throws IOException, ADLParseException { //Create versioned archetypes List archetypes = new ArrayList<>(); diff --git a/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java b/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java index d8e7d21b9..57e9130f8 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java @@ -10,19 +10,17 @@ import com.nedap.archie.flattener.specexamples.FlattenerTestUtil; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ReferenceModels; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.io.InputStream; import java.util.List; -import java.util.Optional; import java.util.Stack; import java.util.stream.Collectors; -import static com.nedap.archie.flattener.specexamples.FlattenerTestUtil.parse; -import static junit.framework.TestCase.assertNull; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; public class OperationalTemplateCreatorTest { @@ -93,16 +91,18 @@ public void dontFillEmptyOccurrencesUnlessSet() throws Exception { } } - @Test(expected = IllegalArgumentException.class) + @Test public void failOnMissingArchetypeEnabled() throws Exception { SimpleArchetypeRepository repository = new SimpleArchetypeRepository(); - try(InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.with_used_archetype.v1.adls")) { - Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); - FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forOperationalTemplate(); - Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), flattenerConfiguration); - OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); - fail(); - } + assertThrows(IllegalArgumentException.class, () -> { + try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.with_used_archetype.v1.adls")) { + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forOperationalTemplate(); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), flattenerConfiguration); + OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); + fail(); + } + }); } @Test @@ -162,7 +162,7 @@ private Archetype parseAndCreateOPTWithConfig(String fileName, InMemoryFullArche ReferenceModels models = new ReferenceModels(); models.registerModel(ArchieRMInfoLookup.getInstance()); ValidationResult validationResult = new ArchetypeValidator(models).validate(result, repository); - assertTrue(validationResult.getErrors().toString(), validationResult.passes()); + assertThat(validationResult.getErrors().toString(), validationResult.passes()); return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), config).flatten(parse(fileName)); } diff --git a/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java index 24e794f17..abb921704 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/RMOverlayFlattenerTest.java @@ -5,10 +5,10 @@ import com.nedap.archie.aom.rmoverlay.VisibilityType; import com.nedap.archie.archetypevalidator.ArchetypeValidator; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class RMOverlayFlattenerTest { @@ -21,7 +21,7 @@ public void flattenParentChild() throws Exception{ repository.addArchetype(child); repository.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider())); - repository.getAllValidationResults().forEach(v -> assertTrue(v.getErrors().toString(), !v.hasWarningsOrErrors())); + repository.getAllValidationResults().forEach(v -> assertTrue(!v.hasWarningsOrErrors(), v.getErrors().toString())); Archetype flattenedChild = repository.getFlattenedArchetype("openEHR-EHR-OBSERVATION.to_flatten_child_with_overlay.v1.0.0"); assertEquals(VisibilityType.HIDE, parent.getRmOverlay().getRmVisibility().get("/subject").getVisibility()); assertNull(parent.getRmOverlay().getRmVisibility().get("/state")); @@ -41,7 +41,7 @@ public void flattenIncludedArchetype() throws Exception { repository.addArchetype(composition); repository.compile(new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider())); - repository.getAllValidationResults().forEach(v -> assertTrue(v.getErrors().toString(), !v.hasWarningsOrErrors())); + repository.getAllValidationResults().forEach(v -> assertTrue(!v.hasWarningsOrErrors(), v.getErrors().toString())); OperationalTemplate opt = (OperationalTemplate) new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()).flatten(composition); assertEquals(VisibilityType.HIDE, opt.getRmOverlay().getRmVisibility().get("/content[id2]/subject").getVisibility()); assertEquals("at12", opt.getRmOverlay().getRmVisibility().get("/content[id2]/subject").getAlias().getCodeString()); diff --git a/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java index bf085f358..6a318c3e6 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/RulesFlattenerTest.java @@ -7,11 +7,11 @@ import com.nedap.archie.rminfo.ReferenceModels; import com.nedap.archie.rules.*; import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 15/05/2017. @@ -27,7 +27,7 @@ public class RulesFlattenerTest { private ReferenceModels models; - @Before + @BeforeEach public void setup() throws Exception { models = BuiltinReferenceModels.getAvailableModelInfoLookups(); @@ -68,7 +68,7 @@ private void checkCorrectSyntax(Archetype flattened) throws ADLParseException { String serialized= ADLArchetypeSerializer.serialize(flattened); ADLParser parser = new ADLParser(); parser.parse(serialized); - assertFalse(parser.getErrors().toString(), parser.getErrors().hasErrors()); + assertFalse(parser.getErrors().hasErrors(), parser.getErrors().toString()); } @Test diff --git a/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java b/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java index e64653ec9..db1071e32 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/SiblingOrderFlattenerTest.java @@ -10,16 +10,16 @@ import com.nedap.archie.flattener.specexamples.FlattenerTestUtil; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ReferenceModels; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.util.List; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class SiblingOrderFlattenerTest { @@ -27,13 +27,13 @@ public class SiblingOrderFlattenerTest { private Archetype parentArchetype; - @Before + @BeforeEach public void setup() throws Exception { repository = new InMemoryFullArchetypeRepository(); parentArchetype = parse("openEHR-EHR-CLUSTER.order-parent.v1.0.0.adls"); ReferenceModels models = BuiltinReferenceModels.getAvailableModelInfoLookups(); ValidationResult validationResult = new ArchetypeValidator(models).validate(parentArchetype, repository); - assertTrue(validationResult.getErrors().toString(), validationResult.passes()); + assertTrue(validationResult.passes(), validationResult.getErrors().toString()); repository.addArchetype(parentArchetype); } @@ -218,7 +218,7 @@ private Archetype parseAndFlatten(String fileName) throws IOException, ADLParseE ReferenceModels models = new ReferenceModels(); models.registerModel(ArchieRMInfoLookup.getInstance()); ValidationResult validationResult = new ArchetypeValidator(models).validate(result, repository); - assertTrue(validationResult.getErrors().toString(), validationResult.passes()); + assertTrue(validationResult.passes(), validationResult.getErrors().toString()); return new Flattener(repository, BuiltinReferenceModels.getAvailableModelInfoLookups()).flatten(parse(fileName)); } @@ -228,7 +228,7 @@ private Archetype parseAndCreateOPT(String fileName) throws IOException, ADLPars ReferenceModels models = new ReferenceModels(); models.registerModel(ArchieRMInfoLookup.getInstance()); ValidationResult validationResult = new ArchetypeValidator(models).validate(result, repository); - assertTrue(validationResult.getErrors().toString(), validationResult.passes()); + assertTrue(validationResult.passes(), validationResult.getErrors().toString()); return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), FlattenerConfiguration.forOperationalTemplate()).flatten(parse(fileName)); } @@ -238,7 +238,7 @@ private Archetype parseAndFlattenRemoveZeroOccurrences(String fileName) throws I ReferenceModels models = new ReferenceModels(); models.registerModel(ArchieRMInfoLookup.getInstance()); ValidationResult validationResult = new ArchetypeValidator(models).validate(result, repository); - assertTrue(validationResult.getErrors().toString(), validationResult.passes()); + assertTrue(validationResult.passes(), validationResult.getErrors().toString()); FlattenerConfiguration config = FlattenerConfiguration.forFlattened(); config.setRemoveZeroOccurrencesObjects(true); return new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), config).flatten(parse(fileName)); diff --git a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java index 0edf0dbf0..e739ea19d 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecBMMTest.java @@ -2,12 +2,12 @@ import com.nedap.archie.flattener.SimpleArchetypeRepository; import com.nedap.archie.rminfo.SimpleMetaModelProvider; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.openehr.referencemodels.BuiltinReferenceModels; public class FlattenerExamplesFromSpecBMMTest extends FlattenerExamplesFromSpecTest { - @Before + @BeforeEach public void setup() throws Exception { repository = new SimpleArchetypeRepository(); metaModelProvider = new SimpleMetaModelProvider(null, BuiltinReferenceModels.getBmmRepository(), BuiltinReferenceModels.getAomProfiles()); diff --git a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java index b5991cde7..b0d032166 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerExamplesFromSpecTest.java @@ -11,16 +11,15 @@ import com.nedap.archie.flattener.SimpleArchetypeRepository; import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.SimpleMetaModelProvider; -import org.junit.Before; -import org.junit.Test; -import org.openehr.bmm.v2.validation.BmmRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.List; import java.util.stream.Collectors; import static com.nedap.archie.flattener.specexamples.FlattenerTestUtil.parse; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class FlattenerExamplesFromSpecTest { @@ -29,7 +28,7 @@ public class FlattenerExamplesFromSpecTest { protected MetaModelProvider metaModelProvider; - @Before + @BeforeEach public void setup() throws Exception { repository = new SimpleArchetypeRepository(); metaModelProvider = new SimpleMetaModelProvider(BuiltinReferenceModels.getAvailableModelInfoLookups(), null); @@ -47,17 +46,17 @@ public void specializationPaths() throws Exception { CObject firstAddedConstraint = flattened.itemAtPath("/data[id2]/events[id3]/data[id4]/items[id79.2]"); CObject secondAddedConstraint = flattened.itemAtPath("/data[id2]/events[id3]/data[id4]/items[id79.7]"); - assertNotNull("first constraint should have been added", firstAddedConstraint); + assertNotNull( firstAddedConstraint, "first constraint should have been added"); assertEquals(new MultiplicityInterval(0, 1), firstAddedConstraint.getOccurrences()); - assertNotNull("added constraint should have a value attribute", firstAddedConstraint.getAttribute("value")); + assertNotNull(firstAddedConstraint.getAttribute("value"), "added constraint should have a value attribute"); - assertNotNull("second constraint should have been added", secondAddedConstraint); + assertNotNull(secondAddedConstraint, "second constraint should have been added"); assertEquals(new MultiplicityInterval(0, 1), secondAddedConstraint.getOccurrences()); - assertNull("second added constraint should not have a value attribute", secondAddedConstraint.getAttribute("value")); + assertNull(secondAddedConstraint.getAttribute("value"), "second added constraint should not have a value attribute"); //original constraint should not have been closed and still be present - assertNotNull("original constraint should not have been removed", originalConstraint); - assertNull("original constraint should not have been closed", originalConstraint.getOccurrences()); + assertNotNull(originalConstraint, "original constraint should not have been removed"); + assertNull(originalConstraint.getOccurrences(), "original constraint should not have been closed"); } @Test @@ -71,8 +70,7 @@ public void redefinitionForRefinement() throws Exception { CObject nodeWithId4 = (CObject) flattenedDiagnosis.itemAtPath("/data[id2]/items[id3]/value[id4]"); assertEquals("DV_CODED_TEXT", nodeWithId4.getRmTypeName()); - assertTrue("dv coded text should now have a terminology code constraint", - nodeWithId4.getAttribute("defining_code").getChildren().get(0) instanceof CTerminologyCode); + assertInstanceOf(CTerminologyCode.class, nodeWithId4.getAttribute("defining_code").getChildren().get(0), "dv coded text should now have a terminology code constraint"); CObject firstAddedNode = flattenedDiagnosis.itemAtPath("/data/items[id0.32]"); @@ -110,14 +108,14 @@ public void specialisationWithCloning() throws Exception { for(String nodeId: Lists.newArrayList("1", "2", "5")) { - assertNotNull("node id3." + nodeId + " should have subnode id4", - flattenedLipidStudies.itemAtPath(String.format("/items[id3.%s]/items[id4]", nodeId))); + assertNotNull(flattenedLipidStudies.itemAtPath(String.format("/items[id3.%s]/items[id4]", nodeId)), + "node id3." + nodeId + " should have subnode id4"); - assertNotNull("node id3." + nodeId + " should have subnode id2." + nodeId, - flattenedLipidStudies.itemAtPath(String.format("/items[id3.%s]/items[id2.%s]", nodeId, nodeId))); + assertNotNull(flattenedLipidStudies.itemAtPath(String.format("/items[id3.%s]/items[id2.%s]", nodeId, nodeId)), + "node id3." + nodeId + " should have subnode id2." + nodeId); - assertNull("node id3." + nodeId + " should have subnode id2." + nodeId, - flattenedLipidStudies.itemAtPath(String.format("/items[id3.%s]/items[id2]", nodeId))); + assertNull( flattenedLipidStudies.itemAtPath(String.format("/items[id3.%s]/items[id2]", nodeId)), + "node id3." + nodeId + " should have subnode id2." + nodeId); } @@ -225,8 +223,8 @@ public void RMTypeRefinement() throws Exception { //all three are descendants in the RM Of the value constraint, so they should match and take over any attributes of the parent for(CObject child:value.getChildren()) { CAttribute accuracyAttribute = child.getAttribute("accuracy"); - assertNotNull(child.getNodeId() + " should have accuraccy != null", accuracyAttribute); - assertFalse(child.getNodeId() + " should have accuraccy !empty", accuracyAttribute.getChildren().isEmpty()); + assertNotNull(accuracyAttribute, child.getNodeId() + " should have accuraccy != null"); + assertFalse(accuracyAttribute.getChildren().isEmpty(), child.getNodeId() + " should have accuraccy !empty"); CReal accuracy = (CReal) accuracyAttribute.getChildren().get(0); CReal parentAccuracy = rmTypeRefinement.itemAtPath("/value/accuracy[1]"); assertEquals(parentAccuracy.getConstraint(), accuracy.getConstraint()); @@ -247,7 +245,7 @@ public void internalReferenceRedefinition() throws Exception { assertNotNull(flat.itemAtPath("/data[id3]/items[id0.1]")); assertNull(flat.itemAtPath("/data[id2]/items[id0.1]")); CObject id3 = flat.itemAtPath("/data[id3]"); - assertEquals("the complex object proxy should have been replaced with a regular complex object", CComplexObject.class, id3.getClass()); + assertEquals(CComplexObject.class, id3.getClass(), "the complex object proxy should have been replaced with a regular complex object"); } @Test @@ -292,8 +290,8 @@ public void tupleRedefinition() throws Exception { CAttributeTuple tuple = dvQuantity.getAttributeTuples().get(0); assertEquals(1, tuple.getTuples().size());//only the mm[Hg] should be left assertEquals(Lists.newArrayList("magnitude", "units"), tuple.getMemberNames()); - assertEquals("socParent should have been updated for units", tuple, dvQuantity.getAttribute("units").getSocParent()); - assertEquals("socParent should have been updated for magnitude", tuple, dvQuantity.getAttribute("magnitude").getSocParent()); + assertEquals(tuple, dvQuantity.getAttribute("units").getSocParent(), "socParent should have been updated for units"); + assertEquals(tuple, dvQuantity.getAttribute("magnitude").getSocParent(), "socParent should have been updated for magnitude"); assertEquals(1, dvQuantity.getAttribute("magnitude").getChildren().size()); CReal magnitudeAttr = (CReal) dvQuantity.getAttribute("magnitude").getChildren().get(0); @@ -320,8 +318,8 @@ public void addTuple() throws Exception { CAttributeTuple tuple = dvQuantity.getAttributeTuples().get(0); assertEquals(1, tuple.getTuples().size());//only the mm[Hg] should be left assertEquals(Lists.newArrayList("magnitude", "units"), tuple.getMemberNames()); - assertEquals("socParent should have been added for units", tuple, dvQuantity.getAttribute("units").getSocParent()); - assertEquals("socParent should have been added for magnitude", tuple, dvQuantity.getAttribute("magnitude").getSocParent()); + assertEquals(tuple, dvQuantity.getAttribute("units").getSocParent(), "socParent should have been added for units"); + assertEquals(tuple, dvQuantity.getAttribute("magnitude").getSocParent(), "socParent should have been added for magnitude"); assertEquals(1, dvQuantity.getAttribute("magnitude").getChildren().size()); CReal magnitudeAttr = (CReal) dvQuantity.getAttribute("magnitude").getChildren().get(0); diff --git a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerTestUtil.java b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerTestUtil.java index 339ed6e61..451104157 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerTestUtil.java +++ b/tools/src/test/java/com/nedap/archie/flattener/specexamples/FlattenerTestUtil.java @@ -7,9 +7,8 @@ import java.io.IOException; import java.io.InputStream; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.fail; public class FlattenerTestUtil { public static Archetype parse(String filename) throws IOException, ADLParseException { @@ -19,7 +18,7 @@ public static Archetype parse(String filename) throws IOException, ADLParseExcep fail("cannot find file: " + filename); } Archetype result = parser.parse(stream); - assertTrue("there should be no errors parsing " + filename + ", but was: " + parser.getErrors(), parser.getErrors().hasNoMessages()); + assertThat("there should be no errors parsing " + filename + ", but was: " + parser.getErrors(), parser.getErrors().hasNoMessages()); return result; } } diff --git a/tools/src/test/java/com/nedap/archie/flattener/specexamples/TerminologyFlattenerExamplesFromSpec.java b/tools/src/test/java/com/nedap/archie/flattener/specexamples/TerminologyFlattenerExamplesFromSpec.java index 2aed47346..37290e72a 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/specexamples/TerminologyFlattenerExamplesFromSpec.java +++ b/tools/src/test/java/com/nedap/archie/flattener/specexamples/TerminologyFlattenerExamplesFromSpec.java @@ -5,21 +5,21 @@ import com.nedap.archie.aom.terminology.ValueSet; import com.nedap.archie.flattener.Flattener; import com.nedap.archie.flattener.SimpleArchetypeRepository; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.Map; import static com.nedap.archie.flattener.specexamples.FlattenerTestUtil.parse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class TerminologyFlattenerExamplesFromSpec { private static SimpleArchetypeRepository repository; - @Before + @BeforeEach public void setup() throws Exception { repository = new SimpleArchetypeRepository(); } diff --git a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java index 4f1b7f1d0..877e170ef 100644 --- a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java +++ b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java @@ -21,8 +21,8 @@ import com.nedap.archie.rules.OperatorKind; import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; import com.nedap.archie.testutil.TestUtil; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.threeten.extra.PeriodDuration; @@ -35,7 +35,8 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; /** * A test that tests JSON parsing of Archetypes using Jackson @@ -319,7 +320,7 @@ public void parseS2AomJson() throws Exception { } } - @Ignore // for local testing + @Disabled // for local testing @Test public void parseS2AomJsonAll() throws Exception { diff --git a/tools/src/test/java/com/nedap/archie/json/JSONSchemaCreatorTest.java b/tools/src/test/java/com/nedap/archie/json/JSONSchemaCreatorTest.java index ed5537e54..9a5e3a0af 100644 --- a/tools/src/test/java/com/nedap/archie/json/JSONSchemaCreatorTest.java +++ b/tools/src/test/java/com/nedap/archie/json/JSONSchemaCreatorTest.java @@ -5,7 +5,7 @@ import jakarta.json.JsonObject; import jakarta.json.JsonWriterFactory; import jakarta.json.stream.JsonGenerator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.bmm.core.BmmModel; import org.openehr.referencemodels.BuiltinReferenceModels; diff --git a/tools/src/test/java/com/nedap/archie/json/JacksonRMRoundTripTest.java b/tools/src/test/java/com/nedap/archie/json/JacksonRMRoundTripTest.java index 101a7dadd..0f3cf55d2 100644 --- a/tools/src/test/java/com/nedap/archie/json/JacksonRMRoundTripTest.java +++ b/tools/src/test/java/com/nedap/archie/json/JacksonRMRoundTripTest.java @@ -19,8 +19,8 @@ import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.testutil.TestUtil; import com.nedap.archie.xml.JAXBUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.InputStream; import java.net.URI; @@ -29,8 +29,8 @@ import java.time.LocalTime; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Tests JSON serialization and deserialization of RM Objects using Jackson @@ -44,7 +44,7 @@ public class JacksonRMRoundTripTest { private TestUtil testUtil; - @Before + @BeforeEach public void setup() { testUtil = new TestUtil(); parser = new ADLParser(new RMConstraintImposer()); diff --git a/tools/src/test/java/com/nedap/archie/json/RMJacksonTest.java b/tools/src/test/java/com/nedap/archie/json/RMJacksonTest.java index 528960ea2..6358289ba 100644 --- a/tools/src/test/java/com/nedap/archie/json/RMJacksonTest.java +++ b/tools/src/test/java/com/nedap/archie/json/RMJacksonTest.java @@ -6,7 +6,7 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; import java.io.InputStream; @@ -15,8 +15,9 @@ import java.util.LinkedHashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class RMJacksonTest { @@ -151,7 +152,7 @@ public void serializeDvDateTime() throws Exception { DvDateTime year = new DvDateTime(Year.of(2015)); String yearString = objectMapper.writeValueAsString(year); - assertTrue(yearString, yearString.contains("\"2015\"")); + assertThat(yearString, yearString.contains("\"2015\"")); DvDateTime parsedYear = objectMapper.readValue(yearString, DvDateTime.class); assertEquals(year.getValue(), parsedYear.getValue()); } diff --git a/tools/src/test/java/com/nedap/archie/json/flat/ArchetypeParsePostProcessorTest.java b/tools/src/test/java/com/nedap/archie/json/flat/ArchetypeParsePostProcessorTest.java index 9636abb0a..1ca16d45e 100644 --- a/tools/src/test/java/com/nedap/archie/json/flat/ArchetypeParsePostProcessorTest.java +++ b/tools/src/test/java/com/nedap/archie/json/flat/ArchetypeParsePostProcessorTest.java @@ -4,11 +4,11 @@ import com.nedap.archie.aom.utils.ArchetypeParsePostProcessor; import com.nedap.archie.json.ArchieJacksonConfiguration; import com.nedap.archie.json.JacksonUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.InputStream; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class ArchetypeParsePostProcessorTest { @Test diff --git a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java index 2f7d24dce..38f216cd3 100644 --- a/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java +++ b/tools/src/test/java/com/nedap/archie/json/flat/FlatJsonGeneratorTest.java @@ -22,8 +22,8 @@ import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.MetaModel; import com.nedap.archie.rminfo.MetaModelProvider; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.threeten.extra.PeriodDuration; @@ -34,17 +34,14 @@ import java.util.LinkedHashMap; import java.util.Map; -import static junit.framework.Assert.assertTrue; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.*; public class FlatJsonGeneratorTest { private static final String BLOOD_PRESSURE_PATH = "/ckm-mirror/local/archetypes/entry/observation/openEHR-EHR-OBSERVATION.blood_pressure.v1.1.0.adls"; private static final double EPSILON = 0.00000001d; - @After + @AfterEach public void tearDown() { ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage(null); } diff --git a/tools/src/test/java/com/nedap/archie/kryo/URISerializerTest.java b/tools/src/test/java/com/nedap/archie/kryo/URISerializerTest.java index a2154cd1e..fa8a337e8 100644 --- a/tools/src/test/java/com/nedap/archie/kryo/URISerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/kryo/URISerializerTest.java @@ -2,10 +2,10 @@ import com.nedap.archie.rm.datavalues.DvURI; import com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class URISerializerTest { @Test diff --git a/tools/src/test/java/com/nedap/archie/paths/PathSegmentTest.java b/tools/src/test/java/com/nedap/archie/paths/PathSegmentTest.java index aa276d5f0..774013315 100644 --- a/tools/src/test/java/com/nedap/archie/paths/PathSegmentTest.java +++ b/tools/src/test/java/com/nedap/archie/paths/PathSegmentTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Created by stefan.teijgeler on 26/08/16. diff --git a/tools/src/test/java/com/nedap/archie/query/APathToXPathConverterTest.java b/tools/src/test/java/com/nedap/archie/query/APathToXPathConverterTest.java index 794c3bfc0..7a78f06c3 100644 --- a/tools/src/test/java/com/nedap/archie/query/APathToXPathConverterTest.java +++ b/tools/src/test/java/com/nedap/archie/query/APathToXPathConverterTest.java @@ -1,8 +1,8 @@ package com.nedap.archie.query; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class APathToXPathConverterTest { diff --git a/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java b/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java index 8ade2073c..08dc7a751 100644 --- a/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java +++ b/tools/src/test/java/com/nedap/archie/query/RMObjectAttributesTest.java @@ -15,13 +15,13 @@ import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.List; import static com.nedap.archie.query.RMObjectAttributes.getAttributeValueFromRMObject; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; @Deprecated public class RMObjectAttributesTest { @@ -30,7 +30,7 @@ public class RMObjectAttributesTest { private Archetype archetype; private Pathable root; - @Before + @BeforeEach public void setup() throws Exception { ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("en"); archetype = new ADLParser(new RMConstraintImposer()).parse(getClass().getResourceAsStream("/basic.adl")); diff --git a/tools/src/test/java/com/nedap/archie/query/RMQueryContextTest.java b/tools/src/test/java/com/nedap/archie/query/RMQueryContextTest.java index 49d06eb22..998f67363 100644 --- a/tools/src/test/java/com/nedap/archie/query/RMQueryContextTest.java +++ b/tools/src/test/java/com/nedap/archie/query/RMQueryContextTest.java @@ -14,13 +14,13 @@ import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.testutil.TestUtil; import com.nedap.archie.xml.JAXBUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** * Created by pieter.bos on 03/05/16. @@ -31,7 +31,7 @@ public class RMQueryContextTest { private Archetype archetype; private Pathable root; - @Before + @BeforeEach public void setup() throws Exception { ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("en"); archetype = new ADLParser(new RMConstraintImposer()).parse(getClass().getResourceAsStream("/basic.adl")); diff --git a/tools/src/test/java/com/nedap/archie/rm/LocatableTest.java b/tools/src/test/java/com/nedap/archie/rm/LocatableTest.java index e90518150..0ba4635d3 100644 --- a/tools/src/test/java/com/nedap/archie/rm/LocatableTest.java +++ b/tools/src/test/java/com/nedap/archie/rm/LocatableTest.java @@ -5,9 +5,9 @@ import com.nedap.archie.rm.composition.Observation; import com.nedap.archie.rm.datastructures.*; import com.nedap.archie.rm.datavalues.DvText; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Created by pieter.bos on 10/11/15. diff --git a/tools/src/test/java/com/nedap/archie/rminfo/ArchieRMInfoLookupTest.java b/tools/src/test/java/com/nedap/archie/rminfo/ArchieRMInfoLookupTest.java index 094419e53..90ce6ff4e 100644 --- a/tools/src/test/java/com/nedap/archie/rminfo/ArchieRMInfoLookupTest.java +++ b/tools/src/test/java/com/nedap/archie/rminfo/ArchieRMInfoLookupTest.java @@ -16,13 +16,13 @@ import com.nedap.archie.rm.support.identification.UID; import com.nedap.archie.rm.support.identification.UIDBasedId; import com.nedap.archie.rm.support.identification.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.lang.reflect.Field; import java.net.URI; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by stefan.teijgeler on 31/08/16. @@ -134,8 +134,9 @@ public void genericType() { assertNotNull(valueAttribute); assertEquals("magnitude", valueAttribute.getRmName()); assertFalse(valueAttribute.isNullable()); - assertEquals("DvQuantity extends DvAmount should have a double magnitude field", Double.class, valueAttribute.getType()); - + assertEquals(Double.class, valueAttribute.getType(), + "DvQuantity extends DvAmount should have a double magnitude field" + ); } @Test diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/AttributeTupleConstraintsTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/AttributeTupleConstraintsTest.java index 6832897b0..6dee4da63 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/AttributeTupleConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/AttributeTupleConstraintsTest.java @@ -6,12 +6,12 @@ import com.nedap.archie.rm.datavalues.quantity.DvQuantity; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.HashMap; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 21/03/16. @@ -22,7 +22,7 @@ public class AttributeTupleConstraintsTest { private final ValidationHelper helper = new ValidationHelper(ArchieRMInfoLookup.getInstance(), new ValidationConfiguration.Builder().build()); - @BeforeClass + @BeforeAll public static void setup() throws Exception { Archetype archetype = TestUtil.parseFailOnErrors("/basic.adl"); CComplexObject valueObject = archetype.getDefinition().itemAtPath("/context[id11]/other_context[id2]/items[id3]/items[id7]/value[id16]"); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ConstraintToStringUtilTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ConstraintToStringUtilTest.java index 7fe2680bf..425a53cf2 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ConstraintToStringUtilTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ConstraintToStringUtilTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.rmobjectvalidator; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ConstraintToStringUtilTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/PrimitiveObjectConstraintHelperTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/PrimitiveObjectConstraintHelperTest.java index adbc6252e..deb9223f1 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/PrimitiveObjectConstraintHelperTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/PrimitiveObjectConstraintHelperTest.java @@ -2,14 +2,14 @@ import com.nedap.archie.aom.primitives.*; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.LocalTime; import java.time.Month; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class PrimitiveObjectConstraintHelperTest { private final PrimitiveObjectConstraintHelper helper = new PrimitiveObjectConstraintHelper(new ValidationConfiguration.Builder().build()); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java index 7f965e921..19a328158 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmObjectValidatorTest.java @@ -16,15 +16,16 @@ import com.nedap.archie.rm.datavalues.quantity.DvProportion; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.util.EnumSet; import java.util.List; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; public class RmObjectValidatorTest { @@ -34,7 +35,7 @@ public class RmObjectValidatorTest { private RMObjectValidator validatorWithoutInvariants; - @Before + @BeforeEach public void setup() { testUtil = new TestUtil(); @@ -57,14 +58,14 @@ public void requiredAttributesShouldBePresent() throws Exception { dvProportion.setType(3L); List validationMessages = validatorWithoutInvariants.validate(opt, element); - assertEquals("There should be 1 errors", 1, validationMessages.size()); - assertEquals("There should be a validation message about the numerator", "Attribute numerator of class DV_PROPORTION does not match existence 1..1", validationMessages.get(0).getMessage()); - assertEquals("The path should be correct", "/value/numerator", validationMessages.get(0).getPath()); - assertEquals("The archetype path should be correct", "/value[id2]/numerator", validationMessages.get(0).getArchetypePath()); + assertEquals(1, validationMessages.size(), "There should be 1 errors"); + assertEquals("Attribute numerator of class DV_PROPORTION does not match existence 1..1", validationMessages.get(0).getMessage(), "There should be a validation message about the numerator"); + assertEquals("/value/numerator", validationMessages.get(0).getPath(), "The path should be correct"); + assertEquals("/value[id2]/numerator", validationMessages.get(0).getArchetypePath(), "The archetype path should be correct"); dvProportion.setNumerator(2D); validationMessages = validator.validate(opt, element); - assertEquals("There should be 0 errors", 0, validationMessages.size()); + assertEquals(0, validationMessages.size(), "There should be 0 errors"); } @@ -79,7 +80,7 @@ public void cardinalityMismatchValidation() throws Exception { items.remove(0); List validationMessages = validatorWithoutInvariants.validate(opt, itemTree); - assertEquals("There should be 1 error", 1, validationMessages.size()); + assertEquals(1, validationMessages.size(), "There should be 1 error"); assertEquals("Attribute does not match cardinality 1..2", validationMessages.get(0).getMessage()); // Type should be REQUIRED assertEquals(RMObjectValidationMessageType.CARDINALITY_MISMATCH, validationMessages.get(0).getType()); @@ -98,7 +99,7 @@ public void testEmptyElementWithoutArchetype() { List messages = validator.validate(element); assertEquals(2, messages.size()); for(RMObjectValidationMessage message:messages) { - assertTrue(message.getPath() + " unexpected value", Sets.newHashSet("/name", "/archetype_node_id", "/").contains(message.getPath())); + assertThat(message.getPath() + " unexpected value", Sets.newHashSet("/name", "/archetype_node_id", "/").contains(message.getPath())); assertTrue(EnumSet.of(RMObjectValidationMessageType.REQUIRED, RMObjectValidationMessageType.INVARIANT_ERROR).contains(message.getType())); } } @@ -113,9 +114,9 @@ public void testClusterWithoutArchetype() { cluster.setItems(Lists.newArrayList(element)); List messages = validator.validate(cluster); - assertEquals(messages.toString() ,2, messages.size()); + assertEquals(2, messages.size(), messages.toString()); for(RMObjectValidationMessage message:messages) { - assertTrue(message.getPath(), Sets.newHashSet("/items[1]/name", "/items[1]/archetype_node_id").contains(message.getPath())); + assertThat(message.getPath(), Sets.newHashSet("/items[1]/name", "/items[1]/archetype_node_id").contains(message.getPath())); assertEquals(RMObjectValidationMessageType.REQUIRED, message.getType()); } } @@ -132,7 +133,7 @@ public void testValidClusterWithoutArchetype() { cluster.setItems(Lists.newArrayList(element)); List messages = validator.validate(cluster); - assertEquals(messages.toString(), 0, messages.size()); + assertEquals(0, messages.size(), messages.toString()); } @@ -145,10 +146,10 @@ public void skipInvariantValidation(){ List messages = validator.validate(element); - assertEquals(messages.toString(), 1, messages.size()); + assertEquals(1, messages.size(), messages.toString()); messages = validatorWithoutInvariants.validate(element); - assertEquals(messages.toString(), 0, messages.size()); + assertEquals(0, messages.size(), messages.toString()); } @@ -162,11 +163,11 @@ public void skipInvariantValidationOld(){ RMObjectValidator oldValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), emptyRepo); List messages = oldValidator.validate(element); - assertEquals(messages.toString(), 1, messages.size()); + assertEquals(1, messages.size(), messages.toString()); oldValidator.setRunInvariantChecks(false); messages = oldValidator.validate(element); - assertEquals(messages.toString(), 0, messages.size()); + assertEquals(0, messages.size(), messages.toString()); } diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidatorTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidatorTest.java index fd59d6598..e3fbcbd86 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmPrimitiveObjectValidatorTest.java @@ -6,12 +6,12 @@ import com.nedap.archie.query.RMObjectWithPath; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ModelInfoLookup; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class RmPrimitiveObjectValidatorTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmTupleValidatorTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmTupleValidatorTest.java index c606f071f..05f246eba 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmTupleValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/RmTupleValidatorTest.java @@ -10,12 +10,12 @@ import com.nedap.archie.query.RMObjectWithPath; import com.nedap.archie.rm.datavalues.quantity.DvQuantity; import com.nedap.archie.rminfo.ArchieRMInfoLookup; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class RmTupleValidatorTest { private static final ArchieRMInfoLookup lookup = ArchieRMInfoLookup.getInstance(); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java index 03d2eaa4a..cc2f08ecb 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/TerminologyCodeConstraintsTest.java @@ -18,16 +18,16 @@ import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rules.evaluation.DummyRulesPrimitiveObjectParent; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.net.URI; import java.util.*; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 23/02/16. @@ -39,7 +39,7 @@ public class TerminologyCodeConstraintsTest { private final PrimitiveObjectConstraintHelper primitiveObjectConstraintHelper = new PrimitiveObjectConstraintHelper(validationConfiguration); private final ValidationHelper validationHelper = new ValidationHelper(ArchieRMInfoLookup.getInstance(), validationConfiguration); - @Before + @BeforeEach public void setupArchetype() { archetype = new AuthoredArchetype(); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java index 7fe9e1799..463f1d81e 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/ValidateArchetypedTest.java @@ -16,14 +16,14 @@ import com.nedap.archie.rm.support.identification.ArchetypeID; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ValidateArchetypedTest { @@ -35,7 +35,7 @@ public class ValidateArchetypedTest { private OperationalTemplate elementOpt; private Archetype itemTreeArchetype; - @Before + @BeforeEach public void setup() throws Exception { testUtil = new TestUtil(); @@ -80,9 +80,9 @@ public void testArchetypedOtherDetails() { element.setFeederAudit(feederAudit); List validationMessages = validator.validate(elementOpt, element); - assertEquals("There should be 1 error", 1, validationMessages.size()); + assertEquals(1, validationMessages.size(), "There should be 1 error"); assertEquals("Attribute does not match cardinality 1..2", validationMessages.get(0).getMessage()); - assertEquals("The path should be correct", "/feeder_audit/originating_system_audit/other_details[id1]/items", validationMessages.get(0).getPath()); + assertEquals("/feeder_audit/originating_system_audit/other_details[id1]/items", validationMessages.get(0).getPath(), "The path should be correct"); assertEquals(RMObjectValidationMessageType.CARDINALITY_MISMATCH, validationMessages.get(0).getType()); } diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/EventContextInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/EventContextInvariantTest.java index c8b3be4d9..f1af313ee 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/EventContextInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/EventContextInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.composition.EventContext; import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FeederAuditDetailsInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FeederAuditDetailsInvariantTest.java index cf7e8d0fb..dfdc4d7c1 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FeederAuditDetailsInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FeederAuditDetailsInvariantTest.java @@ -1,7 +1,7 @@ package com.nedap.archie.rmobjectvalidator.invariants; import com.nedap.archie.rm.archetyped.FeederAuditDetails; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FeederAuditDetailsInvariantTest { @Test diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FolderInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FolderInvariantTest.java index d4bf9e3ca..ffa6cffcd 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FolderInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/FolderInvariantTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.directory.Folder; -import org.junit.Test; +import org.junit.jupiter.api.Test; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/IntervalInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/IntervalInvariantTest.java index b342e6e50..a8482a7a0 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/IntervalInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/IntervalInvariantTest.java @@ -1,7 +1,7 @@ package com.nedap.archie.rmobjectvalidator.invariants; import com.nedap.archie.base.Interval; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class IntervalInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/InvariantTestUtil.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/InvariantTestUtil.java index 20aec5655..7cb746d93 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/InvariantTestUtil.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/InvariantTestUtil.java @@ -18,8 +18,9 @@ import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class InvariantTestUtil { private static final OperationalTemplateProvider optProvider = new DummyOperationalTemplateProvider("example"); @@ -27,7 +28,7 @@ public class InvariantTestUtil { public static void assertValid(Object object) { RMObjectValidator validator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), optProvider, new ValidationConfiguration.Builder().build()); List messages = validator.validate(object); - assertTrue("object should be valid, was not: " + messages, messages.isEmpty()); + assertThat("object should be valid, was not: " + messages, messages.isEmpty()); } public static void assertInvariantInvalid(Object object, String invariantName, String path) { @@ -37,7 +38,7 @@ public static void assertInvariantInvalid(Object object, String invariantName, S public static void assertInvariantInvalid(Object object, String invariantName, String rmTypeName, String path) { RMObjectValidator validator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), optProvider, new ValidationConfiguration.Builder().build()); List messages = validator.validate(object); - assertEquals(messages.toString(), 1, messages.size()); + assertEquals(1, messages.size(), messages.toString()); assertEquals("Invariant " + invariantName + " failed on type " + rmTypeName, messages.get(0).getMessage()); assertEquals(path, messages.get(0).getPath()); } diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ParticipationInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ParticipationInvariantTest.java index 297bc0007..e2deac3b3 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ParticipationInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ParticipationInvariantTest.java @@ -4,7 +4,7 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.generic.Participation; import com.nedap.archie.rm.generic.PartySelf; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ParticipationInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/PartyRelatedInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/PartyRelatedInvariantTest.java index 917ac2da9..2872a39b3 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/PartyRelatedInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/PartyRelatedInvariantTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rm.generic.PartyRelated; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PartyRelatedInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/TermMappingInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/TermMappingInvariantTest.java index b7c0adc39..70806ea4b 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/TermMappingInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/TermMappingInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.datatypes.CodePhrase; import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rm.datavalues.TermMapping; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class TermMappingInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/PartyRefInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/PartyRefInvariantTest.java index b895f7844..54121514c 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/PartyRefInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/PartyRefInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.PartyRef; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PartyRefInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/UIDInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/UIDInvariantTest.java index a70f545ef..27fbd202a 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/UIDInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/UIDInvariantTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.rm.support.identification.UUID; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UIDInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/VersionTreeIdInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/VersionTreeIdInvariantTest.java index 3eb48a973..5629e2cfc 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/VersionTreeIdInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/base/VersionTreeIdInvariantTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.rm.support.identification.VersionTreeId; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class VersionTreeIdInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/AuditDetailsInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/AuditDetailsInvariantTest.java index 6f68e26f8..3c1184d11 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/AuditDetailsInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/AuditDetailsInvariantTest.java @@ -6,7 +6,7 @@ import com.nedap.archie.rm.generic.AuditDetails; import com.nedap.archie.rm.generic.PartySelf; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/OriginalVersionInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/OriginalVersionInvariantTest.java index f2ef290bc..5423057e8 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/OriginalVersionInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/changecontrol/OriginalVersionInvariantTest.java @@ -7,7 +7,7 @@ import com.nedap.archie.rm.generic.PartySelf; import com.nedap.archie.rm.support.identification.ObjectVersionId; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ElementInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ElementInvariantTest.java index 99c291c7c..43771f018 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ElementInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ElementInvariantTest.java @@ -4,7 +4,7 @@ import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ElementInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ItemTableInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ItemTableInvariantTest.java index f3f9b6e5a..99efc3952 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ItemTableInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datastructures/ItemTableInvariantTest.java @@ -6,7 +6,7 @@ import com.nedap.archie.rm.datastructures.ItemTable; import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Arrays; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/CodePhraseInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/CodePhraseInvariantTest.java index b44875506..c1e20935d 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/CodePhraseInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/CodePhraseInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.datatypes.CodePhrase; import com.nedap.archie.rm.support.identification.TerminologyId; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CodePhraseInvariantTest { @Test diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvDurationInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvDurationInvariantTest.java index 10fe4bfed..91a67fea9 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvDurationInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvDurationInvariantTest.java @@ -5,7 +5,7 @@ import com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration; import com.nedap.archie.rm.support.identification.TerminologyId; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.Period; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvEhrUriInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvEhrUriInvariantTest.java index c23764f81..8f20cc09a 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvEhrUriInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvEhrUriInvariantTest.java @@ -6,14 +6,14 @@ import com.nedap.archie.rmobjectvalidator.RMObjectValidator; import com.nedap.archie.rmobjectvalidator.ValidationConfiguration; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class DvEhrUriInvariantTest { @@ -32,7 +32,7 @@ public void invalid() { public void invalid2() { RMObjectValidator validator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), (templateId) -> null, new ValidationConfiguration.Builder().build()); List messages = validator.validate(new DvEHRURI("")); - assertEquals(messages.toString(), 2, messages.size()); + assertEquals(2, messages.size(), messages.toString()); Set expectedMessages = new HashSet<>(); expectedMessages.add("Invariant Scheme_valid failed on type DV_EHR_URI"); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIdentifierInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIdentifierInvariantTest.java index d31942d21..0558b99f0 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIdentifierInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIdentifierInvariantTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.rm.datavalues.DvIdentifier; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvIdentifierInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIntervalInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIntervalInvariantTest.java index 20c357052..fa094895e 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIntervalInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvIntervalInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.datavalues.quantity.DvCount; import com.nedap.archie.rm.datavalues.quantity.DvInterval; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvIntervalInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvMultimediaInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvMultimediaInvariantTest.java index 8c3d66634..9f533f30d 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvMultimediaInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvMultimediaInvariantTest.java @@ -4,7 +4,7 @@ import com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia; import com.nedap.archie.rm.support.identification.TerminologyId; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvMultimediaInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvParsableInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvParsableInvariantTest.java index 0dfd57289..a6a844423 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvParsableInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvParsableInvariantTest.java @@ -8,7 +8,7 @@ import com.nedap.archie.rmobjectvalidator.RMObjectValidator; import com.nedap.archie.rmobjectvalidator.ValidationConfiguration; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvPeriodicTimeSpecificationInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvPeriodicTimeSpecificationInvariantTest.java index 483052435..c8a1b631e 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvPeriodicTimeSpecificationInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvPeriodicTimeSpecificationInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.datavalues.encapsulated.DvParsable; import com.nedap.archie.rm.datavalues.timespecification.DvPeriodicTimeSpecification; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvPeriodicTimeSpecificationInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvProportionInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvProportionInvariantTest.java index 22c534757..021c7e738 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvProportionInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvProportionInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.datavalues.quantity.DvProportion; import com.nedap.archie.rm.datavalues.quantity.ProportionKind; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvProportionInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvQuantityInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvQuantityInvariantTest.java index 19f5fb1c0..44e8f0e1f 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvQuantityInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvQuantityInvariantTest.java @@ -6,7 +6,7 @@ import com.nedap.archie.rm.datavalues.quantity.DvQuantity; import com.nedap.archie.rm.datavalues.quantity.ReferenceRange; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvTextInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvTextInvariantTest.java index 8ffd58bf2..c530b53e0 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvTextInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvTextInvariantTest.java @@ -4,7 +4,7 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.support.identification.TerminologyId; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvTextInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvUriInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvUriInvariantTest.java index a2d148c85..a50cd73ad 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvUriInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/datavalues/DvUriInvariantTest.java @@ -2,7 +2,7 @@ import com.nedap.archie.rm.datavalues.DvURI; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DvUriInvariantTest { @Test diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ActionInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ActionInvariantTest.java index 3226b8fb5..898921704 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ActionInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ActionInvariantTest.java @@ -9,7 +9,7 @@ import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.LocatableRef; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/CompositionInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/CompositionInvariantTest.java index af404ed5a..064b91180 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/CompositionInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/CompositionInvariantTest.java @@ -9,7 +9,7 @@ import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; import com.nedap.archie.rm.generic.PartySelf; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/EhrInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/EhrInvariantTest.java index 479e7c023..d6b5d245f 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/EhrInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/EhrInvariantTest.java @@ -5,7 +5,7 @@ import com.nedap.archie.rm.support.identification.HierObjectId; import com.nedap.archie.rm.support.identification.ObjectRef; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import java.util.ArrayList; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/InstructionInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/InstructionInvariantTest.java index b7fcb9b04..991746e11 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/InstructionInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/InstructionInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.composition.Instruction; import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class InstructionInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/IsmTransitionInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/IsmTransitionInvariantTest.java index e56a33f7b..ec22da5fc 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/IsmTransitionInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/IsmTransitionInvariantTest.java @@ -3,7 +3,7 @@ import com.nedap.archie.rm.composition.IsmTransition; import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class IsmTransitionInvariantTest { diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ObservationInvariantTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ObservationInvariantTest.java index 4638d1df7..9b7d262c5 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ObservationInvariantTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/invariants/ehr/ObservationInvariantTest.java @@ -7,7 +7,7 @@ import com.nedap.archie.rm.datastructures.PointEvent; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; import com.nedap.archie.rmobjectvalidator.invariants.InvariantTestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java index 07c3d80aa..e49efdd25 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/ArchetypeSlotValidationTest.java @@ -20,15 +20,15 @@ import com.nedap.archie.rmobjectvalidator.RMObjectValidator; import com.nedap.archie.rmobjectvalidator.ValidationConfiguration; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import java.util.List; import java.util.Map; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ArchetypeSlotValidationTest { @@ -43,7 +43,7 @@ public class ArchetypeSlotValidationTest { private Section example; private RMObjectValidator rmObjectValidator; - @Before + @BeforeEach public void setup() throws IOException, ADLParseException { Archetype parent = TestUtil.parseFailOnErrors("/adl2-tests/validity/slots/openEHR-EHR-SECTION.slot_parent.v1.0.0.adls"); @@ -83,7 +83,7 @@ public void validateWithCorrectArchetypeInSlot() throws Exception { exampleIncluded.setArchetypeNodeId("id2"); List validated = rmObjectValidator.validate(parentOpt, example); - assertEquals(validated.toString(), 0, validated.size()); + assertEquals(0, validated.size(), validated.toString()); //now do something invalid Element element = (Element) example.itemAtPath("/items[id2]/data/events[id3]/data/items[id4.1]"); @@ -92,7 +92,7 @@ public void validateWithCorrectArchetypeInSlot() throws Exception { validated = rmObjectValidator.validate(parentOpt, example); - assertEquals(validated.toString(), 1, validated.size()); + assertEquals(1, validated.size(), validated.toString()); RMObjectValidationMessage rmObjectValidationMessage = validated.get(0); assertEquals("/items[id2, 1]/data[id9]/events[id3, 1]/data[id10]/items[id4.1, 3]/value/defining_code[id9999]", rmObjectValidationMessage.getPath()); assertEquals(RMObjectValidationMessageType.DEFAULT, rmObjectValidationMessage.getType()); @@ -110,7 +110,7 @@ public void incorrectArchetypeInSlot() throws Exception { exampleIncluded.setArchetypeNodeId("id2"); List validated = rmObjectValidator.validate(parentOpt, example); - assertEquals(validated.toString(), 1, validated.size()); + assertEquals(1, validated.size(), validated.toString()); RMObjectValidationMessage rmObjectValidationMessage = validated.get(0); assertEquals("/items[id2, 1]", rmObjectValidationMessage.getPath()); assertEquals(RMObjectValidationMessageType.ARCHETYPE_SLOT_ID_MISMATCH, rmObjectValidationMessage.getType()); @@ -129,7 +129,7 @@ public void unknownArchetypeInSlot() throws Exception { exampleIncluded.setArchetypeNodeId("id2"); List validated = rmObjectValidator.validate(parentOpt, example); - assertEquals(validated.toString(), 1, validated.size()); + assertEquals(1, validated.size(), validated.toString()); RMObjectValidationMessage rmObjectValidationMessage = validated.get(0); assertEquals("/items[id2, 1]", rmObjectValidationMessage.getPath()); assertEquals(RMObjectValidationMessageType.ARCHETYPE_NOT_FOUND, rmObjectValidationMessage.getType()); @@ -152,7 +152,7 @@ public void noArchetypeIdInSlot() throws Exception { List validated = rmObjectValidator.validate(parentOpt, example); - assertEquals(validated.toString(), 3, validated.size()); + assertEquals(3, validated.size(), validated.toString()); //there must be an archetype id in a slot RMObjectValidationMessage rmObjectValidationMessage = validated.get(0); diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidationTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidationTest.java index 1d57b1caa..de129ea22 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidationTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMPrimitiveObjectValidationTest.java @@ -7,20 +7,20 @@ import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.rmobjectvalidator.RMObjectValidationMessage; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; @Deprecated public class RMPrimitiveObjectValidationTest { private static ArchieRMInfoLookup lookup; - @BeforeClass + @BeforeAll public static void beforeClass() { lookup = ArchieRMInfoLookup.getInstance(); } diff --git a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidationTest.java b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidationTest.java index c4ff9b66f..c2376ce03 100644 --- a/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidationTest.java +++ b/tools/src/test/java/com/nedap/archie/rmobjectvalidator/validations/RMTupleValidationTest.java @@ -11,19 +11,19 @@ import com.nedap.archie.rm.datavalues.quantity.DvQuantity; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rmobjectvalidator.RMObjectValidationMessage; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; @Deprecated public class RMTupleValidationTest { private static ArchieRMInfoLookup lookup; - @BeforeClass + @BeforeAll public static void beforeClass() { lookup = ArchieRMInfoLookup.getInstance(); } diff --git a/tools/src/test/java/com/nedap/archie/rmutil/PathableUtilTest.java b/tools/src/test/java/com/nedap/archie/rmutil/PathableUtilTest.java index 5fb280a82..818a03ef1 100644 --- a/tools/src/test/java/com/nedap/archie/rmutil/PathableUtilTest.java +++ b/tools/src/test/java/com/nedap/archie/rmutil/PathableUtilTest.java @@ -15,12 +15,12 @@ import com.nedap.archie.rminfo.ModelInfoLookup; import com.nedap.archie.testutil.TestUtil; import com.nedap.archie.xml.JAXBUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class PathableUtilTest { @@ -28,7 +28,7 @@ public class PathableUtilTest { private Archetype archetype; private Pathable root; - @Before + @BeforeEach public void setup() throws Exception { ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("en"); archetype = new ADLParser(new RMConstraintImposer()).parse(getClass().getResourceAsStream("/basic.adl")); diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/BinaryOperatorTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/BinaryOperatorTest.java index 87e14f86b..db5bef7d7 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/BinaryOperatorTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/BinaryOperatorTest.java @@ -6,12 +6,12 @@ import com.nedap.archie.rules.Constant; import com.nedap.archie.rules.ExpressionType; import com.nedap.archie.rules.OperatorKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; import java.time.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java index 3fa41d240..4313539ca 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/FixableAssertionsCheckerTest.java @@ -13,15 +13,15 @@ import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.rmobjectvalidator.ValidationConfiguration; import com.nedap.archie.testutil.TestUtil; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.util.ArrayList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 04/04/2017. @@ -34,7 +34,7 @@ public class FixableAssertionsCheckerTest { private TestUtil testUtil; private RMObjectCreator rmObjectCreator; - @Before + @BeforeEach public void setup() { testUtil = new TestUtil(); rmObjectCreator = new RMObjectCreator(ArchieRMInfoLookup.getInstance()); @@ -43,7 +43,7 @@ public void setup() { ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage("en"); } - @After + @AfterEach public void tearDown() throws Exception { ArchieLanguageConfiguration.setThreadLocalLogicalPathLanguage(null); ArchieLanguageConfiguration.setThreadLocalDescriptiongAndMeaningLanguage(null); @@ -65,7 +65,7 @@ public void fixableMatches() throws Exception { itemTree.addItem(cluster2); EvaluationResult evaluate = ruleEvaluation.evaluate(root, archetype.getRules().getRules()); - assertEquals("There are eleven values that must be set", 16, evaluate.getSetPathValues().size()); + assertEquals(16, evaluate.getSetPathValues().size(), "There are eleven values that must be set"); // Assert that paths must be set to specific values // DvText @@ -134,7 +134,7 @@ public void andExpression() throws Exception { Locatable root = (Locatable) testUtil.constructEmptyRMObject(archetype.getDefinition()); EvaluationResult evaluate = ruleEvaluation.evaluate(root, archetype.getRules().getRules()); - assertEquals("There are seven values that must be set", 7, evaluate.getSetPathValues().size()); + assertEquals(7, evaluate.getSetPathValues().size()); //assert that paths must be set to specific values assertEquals("test string", evaluate.getSetPathValues().get("/data[id2]/events[id3]/data[id4]/items[id5]/value/value").getValue()); @@ -174,7 +174,7 @@ public void constructOnlyNecessaryStructure() throws Exception { Locatable root = rmObjectCreator.create(archetype.getDefinition()); EvaluationResult evaluate = ruleEvaluation.evaluate(root, archetype.getRules().getRules()); - assertEquals("there must be three values that must be set", 1, evaluate.getSetPathValues().size()); + assertEquals(1, evaluate.getSetPathValues().size(), "there must be three values that must be set"); //assert that paths must be set to specific values assertEquals("test string", evaluate.getSetPathValues().get("/data[id2]/events[id3]/data[id4]/items[id5]/value/value").getValue()); diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionUtilTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionUtilTest.java index 0ed5b7799..203f0a403 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionUtilTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionUtilTest.java @@ -1,12 +1,12 @@ package com.nedap.archie.rules.evaluation; import com.nedap.archie.rules.evaluation.evaluators.FunctionUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class FunctionUtilTest { diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionsTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionsTest.java index f5ffaac06..ef18d807c 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionsTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/FunctionsTest.java @@ -13,11 +13,11 @@ import com.nedap.archie.rmobjectvalidator.ValidationConfiguration; import com.nedap.archie.rules.PrimitiveType; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 06/04/2017. @@ -27,7 +27,7 @@ public class FunctionsTest { private ADLParser parser; private Archetype archetype; - @Before + @BeforeEach public void setup() { parser = new ADLParser(new RMConstraintImposer()); } @@ -42,7 +42,7 @@ public void min() throws Exception { ruleEvaluation.evaluate(root, archetype.getRules().getRules()); ValueList min = ruleEvaluation.getVariableMap().get("min"); assertEquals(PrimitiveType.Real, min.getType()); - assertEquals("min should work", 3.0, (Double) min.getValues().get(0).getValue(), 0.001); + assertEquals(3.0, (Double) min.getValues().get(0).getValue(), 0.001, "min should work"); } @Test @@ -55,7 +55,7 @@ public void max() throws Exception { ruleEvaluation.evaluate(root, archetype.getRules().getRules()); ValueList max = ruleEvaluation.getVariableMap().get("max"); assertEquals(PrimitiveType.Real, max.getType()); - assertEquals("max should work", 2.0, (Double) max.getValues().get(0).getValue(), 0.001); + assertEquals(2.0, (Double) max.getValues().get(0).getValue(), 0.001, "max should work"); } private RuleEvaluation getRuleEvaluation() { @@ -88,7 +88,7 @@ public void flatSum() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList flatSum = ruleEvaluation.getVariableMap().get("flat_sum"); assertEquals(PrimitiveType.Real, flatSum.getType()); - assertEquals("flat_sum should work", 122.6, (Double) flatSum.getValues().get(0).getValue(), 0.001); + assertEquals(122.6, (Double) flatSum.getValues().get(0).getValue(), 0.001, "flat_sum should work"); } @@ -110,7 +110,7 @@ public void sum() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList sum = ruleEvaluation.getVariableMap().get("sum"); assertEquals(PrimitiveType.Real, sum.getType()); - assertEquals("sum should work", 65+21+3.3, (Double) sum.getValues().get(0).getValue(), 0.001); + assertEquals(65+21+3.3, (Double) sum.getValues().get(0).getValue(), 0.001, "sum should work"); } @Test @@ -130,7 +130,7 @@ public void mean() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList mean = ruleEvaluation.getVariableMap().get("mean"); assertEquals(PrimitiveType.Real, mean.getType()); - assertEquals("mean should work", (65+21+3.3)/3, (Double) mean.getValues().get(0).getValue(), 0.001); + assertEquals((65+21+3.3)/3, (Double) mean.getValues().get(0).getValue(), 0.001, "mean should work"); } @Test public void valueWhenUndefined() throws Exception { @@ -142,7 +142,7 @@ public void valueWhenUndefined() throws Exception { ruleEvaluation.evaluate(root, archetype.getRules().getRules()); ValueList valueWhenUndefined = ruleEvaluation.getVariableMap().get("value_when_undefined"); assertEquals(PrimitiveType.Real, valueWhenUndefined.getType()); - assertEquals("value when undefined should be set", 10.0d, (Double) valueWhenUndefined.getObject(0), 0.00001d); + assertEquals(10.0d, (Double) valueWhenUndefined.getObject(0), 0.00001d, "value when undefined should be set"); } @Test @@ -158,7 +158,7 @@ public void valueWhenUndefinedWithValue() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList valueWhenUndefined = ruleEvaluation.getVariableMap().get("value_when_undefined"); assertEquals(PrimitiveType.Real, valueWhenUndefined.getType()); - assertEquals("value when undefined should be set to original value", 65d, (Double) valueWhenUndefined.getObject(0), 0.00001d); + assertEquals(65d, (Double) valueWhenUndefined.getObject(0), 0.00001d, "value when undefined should be set to original value"); } @Test @@ -175,9 +175,9 @@ public void round() throws Exception { assertEquals(PrimitiveType.Integer, roundedUp.getType()); assertEquals(PrimitiveType.Integer, roundedDown.getType()); assertEquals(PrimitiveType.Integer, roundedNonDecimal.getType()); - assertEquals("round should round up", 2L, (long) (Long) roundedUp.getValues().get(0).getValue()); - assertEquals("round should round down", 1L, (long) (Long) roundedDown.getValues().get(0).getValue()); - assertEquals("round non-decimal should also work", 3L, (long) (Long) roundedNonDecimal.getValues().get(0).getValue()); + assertEquals(2L, (long) (Long) roundedUp.getValues().get(0).getValue(), "round should round up"); + assertEquals(1L, (long) (Long) roundedDown.getValues().get(0).getValue(), "round should round down"); + assertEquals(3L, (long) (Long) roundedNonDecimal.getValues().get(0).getValue(), "round non-decimal should also work"); } @Test @@ -199,9 +199,9 @@ public void roundMultiple() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList roundMultiple = ruleEvaluation.getVariableMap().get("round_multiple"); assertEquals(PrimitiveType.Integer, roundMultiple.getType()); - assertEquals("rounds each value in a value list", 2, roundMultiple.getValues().size()); - assertEquals("first value is rounded", 65L, (long) (Long) roundMultiple.getValues().get(0).getValue()); - assertEquals("second value is rounded", 46L, (long) (Long) roundMultiple.getValues().get(1).getValue()); + assertEquals(2, roundMultiple.getValues().size(), "rounds each value in a value list"); + assertEquals(65L, (long) (Long) roundMultiple.getValues().get(0).getValue(), "first value is rounded"); + assertEquals(46L, (long) (Long) roundMultiple.getValues().get(1).getValue(), "second value is rounded"); } @Test @@ -217,7 +217,7 @@ public void ceil() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList ceilPath = ruleEvaluation.getVariableMap().get("ceil_path"); assertEquals(PrimitiveType.Integer, ceilPath.getType()); - assertEquals("ceil should round up", 14L, ceilPath.getValues().get(0).getValue()); + assertEquals(14L, ceilPath.getValues().get(0).getValue(), "ceil should round up"); } @Test @@ -233,6 +233,6 @@ public void floor() throws Exception { ruleEvaluation.evaluate(rmObject, archetype.getRules().getRules()); ValueList floorPath = ruleEvaluation.getVariableMap().get("floor_path"); assertEquals(PrimitiveType.Integer, floorPath.getType()); - assertEquals("floor should round down", 13L, floorPath.getValues().get(0).getValue()); + assertEquals(13L, floorPath.getValues().get(0).getValue(), "floor should round down"); } } diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationJaxbTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationJaxbTest.java index 88cc40924..8e5f6efa2 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationJaxbTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationJaxbTest.java @@ -4,11 +4,11 @@ import com.nedap.archie.rm.datavalues.quantity.DvQuantity; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.xml.JAXBUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * runs all the tests in ParsedRuledEvaluationTest, but with JAXB intead of RMPathQuery @@ -61,10 +61,10 @@ public void modelReferences() throws Exception { assertEquals(65d, (Double) ruleEvaluation.getVariableMap().get("arithmetic_test").getObject(0), 0.001d); List assertionResults = ruleEvaluation.getEvaluationResult().getAssertionResults(); - assertEquals("one assertion should have been checked", 1, assertionResults.size()); + assertEquals(1, assertionResults.size(), "one assertion should have been checked"); AssertionResult result = assertionResults.get(0); - assertEquals("the assertion should have succeeded", true, result.getResult()); + assertEquals(true, result.getResult(), "the assertion should have succeeded"); assertEquals("the assertion tag should be correct", "blood_pressure_valid", result.getTag()); assertEquals(1, result.getRawResult().getPaths(0).size()); assertEquals("/data[id2]/events[id3]/data[id4]/items[id5]/value/magnitude", result.getRawResult().getPaths(0).get(0)); diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationPathQueryTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationPathQueryTest.java index d58686510..d89168f68 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationPathQueryTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationPathQueryTest.java @@ -5,12 +5,12 @@ import com.nedap.archie.rm.datastructures.Element; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.LocalDateTime; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ParsedRulesEvaluationPathQueryTest extends ParsedRulesEvaluationTest { diff --git a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java index 75d177bf8..a21e2e86d 100644 --- a/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java +++ b/tools/src/test/java/com/nedap/archie/rules/evaluation/ParsedRulesEvaluationTest.java @@ -25,8 +25,8 @@ import com.nedap.archie.rules.RuleStatement; import com.nedap.archie.rules.VariableDeclaration; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; @@ -35,7 +35,8 @@ import java.util.Map; import java.util.Objects; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 01/04/16. @@ -47,7 +48,7 @@ public abstract class ParsedRulesEvaluationTest { TestUtil testUtil; - @Before + @BeforeEach public void setup() { testUtil = new TestUtil(); parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); @@ -75,7 +76,7 @@ public void precedenceOverride() throws Exception { Archetype parse(String filename) throws IOException, ADLParseException { archetype = parser.parse(ParsedRulesEvaluationTest.class.getResourceAsStream(filename)); - assertTrue(parser.getErrors().toString(), parser.getErrors().hasNoErrors()); + assertThat(parser.getErrors().toString(), parser.getErrors().hasNoErrors()); return archetype; } @@ -133,11 +134,11 @@ public void modelReferences() throws Exception { assertEquals(65d, (Double) ruleEvaluation.getVariableMap().get("arithmetic_test").getObject(0), 0.001d); List assertionResults = ruleEvaluation.getEvaluationResult().getAssertionResults(); - assertEquals("one assertion should have been checked", 1, assertionResults.size()); + assertEquals(1, assertionResults.size(), "one assertion should have been checked"); AssertionResult result = assertionResults.get(0); - assertEquals("the assertion should have succeeded", true, result.getResult()); - assertEquals("the assertion tag should be correct", "blood_pressure_valid", result.getTag()); + assertTrue(result.getResult(), "the assertion should have succeeded"); + assertEquals("blood_pressure_valid", result.getTag(), "the assertion tag should be correct"); assertEquals(1, result.getRawResult().getPaths(0).size()); assertEquals("/data[id2]/events[id3, 1]/data[id4]/items[id5, 1]/value/magnitude", result.getRawResult().getPaths(0).get(0)); @@ -209,11 +210,11 @@ public void multiValuedExpressions() throws Exception { ruleEvaluation.evaluate(root, archetype.getRules().getRules()); List assertionResults = ruleEvaluation.getEvaluationResult().getAssertionResults(); - assertEquals("one assertion should have been checked", 1, assertionResults.size()); + assertEquals(1, assertionResults.size(), "one assertion should have been checked"); AssertionResult result = assertionResults.get(0); - assertEquals("the assertion should have succeeded", true, result.getResult()); - assertEquals("the assertion tag should be correct", "blood_pressure_valid", result.getTag()); + assertEquals(true, result.getResult(), "the assertion should have succeeded"); + assertEquals("blood_pressure_valid", result.getTag(), "the assertion tag should be correct"); } @Test @@ -226,11 +227,11 @@ public void forAllExpression() throws Exception { ruleEvaluation.evaluate(root, archetype.getRules().getRules()); List assertionResults = ruleEvaluation.getEvaluationResult().getAssertionResults(); - assertEquals("one assertion should have been checked", 1, assertionResults.size()); + assertEquals(1, assertionResults.size(), "one assertion should have been checked"); AssertionResult result = assertionResults.get(0); - assertEquals("the assertion should have succeeded", false, result.getResult()); - assertEquals("the assertion tag should be correct", "blood_pressure_valid", result.getTag()); + assertEquals(false, result.getResult(), "the assertion should have succeeded"); + assertEquals("blood_pressure_valid", result.getTag(), "the assertion tag should be correct"); } public Pathable constructTwoBloodPressureObservations() { @@ -667,7 +668,7 @@ public void impliesEvaluatesToNull() throws Exception { EvaluationResult evaluationResult = ruleEvaluation.evaluate(root, archetype.getRules().getRules()); assertEquals(3, evaluationResult.getAssertionResults().size()); for(AssertionResult assertionResult:evaluationResult.getAssertionResults()) { - assertTrue(assertionResult + " failed and it should not", assertionResult.getResult()); //all three assertions should not lead to validation errors + assertThat(assertionResult + " failed and it should not", assertionResult.getResult()); //all three assertions should not lead to validation errors } //no paths must exist, not exist or set @@ -793,7 +794,7 @@ public void flattenedRules() throws IOException, ADLParseException { codedText.setValue("value 1"); EvaluationResult result = ruleEvaluation.evaluate(cluster, opt.getRules().getRules()); AssertionResult assertionResult = result.getAssertionResults().get(0); - assertTrue("The given validation rule should pass", assertionResult.getResult()); + assertThat("The given validation rule should pass", assertionResult.getResult()); assertEquals("ac3", assertionResult.getPathsConstrainedToValueSets().get("/items[id2, 1]/items[id2]/value/defining_code")); assertEquals(2, result.getPathsConstrainedToValueSets().size()); assertEquals("ac3", result.getPathsConstrainedToValueSets().get("/items[id2, 1]/items[id2]/value/defining_code")); diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java index 42eff84ce..6b2bc0f83 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerParserRoundtripTest.java @@ -15,8 +15,7 @@ import com.nedap.archie.json.ArchieRMObjectMapperProvider; import com.nedap.archie.rminfo.RMObjectMapperProvider; import com.nedap.archie.testutil.TestUtil; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,8 +25,8 @@ import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author markopi @@ -71,9 +70,9 @@ public void escapeQuotes() throws Exception { archetype.getDescription().setLicence("license with a \"-mark"); String serialized = ADLArchetypeSerializer.serialize(archetype); - Assert.assertThat(serialized, containsString("license with a \\\"-mark" )); + assertThat(serialized, containsString("license with a \\\"-mark" )); Archetype parsed = new ADLParser().parse(serialized); - Assert.assertThat(parsed.getDescription().getLicence(), is("license with a \"-mark" )); + assertThat(parsed.getDescription().getLicence(), is("license with a \"-mark" )); } @Test @@ -82,9 +81,9 @@ public void escapeQuotes2() throws Exception { archetype.getDescription().setLicence("license with a \\-mark"); String serialized = ADLArchetypeSerializer.serialize(archetype); - Assert.assertThat(serialized, containsString("license with a \\\\-mark" )); + assertThat(serialized, containsString("license with a \\\\-mark" )); Archetype parsed = new ADLParser().parse(serialized); - Assert.assertThat(parsed.getDescription().getLicence(), is("license with a \\-mark" )); + assertThat(parsed.getDescription().getLicence(), is("license with a \\-mark" )); } @Test @@ -93,9 +92,9 @@ public void escapeQuotes3() throws Exception { archetype.getDescription().setLicence("license with a \\\"-mark"); String serialized = ADLArchetypeSerializer.serialize(archetype); - Assert.assertThat(serialized, containsString("license with a \\\\\\\"-mark" )); + assertThat(serialized, containsString("license with a \\\\\\\"-mark" )); Archetype parsed = new ADLParser().parse(serialized); - Assert.assertThat(parsed.getDescription().getLicence(), is("license with a \\\"-mark" )); + assertThat(parsed.getDescription().getLicence(), is("license with a \\\"-mark" )); } @Test @@ -157,10 +156,10 @@ private Archetype roundtrip(Archetype archetype, RMObjectMapperProvider rmObject ADLParser parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); Archetype result = parser.parse(serialized); - assertTrue("roundtrip parsing should never cause errors: " + parser.getErrors().toString(), parser.getErrors().hasNoErrors()); + assertTrue(parser.getErrors().hasNoErrors(), "roundtrip parsing should never cause errors: " + parser.getErrors().toString()); String serialized2 = ADLArchetypeSerializer.serialize(result, null, rmObjectMapperProvider); - assertEquals("roundtrip serialization should be idempotent", serialized, serialized2); + assertEquals(serialized, serialized2, "roundtrip serialization should be idempotent"); return result; } @@ -183,10 +182,10 @@ public void defaultValuesNoMetamodels() throws Exception { ADLParser parser = new ADLParser(/* no metamodels */); Archetype result = parser.parse(serialized); - assertTrue("roundtrip parsing should never cause errors: " + parser.getErrors().toString(), parser.getErrors().hasNoErrors()); + assertTrue(parser.getErrors().hasNoErrors(),"roundtrip parsing should never cause errors: " + parser.getErrors().toString()); String serialized2 = ADLArchetypeSerializer.serialize(result, null, null); - assertEquals("roundtrip serialization should be idempotent", serialized, serialized2); + assertEquals(serialized, serialized2, "roundtrip serialization should be idempotent"); CComplexObject startDvTextConstraint = archetype.itemAtPath("/items[id2]/value[id21]"); CComplexObject resultDvTextConstraint = result.itemAtPath("/items[id2]/value[id21]"); diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java index 30f281725..7fdbfcfbb 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLArchetypeSerializerTest.java @@ -5,14 +5,15 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.aom.rmoverlay.VisibilityType; import com.nedap.archie.testutil.TestUtil; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.IOException; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; /** * @author markopi diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLDefinitionSerializerTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLDefinitionSerializerTest.java index f4b1d5bc9..648ca90f3 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/ADLDefinitionSerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/ADLDefinitionSerializerTest.java @@ -4,15 +4,15 @@ import com.nedap.archie.adlparser.ADLParser; import com.nedap.archie.aom.*; import com.nedap.archie.base.MultiplicityInterval; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.List; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author markopi @@ -21,7 +21,7 @@ public class ADLDefinitionSerializerTest { private static Archetype archetypePrimitives; - @BeforeClass + @BeforeAll public static void setupClass() throws IOException, ADLParseException { archetypePrimitives = load("openEHR-TEST_PKG-WHOLE.primitive_types.v1.adls"); } diff --git a/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java b/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java index 313227fda..f62836453 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/adl/DefaultValueSerializerTest.java @@ -11,12 +11,13 @@ import com.nedap.archie.rm.datavalues.DvCodedText; import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.support.identification.TerminologyId; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.InputStream; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; public class DefaultValueSerializerTest { @@ -177,7 +178,7 @@ public void serializeClusterOdin() throws Exception { Archetype parsed = adlParser.parse(serialized); - assertTrue(adlParser.getErrors().toString(), adlParser.getErrors().hasNoErrors()); + assertThat(adlParser.getErrors().toString(), adlParser.getErrors().hasNoErrors()); assertNotNull(parsed.getDefinition().getDefaultValue()); Cluster defaultValue = (Cluster) ((CComplexObject) parsed.getDefinition()).getDefaultValue(); assertEquals(2, defaultValue.getItems().size()); diff --git a/tools/src/test/java/com/nedap/archie/serializer/rules/ADLRulesSerializerTest.java b/tools/src/test/java/com/nedap/archie/serializer/rules/ADLRulesSerializerTest.java index be94d6739..bff4b34a9 100644 --- a/tools/src/test/java/com/nedap/archie/serializer/rules/ADLRulesSerializerTest.java +++ b/tools/src/test/java/com/nedap/archie/serializer/rules/ADLRulesSerializerTest.java @@ -5,11 +5,11 @@ import com.nedap.archie.aom.Archetype; import com.nedap.archie.rules.evaluation.ParsedRulesEvaluationTest; import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Created by pieter.bos on 15/06/16. diff --git a/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java b/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java index 21228970f..c8eaefb2f 100644 --- a/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java +++ b/tools/src/test/java/com/nedap/archie/testutil/TestUtil.java @@ -24,7 +24,8 @@ import java.util.stream.Collectors; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.*; /** * Created by pieter.bos on 06/04/16. @@ -128,7 +129,8 @@ public static void assertCObjectEquals(CObject cobject1, CObject cobject2) throw .filter( o -> primitiveObjectMatches(primitiveChild, o) ).collect(Collectors.toList()); - assertFalse("a primitive object should have a matching primitive object", childObjects2.isEmpty()); + assertFalse(childObjects2.isEmpty(),"a primitive object should have a matching primitive object" + ); } } @@ -149,7 +151,7 @@ public static Archetype parseFailOnErrors(String resourceName) throws IOExceptio } Archetype archetype = parser.parse(stream); parser.getErrors().logToLogger(); - assertFalse(parser.getErrors().toString(), parser.getErrors().hasErrors()); + assertFalse(parser.getErrors().hasErrors(), parser.getErrors().toString()); assertNotNull(archetype); return archetype; } @@ -163,11 +165,11 @@ public static void parseExpectErrorCode(String resourceName, String errorCode) t } try { Archetype archetype = parser.parse(stream); - assertTrue("Parser expected to have errors, but there were none", parser.getErrors().hasErrors()); + assertThat("Parser expected to have errors, but there were none", parser.getErrors().hasErrors()); } catch (ADLParseException ex) { parser.getErrors().logToLogger(); - assertTrue("Parser expected to have errors, but there were none", parser.getErrors().hasErrors()); - assertTrue("expected error code to be present: " + errorCode, parser.getErrors().getErrors().stream().filter(e -> e.getShortMessage().equalsIgnoreCase(errorCode)).findFirst().isPresent()); + assertThat("Parser expected to have errors, but there were none", parser.getErrors().hasErrors()); + assertThat("expected error code to be present: " + errorCode, parser.getErrors().getErrors().stream().filter(e -> e.getShortMessage().equalsIgnoreCase(errorCode)).findFirst().isPresent()); } } } diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMRoundTripTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMRoundTripTest.java index 23377014f..dc3568456 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMRoundTripTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMRoundTripTest.java @@ -6,8 +6,8 @@ import com.nedap.archie.flattener.FlattenerTest; import com.nedap.archie.flattener.SimpleArchetypeRepository; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import javax.xml.bind.JAXBException; @@ -17,7 +17,7 @@ import java.io.StringWriter; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; /** * Created by pieter.bos on 22/07/16. @@ -30,7 +30,7 @@ public class JAXBAOMRoundTripTest { private Unmarshaller unmarshaller; private StringWriter writer; - @Before + @BeforeEach public void setup() throws Exception { parser = new ADLParser(); //no constraints imposer in this test! writer = new StringWriter(); diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java index 316f91d96..e84d668bb 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java @@ -12,8 +12,8 @@ import com.nedap.archie.base.terminology.TerminologyCode; import com.nedap.archie.datetime.DateTimeParsers; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; @@ -24,15 +24,16 @@ import java.util.LinkedHashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class JAXBAOMTest { private Archetype archetype; private CComplexObject elementRootNode; private CAttribute valueAttribute; - @Before + @BeforeEach public void setup() { //create an empty archetype archetype = new AuthoredArchetype(); @@ -62,8 +63,8 @@ public void serializeCDuration() throws Exception { marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); marshaller.marshal(archetype, writer); String xml = writer.toString(); - assertTrue(xml, xml.contains("-P10D")); - assertTrue(xml, xml.contains("PT10S")); + assertThat(xml, xml.contains("-P10D")); + assertThat(xml, xml.contains("PT10S")); } @Test @@ -79,7 +80,7 @@ public void testCTerminologyCode() throws Exception { marshaller.marshal(archetype, writer); String xml = writer.toString(); - assertTrue(xml, xml.contains("preferred")); + assertThat(xml, xml.contains("preferred")); Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); Archetype unmarshalled = (Archetype) unmarshaller.unmarshal(new StringReader(xml)); @@ -281,7 +282,7 @@ public void templateXml() throws Exception { Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); Template unmarshalled = (Template) unmarshaller.unmarshal(new StringReader(writer.toString())); - assertEquals("one template overlay should have been unmarshalled", 1, unmarshalled.getTemplateOverlays().size()); + assertEquals(1, unmarshalled.getTemplateOverlays().size(), "one template overlay should have been unmarshalled"); assertEquals("openEHR-EHR-ELEMENT.test.v0.0.1", unmarshalled.getTemplateOverlays().get(0).getArchetypeId().getFullId()); } diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java index 9ee8a65dd..7a842c906 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBRMRoundTripTest.java @@ -11,8 +11,8 @@ import com.nedap.archie.rm.datavalues.quantity.datetime.DvTime; import com.nedap.archie.rminfo.ArchieRMInfoLookup; import com.nedap.archie.testutil.TestUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.referencemodels.BuiltinReferenceModels; import javax.xml.bind.Marshaller; @@ -24,8 +24,8 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Created by pieter.bos on 30/06/16. @@ -37,7 +37,7 @@ public class JAXBRMRoundTripTest { private TestUtil testUtil; - @Before + @BeforeEach public void setup() { testUtil = new TestUtil(); parser = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()); @@ -80,7 +80,8 @@ public void dataValues() throws Exception { assertThat(parsedQueryContext.find("/items['Date']/value").getValue(), is(LocalDate.of(2016, 1, 1))); assertThat(parsedQueryContext.find("/items['Datetime']/value").getValue(), is(LocalDateTime.of(2016, 1, 1, 12, 00))); assertThat(parsedQueryContext.find("/items['Time']/value").getValue(), is(LocalTime.of(12, 0))); - assertEquals("double should be correct", parsedQueryContext.find("/items['Quantity']/value/magnitude"), 23d, 0.001d); + assertEquals(23d, parsedQueryContext.find("/items['Quantity']/value/magnitude"), 0.001d, "double should be correct" + ); } private RMQueryContext getQueryContext(Cluster cluster) { diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBRMTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBRMTest.java index 253adbb74..841603fa0 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBRMTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBRMTest.java @@ -4,7 +4,7 @@ import com.nedap.archie.rm.datavalues.DvText; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime; import com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; import javax.xml.bind.Marshaller; @@ -13,8 +13,9 @@ import java.io.StringWriter; import java.time.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class JAXBRMTest { @@ -28,7 +29,7 @@ public void serializeDuration() throws Exception { marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); marshaller.marshal(element, writer); String xml = writer.toString(); - assertTrue(xml, xml.contains("P10D")); + assertThat(xml, xml.contains("P10D")); } @Test @@ -41,7 +42,7 @@ public void serializeNegativeDuration() throws Exception { marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); marshaller.marshal(element, writer); String xml = writer.toString(); - assertTrue(xml, xml.contains("-P10D")); + assertThat(xml, xml.contains("-P10D")); } @Test diff --git a/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java b/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java index b2ab9e3d0..1bd7562ed 100644 --- a/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java +++ b/utils/src/test/java/com/nedap/archie/datetime/DateTimeParserTest.java @@ -1,13 +1,13 @@ package com.nedap.archie.datetime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; import java.time.*; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAmount; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Created by pieter.bos on 02/03/16. diff --git a/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java b/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java index 24b2483d1..45404b491 100644 --- a/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java +++ b/utils/src/test/java/com/nedap/archie/datetime/DateTimeSerializerFormattersTest.java @@ -1,6 +1,6 @@ package com.nedap.archie.datetime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; import java.time.*; @@ -8,7 +8,7 @@ import java.util.Collections; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class DateTimeSerializerFormattersTest { diff --git a/utils/src/test/java/org/openehr/utils/error/ErrorAccumulatorTest.java b/utils/src/test/java/org/openehr/utils/error/ErrorAccumulatorTest.java index d40b59382..181d06c4f 100644 --- a/utils/src/test/java/org/openehr/utils/error/ErrorAccumulatorTest.java +++ b/utils/src/test/java/org/openehr/utils/error/ErrorAccumulatorTest.java @@ -1,7 +1,7 @@ package org.openehr.utils.error; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openehr.utils.message.MessageCode; import org.openehr.utils.message.MessageDescriptor; import org.openehr.utils.message.MessageLogger; @@ -9,13 +9,13 @@ import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ErrorAccumulatorTest { private MessageLogger errorAccumulator; - @Before + @BeforeEach public void setup() { errorAccumulator = new MessageLogger(); } diff --git a/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java b/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java index a300afc45..fd627a300 100644 --- a/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java +++ b/utils/src/test/java/org/openehr/utils/file/FileAndDirUtilsTest.java @@ -1,7 +1,7 @@ package org.openehr.utils.file; import org.apache.commons.io.filefilter.IOFileFilter; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openehr.utils.operation.OperationOutcome; import org.openehr.utils.operation.OperationOutcomeStatus; @@ -9,8 +9,8 @@ import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; /** * Copyright 2017 Cognitive Medical Systems, Inc (http://www.cognitivemedicine.com). From 3a5dd242767448fddbb95a78d32d84fd3e42893f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20G=C3=BCven=C3=A7?= <21soft1014@isik.edu.tr> Date: Mon, 23 Feb 2026 13:29:52 +0300 Subject: [PATCH 36/60] Fix typo in README: 'thanks the the' -> 'thanks to the' (#733) Corrected a grammar error in the 'Serializing to ADL' section. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1370b266c..fc694026a 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ It also does not yet diff the rules section, this must be manually performed. ### Serializing to ADL -Archetype models can be serialized to ADL thanks the the serializer written by @markopi64 from Marand Labs. To use: +Archetype models can be serialized to ADL thanks to the serializer written by @markopi64 from Marand Labs. To use: ```java String serialized = ADLArchetypeSerializer.serialize(archetype); From 0444be631abf2c02d87b3803301358bc648d4d55 Mon Sep 17 00:00:00 2001 From: Mathijs Hudepohl Date: Tue, 3 Mar 2026 16:05:21 +0100 Subject: [PATCH 37/60] Fix missing refactor (#755) --- utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java b/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java index c765592da..f04ef844f 100644 --- a/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java +++ b/utils/src/test/java/com/nedap/archie/util/CloneUtilTest.java @@ -1,9 +1,9 @@ package com.nedap.archie.util; import com.nedap.archie.base.Cardinality; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class CloneUtilTest { @Test From d247d564676d948d2f9161b09730744484ed12c1 Mon Sep 17 00:00:00 2001 From: JoshuaForssmanNedap Date: Thu, 5 Mar 2026 09:39:53 +0100 Subject: [PATCH 38/60] Adding Gradle test runner fix (#759) * Adding gradle test runner fix * Adding config to be able to run verification/test gradle tasks per module individually --- build.gradle | 4 +++- gradle/libs.versions.toml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8fef18d96..4cf7f6829 100644 --- a/build.gradle +++ b/build.gradle @@ -69,7 +69,7 @@ subprojects { api(libs.threeten.extra) - testImplementation(libs.junit5.jupiter) + testImplementation(libs.bundles.junit) testImplementation(libs.hamcrest) testImplementation(libs.slf4j.simple) @@ -83,6 +83,8 @@ subprojects { test { + useJUnitPlatform() + outputs.upToDateWhen { false } testLogging { events "failed" exceptionFormat = "full" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0d6892f9e..21dbe7815 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,7 @@ nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0 [bundles] jackson = ["jackson-annotations", "jackson-databind", "jackson-datatype-jsr310"] +junit = ["junit5-jupiter", "junit5-jupiter-engine", "junit5-platform-launcher"] [libraries] activation = { module = "javax.activation:activation", version = "1.1.1" } @@ -38,7 +39,9 @@ jaxb-core = { module = "com.sun.xml.bind:jaxb-core", version = "2.3.0.1" } jaxb-impl = { module = "com.sun.xml.bind:jaxb-impl", version = "2.3.9" } -junit5-jupiter = { module = "org.junit.jupiter:junit-jupiter-api", version = "5.14.2" } +junit5-jupiter = { module = "org.junit.jupiter:junit-jupiter-api", version = "5.14.3" } +junit5-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version = "5.14.3" } +junit5-platform-launcher = { module = "org.junit.platform:junit-platform-launcher"} hamcrest = { module = "org.hamcrest:hamcrest", version = "2.2" } kryo = { module = "com.esotericsoftware.kryo:kryo5", version = "5.6.2" } From 3959c95a03fce5c599265a4272be937b9446bc94 Mon Sep 17 00:00:00 2001 From: Mathijs Hudepohl Date: Thu, 12 Mar 2026 12:59:34 +0100 Subject: [PATCH 39/60] Add original language to component terminologies during operational template creation (#757) * Add test * Add original language to component terminologies when not set --- .../flattener/OperationalTemplateCreator.java | 4 +++ .../OperationalTemplateCreatorTest.java | 36 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java b/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java index 807db5728..8a3cf2824 100644 --- a/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java +++ b/tools/src/main/java/com/nedap/archie/flattener/OperationalTemplateCreator.java @@ -246,6 +246,10 @@ private void fillArchetypeRoot(CArchetypeRoot root, OperationalTemplate result) } } + if (terminology.getOriginalLanguage() == null && result.getOriginalLanguage() != null) { + terminology.setOriginalLanguage(result.getOriginalLanguage().getCodeString()); + } + result.addComponentTerminology(newNodeId, terminology); // Replaces dashes and convert to lower case, as dashes and variables starting with an upper case letter diff --git a/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java b/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java index 57e9130f8..c837f2b29 100644 --- a/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java +++ b/tools/src/test/java/com/nedap/archie/flattener/OperationalTemplateCreatorTest.java @@ -4,6 +4,7 @@ import com.nedap.archie.adlparser.ADLParseException; import com.nedap.archie.adlparser.ADLParser; import com.nedap.archie.aom.*; +import com.nedap.archie.aom.terminology.ArchetypeTerminology; import com.nedap.archie.archetypevalidator.ArchetypeValidator; import com.nedap.archie.archetypevalidator.ValidationResult; import com.nedap.archie.base.MultiplicityInterval; @@ -157,6 +158,41 @@ public void allowSpecializationBeforeExclusionDisabled() throws Exception { ); } + @Test + public void testTemplateOverlayOriginalLanguage() throws Exception { + SimpleArchetypeRepository repository = new SimpleArchetypeRepository(); + + try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-OBSERVATION.height.v1.adls")) { + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + repository.addArchetype(archetype); + } + + try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-COMPOSITION.report.v1.adls")) { + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + repository.addArchetype(archetype); + } + + try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-COMPOSITION.report-result.v1.adls")) { + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + repository.addArchetype(archetype); + } + + try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-COMPOSITION.length.v1.0.0.adlt")) { + Archetype archetype = new ADLParser(BuiltinReferenceModels.getMetaModelProvider()).parse(stream); + FlattenerConfiguration flattenerConfiguration = FlattenerConfiguration.forOperationalTemplate(); + flattenerConfiguration.setFailOnMissingUsedArchetype(true); + Flattener flattener = new Flattener(repository, BuiltinReferenceModels.getMetaModelProvider(), flattenerConfiguration); + OperationalTemplate template = (OperationalTemplate) flattener.flatten(archetype); + + // The node id for the used archetype + String newNodeId = "openEHR-EHR-OBSERVATION.ovl-length-height-001.v1.0.0"; + ArchetypeTerminology componentTerminology = template.getComponentTerminologies().get(newNodeId); + + assertNotNull(componentTerminology, "Component terminology should be present. Available keys: " + template.getComponentTerminologies().keySet()); + assertEquals("en", componentTerminology.getOriginalLanguage(), "Original language of component terminology should be 'en'"); + } + } + private Archetype parseAndCreateOPTWithConfig(String fileName, InMemoryFullArchetypeRepository repository, FlattenerConfiguration config) throws IOException, ADLParseException { Archetype result = parse(fileName); ReferenceModels models = new ReferenceModels(); From fb755aa9d82c4930c51493979605304d93c813dc Mon Sep 17 00:00:00 2001 From: JoshuaForssmanNedap Date: Thu, 26 Mar 2026 11:01:21 +0100 Subject: [PATCH 40/60] Update error message for null value set id (#766) --- i18n/po/i18n_en.po | 20 +++--- i18n/po/i18n_nl.po | 20 +++--- i18n/po/keys.pot | 20 +++--- .../BasicTerminologyValidation.java | 4 ++ .../TermCodeSpecializationTest.java | 14 ++++ ...correct_child_valueset_id_null.v1.0.0.adls | 68 +++++++++++++++++++ 6 files changed, 122 insertions(+), 24 deletions(-) create mode 100644 tools/src/test/resources/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0.adls diff --git a/i18n/po/i18n_en.po b/i18n/po/i18n_en.po index 8e0c8d573..def9ae3a4 100644 --- a/i18n/po/i18n_en.po +++ b/i18n/po/i18n_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-17 15:14+0200\n" +"POT-Creation-Date: 2026-03-26 09:39+0100\n" "PO-Revision-Date: \n" "Last-Translator: Pieter Bos \n" "Language-Team: \n" @@ -190,7 +190,7 @@ msgstr "" msgid "Code {0} from the C_TERMINOLOGY_CODE constraint is not defined in the terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:164 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:168 #, java-format msgid "Code {0} is in the terminology, but not used in the archetype" msgstr "" @@ -321,7 +321,7 @@ msgstr "" msgid "Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:178 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:182 #, java-format msgid "Node id {0} already used in archetype as {1} with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4" msgstr "" @@ -1259,13 +1259,13 @@ msgstr "" msgid "value code validity. Each value code (at-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the flattened form of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:143 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:147 #, java-format msgid "value code {0} is used in redefined value set {1}, but not present in its parent value set with members {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:121 #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:125 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:129 #, java-format msgid "value code {0} is used in value set {1}, but not present in terminology" msgstr "" @@ -1274,18 +1274,22 @@ msgstr "" msgid "value set assumed value code validity. Each value code (at-code) used as an assumed_value for a value set in a term constraint in the archetype definition must exist in the value set definition in the terminology for the identified value set." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:110 #, java-format msgid "value set code {0} is not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:112 #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:116 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:120 #, java-format msgid "value set code {0} is used in value set {1}, but not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:138 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 +msgid "value set does not contain a set Id value" +msgstr "" + +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:142 #, java-format msgid "value set {0} has a specialized code, but the valueset it specialized cannot be found in the flat parent" msgstr "" diff --git a/i18n/po/i18n_nl.po b/i18n/po/i18n_nl.po index c1308e77b..d35ecf5d6 100644 --- a/i18n/po/i18n_nl.po +++ b/i18n/po/i18n_nl.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-17 15:14+0200\n" +"POT-Creation-Date: 2026-03-26 09:39+0100\n" "PO-Revision-Date: \n" "Last-Translator: Pieter Bos \n" "Language-Team: \n" @@ -190,7 +190,7 @@ msgstr "Code {0} van de C_TERMINOLOGY_CODE heeft specialization depth {1}, maar msgid "Code {0} from the C_TERMINOLOGY_CODE constraint is not defined in the terminology" msgstr "Code {0} van deze C_TERMINOLOGY_CODE bestaat niet in de terminology" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:164 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:168 #, java-format msgid "Code {0} is in the terminology, but not used in the archetype" msgstr "Code {0} uit de terminologie is niet gebruikt in de definitie van het archetype" @@ -321,7 +321,7 @@ msgstr "De specialization depth van node id {0} klopt niet bij de specialization msgid "Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4" msgstr "Node id nummers moeten uniek zijn zonder hun ac, at of id-prefix, om conversie van het archetype naar ADL 1.4 mogelijk te maken" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:178 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:182 #, java-format msgid "Node id {0} already used in archetype as {1} with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4" msgstr "Node id {0} wordt al gebruikt in het archetype als {1} met een andere at, id of ac prefix. Het archetype kan niet naar ADL 1.4 geconverteerd worden" @@ -1259,13 +1259,13 @@ msgstr "" msgid "value code validity. Each value code (at-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the flattened form of the current archetype." msgstr "Geldigheid van een value code. Elke value code (at-code) gebruikt in een term constraint in de definitie van het archetype moet in de term definities van de flat form van dit archetype opgenomen zijn." -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:143 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:147 #, java-format msgid "value code {0} is used in redefined value set {1}, but not present in its parent value set with members {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:121 #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:125 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:129 #, java-format msgid "value code {0} is used in value set {1}, but not present in terminology" msgstr "de code {0} is gebruikt in value set {1}, maar bestaat niet in de terminologie" @@ -1274,18 +1274,22 @@ msgstr "de code {0} is gebruikt in value set {1}, maar bestaat niet in de termin msgid "value set assumed value code validity. Each value code (at-code) used as an assumed_value for a value set in a term constraint in the archetype definition must exist in the value set definition in the terminology for the identified value set." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:110 #, java-format msgid "value set code {0} is not present in terminology" msgstr "de code {0} van een value set bestaat niet in de terminologie" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:112 #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:116 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:120 #, java-format msgid "value set code {0} is used in value set {1}, but not present in terminology" msgstr "de value set code {0} is gebruikt in value set {1}, maar bestaat niet in de terminologie" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:138 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 +msgid "value set does not contain a set Id value" +msgstr "" + +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:142 #, java-format msgid "value set {0} has a specialized code, but the valueset it specialized cannot be found in the flat parent" msgstr "" diff --git a/i18n/po/keys.pot b/i18n/po/keys.pot index 5ca873152..b00001d2e 100644 --- a/i18n/po/keys.pot +++ b/i18n/po/keys.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-17 15:14+0200\n" +"POT-Creation-Date: 2026-03-26 09:39+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -195,7 +195,7 @@ msgstr "" msgid "Code {0} from the C_TERMINOLOGY_CODE constraint is not defined in the terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:164 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:168 #, java-format msgid "Code {0} is in the terminology, but not used in the archetype" msgstr "" @@ -326,7 +326,7 @@ msgstr "" msgid "Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:178 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:182 #, java-format msgid "Node id {0} already used in archetype as {1} with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4" msgstr "" @@ -1264,13 +1264,13 @@ msgstr "" msgid "value code validity. Each value code (at-code) used in a term constraint in the archetype definition must be defined in the term_definitions part of the terminology of the flattened form of the current archetype." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:143 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:147 #, java-format msgid "value code {0} is used in redefined value set {1}, but not present in its parent value set with members {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:121 #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:125 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:129 #, java-format msgid "value code {0} is used in value set {1}, but not present in terminology" msgstr "" @@ -1279,18 +1279,22 @@ msgstr "" msgid "value set assumed value code validity. Each value code (at-code) used as an assumed_value for a value set in a term constraint in the archetype definition must exist in the value set definition in the terminology for the identified value set." msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:110 #, java-format msgid "value set code {0} is not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:112 #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:116 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:120 #, java-format msgid "value set code {0} is used in value set {1}, but not present in terminology" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:138 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:106 +msgid "value set does not contain a set Id value" +msgstr "" + +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java:142 #, java-format msgid "value set {0} has a specialized code, but the valueset it specialized cannot be found in the flat parent" msgstr "" diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java index 35bddbcd5..f5498cfff 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java @@ -102,6 +102,10 @@ private void validateValueSets() { ArchetypeTerminology terminology = archetype.getTerminology(); int terminologySpecialisationDepth = terminology.specialisationDepth(); for(ValueSet valueSet:terminology.getValueSets().values()){ + if(valueSet.getId() == null) { + addMessage(ErrorType.OTHER, I18n.t("value set does not contain a set Id value")); + continue; + } if(!terminology.hasValueSetCode(valueSet.getId())) { addMessage(ErrorType.VTVSID, I18n.t("value set code {0} is not present in terminology", valueSet.getId())); } diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java index f55fbe8f1..d86c27ebc 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/TermCodeSpecializationTest.java @@ -14,6 +14,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.LinkedHashSet; +import java.util.Objects; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.*; @@ -52,6 +53,19 @@ public void invalidRequiredBindingStrength() throws Exception { assertTrue(validationResult.getErrors().stream().filter(e -> e.getType() == ErrorType.VPOV).findFirst().isPresent(), "VPOV error should be present"); } + @Test + public void invalidValueSetWithoutId() throws Exception { + Archetype parent = TestUtil.parseFailOnErrors("/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.constraint_strength_parent.v1.0.0.adls"); + Archetype child = TestUtil.parseFailOnErrors("/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0.adls"); + InMemoryFullArchetypeRepository repo = new InMemoryFullArchetypeRepository(); + repo.addArchetype(parent); + repo.addArchetype(child); + ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); + repo.compile(archetypeValidator); + ValidationResult validationResult = repo.getValidationResult("openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0"); + assertTrue(validationResult.getErrors().stream().anyMatch(e -> e.getType() == ErrorType.OTHER && Objects.equals(e.getMessage(), "value set does not contain a set Id value"))); + } + @Test public void invalidConstraintStrengthRedefinition() throws Exception { Archetype parent = TestUtil.parseFailOnErrors("/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.constraint_strength_parent.v1.0.0.adls"); diff --git a/tools/src/test/resources/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0.adls b/tools/src/test/resources/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0.adls new file mode 100644 index 000000000..68a7fae55 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/archetypevalidator/primitives/openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0.adls @@ -0,0 +1,68 @@ +archetype (adl_version=2.0.7; rm_release=1.0.2) + openEHR-EHR-CLUSTER.incorrect_child_valueset_id_null.v1.0.0 + +specialise + openEHR-EHR-CLUSTER.constraint_strength_parent.v1.0.0 + +language + original_language = <[ISO_639-1::en]> + +description + original_author = < + ["name"] = <"Pieter Bos"> + > + details = < + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"Test a valid constraint strength child"> + keywords = <"ADL", "validation", "test"> + copyright = <"copyright (c) 2008 The openEHR Foundation"> + > + > + other_details = < + ["regression"] = <"PASS"> + > + lifecycle_state = <"unmanaged"> + +definition + CLUSTER[id1.1] matches { + /items[id2]/value[id3]/defining_code matches {[ac1.1]} -- required + /items[id4]/value[id5]/defining_code matches {[ac0.2]} -- extensible + /items[id6]/value[id7]/defining_code matches {[ac0.2]} -- preferred + /items[id8]/value[id9]/defining_code matches {[ac0.2]} -- example + } + +terminology + term_definitions = < + ["en"] = < + ["id1.1"] = < + text = <"root node"> + description = <"root node"> + > + ["ac1.1"] = < + text = <"extended value set 1"> + description = <"extended value set 1"> + > + ["ac0.2"] = < + text = <"extended value set 2"> + description = <"extended value set 2"> + > + ["at0.1"] = < + text = <"value 4"> + description = <"value 4"> + > + ["at2.1"] = < + text = <"value 2 specialized"> + description = <"value 2 specialized"> + > + > + > + value_sets = < + ["ac1.1"] = < + id=<"ac1.1"> + members = <"at1", "at2.1"> + > + ["ac0.2"] = < + members = <"ac1", "at0.1"> + > + > \ No newline at end of file From 634117c3f6c07b09778bfd33d0e441f0fa0ad4ff Mon Sep 17 00:00:00 2001 From: Eline Brader <73945320+EBrader@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:22:56 +0200 Subject: [PATCH 41/60] Validate the type of default values in archetypes (#767) * Validate default value types * Run translations * Improve tests * Change code more explicit --- .../archie/archetypevalidator/ErrorType.java | 3 +- i18n/po/i18n_en.po | 31 ++++++--- i18n/po/i18n_nl.po | 30 +++++--- i18n/po/keys.pot | 31 ++++++--- .../ValidateAgainstReferenceModel.java | 19 ++++++ .../ArchetypeValidatorTest.java | 34 +++++++++- ...CLUSTER.default_values_invalid.v0.0.0.adls | 68 +++++++++++++++++++ 7 files changed, 180 insertions(+), 36 deletions(-) create mode 100644 tools/src/test/resources/com/nedap/archie/archetypevalidator/openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0.adls diff --git a/aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java b/aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java index d5c3e3e0a..39144caa9 100644 --- a/aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java +++ b/aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java @@ -85,7 +85,8 @@ public enum ErrorType implements MessageCode { VALUESET_REDEFINITION_ERROR(I18n.register("A redefined value set can only be a subset of its parent value set, nothing can be added")), OVERLAY_VALIDATION_FAILED(I18n.register("The validation of a template overlay failed")), PARENT_VALIDATION_FAILED(I18n.register("The validation of the parent archetype failed")), - ADL14_INCOMPATIBLE_NODE_IDS(I18n.register("Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4")); + ADL14_INCOMPATIBLE_NODE_IDS(I18n.register("Node id numbers should be unique without their ac, at or id-prefix, to ensure the possibility of converting the archetype to ADL 1.4")), + DEFAULT_OBJECT_TYPE_VALIDITY(I18n.register("object constraint default value type validity: the type of the default value of an object constraint must conform to the type of the constraint")); private final String description; diff --git a/i18n/po/i18n_en.po b/i18n/po/i18n_en.po index def9ae3a4..c1c6fcdef 100644 --- a/i18n/po/i18n_en.po +++ b/i18n/po/i18n_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-26 09:39+0100\n" +"POT-Creation-Date: 2026-03-30 14:54+0200\n" "PO-Revision-Date: \n" "Last-Translator: Pieter Bos \n" "Language-Team: \n" @@ -136,13 +136,13 @@ msgstr "" msgid "Attribute {0} of class {1} does not match existence {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:63 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:75 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:82 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:94 #, java-format msgid "Attribute {0}.{1} cannot be constrained by a {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:41 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:60 #, java-format msgid "Attribute {0}.{1} cannot contain type {2}" msgstr "" @@ -205,6 +205,11 @@ msgstr "" msgid "Could not find parent object for {0} but it should have been prechecked. Could you report this as a bug?" msgstr "" +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:40 +#, java-format +msgid "Default value of type {0} does not conform to constraint type {1}" +msgstr "" + #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java:67 #, java-format msgid "Differential path must point to a C_ATTRIBUTE in the flat parent, but it pointed instead to a {0}" @@ -687,7 +692,7 @@ msgstr "" msgid "Sibling order {0} refers to missing node id" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:144 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:163 msgid "Single valued attributes can not have a cardinality" msgstr "" @@ -761,12 +766,12 @@ msgstr "" msgid "The attribute {0} of type {1} can only have a single value, but the occurrences of the C_OBJECTS below has an upper limit of more than 1" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:147 #, java-format msgid "The cardinality of Attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict multiplicities validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:155 #, java-format msgid "The cardinality {0} of attribute {2}.{3} does not match cardinality {1} of the reference model" msgstr "" @@ -786,12 +791,12 @@ msgstr "" msgid "The constraint interval for this {0} has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:109 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 #, java-format msgid "The existence of attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict existence validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:117 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 #, java-format msgid "The existence {0} of attribute {2}.{3} does not match existence {1} of the reference model" msgstr "" @@ -885,7 +890,7 @@ msgstr "" msgid "Tuple member attribute {0} is not an attribute of type {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:28 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:47 #, java-format msgid "Type name {0} does not exist" msgstr "" @@ -1115,6 +1120,10 @@ msgstr "" msgid "node id must be defined in flat terminology" msgstr "" +#: ../aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java:89 +msgid "object constraint default value type validity: the type of the default value of an object constraint must conform to the type of the constraint" +msgstr "" + #: ../aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java:12 msgid "object constraint type name existence: a type name introducing an object constraint block must be defined in the underlying information model" msgstr "" @@ -1311,7 +1320,7 @@ msgstr "" msgid "{0} and {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:99 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:118 #, java-format msgid "{0} is not a known attribute of {1}" msgstr "" diff --git a/i18n/po/i18n_nl.po b/i18n/po/i18n_nl.po index d35ecf5d6..f9c9e89b2 100644 --- a/i18n/po/i18n_nl.po +++ b/i18n/po/i18n_nl.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-26 09:39+0100\n" +"POT-Creation-Date: 2026-03-30 14:54+0200\n" "PO-Revision-Date: \n" "Last-Translator: Pieter Bos \n" "Language-Team: \n" @@ -136,13 +136,13 @@ msgstr "Attribuut {0} is geen tuple in het archetype dat gespecializeerd wordt, msgid "Attribute {0} of class {1} does not match existence {2}" msgstr "Attribuut {0} van class {1} komt niet overeen met existence {2}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:63 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:75 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:82 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:94 #, java-format msgid "Attribute {0}.{1} cannot be constrained by a {2}" msgstr "Attribuut {0}.{1} kan niet worden beperkt met een {2}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:41 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:60 #, java-format msgid "Attribute {0}.{1} cannot contain type {2}" msgstr "Attribuut {0}.{1} mag geen type {2} bevatten" @@ -205,6 +205,10 @@ msgstr "" msgid "Could not find parent object for {0} but it should have been prechecked. Could you report this as a bug?" msgstr "Kan parent object voor {0} niet vinden. Deze melding is waarschijnlijk een bug, zou u dat kunnen melden?" +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:40 +msgid "Default value of type {0} does not conform to constraint type {1}" +msgstr "Default waarde van type {0} komt niet overeen met constraint type {1}" + #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java:67 #, java-format msgid "Differential path must point to a C_ATTRIBUTE in the flat parent, but it pointed instead to a {0}" @@ -687,7 +691,7 @@ msgstr "" msgid "Sibling order {0} refers to missing node id" msgstr "Sibling order {0} verwijst naar een ontbrekende node id" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:144 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:163 msgid "Single valued attributes can not have a cardinality" msgstr "Attributen die maar één waarde kunnen bevatten mogen geen cardinaliteit hebben" @@ -761,12 +765,12 @@ msgstr "Het attribuut bevat {0} waarden die verplicht zijn, maar heeft een maxim msgid "The attribute {0} of type {1} can only have a single value, but the occurrences of the C_OBJECTS below has an upper limit of more than 1" msgstr "Het attribuut {0} van type {1} kan maar één waarde hebben, maar de occurrences van de C_OBJECTS in dit attibuut heeft een maximale limiet van meer dan 1" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:147 #, java-format msgid "The cardinality of Attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict multiplicities validation being enabled" msgstr "De cardinaliteit van attribuut {0}.{1} is hetzelfde als in het referentiemodel. Dit is niet toegestaan als strikte validatie is ingeschakeld" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:155 #, java-format msgid "The cardinality {0} of attribute {2}.{3} does not match cardinality {1} of the reference model" msgstr "De cardinaliteit {0} van attribuut {2}.{3} klopt niet met de cardinaliteit {1} uit het referentiemodel" @@ -786,12 +790,12 @@ msgstr "" msgid "The constraint interval for this {0} has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:109 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 #, java-format msgid "The existence of attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict existence validation being enabled" msgstr "De existence van attribuut {0}.{1} is hetzelfde als in het referentiemodel. Dit is niet toegestaan als strikte validatie ingeschakeld is" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:117 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 #, java-format msgid "The existence {0} of attribute {2}.{3} does not match existence {1} of the reference model" msgstr "De existence {0} van attribuut {2}.{3} klopt niet bij existence {1} van het referentiemodel" @@ -885,7 +889,7 @@ msgstr "De beschrijving van de vertaling {0} zou een gelijke sleutelwaarde als d msgid "Tuple member attribute {0} is not an attribute of type {1}" msgstr "Onderdeel van tupel {0} is geen attribuut van type {1}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:28 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:47 #, java-format msgid "Type name {0} does not exist" msgstr "Type met naam {0} bestaat niet" @@ -1115,6 +1119,10 @@ msgstr "kleiner dan {0}" msgid "node id must be defined in flat terminology" msgstr "node id ontbreekt in de flat terminologie" +#: ../aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java:89 +msgid "object constraint default value type validity: the type of the default value of an object constraint must conform to the type of the constraint" +msgstr "Object constraint default waarde type validiteit: het type van de default waarde van een object constraint moet conformen met het type van de constraint" + #: ../aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java:12 msgid "object constraint type name existence: a type name introducing an object constraint block must be defined in the underlying information model" msgstr "" @@ -1311,7 +1319,7 @@ msgstr "value-set waardes uniek. Elke waarde mag maar één keer gebruikt worden msgid "{0} and {1}" msgstr "{0} en {1}" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:99 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:118 #, java-format msgid "{0} is not a known attribute of {1}" msgstr "{0} is niet een bekend attribuut van {1}" diff --git a/i18n/po/keys.pot b/i18n/po/keys.pot index b00001d2e..458fdb065 100644 --- a/i18n/po/keys.pot +++ b/i18n/po/keys.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-26 09:39+0100\n" +"POT-Creation-Date: 2026-03-30 14:54+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,13 +141,13 @@ msgstr "" msgid "Attribute {0} of class {1} does not match existence {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:63 -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:75 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:82 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:94 #, java-format msgid "Attribute {0}.{1} cannot be constrained by a {2}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:41 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:60 #, java-format msgid "Attribute {0}.{1} cannot contain type {2}" msgstr "" @@ -210,6 +210,11 @@ msgstr "" msgid "Could not find parent object for {0} but it should have been prechecked. Could you report this as a bug?" msgstr "" +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:40 +#, java-format +msgid "Default value of type {0} does not conform to constraint type {1}" +msgstr "" + #: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/DefinitionStructureValidation.java:67 #, java-format msgid "Differential path must point to a C_ATTRIBUTE in the flat parent, but it pointed instead to a {0}" @@ -692,7 +697,7 @@ msgstr "" msgid "Sibling order {0} refers to missing node id" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:144 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:163 msgid "Single valued attributes can not have a cardinality" msgstr "" @@ -766,12 +771,12 @@ msgstr "" msgid "The attribute {0} of type {1} can only have a single value, but the occurrences of the C_OBJECTS below has an upper limit of more than 1" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:147 #, java-format msgid "The cardinality of Attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict multiplicities validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:155 #, java-format msgid "The cardinality {0} of attribute {2}.{3} does not match cardinality {1} of the reference model" msgstr "" @@ -791,12 +796,12 @@ msgstr "" msgid "The constraint interval for this {0} has lower > upper, this is not allowed" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:109 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:128 #, java-format msgid "The existence of attribute {0}.{1} is the same as in the reference model - this is not allowed due to strict existence validation being enabled" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:117 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:136 #, java-format msgid "The existence {0} of attribute {2}.{3} does not match existence {1} of the reference model" msgstr "" @@ -890,7 +895,7 @@ msgstr "" msgid "Tuple member attribute {0} is not an attribute of type {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:28 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:47 #, java-format msgid "Type name {0} does not exist" msgstr "" @@ -1120,6 +1125,10 @@ msgstr "" msgid "node id must be defined in flat terminology" msgstr "" +#: ../aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java:89 +msgid "object constraint default value type validity: the type of the default value of an object constraint must conform to the type of the constraint" +msgstr "" + #: ../aom/src/main/java/com/nedap/archie/archetypevalidator/ErrorType.java:12 msgid "object constraint type name existence: a type name introducing an object constraint block must be defined in the underlying information model" msgstr "" @@ -1316,7 +1325,7 @@ msgstr "" msgid "{0} and {1}" msgstr "" -#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:99 +#: ../tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java:118 #, java-format msgid "{0} is not a known attribute of {1}" msgstr "" diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java index 205abf1cc..04ca763a0 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/ValidateAgainstReferenceModel.java @@ -5,6 +5,8 @@ import com.nedap.archie.aom.utils.AOMUtils; import com.nedap.archie.archetypevalidator.ErrorType; import com.nedap.archie.archetypevalidator.ValidatingVisitor; +import com.nedap.archie.base.OpenEHRBase; +import com.nedap.archie.rminfo.RMTypeInfo; import org.openehr.utils.message.I18n; /** @@ -21,6 +23,23 @@ public ValidateAgainstReferenceModel() { @Override protected void validate(CComplexObject cObject) { validateTypes(cObject); + validateDefaultValueType(cObject); + } + + private void validateDefaultValueType(CComplexObject cObject) { + OpenEHRBase defaultValue = cObject.getDefaultValue(); + RMTypeInfo typeInfo; + if (defaultValue == null || defaultValue instanceof DefaultValueContainer || metaModel.getModelInfoLookup() == null || + (typeInfo = metaModel.getModelInfoLookup().getTypeInfo(defaultValue.getClass())) == null) { + return; + } + + String defaultValueTypeName = typeInfo.getRmName(); + if (!metaModel.rmTypesConformant(defaultValueTypeName, cObject.getRmTypeName())) { + addMessageWithPath(ErrorType.DEFAULT_OBJECT_TYPE_VALIDITY, cObject.getPath(), + I18n.t("Default value of type {0} does not conform to constraint type {1}", + defaultValueTypeName, cObject.getRmTypeName())); + } } private void validateTypes(CObject cObject) { diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java index 2f5950087..4ad9d5624 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java @@ -6,6 +6,7 @@ import com.nedap.archie.flattener.InMemoryFullArchetypeRepository; import com.nedap.archie.openehrtestrm.TestRMInfoLookup; import com.nedap.archie.rminfo.ArchieRMInfoLookup; +import com.nedap.archie.rminfo.MetaModelProvider; import com.nedap.archie.rminfo.ReferenceModels; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -22,14 +23,12 @@ */ public class ArchetypeValidatorTest { - private ADLParser parser; private Archetype archetype; private ReferenceModels models; @BeforeEach public void setup() { - parser = new ADLParser(); models = new ReferenceModels(); models.registerModel(ArchieRMInfoLookup.getInstance()); models.registerModel(TestRMInfoLookup.getInstance()); @@ -341,7 +340,38 @@ public void incompatibleNodeIdValidationTest() throws IOException, ADLParseExcep } } + @Test + public void defaultValueTypeNoConform() throws Exception { + archetype = parse("openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0.adls"); + + // Validation when model provided + ValidationResult validationResult = new ArchetypeValidator(models).validate(archetype); + assertOneError(validationResult, ErrorType.DEFAULT_OBJECT_TYPE_VALIDITY); + } + + @Test + public void defaultValueTypeNoConformNoModel() throws Exception { + archetype = parse("openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0.adls", null); + + // No validation when no model provided + ValidationResult validationResult = new ArchetypeValidator(models).validate(archetype); + assertTrue(validationResult.passes(), validationResult.toString()); + } + + @Test + public void defaultValueTypeInheritConforms() throws Exception { + archetype = parse("../serializer/adl/openEHR-EHR-CLUSTER.default_values.v1.adls"); + + ValidationResult validationResult = new ArchetypeValidator(models).validate(archetype); + assertTrue(validationResult.passes(), validationResult.toString()); + } + private Archetype parse(String filename) throws IOException, ADLParseException { + return parse(filename, BuiltinReferenceModels.getMetaModelProvider()); + } + + private Archetype parse(String filename, MetaModelProvider metaModelProvider) throws IOException, ADLParseException { + ADLParser parser = new ADLParser(metaModelProvider); archetype = parser.parse(ArchetypeValidatorTest.class.getResourceAsStream(filename)); assertThat(parser.getErrors().toString(), parser.getErrors().hasNoErrors()); return archetype; diff --git a/tools/src/test/resources/com/nedap/archie/archetypevalidator/openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0.adls b/tools/src/test/resources/com/nedap/archie/archetypevalidator/openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0.adls new file mode 100644 index 000000000..18d0f47c0 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/archetypevalidator/openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0.adls @@ -0,0 +1,68 @@ +archetype (adl_version=2.0.5; rm_release=1.0.2) + openEHR-EHR-CLUSTER.default_values_invalid.v0.0.0 + +language + original_language = <[ISO_639-1::en]> + +description + original_author = < + ["name"] = <"Jelte Zeilstra"> + ["organisation"] = <"Nedap "> + > + details = < + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"A very simple cluster archetype for testing invalid default values"> + > + > + +definition + CLUSTER[id1] matches { -- Prescription + items matches { + ELEMENT[id2] matches { + value matches { + DV_TEXT[id21] matches { + _default = (DV_TEXT) < + value = <"Some default valid value"> + > + } + } + } + ELEMENT[id3] matches { + value matches { + DV_CODED_TEXT[id31] matches { + _default = (json) <# + { + "_type" : "DV_TEXT", + "value" : "Some default invalid value" + } + #> + } + } + } + } + _default = (someotherformat) <# + This is some other format which cannot be parsed. +The indentation of + this format + shouldn't be changed by the serializer. + #> + } + +terminology + term_definitions = < + ["en"] = < + ["id1"] = < + text = <"Prescription"> + description = <"A document authorising supply and administration of one or more medicines, vaccines or other therapeutic goods (as a collection of medication instrations) to be communicated to a dispensing or administration provider."> + > + ["id2"] = < + text = <"dv text"> + description = <"dv text"> + > + ["id3"] = < + text = <"dv coded text"> + description = <"dv coded text"> + > + > + > From 9316d838cb11e1a248ac664b7b0834990305d98e Mon Sep 17 00:00:00 2001 From: JoshuaForssmanNedap Date: Mon, 13 Apr 2026 10:15:08 +0200 Subject: [PATCH 42/60] Refactor validation tests to correct expected error counts and messages for duplicate node IDs (#768) --- .../validations/BasicTerminologyValidation.java | 3 ++- .../archie/archetypevalidator/ArchetypeValidatorTest.java | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java index f5498cfff..c1b809495 100644 --- a/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java +++ b/tools/src/main/java/com/nedap/archie/archetypevalidator/validations/BasicTerminologyValidation.java @@ -7,6 +7,7 @@ import com.nedap.archie.aom.utils.CodeRedefinitionStatus; import com.nedap.archie.archetypevalidator.ArchetypeValidationBase; import com.nedap.archie.archetypevalidator.ErrorType; +import com.nedap.archie.definitions.AdlCodeDefinitions; import com.nedap.archie.query.AOMPathQuery; import org.openehr.utils.message.I18n; @@ -174,7 +175,7 @@ private void warnAboutUnusedValues() { private void warnAboutDuplicateNodeIdsWithoutPrefix() { Map usedCodesMap = new HashMap<>(); for (String usedCode : archetype.getAllUsedCodes()) { - if (archetype.specializationDepth() == AOMUtils.getSpecializationDepthFromCode(usedCode)) { + if ((archetype.specializationDepth() == AOMUtils.getSpecializationDepthFromCode(usedCode)) && !usedCode.startsWith(AdlCodeDefinitions.VALUE_SET_CODE_LEADER)) { String usedCodeWithoutPrefix = AOMUtils.stripPrefix(usedCode); if (usedCodesMap.get(usedCodeWithoutPrefix) != null) { addWarningWithPath(ErrorType.ADL14_INCOMPATIBLE_NODE_IDS, diff --git a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java index 4ad9d5624..81a5dabb0 100644 --- a/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java +++ b/tools/src/test/java/com/nedap/archie/archetypevalidator/ArchetypeValidatorTest.java @@ -330,13 +330,11 @@ public void incompatibleNodeIdValidationTest() throws IOException, ADLParseExcep ArchetypeValidator archetypeValidator = new ArchetypeValidator(BuiltinReferenceModels.getMetaModelProvider()); ValidationResult result = archetypeValidator.validate(archetypeWithIncompatibleNodeId, repository); assertTrue(result.passes()); - assertEquals(6, result.getErrors().size()); + assertEquals(4, result.getErrors().size()); assertEquals("Node id at12 already used in archetype as id12 with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4", result.getErrors().get(0).getMessage()); assertEquals("Node id at2 already used in archetype as id2 with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4", result.getErrors().get(1).getMessage()); assertEquals("Node id at3 already used in archetype as id3 with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4", result.getErrors().get(2).getMessage()); assertEquals("Node id at4 already used in archetype as id4 with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4", result.getErrors().get(3).getMessage()); - assertEquals("Node id ac4 already used in archetype as at4 with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4", result.getErrors().get(4).getMessage()); - assertEquals("Node id ac12 already used in archetype as at12 with a different at, id or ac prefix. The archetype will not be convertible to ADL 1.4", result.getErrors().get(5).getMessage()); } } From 5e40c71b8f5a5bc8008d4f18553c677cdd3ed674 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:59:37 +0200 Subject: [PATCH 43/60] Bump org.hamcrest:hamcrest from 2.2 to 3.0 (#750) Bumps [org.hamcrest:hamcrest](https://github.com/hamcrest/JavaHamcrest) from 2.2 to 3.0. - [Release notes](https://github.com/hamcrest/JavaHamcrest/releases) - [Changelog](https://github.com/hamcrest/JavaHamcrest/blob/master/CHANGES.md) - [Commits](https://github.com/hamcrest/JavaHamcrest/compare/v2.2...v3.0) --- updated-dependencies: - dependency-name: org.hamcrest:hamcrest dependency-version: '3.0' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 21dbe7815..f7b1666e7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -42,7 +42,7 @@ jaxb-impl = { module = "com.sun.xml.bind:jaxb-impl", version = "2.3.9" } junit5-jupiter = { module = "org.junit.jupiter:junit-jupiter-api", version = "5.14.3" } junit5-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version = "5.14.3" } junit5-platform-launcher = { module = "org.junit.platform:junit-platform-launcher"} -hamcrest = { module = "org.hamcrest:hamcrest", version = "2.2" } +hamcrest = { module = "org.hamcrest:hamcrest", version = "3.0" } kryo = { module = "com.esotericsoftware.kryo:kryo5", version = "5.6.2" } From b3802be967d7d1dd4b5c0d0b222e3f54bcd3ddcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:58:08 +0200 Subject: [PATCH 44/60] Bump jackson from 2.21.0 to 2.21.2 (#765) Bumps `jackson` from 2.21.0 to 2.21.2. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.0 to 2.21.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.21.0 to 2.21.2 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.21.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f7b1666e7..64555281f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] antlr = "4.13.2" -jackson = "2.21.0" +jackson = "2.21.2" jackson_annotations = "2.21" slf4j = "1.7.36" From f5a5c22461a2984a344cb24158196e96c6916911 Mon Sep 17 00:00:00 2001 From: Jelte Zeilstra Date: Thu, 16 Apr 2026 10:20:46 +0200 Subject: [PATCH 45/60] Retain term definitions order in ADL1.4 converter (#769) --- .../archie/adl14/ADL14NodeIDConverter.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java b/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java index aa06afe1a..49b95c19b 100644 --- a/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java +++ b/aom/src/main/java/com/nedap/archie/adl14/ADL14NodeIDConverter.java @@ -152,29 +152,32 @@ private List findUnnecessaryCodes(CObject cObject, Map convertedCodes, List unnecessaryCodes) { - //process the codes in alphabetical order, high to low, to prevent overwriting codes - //even better would probably be to create an empty terminology and separate all new+converted codes and old codes - //instead of doing this in place. Worth a refactor perhaps? - ArrayList sortedCodes = new ArrayList<>(convertedCodes.values()); - Comparator comparator = Comparator.comparing(ConvertedCodeResult::getOriginalCode); - sortedCodes.sort(comparator.reversed()); - - for (ConvertedCodeResult convertedCode : sortedCodes) { - for (String language : archetype.getTerminology().getTermDefinitions().keySet()) { - Map terms = archetype.getTerminology().getTermDefinitions().get(language); - ArchetypeTerm term = terms.remove(convertedCode.getOriginalCode()); - if (term != null && !unnecessaryCodes.contains(convertedCode.getOriginalCode())) { - for (String newCode : convertedCode.getConvertedCodes()) { - ArchetypeTerm newTerm = new ArchetypeTerm(); - newTerm.setCode(newCode); - newTerm.setText(term.getText()); - newTerm.setDescription(term.getDescription()); - newTerm.putAll(term.getOtherItems()); - terms.put(newCode, term); + archetype.getTerminology().getTermDefinitions().replaceAll((language, terms) -> { + Map newTerms = new LinkedHashMap<>(); + + for (Map.Entry entry : terms.entrySet()) { + String oldCode = entry.getKey(); + if (!unnecessaryCodes.contains(oldCode)) { + ArchetypeTerm term = entry.getValue(); + ConvertedCodeResult convertedCode = convertedCodes.get(oldCode); + if (convertedCode != null) { + for (String newCode : convertedCode.getConvertedCodes()) { + ArchetypeTerm newTerm = new ArchetypeTerm(); + newTerm.setCode(newCode); + newTerm.setText(term.getText()); + newTerm.setDescription(term.getDescription()); + newTerm.putAll(term.getOtherItems()); + newTerms.put(newCode, newTerm); + } + } else { + // Code is not converted, copy it. + newTerms.put(oldCode, term); } } } - } + + return newTerms; + }); //the terminology can still contain old unused codes now. The archetype validation will warn about that later } From 699bcb1e124a0b34a2cd44e75fcab5faceea1c7c Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Thu, 23 Apr 2026 16:09:36 +0700 Subject: [PATCH 46/60] Add tests to check if forwards compatible (#773) --- .../java/com/nedap/archie/json/AOMJacksonTest.java | 13 +++++++++++++ .../test/java/com/nedap/archie/xml/JAXBAOMTest.java | 1 + 2 files changed, 14 insertions(+) diff --git a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java index 877e170ef..0f083ae26 100644 --- a/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java +++ b/tools/src/test/java/com/nedap/archie/json/AOMJacksonTest.java @@ -276,11 +276,24 @@ public void cTerminologyCode() throws Exception { String json = objectMapper.writeValueAsString(cTermCode); assertTrue(json.contains("\"constraint_status\" : \"preferred\"")); + assertTrue(json.contains("\"constraint\" : [ \"ac23\" ]")); CTerminologyCode parsedTermCode = objectMapper.readValue(json, CTerminologyCode.class); assertEquals(cTermCode.getConstraint(), parsedTermCode.getConstraint()); assertEquals(ConstraintStatus.PREFERRED, parsedTermCode.getConstraintStatus()); } + @Test + public void forwardsCompatibilityCTerminologyCodeConstraintTypeFromJsonTest() throws Exception { + String json = "{\n" + + " \"rm_type_name\" : \"terminology_code\",\n" + + " \"node_id\" : \"id9999\",\n" + + " \"constraint\" : \"ac23\"\n" + + "}"; + ObjectMapper objectMapper = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createStandardsCompliant()); + CTerminologyCode parsedTermCode = objectMapper.readValue(json, CTerminologyCode.class); + assertEquals("ac23", parsedTermCode.getConstraint().get(0)); + } + @Test public void rmOverlay() throws Exception { Archetype archetype = TestUtil.parseFailOnErrors("/com/nedap/archie/flattener/openEHR-EHR-OBSERVATION.to_flatten_parent_with_overlay.v1.0.0.adls"); diff --git a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java index e84d668bb..c7645f609 100644 --- a/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java +++ b/tools/src/test/java/com/nedap/archie/xml/JAXBAOMTest.java @@ -81,6 +81,7 @@ public void testCTerminologyCode() throws Exception { String xml = writer.toString(); assertThat(xml, xml.contains("preferred")); + assertThat(xml, xml.contains("ac23")); Unmarshaller unmarshaller = JAXBUtil.getArchieJAXBContext().createUnmarshaller(); Archetype unmarshalled = (Archetype) unmarshaller.unmarshal(new StringReader(xml)); From 73f95103e3e8446470077deb8f8308ee886a803a Mon Sep 17 00:00:00 2001 From: Vera Prinsen <33416829+VeraPrinsen@users.noreply.github.com> Date: Fri, 8 May 2026 08:00:23 +0200 Subject: [PATCH 47/60] Change RmTypeName of CTerminologyCode to code_phrase (#774) * Change RmTypeName of CTerminologyCode to code_phrase * Update CTerminologyCode.java * Update CTerminologyCode.java * Return rmTypeName of CTerminologyCode dependent on the parent * Add null check * Add null check * remove unused file * Requested Changes * remove gson dependency --- aom/build.gradle | 2 + .../aom/primitives/CTerminologyCode.java | 14 +++ .../nedap/archie/aom/ArchetypeJsonTest.java | 44 +++++++++ ...EHR-CLUSTER.c_terminology_code.v1.0.0.adls | 92 +++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 aom/src/test/java/com/nedap/archie/aom/ArchetypeJsonTest.java create mode 100644 aom/src/test/resources/com/nedap/archie/aom/openEHR-EHR-CLUSTER.c_terminology_code.v1.0.0.adls diff --git a/aom/build.gradle b/aom/build.gradle index 675fb909f..cbb057162 100644 --- a/aom/build.gradle +++ b/aom/build.gradle @@ -7,4 +7,6 @@ dependencies { api project(':utils') api project(':bmm') api project(':openehr-terminology') + + testImplementation project(':archie-utils') } diff --git a/aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java b/aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java index d52798671..4720e6e3e 100644 --- a/aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java +++ b/aom/src/main/java/com/nedap/archie/aom/primitives/CTerminologyCode.java @@ -299,4 +299,18 @@ public String toString() { return result.toString(); } + @Override + public String getRmTypeName() { + if (getParent() == null || getParent().getRmAttributeName() == null) { + return "terminology_code"; + } + switch (getParent().getRmAttributeName()) { + case "defining_code": + return "CODE_PHRASE"; + case "symbol": + return "DV_CODED_TEXT"; + default: + return "terminology_code"; + } + } } diff --git a/aom/src/test/java/com/nedap/archie/aom/ArchetypeJsonTest.java b/aom/src/test/java/com/nedap/archie/aom/ArchetypeJsonTest.java new file mode 100644 index 000000000..38ed9292a --- /dev/null +++ b/aom/src/test/java/com/nedap/archie/aom/ArchetypeJsonTest.java @@ -0,0 +1,44 @@ +package com.nedap.archie.aom; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.nedap.archie.adlparser.ADLParser; +import com.nedap.archie.json.ArchieJacksonConfiguration; +import com.nedap.archie.json.JacksonUtil; +import org.junit.jupiter.api.Test; + +import java.io.InputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ArchetypeJsonTest { + + @Test + public void testCTerminologyConstraint() throws Exception { + Archetype archetype; + try (InputStream stream = getClass().getResourceAsStream("openEHR-EHR-CLUSTER.c_terminology_code.v1.0.0.adls")) { + archetype = new ADLParser().parse(stream); + } + String json = JacksonUtil.getObjectMapper(ArchieJacksonConfiguration.createStandardsCompliant()).writeValueAsString(archetype); + + JsonNode objectNode = new ObjectMapper().readValue(json, JsonNode.class); + JsonNode elements = objectNode.get("definition").get("attributes").get(0).get("children"); + + assertRmTypeName("DV_CODED_TEXT", elements.get(0)); + assertRmTypeName("DV_ORDINAL", elements.get(1)); + assertRmTypeName("DV_SCALE", elements.get(2)); + } + + private void assertRmTypeName(String expectedDataValueRmTypeName, JsonNode element) { + JsonNode dataValue = element.get("attributes").get(0).get("children").get(0); + String dataValueRmTypeName = dataValue.get("rm_type_name").textValue(); // DV_CODED_TEXT, DV_ORDINAL or DV_SCALE + assertEquals(expectedDataValueRmTypeName, dataValueRmTypeName); + + JsonNode dataValueAttribute = dataValue.get("attributes").get(dataValueRmTypeName.equals("DV_CODED_TEXT") ? 0 : 1); + assertEquals(dataValueRmTypeName.equals("DV_CODED_TEXT") ? "defining_code" : "symbol", dataValueAttribute.get("rm_attribute_name").textValue()); + + JsonNode cTerminologyConstraint = dataValueAttribute.get("children").get(0); + assertEquals("C_TERMINOLOGY_CODE", cTerminologyConstraint.get("_type").textValue()); + assertEquals(dataValueRmTypeName.equals("DV_CODED_TEXT") ? "CODE_PHRASE" : "DV_CODED_TEXT", cTerminologyConstraint.get("rm_type_name").textValue()); + } +} diff --git a/aom/src/test/resources/com/nedap/archie/aom/openEHR-EHR-CLUSTER.c_terminology_code.v1.0.0.adls b/aom/src/test/resources/com/nedap/archie/aom/openEHR-EHR-CLUSTER.c_terminology_code.v1.0.0.adls new file mode 100644 index 000000000..cdbc2363d --- /dev/null +++ b/aom/src/test/resources/com/nedap/archie/aom/openEHR-EHR-CLUSTER.c_terminology_code.v1.0.0.adls @@ -0,0 +1,92 @@ +archetype (adl_version=2.0.5; rm_release=1.1.0) + openEHR-EHR-CLUSTER.c_terminology_code.v1.0.0 + +language + original_language = <[ISO_639-1::nl]> + +description + original_author = < + ["name"] = <"vera.prinsen"> + > + lifecycle_state = <"DRAFT"> + details = < + ["nl"] = < + language = <[ISO-639_1::nl]> + purpose = <""> + > + > + +definition + CLUSTER[id1] matches { -- CTerminologyCode + items matches { + ELEMENT[id5] occurrences matches {0..1} matches { -- DV_CODED_TEXT + value matches { + DV_CODED_TEXT[id6] matches { + defining_code matches {[ac2]} -- valueset + } + } + } + ELEMENT[id7] occurrences matches {0..1} matches { -- DV_ORDINAL + value matches { + DV_ORDINAL[id8] matches { + [value, symbol] matches { + [{0}, {[at3]}], -- term 1 + [{1}, {[at4]}] -- term 2 + } + } + } + } + ELEMENT[id9] occurrences matches {0..1} matches { -- DV_SCALE + value matches { + DV_SCALE[id10] matches { + [value, symbol] matches { + [{0.5}, {[at3]}], -- term 1 + [{1.5}, {[at4]}] -- term 2 + } + } + } + } + } + } + +terminology + term_definitions = < + ["nl"] = < + ["id1"] = < + text = <"CTerminologyCode"> + description = <""> + code = <"id1"> + > + ["ac2"] = < + text = <"valueset"> + description = <""> + > + ["at3"] = < + text = <"term 1"> + description = <""> + code = <""> + > + ["at4"] = < + text = <"term 2"> + description = <""> + > + ["id5"] = < + text = <"DV_CODED_TEXT"> + description = <""> + > + ["id7"] = < + text = <"DV_ORDINAL"> + description = <""> + > + ["id9"] = < + text = <"DV_SCALE"> + description = <""> + > + > + > + value_sets = < + ["ac2"] = < + id = <"ac2"> + members = <"at3", "at4"> + > + > From b2c11836da40772843175816e6e7ebdaf7618ef2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 13:34:24 +0200 Subject: [PATCH 48/60] Bump com.google.guava:guava from 33.5.0-jre to 33.6.0-jre (#771) Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.5.0-jre to 33.6.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-version: 33.6.0-jre dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 64555281f..99a5388ff 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,7 +25,7 @@ commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.20.0 commons-text = { module = "org.apache.commons:commons-text", version = "1.15.0" } -guava = { module = "com.google.guava:guava", version = "33.5.0-jre" } +guava = { module = "com.google.guava:guava", version = "33.6.0-jre" } jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson_annotations" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } From c5afa15166c5ad4f366b19f212b6a2329cab9951 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 13:34:26 +0200 Subject: [PATCH 49/60] Bump commons-io:commons-io from 2.21.0 to 2.22.0 (#775) Bumps commons-io:commons-io from 2.21.0 to 2.22.0. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-version: 2.22.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 99a5388ff..1dba93abb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,7 @@ activation = { module = "javax.activation:activation", version = "1.1.1" } antlr4 = { module = "org.antlr:antlr4", version.ref = "antlr" } antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" } -commons-io = { module = "commons-io:commons-io", version = "2.21.0" } +commons-io = { module = "commons-io:commons-io", version = "2.22.0" } commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.20.0" } From 043ae57c88a7e95dcda98382b862a4d1c0398a0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 13:34:27 +0200 Subject: [PATCH 50/60] Bump jackson from 2.21.2 to 2.21.3 (#777) Bumps `jackson` from 2.21.2 to 2.21.3. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.2 to 2.21.3 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.21.2 to 2.21.3 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.3 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.21.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1dba93abb..27fb5cc9b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] antlr = "4.13.2" -jackson = "2.21.2" +jackson = "2.21.3" jackson_annotations = "2.21" slf4j = "1.7.36" From 412c92d0bbbf76757c1fa48f4ac516587100fab2 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Wed, 20 May 2026 14:30:36 +0200 Subject: [PATCH 51/60] Update Archie to 3.18.0 (#782) --- README.md | 6 +++--- build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc694026a..9b49ee187 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can depend on parts of Archie, or the entire library at once. If you want th ```gradle dependencies { - compile 'com.nedap.healthcare.archie:archie-all:3.17.0' + compile 'com.nedap.healthcare.archie:archie-all:3.18.0' } ``` @@ -28,11 +28,11 @@ or if you use maven, in your pom.xml com.nedap.healthcare.archie archie-all - 3.17.0 + 3.18.0 ``` -If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.17.0 and com.nedap.healthcare.archie:referencemodels:3.17.0 instead +If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.18.0 and com.nedap.healthcare.archie:referencemodels:3.18.0 instead ## Build diff --git a/build.gradle b/build.gradle index 4cf7f6829..361fde8a4 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ repositories { allprojects { - version = '3.17.0' + version = '3.18.0' group = 'com.nedap.healthcare.archie' ext.gradleScriptDir = "${rootProject.projectDir}/gradle" //archivesBaseName = 'archie' From 4ccf2dcc6cc3a3d2ef8772064da68b310f2755ee Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Thu, 21 May 2026 11:40:23 +0200 Subject: [PATCH 52/60] Add release.yml (#783) --- .github/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..b42676a6f --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,11 @@ +changelog: + categories: + - title: Changes + labels: + - '*' + exclude: + labels: + - dependencies + - title: Dependencies + labels: + - dependencies \ No newline at end of file From 45861a6e038fd831fecd6faaff25f4f663bc9170 Mon Sep 17 00:00:00 2001 From: Eline Brader <73945320+EBrader@users.noreply.github.com> Date: Fri, 22 May 2026 14:57:50 +0200 Subject: [PATCH 53/60] Make sure the mappers are initialized once (#784) --- .../com/nedap/archie/rminfo/MetaModel.java | 53 ++++++++++----- .../nedap/archie/rminfo/MetaModelTest.java | 65 +++++++++++++++++++ 2 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 aom/src/test/java/com/nedap/archie/rminfo/MetaModelTest.java diff --git a/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java b/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java index d8277f198..f81cfb729 100644 --- a/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java +++ b/aom/src/main/java/com/nedap/archie/rminfo/MetaModel.java @@ -19,9 +19,10 @@ public class MetaModel implements MetaModelInterface { private final ModelInfoLookup modelInfoLookup; private final BmmModel bmmModel; private final AomProfile aomProfile; - private final ObjectMapper odinInputObjectMapper; - private final ObjectMapper odinOutputObjectMapper; - private final ObjectMapper jsonObjectMapper; + private final RMObjectMapperProvider objectMapperProvider; + private volatile ObjectMapper odinInputObjectMapper; + private volatile ObjectMapper odinOutputObjectMapper; + private volatile ObjectMapper jsonObjectMapper; public MetaModel(ModelInfoLookup modelInfoLookup, BmmModel bmmModel) { this(modelInfoLookup, bmmModel, null); @@ -38,15 +39,7 @@ public MetaModel(ModelInfoLookup modelInfoLookup, BmmModel bmmModel, AomProfile this.modelInfoLookup = modelInfoLookup; this.bmmModel = bmmModel; this.aomProfile = aomProfile; - if (provider != null) { - this.odinInputObjectMapper = provider.getInputOdinObjectMapper(); - this.odinOutputObjectMapper = provider.getOutputOdinObjectMapper(); - this.jsonObjectMapper = provider.getJsonObjectMapper(); - } else { - this.odinInputObjectMapper = null; - this.odinOutputObjectMapper = null; - this.jsonObjectMapper = null; - } + this.objectMapperProvider = provider; } /** @@ -93,7 +86,17 @@ public AomProfile getAomProfile() { * @return the object mapper to use for JSON converted from ODIN to parse this model */ public ObjectMapper getOdinInputObjectMapper() { - return odinInputObjectMapper; + ObjectMapper mapper = odinInputObjectMapper; + if (mapper == null && objectMapperProvider != null) { + synchronized (this) { + mapper = odinInputObjectMapper; + if (mapper == null) { + mapper = objectMapperProvider.getInputOdinObjectMapper(); + odinInputObjectMapper = mapper; + } + } + } + return mapper; } /** @@ -104,11 +107,31 @@ public ObjectMapper getOdinInputObjectMapper() { * @return Get the object mapper to output ODIN from this model */ public ObjectMapper getOdinOutputObjectMapper() { - return odinOutputObjectMapper; + ObjectMapper mapper = odinOutputObjectMapper; + if (mapper == null && objectMapperProvider != null) { + synchronized (this) { + mapper = odinOutputObjectMapper; + if (mapper == null) { + mapper = objectMapperProvider.getOutputOdinObjectMapper(); + odinOutputObjectMapper = mapper; + } + } + } + return mapper; } public ObjectMapper getJsonObjectMapper() { - return jsonObjectMapper; + ObjectMapper mapper = jsonObjectMapper; + if (mapper == null && objectMapperProvider != null) { + synchronized (this) { + mapper = jsonObjectMapper; + if (mapper == null) { + mapper = objectMapperProvider.getJsonObjectMapper(); + jsonObjectMapper = mapper; + } + } + } + return mapper; } /** diff --git a/aom/src/test/java/com/nedap/archie/rminfo/MetaModelTest.java b/aom/src/test/java/com/nedap/archie/rminfo/MetaModelTest.java new file mode 100644 index 000000000..82919a3a7 --- /dev/null +++ b/aom/src/test/java/com/nedap/archie/rminfo/MetaModelTest.java @@ -0,0 +1,65 @@ +package com.nedap.archie.rminfo; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import org.openehr.bmm.core.BmmModel; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + +public class MetaModelTest { + + private static class CountingProvider implements RMObjectMapperProvider { + int inputCalls; + int outputCalls; + int jsonCalls; + + @Override + public ObjectMapper getInputOdinObjectMapper() { + inputCalls++; + return new ObjectMapper(); + } + + @Override + public ObjectMapper getOutputOdinObjectMapper() { + outputCalls++; + return new ObjectMapper(); + } + + @Override + public ObjectMapper getJsonObjectMapper() { + jsonCalls++; + return new ObjectMapper(); + } + } + + @Test + public void eachObjectMapperIsFetchedOnceAndCached() { + CountingProvider provider = new CountingProvider(); + MetaModel metaModel = new MetaModel(null, new BmmModel(), null, provider); + + metaModel.getOdinInputObjectMapper(); + assertEquals(1, provider.inputCalls); + assertEquals(0, provider.outputCalls); + assertEquals(0, provider.jsonCalls); + + metaModel.getOdinOutputObjectMapper(); + assertEquals(1, provider.inputCalls); + assertEquals(1, provider.outputCalls); + assertEquals(0, provider.jsonCalls); + + metaModel.getJsonObjectMapper(); + assertEquals(1, provider.inputCalls); + assertEquals(1, provider.outputCalls); + assertEquals(1, provider.jsonCalls); + + metaModel.getOdinInputObjectMapper(); + metaModel.getOdinOutputObjectMapper(); + metaModel.getJsonObjectMapper(); + assertEquals(1, provider.inputCalls); + assertEquals(1, provider.outputCalls); + assertEquals(1, provider.jsonCalls); + } +} From c1baee9306f712ee822d88f7b387a7964d102a27 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Fri, 12 Jun 2026 09:16:33 +0200 Subject: [PATCH 54/60] Fix Codecov PGP key import in CI (#795) * Fix Codecov PGP key import in CI The keybase account was renamed from codecovsecurity to codecovsecops, so the old URL returned HTTP 404 (a 32-byte error body that was piped into gpg, causing 'no valid OpenPGP data found' and failing the Java 17 build). Point at the new account and add curl -fsS so a future broken URL fails fast at the curl step instead of confusingly inside gpg. * Migrate CI coverage upload from legacy uploader to Codecov CLI The Bash/binary uploader (uploader.codecov.io) is deprecated in favor of the Codecov CLI. Replace the manual download + PGP/SHA verification + binary invocation with 'pip install codecov-cli' and 'codecovcli upload-process'. --disable-search since we pass the jacoco report explicitly with -f; -n tags the upload with the Semaphore workflow id. * Add user-install bin dir to PATH for codecovcli pip installs the codecovcli console script into the user base bin (~/.local/bin), which is not on Semaphore's PATH, so the upload step failed with 'codecovcli: command not found'. Prepend the user-base bin dir (resolved via python3 -m site --user-base) before invoking it. Co-Authored-By: Claude Opus 4.8 (1M context) * Revert "Add user-install bin dir to PATH for codecovcli" This reverts commit 2547f0a436f0a83c05abafd9e2943257151ffe3b. * Revert "Migrate CI coverage upload from legacy uploader to Codecov CLI" This reverts commit bcff14b6addd1058a735eaaf57f908b39332cf6b. --------- Co-authored-by: Claude Opus 4.8 (1M context) --- .semaphore/semaphore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index e26d696d8..1531034e5 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -17,7 +17,7 @@ blocks: - sem-version java 17 - ./gradlew clean build - ./gradlew jacocoRootReport - - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step + - curl -fsS https://keybase.io/codecovsecops/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step - curl -Os https://uploader.codecov.io/latest/linux/codecov - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig From 0bfcff1492e1c1aee60b6d2739f2ade5872f0730 Mon Sep 17 00:00:00 2001 From: Vera Prinsen <33416829+VeraPrinsen@users.noreply.github.com> Date: Fri, 12 Jun 2026 14:56:25 +0200 Subject: [PATCH 55/60] Add ADL1.4 to ADL2 converter tests (#794) * Create ADL14ToADL2Test.java * Add test files and fix test --- .../nedap/archie/adl14/ADL14ToADL2Test.java | 70 + ...nEHR-EHR-CLUSTER.exam-abdomen_adl14.v0.adl | 687 +++++++ ...TER.exam-abdomen_adl2_id.v0.0.1-alpha.adls | 323 ++++ .../openEHR-EHR-CLUSTER.exam_adl14.v2.adl | 674 +++++++ ...enEHR-EHR-CLUSTER.exam_adl2_id.v2.1.3.adls | 656 +++++++ .../openEHR-EHR-OBSERVATION.demo_adl14.v1.adl | 1014 +++++++++++ ...R-EHR-OBSERVATION.demo_adl2_id.v1.0.0.adls | 1608 +++++++++++++++++ 7 files changed, 5032 insertions(+) create mode 100644 tools/src/test/java/com/nedap/archie/adl14/ADL14ToADL2Test.java create mode 100644 tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl14.v0.adl create mode 100644 tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl2_id.v0.0.1-alpha.adls create mode 100644 tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl14.v2.adl create mode 100644 tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl2_id.v2.1.3.adls create mode 100644 tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl14.v1.adl create mode 100644 tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl2_id.v1.0.0.adls diff --git a/tools/src/test/java/com/nedap/archie/adl14/ADL14ToADL2Test.java b/tools/src/test/java/com/nedap/archie/adl14/ADL14ToADL2Test.java new file mode 100644 index 000000000..c9580439c --- /dev/null +++ b/tools/src/test/java/com/nedap/archie/adl14/ADL14ToADL2Test.java @@ -0,0 +1,70 @@ +package com.nedap.archie.adl14; + +import com.nedap.archie.aom.Archetype; +import com.nedap.archie.serializer.adl.ADLArchetypeSerializer; +import org.antlr.v4.runtime.CharStreams; +import org.apache.commons.io.input.BOMInputStream; +import org.junit.jupiter.api.Test; +import org.openehr.referencemodels.BuiltinReferenceModels; + +import java.io.InputStream; +import java.util.Arrays; +import java.util.Collections; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +public class ADL14ToADL2Test { + + private String path = "/com/nedap/archie/adl14/"; + + @Test + public void demoFromAdl14ToAdl2IdCodedTest() throws Exception { + Archetype adl14; + try (InputStream stream = getClass().getResourceAsStream(path + "openEHR-EHR-OBSERVATION.demo_adl14.v1.adl")) { + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); + adl14 = parser.parse(stream, ConversionConfigForTest.getConfig()); + } + + // Configuration defaults to ID_CODED + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), new ADL14ConversionConfiguration()); + + ADL2ConversionResultList resultList = converter.convert(Collections.singletonList(adl14)); + Archetype result = resultList.getConversionResults().get(0).getArchetype(); + + assertEquals( + CharStreams.fromStream(new BOMInputStream.Builder().setInputStream(getClass().getResourceAsStream(path + "openEHR-EHR-OBSERVATION.demo_adl2_id.v1.0.0.adls")).get()).toString(), + ADLArchetypeSerializer.serialize(result) + ); + } + + @Test + public void examAbdomenFromAdl14ToAdl2IdCodedTest() throws Exception { + Archetype parent; + try (InputStream stream = getClass().getResourceAsStream(path + "openEHR-EHR-CLUSTER.exam_adl14.v2.adl")) { + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); + parent = parser.parse(stream, ConversionConfigForTest.getConfig()); + } + Archetype child; + try (InputStream stream = getClass().getResourceAsStream(path + "openEHR-EHR-CLUSTER.exam-abdomen_adl14.v0.adl")) { + ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModelProvider()); + child = parser.parse(stream, ConversionConfigForTest.getConfig()); + } + + // Configuration defaults to ID_CODED + ADL14Converter converter = new ADL14Converter(BuiltinReferenceModels.getMetaModelProvider(), new ADL14ConversionConfiguration()); + + ADL2ConversionResultList resultList = converter.convert(Arrays.asList(parent, child)); + Archetype parentResult = resultList.getConversionResults().get(0).getArchetype(); + Archetype childResult = resultList.getConversionResults().get(1).getArchetype(); + + assertEquals( + CharStreams.fromStream(new BOMInputStream.Builder().setInputStream(getClass().getResourceAsStream(path + "openEHR-EHR-CLUSTER.exam_adl2_id.v2.1.3.adls")).get()).toString(), + ADLArchetypeSerializer.serialize(parentResult) + ); + assertEquals( + CharStreams.fromStream(new BOMInputStream.Builder().setInputStream(getClass().getResourceAsStream(path + "openEHR-EHR-CLUSTER.exam-abdomen_adl2_id.v0.0.1-alpha.adls")).get()).toString(), + ADLArchetypeSerializer.serialize(childResult) + ); + } +} diff --git a/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl14.v0.adl b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl14.v0.adl new file mode 100644 index 000000000..d1d82bc26 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl14.v0.adl @@ -0,0 +1,687 @@ +archetype (adl_version=1.4; uid=a965a5e8-12a6-471c-8a8e-98dfb8aa9f1f) + openEHR-EHR-CLUSTER.exam-abdomen.v0 +specialise + openEHR-EHR-CLUSTER.exam.v2 + +concept + [at0000.1] -- Examination of the abdomen +language + original_language = <[ISO_639-1::en]> + translations = < + ["de"] = < + language = <[ISO_639-1::de]> + author = < + ["name"] = <"Nina Schewe, Natalia Strauch, Darin Leonhardt"> + ["organisation"] = <"Medizinische Hochschule Hannover, PLRI für medizinische Informatik/ Medizinische Hochschule"> + ["email"] = <"schewe.nina@mh-hannover.de, Strauch.Natalia@mh-hannover.de, leonhardt.darin@mh-hannover.de"> + > + > + ["sv"] = < + language = <[ISO_639-1::sv]> + author = < + ["name"] = <"Erik Sundvall"> + ["organisation"] = <"Region Östergötland + Linköping University"> + ["email"] = <"erik.sundvall@regionostergotland.se"> + > + > + ["nb"] = < + language = <[ISO_639-1::nb]> + author = < + ["name"] = <"Silje Ljosland Bakke"> + ["organisation"] = <"Nasjonal IKT HF"> + > + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + author = < + ["name"] = <"Adriana Kitajima"> + ["organisation"] = <"Hospital Alemão Oswaldo Cruz - HAOC"> + ["email"] = <"adrianakitajima@gmail.com"> + > + > + ["el"] = < + language = <[ISO_639-1::el]> + author = < + ["name"] = <"Erasmia Partafylla"> + ["organisation"] = <"Sigmasoft"> + ["email"] = <"c.partafylla@sigmasoft.gr"> + > + > + ["es"] = < + language = <[ISO_639-1::es]> + author = < + ["name"] = <"Julio de Sosa"> + ["organisation"] = <"Servei Català de la Salut"> + ["email"] = <"juliodesosa@catsalut.cat"> + > + > + > +description + original_author = < + ["name"] = <"Heather Leslie"> + ["organisation"] = <"Atomica Informatics"> + ["email"] = <"heather.leslie@atomicainformatics.com"> + ["date"] = <"2015-06-22"> + > + details = < + ["de"] = < + language = <[ISO_639-1::de]> + purpose = <"Aufzeichnung der bei der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachteten Befunde."> + use = <"Zur Aufzeichnung der beobachteten Befunde während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur. + +Dieser Archetyp wurde speziell für die Verwendung im SLOT „Untersuchungsdetails“ innerhalb des Archetyps OBSERVATION.exam oder im SLOT „Verfahrensdetails“ innerhalb des Archetyps ACTION.procedure entwickelt, kann aber auch innerhalb anderer Archetypen ENTRY oder CLUSTER verwendet werden, sofern dies klinisch sinnvoll ist. Spezialisierungen dieses Archetyps werden verwendet, um Untersuchungsergebnisse für bestimmte Körpersysteme, anatomische Strukturen oder genauere Körperstellen zu erfassen. Jede Spezialisierung behält die Grundstruktur dieses allgemeinen Archetyps als Basis bei und wird durch die Hinzufügung von Elementen erweitert, die für die Körperstelle spezifisch sind. Steht keine geeignete Spezialisierung zur Verfügung, ist dieser Archetyp zu verwenden und das untersuchte System oder die untersuchte Struktur mit dem Datenelement „System oder untersuchte Struktur“ und die Körperstelle mit dem Datenelement „Körperstelle“ oder dem SLOT „Strukturierte Körperstelle“ anzugeben. + +Die Interpretation der Befunde, z. B. „Keine Abnormität festgestellt“ oder „Mäßige Entzündung vorhanden“, kann mit dem Datenelement „Klinische Interpretation“ erfasst werden. + +Verwendung zur Bereitstellung eines Rahmens, in dem CLUSTER-Archetypen im SLOT „Untersuchungsbefund“ verschachtelt werden können, um zusätzliche strukturierte körperliche Untersuchungsbefunde zu erfassen. + +Der Archetyp CLUSTER.exclusion_exam kann in den SLOT „Nicht durchgeführte Untersuchung“ geschachtelt werden, um optional explizite Details über die nicht durchgeführte Untersuchung zu erfassen. + +Verwenden Sie das Datenelement „Klinische Beschreibung“, um die narrativen Beschreibungen klinischer Befunde innerhalb bestehender oder vorhandener klinischer Systeme in ein archetypisches Format einzubinden."> + misuse = <"Nicht zur Darstellung der klinischen Anamnese zu verwenden – verwenden Sie spezifische OBSERVATION- und CLUSTER-Archetypen. Zum Beispiel OBSERVATION.story und CLUSTER.symptom_sign. + +Nicht zur Darstellung der Ergebnisse einer bildgebenden Untersuchung verwenden – verwenden Sie für diesen Zweck die Archetypenfamilie CLUSTER.imaging_exam."> + > + ["sv"] = < + language = <[ISO_639-1::sv]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + keywords = <"fynd, undersökningsfynd, fysisk undersökning, u.a., utan anmärkning", ...> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["nb"] = < + language = <[ISO_639-1::nb]> + purpose = <"For å registrere en fritekstbeskrivelse og klinisk tolkning av observerte funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + use = <"Brukes til å registrere en fritekstbeskrivelse og klinisk tolkning av observerte funn ved fysisk undersøkelse av et spesifisert organsystem eller anatomisk struktur. Denne arketypen består kun av kjerneelementene av mønsteret for undersøkelser, og kan utvides ved hjelp av andre CLUSTER-arketyper eller brukes som grunnlag for undersøkelsesarketyper for spesifikke kroppssystemer eller anatomiske strukturer. + +Eksempler på detaljer som kan beskrives ved hjelp av dette CLUSTER er inspeksjon, palpasjon, auskultasjon, perkusjon og bevegelser i kroppssystemer eller anatomiske strukturer. Undersøkelsen kan støttes av enkle hjelpemidler som stetoskop, otoskop eller reflekshammer. Også funn ved mer avanserte undersøkelser kan registreres her, som ved endoskopi. I de tilfellene vil informasjon om hvilket hjelpemiddel eller utstyr brukt bli registrert i OBSERVATION.exam, elementet \"Detaljer om medisinsk utstyr\", i ACTION.procedure \"Prosedyredetaljer\" eller tilsvarende i egnet ENTRY- eller ACTION-arketype. + +Arketypen er laget spesifikt for å brukes i \"Undersøkelsesdetaljer\"-SLOTet i arketypen OBSERVATION.exam, men kan også brukes innen andre ENTRY- og CLUSTER-arketyper der det er klinisk passende. + +Denne arketypen kan benyttes for alle typer undersøkelser, alt fra enkle undersøkelser som undersøkelse av et hudområde, inspeksjon av ører og til artroskopi av et kne. + +Kan for eksempel nøstes i SLOTet \"Undersøkelsesdetaljer\" i arketypen OBSERVATION.exam (Norsk Funn ved fysisk undersøkelse) for å registrere ytterligere strukturerte funn ved fysiske undersøkelser. + +Arketypen CLUSTER.exclusion_exam kan nøstes i SLOTet \"Undersøkelse ikke utført\" der en har behov for å registrere informasjon om at en undersøkelse ikke ble utført. + +Brukes for å videreføre fritekstbeskrivelser av kliniske funn fra tidligere systemer inn i et arketypeformat, ved å bruke elementet \"Klinisk beskrivelse\"."> + misuse = <"Skal ikke brukes til å ta opp frittstående klinisk observasjoner eller testresultater - bruk spesifikke OBSERVATION arketyper, for eksempel OBSERVATION.head_circumference eller OBSERVATION.glasgow_coma_scale. + +Skal ikke brukes til å ta opp anamnese - bruk da spesifikke OBSERVATION og CLUSTER arketyper. For eksempel OBSERVATION.story og CLUSTER.symptom_sign."> + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["el"] = < + language = <[ISO_639-1::el]> + purpose = <"Για την καταγραφή των ευρημάτων που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose.(en)"> + > + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"To record a narrative description and clinical interpretation of the findings observed during the physical examination of the abdomen."> + use = <"Use to record a narrative description and clinical interpretation of the findings observed during the physical examination of the abdomen. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element."> + misuse = <"Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign."> + copyright = <"© openEHR Foundation"> + > + ["es"] = < + language = <[ISO_639-1::es]> + purpose = <"Registrar los hallazgos observados durante la exploración física de un sistema corporal o una estructura anatómica."> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose.(en)"> + > + > + lifecycle_state = <"in_development"> + other_contributors = <"Vebjørn Arntzen, Oslo University Hospital, Norway (openEHR Editor)", "Silje Ljosland Bakke, Nasjonal IKT HF, Norway (openEHR Editor)", "SB Bhattacharyya, Sudisa Consultancy Services, India", "Lisbeth Dahlhaug, Helse Midt - Norge IT, Norway", "Shahla Foozonkhah, Iran ministry of health and education, Iran", "Hildegard Franke, freshEHR Clinical Informatics Ltd., United Kingdom (openEHR Editor)", "Mikkel Gaup Grønmo, FSE, Helse Nord, Norway (Nasjonal IKT redaktør)", "Ingrid Heitmann, Oslo universitetssykehus HF, Norway", "Hilde Hollås, DIPS ASA, Norway", "Evelyn Hovenga, EJSH Consulting, Australia", "Lars Ivar Mehlum, Helse Bergen HF, Norway", "Sabine Leh, Haukeland University Hospital, Department of Pathology, Norway", "Heather Leslie, Atomica Informatics, Australia (openEHR Editor)", "Ian McNicoll, freshEHR Clinical Informatics, United Kingdom", "Lars Morgan Karlsen, DIPS ASA, Norway", "Bjørn Næss, DIPS ASA, Norway", "Andrej Orel, Marand d.o.o., Slovenia", "Vladimir Pizzo, Hospital Sírio Libanês, Brazil", "Jussara Rotzsch, UNB, Brazil", "Anoop Shah, University College London, United Kingdom", "Line Silsand, Universitetssykehuset i Nord-Norge, Norway", "Norwegian Review Summary, Nasjonal IKT HF, Norway", "Nyree Taylor, Ocean Informatics, Australia (openEHR Editor)", "Rowan Thomas, St. Vincent's Hospital Melbourne, Australia", "Jon Tysdahl, Furst medlab AS, Norway", "John Tore Valand, Helse Bergen, Norway (openEHR Editor)"> + other_details = < + ["licence"] = <"This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/."> + ["custodian_organisation"] = <"openEHR Foundation"> + ["current_contact"] = <"Heather Leslie, Atomica Informatics, Australia"> + ["original_namespace"] = <"org.openehr"> + ["original_publisher"] = <"openEHR Foundation"> + ["custodian_namespace"] = <"org.openehr"> + ["MD5-CAM-1.0.1"] = <"355409551F411079900E4744B677B74E"> + ["build_uid"] = <"837261fa-d6a9-441c-b85b-3e1e33aae00d"> + ["ip_acknowledgements"] = <"This artefact includes content from SNOMED Clinical Terms® (SNOMED CT®) which is copyrighted material of the International Health Terminology Standards Development Organisation (IHTSDO). Where an implementation of this artefact makes use of SNOMED CT content, the implementer must have the appropriate SNOMED CT Affiliate license - for more information contact http://www.snomed.org/snomed-ct/get-snomedct or info@snomed.org."> + ["revision"] = <"0.0.1-alpha"> + > + +definition + CLUSTER[at0000.1] matches { -- Examination of the abdomen + items cardinality matches {1..*; unordered} matches { + ELEMENT[at0001.1] matches { -- System or structure examined + value matches { + DV_TEXT matches {*} + } + } + ELEMENT[at0012] occurrences matches {0..1} matches { -- Body site + value matches { + DV_TEXT matches {*} + } + } + allow_archetype CLUSTER[at0011] occurrences matches {0..*} matches { -- Structured body site + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location(-[a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.anatomical_location_circle(-[a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.anatomical_location_relative(-[a-zA-Z0-9_]+)*\.v2/} + } + ELEMENT[at0003] occurrences matches {0..1} matches { -- Clinical description + value matches { + DV_TEXT matches {*} + } + } + allow_archetype CLUSTER[at0004.1] occurrences matches {0..*} matches { -- Examination findings + include + archetype_id/value matches {/.*/} + } + allow_archetype CLUSTER[at0005] occurrences matches {0..*} matches { -- Multimedia representation + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.media_file(-[a-zA-Z0-9_]+)*\.v1/} + } + ELEMENT[at0006] occurrences matches {0..*} matches { -- Clinical interpretation + value matches { + DV_TEXT matches {*} + } + } + ELEMENT[at0007] occurrences matches {0..1} matches { -- Comment + value matches { + DV_TEXT matches {*} + } + } + allow_archetype CLUSTER[at0008] occurrences matches {0..*} matches { -- Examination not done + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.exclusion_exam(-[a-zA-Z0-9_]+)*\.v1/} + } + } + } + + +ontology + terminologies_available = <"SNOMED-CT", ...> + term_definitions = < + ["en"] = < + items = < + ["at0000.1"] = < + text = <"Examination of the abdomen"> + description = <"Findings observed during the physical examination of the abdomen."> + > + ["at0001.1"] = < + text = <"System or structure examined"> + description = <"Identification of the examined body system or anatomical structure."> + comment = <"For example: the very generic term \"skin\", which will likely require additional qualification using one of the 'Body site' data elements, or the complete phrase \"skin of right knee\". Coding of the system or structure examined with a terminology is preferred, where possible."> + > + ["at0004.1"] = < + text = <"Examination findings"> + description = <"Structured details about the physical examination findings."> + > + ["at0000"] = < + text = <"Physical examination findings"> + description = <"Findings observed during the physical examination of a body system or anatomical structure."> + > + ["at0001"] = < + text = <"System or structure examined"> + description = <"Identification of the examined body system or anatomical structure."> + comment = <"Coding of the system or structure examined with a terminology is preferred, where possible."> + > + ["at0003"] = < + text = <"Clinical description"> + description = <"Narrative description of the overall findings observed during the physical examination."> + > + ["at0004"] = < + text = <"Examination findings"> + description = <"Structured details about the physical examination findings."> + > + ["at0005"] = < + text = <"Multimedia representation"> + description = <"Digital image, video or diagram representing the physical examination findings."> + > + ["at0006"] = < + text = <"Clinical interpretation"> + description = <"Single word, phrase or brief description that represents the clinical meaning and significance of the physical examination findings."> + comment = <"For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible."> + > + ["at0007"] = < + text = <"Comment"> + description = <"Additional narrative about the physical examination findings, not captured in other fields."> + > + ["at0008"] = < + text = <"Examination not done"> + description = <"Details to explicitly record that this examination was not performed."> + > + ["at0011"] = < + text = <"Structured body site"> + description = <"A structured description of the area of the body under examination."> + comment = <"If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant."> + > + ["at0012"] = < + text = <"Body site"> + description = <"Identification of the area of the body under examination."> + comment = <"For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant."> + > + > + > + ["nb"] = < + items = < + ["at0000.1"] = < + text = <"*Examination of the abdomen (en)"> + description = <"Funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + > + ["at0001.1"] = < + text = <"Undersøkt organsystem eller struktur"> + description = <"Identifisering av det undersøkte organsystemet eller anatomiske strukturen."> + comment = <"For eksempel den generiske termen \"Hud\" - som mest sannsynlig vil trenge en ytterligere spesifikasjon ved å benytte dataelementet \"Anatomisk lokalisasjon\", eller en fullstendig frase, som \"Hud på høyre kne\". Det er anbefalt å kode det undersøkte systemet eller strukturen med en terminologi, der det er mulig."> + > + ["at0004.1"] = < + text = <"Spesifikke funn"> + description = <"Ytterligere strukturerte detaljer om undersøkelsesfunnene."> + > + ["at0000"] = < + text = <"Funn ved fysisk undersøkelse"> + description = <"Undersøkelsesfunn gjort ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + > + ["at0001"] = < + text = <"Undersøkt organsystem eller struktur"> + description = <"Identifisering av det undersøkte organsystemet eller den anatomiske strukturen."> + comment = <"Det anbefales å kode organsystem eller den anatomiske strukturen med en terminologi dersom mulig."> + > + ["at0003"] = < + text = <"Klinisk beskrivelse"> + description = <"Fritekstbeskrivelse av de overordnede funnene ved den fysiske undersøkelsen."> + > + ["at0004"] = < + text = <"Spesifikke funn"> + description = <"Ytterligere strukturerte detaljer om undersøkelsesfunnene."> + > + ["at0005"] = < + text = <"Multimediarepresentasjon"> + description = <"Digitale bilder, video eller diagram som representerer undersøkelsesfunnene."> + > + ["at0006"] = < + text = <"Fortolkning"> + description = <"Enkelt ord, setning, frase eller kort beskrivelse som representerer den kliniske betydning og viktigheten av funnene ved den fysiske undersøkelsen."> + comment = <"For eksempel \"Uten anmerkning\" eller \"Moderat inflammasjon\". Det anbefales å kode \"Fortolkning\" med en terminologi dersom mulig."> + > + ["at0007"] = < + text = <"Kommentar"> + description = <"Ytterligere fritekst om funn ved undersøkelsen, som ikke dekkes av andre elementer."> + > + ["at0008"] = < + text = <"Undersøkelse ikke utført"> + description = <"Detaljer for å eksplisitt registrere at denne undersøkelsen ikke ble utført."> + > + ["at0011"] = < + text = <"Strukturert anatomisk lokalisasjon"> + description = <"Angivelse av en strukturert anatomisk lokalisering av det undersøkte organsystemet eller den anatomiske strukturen."> + comment = <"Hvis anatomisk lokalisasjon er entydig identifisert i elementet \"Undersøkt organsystem eller struktur\" er dette SLOT'et ikke nødvendig å benytte."> + > + ["at0012"] = < + text = <"Anatomisk lokalisasjon"> + description = <"Identifisering av et enkelt fysisk sted enten på eller i menneskekroppen."> + comment = <"For eksempel undersøkelse av et spesifikt område på huden. Dersom den anatomiske lokaliseringen allerede er identifisert i elementet \"Undersøkt organsystem eller struktur\" er dette dataelementet overflødig."> + > + > + > + ["pt-br"] = < + items = < + ["at0000.1"] = < + text = <"*Physical examination findings (en)"> + description = <"Constatações observadas durante o exame físico de um sistema corporal ou estrutura anatômica."> + > + ["at0001.1"] = < + text = <"Sistema ou estrutura examinada"> + description = <"Identificação do sistema do corpo examinado ou da estrutura anatômica."> + comment = <"A codificação do sistema ou estrutura examinada com uma terminologia é preferível, sempre que possível."> + > + ["at0004.1"] = < + text = <"Resultados do exame"> + description = <"Detalhes estruturados sobre os resultados do exame físico."> + > + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"Constatações observadas durante o exame físico de um sistema corporal ou estrutura anatômica."> + > + ["at0001"] = < + text = <"Sistema ou estrutura examinada"> + description = <"Identificação do sistema do corpo examinado ou da estrutura anatômica."> + comment = <"A codificação do sistema ou estrutura examinada com uma terminologia é preferível, sempre que possível."> + > + ["at0003"] = < + text = <"Descrição clínica"> + description = <"Descrição narrativa dos achados gerais observados durante o exame físico."> + > + ["at0004"] = < + text = <"Resultados do exame"> + description = <"Detalhes estruturados sobre os resultados do exame físico."> + > + ["at0005"] = < + text = <"Representação multimídia"> + description = <"Imagem digital, vídeo ou diagrama representando os achados do exame físico."> + > + ["at0006"] = < + text = <"Interpretação clínica"> + description = <"Palavra, frase ou breve descrição que represente o significado clínico e o significado dos resultados do exame físico."> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible. (en)"> + > + ["at0007"] = < + text = <"Comentário"> + description = <"Narrativa adicional sobre os achados do exame físico, não capturados em outros campos."> + > + ["at0008"] = < + text = <"Exame não realizado"> + description = <"Detalhes para registrar explicitamente que esse exame não foi realizado."> + > + ["at0011"] = < + text = <"Local do corpo estruturado"> + description = <"Uma descrição estruturada da área do corpo em exame."> + comment = <"Se o local do corpo tiver sido totalmente identificado no elemento de dados 'Sistema ou estrutura examinada' ou 'Local do corpo', esse SLOT se tornará redundante."> + > + ["at0012"] = < + text = <"Local do corpo"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + ["de"] = < + items = < + ["at0000.1"] = < + text = <"Ergebnisse der körperlichen Untersuchung"> + description = <"Während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachtete Befunde."> + > + ["at0001.1"] = < + text = <"Untersuchtes System oder untersuchte Struktur"> + description = <"Identifizierung des untersuchten Körpersystems oder der anatomischen Struktur."> + comment = <"Wenn möglich wird die Kodierung des untersuchten Systems oder der untersuchten Struktur mit einer Terminologie bevorzugt."> + > + ["at0004.1"] = < + text = <"Untersuchungsergebnisse"> + description = <"Strukturierte Angaben zu den Ergebnissen der körperlichen Untersuchung."> + > + ["at0000"] = < + text = <"Ergebnisse der körperlichen Untersuchung"> + description = <"Während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachtete Befunde."> + > + ["at0001"] = < + text = <"Untersuchtes System oder untersuchte Struktur"> + description = <"Identifizierung des untersuchten Körpersystems oder der anatomischen Struktur."> + comment = <"Wenn möglich wird die Kodierung des untersuchten Systems oder der untersuchten Struktur mit einer Terminologie bevorzugt."> + > + ["at0003"] = < + text = <"Klinische Beschreibung"> + description = <"Beschreibung der bei der körperlichen Untersuchung beobachteten Gesamtbefunde."> + > + ["at0004"] = < + text = <"Untersuchungsergebnisse"> + description = <"Strukturierte Angaben zu den Ergebnissen der körperlichen Untersuchung."> + > + ["at0005"] = < + text = <"Multimediale Darstellung"> + description = <"Digitales Bild, Video oder Diagramm, das die Ergebnisse der körperlichen Untersuchung darstellt."> + > + ["at0006"] = < + text = <"Klinische Interpretation"> + description = <"Ein einzelnes Wort, eine Phrase oder eine kurze Beschreibung, die die klinische Bedeutung und Wichtigkeit der Untersuchungsergebnisse darstellt."> + comment = <"Zum Beispiel: „Ohne Befund“ oder „Mäßige Entzündung vorhanden“. Wenn möglich, wird die Codierung der „Klinischen Interpretation“ mit einer Terminologie bevorzugt."> + > + ["at0007"] = < + text = <"Kommentar"> + description = <"Zusätzliche Beschreibung der Ergebnisse der körperlichen Untersuchung, die in anderen Bereichen nicht erfasst werden konnten."> + > + ["at0008"] = < + text = <"Nicht durchgeführte Untersuchung"> + description = <"Eine Aussage die ausdrücklich erfasst, dass die Untersuchung nicht durchgeführt wurde."> + > + ["at0011"] = < + text = <"Strukturierte Körperstelle"> + description = <"Eine strukturierte Beschreibung des zu untersuchenden Körperbereichs."> + comment = <"Wenn die Körperstelle im Datenelement \"Untersuchtes System oder untersuchte Struktur\" oder im Datenelement \"Körperstelle\" vollständig identifiziert wurde, wird die Verwendung dieses SLOT überflüssig."> + > + ["at0012"] = < + text = <"Körperstelle"> + description = <"Identifizierung des untersuchten Körperbereichs."> + comment = <"Zum Beispiel die Untersuchung einer bestimmten Hautpartie. Wenn die Körperstelle im Datenelement „Untersuchtes System oder Struktur“ vollständig identifiziert wurde, wird dieses Datenelement überflüssig."> + > + > + > + ["sv"] = < + items = < + ["at0000.1"] = < + text = <"*Physical examination findings (en)"> + description = <"Observerade fynd vid fysisk undersökning av system i kroppen, eller av anatomisk struktur"> + > + ["at0001.1"] = < + text = <"System eller struktur som undersökts"> + description = <"Identifiering av systemet eller strukturen som undersökts."> + comment = <"Om möjligt, koda systemet eller strukturen med hjälp av ett terminologisystem."> + > + ["at0004.1"] = < + text = <"Fynd vid undersökning"> + description = <"Strukturerade detaljer om fynd vid den fysiska undersökningen."> + > + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"Observerade fynd vid fysisk undersökning av system i kroppen, eller av anatomisk struktur"> + > + ["at0001"] = < + text = <"System eller struktur som undersökts"> + description = <"Identifiering av systemet eller strukturen som undersökts."> + comment = <"Om möjligt, koda systemet eller strukturen med hjälp av ett terminologisystem."> + > + ["at0003"] = < + text = <"Klinisk beskrivning"> + description = <"En övergripande beskrivning av fynden från den fysiska undersökningen. "> + > + ["at0004"] = < + text = <"Fynd vid undersökning"> + description = <"Strukturerade detaljer om fynd vid den fysiska undersökningen."> + > + ["at0005"] = < + text = <"Multimedia-representation"> + description = <"Digital bild, video eller diagram som återger fynd från undersökningen."> + > + ["at0006"] = < + text = <"Klinisk tolkning"> + description = <"Ord, fras eller kort beskrivning av fyndens kliniska betydelse."> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible. (en)"> + > + ["at0007"] = < + text = <"Kommentar"> + description = <"Kommentarer avseende undersökningsfynd som inte beskrivs i övriga fält."> + > + ["at0008"] = < + text = <"Undersökning ej genomförd"> + description = <"Detaljerad beskrivning om att undersökningen inte genomfördes."> + > + ["at0011"] = < + text = <"Strukturerad anatomisk plats"> + description = <"Strukturerad beskrivning av den anatomiska platsen som undersökts."> + comment = <"Om den anatomiska platsen kan identifieras helt via dataelementet \"System eller struktur som undersökts\" så blir denna del redundant."> + > + ["at0012"] = < + text = <"Anatomisk plats"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + ["el"] = < + items = < + ["at0000.1"] = < + text = <"*Physical examination findings (en)"> + description = <"Ευρήματα που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + > + ["at0001.1"] = < + text = <"Εξεταζόμενο σύστημα ή δομή"> + description = <"Ταυτοποίηση του εξεταζόμενου συστήματος σώματος ή ανατομικής δομής."> + comment = <"Προτιμάται η κωδικοποίηση του συστήματος ή της δομής που εξετάζεται με ορολογία, όπου είναι δυνατόν."> + > + ["at0004.1"] = < + text = <"Ευρήματα εξέτασης"> + description = <"Δομημένες λεπτομέρειες σχετικά με τα ευρήματα της φυσικής εξέτασης."> + > + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"Ευρήματα που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + > + ["at0001"] = < + text = <"Εξεταζόμενο σύστημα ή δομή"> + description = <"Ταυτοποίηση του εξεταζόμενου συστήματος σώματος ή ανατομικής δομής."> + comment = <"Προτιμάται η κωδικοποίηση του συστήματος ή της δομής που εξετάζεται με ορολογία, όπου είναι δυνατόν."> + > + ["at0003"] = < + text = <"Κλινική Περιγραφή"> + description = <"Αφηγηματική περιγραφή των συνολικών ευρημάτων που παρατηρήθηκαν κατά τη διάρκεια της φυσικής εξέτασης."> + > + ["at0004"] = < + text = <"Ευρήματα εξέτασης"> + description = <"Δομημένες λεπτομέρειες σχετικά με τα ευρήματα της φυσικής εξέτασης."> + > + ["at0005"] = < + text = <"Αναπαράσταση πολυμέσων"> + description = <"Ψηφιακή εικόνα, βίντεο ή διάγραμμα που αναπαριστά τα ευρήματα της φυσικής εξέτασης."> + > + ["at0006"] = < + text = <"Κλινική αξιολόγηση"> + description = <"Μία λέξη, φράση ή σύντομη περιγραφή που αντιπροσωπεύει την κλινική σημασία και σημασία των ευρημάτων της φυσικής εξέτασης."> + comment = <"Για παράδειγμα: «Δεν ανιχνεύθηκε ανωμαλία» ή «Υπάρχει μέτρια φλεγμονή». Προτιμάται η κωδικοποίηση της «κλινικής ερμηνείας» με ορολογία, όπου είναι δυνατόν."> + > + ["at0007"] = < + text = <"Σχόλιο"> + description = <"Πρόσθετη αφήγηση σχετικά με τα ευρήματα της φυσικής εξέτασης, που δεν αποτυπώνεται σε άλλους τομείς."> + > + ["at0008"] = < + text = <"Λόγος διακοπής εξέτασης"> + description = <"Λεπτομέρειες για να καταγραφεί ρητά ότι αυτή η εξέταση δεν διενεργήθηκε."> + > + ["at0011"] = < + text = <"ω"> + description = <"περιγραφή της περιοχής του υπό εξέταση σώματος."> + comment = <"*If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant.(en)"> + > + ["at0012"] = < + text = <"Περιοχή σώματος"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + ["es"] = < + items = < + ["at0000.1"] = < + text = <"*Physical examination findings (en)"> + description = <"*Findings observed during the physical examination of a body system or anatomical structure.(en)"> + > + ["at0001.1"] = < + text = <"*System or structure examined(en)"> + description = <"*Identification of the examined body system or anatomical structure.(en)"> + comment = <"*Coding of the system or structure examined with a terminology is preferred, where possible.(en)"> + > + ["at0004.1"] = < + text = <"*Examination findings(en)"> + description = <"*Structured details about the physical examination findings.(en)"> + > + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"*Findings observed during the physical examination of a body system or anatomical structure.(en)"> + > + ["at0001"] = < + text = <"*System or structure examined(en)"> + description = <"*Identification of the examined body system or anatomical structure.(en)"> + comment = <"*Coding of the system or structure examined with a terminology is preferred, where possible.(en)"> + > + ["at0003"] = < + text = <"*Clinical description(en)"> + description = <"*Narrative description of the overall findings observed during the physical examination.(en)"> + > + ["at0004"] = < + text = <"*Examination findings(en)"> + description = <"*Structured details about the physical examination findings.(en)"> + > + ["at0005"] = < + text = <"*Multimedia representation(en)"> + description = <"*Digital image, video or diagram representing the physical examination findings.(en)"> + > + ["at0006"] = < + text = <"*Clinical interpretation(en)"> + description = <"*Single word, phrase or brief description that represents the clinical meaning and significance of the physical examination findings.(en)"> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible.(en)"> + > + ["at0007"] = < + text = <"*Comment(en)"> + description = <"*Additional narrative about the physical examination findings, not captured in other fields.(en)"> + > + ["at0008"] = < + text = <"*Examination not done(en)"> + description = <"*Details to explicitly record that this examination was not performed.(en)"> + > + ["at0011"] = < + text = <"*Structured body site(en)"> + description = <"*A structured description of the area of the body under examination.(en)"> + comment = <"*If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant.(en)"> + > + ["at0012"] = < + text = <"*Body site(en)"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + > diff --git a/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl2_id.v0.0.1-alpha.adls b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl2_id.v0.0.1-alpha.adls new file mode 100644 index 000000000..ab7fe3b01 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam-abdomen_adl2_id.v0.0.1-alpha.adls @@ -0,0 +1,323 @@ +archetype (adl_version=2.0.6; rm_release=1.1.0; generated; uid=a965a5e8-12a6-471c-8a8e-98dfb8aa9f1f; build_uid=837261fa-d6a9-441c-b85b-3e1e33aae00d) + openEHR-EHR-CLUSTER.exam-abdomen.v0.0.1-alpha + +specialize + openEHR-EHR-CLUSTER.exam.v2 + +language + original_language = <[ISO_639-1::en]> + translations = < + ["de"] = < + language = <[ISO_639-1::de]> + author = < + ["name"] = <"Nina Schewe, Natalia Strauch, Darin Leonhardt"> + ["organisation"] = <"Medizinische Hochschule Hannover, PLRI für medizinische Informatik/ Medizinische Hochschule"> + ["email"] = <"schewe.nina@mh-hannover.de, Strauch.Natalia@mh-hannover.de, leonhardt.darin@mh-hannover.de"> + > + > + ["sv"] = < + language = <[ISO_639-1::sv]> + author = < + ["name"] = <"Erik Sundvall"> + ["organisation"] = <"Region Östergötland + Linköping University"> + ["email"] = <"erik.sundvall@regionostergotland.se"> + > + > + ["nb"] = < + language = <[ISO_639-1::nb]> + author = < + ["name"] = <"Silje Ljosland Bakke"> + ["organisation"] = <"Nasjonal IKT HF"> + > + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + author = < + ["name"] = <"Adriana Kitajima"> + ["organisation"] = <"Hospital Alemão Oswaldo Cruz - HAOC"> + ["email"] = <"adrianakitajima@gmail.com"> + > + > + ["el"] = < + language = <[ISO_639-1::el]> + author = < + ["name"] = <"Erasmia Partafylla"> + ["organisation"] = <"Sigmasoft"> + ["email"] = <"c.partafylla@sigmasoft.gr"> + > + > + ["es"] = < + language = <[ISO_639-1::es]> + author = < + ["name"] = <"Julio de Sosa"> + ["organisation"] = <"Servei Català de la Salut"> + ["email"] = <"juliodesosa@catsalut.cat"> + > + > + > + +description + original_author = < + ["name"] = <"Heather Leslie"> + ["organisation"] = <"Atomica Informatics"> + ["email"] = <"heather.leslie@atomicainformatics.com"> + ["date"] = <"2015-06-22"> + > + original_namespace = <"org.openehr"> + original_publisher = <"openEHR Foundation"> + other_contributors = <"Vebjørn Arntzen, Oslo University Hospital, Norway (openEHR Editor)", "Silje Ljosland Bakke, Nasjonal IKT HF, Norway (openEHR Editor)", "SB Bhattacharyya, Sudisa Consultancy Services, India", "Lisbeth Dahlhaug, Helse Midt - Norge IT, Norway", "Shahla Foozonkhah, Iran ministry of health and education, Iran", "Hildegard Franke, freshEHR Clinical Informatics Ltd., United Kingdom (openEHR Editor)", "Mikkel Gaup Grønmo, FSE, Helse Nord, Norway (Nasjonal IKT redaktør)", "Ingrid Heitmann, Oslo universitetssykehus HF, Norway", "Hilde Hollås, DIPS ASA, Norway", "Evelyn Hovenga, EJSH Consulting, Australia", "Lars Ivar Mehlum, Helse Bergen HF, Norway", "Sabine Leh, Haukeland University Hospital, Department of Pathology, Norway", "Heather Leslie, Atomica Informatics, Australia (openEHR Editor)", "Ian McNicoll, freshEHR Clinical Informatics, United Kingdom", "Lars Morgan Karlsen, DIPS ASA, Norway", "Bjørn Næss, DIPS ASA, Norway", "Andrej Orel, Marand d.o.o., Slovenia", "Vladimir Pizzo, Hospital Sírio Libanês, Brazil", "Jussara Rotzsch, UNB, Brazil", "Anoop Shah, University College London, United Kingdom", "Line Silsand, Universitetssykehuset i Nord-Norge, Norway", "Norwegian Review Summary, Nasjonal IKT HF, Norway", "Nyree Taylor, Ocean Informatics, Australia (openEHR Editor)", "Rowan Thomas, St. Vincent's Hospital Melbourne, Australia", "Jon Tysdahl, Furst medlab AS, Norway", "John Tore Valand, Helse Bergen, Norway (openEHR Editor)"> + lifecycle_state = <"in_development"> + custodian_namespace = <"org.openehr"> + custodian_organisation = <"openEHR Foundation"> + licence = <"This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/."> + ip_acknowledgements = < + ["1"] = <"This artefact includes content from SNOMED Clinical Terms® (SNOMED CT®) which is copyrighted material of the International Health Terminology Standards Development Organisation (IHTSDO). Where an implementation of this artefact makes use of SNOMED CT content, the implementer must have the appropriate SNOMED CT Affiliate license - for more information contact http://www.snomed.org/snomed-ct/get-snomedct or info@snomed.org."> + > + other_details = < + ["current_contact"] = <"Heather Leslie, Atomica Informatics, Australia"> + ["MD5-CAM-1.0.1"] = <"355409551F411079900E4744B677B74E"> + > + details = < + ["de"] = < + language = <[ISO_639-1::de]> + purpose = <"Aufzeichnung der bei der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachteten Befunde."> + use = <"Zur Aufzeichnung der beobachteten Befunde während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur. + +Dieser Archetyp wurde speziell für die Verwendung im SLOT „Untersuchungsdetails“ innerhalb des Archetyps OBSERVATION.exam oder im SLOT „Verfahrensdetails“ innerhalb des Archetyps ACTION.procedure entwickelt, kann aber auch innerhalb anderer Archetypen ENTRY oder CLUSTER verwendet werden, sofern dies klinisch sinnvoll ist. Spezialisierungen dieses Archetyps werden verwendet, um Untersuchungsergebnisse für bestimmte Körpersysteme, anatomische Strukturen oder genauere Körperstellen zu erfassen. Jede Spezialisierung behält die Grundstruktur dieses allgemeinen Archetyps als Basis bei und wird durch die Hinzufügung von Elementen erweitert, die für die Körperstelle spezifisch sind. Steht keine geeignete Spezialisierung zur Verfügung, ist dieser Archetyp zu verwenden und das untersuchte System oder die untersuchte Struktur mit dem Datenelement „System oder untersuchte Struktur“ und die Körperstelle mit dem Datenelement „Körperstelle“ oder dem SLOT „Strukturierte Körperstelle“ anzugeben. + +Die Interpretation der Befunde, z. B. „Keine Abnormität festgestellt“ oder „Mäßige Entzündung vorhanden“, kann mit dem Datenelement „Klinische Interpretation“ erfasst werden. + +Verwendung zur Bereitstellung eines Rahmens, in dem CLUSTER-Archetypen im SLOT „Untersuchungsbefund“ verschachtelt werden können, um zusätzliche strukturierte körperliche Untersuchungsbefunde zu erfassen. + +Der Archetyp CLUSTER.exclusion_exam kann in den SLOT „Nicht durchgeführte Untersuchung“ geschachtelt werden, um optional explizite Details über die nicht durchgeführte Untersuchung zu erfassen. + +Verwenden Sie das Datenelement „Klinische Beschreibung“, um die narrativen Beschreibungen klinischer Befunde innerhalb bestehender oder vorhandener klinischer Systeme in ein archetypisches Format einzubinden."> + misuse = <"Nicht zur Darstellung der klinischen Anamnese zu verwenden – verwenden Sie spezifische OBSERVATION- und CLUSTER-Archetypen. Zum Beispiel OBSERVATION.story und CLUSTER.symptom_sign. + +Nicht zur Darstellung der Ergebnisse einer bildgebenden Untersuchung verwenden – verwenden Sie für diesen Zweck die Archetypenfamilie CLUSTER.imaging_exam."> + > + ["sv"] = < + language = <[ISO_639-1::sv]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + keywords = <"fynd, undersökningsfynd, fysisk undersökning, u.a., utan anmärkning", ...> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["nb"] = < + language = <[ISO_639-1::nb]> + purpose = <"For å registrere en fritekstbeskrivelse og klinisk tolkning av observerte funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + use = <"Brukes til å registrere en fritekstbeskrivelse og klinisk tolkning av observerte funn ved fysisk undersøkelse av et spesifisert organsystem eller anatomisk struktur. Denne arketypen består kun av kjerneelementene av mønsteret for undersøkelser, og kan utvides ved hjelp av andre CLUSTER-arketyper eller brukes som grunnlag for undersøkelsesarketyper for spesifikke kroppssystemer eller anatomiske strukturer. + +Eksempler på detaljer som kan beskrives ved hjelp av dette CLUSTER er inspeksjon, palpasjon, auskultasjon, perkusjon og bevegelser i kroppssystemer eller anatomiske strukturer. Undersøkelsen kan støttes av enkle hjelpemidler som stetoskop, otoskop eller reflekshammer. Også funn ved mer avanserte undersøkelser kan registreres her, som ved endoskopi. I de tilfellene vil informasjon om hvilket hjelpemiddel eller utstyr brukt bli registrert i OBSERVATION.exam, elementet \"Detaljer om medisinsk utstyr\", i ACTION.procedure \"Prosedyredetaljer\" eller tilsvarende i egnet ENTRY- eller ACTION-arketype. + +Arketypen er laget spesifikt for å brukes i \"Undersøkelsesdetaljer\"-SLOTet i arketypen OBSERVATION.exam, men kan også brukes innen andre ENTRY- og CLUSTER-arketyper der det er klinisk passende. + +Denne arketypen kan benyttes for alle typer undersøkelser, alt fra enkle undersøkelser som undersøkelse av et hudområde, inspeksjon av ører og til artroskopi av et kne. + +Kan for eksempel nøstes i SLOTet \"Undersøkelsesdetaljer\" i arketypen OBSERVATION.exam (Norsk Funn ved fysisk undersøkelse) for å registrere ytterligere strukturerte funn ved fysiske undersøkelser. + +Arketypen CLUSTER.exclusion_exam kan nøstes i SLOTet \"Undersøkelse ikke utført\" der en har behov for å registrere informasjon om at en undersøkelse ikke ble utført. + +Brukes for å videreføre fritekstbeskrivelser av kliniske funn fra tidligere systemer inn i et arketypeformat, ved å bruke elementet \"Klinisk beskrivelse\"."> + misuse = <"Skal ikke brukes til å ta opp frittstående klinisk observasjoner eller testresultater - bruk spesifikke OBSERVATION arketyper, for eksempel OBSERVATION.head_circumference eller OBSERVATION.glasgow_coma_scale. + +Skal ikke brukes til å ta opp anamnese - bruk da spesifikke OBSERVATION og CLUSTER arketyper. For eksempel OBSERVATION.story og CLUSTER.symptom_sign."> + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["el"] = < + language = <[ISO_639-1::el]> + purpose = <"Για την καταγραφή των ευρημάτων που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose.(en)"> + > + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"To record a narrative description and clinical interpretation of the findings observed during the physical examination of the abdomen."> + use = <"Use to record a narrative description and clinical interpretation of the findings observed during the physical examination of the abdomen. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element."> + misuse = <"Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign."> + copyright = <"© openEHR Foundation"> + > + ["es"] = < + language = <[ISO_639-1::es]> + purpose = <"Registrar los hallazgos observados durante la exploración física de un sistema corporal o una estructura anatómica."> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose.(en)"> + > + > + +definition + CLUSTER[id1.1] matches { -- Examination of the abdomen + items matches { + ELEMENT[id2.1] -- System or structure examined + } + } + +terminology + term_definitions = < + ["de"] = < + ["id1.1"] = < + text = <"Ergebnisse der körperlichen Untersuchung"> + description = <"Während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachtete Befunde."> + > + ["id2.1"] = < + text = <"Untersuchtes System oder untersuchte Struktur"> + description = <"Identifizierung des untersuchten Körpersystems oder der anatomischen Struktur."> + comment = <"Wenn möglich wird die Kodierung des untersuchten Systems oder der untersuchten Struktur mit einer Terminologie bevorzugt."> + > + ["id5.1"] = < + text = <"Untersuchungsergebnisse"> + description = <"Strukturierte Angaben zu den Ergebnissen der körperlichen Untersuchung."> + > + > + ["sv"] = < + ["id1.1"] = < + text = <"*Physical examination findings (en)"> + description = <"Observerade fynd vid fysisk undersökning av system i kroppen, eller av anatomisk struktur"> + > + ["id2.1"] = < + text = <"System eller struktur som undersökts"> + description = <"Identifiering av systemet eller strukturen som undersökts."> + comment = <"Om möjligt, koda systemet eller strukturen med hjälp av ett terminologisystem."> + > + ["id5.1"] = < + text = <"Fynd vid undersökning"> + description = <"Strukturerade detaljer om fynd vid den fysiska undersökningen."> + > + > + ["nb"] = < + ["id1.1"] = < + text = <"*Examination of the abdomen (en)"> + description = <"Funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + > + ["id2.1"] = < + text = <"Undersøkt organsystem eller struktur"> + description = <"Identifisering av det undersøkte organsystemet eller anatomiske strukturen."> + comment = <"For eksempel den generiske termen \"Hud\" - som mest sannsynlig vil trenge en ytterligere spesifikasjon ved å benytte dataelementet \"Anatomisk lokalisasjon\", eller en fullstendig frase, som \"Hud på høyre kne\". Det er anbefalt å kode det undersøkte systemet eller strukturen med en terminologi, der det er mulig."> + > + ["id5.1"] = < + text = <"Spesifikke funn"> + description = <"Ytterligere strukturerte detaljer om undersøkelsesfunnene."> + > + > + ["pt-br"] = < + ["id1.1"] = < + text = <"*Physical examination findings (en)"> + description = <"Constatações observadas durante o exame físico de um sistema corporal ou estrutura anatômica."> + > + ["id2.1"] = < + text = <"Sistema ou estrutura examinada"> + description = <"Identificação do sistema do corpo examinado ou da estrutura anatômica."> + comment = <"A codificação do sistema ou estrutura examinada com uma terminologia é preferível, sempre que possível."> + > + ["id5.1"] = < + text = <"Resultados do exame"> + description = <"Detalhes estruturados sobre os resultados do exame físico."> + > + > + ["el"] = < + ["id1.1"] = < + text = <"*Physical examination findings (en)"> + description = <"Ευρήματα που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + > + ["id2.1"] = < + text = <"Εξεταζόμενο σύστημα ή δομή"> + description = <"Ταυτοποίηση του εξεταζόμενου συστήματος σώματος ή ανατομικής δομής."> + comment = <"Προτιμάται η κωδικοποίηση του συστήματος ή της δομής που εξετάζεται με ορολογία, όπου είναι δυνατόν."> + > + ["id5.1"] = < + text = <"Ευρήματα εξέτασης"> + description = <"Δομημένες λεπτομέρειες σχετικά με τα ευρήματα της φυσικής εξέτασης."> + > + > + ["en"] = < + ["id1.1"] = < + text = <"Examination of the abdomen"> + description = <"Findings observed during the physical examination of the abdomen."> + > + ["id2.1"] = < + text = <"System or structure examined"> + description = <"Identification of the examined body system or anatomical structure."> + comment = <"For example: the very generic term \"skin\", which will likely require additional qualification using one of the 'Body site' data elements, or the complete phrase \"skin of right knee\". Coding of the system or structure examined with a terminology is preferred, where possible."> + > + ["id5.1"] = < + text = <"Examination findings"> + description = <"Structured details about the physical examination findings."> + > + > + ["es"] = < + ["id1.1"] = < + text = <"*Physical examination findings (en)"> + description = <"*Findings observed during the physical examination of a body system or anatomical structure.(en)"> + > + ["id2.1"] = < + text = <"*System or structure examined(en)"> + description = <"*Identification of the examined body system or anatomical structure.(en)"> + comment = <"*Coding of the system or structure examined with a terminology is preferred, where possible.(en)"> + > + ["id5.1"] = < + text = <"*Examination findings(en)"> + description = <"*Structured details about the physical examination findings.(en)"> + > + > + > diff --git a/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl14.v2.adl b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl14.v2.adl new file mode 100644 index 000000000..85be4b570 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl14.v2.adl @@ -0,0 +1,674 @@ +archetype (adl_version=1.4; uid=7bed0e4b-3603-4a0a-8f20-75b80d81be9b) + openEHR-EHR-CLUSTER.exam.v2 + +concept + [at0000] -- Physical examination findings +language + original_language = <[ISO_639-1::en]> + translations = < + ["de"] = < + language = <[ISO_639-1::de]> + author = < + ["name"] = <"Nina Schewe, Natalia Strauch, Darin Leonhardt"> + ["organisation"] = <"Medizinische Hochschule Hannover, PLRI für medizinische Informatik/ Medizinische Hochschule"> + ["email"] = <"schewe.nina@mh-hannover.de, Strauch.Natalia@mh-hannover.de, leonhardt.darin@mh-hannover.de"> + > + > + ["sv"] = < + language = <[ISO_639-1::sv]> + author = < + ["name"] = <"Erik Sundvall"> + ["organisation"] = <"Region Östergötland + Linköping University"> + ["email"] = <"erik.sundvall@regionostergotland.se"> + > + > + ["nb"] = < + language = <[ISO_639-1::nb]> + author = < + ["name"] = <"Silje Ljosland Bakke, Vebjørn Arntzen"> + ["organisation"] = <"Nasjonal IKT HF, Oslo University Hospital"> + ["email"] = <"varntzen@ous-hf.no"> + > + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + author = < + ["name"] = <"Adriana Kitajima"> + ["organisation"] = <"Hospital Alemão Oswaldo Cruz - HAOC"> + ["email"] = <"adrianakitajima@gmail.com"> + > + > + ["el"] = < + language = <[ISO_639-1::el]> + author = < + ["name"] = <"Erasmia Partafylla"> + ["organisation"] = <"Sigmasoft"> + ["email"] = <"c.partafylla@sigmasoft.gr"> + > + > + ["es"] = < + language = <[ISO_639-1::es]> + author = < + ["name"] = <"Julio de Sosa, Clara Calleja Vega"> + ["organisation"] = <"Servei Català de la Salut, CatSalut. Servei Català de la Salut."> + ["email"] = <"juliodesosa@catsalut.cat, ccalleja@catsalut.cat"> + > + > + ["ca"] = < + language = <[ISO_639-1::ca]> + author = < + ["name"] = <"Laura Moral López"> + ["organisation"] = <"Sistema de Salut de Catalunya"> + ["email"] = <"lauramoral@catsalut.cat"> + > + other_details = < + ["other_contributors"] = <"Tradcrea"> + > + > + > +description + original_author = < + ["name"] = <"Heather Leslie"> + ["organisation"] = <"Atomica Informatics"> + ["email"] = <"heather.leslie@atomicainformatics.com"> + ["date"] = <"2015-06-23"> + > + details = < + ["de"] = < + language = <[ISO_639-1::de]> + purpose = <"Aufzeichnung der bei der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachteten Befunde."> + use = <"Zur Aufzeichnung der beobachteten Befunde während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur. + +Dieser Archetyp wurde speziell für die Verwendung im SLOT „Untersuchungsdetails“ innerhalb des Archetyps OBSERVATION.exam oder im SLOT „Verfahrensdetails“ innerhalb des Archetyps ACTION.procedure entwickelt, kann aber auch innerhalb anderer Archetypen ENTRY oder CLUSTER verwendet werden, sofern dies klinisch sinnvoll ist. Spezialisierungen dieses Archetyps werden verwendet, um Untersuchungsergebnisse für bestimmte Körpersysteme, anatomische Strukturen oder genauere Körperstellen zu erfassen. Jede Spezialisierung behält die Grundstruktur dieses allgemeinen Archetyps als Basis bei und wird durch die Hinzufügung von Elementen erweitert, die für die Körperstelle spezifisch sind. Steht keine geeignete Spezialisierung zur Verfügung, ist dieser Archetyp zu verwenden und das untersuchte System oder die untersuchte Struktur mit dem Datenelement „System oder untersuchte Struktur“ und die Körperstelle mit dem Datenelement „Körperstelle“ oder dem SLOT „Strukturierte Körperstelle“ anzugeben. + +Die Interpretation der Befunde, z. B. „Keine Abnormität festgestellt“ oder „Mäßige Entzündung vorhanden“, kann mit dem Datenelement „Klinische Interpretation“ erfasst werden. + +Verwendung zur Bereitstellung eines Rahmens, in dem CLUSTER-Archetypen im SLOT „Untersuchungsbefund“ verschachtelt werden können, um zusätzliche strukturierte körperliche Untersuchungsbefunde zu erfassen. + +Der Archetyp CLUSTER.exclusion_exam kann in den SLOT „Nicht durchgeführte Untersuchung“ geschachtelt werden, um optional explizite Details über die nicht durchgeführte Untersuchung zu erfassen. + +Verwenden Sie das Datenelement „Klinische Beschreibung“, um die narrativen Beschreibungen klinischer Befunde innerhalb bestehender oder vorhandener klinischer Systeme in ein archetypisches Format einzubinden."> + misuse = <"Nicht zur Darstellung der klinischen Anamnese zu verwenden – verwenden Sie spezifische OBSERVATION- und CLUSTER-Archetypen. Zum Beispiel OBSERVATION.story und CLUSTER.symptom_sign. + +Nicht zur Darstellung der Ergebnisse einer bildgebenden Untersuchung verwenden – verwenden Sie für diesen Zweck die Archetypenfamilie CLUSTER.imaging_exam."> + > + ["sv"] = < + language = <[ISO_639-1::sv]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + keywords = <"fynd, undersökningsfynd, fysisk undersökning, u.a., utan anmärkning", ...> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["nb"] = < + language = <[ISO_639-1::nb]> + purpose = <"For å registrere observerte funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + use = <" +Bruk for å registrere observerte funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur. + +Denne arketypen har vært designet spesifikt for å kunne brukes i SLOT'et \"Undersøkelsesdetaljer\" i arketypen OBSERVATION.exam (Funn ved fysisk undersøkelse) eller SLOT'et \"Prosedyredetaljer\" i arketypen ACTION.procedure (Prosedyre), men kan også bli brukt i andre ENTRY- eller CLUSTER-arketyper der det er klinisk passende. Spesialiseringer av denne arketypen for bestemte organsystem eller anatomiske strukturer kan brukes for å registrere undersøkelsesfunn for disse. Hver slik spesialisering vil bevare den underliggende strukturen til denne generiske arketypen som basis, og utvides med tilleggselementer som er spesifikk for den kroppsstrukturen spesialiseringen gjelder. Dersom det ikke finnes noen passende spesialisering, bruk denne arketypen og registrer organstrukturen eller den anatomiske strukturen i elementet \"Undersøkt organsystem eller struktur\" og lokalisering på kroppen i SLOT'et \"Anatomisk lokalisasjon\" eller \"Strukturert anatomisk lokalisasjon\". + +Tolkning av funn kan bli registrert i dataelementet \"Fortolkning\", for eksempel \"Uten anmerkning\" eller \"Moderat inflammasjon\". + +Kan også brukes som et rammeverk der man kan nøste CLUSTER-arketyper i SLOT'et \"Spesifikke funn\" for å registrere ytterligere strukturerte undersøkelsesfunn. + +Arketypen CLUSTER.exclusion_exam (Eksklusjon av en undersøkelse) kan nøstes inn i SLOT'et \"Undersøkelse ikke utført\" for å registrere begrunnelse eller detaljer om hvorfor undersøkelsen ikke ble utført. + +Brukes for å legge til fritekstlige beskrivelser av undersøkelsesfunn fra eksisterende eller historiske journalsystemer til arketypeformat ved å benytte dataelementet \"Klinisk beskrivelse\"."> + misuse = <"Skal ikke brukes til å ta opp anamnese - bruk da spesifikke OBSERVATION og CLUSTER arketyper. For eksempel OBSERVATION.story og CLUSTER.symptom_sign. + +Skal ikke brukes for å registrere funn ved bildeundersøkelse - bruk arketype innen gruppen av CLUSTER.imaging_exam (Bildeundersøkelse) for dette."> + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["el"] = < + language = <[ISO_639-1::el]> + purpose = <"Για την καταγραφή των ευρημάτων που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose.(en)"> + > + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"To record the findings observed during the physical examination of a body system or anatomical structure."> + use = <"Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element."> + misuse = <"Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose."> + copyright = <"© openEHR Foundation"> + > + ["es"] = < + language = <[ISO_639-1::es]> + purpose = <"Registrar los hallazgos observados durante el examen físico de un sistema corporal o estructura anatómica."> + use = <"Se utiliza para registrar los hallazgos observados durante la exploración física de un sistema corporal o estructura anatómica. + +Este arquetipo se ha diseñado específicamente para su uso en el SLOT \"Detalle del examen\" dentro de OBSERVATION.exam o en el SLOT \"Detalle del procedimiento\" dentro de ACTION.procedure, pero también puede utilizarse dentro de otros arquetipos de ENTRY o CLUSTER, cuando sea clínicamente apropiado. Las especializaciones de este arquetipo se utilizarán para registrar los hallazgos de la exploración de sistemas corporales, estructuras anatómicas o zonas corporales más precisas identificadas. Cada especialización conservará la estructura subyacente de este arquetipo general como base y se ampliará añadiendo elementos específicos de la zona corporal. Si no hay una especialización adecuada disponible, utilice este arquetipo e identifique el sistema o la estructura que se examina utilizando el elemento de datos \"Sistema o estructura examinada\" y la ubicación en el cuerpo utilizando el elemento de datos \"Zona corporal\" o la ranura \"Zona corporal estructurada\". + +Interpretación de los hallazgos, por ejemplo, \"No se detecta ninguna anomalía\" o La presencia de inflamación moderada se puede registrar mediante el elemento de datos \"Interpretación clínica\". + +Se utiliza para proporcionar un marco en el que los arquetipos CLUSTER se pueden anidar en la ranura \"Hallazgos del examen\" para registrar hallazgos adicionales estructurados del examen físico. + +El arquetipo CLUSTER.exclusion_exam se puede anidar en la ranura \"Examen no realizado\" para registrar opcionalmente detalles explícitos sobre el examen no realizado. + +Se utiliza para incorporar las descripciones narrativas de los hallazgos clínicos en sistemas clínicos existentes o heredados en un formato arquetipado, mediante el elemento de datos \"Descripción clínica\"."> + misuse = <"No debe utilizarse para registrar la historia clínica; utilice los arquetipos específicos OBSERVATION y CLUSTER. Por ejemplo, OBSERVATION.story y CLUSTER.symptom_sign. + +No debe utilizarse para registrar los resultados de un examen de imagen; utilice la familia de arquetipos CLUSTER.imaging_exam para este fin."> + > + ["ca"] = < + language = <[ISO_639-1::ca]> + purpose = <"Registrar les troballes observades durant l'examen físic del cos o estructura anatòmica."> + use = <"S'utilitza per registrar les troballes observades durant l'examen físic del cos o estructura anatòmica. + +Aquest arquetip ha estat dissenyat específicament per a ser utilitzat en el SLOT 'Examination detail' dins de l'OBSERVATION.exam o del SLOT \"Procedure detail\" dins de l'arquetip ACTION.procedure, però també es pot utilitzar dins d'altres arquetips ENTRY o CLUSTER, quan sigui clínicament apropiat. Les especialitzacions d'aquest arquetip s'utilitzaran per registrar els resultats de l'examen per a sistemes corporals identificats, estructures anatòmiques o llocs corporals més precisos. Cada especialització preservarà com a base l'estructura subjacent d'aquest arquetip general i s'ampliarà mitjançant l'addició d'elements específics al cos. Si no hi ha una especialització adequada disponible, utilitzeu aquest arquetip i identifiqueu el sistema o estructura que s'està examinant utilitzant l'element de dades \"Sistema o estructura examinada\" i la ubicació en el cos utilitzant l'element de dades \"lloc del cos\" o la RANURA \"lloc del cos estructurat\". + +La interpretació de les troballes, per exemple 'No s'ha detectat cap anormalitat' o 'inflamació present moderada', es pot registrar utilitzant l'element de dades 'interpretació clínica'. + +S'utilitza per proporcionar un marc en el qual els arquetips de CLUSTER poden ser afegits en el SLOT \"Troballes de l'examen\" per registrar resultats d'un examen físic estructurats addicionals. + +L'arquetip CLUSTER.exclusion_exam es pot afegir dins del SLOT 'Examen no realitzat' per tal de registrar opcionalment detalls explícits sobre l'examen que no s'està realitzant. + +Incorporar les descripcions narratives de les troballes clíniques dins dels sistemes clínics existents o llegats en un format arquetipat, utilitzant l'element de dades de \"Descripció clínica\"."> + misuse = <"No s'ha d'utilitzar per registrar la història clínica - utilitzar els arquetipis OBSERVATION i CLUSTER. Exemple: OBSERVATION.story i CLUSTER.symptom_sign. + +No s'ha d'utilitzar per registrar els resultats d'un examen d'imatge - utilitzar la família d'arquetips CLUSTER.imaging_exam per a aquest propòsit."> + > + > + lifecycle_state = <"published"> + other_contributors = <"Vebjørn Arntzen, Oslo University Hospital, Norway (openEHR Editor)", "Silje Ljosland Bakke, Nasjonal IKT HF, Norway (openEHR Editor)", "SB Bhattacharyya, Sudisa Consultancy Services, India", "Lisbeth Dahlhaug, Helse Midt - Norge IT, Norway", "Shahla Foozonkhah, Iran ministry of health and education, Iran", "Hildegard Franke, freshEHR Clinical Informatics Ltd., United Kingdom (openEHR Editor)", "Mikkel Gaup Grønmo, FSE, Helse Nord, Norway (Nasjonal IKT redaktør)", "Ingrid Heitmann, Oslo universitetssykehus HF, Norway", "Hilde Hollås, DIPS ASA, Norway", "Evelyn Hovenga, EJSH Consulting, Australia", "Lars Ivar Mehlum, Helse Bergen HF, Norway", "Sabine Leh, Haukeland University Hospital, Department of Pathology, Norway", "Heather Leslie, Atomica Informatics, Australia (openEHR Editor)", "Ian McNicoll, freshEHR Clinical Informatics, United Kingdom", "Lars Morgan Karlsen, DIPS ASA, Norway", "Bjørn Næss, DIPS ASA, Norway", "Andrej Orel, Marand d.o.o., Slovenia", "Vladimir Pizzo, Hospital Sírio Libanês, Brazil", "Jussara Rotzsch, UNB, Brazil", "Anoop Shah, University College London, United Kingdom", "Line Silsand, Universitetssykehuset i Nord-Norge, Norway", "Norwegian Review Summary, Nasjonal IKT HF, Norway", "Nyree Taylor, Ocean Informatics, Australia (openEHR Editor)", "Rowan Thomas, St. Vincent's Hospital Melbourne, Australia", "Jon Tysdahl, Furst medlab AS, Norway", "John Tore Valand, Helse Bergen, Norway (openEHR Editor)"> + other_details = < + ["licence"] = <"This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/."> + ["custodian_organisation"] = <"openEHR Foundation"> + ["current_contact"] = <"Heather Leslie, Atomica Informatics, Australia"> + ["original_namespace"] = <"org.openehr"> + ["original_publisher"] = <"openEHR Foundation"> + ["custodian_namespace"] = <"org.openehr"> + ["MD5-CAM-1.0.1"] = <"419545A4ABAC8966511DFB6F7F5993EA"> + ["build_uid"] = <"06eaf774-4c3f-455d-ba3c-cdb5d81b4e0a"> + ["ip_acknowledgements"] = <"This artefact includes content from SNOMED Clinical Terms® (SNOMED CT®) which is copyrighted material of the International Health Terminology Standards Development Organisation (IHTSDO). Where an implementation of this artefact makes use of SNOMED CT content, the implementer must have the appropriate SNOMED CT Affiliate license - for more information contact http://www.snomed.org/snomed-ct/get-snomedct or info@snomed.org."> + ["revision"] = <"2.1.3"> + > + +definition + CLUSTER[at0000] matches { -- Physical examination findings + items cardinality matches {1..*; unordered} matches { + ELEMENT[at0001] matches { -- System or structure examined + value matches { + DV_TEXT matches {*} + } + } + ELEMENT[at0012] occurrences matches {0..1} matches { -- Body site + value matches { + DV_TEXT matches {*} + } + } + allow_archetype CLUSTER[at0011] occurrences matches {0..*} matches { -- Structured body site + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location(-[a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.anatomical_location_circle(-[a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.anatomical_location_relative(-[a-zA-Z0-9_]+)*\.v2/} + } + ELEMENT[at0003] occurrences matches {0..1} matches { -- Clinical description + value matches { + DV_TEXT matches {*} + } + } + allow_archetype CLUSTER[at0004] occurrences matches {0..*} matches { -- Examination findings + include + archetype_id/value matches {/.*/} + } + allow_archetype CLUSTER[at0005] occurrences matches {0..*} matches { -- Multimedia representation + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.media_file(-[a-zA-Z0-9_]+)*\.v1/} + } + ELEMENT[at0006] occurrences matches {0..*} matches { -- Clinical interpretation + value matches { + DV_TEXT matches {*} + } + } + ELEMENT[at0007] occurrences matches {0..1} matches { -- Comment + value matches { + DV_TEXT matches {*} + } + } + allow_archetype CLUSTER[at0008] occurrences matches {0..*} matches { -- Examination not done + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.exclusion_exam(-[a-zA-Z0-9_]+)*\.v1/} + } + } + } + + +ontology + term_definitions = < + ["en"] = < + items = < + ["at0000"] = < + text = <"Physical examination findings"> + description = <"Findings observed during the physical examination of a body system or anatomical structure."> + > + ["at0001"] = < + text = <"System or structure examined"> + description = <"Identification of the examined body system or anatomical structure."> + comment = <"Coding of the system or structure examined with a terminology is preferred, where possible."> + > + ["at0003"] = < + text = <"Clinical description"> + description = <"Narrative description of the overall findings observed during the physical examination."> + > + ["at0004"] = < + text = <"Examination findings"> + description = <"Structured details about the physical examination findings."> + > + ["at0005"] = < + text = <"Multimedia representation"> + description = <"Digital image, video or diagram representing the physical examination findings."> + > + ["at0006"] = < + text = <"Clinical interpretation"> + description = <"Single word, phrase or brief description that represents the clinical meaning and significance of the physical examination findings."> + comment = <"For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible."> + > + ["at0007"] = < + text = <"Comment"> + description = <"Additional narrative about the physical examination findings, not captured in other fields."> + > + ["at0008"] = < + text = <"Examination not done"> + description = <"Details to explicitly record that this examination was not performed."> + > + ["at0011"] = < + text = <"Structured body site"> + description = <"A structured description of the area of the body under examination."> + comment = <"If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant."> + > + ["at0012"] = < + text = <"Body site"> + description = <"Identification of the area of the body under examination."> + comment = <"For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant."> + > + > + > + ["nb"] = < + items = < + ["at0000"] = < + text = <"Funn ved fysisk undersøkelse"> + description = <"Undersøkelsesfunn gjort ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + > + ["at0001"] = < + text = <"Undersøkt organsystem eller struktur"> + description = <"Identifisering av det undersøkte organsystemet eller den anatomiske strukturen."> + comment = <"Det anbefales å kode organsystem eller den anatomiske strukturen med en terminologi dersom mulig."> + > + ["at0003"] = < + text = <"Klinisk beskrivelse"> + description = <"Fritekstbeskrivelse av de overordnede funnene ved den fysiske undersøkelsen."> + > + ["at0004"] = < + text = <"Spesifikke funn"> + description = <"Ytterligere strukturerte detaljer om undersøkelsesfunnene."> + > + ["at0005"] = < + text = <"Multimediarepresentasjon"> + description = <"Digitale bilder, video eller diagram som representerer undersøkelsesfunnene."> + > + ["at0006"] = < + text = <"Fortolkning"> + description = <"Enkelt ord, setning, frase eller kort beskrivelse som representerer den kliniske betydning og viktigheten av funnene ved den fysiske undersøkelsen."> + comment = <"For eksempel \"Uten anmerkning\" eller \"Moderat inflammasjon\". Det anbefales å kode \"Fortolkning\" med en terminologi dersom mulig."> + > + ["at0007"] = < + text = <"Kommentar"> + description = <"Ytterligere fritekst om funn ved undersøkelsen, som ikke dekkes av andre elementer."> + > + ["at0008"] = < + text = <"Undersøkelse ikke utført"> + description = <"Detaljer for å eksplisitt registrere at denne undersøkelsen ikke ble utført."> + > + ["at0011"] = < + text = <"Strukturert anatomisk lokalisasjon"> + description = <"Angivelse av en strukturert anatomisk lokalisering av det undersøkte organsystemet eller den anatomiske strukturen."> + comment = <"Hvis anatomisk lokalisasjon er entydig identifisert i elementet \"Undersøkt organsystem eller struktur\" er dette SLOT'et ikke nødvendig å benytte."> + > + ["at0012"] = < + text = <"Anatomisk lokalisasjon"> + description = <"Identifisering av et enkelt fysisk sted enten på eller i menneskekroppen."> + comment = <"For eksempel undersøkelse av et spesifikt område på huden. Dersom den anatomiske lokaliseringen allerede er identifisert i elementet \"Undersøkt organsystem eller struktur\" er dette dataelementet overflødig."> + > + > + > + ["pt-br"] = < + items = < + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"Constatações observadas durante o exame físico de um sistema corporal ou estrutura anatômica."> + > + ["at0001"] = < + text = <"Sistema ou estrutura examinada"> + description = <"Identificação do sistema do corpo examinado ou da estrutura anatômica."> + comment = <"A codificação do sistema ou estrutura examinada com uma terminologia é preferível, sempre que possível."> + > + ["at0003"] = < + text = <"Descrição clínica"> + description = <"Descrição narrativa dos achados gerais observados durante o exame físico."> + > + ["at0004"] = < + text = <"Resultados do exame"> + description = <"Detalhes estruturados sobre os resultados do exame físico."> + > + ["at0005"] = < + text = <"Representação multimídia"> + description = <"Imagem digital, vídeo ou diagrama representando os achados do exame físico."> + > + ["at0006"] = < + text = <"Interpretação clínica"> + description = <"Palavra, frase ou breve descrição que represente o significado clínico e o significado dos resultados do exame físico."> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible. (en)"> + > + ["at0007"] = < + text = <"Comentário"> + description = <"Narrativa adicional sobre os achados do exame físico, não capturados em outros campos."> + > + ["at0008"] = < + text = <"Exame não realizado"> + description = <"Detalhes para registrar explicitamente que esse exame não foi realizado."> + > + ["at0011"] = < + text = <"Local do corpo estruturado"> + description = <"Uma descrição estruturada da área do corpo em exame."> + comment = <"Se o local do corpo tiver sido totalmente identificado no elemento de dados 'Sistema ou estrutura examinada' ou 'Local do corpo', esse SLOT se tornará redundante."> + > + ["at0012"] = < + text = <"Local do corpo"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + ["de"] = < + items = < + ["at0000"] = < + text = <"Ergebnisse der körperlichen Untersuchung"> + description = <"Während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachtete Befunde."> + > + ["at0001"] = < + text = <"Untersuchtes System oder untersuchte Struktur"> + description = <"Identifizierung des untersuchten Körpersystems oder der anatomischen Struktur."> + comment = <"Wenn möglich wird die Kodierung des untersuchten Systems oder der untersuchten Struktur mit einer Terminologie bevorzugt."> + > + ["at0003"] = < + text = <"Klinische Beschreibung"> + description = <"Beschreibung der bei der körperlichen Untersuchung beobachteten Gesamtbefunde."> + > + ["at0004"] = < + text = <"Untersuchungsergebnisse"> + description = <"Strukturierte Angaben zu den Ergebnissen der körperlichen Untersuchung."> + > + ["at0005"] = < + text = <"Multimediale Darstellung"> + description = <"Digitales Bild, Video oder Diagramm, das die Ergebnisse der körperlichen Untersuchung darstellt."> + > + ["at0006"] = < + text = <"Klinische Interpretation"> + description = <"Ein einzelnes Wort, eine Phrase oder eine kurze Beschreibung, die die klinische Bedeutung und Wichtigkeit der Untersuchungsergebnisse darstellt."> + comment = <"Zum Beispiel: „Ohne Befund“ oder „Mäßige Entzündung vorhanden“. Wenn möglich, wird die Codierung der „Klinischen Interpretation“ mit einer Terminologie bevorzugt."> + > + ["at0007"] = < + text = <"Kommentar"> + description = <"Zusätzliche Beschreibung der Ergebnisse der körperlichen Untersuchung, die in anderen Bereichen nicht erfasst werden konnten."> + > + ["at0008"] = < + text = <"Nicht durchgeführte Untersuchung"> + description = <"Eine Aussage die ausdrücklich erfasst, dass die Untersuchung nicht durchgeführt wurde."> + > + ["at0011"] = < + text = <"Strukturierte Körperstelle"> + description = <"Eine strukturierte Beschreibung des zu untersuchenden Körperbereichs."> + comment = <"Wenn die Körperstelle im Datenelement \"Untersuchtes System oder untersuchte Struktur\" oder im Datenelement \"Körperstelle\" vollständig identifiziert wurde, wird die Verwendung dieses SLOT überflüssig."> + > + ["at0012"] = < + text = <"Körperstelle"> + description = <"Identifizierung des untersuchten Körperbereichs."> + comment = <"Zum Beispiel die Untersuchung einer bestimmten Hautpartie. Wenn die Körperstelle im Datenelement „Untersuchtes System oder Struktur“ vollständig identifiziert wurde, wird dieses Datenelement überflüssig."> + > + > + > + ["sv"] = < + items = < + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"Observerade fynd vid fysisk undersökning av system i kroppen, eller av anatomisk struktur"> + > + ["at0001"] = < + text = <"System eller struktur som undersökts"> + description = <"Identifiering av systemet eller strukturen som undersökts."> + comment = <"Om möjligt, koda systemet eller strukturen med hjälp av ett terminologisystem."> + > + ["at0003"] = < + text = <"Klinisk beskrivning"> + description = <"En övergripande beskrivning av fynden från den fysiska undersökningen. "> + > + ["at0004"] = < + text = <"Fynd vid undersökning"> + description = <"Strukturerade detaljer om fynd vid den fysiska undersökningen."> + > + ["at0005"] = < + text = <"Multimedia-representation"> + description = <"Digital bild, video eller diagram som återger fynd från undersökningen."> + > + ["at0006"] = < + text = <"Klinisk tolkning"> + description = <"Ord, fras eller kort beskrivning av fyndens kliniska betydelse."> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible. (en)"> + > + ["at0007"] = < + text = <"Kommentar"> + description = <"Kommentarer avseende undersökningsfynd som inte beskrivs i övriga fält."> + > + ["at0008"] = < + text = <"Undersökning ej genomförd"> + description = <"Detaljerad beskrivning om att undersökningen inte genomfördes."> + > + ["at0011"] = < + text = <"Strukturerad anatomisk plats"> + description = <"Strukturerad beskrivning av den anatomiska platsen som undersökts."> + comment = <"Om den anatomiska platsen kan identifieras helt via dataelementet \"System eller struktur som undersökts\" så blir denna del redundant."> + > + ["at0012"] = < + text = <"Anatomisk plats"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + ["el"] = < + items = < + ["at0000"] = < + text = <"*Physical examination findings (en)"> + description = <"Ευρήματα που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + > + ["at0001"] = < + text = <"Εξεταζόμενο σύστημα ή δομή"> + description = <"Ταυτοποίηση του εξεταζόμενου συστήματος σώματος ή ανατομικής δομής."> + comment = <"Προτιμάται η κωδικοποίηση του συστήματος ή της δομής που εξετάζεται με ορολογία, όπου είναι δυνατόν."> + > + ["at0003"] = < + text = <"Κλινική Περιγραφή"> + description = <"Αφηγηματική περιγραφή των συνολικών ευρημάτων που παρατηρήθηκαν κατά τη διάρκεια της φυσικής εξέτασης."> + > + ["at0004"] = < + text = <"Ευρήματα εξέτασης"> + description = <"Δομημένες λεπτομέρειες σχετικά με τα ευρήματα της φυσικής εξέτασης."> + > + ["at0005"] = < + text = <"Αναπαράσταση πολυμέσων"> + description = <"Ψηφιακή εικόνα, βίντεο ή διάγραμμα που αναπαριστά τα ευρήματα της φυσικής εξέτασης."> + > + ["at0006"] = < + text = <"Κλινική αξιολόγηση"> + description = <"Μία λέξη, φράση ή σύντομη περιγραφή που αντιπροσωπεύει την κλινική σημασία και σημασία των ευρημάτων της φυσικής εξέτασης."> + comment = <"Για παράδειγμα: «Δεν ανιχνεύθηκε ανωμαλία» ή «Υπάρχει μέτρια φλεγμονή». Προτιμάται η κωδικοποίηση της «κλινικής ερμηνείας» με ορολογία, όπου είναι δυνατόν."> + > + ["at0007"] = < + text = <"Σχόλιο"> + description = <"Πρόσθετη αφήγηση σχετικά με τα ευρήματα της φυσικής εξέτασης, που δεν αποτυπώνεται σε άλλους τομείς."> + > + ["at0008"] = < + text = <"Λόγος διακοπής εξέτασης"> + description = <"Λεπτομέρειες για να καταγραφεί ρητά ότι αυτή η εξέταση δεν διενεργήθηκε."> + > + ["at0011"] = < + text = <"ω"> + description = <"περιγραφή της περιοχής του υπό εξέταση σώματος."> + comment = <"*If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant.(en)"> + > + ["at0012"] = < + text = <"Περιοχή σώματος"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + > + ["es"] = < + items = < + ["at0000"] = < + text = <"Hallazgos de la exploración física"> + description = <"Hallazgos observados durante la exploración física de un sistema corporal o estructura anatómica."> + > + ["at0001"] = < + text = <"Sistema o estructura examinada"> + description = <"Identificación del sistema corporal o estructura anatómica examinados."> + comment = <"Se prefiere, siempre que sea posible, codificar el sistema o la estructura examinada con una terminología."> + > + ["at0003"] = < + text = <"Descripción clínica"> + description = <"Descripción narrativa de los hallazgos generales observados durante la exploración física."> + > + ["at0004"] = < + text = <"Hallazgos de la exploración"> + description = <"Detalles estructurados sobre los hallazgos de la exploración física."> + > + ["at0005"] = < + text = <"Representación multimedia"> + description = <"Imagen digital, video o diagrama que representa los hallazgos de la exploración física."> + > + ["at0006"] = < + text = <"Interpretación clínica"> + description = <"Palabra, frase o descripción breve que representa el significado clínico y la importancia de los hallazgos de la exploración física."> + comment = <"Por ejemplo: \"No se detecta ninguna anomalía\" o \"Inflamación moderada\". Se prefiere codificar la \"Interpretación clínica\" con una terminología, siempre que sea posible."> + > + ["at0007"] = < + text = <"Comentario"> + description = <"Narración adicional sobre los hallazgos de la exploración física, no registrada en otros campos."> + > + ["at0008"] = < + text = <"Examen no realizado"> + description = <"Detalles para registrar explícitamente que esta exploración no se realizó."> + > + ["at0011"] = < + text = <"Zona corporal estructurada"> + description = <"Descripción estructurada de la zona del cuerpo examinada."> + comment = <"Si la zona corporal se ha identificado completamente en los elementos de datos «Sistema o estructura examinada» o «Zona corporal», esta ranura se vuelve redundante."> + > + ["at0012"] = < + text = <"Zona corporal"> + description = <"Identificación de la zona del cuerpo examinada."> + comment = <"Por ejemplo, el examen de una zona específica de la piel. Si la zona corporal se ha identificado completamente en los elementos de datos «Sistema o estructura examinada», este elemento se vuelve redundante."> + > + > + > + ["ca"] = < + items = < + ["at0000"] = < + text = <"Resultats de l'examen físic"> + description = <"Troballes observades durant l'examen físic d'un sistema corporal o estructura anatòmica."> + > + ["at0001"] = < + text = <"Sistema o estructura examinada"> + description = <"Identificació del sistema corporal examinat o estructura anatòmica."> + comment = <"Preferiblement utilitzar la codificació del sistema o estructura examinada amb una terminologia, sempre que sigui possible."> + > + ["at0003"] = < + text = <"Descripció clínica"> + description = <"Descripció narrativa dels resultats globals observats durant l'examen físic."> + > + ["at0004"] = < + text = <"Resultats de l'examen"> + description = <"Detalls estructurats sobre els resultats de l'examen físic."> + > + ["at0005"] = < + text = <"Representació multimèdia"> + description = <"Imatge digital, vídeo o diagrama que representa els resultats de l'examen físic."> + > + ["at0006"] = < + text = <"Interpretació clínica"> + description = <"Paraula única, frase o breu descripció que representa el significat clínic i la significació de les troballes de l'examen físic."> + comment = <"Exemple: 'No s'ha detectat cap anormalitat' o 'inflamació present moderada'. Es prefereix la codificació de la \"interpretació clínica\" amb una terminologia, sempre que sigui possible."> + > + ["at0007"] = < + text = <"Comentari"> + description = <"Narrativa addicional sobre els resultats de l'examen físic, no capturada en altres camps."> + > + ["at0008"] = < + text = <"Examen no realitzat"> + description = <"Detalls per registrar explícitament que aquest examen no es va realitzar."> + > + ["at0011"] = < + text = <"Part del cos estructurada"> + description = <"Descripció estructurada de l'àrea del cos objecte d'examen."> + comment = <"Si el lloc del cos ha estat completament identificat en el \"Sistema o estructura examinada\" o l'element de dades del \"lloc cos\", aquest SLOT es torna redundant."> + > + ["at0012"] = < + text = <"Part del cos"> + description = <"Identificació de l'àrea de l'organisme objecte d'examen."> + comment = <"Exemple: l'examen d'una àrea específica de la pell. Si el lloc del cos ha estat completament identificat en l'element de dades \"Sistema o estructura examinada\", aquest element de dades esdevé redundant."> + > + > + > + > diff --git a/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl2_id.v2.1.3.adls b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl2_id.v2.1.3.adls new file mode 100644 index 000000000..3704e3ac9 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-CLUSTER.exam_adl2_id.v2.1.3.adls @@ -0,0 +1,656 @@ +archetype (adl_version=2.0.6; rm_release=1.1.0; generated; uid=7bed0e4b-3603-4a0a-8f20-75b80d81be9b; build_uid=06eaf774-4c3f-455d-ba3c-cdb5d81b4e0a) + openEHR-EHR-CLUSTER.exam.v2.1.3 + +language + original_language = <[ISO_639-1::en]> + translations = < + ["de"] = < + language = <[ISO_639-1::de]> + author = < + ["name"] = <"Nina Schewe, Natalia Strauch, Darin Leonhardt"> + ["organisation"] = <"Medizinische Hochschule Hannover, PLRI für medizinische Informatik/ Medizinische Hochschule"> + ["email"] = <"schewe.nina@mh-hannover.de, Strauch.Natalia@mh-hannover.de, leonhardt.darin@mh-hannover.de"> + > + > + ["sv"] = < + language = <[ISO_639-1::sv]> + author = < + ["name"] = <"Erik Sundvall"> + ["organisation"] = <"Region Östergötland + Linköping University"> + ["email"] = <"erik.sundvall@regionostergotland.se"> + > + > + ["nb"] = < + language = <[ISO_639-1::nb]> + author = < + ["name"] = <"Silje Ljosland Bakke, Vebjørn Arntzen"> + ["organisation"] = <"Nasjonal IKT HF, Oslo University Hospital"> + ["email"] = <"varntzen@ous-hf.no"> + > + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + author = < + ["name"] = <"Adriana Kitajima"> + ["organisation"] = <"Hospital Alemão Oswaldo Cruz - HAOC"> + ["email"] = <"adrianakitajima@gmail.com"> + > + > + ["el"] = < + language = <[ISO_639-1::el]> + author = < + ["name"] = <"Erasmia Partafylla"> + ["organisation"] = <"Sigmasoft"> + ["email"] = <"c.partafylla@sigmasoft.gr"> + > + > + ["es"] = < + language = <[ISO_639-1::es]> + author = < + ["name"] = <"Julio de Sosa, Clara Calleja Vega"> + ["organisation"] = <"Servei Català de la Salut, CatSalut. Servei Català de la Salut."> + ["email"] = <"juliodesosa@catsalut.cat, ccalleja@catsalut.cat"> + > + > + ["ca"] = < + language = <[ISO_639-1::ca]> + author = < + ["name"] = <"Laura Moral López"> + ["organisation"] = <"Sistema de Salut de Catalunya"> + ["email"] = <"lauramoral@catsalut.cat"> + > + other_details = < + ["other_contributors"] = <"Tradcrea"> + > + > + > + +description + original_author = < + ["name"] = <"Heather Leslie"> + ["organisation"] = <"Atomica Informatics"> + ["email"] = <"heather.leslie@atomicainformatics.com"> + ["date"] = <"2015-06-23"> + > + original_namespace = <"org.openehr"> + original_publisher = <"openEHR Foundation"> + other_contributors = <"Vebjørn Arntzen, Oslo University Hospital, Norway (openEHR Editor)", "Silje Ljosland Bakke, Nasjonal IKT HF, Norway (openEHR Editor)", "SB Bhattacharyya, Sudisa Consultancy Services, India", "Lisbeth Dahlhaug, Helse Midt - Norge IT, Norway", "Shahla Foozonkhah, Iran ministry of health and education, Iran", "Hildegard Franke, freshEHR Clinical Informatics Ltd., United Kingdom (openEHR Editor)", "Mikkel Gaup Grønmo, FSE, Helse Nord, Norway (Nasjonal IKT redaktør)", "Ingrid Heitmann, Oslo universitetssykehus HF, Norway", "Hilde Hollås, DIPS ASA, Norway", "Evelyn Hovenga, EJSH Consulting, Australia", "Lars Ivar Mehlum, Helse Bergen HF, Norway", "Sabine Leh, Haukeland University Hospital, Department of Pathology, Norway", "Heather Leslie, Atomica Informatics, Australia (openEHR Editor)", "Ian McNicoll, freshEHR Clinical Informatics, United Kingdom", "Lars Morgan Karlsen, DIPS ASA, Norway", "Bjørn Næss, DIPS ASA, Norway", "Andrej Orel, Marand d.o.o., Slovenia", "Vladimir Pizzo, Hospital Sírio Libanês, Brazil", "Jussara Rotzsch, UNB, Brazil", "Anoop Shah, University College London, United Kingdom", "Line Silsand, Universitetssykehuset i Nord-Norge, Norway", "Norwegian Review Summary, Nasjonal IKT HF, Norway", "Nyree Taylor, Ocean Informatics, Australia (openEHR Editor)", "Rowan Thomas, St. Vincent's Hospital Melbourne, Australia", "Jon Tysdahl, Furst medlab AS, Norway", "John Tore Valand, Helse Bergen, Norway (openEHR Editor)"> + lifecycle_state = <"published"> + custodian_namespace = <"org.openehr"> + custodian_organisation = <"openEHR Foundation"> + licence = <"This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/."> + ip_acknowledgements = < + ["1"] = <"This artefact includes content from SNOMED Clinical Terms® (SNOMED CT®) which is copyrighted material of the International Health Terminology Standards Development Organisation (IHTSDO). Where an implementation of this artefact makes use of SNOMED CT content, the implementer must have the appropriate SNOMED CT Affiliate license - for more information contact http://www.snomed.org/snomed-ct/get-snomedct or info@snomed.org."> + > + other_details = < + ["current_contact"] = <"Heather Leslie, Atomica Informatics, Australia"> + ["MD5-CAM-1.0.1"] = <"419545A4ABAC8966511DFB6F7F5993EA"> + > + details = < + ["de"] = < + language = <[ISO_639-1::de]> + purpose = <"Aufzeichnung der bei der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachteten Befunde."> + use = <"Zur Aufzeichnung der beobachteten Befunde während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur. + +Dieser Archetyp wurde speziell für die Verwendung im SLOT „Untersuchungsdetails“ innerhalb des Archetyps OBSERVATION.exam oder im SLOT „Verfahrensdetails“ innerhalb des Archetyps ACTION.procedure entwickelt, kann aber auch innerhalb anderer Archetypen ENTRY oder CLUSTER verwendet werden, sofern dies klinisch sinnvoll ist. Spezialisierungen dieses Archetyps werden verwendet, um Untersuchungsergebnisse für bestimmte Körpersysteme, anatomische Strukturen oder genauere Körperstellen zu erfassen. Jede Spezialisierung behält die Grundstruktur dieses allgemeinen Archetyps als Basis bei und wird durch die Hinzufügung von Elementen erweitert, die für die Körperstelle spezifisch sind. Steht keine geeignete Spezialisierung zur Verfügung, ist dieser Archetyp zu verwenden und das untersuchte System oder die untersuchte Struktur mit dem Datenelement „System oder untersuchte Struktur“ und die Körperstelle mit dem Datenelement „Körperstelle“ oder dem SLOT „Strukturierte Körperstelle“ anzugeben. + +Die Interpretation der Befunde, z. B. „Keine Abnormität festgestellt“ oder „Mäßige Entzündung vorhanden“, kann mit dem Datenelement „Klinische Interpretation“ erfasst werden. + +Verwendung zur Bereitstellung eines Rahmens, in dem CLUSTER-Archetypen im SLOT „Untersuchungsbefund“ verschachtelt werden können, um zusätzliche strukturierte körperliche Untersuchungsbefunde zu erfassen. + +Der Archetyp CLUSTER.exclusion_exam kann in den SLOT „Nicht durchgeführte Untersuchung“ geschachtelt werden, um optional explizite Details über die nicht durchgeführte Untersuchung zu erfassen. + +Verwenden Sie das Datenelement „Klinische Beschreibung“, um die narrativen Beschreibungen klinischer Befunde innerhalb bestehender oder vorhandener klinischer Systeme in ein archetypisches Format einzubinden."> + misuse = <"Nicht zur Darstellung der klinischen Anamnese zu verwenden – verwenden Sie spezifische OBSERVATION- und CLUSTER-Archetypen. Zum Beispiel OBSERVATION.story und CLUSTER.symptom_sign. + +Nicht zur Darstellung der Ergebnisse einer bildgebenden Untersuchung verwenden – verwenden Sie für diesen Zweck die Archetypenfamilie CLUSTER.imaging_exam."> + > + ["sv"] = < + language = <[ISO_639-1::sv]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + keywords = <"fynd, undersökningsfynd, fysisk undersökning, u.a., utan anmärkning", ...> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["nb"] = < + language = <[ISO_639-1::nb]> + purpose = <"For å registrere observerte funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + use = <" +Bruk for å registrere observerte funn ved fysisk undersøkelse av et organsystem eller anatomisk struktur. + +Denne arketypen har vært designet spesifikt for å kunne brukes i SLOT'et \"Undersøkelsesdetaljer\" i arketypen OBSERVATION.exam (Funn ved fysisk undersøkelse) eller SLOT'et \"Prosedyredetaljer\" i arketypen ACTION.procedure (Prosedyre), men kan også bli brukt i andre ENTRY- eller CLUSTER-arketyper der det er klinisk passende. Spesialiseringer av denne arketypen for bestemte organsystem eller anatomiske strukturer kan brukes for å registrere undersøkelsesfunn for disse. Hver slik spesialisering vil bevare den underliggende strukturen til denne generiske arketypen som basis, og utvides med tilleggselementer som er spesifikk for den kroppsstrukturen spesialiseringen gjelder. Dersom det ikke finnes noen passende spesialisering, bruk denne arketypen og registrer organstrukturen eller den anatomiske strukturen i elementet \"Undersøkt organsystem eller struktur\" og lokalisering på kroppen i SLOT'et \"Anatomisk lokalisasjon\" eller \"Strukturert anatomisk lokalisasjon\". + +Tolkning av funn kan bli registrert i dataelementet \"Fortolkning\", for eksempel \"Uten anmerkning\" eller \"Moderat inflammasjon\". + +Kan også brukes som et rammeverk der man kan nøste CLUSTER-arketyper i SLOT'et \"Spesifikke funn\" for å registrere ytterligere strukturerte undersøkelsesfunn. + +Arketypen CLUSTER.exclusion_exam (Eksklusjon av en undersøkelse) kan nøstes inn i SLOT'et \"Undersøkelse ikke utført\" for å registrere begrunnelse eller detaljer om hvorfor undersøkelsen ikke ble utført. + +Brukes for å legge til fritekstlige beskrivelser av undersøkelsesfunn fra eksisterende eller historiske journalsystemer til arketypeformat ved å benytte dataelementet \"Klinisk beskrivelse\"."> + misuse = <"Skal ikke brukes til å ta opp anamnese - bruk da spesifikke OBSERVATION og CLUSTER arketyper. For eksempel OBSERVATION.story og CLUSTER.symptom_sign. + +Skal ikke brukes for å registrere funn ved bildeundersøkelse - bruk arketype innen gruppen av CLUSTER.imaging_exam (Bildeundersøkelse) for dette."> + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + purpose = <"*To record the findings observed during the physical examination of a body system or anatomical structure. (en)"> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose. (en)"> + > + ["el"] = < + language = <[ISO_639-1::el]> + purpose = <"Για την καταγραφή των ευρημάτων που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + use = <"*Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element. (en)"> + misuse = <"*Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose.(en)"> + > + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"To record the findings observed during the physical examination of a body system or anatomical structure."> + use = <"Use to record the observed findings during the physical examination of a body system or anatomical structure. + +This archetype has been specifically designed to be used in the 'Examination detail' SLOT within the OBSERVATION.exam or the \"Procedure detail\" SLOT within the ACTION.procedure archetype, but can also be used within other ENTRY or CLUSTER archetypes, where clinically appropriate. Specialisations of this archetype will be used to record examination findings for identified body systems, anatomical structures or more precise body sites. Each specialisation will preserve the underlying structure of this general archetype as its base and be extended by the addition of elements specific to the body site. If there is no appropriate specialisation available, use this archetype and identify the system or structure being examined using the 'System or structure examined' data element and the location on the body using the 'Body site' data element or the 'Structured body site' SLOT. + +Interpretation of the findings, for example 'No abnormality detected' or 'Moderate inflammation present', can be recorded using the 'Clinical interpretation' data element. + +Use to provide a framework in which CLUSTER archetypes can be nested in the 'Examination findings' SLOT to record additional structured physical examination findings. + +The CLUSTER.exclusion_exam archetype can be nested within the 'Examination not done' SLOT to optionally record explicit details about the examination not being performed. + +Use to incorporate the narrative descriptions of clinical findings within existing or legacy clinical systems into an archetyped format, using the 'Clinical Description' data element."> + misuse = <"Not to be used for recording the clinical history - use specific OBSERVATION and CLUSTER archetypes. For example OBSERVATION.story and CLUSTER.symptom_sign. + +Not to be used for recording the results of an imaging examination - use the CLUSTER.imaging_exam family of archetypes for this purpose."> + copyright = <"© openEHR Foundation"> + > + ["es"] = < + language = <[ISO_639-1::es]> + purpose = <"Registrar los hallazgos observados durante el examen físico de un sistema corporal o estructura anatómica."> + use = <"Se utiliza para registrar los hallazgos observados durante la exploración física de un sistema corporal o estructura anatómica. + +Este arquetipo se ha diseñado específicamente para su uso en el SLOT \"Detalle del examen\" dentro de OBSERVATION.exam o en el SLOT \"Detalle del procedimiento\" dentro de ACTION.procedure, pero también puede utilizarse dentro de otros arquetipos de ENTRY o CLUSTER, cuando sea clínicamente apropiado. Las especializaciones de este arquetipo se utilizarán para registrar los hallazgos de la exploración de sistemas corporales, estructuras anatómicas o zonas corporales más precisas identificadas. Cada especialización conservará la estructura subyacente de este arquetipo general como base y se ampliará añadiendo elementos específicos de la zona corporal. Si no hay una especialización adecuada disponible, utilice este arquetipo e identifique el sistema o la estructura que se examina utilizando el elemento de datos \"Sistema o estructura examinada\" y la ubicación en el cuerpo utilizando el elemento de datos \"Zona corporal\" o la ranura \"Zona corporal estructurada\". + +Interpretación de los hallazgos, por ejemplo, \"No se detecta ninguna anomalía\" o La presencia de inflamación moderada se puede registrar mediante el elemento de datos \"Interpretación clínica\". + +Se utiliza para proporcionar un marco en el que los arquetipos CLUSTER se pueden anidar en la ranura \"Hallazgos del examen\" para registrar hallazgos adicionales estructurados del examen físico. + +El arquetipo CLUSTER.exclusion_exam se puede anidar en la ranura \"Examen no realizado\" para registrar opcionalmente detalles explícitos sobre el examen no realizado. + +Se utiliza para incorporar las descripciones narrativas de los hallazgos clínicos en sistemas clínicos existentes o heredados en un formato arquetipado, mediante el elemento de datos \"Descripción clínica\"."> + misuse = <"No debe utilizarse para registrar la historia clínica; utilice los arquetipos específicos OBSERVATION y CLUSTER. Por ejemplo, OBSERVATION.story y CLUSTER.symptom_sign. + +No debe utilizarse para registrar los resultados de un examen de imagen; utilice la familia de arquetipos CLUSTER.imaging_exam para este fin."> + > + ["ca"] = < + language = <[ISO_639-1::ca]> + purpose = <"Registrar les troballes observades durant l'examen físic del cos o estructura anatòmica."> + use = <"S'utilitza per registrar les troballes observades durant l'examen físic del cos o estructura anatòmica. + +Aquest arquetip ha estat dissenyat específicament per a ser utilitzat en el SLOT 'Examination detail' dins de l'OBSERVATION.exam o del SLOT \"Procedure detail\" dins de l'arquetip ACTION.procedure, però també es pot utilitzar dins d'altres arquetips ENTRY o CLUSTER, quan sigui clínicament apropiat. Les especialitzacions d'aquest arquetip s'utilitzaran per registrar els resultats de l'examen per a sistemes corporals identificats, estructures anatòmiques o llocs corporals més precisos. Cada especialització preservarà com a base l'estructura subjacent d'aquest arquetip general i s'ampliarà mitjançant l'addició d'elements específics al cos. Si no hi ha una especialització adequada disponible, utilitzeu aquest arquetip i identifiqueu el sistema o estructura que s'està examinant utilitzant l'element de dades \"Sistema o estructura examinada\" i la ubicació en el cos utilitzant l'element de dades \"lloc del cos\" o la RANURA \"lloc del cos estructurat\". + +La interpretació de les troballes, per exemple 'No s'ha detectat cap anormalitat' o 'inflamació present moderada', es pot registrar utilitzant l'element de dades 'interpretació clínica'. + +S'utilitza per proporcionar un marc en el qual els arquetips de CLUSTER poden ser afegits en el SLOT \"Troballes de l'examen\" per registrar resultats d'un examen físic estructurats addicionals. + +L'arquetip CLUSTER.exclusion_exam es pot afegir dins del SLOT 'Examen no realitzat' per tal de registrar opcionalment detalls explícits sobre l'examen que no s'està realitzant. + +Incorporar les descripcions narratives de les troballes clíniques dins dels sistemes clínics existents o llegats en un format arquetipat, utilitzant l'element de dades de \"Descripció clínica\"."> + misuse = <"No s'ha d'utilitzar per registrar la història clínica - utilitzar els arquetipis OBSERVATION i CLUSTER. Exemple: OBSERVATION.story i CLUSTER.symptom_sign. + +No s'ha d'utilitzar per registrar els resultats d'un examen d'imatge - utilitzar la família d'arquetips CLUSTER.imaging_exam per a aquest propòsit."> + > + > + +definition + CLUSTER[id1] matches { -- Physical examination findings + items cardinality matches {1..*; unordered} matches { + ELEMENT[id2] occurrences matches {1} matches { -- System or structure examined + value matches { + DV_TEXT[id9000] + } + } + ELEMENT[id13] occurrences matches {0..1} matches { -- Body site + value matches { + DV_TEXT[id9001] + } + } + allow_archetype CLUSTER[id12] matches { -- Structured body site + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location(-[a-zA-Z0-9_]+)*\.v1\..*|openEHR-EHR-CLUSTER\.anatomical_location_circle(-[a-zA-Z0-9_]+)*\.v1\..*|openEHR-EHR-CLUSTER\.anatomical_location_relative(-[a-zA-Z0-9_]+)*\.v2\..*/} + } + ELEMENT[id4] occurrences matches {0..1} matches { -- Clinical description + value matches { + DV_TEXT[id9002] + } + } + allow_archetype CLUSTER[id5] matches { -- Examination findings + include + archetype_id/value matches {/.*/} + } + allow_archetype CLUSTER[id6] matches { -- Multimedia representation + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.media_file(-[a-zA-Z0-9_]+)*\.v1\..*/} + } + ELEMENT[id7] matches { -- Clinical interpretation + value matches { + DV_TEXT[id9003] + } + } + ELEMENT[id8] occurrences matches {0..1} matches { -- Comment + value matches { + DV_TEXT[id9004] + } + } + allow_archetype CLUSTER[id9] matches { -- Examination not done + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.exclusion_exam(-[a-zA-Z0-9_]+)*\.v1\..*/} + } + } + } + +terminology + term_definitions = < + ["de"] = < + ["id1"] = < + text = <"Ergebnisse der körperlichen Untersuchung"> + description = <"Während der körperlichen Untersuchung eines Körpersystems oder einer anatomischen Struktur beobachtete Befunde."> + > + ["id2"] = < + text = <"Untersuchtes System oder untersuchte Struktur"> + description = <"Identifizierung des untersuchten Körpersystems oder der anatomischen Struktur."> + comment = <"Wenn möglich wird die Kodierung des untersuchten Systems oder der untersuchten Struktur mit einer Terminologie bevorzugt."> + > + ["id4"] = < + text = <"Klinische Beschreibung"> + description = <"Beschreibung der bei der körperlichen Untersuchung beobachteten Gesamtbefunde."> + > + ["id5"] = < + text = <"Untersuchungsergebnisse"> + description = <"Strukturierte Angaben zu den Ergebnissen der körperlichen Untersuchung."> + > + ["id6"] = < + text = <"Multimediale Darstellung"> + description = <"Digitales Bild, Video oder Diagramm, das die Ergebnisse der körperlichen Untersuchung darstellt."> + > + ["id7"] = < + text = <"Klinische Interpretation"> + description = <"Ein einzelnes Wort, eine Phrase oder eine kurze Beschreibung, die die klinische Bedeutung und Wichtigkeit der Untersuchungsergebnisse darstellt."> + comment = <"Zum Beispiel: „Ohne Befund“ oder „Mäßige Entzündung vorhanden“. Wenn möglich, wird die Codierung der „Klinischen Interpretation“ mit einer Terminologie bevorzugt."> + > + ["id8"] = < + text = <"Kommentar"> + description = <"Zusätzliche Beschreibung der Ergebnisse der körperlichen Untersuchung, die in anderen Bereichen nicht erfasst werden konnten."> + > + ["id9"] = < + text = <"Nicht durchgeführte Untersuchung"> + description = <"Eine Aussage die ausdrücklich erfasst, dass die Untersuchung nicht durchgeführt wurde."> + > + ["id12"] = < + text = <"Strukturierte Körperstelle"> + description = <"Eine strukturierte Beschreibung des zu untersuchenden Körperbereichs."> + comment = <"Wenn die Körperstelle im Datenelement \"Untersuchtes System oder untersuchte Struktur\" oder im Datenelement \"Körperstelle\" vollständig identifiziert wurde, wird die Verwendung dieses SLOT überflüssig."> + > + ["id13"] = < + text = <"Körperstelle"> + description = <"Identifizierung des untersuchten Körperbereichs."> + comment = <"Zum Beispiel die Untersuchung einer bestimmten Hautpartie. Wenn die Körperstelle im Datenelement „Untersuchtes System oder Struktur“ vollständig identifiziert wurde, wird dieses Datenelement überflüssig."> + > + > + ["sv"] = < + ["id1"] = < + text = <"*Physical examination findings (en)"> + description = <"Observerade fynd vid fysisk undersökning av system i kroppen, eller av anatomisk struktur"> + > + ["id2"] = < + text = <"System eller struktur som undersökts"> + description = <"Identifiering av systemet eller strukturen som undersökts."> + comment = <"Om möjligt, koda systemet eller strukturen med hjälp av ett terminologisystem."> + > + ["id4"] = < + text = <"Klinisk beskrivning"> + description = <"En övergripande beskrivning av fynden från den fysiska undersökningen. "> + > + ["id5"] = < + text = <"Fynd vid undersökning"> + description = <"Strukturerade detaljer om fynd vid den fysiska undersökningen."> + > + ["id6"] = < + text = <"Multimedia-representation"> + description = <"Digital bild, video eller diagram som återger fynd från undersökningen."> + > + ["id7"] = < + text = <"Klinisk tolkning"> + description = <"Ord, fras eller kort beskrivning av fyndens kliniska betydelse."> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible. (en)"> + > + ["id8"] = < + text = <"Kommentar"> + description = <"Kommentarer avseende undersökningsfynd som inte beskrivs i övriga fält."> + > + ["id9"] = < + text = <"Undersökning ej genomförd"> + description = <"Detaljerad beskrivning om att undersökningen inte genomfördes."> + > + ["id12"] = < + text = <"Strukturerad anatomisk plats"> + description = <"Strukturerad beskrivning av den anatomiska platsen som undersökts."> + comment = <"Om den anatomiska platsen kan identifieras helt via dataelementet \"System eller struktur som undersökts\" så blir denna del redundant."> + > + ["id13"] = < + text = <"Anatomisk plats"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + ["nb"] = < + ["id1"] = < + text = <"Funn ved fysisk undersøkelse"> + description = <"Undersøkelsesfunn gjort ved fysisk undersøkelse av et organsystem eller anatomisk struktur."> + > + ["id2"] = < + text = <"Undersøkt organsystem eller struktur"> + description = <"Identifisering av det undersøkte organsystemet eller den anatomiske strukturen."> + comment = <"Det anbefales å kode organsystem eller den anatomiske strukturen med en terminologi dersom mulig."> + > + ["id4"] = < + text = <"Klinisk beskrivelse"> + description = <"Fritekstbeskrivelse av de overordnede funnene ved den fysiske undersøkelsen."> + > + ["id5"] = < + text = <"Spesifikke funn"> + description = <"Ytterligere strukturerte detaljer om undersøkelsesfunnene."> + > + ["id6"] = < + text = <"Multimediarepresentasjon"> + description = <"Digitale bilder, video eller diagram som representerer undersøkelsesfunnene."> + > + ["id7"] = < + text = <"Fortolkning"> + description = <"Enkelt ord, setning, frase eller kort beskrivelse som representerer den kliniske betydning og viktigheten av funnene ved den fysiske undersøkelsen."> + comment = <"For eksempel \"Uten anmerkning\" eller \"Moderat inflammasjon\". Det anbefales å kode \"Fortolkning\" med en terminologi dersom mulig."> + > + ["id8"] = < + text = <"Kommentar"> + description = <"Ytterligere fritekst om funn ved undersøkelsen, som ikke dekkes av andre elementer."> + > + ["id9"] = < + text = <"Undersøkelse ikke utført"> + description = <"Detaljer for å eksplisitt registrere at denne undersøkelsen ikke ble utført."> + > + ["id12"] = < + text = <"Strukturert anatomisk lokalisasjon"> + description = <"Angivelse av en strukturert anatomisk lokalisering av det undersøkte organsystemet eller den anatomiske strukturen."> + comment = <"Hvis anatomisk lokalisasjon er entydig identifisert i elementet \"Undersøkt organsystem eller struktur\" er dette SLOT'et ikke nødvendig å benytte."> + > + ["id13"] = < + text = <"Anatomisk lokalisasjon"> + description = <"Identifisering av et enkelt fysisk sted enten på eller i menneskekroppen."> + comment = <"For eksempel undersøkelse av et spesifikt område på huden. Dersom den anatomiske lokaliseringen allerede er identifisert i elementet \"Undersøkt organsystem eller struktur\" er dette dataelementet overflødig."> + > + > + ["pt-br"] = < + ["id1"] = < + text = <"*Physical examination findings (en)"> + description = <"Constatações observadas durante o exame físico de um sistema corporal ou estrutura anatômica."> + > + ["id2"] = < + text = <"Sistema ou estrutura examinada"> + description = <"Identificação do sistema do corpo examinado ou da estrutura anatômica."> + comment = <"A codificação do sistema ou estrutura examinada com uma terminologia é preferível, sempre que possível."> + > + ["id4"] = < + text = <"Descrição clínica"> + description = <"Descrição narrativa dos achados gerais observados durante o exame físico."> + > + ["id5"] = < + text = <"Resultados do exame"> + description = <"Detalhes estruturados sobre os resultados do exame físico."> + > + ["id6"] = < + text = <"Representação multimídia"> + description = <"Imagem digital, vídeo ou diagrama representando os achados do exame físico."> + > + ["id7"] = < + text = <"Interpretação clínica"> + description = <"Palavra, frase ou breve descrição que represente o significado clínico e o significado dos resultados do exame físico."> + comment = <"*For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible. (en)"> + > + ["id8"] = < + text = <"Comentário"> + description = <"Narrativa adicional sobre os achados do exame físico, não capturados em outros campos."> + > + ["id9"] = < + text = <"Exame não realizado"> + description = <"Detalhes para registrar explicitamente que esse exame não foi realizado."> + > + ["id12"] = < + text = <"Local do corpo estruturado"> + description = <"Uma descrição estruturada da área do corpo em exame."> + comment = <"Se o local do corpo tiver sido totalmente identificado no elemento de dados 'Sistema ou estrutura examinada' ou 'Local do corpo', esse SLOT se tornará redundante."> + > + ["id13"] = < + text = <"Local do corpo"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + ["el"] = < + ["id1"] = < + text = <"*Physical examination findings (en)"> + description = <"Ευρήματα που παρατηρούνται κατά τη φυσική εξέταση ενός συστήματος σώματος ή ανατομικής δομής."> + > + ["id2"] = < + text = <"Εξεταζόμενο σύστημα ή δομή"> + description = <"Ταυτοποίηση του εξεταζόμενου συστήματος σώματος ή ανατομικής δομής."> + comment = <"Προτιμάται η κωδικοποίηση του συστήματος ή της δομής που εξετάζεται με ορολογία, όπου είναι δυνατόν."> + > + ["id4"] = < + text = <"Κλινική Περιγραφή"> + description = <"Αφηγηματική περιγραφή των συνολικών ευρημάτων που παρατηρήθηκαν κατά τη διάρκεια της φυσικής εξέτασης."> + > + ["id5"] = < + text = <"Ευρήματα εξέτασης"> + description = <"Δομημένες λεπτομέρειες σχετικά με τα ευρήματα της φυσικής εξέτασης."> + > + ["id6"] = < + text = <"Αναπαράσταση πολυμέσων"> + description = <"Ψηφιακή εικόνα, βίντεο ή διάγραμμα που αναπαριστά τα ευρήματα της φυσικής εξέτασης."> + > + ["id7"] = < + text = <"Κλινική αξιολόγηση"> + description = <"Μία λέξη, φράση ή σύντομη περιγραφή που αντιπροσωπεύει την κλινική σημασία και σημασία των ευρημάτων της φυσικής εξέτασης."> + comment = <"Για παράδειγμα: «Δεν ανιχνεύθηκε ανωμαλία» ή «Υπάρχει μέτρια φλεγμονή». Προτιμάται η κωδικοποίηση της «κλινικής ερμηνείας» με ορολογία, όπου είναι δυνατόν."> + > + ["id8"] = < + text = <"Σχόλιο"> + description = <"Πρόσθετη αφήγηση σχετικά με τα ευρήματα της φυσικής εξέτασης, που δεν αποτυπώνεται σε άλλους τομείς."> + > + ["id9"] = < + text = <"Λόγος διακοπής εξέτασης"> + description = <"Λεπτομέρειες για να καταγραφεί ρητά ότι αυτή η εξέταση δεν διενεργήθηκε."> + > + ["id12"] = < + text = <"ω"> + description = <"περιγραφή της περιοχής του υπό εξέταση σώματος."> + comment = <"*If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant.(en)"> + > + ["id13"] = < + text = <"Περιοχή σώματος"> + description = <"*Identification of the area of the body under examination. (en)"> + comment = <"*For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant. (en)"> + > + > + ["en"] = < + ["id1"] = < + text = <"Physical examination findings"> + description = <"Findings observed during the physical examination of a body system or anatomical structure."> + > + ["id2"] = < + text = <"System or structure examined"> + description = <"Identification of the examined body system or anatomical structure."> + comment = <"Coding of the system or structure examined with a terminology is preferred, where possible."> + > + ["id4"] = < + text = <"Clinical description"> + description = <"Narrative description of the overall findings observed during the physical examination."> + > + ["id5"] = < + text = <"Examination findings"> + description = <"Structured details about the physical examination findings."> + > + ["id6"] = < + text = <"Multimedia representation"> + description = <"Digital image, video or diagram representing the physical examination findings."> + > + ["id7"] = < + text = <"Clinical interpretation"> + description = <"Single word, phrase or brief description that represents the clinical meaning and significance of the physical examination findings."> + comment = <"For example: 'No abnormality detected' or 'Moderate inflammation present'. Coding of the 'Clinical interpretation' with a terminology is preferred, where possible."> + > + ["id8"] = < + text = <"Comment"> + description = <"Additional narrative about the physical examination findings, not captured in other fields."> + > + ["id9"] = < + text = <"Examination not done"> + description = <"Details to explicitly record that this examination was not performed."> + > + ["id12"] = < + text = <"Structured body site"> + description = <"A structured description of the area of the body under examination."> + comment = <"If the body site has been fully identified in the 'System or structure examined' or the 'Body site' data element, this SLOT becomes redundant."> + > + ["id13"] = < + text = <"Body site"> + description = <"Identification of the area of the body under examination."> + comment = <"For example examination of a specific area of skin. If the body site has been fully identified in the 'System or structure examined' data element, this data element becomes redundant."> + > + > + ["es"] = < + ["id1"] = < + text = <"Hallazgos de la exploración física"> + description = <"Hallazgos observados durante la exploración física de un sistema corporal o estructura anatómica."> + > + ["id2"] = < + text = <"Sistema o estructura examinada"> + description = <"Identificación del sistema corporal o estructura anatómica examinados."> + comment = <"Se prefiere, siempre que sea posible, codificar el sistema o la estructura examinada con una terminología."> + > + ["id4"] = < + text = <"Descripción clínica"> + description = <"Descripción narrativa de los hallazgos generales observados durante la exploración física."> + > + ["id5"] = < + text = <"Hallazgos de la exploración"> + description = <"Detalles estructurados sobre los hallazgos de la exploración física."> + > + ["id6"] = < + text = <"Representación multimedia"> + description = <"Imagen digital, video o diagrama que representa los hallazgos de la exploración física."> + > + ["id7"] = < + text = <"Interpretación clínica"> + description = <"Palabra, frase o descripción breve que representa el significado clínico y la importancia de los hallazgos de la exploración física."> + comment = <"Por ejemplo: \"No se detecta ninguna anomalía\" o \"Inflamación moderada\". Se prefiere codificar la \"Interpretación clínica\" con una terminología, siempre que sea posible."> + > + ["id8"] = < + text = <"Comentario"> + description = <"Narración adicional sobre los hallazgos de la exploración física, no registrada en otros campos."> + > + ["id9"] = < + text = <"Examen no realizado"> + description = <"Detalles para registrar explícitamente que esta exploración no se realizó."> + > + ["id12"] = < + text = <"Zona corporal estructurada"> + description = <"Descripción estructurada de la zona del cuerpo examinada."> + comment = <"Si la zona corporal se ha identificado completamente en los elementos de datos «Sistema o estructura examinada» o «Zona corporal», esta ranura se vuelve redundante."> + > + ["id13"] = < + text = <"Zona corporal"> + description = <"Identificación de la zona del cuerpo examinada."> + comment = <"Por ejemplo, el examen de una zona específica de la piel. Si la zona corporal se ha identificado completamente en los elementos de datos «Sistema o estructura examinada», este elemento se vuelve redundante."> + > + > + ["ca"] = < + ["id1"] = < + text = <"Resultats de l'examen físic"> + description = <"Troballes observades durant l'examen físic d'un sistema corporal o estructura anatòmica."> + > + ["id2"] = < + text = <"Sistema o estructura examinada"> + description = <"Identificació del sistema corporal examinat o estructura anatòmica."> + comment = <"Preferiblement utilitzar la codificació del sistema o estructura examinada amb una terminologia, sempre que sigui possible."> + > + ["id4"] = < + text = <"Descripció clínica"> + description = <"Descripció narrativa dels resultats globals observats durant l'examen físic."> + > + ["id5"] = < + text = <"Resultats de l'examen"> + description = <"Detalls estructurats sobre els resultats de l'examen físic."> + > + ["id6"] = < + text = <"Representació multimèdia"> + description = <"Imatge digital, vídeo o diagrama que representa els resultats de l'examen físic."> + > + ["id7"] = < + text = <"Interpretació clínica"> + description = <"Paraula única, frase o breu descripció que representa el significat clínic i la significació de les troballes de l'examen físic."> + comment = <"Exemple: 'No s'ha detectat cap anormalitat' o 'inflamació present moderada'. Es prefereix la codificació de la \"interpretació clínica\" amb una terminologia, sempre que sigui possible."> + > + ["id8"] = < + text = <"Comentari"> + description = <"Narrativa addicional sobre els resultats de l'examen físic, no capturada en altres camps."> + > + ["id9"] = < + text = <"Examen no realitzat"> + description = <"Detalls per registrar explícitament que aquest examen no es va realitzar."> + > + ["id12"] = < + text = <"Part del cos estructurada"> + description = <"Descripció estructurada de l'àrea del cos objecte d'examen."> + comment = <"Si el lloc del cos ha estat completament identificat en el \"Sistema o estructura examinada\" o l'element de dades del \"lloc cos\", aquest SLOT es torna redundant."> + > + ["id13"] = < + text = <"Part del cos"> + description = <"Identificació de l'àrea de l'organisme objecte d'examen."> + comment = <"Exemple: l'examen d'una àrea específica de la pell. Si el lloc del cos ha estat completament identificat en l'element de dades \"Sistema o estructura examinada\", aquest element de dades esdevé redundant."> + > + > + > diff --git a/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl14.v1.adl b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl14.v1.adl new file mode 100644 index 000000000..68d4c00a3 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl14.v1.adl @@ -0,0 +1,1014 @@ +archetype (adl_version=1.4; uid=489ceb2a-8336-406c-9fa5-e01b44643a47) + openEHR-EHR-OBSERVATION.demo.v1 + +concept + [at0000] -- Demonstration +language + original_language = <[ISO_639-1::en]> + translations = < + ["nb"] = < + language = <[ISO_639-1::nb]> + author = < + ["name"] = <"Silje Ljosland Bakke"> + ["organisation"] = <"Bergen Hospital Trust"> + > + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + author = < + ["name"] = <"Jussara Rötzsch"> + ["organisation"] = <"openEHR Foundation"> + ["email"] = <"jussara.macedo@gmail.com"> + > + accreditation = <"MD. MSc., Pschyatrist, Clinical Modeller, Coordinator of Standards and Semantic Interoperability of Brazil e-Health Initiative "> + > + > +description + original_author = < + ["name"] = <"Heather Leslie"> + ["organisation"] = <"Atomica Informatics"> + ["email"] = <"heather.leslie@atomicainformatics.com"> + ["date"] = <"2008-12-23"> + > + details = < + ["nb"] = < + language = <[ISO_639-1::nb]> + purpose = <"For å gi en oversikt over visningen av de forskjellige datatypene som er tilgjengelige i en openEHR-arketype. Gir også oversikt over Data, State, Event og Protocol-modellene i forbindelse med HTML-visning og tilknyttet ADL."> + use = <"For å gi en visuell oversikt over datatyper og komponenter i arketyper til nåværende og fremtidige deltakere i vurdering av arketyper."> + keywords = <"demonstrasjon", "test", "prototype", "datatyper", "state", "status", "protocol", "protokoll", "event", "hendelse", "data"> + misuse = <"Skal ikke brukes til reelle kliniske data."> + copyright = <"© openEHR Foundation"> + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + purpose = <"Para fornecer uma visão geral da exibição de cada um dos tipos de dados disponíveis em um arquétipo openEHR, e dos modelos de Dados, Eventos e Protocolos dentro de um contexto de uma tela HTML e ADL associado."> + use = <"Para fornecer uma visualisação geral dos tipos de dados e componetes dos arquétipos para atuais e potenciais revisores de conteúdo clínico no Gestor de Conhecimento Clínico openEHR, o CKM."> + keywords = <"demonstração", "teste", "protótipo(s)", "tipo(s) de dado(s)", "estado", "protocolo(s)", "evento(s)", "dado(s)"> + misuse = <"Não apropriado para carregar nenhum dado clínico real."> + copyright = <"© openEHR Foundation"> + > + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"To provide an overview of the display of each of the datatypes available in an openEHR archetype, and of the Data, State, Event and Protocol models within the context of a HTML display and associated ADL."> + use = <"To provide a visual overview of archetype data types and archetype components to potential and current clinical content reviewers in the openEHR Clinical Knowledge Manager."> + keywords = <"demonstration", "test", "prototype", "datatypes", "state", "protocol", "event", "data"> + misuse = <"Not to carry any real clinical data."> + copyright = <"© openEHR Foundation"> + > + > + lifecycle_state = <"published"> + other_contributors = <"Individual A, Argentina", "Individual B, Belgium", "Individual C, Canada (Editor)"> + other_details = < + ["licence"] = <"This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/."> + ["custodian_organisation"] = <"openEHR Foundation"> + ["references"] = <"openEHR website: http://www.openehr.org/home.html +CKM: http://www.openehr.org/knowledge/"> + ["current_contact"] = <"Heather Leslie, Atomica Informatics"> + ["original_namespace"] = <"org.openehr"> + ["original_publisher"] = <"openEHR Foundation"> + ["custodian_namespace"] = <"org.openehr"> + ["MD5-CAM-1.0.1"] = <"44E350A26FDDA0C9E6E98F4BD527CE70"> + ["build_uid"] = <"b115156b-c2a5-46ab-ad0c-d0d99c0f979d"> + ["ip_acknowledgements"] = <"This artefact includes content from SNOMED Clinical Terms® (SNOMED CT®) which is copyrighted material of the International Health Terminology Standards Development Organisation (IHTSDO). Where an implementation of this artefact makes use of SNOMED CT content, the implementer must have the appropriate SNOMED CT Affiliate license - for more information contact http://www.snomed.org/snomed-ct/get-snomedct or info@snomed.org."> + ["revision"] = <"1.0.0"> + > + +definition + OBSERVATION[at0000] matches { -- Demonstration + data matches { + HISTORY[at0001] matches { -- Event Series + events cardinality matches {1..*; unordered} matches { + EVENT[at0002] occurrences matches {0..1} matches { -- Any Event + data matches { + ITEM_TREE[at0003] matches { -- Tree + items cardinality matches {0..*; unordered} matches { + ELEMENT[at0032] occurrences matches {0..1} matches {*} + CLUSTER[at0004] occurrences matches {0..*} matches { -- Heading1 + items cardinality matches {1..*; unordered} matches { + ELEMENT[at0005] occurrences matches {0..1} matches { -- Free Text or Coded + value matches { + DV_TEXT matches {*} + } + } + ELEMENT[at0006] occurrences matches {0..*} matches { -- Text That Uses Internal Codes + value matches { + DV_CODED_TEXT matches { + defining_code matches { + [local:: + at0007, -- Lying + at0008, -- Reclining + at0009, -- Sitting + at0010] -- Standing + } + } + } + } + ELEMENT[at0011] matches { -- Text That is Sourced From an External Terminology + value matches { + DV_CODED_TEXT matches { + defining_code matches {[ac0001]} -- SubsetA + } + } + } + ELEMENT[at0012] occurrences matches {0..1} matches { -- Quantity + value matches { + C_DV_QUANTITY < + property = <[openehr::122]> + list = < + ["1"] = < + units = <"cm"> + magnitude = <|0.0..100.0|> + precision = <|1|> + > + ["2"] = < + units = <"mm"> + > + ["3"] = < + units = <"[in_i]"> + > + ["4"] = < + units = <"[ft_i]"> + > + > + > + } + } + ELEMENT[at0023] occurrences matches {0..1} matches { -- Interval of Quantity + value matches { + DV_INTERVAL matches { + upper matches { + C_DV_QUANTITY < + property = <[openehr::122]> + list = < + ["1"] = < + units = <"cm"> + > + ["2"] = < + units = <"m"> + > + ["3"] = < + units = <"[in_i]"> + > + ["4"] = < + units = <"[ft_i]"> + > + > + > + } + lower matches { + C_DV_QUANTITY < + property = <[openehr::122]> + list = < + ["1"] = < + units = <"cm"> + > + ["2"] = < + units = <"m"> + > + ["3"] = < + units = <"[in_i]"> + > + ["4"] = < + units = <"[ft_i]"> + > + > + > + } + } + } + } + ELEMENT[at0013] occurrences matches {0..1} matches { -- Count + value matches { + DV_COUNT matches { + magnitude matches {|>=0|} + } + } + } + ELEMENT[at0022] occurrences matches {0..1} matches { -- Interval of Integer + value matches { + DV_INTERVAL matches { + upper matches { + DV_COUNT matches {*} + } + lower matches { + DV_COUNT matches {*} + } + } + } + } + ELEMENT[at0028] occurrences matches {0..1} matches { -- Proportion + value matches { + DV_PROPORTION matches { + is_integral matches {True} + type matches {0, 2, 3, 4} + } + } + } + ELEMENT[at0014] occurrences matches {0..1} matches { -- Date/Time + value matches { + DV_DATE_TIME matches {*} + } + } + ELEMENT[at0024] occurrences matches {0..1} matches { -- Interval of Date + value matches { + DV_INTERVAL matches { + upper matches { + DV_DATE_TIME matches {*} + } + lower matches { + DV_DATE_TIME matches {*} + } + } + } + } + ELEMENT[at0021] occurrences matches {0..1} matches { -- Duration + value matches { + DV_DURATION matches {*} + } + } + ELEMENT[at0015] occurrences matches {0..1} matches { -- Ordinal + value matches { + 0|[local::at0038], -- No pain + 1|[local::at0039], -- Slight pain + 2|[local::at0040], -- Mild pain + 5|[local::at0041], -- Moderate pain + 9|[local::at0042], -- Severe pain + 10|[local::at0043] -- Most severe pain imaginable + } + } + ELEMENT[at0016] occurrences matches {0..1} matches { -- Boolean + value matches { + DV_BOOLEAN matches { + value matches {True, False} + } + } + null_flavour existence matches {0..1} matches { + DV_CODED_TEXT matches { + defining_code matches { + [openehr:: + 271, + 272, + 273, + 253] + } + } + } + } + ELEMENT[at0017] occurrences matches {0..1} matches {*} + ELEMENT[at0025] occurrences matches {0..1} matches { -- Choice + value matches { + C_DV_QUANTITY < + property = <[openehr::124]> + list = < + ["1"] = < + units = <"g"> + > + ["2"] = < + units = <"[foz_us]"> + > + > + > + DV_CODED_TEXT matches { + defining_code matches {[ac0003]} -- SubsetB + } + } + } + ELEMENT[at0026] occurrences matches {0..1} matches { -- Multimedia + value matches { + DV_MULTIMEDIA matches { + media_type matches { + [openEHR:: + 387, + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 409, + 410, + 411, + 412, + 413, + 425, + 426, + 427, + 428, + 429, + 415, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 424, + 401, + 402, + 404, + 405, + 406, + 407, + 414, + 517, + 518, + 519, + 637] + } + } + } + } + ELEMENT[at0027] occurrences matches {0..1} matches { -- URI - resource identifier + value matches { + DV_URI matches {*} + } + } + ELEMENT[at0044] occurrences matches {0..1} matches { -- Identifier + value matches { + DV_IDENTIFIER matches {*} + } + } + } + } + CLUSTER[at0018] occurrences matches {0..1} matches { -- Heading 2 + items cardinality matches {1..*; unordered} matches { + allow_archetype CLUSTER[at0019] occurrences matches {0..*} matches { -- Slot To Contain Other Cluster Archetypes + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location\.v1|openEHR-EHR-CLUSTER\.device\.v1/} + } + allow_archetype ELEMENT[at0020] occurrences matches {0..*} matches { -- Slot To Contain Other Element Archetypes + include + archetype_id/value matches {/openEHR-EHR-ELEMENT\.ctg_codes\.v1/} + exclude + archetype_id/value matches {/.*/} + } + } + } + } + } + } + state matches { + ITEM_TREE[at0030] matches { -- Tree + items cardinality matches {0..*; unordered} matches { + ELEMENT[at0031] occurrences matches {0..1} matches {*} + } + } + } + } + POINT_EVENT[at0033] occurrences matches {0..1} matches { -- Named Point In Time + data matches { + use_node ITEM_TREE /data[at0001]/events[at0002]/data[at0003] -- /data[Event Series]/events[Any Event]/data[Tree] + } + state matches { + use_node ITEM_TREE /data[at0001]/events[at0002]/state[at0030] -- /data[Event Series]/events[Any Event]/state[Tree] + } + } + INTERVAL_EVENT[at0034] occurrences matches {0..1} matches { -- Named Interval + math_function matches { + DV_CODED_TEXT matches { + defining_code matches {[openehr::147]} + } + } + data matches { + use_node ITEM_TREE /data[at0001]/events[at0002]/data[at0003] -- /data[Event Series]/events[Any Event]/data[Tree] + } + state matches { + use_node ITEM_TREE /data[at0001]/events[at0002]/state[at0030] -- /data[Event Series]/events[Any Event]/state[Tree] + } + } + POINT_EVENT[at0035] occurrences matches {0..1} matches { -- Offset Point In Time + offset matches { + DV_DURATION matches { + value matches {|PT5M|} + } + } + data matches { + use_node ITEM_TREE /data[at0001]/events[at0002]/data[at0003] -- /data[Event Series]/events[Any Event]/data[Tree] + } + state matches { + use_node ITEM_TREE /data[at0001]/events[at0002]/state[at0030] -- /data[Event Series]/events[Any Event]/state[Tree] + } + } + } + } + } + protocol matches { + ITEM_TREE[at0036] matches { -- Tree + items cardinality matches {0..*; unordered} matches { + ELEMENT[at0037] occurrences matches {0..1} matches {*} + allow_archetype CLUSTER[at0045] occurrences matches {0..*} matches { -- Extension + include + archetype_id/value matches {/.*/} + } + } + } + } + } + + +ontology + terminologies_available = <"SNOMED-CT", ...> + term_definitions = < + ["en"] = < + items = < + ["at0000"] = < + text = <"Demonstration"> + description = <"Demonstration archetype with descriptions and explanations."> + > + ["at0001"] = < + text = <"Event Series"> + description = <"@ internal @"> + > + ["at0002"] = < + text = <"Any Event"> + description = <"All archetypes of the OBSERVATION class contain a HISTORY or EVENT model which contains information about the timing of the observation and the 'width' of the information - either a point in time or an interval. The default is 'Any event' and it is not specified if this is a Point in time or an Interval."> + > + ["at0003"] = < + text = <"Tree"> + description = <"@ internal @"> + > + ["at0004"] = < + text = <"Heading1"> + description = <"This is a symbol for a cluster which can have other elements 'nested' within it."> + > + ["at0005"] = < + text = <"Free Text or Coded"> + description = <"Text data type in which free text can be entered or coding can be incorporated either in the template or at run time."> + > + ["at0006"] = < + text = <"Text That Uses Internal Codes"> + description = <"Text data type which can use an internal vocabulary. Each of these 'internal codes' can be bound to a terminology code."> + > + ["at0007"] = < + text = <"Lying"> + description = <"Patient is lying supine."> + > + ["at0008"] = < + text = <"Reclining"> + description = <"Patient is reclining, propped up on one medium pillow."> + > + ["at0009"] = < + text = <"Sitting"> + description = <"Patient is sitting on a chair."> + > + ["at0010"] = < + text = <"Standing"> + description = <"Patient is standing."> + > + ["at0011"] = < + text = <"Text That is Sourced From an External Terminology"> + description = <"Text data type utilising codes derived from an external terminology source eg a SNOMED-CT, LOINC or ICD subset."> + > + ["at0012"] = < + text = <"Quantity"> + description = <"A quantity data type used to record a measurement associated with its' appropriate units. These are derived from ISO standards and the Reference model enables conversion between these units. The example shown here is length."> + > + ["at0013"] = < + text = <"Count"> + description = <"Count data types are composed of an integer with no units eg for recording the number of children - in this example the minimum is set at 0 and the maximum not specified."> + > + ["at0014"] = < + text = <"Date/Time"> + description = <"Date/Time datatype allows recording of a date and/or time, including partial dates such as year only or month and year only. Allow all is the default - so all forms of date/time are permitted."> + > + ["at0015"] = < + text = <"Ordinal"> + description = <"Ordinal datatypes pair a number and text - in this way scores can be calculated in software, or progression can be assessed eg if used in a pain score."> + > + ["at0016"] = < + text = <"Boolean"> + description = <"Boolean datatype that allows for true or false answers."> + > + ["at0017"] = < + text = <"Any"> + description = <"The datatype for this 'any' element can be specified or constrained in a template or at run-time, but is not explicitly modelled in the archetype."> + > + ["at0018"] = < + text = <"Heading 2"> + description = <"This is a symbol for a cluster which can have other elements 'nested' within it."> + > + ["at0019"] = < + text = <"Slot To Contain Other Cluster Archetypes"> + description = <"List of CLUSTER archetypes allowed to be included or excluded within this OBSERVATION archetype."> + > + ["at0020"] = < + text = <"Slot To Contain Other Element Archetypes"> + description = <"List of ELEMENT archetypes allowed to be included or excluded within this OBSERVATION archetype."> + > + ["at0021"] = < + text = <"Duration"> + description = <"Duration datatype allows recording of the duration of clinical concepts. 'Allow all time units' is the default, although specific time units can be explicitly modelled. Maximum and minum values can be set for each time unit."> + > + ["at0022"] = < + text = <"Interval of Integer"> + description = <"Interval of integer datatype allows for recording of a range of counts eg 1-2 tablets prescribed. Maximum and minimum values can be set for the lower count and the upper count."> + > + ["at0023"] = < + text = <"Interval of Quantity"> + description = <"Interval of quantity datatypes allow for the recording of a range of measurements in association with appropriate units eg 1-2cm (prescribed amount of cream for a rash)."> + > + ["at0024"] = < + text = <"Interval of Date"> + description = <"Interval of integer datatype allows for recording of a range of dates eg between September 1, 2008 and September 8, 2008."> + > + ["at0025"] = < + text = <"Choice"> + description = <"Choice datatype allows for a number of types of element to be specified simultaneously and which can constrained or selected within a template or at run-time. In this example, a text datatype set to Free text or Coded and another that is constrained to Terminology record data about the same data element."> + > + ["at0026"] = < + text = <"Multimedia"> + description = <"Multimedia datatypes allow for the recording of many types of multimedia files to be captured. All available types have been explicitly selected in this example."> + > + ["at0027"] = < + text = <"URI - resource identifier"> + description = <"URI datatypes allow for recording of relationships from this data to data recorded elsewhere. These links can be within the same EHR, or external eg to a URL."> + > + ["at0028"] = < + text = <"Proportion"> + description = <"Proportion datatypes allow for ratios, percent, fractions and proportions to be modelled."> + > + ["at0030"] = < + text = <"Tree"> + description = <"@ internal @"> + > + ["at0031"] = < + text = <"State - Definition"> + description = <"All archetypes of the OBSERVATION class can contain a STATE model which contains information about the subject of data at the time the information was collected, and this information is required for safe clinical interpretation of the core information. An example is the position of the patient at the time of measuring a blood pressure. Datatypes are identical to those explained in the Data model, above."> + > + ["at0032"] = < + text = <"Data - Definition"> + description = <"All archetypes of the OBSERVATION class contain a DATA model which contains the core information e.g. the systolic and diastolic pressures when measuring a blood pressure."> + > + ["at0033"] = < + text = <"Named Point In Time"> + description = <"An event that is both named (eg Birth) and constrained as a Point in time event records the data elements in relation to a specified point in time eg Weight at Birth."> + > + ["at0034"] = < + text = <"Named Interval"> + description = <"An event that is both named and constrained as an Interval event records the data elements in relation to a period of time eg Weight Loss over time. The interval can be fixed or left unspecified. In addition there are mathematical functions that can be specified to capture concepts such as change, decrease, increase, maximum, minimum, mean etc."> + > + ["at0035"] = < + text = <"Offset Point In Time"> + description = <"Offset Point in time records data at a point in time with a fixed offset of 5 minutes from another specified event eg recording a 2 minute Apgar reading at 2 minutes offset from Birth."> + > + ["at0036"] = < + text = <"Tree"> + description = <"@ internal @"> + > + ["at0037"] = < + text = <"Protocol - Definition"> + description = <"All archetypes of the OBSERVATION class can contain a PROTOCOL model which records information on how the information was gathered or measured, and any other information that is not required for safe clinical interpretation of the core Data. Datatypes are identical to those explained in the Data model, above."> + > + ["at0038"] = < + text = <"No pain"> + description = <"No pain at all."> + > + ["at0039"] = < + text = <"Slight pain"> + description = <"Pain level rated as 1 out of a possible maximum score of 10."> + > + ["at0040"] = < + text = <"Mild pain"> + description = <"Pain level rated as 2 out of a possible maximum score of 10."> + > + ["at0041"] = < + text = <"Moderate pain"> + description = <"Pain level rated as 5 out of a possible maximum score of 10."> + > + ["at0042"] = < + text = <"Severe pain"> + description = <"Pain level rated as 9 out of a possible maximum score of 10."> + > + ["at0043"] = < + text = <"Most severe pain imaginable"> + description = <"Pain level rated as 10 out of a possible maximum score of 10."> + > + ["at0044"] = < + text = <"Identifier"> + description = <"Identifier datatypes enable recording of formal data identifiers."> + > + ["at0045"] = < + text = <"Extension"> + description = <"Additional information required to capture local context or to align with other reference models/formalisms."> + comment = <"For example: Local hospital departmental infomation or additional metadata to align with FHIR or CIMI equivalents."> + > + > + > + ["pt-br"] = < + items = < + ["at0000"] = < + text = <"Demonstração"> + description = <"Arquétipo de Demonstração com descrições e explicações. "> + > + ["at0001"] = < + text = <"*Event Series(en)"> + description = <"*@ internal @(en)"> + > + ["at0002"] = < + text = <"Qualquer evento"> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO contêm um modelo de HISTÓRIA ou de EVENTO que contém informação sobre o período da observação com a duração da informação- seja um ponto no tempo ou um intervalo temporal. O padrão predeterminado é ' Qualquer evento' e não é especificado, se é um Ponto no tempo ou um Intervalo."> + > + ["at0003"] = < + text = <"*Tree(en)"> + description = <"*@ internal @(en)"> + > + ["at0004"] = < + text = <"Cabeçalho1"> + description = <"Este é um símbolo para um 'cluster' que pode ter outros elementos 'aninhados' dentro dele."> + > + ["at0005"] = < + text = <"Texto livre ou Codificado"> + description = <"Tipo de dado Texto no qual se pode entrar ou texto livre ou códigos podem ser incoprporados seja no template ou no tempo de execução."> + > + ["at0006"] = < + text = <"Texto Que Usa Códigos Internos"> + description = <"Tipo de dados Texto que pode usar um vocabulário interno. Cada um desses ' códigos internos' pode ser vnculado a um código de uma terminologia."> + > + ["at0007"] = < + text = <"Deitado"> + description = <"Paciente Deitado em posição supina ou decúbito dorsal."> + > + ["at0008"] = < + text = <"Reclinado"> + description = <"Paciente Reclinado, apoiado em um travesseiro médio."> + > + ["at0009"] = < + text = <"Sentado"> + description = <"Paciente está Sentado em uma cadeira."> + > + ["at0010"] = < + text = <"Em pé"> + description = <"Paciente está em Pé."> + > + ["at0011"] = < + text = <"Texto Cuja Origem é uma Terminologia Externa "> + description = <"Tipo de dado Texto utilizando códigos originários de uma terminologia externa como, por exemplo, um subset do SNOMED CT, do LOINC ou da CID 10. "> + > + ["at0012"] = < + text = <"Quantidade"> + description = <"Um tipo de dado de Quantidade usado para registrar uma medida associada com suas uniddades apropriadas. Essas unidades são derivadas de norams ISO e o modelo de Referência possibilita a conversão entre elas. O exemplo demonstrado aqui é o comprimento."> + > + ["at0013"] = < + text = <"Contagem "> + description = <"Tipos de dados de Contagem são compostos de um número inteiro sem casas decimais (integer), por exemplo, para registar o número de filhos- nesse exemplo o mínimo é colocado como 0 e o máximo não é especificado."> + > + ["at0014"] = < + text = <"Data/Horário"> + description = <"Tipos de dado Data/Horário permite o registro de uma data e /ou um horário, incluindo datas parciais como somente o mês ou o ano. Permite tudo como padrão de modo que todas as formas de data/horário são permitidas."> + > + ["at0015"] = < + text = <"Ordinal"> + description = <"Tipos de dados Ordinal pareiam um número e texto- deste modo pode ser calculada uma pontuação pela aplicação a progressão ser avaliada, como por exemplo se está se utilizando de uma escala de avaliação de dor."> + > + ["at0016"] = < + text = <"Booleano"> + description = <"Tipo de dado Booleano que permite repostas do tipo falso ou verdadeiro."> + > + ["at0017"] = < + text = <"Qualquer"> + description = <"Este tipo de dado para esse elemento 'Qualquer' pode ser especificado ou 'restrito' num modelo ou no tempo de execução, mas não é especificamente modelado no arquétipo."> + > + ["at0018"] = < + text = <"Cabelaçalho2"> + description = <"Esse é o símbolo de um 'cluster' que pode ter outros elementos 'aninhados' dentro dele."> + > + ["at0019"] = < + text = <"Slot Para Conter Outros Arquétipos Clusters"> + description = <"Lista de arquétipos CLUSTER permitidos de serem incluídos ou excluídos dentro deste arquétipo de OBSERVAÇÃO."> + > + ["at0020"] = < + text = <"Slot Para Conter Outroa Arququétipos de Elementos"> + description = <"Lista de arquétipos de ELEMENTOS permitidos de serem incluíos ou excluídos dentro deste arquétipo de OBSERVAÇÃO."> + > + ["at0021"] = < + text = <"Duração"> + description = <"Tipo de dado Duração permite registrar a duração dos conceitos clínicos. O padrão predeterminado é 'Permitir todas unidades de tempo', embora unidades específicas de tempo possam ser explicitamente modeladas. Valores máximos e mínimos podem ser configurados para cada unidade de tempo."> + > + ["at0022"] = < + text = <"Intervalo de Integer"> + description = <"Tipo de dados de Intervalo de Integer permite o registro de uma faixa de contagem em intervalos, por exemplo, a cada 1 a 2 comprimidos prescritos. Os valores máximo e mínimo podem ser configurados para a contagem inferior ou para a superior."> + > + ["at0023"] = < + text = <"Intervalo de Quantidade"> + description = <"Tipos de dados de Intervalo de Quantidade permitem registrar uma gama de mediddas associadas com unidades apropriadas, por exemplo, 1-2cm (quantidade de creme prescrito para um uma erupção cutânea)."> + > + ["at0024"] = < + text = <"Intervalo de Data"> + description = <"Tipo de dado de Intervalo de Integer permite o registro de uma faixa de datas como, por exemplo, entre 1 de Setembro de 2008 e 8 de Setembro de 2008."> + > + ["at0025"] = < + text = <"Escolha"> + description = <"Tipo de dado Escolha permite que um número de tipos de elementos sejam simultaneamente especificados, os quais podem ser restringidos num template ou no tempo de execução. Neste exemplo, um tipo de dado Texto é configurado para Texto livre ou Codificado e outro que é configurado restritamente para registrar códigos de uma determinada terminologia para o mesmo elemento de dado."> + > + ["at0026"] = < + text = <"Multimídia"> + description = <"Tipos de dado Multimídia permitem o registro de vários tipos de arquivos multimídia. Todos os tipos disponíveis foram explicitamente selecionados neste exemplo."> + > + ["at0027"] = < + text = <"URI - Identificador de Recursos "> + description = <"Tipos de dados URI permitem registrar os relacionamentos entre estes dados e os dados registrados em outros lugares. Esses enlaces (links) podem estar no mesmo RES ou serem externos, por exemplo, pertencer a num endereço na internet, uma URL."> + > + ["at0028"] = < + text = <"Porporção"> + description = <"Tipos de dados de Proporção permitem modelar taxas, porcentagens, frações e proporções."> + > + ["at0030"] = < + text = <"*Tree(en)"> + description = <"*@ internal @(en)"> + > + ["at0031"] = < + text = <"Estado - Definição"> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO podem conter um modelo de ESTADO, que contém a informação sobre o sujeito a informação na hora que o dado foi colhido, e essa informação é requisito para uma interpretação segura das informações básicas. Um exemplo disso é a posição que o paciente se encontrava quando sua pressão arterial foi medida. Os tipos de dados são idênticos aos que foram explicados no modelo de DADOS acima."> + > + ["at0032"] = < + text = <"Dados - Definição "> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO contêm um modelo de DADOS que contém as informações básicas, por exemplo, as pressões sistólica e diastólica, quando está se medindo a pressão sanguínea."> + > + ["at0033"] = < + text = <"Ponto no tempo Nomeado"> + description = <"Um evento que é ao mesmo tempo nomeado (p. ex. Nascimento) e restrito como evento em um Ponto no tempo, registra os elementos de dados relacionados a um ponto específico no tempo, como por exemplo, Peso no Nascimento."> + > + ["at0034"] = < + text = <"Intervalo Nomeado"> + description = <"Um evento que é ao mesmo tempo nomeado e restrito como um evento Intervalo, registra os mesmos elementos de dados relacionados ao período de tempo, por exemplo, Perda de peso durante o determinado período. O intervalo pode ser fixado, ou deixado inespecificado. Além disso, pode-se especificar funções matemáticas para capturar conceitos como mudança, diminuição aumento, máximo, mínimo, média,etc."> + > + ["at0035"] = < + text = <"Deslocamento do Ponto no tempo"> + description = <"Deslocamento do Ponto no Tempo registra o deslocamento fixo de 5 minutos de outro evento especificado, por exemplo, registrando a leitura de um escore de Apgar de 2 minutos aos 2 minutos após o parto."> + > + ["at0036"] = < + text = <"*Tree(en)"> + description = <"*@ internal @(en)"> + > + ["at0037"] = < + text = <"Protocolo-Definição"> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO podem conter um modelo de PROTOCOLO, o qual registra informação sobre como a informação foi colhida ou medida e quaisquer outras informações que não sejam necessárias para a interpretação clínica segura das informações básicas. Os tipos de dados são idênticos àqueles explicados no modelo e DADOS acima."> + > + ["at0038"] = < + text = <"Sem dor"> + description = <"Nenhuma dor."> + > + ["at0039"] = < + text = <"Dor leve"> + description = <"Dor classificada como nível 1 numa escala máxima de 10."> + > + ["at0040"] = < + text = <"Dor branda"> + description = <"Dor classificada como nível 2 numa escala máxima de 10."> + > + ["at0041"] = < + text = <"Dor Moderada"> + description = <"Dor classificada como nível 5 numa escala máxima de 10."> + > + ["at0042"] = < + text = <"Dor severa"> + description = <"Dor classificada nível 9 numa escala de 10."> + > + ["at0043"] = < + text = <"Pior dor possível"> + description = <"Dor classificada como nível 10 numa escala de 10."> + > + ["at0044"] = < + text = <"Identificador"> + description = <"Tipos de dados Identificadores possibilitam registrar identificadores formais de dados."> + > + ["at0045"] = < + text = <"*Extension(en)"> + description = <"*Additional information required to capture local context or to align with other reference models/formalisms.(en)"> + comment = <"*For example: Local hospital departmental infomation or additional metadata to align with FHIR or CIMI equivalents.(en)"> + > + > + > + ["nb"] = < + items = < + ["at0000"] = < + text = <"Demonstrasjon"> + description = <"Demonstrasjonsarketype med beskrivelser og forklaringer."> + > + ["at0001"] = < + text = <"*Event Series(en)"> + description = <"*@ internal @(en)"> + > + ["at0002"] = < + text = <"Tidfestet hendelse"> + description = <"Alle arketyper av OBSERVATION-klassen inneholder en HISTORY eller EVENT-modell som inneholder informasjon om tidfesting av observasjonen og \"bredden\" av informasjonen, enten et tidspunkt eller et intervall. Standardverdi er \"Tidfestet hendelse\", og det er ikke spesifisert om dette er et tidspunkt eller et intervall."> + > + ["at0003"] = < + text = <"*Tree(en)"> + description = <"*@ internal @(en)"> + > + ["at0004"] = < + text = <"Overskrift1"> + description = <"Dette er et symbol for et \"cluster\" som kan inneholde andre elementer."> + > + ["at0005"] = < + text = <"Fri eller kodet tekst"> + description = <"Tekstdatatype som kan inneholde fritekst eller kodet tekst. Kodingen kan legges inn enten i template eller i applikasjonen."> + > + ["at0006"] = < + text = <"Tekst med interne koder"> + description = <"Tekstdatatype som bruker et internt vokabular. Hver av disse \"interne kodene\" kan bindes til en terminologikode."> + > + ["at0007"] = < + text = <"Liggende"> + description = <"Pasienten ligger på ryggen."> + > + ["at0008"] = < + text = <"Tilbakelent"> + description = <"Pasienten ligger tilbakelent, støttet av en mellomstor pute."> + > + ["at0009"] = < + text = <"Sittende"> + description = <"Pasienten sitter i en stol."> + > + ["at0010"] = < + text = <"Stående"> + description = <"Pasienten står oppreist."> + > + ["at0011"] = < + text = <"Tekst hentet fra en ekstern terminologi"> + description = <"Tekstdata som bruker koder fra en ekstern terminologikilde, f.eks. SNOMED CT, LOINC eller ICD."> + > + ["at0012"] = < + text = <"Kvantitet"> + description = <"En kvantitetsdatatype som brukes til å registrere målinger tilknyttet passende enheter. Disse hentes fra ISO-standarder, og referansemodellen tillater konvertering mellom enhetene. Eksempelet vist er her lengde."> + > + ["at0013"] = < + text = <"Antall"> + description = <"Antall-datatypen består av et heltall uten enheter, f.eks. for å registrere antall barn. I dette eksempelet er minimum satt til 0 og maksimum er uspesifisert."> + > + ["at0014"] = < + text = <"Dato/tid"> + description = <"Dato/tidsdatatypen brukes til å registrere en dato og/eller tid, inklusiv deldatoer som f.eks. kun år eller kun måned og år. Standardverdi er at alle former er tillatt."> + > + ["at0015"] = < + text = <"Ordinal"> + description = <"Ordinaldatatyper setter sammen et tall og en tekststreng. Dette gjør det mulig å regne ut scoringer, eller vurdere progresjon dersom den brukes f.eks. i en smerteskala."> + > + ["at0016"] = < + text = <"Boolsk verdi"> + description = <"Boolsk verdi-datatypen brukes for å registrere verdier som sann/usann."> + > + ["at0017"] = < + text = <"Hvilken som helst"> + description = <"Datatypen \"hvilken som helst\" kan spesifiseres eller begrenses i template eller i applikasjonen, men modelleres ikke eksplisitt i arketypen."> + > + ["at0018"] = < + text = <"Overskrift 2"> + description = <"Dette er et symbol for et \"cluster\" med andre elementer inni seg."> + > + ["at0019"] = < + text = <"Utvidelsesspor som kan inneholde andre Cluster-arketyper"> + description = <"Listen over CLUSTER-arketyper som kan inkluderes eller ekskluderes i denne OBSERVATION-arketypen."> + > + ["at0020"] = < + text = <"Utvidelsesspor som kan inneholde andre Element-arketyper"> + description = <"Liste over ELEMENT-arketyper som kan inkluderes eller ekskluderes i denne OBSERVATION-arketypen."> + > + ["at0021"] = < + text = <"Varighet"> + description = <"Varighet-datatypen brukes til å registrere varigheten til kliniske konsepter. \"Tillat alle tidsenheter\" er standardverdi, selv om spesifikke tidsenheter kan modelleres eksplisitt. Maksimums- og minimumsverdier kan settes for hver tidsenhet."> + > + ["at0022"] = < + text = <"Antallsintervall"> + description = <"Antallsintervall-datatypen brukes for å registrere et intervall av antall, f.eks. 1-2 tabletter foreskrevet. Maksimums- og minimumsverdier kan settes for laveste og høyeste antall."> + > + ["at0023"] = < + text = <"Kvantitetsintervall"> + description = <"Kvantitetsintervaller tillater registreing av et intervall av målinger tilknyttet aktuelle enheter, f.eks. 1-2cm (foreskrevet mengde krem mot et utslett)."> + > + ["at0024"] = < + text = <"Datointervall"> + description = <"Datointervall-datatypen brukes til å registrere et intervall av datoer, f.eks. mellom 1. september 2008 og 8. september 2008."> + > + ["at0025"] = < + text = <"Valg"> + description = <"Valg-datatypen tillater at man gir flere valgmuligheter for hvilken datatype et element kan tilhøre. Dette kan velges eller begrenses i template eller i applikasjonen. I dette eksempelet er valget mellom en tekstdatatype satt til fri eller kodet tekst, eller en som er begrenset til å bruke kodeverdier fra en terminologi."> + > + ["at0026"] = < + text = <"Multimedia"> + description = <"Multimedia-datatyper brukes for å registrere en av flere mulige typer multimediafiler. I dette eksempelet er alle mulige typer eksplisitt valgte."> + > + ["at0027"] = < + text = <"URI-ressursidentifikator"> + description = <"URI-datatyper tillater registrering av sammenhenger mellom disse dataene og data som er registrert andre steder. Lenkene kan være innenfor samme system, eller eksterne f.eks. en URL."> + > + ["at0028"] = < + text = <"Forhold"> + description = <"Forholdsdatatyper brukes til proporsjoner, prosent og brøker."> + > + ["at0030"] = < + text = <"*Tree(en)"> + description = <"*@ internal @(en)"> + > + ["at0031"] = < + text = <"State-definision"> + description = <"Alle arketyper av OBSERVATION-klassen kan inneholde en STATE-modell som inneholder informasjon om subjektet for datainnsamlingen på tidspunktet informasjonen ble innhentet, og denne informasjonen er nødvendig for trygg klinisk tolkning av kjerneinformasjonen. Et eksempel er stillingen pasienten befinner seg i under en blodtrykksmåling. Mulige datatyper er de samme som i DATA-modellen."> + > + ["at0032"] = < + text = <"Data - definisjon"> + description = <"Alle arketyper i OBSERVATION-klassen inneholder en DATA-modell som inneholder kjerneinformasjonen, f.eks. systolisk og diastolisk trykk for en blodtrykksmåling."> + > + ["at0033"] = < + text = <"Navngitt tidspunkt"> + description = <"En hendelse som er både navngitt (f.eks. fødsel) og begrenset til et tidspunkt, og brukes til å registrere dataelementer i sammenheng med et spesifikt tidspunkt, f.eks. fødselsvekt."> + > + ["at0034"] = < + text = <"Navngitt intervall"> + description = <"En hendelse som er både navngitt og begrenset til et intervall, og brukes til å registrere dataelementer i forbindelse med et tidsintervall, f.eks. vekttap over tid. Intervallet kan være fastsatt eller uspesifisert. I tillegg kan det spesifiseres matematiske funksjoner for å håndtere konsepter som endring, minking, økning, maksimum, minimum, gjennomsnitt, etc."> + > + ["at0035"] = < + text = <"Forskjøvet tidspunkt"> + description = <"Forskjøvet tidspunkt brukes til å registrere data på et tidspunkt med en fastsatt forskyvning fra en annen spesifisert hendelse, f.eks. 2-minutters Apgar-score ved 2 minutter forskyvning fra fødselen."> + > + ["at0036"] = < + text = <"*Tree(en)"> + description = <"*@ internal @(en)"> + > + ["at0037"] = < + text = <"Protocol-definisjon"> + description = <"Alle arketyper av OBSERVATION-klassen kan inneholde en PROTOCOL-modell som registrerer informasjon om hvordan informasjonen ble samlet eller målt, og eventuell annen informasjon som ikke er nødvendig for trygg klinisk tolkning av kjernedataene. Datatypene er de samme som for DATA-modellen."> + > + ["at0038"] = < + text = <"Ingen smerte"> + description = <"Overhodet ingen smerte."> + > + ["at0039"] = < + text = <"Svak smerte"> + description = <"Smertenivå vurdert som 1 av maksimalt 10."> + > + ["at0040"] = < + text = <"Mild smerte"> + description = <"Smertenivå vurdert som 2 av maksimalt 10."> + > + ["at0041"] = < + text = <"Moderat smerte"> + description = <"Smertenivå vurdert som 5 av maksimalt 10."> + > + ["at0042"] = < + text = <"Sterk smerte"> + description = <"Smertenivå vurdert som 9 av maksimalt 10."> + > + ["at0043"] = < + text = <"Sterkeste mulige smerte"> + description = <"Smertenivå vurdert som 10 av maksimalt 10."> + > + ["at0044"] = < + text = <"Identifikator"> + description = <"Identifikator-datatyper tillater registrering av formelle dataidentifikatorer."> + > + ["at0045"] = < + text = <"*Extension(en)"> + description = <"*Additional information required to capture local context or to align with other reference models/formalisms.(en)"> + comment = <"*For example: Local hospital departmental infomation or additional metadata to align with FHIR or CIMI equivalents.(en)"> + > + > + > + > + constraint_definitions = < + ["en"] = < + items = < + ["ac0001"] = < + text = <"SubsetA"> + description = <"Terminology subset derived from XXX"> + > + ["ac0003"] = < + text = <"SubsetB"> + description = <"XYZ codes from Terminology 123"> + > + > + > + ["pt-br"] = < + items = < + ["ac0001"] = < + text = <"SubconjuntoA"> + description = <"Subconjunto de terminologia originário de XXX"> + > + ["ac0003"] = < + text = <"SubconjuntoB"> + description = <"Códigos XYZ da Terminologia 123"> + > + > + > + ["nb"] = < + items = < + ["ac0001"] = < + text = <"Subsett A"> + description = <"Terminologi-subsett fra XXX"> + > + ["ac0003"] = < + text = <"Subsett B"> + description = <"XYZ koder fra Terminologi 123"> + > + > + > + > diff --git a/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl2_id.v1.0.0.adls b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl2_id.v1.0.0.adls new file mode 100644 index 000000000..13461f9f8 --- /dev/null +++ b/tools/src/test/resources/com/nedap/archie/adl14/openEHR-EHR-OBSERVATION.demo_adl2_id.v1.0.0.adls @@ -0,0 +1,1608 @@ +archetype (adl_version=2.0.6; rm_release=1.1.0; generated; uid=489ceb2a-8336-406c-9fa5-e01b44643a47; build_uid=b115156b-c2a5-46ab-ad0c-d0d99c0f979d) + openEHR-EHR-OBSERVATION.demo.v1.0.0 + +language + original_language = <[ISO_639-1::en]> + translations = < + ["nb"] = < + language = <[ISO_639-1::nb]> + author = < + ["name"] = <"Silje Ljosland Bakke"> + ["organisation"] = <"Bergen Hospital Trust"> + > + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + author = < + ["name"] = <"Jussara Rötzsch"> + ["organisation"] = <"openEHR Foundation"> + ["email"] = <"jussara.macedo@gmail.com"> + > + accreditation = <"MD. MSc., Pschyatrist, Clinical Modeller, Coordinator of Standards and Semantic Interoperability of Brazil e-Health Initiative "> + > + > + +description + original_author = < + ["name"] = <"Heather Leslie"> + ["organisation"] = <"Atomica Informatics"> + ["email"] = <"heather.leslie@atomicainformatics.com"> + ["date"] = <"2008-12-23"> + > + original_namespace = <"org.openehr"> + original_publisher = <"openEHR Foundation"> + other_contributors = <"Individual A, Argentina", "Individual B, Belgium", "Individual C, Canada (Editor)"> + lifecycle_state = <"published"> + custodian_namespace = <"org.openehr"> + custodian_organisation = <"openEHR Foundation"> + licence = <"This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/."> + ip_acknowledgements = < + ["1"] = <"This artefact includes content from SNOMED Clinical Terms® (SNOMED CT®) which is copyrighted material of the International Health Terminology Standards Development Organisation (IHTSDO). Where an implementation of this artefact makes use of SNOMED CT content, the implementer must have the appropriate SNOMED CT Affiliate license - for more information contact http://www.snomed.org/snomed-ct/get-snomedct or info@snomed.org."> + > + references = < + ["1"] = <"openEHR website: http://www.openehr.org/home.html"> + ["2"] = <"CKM: http://www.openehr.org/knowledge/"> + > + other_details = < + ["current_contact"] = <"Heather Leslie, Atomica Informatics"> + ["MD5-CAM-1.0.1"] = <"44E350A26FDDA0C9E6E98F4BD527CE70"> + > + details = < + ["nb"] = < + language = <[ISO_639-1::nb]> + purpose = <"For å gi en oversikt over visningen av de forskjellige datatypene som er tilgjengelige i en openEHR-arketype. Gir også oversikt over Data, State, Event og Protocol-modellene i forbindelse med HTML-visning og tilknyttet ADL."> + keywords = <"demonstrasjon", "test", "prototype", "datatyper", "state", "status", "protocol", "protokoll", "event", "hendelse", "data"> + use = <"For å gi en visuell oversikt over datatyper og komponenter i arketyper til nåværende og fremtidige deltakere i vurdering av arketyper."> + misuse = <"Skal ikke brukes til reelle kliniske data."> + copyright = <"© openEHR Foundation"> + > + ["pt-br"] = < + language = <[ISO_639-1::pt-br]> + purpose = <"Para fornecer uma visão geral da exibição de cada um dos tipos de dados disponíveis em um arquétipo openEHR, e dos modelos de Dados, Eventos e Protocolos dentro de um contexto de uma tela HTML e ADL associado."> + keywords = <"demonstração", "teste", "protótipo(s)", "tipo(s) de dado(s)", "estado", "protocolo(s)", "evento(s)", "dado(s)"> + use = <"Para fornecer uma visualisação geral dos tipos de dados e componetes dos arquétipos para atuais e potenciais revisores de conteúdo clínico no Gestor de Conhecimento Clínico openEHR, o CKM."> + misuse = <"Não apropriado para carregar nenhum dado clínico real."> + copyright = <"© openEHR Foundation"> + > + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"To provide an overview of the display of each of the datatypes available in an openEHR archetype, and of the Data, State, Event and Protocol models within the context of a HTML display and associated ADL."> + keywords = <"demonstration", "test", "prototype", "datatypes", "state", "protocol", "event", "data"> + use = <"To provide a visual overview of archetype data types and archetype components to potential and current clinical content reviewers in the openEHR Clinical Knowledge Manager."> + misuse = <"Not to carry any real clinical data."> + copyright = <"© openEHR Foundation"> + > + > + +definition + OBSERVATION[id1] matches { -- Demonstration + data matches { + HISTORY[id2] matches { + events cardinality matches {1..*; unordered} matches { + EVENT[id3] occurrences matches {0..1} matches { -- Any Event + data matches { + ITEM_TREE[id4] matches { + items cardinality matches {0..*; unordered} matches { + ELEMENT[id33] occurrences matches {0..1} -- Data - Definition + CLUSTER[id5] matches { -- Heading1 + items cardinality matches {1..*; unordered} matches { + ELEMENT[id6] occurrences matches {0..1} matches { -- Free Text or Coded + value matches { + DV_TEXT[id9056] + } + } + ELEMENT[id7] matches { -- Text That Uses Internal Codes + value matches { + DV_CODED_TEXT[id9057] matches { + defining_code matches {[ac9000]} -- Text That Uses Internal Codes (synthesised) + } + } + } + ELEMENT[id12] occurrences matches {1} matches { -- Text That is Sourced From an External Terminology + value matches { + DV_CODED_TEXT[id9058] matches { + defining_code matches {[ac2]} -- SubsetA + } + } + } + ELEMENT[id13] occurrences matches {0..1} matches { -- Quantity + value matches { + DV_QUANTITY[id9059] matches { + property matches {[at9001]} -- Length + [magnitude, units, precision] matches { + [{|0.0..100.0|}, {"cm"}, {1}], + [{|>=0.0|}, {"mm"}, {|>=0|}], + [{|>=0.0|}, {"[in_i]"}, {|>=0|}], + [{|>=0.0|}, {"[ft_i]"}, {|>=0|}] + } + } + } + } + ELEMENT[id24] occurrences matches {0..1} matches { -- Interval of Quantity + value matches { + DV_INTERVAL[id9060] matches { + upper matches { + DV_QUANTITY[id9061] matches { + property matches {[at9001]} -- Length + [units] matches { + [{"cm"}], + [{"m"}], + [{"[in_i]"}], + [{"[ft_i]"}] + } + } + } + lower matches { + DV_QUANTITY[id9062] matches { + property matches {[at9001]} -- Length + [units] matches { + [{"cm"}], + [{"m"}], + [{"[in_i]"}], + [{"[ft_i]"}] + } + } + } + } + } + } + ELEMENT[id14] occurrences matches {0..1} matches { -- Count + value matches { + DV_COUNT[id9063] matches { + magnitude matches {|>=0|} + } + } + } + ELEMENT[id23] occurrences matches {0..1} matches { -- Interval of Integer + value matches { + DV_INTERVAL[id9064] matches { + upper matches { + DV_COUNT[id9065] + } + lower matches { + DV_COUNT[id9066] + } + } + } + } + ELEMENT[id29] occurrences matches {0..1} matches { -- Proportion + value matches { + DV_PROPORTION[id9067] matches { + is_integral matches {True} + type matches {0, 2, 3, 4} + } + } + } + ELEMENT[id15] occurrences matches {0..1} matches { -- Date/Time + value matches { + DV_DATE_TIME[id9068] + } + } + ELEMENT[id25] occurrences matches {0..1} matches { -- Interval of Date + value matches { + DV_INTERVAL[id9069] matches { + upper matches { + DV_DATE_TIME[id9070] + } + lower matches { + DV_DATE_TIME[id9071] + } + } + } + } + ELEMENT[id22] occurrences matches {0..1} matches { -- Duration + value matches { + DV_DURATION[id9072] + } + } + ELEMENT[id16] occurrences matches {0..1} matches { -- Ordinal + value matches { + DV_ORDINAL[id9073] matches { + [value, symbol] matches { + [{0}, {[at39]}], -- No pain + [{1}, {[at40]}], -- Slight pain + [{2}, {[at41]}], -- Mild pain + [{5}, {[at42]}], -- Moderate pain + [{9}, {[at43]}], -- Severe pain + [{10}, {[at44]}] -- Most severe pain imaginable + } + } + } + } + ELEMENT[id17] occurrences matches {0..1} matches { -- Boolean + value matches { + DV_BOOLEAN[id9074] matches { + value matches {True, False} + } + } + null_flavour matches { + DV_CODED_TEXT[id9075] matches { + defining_code matches {[ac9007]} -- Boolean (synthesised) + } + } + } + ELEMENT[id18] occurrences matches {0..1} -- Any + ELEMENT[id26] occurrences matches {0..1} matches { -- Choice + value matches { + DV_QUANTITY[id9076] matches { + property matches {[at9008]} -- Mass + [units] matches { + [{"g"}], + [{"[foz_us]"}] + } + } + DV_CODED_TEXT[id9077] matches { + defining_code matches {[ac4]} -- SubsetB + } + } + } + ELEMENT[id27] occurrences matches {0..1} matches { -- Multimedia + value matches { + DV_MULTIMEDIA[id9078] matches { + media_type matches {[ac9054]} -- Multimedia (synthesised) + } + } + } + ELEMENT[id28] occurrences matches {0..1} matches { -- URI - resource identifier + value matches { + DV_URI[id9079] + } + } + ELEMENT[id45] occurrences matches {0..1} matches { -- Identifier + value matches { + DV_IDENTIFIER[id9080] + } + } + } + } + CLUSTER[id19] occurrences matches {0..1} matches { -- Heading 2 + items cardinality matches {1..*; unordered} matches { + allow_archetype CLUSTER[id20] matches { -- Slot To Contain Other Cluster Archetypes + include + archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location\.v1\..*|openEHR-EHR-CLUSTER\.device\.v1\..*/} + } + allow_archetype ELEMENT[id21] matches { -- Slot To Contain Other Element Archetypes + include + archetype_id/value matches {/openEHR-EHR-ELEMENT\.ctg_codes\.v1\..*/} + exclude + archetype_id/value matches {/.*/} + } + } + } + } + } + } + state matches { + ITEM_TREE[id31] matches { + items cardinality matches {0..*; unordered} matches { + ELEMENT[id32] occurrences matches {0..1} -- State - Definition + } + } + } + } + POINT_EVENT[id34] occurrences matches {0..1} matches { -- Named Point In Time + data matches { + use_node ITEM_TREE[id9081] /data[id2]/events[id3]/data[id4] + } + state matches { + use_node ITEM_TREE[id9082] /data[id2]/events[id3]/state[id31] + } + } + INTERVAL_EVENT[id35] occurrences matches {0..1} matches { -- Named Interval + math_function matches { + DV_CODED_TEXT[id9083] matches { + defining_code matches {[at9055]} -- change + } + } + data matches { + use_node ITEM_TREE[id9084] /data[id2]/events[id3]/data[id4] + } + state matches { + use_node ITEM_TREE[id9085] /data[id2]/events[id3]/state[id31] + } + } + POINT_EVENT[id36] occurrences matches {0..1} matches { -- Offset Point In Time + offset matches { + DV_DURATION[id9086] matches { + value matches {PT5M; PT5M} + } + } + data matches { + use_node ITEM_TREE[id9087] /data[id2]/events[id3]/data[id4] + } + state matches { + use_node ITEM_TREE[id9088] /data[id2]/events[id3]/state[id31] + } + } + } + } + } + protocol matches { + ITEM_TREE[id37] matches { + items cardinality matches {0..*; unordered} matches { + ELEMENT[id38] occurrences matches {0..1} -- Protocol - Definition + allow_archetype CLUSTER[id46] matches { -- Extension + include + archetype_id/value matches {/.*/} + } + } + } + } + } + +terminology + term_definitions = < + ["nb"] = < + ["id1"] = < + text = <"Demonstrasjon"> + description = <"Demonstrasjonsarketype med beskrivelser og forklaringer."> + > + ["id3"] = < + text = <"Tidfestet hendelse"> + description = <"Alle arketyper av OBSERVATION-klassen inneholder en HISTORY eller EVENT-modell som inneholder informasjon om tidfesting av observasjonen og \"bredden\" av informasjonen, enten et tidspunkt eller et intervall. Standardverdi er \"Tidfestet hendelse\", og det er ikke spesifisert om dette er et tidspunkt eller et intervall."> + > + ["id5"] = < + text = <"Overskrift1"> + description = <"Dette er et symbol for et \"cluster\" som kan inneholde andre elementer."> + > + ["id6"] = < + text = <"Fri eller kodet tekst"> + description = <"Tekstdatatype som kan inneholde fritekst eller kodet tekst. Kodingen kan legges inn enten i template eller i applikasjonen."> + > + ["id7"] = < + text = <"Tekst med interne koder"> + description = <"Tekstdatatype som bruker et internt vokabular. Hver av disse \"interne kodene\" kan bindes til en terminologikode."> + > + ["at8"] = < + text = <"Liggende"> + description = <"Pasienten ligger på ryggen."> + > + ["at9"] = < + text = <"Tilbakelent"> + description = <"Pasienten ligger tilbakelent, støttet av en mellomstor pute."> + > + ["at10"] = < + text = <"Sittende"> + description = <"Pasienten sitter i en stol."> + > + ["at11"] = < + text = <"Stående"> + description = <"Pasienten står oppreist."> + > + ["id12"] = < + text = <"Tekst hentet fra en ekstern terminologi"> + description = <"Tekstdata som bruker koder fra en ekstern terminologikilde, f.eks. SNOMED CT, LOINC eller ICD."> + > + ["id13"] = < + text = <"Kvantitet"> + description = <"En kvantitetsdatatype som brukes til å registrere målinger tilknyttet passende enheter. Disse hentes fra ISO-standarder, og referansemodellen tillater konvertering mellom enhetene. Eksempelet vist er her lengde."> + > + ["id14"] = < + text = <"Antall"> + description = <"Antall-datatypen består av et heltall uten enheter, f.eks. for å registrere antall barn. I dette eksempelet er minimum satt til 0 og maksimum er uspesifisert."> + > + ["id15"] = < + text = <"Dato/tid"> + description = <"Dato/tidsdatatypen brukes til å registrere en dato og/eller tid, inklusiv deldatoer som f.eks. kun år eller kun måned og år. Standardverdi er at alle former er tillatt."> + > + ["id16"] = < + text = <"Ordinal"> + description = <"Ordinaldatatyper setter sammen et tall og en tekststreng. Dette gjør det mulig å regne ut scoringer, eller vurdere progresjon dersom den brukes f.eks. i en smerteskala."> + > + ["id17"] = < + text = <"Boolsk verdi"> + description = <"Boolsk verdi-datatypen brukes for å registrere verdier som sann/usann."> + > + ["id18"] = < + text = <"Hvilken som helst"> + description = <"Datatypen \"hvilken som helst\" kan spesifiseres eller begrenses i template eller i applikasjonen, men modelleres ikke eksplisitt i arketypen."> + > + ["id19"] = < + text = <"Overskrift 2"> + description = <"Dette er et symbol for et \"cluster\" med andre elementer inni seg."> + > + ["id20"] = < + text = <"Utvidelsesspor som kan inneholde andre Cluster-arketyper"> + description = <"Listen over CLUSTER-arketyper som kan inkluderes eller ekskluderes i denne OBSERVATION-arketypen."> + > + ["id21"] = < + text = <"Utvidelsesspor som kan inneholde andre Element-arketyper"> + description = <"Liste over ELEMENT-arketyper som kan inkluderes eller ekskluderes i denne OBSERVATION-arketypen."> + > + ["id22"] = < + text = <"Varighet"> + description = <"Varighet-datatypen brukes til å registrere varigheten til kliniske konsepter. \"Tillat alle tidsenheter\" er standardverdi, selv om spesifikke tidsenheter kan modelleres eksplisitt. Maksimums- og minimumsverdier kan settes for hver tidsenhet."> + > + ["id23"] = < + text = <"Antallsintervall"> + description = <"Antallsintervall-datatypen brukes for å registrere et intervall av antall, f.eks. 1-2 tabletter foreskrevet. Maksimums- og minimumsverdier kan settes for laveste og høyeste antall."> + > + ["id24"] = < + text = <"Kvantitetsintervall"> + description = <"Kvantitetsintervaller tillater registreing av et intervall av målinger tilknyttet aktuelle enheter, f.eks. 1-2cm (foreskrevet mengde krem mot et utslett)."> + > + ["id25"] = < + text = <"Datointervall"> + description = <"Datointervall-datatypen brukes til å registrere et intervall av datoer, f.eks. mellom 1. september 2008 og 8. september 2008."> + > + ["id26"] = < + text = <"Valg"> + description = <"Valg-datatypen tillater at man gir flere valgmuligheter for hvilken datatype et element kan tilhøre. Dette kan velges eller begrenses i template eller i applikasjonen. I dette eksempelet er valget mellom en tekstdatatype satt til fri eller kodet tekst, eller en som er begrenset til å bruke kodeverdier fra en terminologi."> + > + ["id27"] = < + text = <"Multimedia"> + description = <"Multimedia-datatyper brukes for å registrere en av flere mulige typer multimediafiler. I dette eksempelet er alle mulige typer eksplisitt valgte."> + > + ["id28"] = < + text = <"URI-ressursidentifikator"> + description = <"URI-datatyper tillater registrering av sammenhenger mellom disse dataene og data som er registrert andre steder. Lenkene kan være innenfor samme system, eller eksterne f.eks. en URL."> + > + ["id29"] = < + text = <"Forhold"> + description = <"Forholdsdatatyper brukes til proporsjoner, prosent og brøker."> + > + ["id32"] = < + text = <"State-definision"> + description = <"Alle arketyper av OBSERVATION-klassen kan inneholde en STATE-modell som inneholder informasjon om subjektet for datainnsamlingen på tidspunktet informasjonen ble innhentet, og denne informasjonen er nødvendig for trygg klinisk tolkning av kjerneinformasjonen. Et eksempel er stillingen pasienten befinner seg i under en blodtrykksmåling. Mulige datatyper er de samme som i DATA-modellen."> + > + ["id33"] = < + text = <"Data - definisjon"> + description = <"Alle arketyper i OBSERVATION-klassen inneholder en DATA-modell som inneholder kjerneinformasjonen, f.eks. systolisk og diastolisk trykk for en blodtrykksmåling."> + > + ["id34"] = < + text = <"Navngitt tidspunkt"> + description = <"En hendelse som er både navngitt (f.eks. fødsel) og begrenset til et tidspunkt, og brukes til å registrere dataelementer i sammenheng med et spesifikt tidspunkt, f.eks. fødselsvekt."> + > + ["id35"] = < + text = <"Navngitt intervall"> + description = <"En hendelse som er både navngitt og begrenset til et intervall, og brukes til å registrere dataelementer i forbindelse med et tidsintervall, f.eks. vekttap over tid. Intervallet kan være fastsatt eller uspesifisert. I tillegg kan det spesifiseres matematiske funksjoner for å håndtere konsepter som endring, minking, økning, maksimum, minimum, gjennomsnitt, etc."> + > + ["id36"] = < + text = <"Forskjøvet tidspunkt"> + description = <"Forskjøvet tidspunkt brukes til å registrere data på et tidspunkt med en fastsatt forskyvning fra en annen spesifisert hendelse, f.eks. 2-minutters Apgar-score ved 2 minutter forskyvning fra fødselen."> + > + ["id38"] = < + text = <"Protocol-definisjon"> + description = <"Alle arketyper av OBSERVATION-klassen kan inneholde en PROTOCOL-modell som registrerer informasjon om hvordan informasjonen ble samlet eller målt, og eventuell annen informasjon som ikke er nødvendig for trygg klinisk tolkning av kjernedataene. Datatypene er de samme som for DATA-modellen."> + > + ["at39"] = < + text = <"Ingen smerte"> + description = <"Overhodet ingen smerte."> + > + ["at40"] = < + text = <"Svak smerte"> + description = <"Smertenivå vurdert som 1 av maksimalt 10."> + > + ["at41"] = < + text = <"Mild smerte"> + description = <"Smertenivå vurdert som 2 av maksimalt 10."> + > + ["at42"] = < + text = <"Moderat smerte"> + description = <"Smertenivå vurdert som 5 av maksimalt 10."> + > + ["at43"] = < + text = <"Sterk smerte"> + description = <"Smertenivå vurdert som 9 av maksimalt 10."> + > + ["at44"] = < + text = <"Sterkeste mulige smerte"> + description = <"Smertenivå vurdert som 10 av maksimalt 10."> + > + ["id45"] = < + text = <"Identifikator"> + description = <"Identifikator-datatyper tillater registrering av formelle dataidentifikatorer."> + > + ["id46"] = < + text = <"*Extension(en)"> + description = <"*Additional information required to capture local context or to align with other reference models/formalisms.(en)"> + comment = <"*For example: Local hospital departmental infomation or additional metadata to align with FHIR or CIMI equivalents.(en)"> + > + ["ac2"] = < + text = <"Subsett A"> + description = <"Terminologi-subsett fra XXX"> + > + ["ac4"] = < + text = <"Subsett B"> + description = <"XYZ koder fra Terminologi 123"> + > + ["ac9000"] = < + text = <"Tekst med interne koder (synthesised)"> + description = <"Tekstdatatype som bruker et internt vokabular. Hver av disse \"interne kodene\" kan bindes til en terminologikode. (synthesised)"> + > + ["at9001"] = < + text = <"* Length (en)"> + description = <"* Length (en)"> + > + ["ac9002"] = < + text = <"Ordinal (synthesised)"> + description = <"Ordinaldatatyper setter sammen et tall og en tekststreng. Dette gjør det mulig å regne ut scoringer, eller vurdere progresjon dersom den brukes f.eks. i en smerteskala. (synthesised)"> + > + ["at9003"] = < + text = <"* no information (en)"> + description = <"* no information (en)"> + > + ["at9004"] = < + text = <"* masked (en)"> + description = <"* masked (en)"> + > + ["at9005"] = < + text = <"* not applicable (en)"> + description = <"* not applicable (en)"> + > + ["at9006"] = < + text = <"* unknown (en)"> + description = <"* unknown (en)"> + > + ["ac9007"] = < + text = <"Boolsk verdi (synthesised)"> + description = <"Boolsk verdi-datatypen brukes for å registrere verdier som sann/usann. (synthesised)"> + > + ["at9008"] = < + text = <"* Mass (en)"> + description = <"* Mass (en)"> + > + ["at9009"] = < + text = <"Term binding for [openEHR::387], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::387], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9010"] = < + text = <"Term binding for [openEHR::388], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::388], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9011"] = < + text = <"Term binding for [openEHR::389], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::389], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9012"] = < + text = <"Term binding for [openEHR::390], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::390], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9013"] = < + text = <"Term binding for [openEHR::391], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::391], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9014"] = < + text = <"Term binding for [openEHR::392], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::392], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9015"] = < + text = <"Term binding for [openEHR::393], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::393], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9016"] = < + text = <"Term binding for [openEHR::394], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::394], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9017"] = < + text = <"Term binding for [openEHR::395], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::395], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9018"] = < + text = <"Term binding for [openEHR::396], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::396], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9019"] = < + text = <"Term binding for [openEHR::397], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::397], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9020"] = < + text = <"Term binding for [openEHR::398], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::398], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9021"] = < + text = <"Term binding for [openEHR::399], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::399], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9022"] = < + text = <"Term binding for [openEHR::400], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::400], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9023"] = < + text = <"Term binding for [openEHR::409], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::409], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9024"] = < + text = <"Term binding for [openEHR::410], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::410], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9025"] = < + text = <"Term binding for [openEHR::411], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::411], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9026"] = < + text = <"Term binding for [openEHR::412], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::412], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9027"] = < + text = <"Term binding for [openEHR::413], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::413], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9028"] = < + text = <"Term binding for [openEHR::425], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::425], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9029"] = < + text = <"Term binding for [openEHR::426], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::426], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9030"] = < + text = <"Term binding for [openEHR::427], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::427], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9031"] = < + text = <"Term binding for [openEHR::428], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::428], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9032"] = < + text = <"Term binding for [openEHR::429], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::429], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9033"] = < + text = <"Term binding for [openEHR::415], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::415], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9034"] = < + text = <"Term binding for [openEHR::416], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::416], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9035"] = < + text = <"Term binding for [openEHR::417], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::417], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9036"] = < + text = <"Term binding for [openEHR::418], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::418], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9037"] = < + text = <"Term binding for [openEHR::419], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::419], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9038"] = < + text = <"Term binding for [openEHR::420], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::420], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9039"] = < + text = <"Term binding for [openEHR::421], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::421], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9040"] = < + text = <"Term binding for [openEHR::422], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::422], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9041"] = < + text = <"Term binding for [openEHR::423], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::423], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9042"] = < + text = <"Term binding for [openEHR::424], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::424], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9043"] = < + text = <"Term binding for [openEHR::401], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::401], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9044"] = < + text = <"Term binding for [openEHR::402], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::402], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9045"] = < + text = <"Term binding for [openEHR::404], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::404], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9046"] = < + text = <"Term binding for [openEHR::405], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::405], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9047"] = < + text = <"Term binding for [openEHR::406], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::406], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9048"] = < + text = <"Term binding for [openEHR::407], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::407], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9049"] = < + text = <"Term binding for [openEHR::414], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::414], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9050"] = < + text = <"Term binding for [openEHR::517], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::517], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9051"] = < + text = <"Term binding for [openEHR::518], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::518], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9052"] = < + text = <"Term binding for [openEHR::519], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::519], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9053"] = < + text = <"Term binding for [openEHR::637], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::637], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["ac9054"] = < + text = <"Multimedia (synthesised)"> + description = <"Multimedia-datatyper brukes for å registrere en av flere mulige typer multimediafiler. I dette eksempelet er alle mulige typer eksplisitt valgte. (synthesised)"> + > + ["at9055"] = < + text = <"* change (en)"> + description = <"* change (en)"> + > + > + ["pt-br"] = < + ["id1"] = < + text = <"Demonstração"> + description = <"Arquétipo de Demonstração com descrições e explicações. "> + > + ["id3"] = < + text = <"Qualquer evento"> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO contêm um modelo de HISTÓRIA ou de EVENTO que contém informação sobre o período da observação com a duração da informação- seja um ponto no tempo ou um intervalo temporal. O padrão predeterminado é ' Qualquer evento' e não é especificado, se é um Ponto no tempo ou um Intervalo."> + > + ["id5"] = < + text = <"Cabeçalho1"> + description = <"Este é um símbolo para um 'cluster' que pode ter outros elementos 'aninhados' dentro dele."> + > + ["id6"] = < + text = <"Texto livre ou Codificado"> + description = <"Tipo de dado Texto no qual se pode entrar ou texto livre ou códigos podem ser incoprporados seja no template ou no tempo de execução."> + > + ["id7"] = < + text = <"Texto Que Usa Códigos Internos"> + description = <"Tipo de dados Texto que pode usar um vocabulário interno. Cada um desses ' códigos internos' pode ser vnculado a um código de uma terminologia."> + > + ["at8"] = < + text = <"Deitado"> + description = <"Paciente Deitado em posição supina ou decúbito dorsal."> + > + ["at9"] = < + text = <"Reclinado"> + description = <"Paciente Reclinado, apoiado em um travesseiro médio."> + > + ["at10"] = < + text = <"Sentado"> + description = <"Paciente está Sentado em uma cadeira."> + > + ["at11"] = < + text = <"Em pé"> + description = <"Paciente está em Pé."> + > + ["id12"] = < + text = <"Texto Cuja Origem é uma Terminologia Externa "> + description = <"Tipo de dado Texto utilizando códigos originários de uma terminologia externa como, por exemplo, um subset do SNOMED CT, do LOINC ou da CID 10. "> + > + ["id13"] = < + text = <"Quantidade"> + description = <"Um tipo de dado de Quantidade usado para registrar uma medida associada com suas uniddades apropriadas. Essas unidades são derivadas de norams ISO e o modelo de Referência possibilita a conversão entre elas. O exemplo demonstrado aqui é o comprimento."> + > + ["id14"] = < + text = <"Contagem "> + description = <"Tipos de dados de Contagem são compostos de um número inteiro sem casas decimais (integer), por exemplo, para registar o número de filhos- nesse exemplo o mínimo é colocado como 0 e o máximo não é especificado."> + > + ["id15"] = < + text = <"Data/Horário"> + description = <"Tipos de dado Data/Horário permite o registro de uma data e /ou um horário, incluindo datas parciais como somente o mês ou o ano. Permite tudo como padrão de modo que todas as formas de data/horário são permitidas."> + > + ["id16"] = < + text = <"Ordinal"> + description = <"Tipos de dados Ordinal pareiam um número e texto- deste modo pode ser calculada uma pontuação pela aplicação a progressão ser avaliada, como por exemplo se está se utilizando de uma escala de avaliação de dor."> + > + ["id17"] = < + text = <"Booleano"> + description = <"Tipo de dado Booleano que permite repostas do tipo falso ou verdadeiro."> + > + ["id18"] = < + text = <"Qualquer"> + description = <"Este tipo de dado para esse elemento 'Qualquer' pode ser especificado ou 'restrito' num modelo ou no tempo de execução, mas não é especificamente modelado no arquétipo."> + > + ["id19"] = < + text = <"Cabelaçalho2"> + description = <"Esse é o símbolo de um 'cluster' que pode ter outros elementos 'aninhados' dentro dele."> + > + ["id20"] = < + text = <"Slot Para Conter Outros Arquétipos Clusters"> + description = <"Lista de arquétipos CLUSTER permitidos de serem incluídos ou excluídos dentro deste arquétipo de OBSERVAÇÃO."> + > + ["id21"] = < + text = <"Slot Para Conter Outroa Arququétipos de Elementos"> + description = <"Lista de arquétipos de ELEMENTOS permitidos de serem incluíos ou excluídos dentro deste arquétipo de OBSERVAÇÃO."> + > + ["id22"] = < + text = <"Duração"> + description = <"Tipo de dado Duração permite registrar a duração dos conceitos clínicos. O padrão predeterminado é 'Permitir todas unidades de tempo', embora unidades específicas de tempo possam ser explicitamente modeladas. Valores máximos e mínimos podem ser configurados para cada unidade de tempo."> + > + ["id23"] = < + text = <"Intervalo de Integer"> + description = <"Tipo de dados de Intervalo de Integer permite o registro de uma faixa de contagem em intervalos, por exemplo, a cada 1 a 2 comprimidos prescritos. Os valores máximo e mínimo podem ser configurados para a contagem inferior ou para a superior."> + > + ["id24"] = < + text = <"Intervalo de Quantidade"> + description = <"Tipos de dados de Intervalo de Quantidade permitem registrar uma gama de mediddas associadas com unidades apropriadas, por exemplo, 1-2cm (quantidade de creme prescrito para um uma erupção cutânea)."> + > + ["id25"] = < + text = <"Intervalo de Data"> + description = <"Tipo de dado de Intervalo de Integer permite o registro de uma faixa de datas como, por exemplo, entre 1 de Setembro de 2008 e 8 de Setembro de 2008."> + > + ["id26"] = < + text = <"Escolha"> + description = <"Tipo de dado Escolha permite que um número de tipos de elementos sejam simultaneamente especificados, os quais podem ser restringidos num template ou no tempo de execução. Neste exemplo, um tipo de dado Texto é configurado para Texto livre ou Codificado e outro que é configurado restritamente para registrar códigos de uma determinada terminologia para o mesmo elemento de dado."> + > + ["id27"] = < + text = <"Multimídia"> + description = <"Tipos de dado Multimídia permitem o registro de vários tipos de arquivos multimídia. Todos os tipos disponíveis foram explicitamente selecionados neste exemplo."> + > + ["id28"] = < + text = <"URI - Identificador de Recursos "> + description = <"Tipos de dados URI permitem registrar os relacionamentos entre estes dados e os dados registrados em outros lugares. Esses enlaces (links) podem estar no mesmo RES ou serem externos, por exemplo, pertencer a num endereço na internet, uma URL."> + > + ["id29"] = < + text = <"Porporção"> + description = <"Tipos de dados de Proporção permitem modelar taxas, porcentagens, frações e proporções."> + > + ["id32"] = < + text = <"Estado - Definição"> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO podem conter um modelo de ESTADO, que contém a informação sobre o sujeito a informação na hora que o dado foi colhido, e essa informação é requisito para uma interpretação segura das informações básicas. Um exemplo disso é a posição que o paciente se encontrava quando sua pressão arterial foi medida. Os tipos de dados são idênticos aos que foram explicados no modelo de DADOS acima."> + > + ["id33"] = < + text = <"Dados - Definição "> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO contêm um modelo de DADOS que contém as informações básicas, por exemplo, as pressões sistólica e diastólica, quando está se medindo a pressão sanguínea."> + > + ["id34"] = < + text = <"Ponto no tempo Nomeado"> + description = <"Um evento que é ao mesmo tempo nomeado (p. ex. Nascimento) e restrito como evento em um Ponto no tempo, registra os elementos de dados relacionados a um ponto específico no tempo, como por exemplo, Peso no Nascimento."> + > + ["id35"] = < + text = <"Intervalo Nomeado"> + description = <"Um evento que é ao mesmo tempo nomeado e restrito como um evento Intervalo, registra os mesmos elementos de dados relacionados ao período de tempo, por exemplo, Perda de peso durante o determinado período. O intervalo pode ser fixado, ou deixado inespecificado. Além disso, pode-se especificar funções matemáticas para capturar conceitos como mudança, diminuição aumento, máximo, mínimo, média,etc."> + > + ["id36"] = < + text = <"Deslocamento do Ponto no tempo"> + description = <"Deslocamento do Ponto no Tempo registra o deslocamento fixo de 5 minutos de outro evento especificado, por exemplo, registrando a leitura de um escore de Apgar de 2 minutos aos 2 minutos após o parto."> + > + ["id38"] = < + text = <"Protocolo-Definição"> + description = <"Todos os arquétipos da classe de OBSERVAÇÃO podem conter um modelo de PROTOCOLO, o qual registra informação sobre como a informação foi colhida ou medida e quaisquer outras informações que não sejam necessárias para a interpretação clínica segura das informações básicas. Os tipos de dados são idênticos àqueles explicados no modelo e DADOS acima."> + > + ["at39"] = < + text = <"Sem dor"> + description = <"Nenhuma dor."> + > + ["at40"] = < + text = <"Dor leve"> + description = <"Dor classificada como nível 1 numa escala máxima de 10."> + > + ["at41"] = < + text = <"Dor branda"> + description = <"Dor classificada como nível 2 numa escala máxima de 10."> + > + ["at42"] = < + text = <"Dor Moderada"> + description = <"Dor classificada como nível 5 numa escala máxima de 10."> + > + ["at43"] = < + text = <"Dor severa"> + description = <"Dor classificada nível 9 numa escala de 10."> + > + ["at44"] = < + text = <"Pior dor possível"> + description = <"Dor classificada como nível 10 numa escala de 10."> + > + ["id45"] = < + text = <"Identificador"> + description = <"Tipos de dados Identificadores possibilitam registrar identificadores formais de dados."> + > + ["id46"] = < + text = <"*Extension(en)"> + description = <"*Additional information required to capture local context or to align with other reference models/formalisms.(en)"> + comment = <"*For example: Local hospital departmental infomation or additional metadata to align with FHIR or CIMI equivalents.(en)"> + > + ["ac2"] = < + text = <"SubconjuntoA"> + description = <"Subconjunto de terminologia originário de XXX"> + > + ["ac4"] = < + text = <"SubconjuntoB"> + description = <"Códigos XYZ da Terminologia 123"> + > + ["ac9000"] = < + text = <"Texto Que Usa Códigos Internos (synthesised)"> + description = <"Tipo de dados Texto que pode usar um vocabulário interno. Cada um desses ' códigos internos' pode ser vnculado a um código de uma terminologia. (synthesised)"> + > + ["at9001"] = < + text = <"* Length (en)"> + description = <"* Length (en)"> + > + ["ac9002"] = < + text = <"Ordinal (synthesised)"> + description = <"Tipos de dados Ordinal pareiam um número e texto- deste modo pode ser calculada uma pontuação pela aplicação a progressão ser avaliada, como por exemplo se está se utilizando de uma escala de avaliação de dor. (synthesised)"> + > + ["at9003"] = < + text = <"* no information (en)"> + description = <"* no information (en)"> + > + ["at9004"] = < + text = <"* masked (en)"> + description = <"* masked (en)"> + > + ["at9005"] = < + text = <"* not applicable (en)"> + description = <"* not applicable (en)"> + > + ["at9006"] = < + text = <"* unknown (en)"> + description = <"* unknown (en)"> + > + ["ac9007"] = < + text = <"Booleano (synthesised)"> + description = <"Tipo de dado Booleano que permite repostas do tipo falso ou verdadeiro. (synthesised)"> + > + ["at9008"] = < + text = <"* Mass (en)"> + description = <"* Mass (en)"> + > + ["at9009"] = < + text = <"Term binding for [openEHR::387], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::387], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9010"] = < + text = <"Term binding for [openEHR::388], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::388], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9011"] = < + text = <"Term binding for [openEHR::389], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::389], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9012"] = < + text = <"Term binding for [openEHR::390], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::390], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9013"] = < + text = <"Term binding for [openEHR::391], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::391], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9014"] = < + text = <"Term binding for [openEHR::392], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::392], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9015"] = < + text = <"Term binding for [openEHR::393], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::393], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9016"] = < + text = <"Term binding for [openEHR::394], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::394], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9017"] = < + text = <"Term binding for [openEHR::395], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::395], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9018"] = < + text = <"Term binding for [openEHR::396], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::396], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9019"] = < + text = <"Term binding for [openEHR::397], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::397], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9020"] = < + text = <"Term binding for [openEHR::398], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::398], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9021"] = < + text = <"Term binding for [openEHR::399], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::399], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9022"] = < + text = <"Term binding for [openEHR::400], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::400], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9023"] = < + text = <"Term binding for [openEHR::409], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::409], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9024"] = < + text = <"Term binding for [openEHR::410], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::410], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9025"] = < + text = <"Term binding for [openEHR::411], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::411], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9026"] = < + text = <"Term binding for [openEHR::412], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::412], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9027"] = < + text = <"Term binding for [openEHR::413], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::413], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9028"] = < + text = <"Term binding for [openEHR::425], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::425], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9029"] = < + text = <"Term binding for [openEHR::426], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::426], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9030"] = < + text = <"Term binding for [openEHR::427], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::427], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9031"] = < + text = <"Term binding for [openEHR::428], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::428], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9032"] = < + text = <"Term binding for [openEHR::429], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::429], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9033"] = < + text = <"Term binding for [openEHR::415], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::415], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9034"] = < + text = <"Term binding for [openEHR::416], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::416], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9035"] = < + text = <"Term binding for [openEHR::417], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::417], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9036"] = < + text = <"Term binding for [openEHR::418], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::418], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9037"] = < + text = <"Term binding for [openEHR::419], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::419], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9038"] = < + text = <"Term binding for [openEHR::420], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::420], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9039"] = < + text = <"Term binding for [openEHR::421], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::421], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9040"] = < + text = <"Term binding for [openEHR::422], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::422], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9041"] = < + text = <"Term binding for [openEHR::423], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::423], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9042"] = < + text = <"Term binding for [openEHR::424], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::424], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9043"] = < + text = <"Term binding for [openEHR::401], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::401], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9044"] = < + text = <"Term binding for [openEHR::402], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::402], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9045"] = < + text = <"Term binding for [openEHR::404], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::404], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9046"] = < + text = <"Term binding for [openEHR::405], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::405], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9047"] = < + text = <"Term binding for [openEHR::406], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::406], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9048"] = < + text = <"Term binding for [openEHR::407], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::407], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9049"] = < + text = <"Term binding for [openEHR::414], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::414], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9050"] = < + text = <"Term binding for [openEHR::517], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::517], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9051"] = < + text = <"Term binding for [openEHR::518], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::518], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9052"] = < + text = <"Term binding for [openEHR::519], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::519], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9053"] = < + text = <"Term binding for [openEHR::637], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::637], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["ac9054"] = < + text = <"Multimídia (synthesised)"> + description = <"Tipos de dado Multimídia permitem o registro de vários tipos de arquivos multimídia. Todos os tipos disponíveis foram explicitamente selecionados neste exemplo. (synthesised)"> + > + ["at9055"] = < + text = <"* change (en)"> + description = <"* change (en)"> + > + > + ["en"] = < + ["id1"] = < + text = <"Demonstration"> + description = <"Demonstration archetype with descriptions and explanations."> + > + ["id3"] = < + text = <"Any Event"> + description = <"All archetypes of the OBSERVATION class contain a HISTORY or EVENT model which contains information about the timing of the observation and the 'width' of the information - either a point in time or an interval. The default is 'Any event' and it is not specified if this is a Point in time or an Interval."> + > + ["id5"] = < + text = <"Heading1"> + description = <"This is a symbol for a cluster which can have other elements 'nested' within it."> + > + ["id6"] = < + text = <"Free Text or Coded"> + description = <"Text data type in which free text can be entered or coding can be incorporated either in the template or at run time."> + > + ["id7"] = < + text = <"Text That Uses Internal Codes"> + description = <"Text data type which can use an internal vocabulary. Each of these 'internal codes' can be bound to a terminology code."> + > + ["at8"] = < + text = <"Lying"> + description = <"Patient is lying supine."> + > + ["at9"] = < + text = <"Reclining"> + description = <"Patient is reclining, propped up on one medium pillow."> + > + ["at10"] = < + text = <"Sitting"> + description = <"Patient is sitting on a chair."> + > + ["at11"] = < + text = <"Standing"> + description = <"Patient is standing."> + > + ["id12"] = < + text = <"Text That is Sourced From an External Terminology"> + description = <"Text data type utilising codes derived from an external terminology source eg a SNOMED-CT, LOINC or ICD subset."> + > + ["id13"] = < + text = <"Quantity"> + description = <"A quantity data type used to record a measurement associated with its' appropriate units. These are derived from ISO standards and the Reference model enables conversion between these units. The example shown here is length."> + > + ["id14"] = < + text = <"Count"> + description = <"Count data types are composed of an integer with no units eg for recording the number of children - in this example the minimum is set at 0 and the maximum not specified."> + > + ["id15"] = < + text = <"Date/Time"> + description = <"Date/Time datatype allows recording of a date and/or time, including partial dates such as year only or month and year only. Allow all is the default - so all forms of date/time are permitted."> + > + ["id16"] = < + text = <"Ordinal"> + description = <"Ordinal datatypes pair a number and text - in this way scores can be calculated in software, or progression can be assessed eg if used in a pain score."> + > + ["id17"] = < + text = <"Boolean"> + description = <"Boolean datatype that allows for true or false answers."> + > + ["id18"] = < + text = <"Any"> + description = <"The datatype for this 'any' element can be specified or constrained in a template or at run-time, but is not explicitly modelled in the archetype."> + > + ["id19"] = < + text = <"Heading 2"> + description = <"This is a symbol for a cluster which can have other elements 'nested' within it."> + > + ["id20"] = < + text = <"Slot To Contain Other Cluster Archetypes"> + description = <"List of CLUSTER archetypes allowed to be included or excluded within this OBSERVATION archetype."> + > + ["id21"] = < + text = <"Slot To Contain Other Element Archetypes"> + description = <"List of ELEMENT archetypes allowed to be included or excluded within this OBSERVATION archetype."> + > + ["id22"] = < + text = <"Duration"> + description = <"Duration datatype allows recording of the duration of clinical concepts. 'Allow all time units' is the default, although specific time units can be explicitly modelled. Maximum and minum values can be set for each time unit."> + > + ["id23"] = < + text = <"Interval of Integer"> + description = <"Interval of integer datatype allows for recording of a range of counts eg 1-2 tablets prescribed. Maximum and minimum values can be set for the lower count and the upper count."> + > + ["id24"] = < + text = <"Interval of Quantity"> + description = <"Interval of quantity datatypes allow for the recording of a range of measurements in association with appropriate units eg 1-2cm (prescribed amount of cream for a rash)."> + > + ["id25"] = < + text = <"Interval of Date"> + description = <"Interval of integer datatype allows for recording of a range of dates eg between September 1, 2008 and September 8, 2008."> + > + ["id26"] = < + text = <"Choice"> + description = <"Choice datatype allows for a number of types of element to be specified simultaneously and which can constrained or selected within a template or at run-time. In this example, a text datatype set to Free text or Coded and another that is constrained to Terminology record data about the same data element."> + > + ["id27"] = < + text = <"Multimedia"> + description = <"Multimedia datatypes allow for the recording of many types of multimedia files to be captured. All available types have been explicitly selected in this example."> + > + ["id28"] = < + text = <"URI - resource identifier"> + description = <"URI datatypes allow for recording of relationships from this data to data recorded elsewhere. These links can be within the same EHR, or external eg to a URL."> + > + ["id29"] = < + text = <"Proportion"> + description = <"Proportion datatypes allow for ratios, percent, fractions and proportions to be modelled."> + > + ["id32"] = < + text = <"State - Definition"> + description = <"All archetypes of the OBSERVATION class can contain a STATE model which contains information about the subject of data at the time the information was collected, and this information is required for safe clinical interpretation of the core information. An example is the position of the patient at the time of measuring a blood pressure. Datatypes are identical to those explained in the Data model, above."> + > + ["id33"] = < + text = <"Data - Definition"> + description = <"All archetypes of the OBSERVATION class contain a DATA model which contains the core information e.g. the systolic and diastolic pressures when measuring a blood pressure."> + > + ["id34"] = < + text = <"Named Point In Time"> + description = <"An event that is both named (eg Birth) and constrained as a Point in time event records the data elements in relation to a specified point in time eg Weight at Birth."> + > + ["id35"] = < + text = <"Named Interval"> + description = <"An event that is both named and constrained as an Interval event records the data elements in relation to a period of time eg Weight Loss over time. The interval can be fixed or left unspecified. In addition there are mathematical functions that can be specified to capture concepts such as change, decrease, increase, maximum, minimum, mean etc."> + > + ["id36"] = < + text = <"Offset Point In Time"> + description = <"Offset Point in time records data at a point in time with a fixed offset of 5 minutes from another specified event eg recording a 2 minute Apgar reading at 2 minutes offset from Birth."> + > + ["id38"] = < + text = <"Protocol - Definition"> + description = <"All archetypes of the OBSERVATION class can contain a PROTOCOL model which records information on how the information was gathered or measured, and any other information that is not required for safe clinical interpretation of the core Data. Datatypes are identical to those explained in the Data model, above."> + > + ["at39"] = < + text = <"No pain"> + description = <"No pain at all."> + > + ["at40"] = < + text = <"Slight pain"> + description = <"Pain level rated as 1 out of a possible maximum score of 10."> + > + ["at41"] = < + text = <"Mild pain"> + description = <"Pain level rated as 2 out of a possible maximum score of 10."> + > + ["at42"] = < + text = <"Moderate pain"> + description = <"Pain level rated as 5 out of a possible maximum score of 10."> + > + ["at43"] = < + text = <"Severe pain"> + description = <"Pain level rated as 9 out of a possible maximum score of 10."> + > + ["at44"] = < + text = <"Most severe pain imaginable"> + description = <"Pain level rated as 10 out of a possible maximum score of 10."> + > + ["id45"] = < + text = <"Identifier"> + description = <"Identifier datatypes enable recording of formal data identifiers."> + > + ["id46"] = < + text = <"Extension"> + description = <"Additional information required to capture local context or to align with other reference models/formalisms."> + comment = <"For example: Local hospital departmental infomation or additional metadata to align with FHIR or CIMI equivalents."> + > + ["ac2"] = < + text = <"SubsetA"> + description = <"Terminology subset derived from XXX"> + > + ["ac4"] = < + text = <"SubsetB"> + description = <"XYZ codes from Terminology 123"> + > + ["ac9000"] = < + text = <"Text That Uses Internal Codes (synthesised)"> + description = <"Text data type which can use an internal vocabulary. Each of these 'internal codes' can be bound to a terminology code. (synthesised)"> + > + ["at9001"] = < + text = <"Length"> + description = <"Length"> + > + ["ac9002"] = < + text = <"Ordinal (synthesised)"> + description = <"Ordinal datatypes pair a number and text - in this way scores can be calculated in software, or progression can be assessed eg if used in a pain score. (synthesised)"> + > + ["at9003"] = < + text = <"no information"> + description = <"no information"> + > + ["at9004"] = < + text = <"masked"> + description = <"masked"> + > + ["at9005"] = < + text = <"not applicable"> + description = <"not applicable"> + > + ["at9006"] = < + text = <"unknown"> + description = <"unknown"> + > + ["ac9007"] = < + text = <"Boolean (synthesised)"> + description = <"Boolean datatype that allows for true or false answers. (synthesised)"> + > + ["at9008"] = < + text = <"Mass"> + description = <"Mass"> + > + ["at9009"] = < + text = <"Term binding for [openEHR::387], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::387], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9010"] = < + text = <"Term binding for [openEHR::388], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::388], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9011"] = < + text = <"Term binding for [openEHR::389], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::389], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9012"] = < + text = <"Term binding for [openEHR::390], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::390], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9013"] = < + text = <"Term binding for [openEHR::391], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::391], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9014"] = < + text = <"Term binding for [openEHR::392], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::392], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9015"] = < + text = <"Term binding for [openEHR::393], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::393], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9016"] = < + text = <"Term binding for [openEHR::394], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::394], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9017"] = < + text = <"Term binding for [openEHR::395], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::395], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9018"] = < + text = <"Term binding for [openEHR::396], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::396], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9019"] = < + text = <"Term binding for [openEHR::397], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::397], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9020"] = < + text = <"Term binding for [openEHR::398], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::398], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9021"] = < + text = <"Term binding for [openEHR::399], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::399], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9022"] = < + text = <"Term binding for [openEHR::400], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::400], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9023"] = < + text = <"Term binding for [openEHR::409], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::409], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9024"] = < + text = <"Term binding for [openEHR::410], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::410], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9025"] = < + text = <"Term binding for [openEHR::411], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::411], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9026"] = < + text = <"Term binding for [openEHR::412], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::412], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9027"] = < + text = <"Term binding for [openEHR::413], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::413], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9028"] = < + text = <"Term binding for [openEHR::425], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::425], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9029"] = < + text = <"Term binding for [openEHR::426], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::426], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9030"] = < + text = <"Term binding for [openEHR::427], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::427], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9031"] = < + text = <"Term binding for [openEHR::428], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::428], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9032"] = < + text = <"Term binding for [openEHR::429], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::429], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9033"] = < + text = <"Term binding for [openEHR::415], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::415], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9034"] = < + text = <"Term binding for [openEHR::416], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::416], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9035"] = < + text = <"Term binding for [openEHR::417], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::417], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9036"] = < + text = <"Term binding for [openEHR::418], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::418], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9037"] = < + text = <"Term binding for [openEHR::419], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::419], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9038"] = < + text = <"Term binding for [openEHR::420], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::420], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9039"] = < + text = <"Term binding for [openEHR::421], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::421], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9040"] = < + text = <"Term binding for [openEHR::422], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::422], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9041"] = < + text = <"Term binding for [openEHR::423], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::423], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9042"] = < + text = <"Term binding for [openEHR::424], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::424], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9043"] = < + text = <"Term binding for [openEHR::401], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::401], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9044"] = < + text = <"Term binding for [openEHR::402], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::402], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9045"] = < + text = <"Term binding for [openEHR::404], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::404], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9046"] = < + text = <"Term binding for [openEHR::405], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::405], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9047"] = < + text = <"Term binding for [openEHR::406], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::406], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9048"] = < + text = <"Term binding for [openEHR::407], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::407], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9049"] = < + text = <"Term binding for [openEHR::414], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::414], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9050"] = < + text = <"Term binding for [openEHR::517], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::517], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9051"] = < + text = <"Term binding for [openEHR::518], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::518], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9052"] = < + text = <"Term binding for [openEHR::519], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::519], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["at9053"] = < + text = <"Term binding for [openEHR::637], translation not known in ADL 1.4 -> ADL 2 converter"> + description = <"Term binding for [openEHR::637], translation not known in ADL 1.4 -> ADL 2 converter"> + > + ["ac9054"] = < + text = <"Multimedia (synthesised)"> + description = <"Multimedia datatypes allow for the recording of many types of multimedia files to be captured. All available types have been explicitly selected in this example. (synthesised)"> + > + ["at9055"] = < + text = <"change"> + description = <"change"> + > + > + > + term_bindings = < + ["openehr"] = < + ["at9001"] = + ["at9003"] = + ["at9004"] = + ["at9005"] = + ["at9006"] = + ["at9008"] = + ["at9055"] = + > + ["openEHR"] = < + ["at9009"] = + ["at9010"] = + ["at9011"] = + ["at9012"] = + ["at9013"] = + ["at9014"] = + ["at9015"] = + ["at9016"] = + ["at9017"] = + ["at9018"] = + ["at9019"] = + ["at9020"] = + ["at9021"] = + ["at9022"] = + ["at9023"] = + ["at9024"] = + ["at9025"] = + ["at9026"] = + ["at9027"] = + ["at9028"] = + ["at9029"] = + ["at9030"] = + ["at9031"] = + ["at9032"] = + ["at9033"] = + ["at9034"] = + ["at9035"] = + ["at9036"] = + ["at9037"] = + ["at9038"] = + ["at9039"] = + ["at9040"] = + ["at9041"] = + ["at9042"] = + ["at9043"] = + ["at9044"] = + ["at9045"] = + ["at9046"] = + ["at9047"] = + ["at9048"] = + ["at9049"] = + ["at9050"] = + ["at9051"] = + ["at9052"] = + ["at9053"] = + > + > + value_sets = < + ["ac9007"] = < + id = <"ac9007"> + members = <"at9003", "at9004", "at9005", "at9006"> + > + ["ac9002"] = < + id = <"ac9002"> + members = <"at39", "at40", "at41", "at42", "at43", "at44"> + > + ["ac9000"] = < + id = <"ac9000"> + members = <"at8", "at9", "at10", "at11"> + > + ["ac9054"] = < + id = <"ac9054"> + members = <"at9009", "at9010", "at9011", "at9012", "at9013", "at9014", "at9015", "at9016", "at9017", "at9018", "at9019", "at9020", "at9021", "at9022", "at9023", "at9024", "at9025", "at9026", "at9027", "at9028", "at9029", "at9030", "at9031", "at9032", "at9033", "at9034", "at9035", "at9036", "at9037", "at9038", "at9039", "at9040", "at9041", "at9042", "at9043", "at9044", "at9045", "at9046", "at9047", "at9048", "at9049", "at9050", "at9051", "at9052", "at9053"> + > + > From 6021bdc6dc963defa6a9f760c4e308ce13237c9f Mon Sep 17 00:00:00 2001 From: Eline Brader <73945320+EBrader@users.noreply.github.com> Date: Wed, 17 Jun 2026 10:31:22 +0200 Subject: [PATCH 56/60] Improve handling NullpointerException by APathQuery (#789) * Improve handling Nullpointer in APathQuery * Improvement --- .../com/nedap/archie/query/APathQuery.java | 10 ++++ .../nedap/archie/query/APathQueryTest.java | 52 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 utils/src/test/java/com/nedap/archie/query/APathQueryTest.java diff --git a/utils/src/main/java/com/nedap/archie/query/APathQuery.java b/utils/src/main/java/com/nedap/archie/query/APathQuery.java index 1c6e8d8d8..67103fa30 100644 --- a/utils/src/main/java/com/nedap/archie/query/APathQuery.java +++ b/utils/src/main/java/com/nedap/archie/query/APathQuery.java @@ -42,10 +42,17 @@ public APathQuery(String query) { throw new UnsupportedOperationException("absolute path starting with // not yet supported"); } RelativeLocationPathContext relativeLocationPathContext; + Throwable exception; if(absoluteLocationPathNorootContext == null) { relativeLocationPathContext = locationPathContext.relativeLocationPath(); + exception = locationPathContext.exception; } else { relativeLocationPathContext = absoluteLocationPathNorootContext.relativeLocationPath(); + exception = absoluteLocationPathNorootContext.exception; + } + + if(relativeLocationPathContext == null) { + throw new IllegalArgumentException("invalid relative path expression: " + query, exception); } if (!relativeLocationPathContext.getTokens(XPathLexer.ABRPATH).isEmpty()) { @@ -55,6 +62,9 @@ public APathQuery(String query) { List stepContexts = relativeLocationPathContext.step(); for (StepContext stepContext : stepContexts) { + if (stepContext.nodeTest() == null) { + throw new IllegalArgumentException("invalid relative path expression: " + query, stepContext.exception); + } String nodeName = stepContext.nodeTest().getText(); List predicateContexts = stepContext.predicate(); PathSegment pathSegment = new PathSegment(nodeName); diff --git a/utils/src/test/java/com/nedap/archie/query/APathQueryTest.java b/utils/src/test/java/com/nedap/archie/query/APathQueryTest.java new file mode 100644 index 000000000..28be3331f --- /dev/null +++ b/utils/src/test/java/com/nedap/archie/query/APathQueryTest.java @@ -0,0 +1,52 @@ +package com.nedap.archie.query; + +import org.antlr.v4.runtime.InputMismatchException; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class APathQueryTest { + + @Test + public void validPaths() { + assertDoesNotThrow(() -> new APathQuery("/items[at0001]")); + assertDoesNotThrow(() -> new APathQuery("/value")); + assertDoesNotThrow(() -> new APathQuery("/items[at0001]/value")); + assertDoesNotThrow(() -> new APathQuery("/[at0001]")); + } + + @Test + public void nullRelativeLocationPathContext() { + Throwable t = assertIllegalPath("["); + assertEquals("invalid relative path expression: [", t.getMessage()); + assertEquals("[", ((InputMismatchException) t.getCause()).getOffendingToken().getText()); + } + + @Test + public void nullStepNodeTest() { + Throwable t1 = assertIllegalPath("/2"); + assertEquals("invalid relative path expression: /2", t1.getMessage()); + assertEquals("2", ((InputMismatchException) t1.getCause()).getOffendingToken().getText()); + + Throwable t2 = assertIllegalPath("/value/"); + assertEquals("invalid relative path expression: /value/", t2.getMessage()); + assertEquals("", ((InputMismatchException) t2.getCause()).getOffendingToken().getText()); + } + + @Test + public void invalidSlashes() { + Throwable t = assertIllegalPath(" /"); + assertEquals("invalid relative path expression: /", t.getMessage()); + assertEquals("", ((InputMismatchException) t.getCause()).getOffendingToken().getText()); + + assertThrows(UnsupportedOperationException.class, () -> new APathQuery("/slash//")); + } + + // ------------------------------------------------------------------------- + // Helpers + // ------------------------------------------------------------------------- + + private static Throwable assertIllegalPath(String query) { + return assertThrows(IllegalArgumentException.class, () -> new APathQuery(query)); + } +} From 935cfe9f2d86e29242977c7324d473529cc357e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 15:15:22 +0200 Subject: [PATCH 57/60] Bump org.threeten:threeten-extra from 1.8.0 to 1.10.0 (#797) Bumps [org.threeten:threeten-extra](https://github.com/ThreeTen/threeten-extra) from 1.8.0 to 1.10.0. - [Release notes](https://github.com/ThreeTen/threeten-extra/releases) - [Commits](https://github.com/ThreeTen/threeten-extra/compare/v1.8.0...v1.10.0) --- updated-dependencies: - dependency-name: org.threeten:threeten-extra dependency-version: 1.10.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 27fb5cc9b..dcaffe029 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,6 +53,6 @@ reflections = { module = "org.reflections:reflections", version = "0.10.2" } slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } -threeten-extra = { module = "org.threeten:threeten-extra", version = "1.8.0" } +threeten-extra = { module = "org.threeten:threeten-extra", version = "1.10.0" } zafarkhaja-semver = { module = "com.github.zafarkhaja:java-semver", version = "0.10.2" } From b8abd7801f077fb0b19cb58b39538b41171b06c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 15:15:35 +0200 Subject: [PATCH 58/60] Bump com.fasterxml.jackson.core:jackson-annotations from 2.21 to 2.22 (#787) Bumps [com.fasterxml.jackson.core:jackson-annotations](https://github.com/FasterXML/jackson) from 2.21 to 2.22. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-version: '2.22' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dcaffe029..230fd84ce 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ antlr = "4.13.2" jackson = "2.21.3" -jackson_annotations = "2.21" +jackson_annotations = "2.22" slf4j = "1.7.36" From e8d92f28aca33f92ea08a826ea19f9581d579720 Mon Sep 17 00:00:00 2001 From: Mattijs Kuhlmann <47526389+MattijsK@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:31:42 +0200 Subject: [PATCH 59/60] Update Archie to v3.19.0 (#808) --- README.md | 6 +++--- build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9b49ee187..6860cd74f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can depend on parts of Archie, or the entire library at once. If you want th ```gradle dependencies { - compile 'com.nedap.healthcare.archie:archie-all:3.18.0' + compile 'com.nedap.healthcare.archie:archie-all:3.19.0' } ``` @@ -28,11 +28,11 @@ or if you use maven, in your pom.xml com.nedap.healthcare.archie archie-all - 3.18.0 + 3.19.0 ``` -If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.18.0 and com.nedap.healthcare.archie:referencemodels:3.18.0 instead +If you want to depend on just the AOM and BMM, without any reference model implementation, depend on com.nedap.healthcare.archie:tools:3.19.0 and com.nedap.healthcare.archie:referencemodels:3.19.0 instead ## Build diff --git a/build.gradle b/build.gradle index 361fde8a4..d85198cc1 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ repositories { allprojects { - version = '3.18.0' + version = '3.19.0' group = 'com.nedap.healthcare.archie' ext.gradleScriptDir = "${rootProject.projectDir}/gradle" //archivesBaseName = 'archie' From 8b6c4f23e95c9874eef51e83a378c4adb4d742d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 10:29:03 +0200 Subject: [PATCH 60/60] Bump jackson from 2.21.3 to 2.22.1 (#807) Bumps `jackson` from 2.21.3 to 2.22.1. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.3 to 2.22.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.21.3 to 2.22.1 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.22.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.22.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 230fd84ce..1c5789605 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] antlr = "4.13.2" -jackson = "2.21.3" +jackson = "2.22.1" jackson_annotations = "2.22" slf4j = "1.7.36"