diff --git a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/DataSharingProcessPluginDefinition.java b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/DataSharingProcessPluginDefinition.java index f3137336..7160f9cf 100644 --- a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/DataSharingProcessPluginDefinition.java +++ b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/DataSharingProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -20,6 +21,7 @@ public class DataSharingProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.6.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); @Override public String getName() @@ -33,6 +35,12 @@ public String getVersion() return VERSION; } + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + @Override public Stream getBpmnFiles() { @@ -75,7 +83,8 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader "highmedorg_requestDataSharing/" + VERSION, Arrays.asList(aReq, cDS, sTReq, sRSDS, sTResM, sTErrM, vDS)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resolver, resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, RELEASE_DATE, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/BloomFilterConfig.java b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/BloomFilterConfig.java index e4d117cb..b1d35d1f 100644 --- a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/BloomFilterConfig.java +++ b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/BloomFilterConfig.java @@ -8,7 +8,6 @@ import org.highmed.dsf.fhir.variables.KeySerializer; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -60,22 +59,24 @@ public BloomFilterConfig(@JsonProperty("permutationSeed") long permutationSeed, this.hmacSha3Key = hmacSha3Key; } + @JsonProperty("permutationSeed") public long getPermutationSeed() { return permutationSeed; } + @JsonProperty("hmacSha2Key") public Key getHmacSha2Key() { return hmacSha2Key; } + @JsonProperty("hmacSha3Key") public Key getHmacSha3Key() { return hmacSha3Key; } - @JsonIgnore public byte[] toBytes() { byte[] bytes = new byte[SEED_LENGTH + HMAC_SHA2_KEY_LENGTH + HMAC_SHA3_KEY_LENGTH]; diff --git a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResult.java b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResult.java index 9ce52281..a233b001 100644 --- a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResult.java +++ b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResult.java @@ -3,7 +3,6 @@ import org.highmed.openehr.model.structure.ResultSet; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; public class QueryResult @@ -44,44 +43,46 @@ public QueryResult(@JsonProperty("organizationIdentifier") String organizationId this.resultSetUrl = resultSetUrl; } + @JsonProperty("organizationIdentifier") public String getOrganizationIdentifier() { return organizationIdentifier; } + @JsonProperty("cohortId") public String getCohortId() { return cohortId; } + @JsonProperty("cohortSize") public int getCohortSize() { return cohortSize; } + @JsonProperty("resultSet") public ResultSet getResultSet() { return resultSet; } + @JsonProperty("resultSetUrl") public String getResultSetUrl() { return resultSetUrl; } - @JsonIgnore public boolean isCohortSizeResult() { return resultSet == null && resultSetUrl == null; } - @JsonIgnore public boolean isIdResultSetResult() { return resultSet != null && resultSetUrl == null; } - @JsonIgnore public boolean isIdResultSetUrlResult() { return resultSet == null && resultSetUrl != null; diff --git a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResults.java b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResults.java index ff3cd0ec..89c11818 100644 --- a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResults.java +++ b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/QueryResults.java @@ -31,6 +31,7 @@ public void addAll(Collection results) this.results.addAll(results); } + @JsonProperty("results") public List getResults() { return Collections.unmodifiableList(results); diff --git a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/SecretKeyWrapper.java b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/SecretKeyWrapper.java index 25af2797..06b39322 100644 --- a/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/SecretKeyWrapper.java +++ b/dsf-bpe-process-data-sharing/src/main/java/org/highmed/dsf/bpe/variable/SecretKeyWrapper.java @@ -10,7 +10,6 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; public class SecretKeyWrapper @@ -49,17 +48,18 @@ private SecretKeyWrapper(@JsonProperty("bytes") byte[] bytes, @JsonProperty("alg this.algorithm = algorithm; } - @JsonIgnore public SecretKey getSecretKey() { return new SecretKeySpec(bytes, algorithm); } + @JsonProperty("algorithm") public String getAlgorithm() { return algorithm; } + @JsonProperty("bytes") public byte[] getBytes() { byte[] key = new byte[bytes.length]; diff --git a/dsf-bpe-process-data-sharing/src/main/resources/bpe/computeDataSharing.bpmn b/dsf-bpe-process-data-sharing/src/main/resources/bpe/computeDataSharing.bpmn index f11bb01d..b7b4d2a2 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/bpe/computeDataSharing.bpmn +++ b/dsf-bpe-process-data-sharing/src/main/resources/bpe/computeDataSharing.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_1lfe4wr SequenceFlow_0xxpamp @@ -41,9 +41,9 @@ - http://highmed.org/bpe/Process/requestDataSharing/0.6.0 + http://highmed.org/bpe/Process/requestDataSharing/#{version} resultMultiMedicDataSharingMessage - http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-data-sharing|0.6.0 + http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-data-sharing|#{version} Flow_0uaqn1r @@ -82,9 +82,9 @@ - http://highmed.org/bpe/Process/requestDataSharing/0.6.0 + http://highmed.org/bpe/Process/requestDataSharing/#{version} errorMultiMedicDataSharingMessage - http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-data-sharing|0.6.0 + http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-data-sharing|#{version} Flow_1tmnvhl diff --git a/dsf-bpe-process-data-sharing/src/main/resources/bpe/executeDataSharing.bpmn b/dsf-bpe-process-data-sharing/src/main/resources/bpe/executeDataSharing.bpmn index d39beff3..577d10ca 100755 --- a/dsf-bpe-process-data-sharing/src/main/resources/bpe/executeDataSharing.bpmn +++ b/dsf-bpe-process-data-sharing/src/main/resources/bpe/executeDataSharing.bpmn @@ -1,6 +1,6 @@ - + Flow_1pzik8k Flow_08925ay @@ -23,9 +23,9 @@ - http://highmed.org/bpe/Process/computeDataSharing/0.6.0 + http://highmed.org/bpe/Process/computeDataSharing/#{version} resultSingleMedicDataSharingMessage - http://highmed.org/fhir/StructureDefinition/task-single-medic-result-data-sharing|0.6.0 + http://highmed.org/fhir/StructureDefinition/task-single-medic-result-data-sharing|#{version} Flow_1611vr6 diff --git a/dsf-bpe-process-data-sharing/src/main/resources/bpe/requestDataSharing.bpmn b/dsf-bpe-process-data-sharing/src/main/resources/bpe/requestDataSharing.bpmn index 5273b87b..6d6d1018 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/bpe/requestDataSharing.bpmn +++ b/dsf-bpe-process-data-sharing/src/main/resources/bpe/requestDataSharing.bpmn @@ -1,6 +1,6 @@ - + @@ -15,9 +15,9 @@ - http://highmed.org/bpe/Process/executeDataSharing/0.6.0 + http://highmed.org/bpe/Process/executeDataSharing/#{version} executeDataSharingMessage - http://highmed.org/fhir/StructureDefinition/task-execute-data-sharing|0.6.0 + http://highmed.org/fhir/StructureDefinition/task-execute-data-sharing|#{version} Flow_18ie7l6 @@ -66,9 +66,9 @@ - http://highmed.org/bpe/Process/computeDataSharing/0.6.0 + http://highmed.org/bpe/Process/computeDataSharing/#{version} computeDataSharingMessage - http://highmed.org/fhir/StructureDefinition/task-compute-data-sharing|0.6.0 + http://highmed.org/fhir/StructureDefinition/task-compute-data-sharing|#{version} Flow_0cx3xe1 diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-computeDataSharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-computeDataSharing.xml index 7b270fdd..19c6cc5d 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-computeDataSharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-computeDataSharing.xml @@ -10,7 +10,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -103,14 +103,15 @@ - + <subtitle value="Process to compute a data sharing result" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-executeDataSharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-executeDataSharing.xml index ee1991d4..0667ba3a 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-executeDataSharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-executeDataSharing.xml @@ -10,7 +10,7 @@ <valueString value="executeDataSharingMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-data-sharing|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-data-sharing|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -75,14 +75,15 @@ </extension> <url value="http://highmed.org/bpe/Process/executeDataSharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="ExecuteDataSharing" /> <title value="Execute Data Sharing" /> <subtitle value="Process to execute a data sharing query" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-requestDataSharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-requestDataSharing.xml index 1c6f26d0..998f885b 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-requestDataSharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ActivityDefinition/highmed-requestDataSharing.xml @@ -10,7 +10,7 @@ <valueString value="requestDataSharingMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-data-sharing|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-data-sharing|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -58,7 +58,7 @@ <valueString value="resultMultiMedicDataSharingMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-data-sharing|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-data-sharing|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -106,7 +106,7 @@ <valueString value="errorMultiMedicDataSharingMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-data-sharing|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-data-sharing|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -151,14 +151,15 @@ </extension> <url value="http://highmed.org/bpe/Process/requestDataSharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="RequestDataSharing" /> <title value="Request Data Sharing" /> <subtitle value="Process to request data sharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/CodeSystem/highmed-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/CodeSystem/highmed-data-sharing.xml index 8be4cade..c43a1f12 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/CodeSystem/highmed-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/CodeSystem/highmed-data-sharing.xml @@ -7,13 +7,14 @@ </meta> <url value="http://highmed.org/fhir/CodeSystem/data-sharing"/> <!-- version managed by bpe --> - <version value="${version}"/> + <version value="#{version}"/> <name value="HiGHmed_Data_Sharing"/> <title value="HiGHmed Data Sharing"/> <!-- status managed by bpe --> <status value="unknown"/> <experimental value="false"/> - <date value="2021-08-24"/> + <!-- date managed by bpe --> + <date value="#{date}"/> <publisher value="HiGHmed"/> <description value="CodeSystem with standard values for HiGhmed data sharing processes"/> <caseSensitive value="true"/> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-research-study-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-research-study-data-sharing.xml index 87970a96..1f8b8470 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-research-study-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-research-study-data-sharing.xml @@ -7,11 +7,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/research-study-data-sharing" /> - <version value="${version}" /> + <version value="#{version}" /> <name value="ResearchStudyDataSharing" /> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-compute-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-compute-data-sharing.xml index 516f1134..82c9f854 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-compute-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-compute-data-sharing.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-compute-data-sharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskComputeDataSharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeDataSharing/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/computeDataSharing/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-execute-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-execute-data-sharing.xml index 89055a75..10addc27 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-execute-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-execute-data-sharing.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-data-sharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskExecuteDataSharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeDataSharing/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/executeDataSharing/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-error-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-error-data-sharing.xml index a13196f9..697acc73 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-error-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-error-data-sharing.xml @@ -8,12 +8,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-data-sharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskMultiMedicErrorDataSharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -23,7 +24,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestDataSharing/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestDataSharing/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-data-sharing.xml index 52d4a7d3..bed845b8 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-data-sharing.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-data-sharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskMultiMedicResultDataSharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestDataSharing/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestDataSharing/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-request-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-request-data-sharing.xml index f9728bf1..fb5387f4 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-request-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-request-data-sharing.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-data-sharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskRequestDataSharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestDataSharing/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestDataSharing/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-data-sharing.xml index b13942f9..e089d280 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-data-sharing.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-data-sharing" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskSingleMedicResultDataSharing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeDataSharing/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/computeDataSharing/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ValueSet/highmed-data-sharing.xml b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ValueSet/highmed-data-sharing.xml index 8992686f..c02879f1 100644 --- a/dsf-bpe-process-data-sharing/src/main/resources/fhir/ValueSet/highmed-data-sharing.xml +++ b/dsf-bpe-process-data-sharing/src/main/resources/fhir/ValueSet/highmed-data-sharing.xml @@ -7,13 +7,14 @@ </meta> <url value="http://highmed.org/fhir/ValueSet/data-sharing"/> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="HiGHmed_Data_Sharing"/> <title value="HiGHmed Data Sharing"/> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false"/> - <date value="2021-08-24"/> + <!-- date managed by bpe --> + <date value="#{date}"/> <publisher value="HiGHmed"/> <description value="ValueSet with standard values for HiGhmed data sharing processes"/> <immutable value="true"/> diff --git a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializationTest.java similarity index 82% rename from dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java rename to dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializationTest.java index 6475a784..4526ca8d 100644 --- a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java +++ b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializationTest.java @@ -8,15 +8,18 @@ import javax.crypto.spec.SecretKeySpec; import org.highmed.dsf.bpe.variable.BloomFilterConfig; +import org.highmed.dsf.fhir.json.ObjectMapperFactory; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -public class BloomFilterConfigTest +import ca.uhn.fhir.context.FhirContext; + +public class BloomFilterConfigSerializationTest { - private static final Logger logger = LoggerFactory.getLogger(BloomFilterConfigTest.class); + private static final Logger logger = LoggerFactory.getLogger(BloomFilterConfigSerializationTest.class); private static final byte[] b1 = Base64.getDecoder().decode("KLhuuy3lDSmo8A/mcYBBZJ+Xu+ok30qDGM4L0magwyY="); private static final byte[] b2 = Base64.getDecoder().decode("VALdwRisuEsUBIXaqJ01L9lk0jJUSGm5ZBE+Ha5bm8c="); @@ -25,16 +28,16 @@ public class BloomFilterConfigTest @Test public void testReadWriteJson() throws Exception { - ObjectMapper objectMapper = new ObjectMapper(); + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); BloomFilterConfig bfc = new BloomFilterConfig(l, new SecretKeySpec(b1, "HmacSHA256"), new SecretKeySpec(b2, "HmacSHA3-256")); - String value = objectMapper.writeValueAsString(bfc); + String value = mapper.writeValueAsString(bfc); logger.debug("BloomFilterConfig: {}", value); - BloomFilterConfig readBfc = objectMapper.readValue(value, BloomFilterConfig.class); + BloomFilterConfig readBfc = mapper.readValue(value, BloomFilterConfig.class); assertNotNull(readBfc); assertEquals(bfc.getPermutationSeed(), readBfc.getPermutationSeed()); diff --git a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/QueryResultsSerializationTest.java b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/QueryResultsSerializationTest.java new file mode 100644 index 00000000..d26d39f2 --- /dev/null +++ b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/QueryResultsSerializationTest.java @@ -0,0 +1,91 @@ +package org.highmed.dsf.bpe.variables; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +import org.highmed.dsf.bpe.variable.QueryResult; +import org.highmed.dsf.bpe.variable.QueryResults; +import org.highmed.dsf.fhir.json.ObjectMapperFactory; +import org.highmed.openehr.model.datatypes.IntegerRowElement; +import org.highmed.openehr.model.datatypes.StringRowElement; +import org.highmed.openehr.model.structure.Column; +import org.highmed.openehr.model.structure.Meta; +import org.highmed.openehr.model.structure.ResultSet; +import org.highmed.openehr.model.structure.RowElement; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import ca.uhn.fhir.context.FhirContext; + +public class QueryResultsSerializationTest +{ + private static final Logger logger = LoggerFactory.getLogger(QueryResultsSerializationTest.class); + + @Test + public void testEmptyQueryResultsSerialization() throws Exception + { + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); + + QueryResults results = new QueryResults(Collections.emptyList()); + + String resultsAsString = mapper.writeValueAsString(results); + assertNotNull(resultsAsString); + + logger.debug("QueryResults (empty): '{}'", resultsAsString); + + QueryResults readResults = mapper.readValue(resultsAsString, QueryResults.class); + assertNotNull(readResults); + assertNotNull(readResults.getResults()); + assertTrue(readResults.getResults().isEmpty()); + } + + @Test + public void testNonEmptyQueryResultsSerialization() throws Exception + { + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); + + QueryResult result = new QueryResult("test.org", UUID.randomUUID().toString(), 1, createResultSet(), + "http://test.com/fhir/Binary/" + UUID.randomUUID().toString()); + QueryResults results = new QueryResults(Collections.singleton(result)); + + String resultsAsString = mapper.writeValueAsString(results); + assertNotNull(resultsAsString); + + logger.debug("QueryResults (non empty): '{}'", resultsAsString); + + QueryResults readResults = mapper.readValue(resultsAsString, QueryResults.class); + assertNotNull(readResults); + assertNotNull(readResults.getResults()); + assertFalse(readResults.getResults().isEmpty()); + assertEquals(1, readResults.getResults().size()); + assertNotNull(readResults.getResults().get(0)); + assertEquals(result.getCohortId(), readResults.getResults().get(0).getCohortId()); + assertEquals(result.getCohortSize(), readResults.getResults().get(0).getCohortSize()); + assertEquals(result.getOrganizationIdentifier(), readResults.getResults().get(0).getOrganizationIdentifier()); + assertEquals(result.getResultSetUrl(), readResults.getResults().get(0).getResultSetUrl()); + assertNotNull(readResults.getResults().get(0).getResultSet()); + assertEquals(result.getResultSet().getName(), readResults.getResults().get(0).getResultSet().getName()); + assertEquals(result.getResultSet().getQuery(), readResults.getResults().get(0).getResultSet().getQuery()); + // Not testing every ResultSet property, see ResultSet serialization tests + } + + private ResultSet createResultSet() + { + Meta meta = new Meta("href", "type", "schemaVersion", "created", "generator", "executedAql"); + List<Column> columns = Arrays.asList(new Column("name1", "path1"), new Column("name2", "path2")); + List<List<RowElement>> rows = Arrays.asList(Arrays.asList(new IntegerRowElement(123)), + Arrays.asList(new StringRowElement("456"))); + ResultSet resultSet = new ResultSet(meta, "name", "query", columns, rows); + return resultSet; + } +} diff --git a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/SecretKeyWrapperTest.java b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/SecretKeyWrapperSerializationTest.java similarity index 62% rename from dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/SecretKeyWrapperTest.java rename to dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/SecretKeyWrapperSerializationTest.java index 974e5166..b14d3603 100644 --- a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/SecretKeyWrapperTest.java +++ b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/bpe/variables/SecretKeyWrapperSerializationTest.java @@ -1,8 +1,11 @@ package org.highmed.dsf.bpe.variables; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import org.highmed.dsf.bpe.variable.SecretKeyWrapper; +import org.highmed.dsf.fhir.json.ObjectMapperFactory; import org.highmed.pseudonymization.crypto.AesGcmUtil; import org.junit.Test; import org.slf4j.Logger; @@ -10,22 +13,24 @@ import com.fasterxml.jackson.databind.ObjectMapper; -public class SecretKeyWrapperTest +import ca.uhn.fhir.context.FhirContext; + +public class SecretKeyWrapperSerializationTest { - private static final Logger logger = LoggerFactory.getLogger(SecretKeyWrapperTest.class); + private static final Logger logger = LoggerFactory.getLogger(SecretKeyWrapperSerializationTest.class); @Test public void testReadWriteJson() throws Exception { - ObjectMapper objectMapper = new ObjectMapper(); + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); SecretKeyWrapper key = SecretKeyWrapper.newAes256Key(); - String value = objectMapper.writeValueAsString(key); + String value = mapper.writeValueAsString(key); logger.debug("SecretKeyWrapper: {}", value); - SecretKeyWrapper readkey = objectMapper.readValue(value, SecretKeyWrapper.class); + SecretKeyWrapper readkey = mapper.readValue(value, SecretKeyWrapper.class); assertNotNull(readkey); assertEquals(key.getAlgorithm(), readkey.getAlgorithm()); @@ -36,17 +41,17 @@ public void testReadWriteJson() throws Exception @Test public void testReadWriteJsonFromBytes() throws Exception { - ObjectMapper objectMapper = new ObjectMapper(); + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); byte[] bytes = AesGcmUtil.generateAES256Key().getEncoded(); SecretKeyWrapper key = SecretKeyWrapper.fromAes256Key(bytes); assertArrayEquals(bytes, key.getBytes()); - String value = objectMapper.writeValueAsString(key); + String value = mapper.writeValueAsString(key); logger.debug("SecretKeyWrapper: {}", value); - SecretKeyWrapper readkey = objectMapper.readValue(value, SecretKeyWrapper.class); + SecretKeyWrapper readkey = mapper.readValue(value, SecretKeyWrapper.class); assertNotNull(readkey); assertEquals(key.getAlgorithm(), readkey.getAlgorithm()); diff --git a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java index 35187d2d..629fdeac 100644 --- a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -1,11 +1,10 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.DataSharingProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.DataSharingProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; @@ -28,7 +27,7 @@ public class ActivityDefinitionProfileTest private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", "highmed-extension-process-authorization-consortium-role-0.5.0.xml", "highmed-extension-process-authorization-organization-0.5.0.xml", @@ -50,67 +49,53 @@ public class ActivityDefinitionProfileTest @Test public void testComputeFeasibilityValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-computeDataSharing.xml"))) + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-computeDataSharing.xml")); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); - - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - - assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> - { - System.err.println("Org: " + orgIdentifier); - return true; - }, role -> - { - System.err.println("Role:" + role); - return true; - })); - } + System.err.println("Org: " + orgIdentifier); + return true; + }, role -> + { + System.err.println("Role:" + role); + return true; + })); } @Test public void testExecuteFeasibilityValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeDataSharing.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeDataSharing.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } @Test public void testRequestFeasibilityValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestDataSharing.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestDataSharing.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } } \ No newline at end of file diff --git a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index f0544f61..6be6c921 100644 --- a/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-data-sharing/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -34,6 +34,7 @@ import static org.highmed.dsf.bpe.ConstantsDataSharing.PROFILE_HIGHMED_TASK_REQUEST_DATA_SHARING_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.ConstantsDataSharing.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_DATA_SHARING; import static org.highmed.dsf.bpe.ConstantsDataSharing.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_DATA_SHARING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.DataSharingProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.DataSharingProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; @@ -71,7 +72,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-group-0.5.0.xml", "highmed-extension-group-id-0.5.0.xml", "highmed-research-study-0.5.0.xml", "highmed-research-study-data-sharing.xml", "highmed-task-request-data-sharing.xml", diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index 8d48387d..bfda306e 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -21,6 +22,7 @@ public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.6.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); private static final String DEPENDENCY_DATA_SHARING_VERSION = "0.6.0"; private static final String DEPENDENCY_DATA_SHARING_NAME_AND_VERSION = "dsf-bpe-process-data-sharing-0.6.0"; @@ -37,6 +39,12 @@ public String getVersion() return VERSION; } + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + @Override public Stream<String> getBpmnFiles() { @@ -83,7 +91,8 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader "highmedorg_executeFeasibility/" + VERSION, Arrays.asList(aExe, cDS, sTExe, vDS), "highmedorg_requestFeasibility/" + VERSION, Arrays.asList(aReq, cDS, sTReq, sTResM, sTErr, vDS)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resolver, resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, RELEASE_DATE, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java index 9cbd2324..5c82d02f 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java @@ -18,16 +18,19 @@ public FinalFeasibilityQueryResult(@JsonProperty("cohortId") String cohortId, this.cohortSize = cohortSize; } + @JsonProperty("cohortId") public String getCohortId() { return cohortId; } + @JsonProperty("participatingMedics") public int getParticipatingMedics() { return participatingMedics; } + @JsonProperty("cohortSize") public int getCohortSize() { return cohortSize; diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java index 65f413db..0ba16484 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java @@ -32,6 +32,7 @@ public void addAll(Collection<FinalFeasibilityQueryResult> results) this.results.addAll(results); } + @JsonProperty("results") public List<FinalFeasibilityQueryResult> getResults() { return Collections.unmodifiableList(results); diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn index f3dd3b5e..15001ec2 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1yff9tp" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_computeFeasibility" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_computeFeasibility" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:subProcess id="SubProcess_1gopxt4"> <bpmn:incoming>SequenceFlow_1lfe4wr</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0xxpamp</bpmn:outgoing> @@ -45,9 +45,9 @@ <bpmn:endEvent id="EndEventSuccess" name="send final results to leading MeDIC"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/requestFeasibility/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/requestFeasibility/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">resultMultiMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_1r6dq8y</bpmn:incoming> @@ -96,9 +96,9 @@ <bpmn:endEvent id="EndEventError" name="send error to leading MeDIC"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/requestFeasibility/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/requestFeasibility/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">errorMultiMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_1tmnvhl</bpmn:incoming> diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn index 4c556084..d1d58a32 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_executeFeasibility" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_executeFeasibility" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> @@ -24,9 +24,9 @@ <bpmn:endEvent id="EndEvent" name="send results to TTP"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/computeFeasibility/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/computeFeasibility/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0ascyjc</bpmn:incoming> diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn index 18130802..c9fe4471 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0inb4ax" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_requestFeasibility" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_requestFeasibility" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:startEvent id="StartEvent" name="start"> <bpmn:outgoing>SequenceFlow_11k77gx</bpmn:outgoing> <bpmn:messageEventDefinition id="MessageEventDefinition_10c2suu" messageRef="Message_1pq9qxp" /> @@ -12,9 +12,9 @@ <bpmn:sendTask id="sendRequestToMedics" name="send request to medics" camunda:class="org.highmed.dsf.bpe.message.SendMedicRequest"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeFeasibility/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeFeasibility/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">executeFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-feasibility|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-feasibility|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_035oihl</bpmn:incoming> @@ -32,9 +32,9 @@ <bpmn:intermediateThrowEvent id="sendCorreltationKeysToTTP" name="send correlation keys to TTP"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/computeFeasibility/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/computeFeasibility/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">computeFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-compute-feasibility|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-compute-feasibility|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0b5s4ef</bpmn:incoming> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml index a9c664cd..78a0e027 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml @@ -10,7 +10,7 @@ <valueString value="computeFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -58,7 +58,7 @@ <valueString value="resultSingleMedicFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -103,14 +103,15 @@ </extension> <url value="http://highmed.org/bpe/Process/computeFeasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="ComputeFeasibility" /> <title value="Compute Feasibility" /> <subtitle value="Process to compute feasibility result" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml index 974932a3..506fd2cd 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml @@ -10,7 +10,7 @@ <valueString value="executeFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -75,14 +75,15 @@ </extension> <url value="http://highmed.org/bpe/Process/executeFeasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="ExecuteFeasibility" /> <title value="Execute a Feasibility" /> <subtitle value="Process to execute a feasibility query" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml index c367973d..3307bdda 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml @@ -10,7 +10,7 @@ <valueString value="requestFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -58,7 +58,7 @@ <valueString value="resultMultiMedicFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -106,7 +106,7 @@ <valueString value="errorMultiMedicFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -151,14 +151,15 @@ </extension> <url value="http://highmed.org/bpe/Process/requestFeasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="RequestFeasibility" /> <title value="Request feasibility" /> <subtitle value="Feasibility Request Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml index 6cf2b575..838e2802 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskComputeFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml index a225592d..6fc4694e 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskErrorFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml index 1bbe5fca..0f10b3ac 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskExecuteFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeFeasibility/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/executeFeasibility/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml index 44d1bd93..96515028 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskMultiMedicResultFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml index 5bd05576..f32ef12b 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskRequestFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml index 9eccad8b..873432dd 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskSingleMedicResultFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializationTest.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializationTest.java new file mode 100644 index 00000000..9e691aa2 --- /dev/null +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializationTest.java @@ -0,0 +1,66 @@ +package org.highmed.dsf.bpe.variables; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Collections; + +import org.highmed.dsf.fhir.json.ObjectMapperFactory; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import ca.uhn.fhir.context.FhirContext; + +public class FinalFeasibilityQueryResultsSerializationTest +{ + private static final Logger logger = LoggerFactory.getLogger(FinalFeasibilityQueryResultsSerializationTest.class); + + @Test + public void testEmptyFinalFeasibilityQueryResultsSerialization() throws Exception + { + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); + + FinalFeasibilityQueryResults results = new FinalFeasibilityQueryResults(Collections.emptyList()); + + String resultsAsString = mapper.writeValueAsString(results); + assertNotNull(resultsAsString); + + logger.debug("FinalFeasibilityQueryResults (empty): '{}'", resultsAsString); + + FinalFeasibilityQueryResults readResults = mapper.readValue(resultsAsString, + FinalFeasibilityQueryResults.class); + assertNotNull(readResults); + assertNotNull(readResults.getResults()); + assertTrue(readResults.getResults().isEmpty()); + } + + @Test + public void testNonEmptyFinalFeasibilityQueryResultsSerialization() throws Exception + { + ObjectMapper mapper = ObjectMapperFactory.createObjectMapper(FhirContext.forR4()); + + FinalFeasibilityQueryResult result = new FinalFeasibilityQueryResult("cohortId", 1, 2); + FinalFeasibilityQueryResults results = new FinalFeasibilityQueryResults(Collections.singleton(result)); + + String resultsAsString = mapper.writeValueAsString(results); + assertNotNull(resultsAsString); + + logger.debug("FinalFeasibilityQueryResults (non empty): '{}'", resultsAsString); + + FinalFeasibilityQueryResults readResults = mapper.readValue(resultsAsString, + FinalFeasibilityQueryResults.class); + assertNotNull(readResults); + assertNotNull(readResults.getResults()); + assertFalse(readResults.getResults().isEmpty()); + assertEquals(1, readResults.getResults().size()); + assertNotNull(readResults.getResults().get(0)); + assertEquals(result.getCohortId(), readResults.getResults().get(0).getCohortId()); + assertEquals(result.getCohortSize(), readResults.getResults().get(0).getCohortSize()); + assertEquals(result.getParticipatingMedics(), readResults.getResults().get(0).getParticipatingMedics()); + } +} diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java index e12cd5bc..e4e43c74 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -1,11 +1,10 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; @@ -28,7 +27,7 @@ public class ActivityDefinitionProfileTest private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", "highmed-extension-process-authorization-consortium-role-0.5.0.xml", "highmed-extension-process-authorization-organization-0.5.0.xml", @@ -50,67 +49,53 @@ public class ActivityDefinitionProfileTest @Test public void testComputeFeasibilityValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml"))) + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml")); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); - - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - - assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> - { - System.err.println("Org: " + orgIdentifier); - return true; - }, role -> - { - System.err.println("Role:" + role); - return true; - })); - } + System.err.println("Org: " + orgIdentifier); + return true; + }, role -> + { + System.err.println("Role:" + role); + return true; + })); } @Test public void testExecuteFeasibilityValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } @Test public void testRequestFeasibilityValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } } \ No newline at end of file diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 44f26549..ac64270f 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -33,6 +33,7 @@ import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; @@ -69,7 +70,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-group-0.5.0.xml", "highmed-extension-group-id-0.5.0.xml", "highmed-research-study-0.5.0.xml", "highmed-task-request-feasibility.xml", "highmed-task-execute-feasibility.xml", diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index a524e794..a57b7796 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -21,6 +22,7 @@ public class LocalServicesProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.6.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); private static final String DEPENDENCY_DATA_SHARING_VERSION = "0.6.0"; private static final String DEPENDENCY_DATA_SHARING_NAME_AND_VERSION = "dsf-bpe-process-data-sharing-0.6.0"; @@ -38,6 +40,12 @@ public String getVersion() return VERSION; } + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + @Override public Stream<String> getBpmnFiles() { @@ -73,7 +81,8 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map .of("highmedorg_localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, cDS, vDS)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resolver, resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, RELEASE_DATE, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index 3a4b741a..9e64a4b6 100644 --- a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_localServicesIntegration" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_localServicesIntegration" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml index d998a648..621c6a3c 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml @@ -10,7 +10,7 @@ <valueString value="localServicesIntegrationMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -55,14 +55,15 @@ </extension> <url value="http://highmed.org/bpe/Process/localServicesIntegration" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="LocalServicesIntegration" /> <title value="Local services integration" /> <subtitle value="Service integration process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml index cc51d80c..600ea09a 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml @@ -8,12 +8,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskLocalServicesIntegration" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -23,7 +24,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java index c804f720..a990b3ea 100644 --- a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -1,11 +1,10 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; @@ -28,7 +27,7 @@ public class ActivityDefinitionProfileTest private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", "highmed-extension-process-authorization-consortium-role-0.5.0.xml", "highmed-extension-process-authorization-organization-0.5.0.xml", @@ -50,20 +49,15 @@ public class ActivityDefinitionProfileTest @Test public void testLocalServicesIntegrationValid() throws Exception { - try (InputStream in = Files.newInputStream( - Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } } \ No newline at end of file diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 214dfebc..8ff4f411 100644 --- a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -12,6 +12,7 @@ import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; @@ -40,7 +41,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-group-0.5.0.xml", "highmed-extension-group-id-0.5.0.xml", "highmed-extension-query-0.5.0.xml", "highmed-task-local-services-integration.xml"), diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index 0ed0badd..bc6ec58e 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -17,6 +18,7 @@ public class PingProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.6.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); @Override public String getName() @@ -30,6 +32,12 @@ public String getVersion() return VERSION; } + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + @Override public Stream<String> getBpmnFiles() { @@ -56,7 +64,8 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("highmedorg_ping/" + VERSION, Arrays.asList(aPing, tPong, tStartPing), "highmedorg_pong/" + VERSION, Arrays.asList(aPong, tPing)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resolver, resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, RELEASE_DATE, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn index fb80d97f..fee083bd 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0azvmx1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_ping" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_ping" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:sequenceFlow id="SequenceFlow_0k1j79c" sourceRef="StartEvent_1" targetRef="selectTargets" /> <bpmn:sequenceFlow id="SequenceFlow_05ia6lz" sourceRef="selectTargets" targetRef="sendPing" /> <bpmn:serviceTask id="selectTargets" name="selectTargets" camunda:class="org.highmed.dsf.bpe.service.SelectPingTargets"> @@ -10,9 +10,9 @@ <bpmn:sendTask id="sendPing" name="sendPing" camunda:class="org.highmed.dsf.bpe.message.SendPing"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/pong/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/pong/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">pingMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_05ia6lz</bpmn:incoming> diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn index 66c68cae..651a63fd 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_15v05m6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_pong" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_pong" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_07w11cw</bpmn:outgoing> <bpmn:messageEventDefinition messageRef="Message_0u91abp" /> @@ -9,9 +9,9 @@ <bpmn:endEvent id="EndEvent_1ivxrjg"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/ping/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/ping/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">pongMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1ism9wt</bpmn:incoming> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index fb074ac7..46f8f47b 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -10,7 +10,7 @@ <valueString value="startPingProcessMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -30,7 +30,7 @@ <valueString value="pongMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -47,14 +47,15 @@ </extension> <url value="http://highmed.org/bpe/Process/ping" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="Ping" /> <title value="PING process" /> <subtitle value="Communication Testing Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index fb6d1ce4..0a08bfee 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -10,7 +10,7 @@ <valueString value="pingMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -27,14 +27,15 @@ </extension> <url value="http://highmed.org/bpe/Process/pong" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="Pong" /> <title value="PONG process" /> <subtitle value="Communication Testing Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml index f388c627..ab9fedac 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-ping" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskPing" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/pong/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/pong/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml index d4084cf4..ab27da19 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-pong" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskPong" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/ping/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml index aebc6cde..557ee67f 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskStartProcess" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/ping/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java index 36e45fae..d090f81e 100644 --- a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java @@ -1,11 +1,10 @@ package org.highmed.dsf.fhir.profiles; +import static org.highmed.dsf.bpe.PingProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; @@ -28,7 +27,7 @@ public class ActivityDefinitionProfileTest private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", "highmed-extension-process-authorization-consortium-role-0.5.0.xml", "highmed-extension-process-authorization-organization-0.5.0.xml", @@ -50,40 +49,30 @@ public class ActivityDefinitionProfileTest @Test public void testPingValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-ping.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule + .readActivityDefinition(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-ping.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } @Test public void testPongValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-pong.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule + .readActivityDefinition(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-pong.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } } \ No newline at end of file diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index a89d86dd..1ad1871d 100644 --- a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -13,6 +13,7 @@ import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_TASK; import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.PingProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; @@ -41,7 +42,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", "highmed-task-pong.xml"), Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml"), diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index 52bfb05f..c667868c 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -19,6 +20,7 @@ public class UpdateAllowListProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.6.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); @Override public String getName() @@ -32,6 +34,12 @@ public String getVersion() return VERSION; } + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + @Override public Stream<String> getBpmnFiles() { @@ -59,7 +67,8 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader "highmedorg_downloadAllowList/" + VERSION, Arrays.asList(aDown, c, sDown, v), "highmedorg_updateAllowList/" + VERSION, Arrays.asList(aUp, c, sUp, v)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resolver, resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, RELEASE_DATE, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn index de311db7..9ef3dd42 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn +++ b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_downloadAllowList" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_downloadAllowList" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="downloadAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn index eae03a8a..f80bc0b7 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn +++ b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_updateAllowList" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_updateAllowList" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="updateAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml index 639af2d6..1b60be2f 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml @@ -10,7 +10,7 @@ <valueString value="downloadAllowListMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -27,14 +27,15 @@ </extension> <url value="http://highmed.org/bpe/Process/downloadAllowList" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="DownloadAllowList" /> <title value="Download Allow List" /> <subtitle value="Download Allow List Bundle Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index d1c7cf33..c5dabcc1 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -10,7 +10,7 @@ <valueString value="updateAllowListMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -39,14 +39,15 @@ </extension> <url value="http://highmed.org/bpe/Process/updateAllowList" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="UpdateAllowList" /> <title value="Update Allow List" /> <subtitle value="Update Allow List Bundle Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml index fbce2f2b..5bc40951 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml @@ -7,13 +7,14 @@ </meta> <url value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="HiGHmed_Update_Allow_List" /> <title value="HiGHmed Update Allow List" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <description value="CodeSystem with standard values for the processes update and download allow list" /> <caseSensitive value="true" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml index afcb991c..3ee0eb28 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml @@ -8,12 +8,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskDownloadAllowList" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -23,7 +24,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/#{version}" /> </element> <element id="Task.input"> <path value="Task.input" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml index 83f474ba..3c2d0813 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskUpdateAllowList" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml index 44450c21..6b3696c2 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml @@ -7,13 +7,14 @@ </meta> <url value="http://highmed.org/fhir/ValueSet/update-allow-list" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="HiGHmed_Update_Allow_List" /> <title value="HiGHmed Update Allow List" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <description value="ValueSet with standard values for the process update allow list" /> <immutable value="true" /> diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java index 1d1797f1..6aa85cc8 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -1,11 +1,10 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; @@ -28,7 +27,7 @@ public class ActivityDefinitionProfileTest private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", "highmed-extension-process-authorization-consortium-role-0.5.0.xml", "highmed-extension-process-authorization-organization-0.5.0.xml", @@ -50,40 +49,30 @@ public class ActivityDefinitionProfileTest @Test public void testDownloadAllowListValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } @Test public void testUpdateAllowListValid() throws Exception { - try (InputStream in = Files - .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } } \ No newline at end of file diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index fef1465d..b689bf4c 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -11,6 +11,7 @@ import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; @@ -41,7 +42,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-update-allow-list.xml", "highmed-task-download-allow-list.xml"), Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index 9960d61c..b3dcc346 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -19,6 +20,7 @@ public class UpdateResourcesProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.6.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); @Override public String getName() @@ -32,6 +34,12 @@ public String getVersion() return VERSION; } + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + @Override public Stream<String> getBpmnFiles() { @@ -61,7 +69,8 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader "highmedorg_executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), "highmedorg_requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resolver, resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, RELEASE_DATE, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn index 81caaa3d..5b8d0d8b 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0k0v4i2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_executeUpdateResources" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_executeUpdateResources" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_0djh0eg</bpmn:outgoing> <bpmn:messageEventDefinition messageRef="Message_1r6vnvn" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn index c2ad93e7..12831980 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0os0n0z" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> - <bpmn:process id="highmedorg_requestUpdateResources" isExecutable="true" camunda:versionTag="0.6.0"> + <bpmn:process id="highmedorg_requestUpdateResources" isExecutable="true" camunda:versionTag="#{version}"> <bpmn:sequenceFlow id="SequenceFlow_1ryplwc" sourceRef="StartEvent_1" targetRef="selectResourceAndTargets" /> <bpmn:sequenceFlow id="SequenceFlow_1u4zxix" sourceRef="selectResourceAndTargets" targetRef="sendRequest" /> <bpmn:endEvent id="EndEvent_1f9cjs7"> @@ -10,9 +10,9 @@ <bpmn:sendTask id="sendRequest" name="sendRequest" camunda:class="org.highmed.dsf.bpe.message.SendRequest"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeUpdateResources/0.6.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeUpdateResources/#{version}</camunda:inputParameter> <camunda:inputParameter name="messageName">executeUpdateResourcesMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources|0.6.0</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources|#{version}</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1u4zxix</bpmn:incoming> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index bdaa2b5f..96c4ca3f 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -10,7 +10,7 @@ <valueString value="executeUpdateResourcesMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -33,14 +33,15 @@ </extension> <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="ExecuteUpdateResources" /> <title value="Execute Update of Resources" /> <subtitle value="Process to Download and Execute FHIR Bundle" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index d71a67b2..9cf917f4 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -10,7 +10,7 @@ <valueString value="requestUpdateResourcesMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources|${version}" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources|#{version}" /> </extension> <extension url="requester"> <valueCoding> @@ -39,14 +39,15 @@ </extension> <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="RequestUpdateResources" /> <title value="Request Update of Resources" /> <subtitle value="Process to Request a Bundle Download" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml index 6589ed88..3798441e 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml @@ -7,13 +7,14 @@ </meta> <url value="http://highmed.org/fhir/CodeSystem/update-resources" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="HiGHmed_Update_Resources" /> <title value="HiGHmed Update Resources" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <description value="CodeSystem with standard values for the process update resources" /> <caseSensitive value="true" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml index 276e9aad..fce399be 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskExecuteUpdateResources" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml index 50b69c78..e8611fb9 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml @@ -7,12 +7,13 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="TaskRequestUpdateResources" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -22,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/${version}" /> + <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/#{version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml index 6ab0bb9d..f16f7642 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml @@ -7,13 +7,14 @@ </meta> <url value="http://highmed.org/fhir/ValueSet/update-resources" /> <!-- version managed by bpe --> - <version value="${version}" /> + <version value="#{version}" /> <name value="HiGHmed_Update_Resources" /> <title value="HiGHmed Update Resources" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-08-24" /> + <!-- date managed by bpe --> + <date value="#{date}" /> <publisher value="HiGHmed" /> <description value="ValueSet with standard values for the process update resources" /> <immutable value="true" /> diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java index 8c763dfa..d7c77bc6 100644 --- a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -1,11 +1,10 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; @@ -28,7 +27,7 @@ public class ActivityDefinitionProfileTest private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", "highmed-extension-process-authorization-consortium-role-0.5.0.xml", "highmed-extension-process-authorization-organization-0.5.0.xml", @@ -50,40 +49,30 @@ public class ActivityDefinitionProfileTest @Test public void testExecuteUpdateResourcesValid() throws Exception { - try (InputStream in = Files.newInputStream( - Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } @Test public void testRequestUpdateResourcesValid() throws Exception { - try (InputStream in = Files.newInputStream( - Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml"))) - { - ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() - .parseResource(ActivityDefinition.class, in); + ActivityDefinition ad = validationRule.readActivityDefinition( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml")); - ValidationResult result = resourceValidator.validate(ad); - ValidationSupportRule.logValidationMessages(logger, result); + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - assertTrue( - processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); - } + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); } } \ No newline at end of file diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index b90a947f..1057c8fc 100644 --- a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -13,6 +13,7 @@ import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.RELEASE_DATE; import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -52,7 +53,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-request-update-resources.xml", "highmed-task-execute-update-resources.xml"), Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", @@ -66,7 +67,7 @@ public class TaskProfileTest @Test public void testGenerateSnapshotNotWorkingWithoutBaseSnapshot() throws Exception { - var reader = new StructureDefinitionReader(validationRule.getFhirContext()); + var reader = new StructureDefinitionReader(validationRule.getFhirContext(), VERSION, RELEASE_DATE); StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.5.0.xml"); StructureDefinition differential = reader diff --git a/pom.xml b/pom.xml index f9671c34..5cb7d3ab 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>log4j2-utils</artifactId> - <version>0.10.0</version> + <version>0.13.0</version> </dependency> <!-- logging --> @@ -122,7 +122,7 @@ <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> - <version>2.12.4</version> + <version>2.13.2</version> </dependency> <!-- testing --> @@ -147,7 +147,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.1</version> + <version>3.10.1</version> <configuration> <source>${compileSource}</source> <target>${compileTarget}</target> @@ -161,7 +161,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>3.2.0</version> + <version>3.2.2</version> <configuration> <archive> <manifest> @@ -183,7 +183,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> - <version>3.2.0</version> + <version>3.3.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -193,13 +193,18 @@ <plugin> <groupId>net.revelc.code.formatter</groupId> <artifactId>formatter-maven-plugin</artifactId> - <version>2.16.0</version> + <version>2.18.0</version> </plugin> <plugin> <groupId>net.revelc.code</groupId> <artifactId>impsort-maven-plugin</artifactId> <version>1.6.2</version> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <version>1.4</version> + </plugin> </plugins> </pluginManagement> @@ -207,7 +212,6 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>buildnumber-maven-plugin</artifactId> - <version>1.4</version> <executions> <execution> <phase>validate</phase>