Skip to content

Commit

Permalink
migrate sdk to ehrbase v2.0.0 (#588)
Browse files Browse the repository at this point in the history
* migrate sdk to erhbase v2.0.0

* update changelog

* Add explicit unit tests and integration tests jacoco steps (#589)

* Separate codestyle in a standalone workflow as it's done in EHRbase

* Add explicit unit tests and integration tests jacoco steps

* Remove client from surfire tests and update it command

* Remove aggregate separate step

---------

Co-authored-by: Alex <alex.vidrean@gmail.com>
  • Loading branch information
stefanspiska and vidi42 authored Apr 24, 2024
1 parent 6078998 commit 2e506db
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 600 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ jobs:
java-version: '17'
cache: 'maven'

- name: Maven - Verify, Jacoco and Package
run: mvn --batch-mode -U verify test jacoco:report-aggregate package
- name: Jacoco - Unit Tests
run: mvn --batch-mode clean jacoco:prepare-agent package jacoco:report

- name: Jacoco - Integration Tests
run: mvn --batch-mode jacoco:prepare-agent-integration failsafe:integration-test failsafe:verify verify jacoco:report

- name: Sonar - Analyze
# Dependabot has no access to the SONAR_TOKEN secret, so we need to skip sonar.
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Note: version releases in the 0.x.y range may introduce breaking changes.

## [unreleased]
### Added
### Changed
- Removed OpenEhrClient::getFolder (use directoryCrudEndpoint()::getFolder instead) ([#588](https://github.com/ehrbase/openEHR_SDK/pull/588))
### Fixed
- Migrated test to run against EHRbase v2 ([#588](https://github.com/ehrbase/openEHR_SDK/pull/588))
- ContributionBuilder: set VERSION.lifecycle_state to 'complete'" ([#588](https://github.com/ehrbase/openEHR_SDK/pull/588))

## [2.9.1]
### Added
Expand Down
16 changes: 0 additions & 16 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,6 @@
<license-header.dir>../</license-header.dir>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration combine.self="override">
<dependenciesToScan>com.github.better-care:web-template-tests</dependenciesToScan>
<includes>
<include>${include.tests}</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>javax.cache</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public interface OpenEhrClient {

DirectoryCrudEndpoint directoryCrudEndpoint(UUID ehrId);

FolderDAO folder(UUID ehrId, String path);

/**
* Get the {@link TemplateEndpoint}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
import com.nedap.archie.rm.archetyped.Locatable;
import com.nedap.archie.rm.changecontrol.OriginalVersion;
import com.nedap.archie.rm.composition.Composition;
import com.nedap.archie.rm.datatypes.CodePhrase;
import com.nedap.archie.rm.datavalues.DvCodedText;
import com.nedap.archie.rm.directory.Folder;
import com.nedap.archie.rm.generic.AuditDetails;
import com.nedap.archie.rm.support.identification.ObjectVersionId;
import com.nedap.archie.rm.support.identification.TerminologyId;
import com.nedap.archie.rm.support.identification.UIDBasedId;
import javax.annotation.Nullable;
import org.ehrbase.openehr.sdk.client.openehrclient.ContributionChangeType;
Expand Down Expand Up @@ -192,6 +195,8 @@ private void updateContribution(
updateMetadataById(precedingVersionUid, originalVersion, compositionAudit);

originalVersion.setCommitAudit(compositionAudit);
originalVersion.setLifecycleState(
new DvCodedText("complete", new CodePhrase(new TerminologyId("openehr"), "532")));

this.contributionCreateDto.getVersions().add(originalVersion);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import org.ehrbase.openehr.sdk.client.openehrclient.CompositionEndpoint;
import org.ehrbase.openehr.sdk.client.openehrclient.ContributionEndpoint;
import org.ehrbase.openehr.sdk.client.openehrclient.DirectoryCrudEndpoint;
import org.ehrbase.openehr.sdk.client.openehrclient.FolderDAO;
import org.ehrbase.openehr.sdk.client.openehrclient.OpenEhrClient;
import org.ehrbase.openehr.sdk.client.openehrclient.OpenEhrClientConfig;
import org.ehrbase.openehr.sdk.client.openehrclient.TemplateEndpoint;
Expand Down Expand Up @@ -330,11 +329,6 @@ public DirectoryCrudEndpoint directoryCrudEndpoint(UUID ehrId) {
return new DefaultCrudEndpoint(this, ehrId);
}

@Override
public FolderDAO folder(UUID ehrId, String path) {
return new DefaultRestDirectoryEndpoint(this, ehrId).getFolder(path);
}

@Override
public TemplateEndpoint templateEndpoint() {
return new DefaultRestTemplateEndpoint(this);
Expand Down

This file was deleted.

Loading

0 comments on commit 2e506db

Please sign in to comment.