Skip to content

Commit

Permalink
Merge branch 'release/v2.18.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Sep 30, 2024
2 parents d5cc26c + f8d0dbc commit 7272e33
Show file tree
Hide file tree
Showing 23 changed files with 184 additions and 41 deletions.
17 changes: 12 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@

Note: version releases in the 0.x.y range may introduce breaking changes.

## [2.18.0]
### Changed
- Updated archie to 3.11.0 and antlr to 4.13.1 ([#640](https://github.com/ehrbase/openEHR_SDK/pull/640))
### Added
### Fixed

## [2.17.0]
### Changed
- Deprecated `response-dto` `EHR_(STATUS)` related classes that are only used by EHRbase ([621](https://github.com/ehrbase/openEHR_SDK/pull/621))
- Deprecated `response-dto` `EHR_(STATUS)` related classes that are only used by EHRbase ([#621](https://github.com/ehrbase/openEHR_SDK/pull/621))
### Added
### Fixed

## [2.16.0]
### Added
### Fixed
- Fix missing Base64 encoding og ´DV_MULTIMEDIA` `data` ([624](https://github.com/ehrbase/openEHR_SDK/pull/624))
- Fix missing Base64 encoding og ´DV_MULTIMEDIA` `data` ([#624](https://github.com/ehrbase/openEHR_SDK/pull/624))

## [2.15.0]
### Added
### Fixed
- Fix flat format parsing of `ObjectVersionId` ([622](https://github.com/ehrbase/openEHR_SDK/pull/622))
- Fix flat format parsing of `ObjectVersionId` ([#622](https://github.com/ehrbase/openEHR_SDK/pull/622))

## [2.14.0]
### Changed
Expand All @@ -32,11 +38,11 @@ Note: version releases in the 0.x.y range may introduce breaking changes.

## [2.11.0]
### Added
- Make AqlObjectPath serializable ([606](https://github.com/ehrbase/openEHR_SDK/pull/606))
- Make AqlObjectPath serializable ([#606](https://github.com/ehrbase/openEHR_SDK/pull/606))

## [2.10.0]
### Added
- Added EHRbase AQL `MetaData` debug execution data ([594](https://github.com/ehrbase/openEHR_SDK/pull/594))
- Added EHRbase AQL `MetaData` debug execution data ([#594](https://github.com/ehrbase/openEHR_SDK/pull/594))
### Changed
- OptParser now ignores node_id tags for all RM types that are not subtypes of LOCATABLE ([#596](https://github.com/ehrbase/openEHR_SDK/pull/596))
- Removed OpenEhrClient::getFolder (use directoryCrudEndpoint()::getFolder instead) ([#588](https://github.com/ehrbase/openEHR_SDK/pull/588))
Expand Down Expand Up @@ -441,3 +447,4 @@ Note: version releases in the 0.x.y range may introduce breaking changes.
[2.15.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.14.0...v2.15.0
[2.16.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.15.0...v2.16.0
[2.17.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.16.0...v2.17.0
[2.18.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.17.0...v2.18.0
2 changes: 1 addition & 1 deletion aql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>aql</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<artifactId>bom</artifactId>
<groupId>org.ehrbase.openehr.sdk</groupId>
<version>2.17.0</version>
<version>2.18.0</version>
<packaging>pom</packaging>

<name>openEHR SDK</name>
Expand Down Expand Up @@ -38,8 +38,8 @@
</developers>

<properties>
<antlr4.version>4.11.1</antlr4.version>
<archie.version>3.3.0</archie.version>
<antlr4.version>4.13.1</antlr4.version>
<archie.version>3.11.0</archie.version>
<assertj.version>3.26.0</assertj.version>
<cglib.version>3.3.0</cglib.version>
<classgraph.version>4.8.175</classgraph.version>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sdk-parent</artifactId>
<groupId>org.ehrbase.openehr.sdk</groupId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion generator-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>generator-commons</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sdk-parent</artifactId>
<groupId>org.ehrbase.openehr.sdk</groupId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>generator</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion opt-1.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>opt-1.4</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>bom</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
<relativePath>./bom/pom.xml</relativePath>
</parent>

<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
<packaging>pom</packaging>
<name>openEHR SDK</name>

Expand Down
2 changes: 1 addition & 1 deletion response-dto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>response-dto</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion serialisation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>serialisation</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

import com.nedap.archie.rm.composition.Composition;
import com.nedap.archie.rminfo.ArchieRMInfoLookup;
import com.nedap.archie.rmobjectvalidator.RMObjectValidationMessageType;
import com.nedap.archie.rmobjectvalidator.RMObjectValidator;
import com.nedap.archie.rmobjectvalidator.ValidationConfiguration;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
Expand Down Expand Up @@ -77,11 +79,16 @@ void roundTripFeederAuditRaw() throws IOException {

softAssertions.assertThat(unmarshal).isNotNull();

RMObjectValidator rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), s -> null);
ValidationConfiguration cfg = new ValidationConfiguration.Builder()
.validateInvariants(true)
.failOnUnknownTerminologyId(!true)
.build();

RMObjectValidator rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), s -> null, cfg);

softAssertions
.assertThat(rmObjectValidator.validate(unmarshal))
.filteredOn(m -> !m.getMessage().contains("Inv_null_flavour_indicated"))
.filteredOn(m -> m.getType() != RMObjectValidationMessageType.ARCHETYPE_NOT_FOUND)
.containsExactlyInAnyOrder();

softAssertions.assertAll();
Expand Down Expand Up @@ -110,11 +117,16 @@ void roundTripRaw() throws IOException {

softAssertions.assertThat(unmarshal).isNotNull();

RMObjectValidator rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), s -> null);
ValidationConfiguration cfg = new ValidationConfiguration.Builder()
.validateInvariants(true)
.failOnUnknownTerminologyId(!true)
.build();

RMObjectValidator rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), s -> null, cfg);

softAssertions
.assertThat(rmObjectValidator.validate(unmarshal))
.filteredOn(m -> !m.getMessage().contains("Inv_null_flavour_indicated"))
.filteredOn(m -> m.getType() != RMObjectValidationMessageType.ARCHETYPE_NOT_FOUND)
.containsExactlyInAnyOrder();

softAssertions.assertAll();
Expand Down Expand Up @@ -352,11 +364,16 @@ private void check(

softAssertions.assertThat(unmarshal).isNotNull();

RMObjectValidator rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), s -> null);
ValidationConfiguration cfg = new ValidationConfiguration.Builder()
.validateInvariants(true)
.failOnUnknownTerminologyId(!true)
.build();

RMObjectValidator rmObjectValidator = new RMObjectValidator(ArchieRMInfoLookup.getInstance(), s -> null, cfg);

softAssertions
.assertThat(rmObjectValidator.validate(unmarshal))
.filteredOn(m -> !m.getMessage().contains("Inv_null_flavour_indicated"))
.filteredOn(m -> m.getType() != RMObjectValidationMessageType.ARCHETYPE_NOT_FOUND)
.containsExactlyInAnyOrder();

softAssertions.assertAll();
Expand Down
2 changes: 1 addition & 1 deletion serialisation_conformance_test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>serialisation_conformance_test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion terminology/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>terminology</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>test-coverage</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion test-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>test-data</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>util</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private RmConstants() {}

public static final String EHR = "EHR";
public static final String EHR_STATUS = "EHR_STATUS";
public static final String FOLDER = "FOLDER";
public static final String COMPOSITION = "COMPOSITION";
public static final String SECTION = "SECTION";
public static final String OBSERVATION = "OBSERVATION";
Expand Down
2 changes: 1 addition & 1 deletion validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</parent>

<artifactId>validation</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import com.nedap.archie.rm.composition.Composition;
import com.nedap.archie.rminfo.ArchieRMInfoLookup;
import com.nedap.archie.rmobjectvalidator.RMObjectValidationMessage;
import com.nedap.archie.rmobjectvalidator.RMObjectValidator;
import com.nedap.archie.rmobjectvalidator.ValidationConfiguration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.stream.Collectors;
import org.ehrbase.openehr.sdk.validation.terminology.ExternalTerminologyValidation;
import org.ehrbase.openehr.sdk.validation.webtemplate.ValidationWalker;
Expand All @@ -36,12 +38,45 @@
* This class is NOT thread-safe!
*/
public class CompositionValidator {
private final ReadWriteLock lock = new ReentrantReadWriteLock();

private final RMObjectValidator rmObjectValidator =
new RMObjectValidator(ArchieRMInfoLookup.getInstance(), archetypeId -> null);
private ValidationConfiguration validationCfg = new ValidationConfiguration.Builder()
.validateInvariants(true)
.failOnUnknownTerminologyId(false)
.build();

private ConfigurableRMObjectValidator rmObjectValidator;

{
initObjectValidator(false);
}

private ExternalTerminologyValidation externalTerminologyValidation;

public void setArchetypeValidation(boolean archetypeValidation) {
initObjectValidator(archetypeValidation);
}

private void initObjectValidator(boolean archetypeValidation) {
try {
lock.writeLock().lock();
rmObjectValidator = new ConfigurableRMObjectValidator(
ArchieRMInfoLookup.getInstance(), archetypeId -> null, validationCfg, archetypeValidation);
} finally {
lock.writeLock().unlock();
}
}

public ConfigurableRMObjectValidator getRmObjectValidator() {
try {
lock.readLock().lock();
return rmObjectValidator;
} finally {
lock.readLock().unlock();
}
}

//////////////////////////////
public CompositionValidator() {}

public CompositionValidator(ExternalTerminologyValidation externalTerminologyValidation) {
Expand All @@ -67,7 +102,7 @@ public List<ConstraintViolation> validate(Composition composition, OPERATIONALTE
* @return the list of constraint violations
*/
public List<ConstraintViolation> validate(Composition composition, WebTemplate template) {
List<RMObjectValidationMessage> messages = rmObjectValidator.validate(composition);
List<RMObjectValidationMessage> messages = getRmObjectValidator().validate(composition);
if (messages.isEmpty()) {
List<ConstraintViolation> result = new ArrayList<>();
new ValidationWalker(externalTerminologyValidation)
Expand All @@ -87,7 +122,16 @@ public List<ConstraintViolation> validate(Composition composition, WebTemplate t
* @param validateInvariants the boolean value
*/
public void setRunInvariantChecks(boolean validateInvariants) {
rmObjectValidator.setRunInvariantChecks(validateInvariants);
try {
lock.writeLock().lock();
validationCfg = new ValidationConfiguration.Builder()
.validateInvariants(validateInvariants)
.failOnUnknownTerminologyId(false)
.build();
initObjectValidator(rmObjectValidator.isArchetypeValidation());
} finally {
lock.writeLock().unlock();
}
}

/**
Expand All @@ -98,8 +142,4 @@ public void setRunInvariantChecks(boolean validateInvariants) {
public void setExternalTerminologyValidation(ExternalTerminologyValidation externalTerminologyValidation) {
this.externalTerminologyValidation = externalTerminologyValidation;
}

public RMObjectValidator getRmObjectValidator() {
return rmObjectValidator;
}
}
Loading

0 comments on commit 7272e33

Please sign in to comment.