Skip to content

Commit aa5849c

Browse files
committed
Merge remote-tracking branch 'origin/release/1.7.1' into main
2 parents a470e4e + bffc318 commit aa5849c

File tree

114 files changed

+1167
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1167
-475
lines changed

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ preferred-citation:
2424
doi: 10.3233/SHTI210060
2525
type: proceedings
2626
title: "Data Sharing Framework (DSF)"
27-
version: 1.7.0
28-
date-released: 2025-01-22
27+
version: 1.7.1
28+
date-released: 2025-03-24
2929
url: https://dsf.dev
3030
repository-code: https://github.com/datasharingframework/dsf
3131
repository-artifact: https://github.com/datasharingframework/dsf/releases

dsf-bpe/dsf-bpe-process-api-v1/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-bpe-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-bpe/dsf-bpe-server-jetty/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-bpe-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-bpe/dsf-bpe-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-bpe-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/spring/config/PropertiesConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ public class PropertiesConfig implements InitializingBean
110110
private boolean webserviceClientLocalVerbose;
111111

112112
@Documentation(description = "Subscription to receive notifications about task resources from the DSF FHIR server")
113-
@Value("${dev.dsf.bpe.fhir.task.subscription.search.parameter:?criteria=Task%3Fstatus%3Drequested&status=active&type=websocket&payload=application/fhir%2Bjson}")
113+
@Value("${dev.dsf.bpe.fhir.task.subscription.search.parameter:?criteria:exact=Task%3Fstatus%3Drequested&status=active&type=websocket&payload=application/fhir%2Bjson}")
114114
private String taskSubscriptionSearchParameter;
115115

116116
@Documentation(description = "Subscription to receive notifications about questionnaire response resources from the DSF FHIR server")
117-
@Value("${dev.dsf.bpe.fhir.questionnaire.response.subscription.search.parameter:?criteria=QuestionnaireResponse%3Fstatus%3Dcompleted&status=active&type=websocket&payload=application/fhir%2Bjson}")
117+
@Value("${dev.dsf.bpe.fhir.questionnaire.response.subscription.search.parameter:?criteria:exact=QuestionnaireResponse%3Fstatus%3Dcompleted&status=active&type=websocket&payload=application/fhir%2Bjson}")
118118
private String questionnaireResponseSubscriptionSearchParameter;
119119

120120
@Documentation(description = "Number of retries until a websocket connection can be established with the DSF FHIR server, `-1` means infinite number of retries")
@@ -126,7 +126,7 @@ public class PropertiesConfig implements InitializingBean
126126
private long websocketRetrySleepMillis;
127127

128128
@Documentation(description = "Directory containing the DSF BPE process plugins for deployment on startup of the DSF BPE server", recommendation = "Change only if you don't use the provided directory structure from the installation guide or made changes to tit")
129-
@Value("${dev.dsf.bpe.process.plugin.directroy:process}")
129+
@Value("${dev.dsf.bpe.process.plugin.directory:process}")
130130
private String processPluginDirectory;
131131

132132
@Documentation(description = "List of process names that should be excluded from deployment during startup of the DSF BPE server; comma or space separated list, YAML block scalars supported", recommendation = "Only deploy processes that can be started depending on your organization's roles in the Allow-List", example = "dsfdev_updateAllowList|1.0, another_process|x.y")

dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/subscription/TaskHandler.java

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.hl7.fhir.r4.model.StringType;
2929
import org.hl7.fhir.r4.model.Task;
3030
import org.hl7.fhir.r4.model.Task.ParameterComponent;
31+
import org.hl7.fhir.r4.model.Task.TaskStatus;
3132
import org.slf4j.Logger;
3233
import org.slf4j.LoggerFactory;
3334
import org.springframework.beans.factory.InitializingBean;
@@ -121,33 +122,50 @@ public void onResource(Task task)
121122
Objects.requireNonNull(task, "task");
122123
Objects.requireNonNull(task.getInstantiatesCanonical(), "task.instantiatesCanonical");
123124

124-
Matcher matcher = INSTANTIATES_CANONICAL_PATTERN.matcher(task.getInstantiatesCanonical());
125-
if (!matcher.matches())
126-
throw new IllegalStateException("InstantiatesCanonical of Task with id " + task.getIdElement().getIdPart()
127-
+ " does not match " + INSTANTIATES_CANONICAL_PATTERN_STRING);
125+
try
126+
{
127+
// businessKey is required even if we update the task with status failed
128+
String businessKey = getFirstInputParameter(task, BpmnMessage.businessKey());
129+
if (businessKey == null)
130+
{
131+
businessKey = UUID.randomUUID().toString();
132+
logger.debug("Adding business-key {} to Task with id {}", businessKey, task.getId());
133+
task.addInput().setType(new CodeableConcept(BpmnMessage.businessKey()))
134+
.setValue(new StringType(businessKey));
135+
}
128136

129-
String processDomain = matcher.group("domain").replace(".", "");
130-
String processDefinitionKey = matcher.group("processName");
131-
String processVersion = matcher.group("processVersion");
137+
if (!TaskStatus.REQUESTED.equals(task.getStatus()))
138+
throw new IllegalArgumentException("Task.status != " + TaskStatus.REQUESTED.toCode());
132139

133-
String messageName = getFirstInputParameter(task, BpmnMessage.messageName());
134-
String businessKey = getFirstInputParameter(task, BpmnMessage.businessKey());
135-
String correlationKey = getFirstInputParameter(task, BpmnMessage.correlationKey());
140+
Matcher matcher = INSTANTIATES_CANONICAL_PATTERN.matcher(task.getInstantiatesCanonical());
141+
if (!matcher.matches())
142+
throw new IllegalStateException("InstantiatesCanonical of Task with id "
143+
+ task.getIdElement().getIdPart() + " does not match " + INSTANTIATES_CANONICAL_PATTERN_STRING);
136144

137-
if (businessKey == null)
138-
{
139-
businessKey = UUID.randomUUID().toString();
140-
logger.debug("Adding business-key {} to Task with id {}", businessKey, task.getId());
141-
task.addInput().setType(new CodeableConcept(BpmnMessage.businessKey()))
142-
.setValue(new StringType(businessKey));
143-
}
144-
task.setStatus(Task.TaskStatus.INPROGRESS);
145-
task = webserviceClient.update(task);
145+
String processDomain = matcher.group("domain").replace(".", "");
146+
String processDefinitionKey = matcher.group("processName");
147+
String processVersion = matcher.group("processVersion");
146148

147-
Map<String, Object> variables = Map.of(TASK_VARIABLE, FhirResourceValues.create(task));
149+
String messageName = getFirstInputParameter(task, BpmnMessage.messageName());
150+
String correlationKey = getFirstInputParameter(task, BpmnMessage.correlationKey());
151+
152+
task.setStatus(Task.TaskStatus.INPROGRESS);
153+
154+
try
155+
{
156+
task = webserviceClient.update(task);
157+
}
158+
catch (Exception e)
159+
{
160+
logger.debug("Unable to handle Task with id {}", task.getId(), e);
161+
logger.warn("Unable to handle Task with id {}: {} - {}", task.getId(), e.getClass().getName(),
162+
e.getMessage());
163+
164+
updateTaskFailed(task, "Unable to update Task to status 'in-progress'");
165+
}
166+
167+
Map<String, Object> variables = Map.of(TASK_VARIABLE, FhirResourceValues.create(task));
148168

149-
try
150-
{
151169
onMessage(businessKey, correlationKey, processDomain, processDefinitionKey, processVersion, messageName,
152170
variables);
153171
}

dsf-bpe/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>dev.dsf</groupId>
99
<artifactId>dsf-pom</artifactId>
10-
<version>1.7.0</version>
10+
<version>1.7.1</version>
1111
</parent>
1212

1313
<modules>

dsf-common/dsf-common-auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-common/dsf-common-config/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-common/dsf-common-db/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-common/dsf-common-documentation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111
</project>

dsf-common/dsf-common-jetty/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-common/dsf-common-jetty/src/main/java/dev/dsf/common/config/AbstractJettyConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public abstract class AbstractJettyConfig
123123
@Value("${dev.dsf.server.certificate.key.password:#{null}}")
124124
private char[] serverCertificateKeyFilePassword;
125125

126-
@Documentation(description = "Set to `true` to enable OIDC authorization code flow", recommendation = "Requires *DEV_DSF_SERVER_AUTH_OIDC_PROVIDER_REALM_BASE_URL*, *DEV_DSF_SERVER_AUTH_OIDC_CLIENT_ID* and *DEV_DSF_SERVER_AUTH_OIDC_CLIENT_SECRET* to be specified")
126+
@Documentation(description = "Set to `true` to enable OIDC authorization code flow", recommendation = "Requires *DEV_DSF_SERVER_AUTH_OIDC_PROVIDER_REALM_BASE_URL*, *DEV_DSF_SERVER_AUTH_OIDC_CLIENT_ID* and *DEV_DSF_SERVER_AUTH_OIDC_CLIENT_SECRET* or *DEV_DSF_SERVER_AUTH_OIDC_CLIENT_SECRET_FILE* to be specified")
127127
@Value("${dev.dsf.server.auth.oidc.authorization.code.flow:false}")
128128
private boolean oidcAuthorizationCodeFlowEnabled;
129129

dsf-common/dsf-common-status/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-common/dsf-common-ui/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-common-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>dev.dsf</groupId>
99
<artifactId>dsf-pom</artifactId>
10-
<version>1.7.0</version>
10+
<version>1.7.1</version>
1111
</parent>
1212

1313
<modules>

dsf-fhir/dsf-fhir-auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-fhir-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-fhir/dsf-fhir-rest-adapter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-fhir-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-fhir/dsf-fhir-server-jetty/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-fhir-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-fhir/dsf-fhir-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-fhir-pom</artifactId>
9-
<version>1.7.0</version>
9+
<version>1.7.1</version>
1010
</parent>
1111

1212
<dependencies>

dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/authorization/SubscriptionAuthorizationRule.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import java.sql.Connection;
44
import java.sql.SQLException;
55
import java.util.ArrayList;
6-
import java.util.Collections;
76
import java.util.List;
8-
import java.util.Map;
97
import java.util.Optional;
108
import java.util.stream.Collectors;
119

@@ -25,7 +23,6 @@
2523
import dev.dsf.fhir.dao.provider.DaoProvider;
2624
import dev.dsf.fhir.help.ParameterConverter;
2725
import dev.dsf.fhir.search.PageAndCount;
28-
import dev.dsf.fhir.search.PartialResult;
2926
import dev.dsf.fhir.search.SearchQuery;
3027
import dev.dsf.fhir.search.SearchQueryParameterError;
3128
import dev.dsf.fhir.service.ReferenceResolver;
@@ -128,26 +125,10 @@ private Optional<String> newResourceOk(Connection connection, Subscription newRe
128125
@Override
129126
protected boolean resourceExists(Connection connection, Subscription newResource)
130127
{
131-
Map<String, List<String>> queryParameters = Map.of("criteria",
132-
Collections.singletonList(newResource.getCriteria()), "type",
133-
Collections.singletonList(newResource.getChannel().getType().toCode()), "payload",
134-
Collections.singletonList(newResource.getChannel().getPayload()));
135-
SubscriptionDao dao = getDao();
136-
SearchQuery<Subscription> query = dao.createSearchQueryWithoutUserFilter(PageAndCount.exists())
137-
.configureParameters(queryParameters);
138-
139-
List<SearchQueryParameterError> uQp = query.getUnsupportedQueryParameters();
140-
if (!uQp.isEmpty())
141-
{
142-
logger.warn("Unable to search for Subscription: Unsupported query parameters: {}", uQp);
143-
144-
throw new IllegalStateException("Unable to search for Subscription: Unsupported query parameters");
145-
}
146-
147128
try
148129
{
149-
PartialResult<Subscription> result = dao.searchWithTransaction(connection, query);
150-
return result.getTotal() >= 1;
130+
return getDao().existsByCriteriaChannelTypeAndChannelPayload(newResource.getCriteria(),
131+
newResource.getChannel().getType().toCode(), newResource.getChannel().getPayload());
151132
}
152133
catch (SQLException e)
153134
{

dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/authorization/TaskAuthorizationRule.java

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,32 @@ else if (TaskStatus.INPROGRESS.equals(oldResource.getStatus())
794794
}
795795
}
796796

797+
// REQUESTED -> FAILED
798+
else if (TaskStatus.REQUESTED.equals(oldResource.getStatus())
799+
&& TaskStatus.FAILED.equals(newResource.getStatus()))
800+
{
801+
final Optional<String> same = reasonNotSame(oldResource, newResource);
802+
if (same.isEmpty())
803+
{
804+
logger.info(
805+
"Update of Task/{}/_history/{} ({} -> {}) authorized for local identity '{}', old Task.status requested, new Task.status failed",
806+
oldResourceId, oldResourceVersion, TaskStatus.REQUESTED.toCode(),
807+
TaskStatus.FAILED.toCode(), identity.getName());
808+
809+
return Optional
810+
.of("Local identity, Task.status failed, Task.restriction.recipient local organization"
811+
+ ", Task.instantiatesCanonical not modified, Task.requester not modified, Task.restriction not modified, Task.input not modified");
812+
}
813+
else
814+
{
815+
logger.warn(
816+
"Update of Task/{}/_history/{} ({} -> {}) unauthorized for local identity '{}', modification of Task properties {} not allowed",
817+
oldResourceId, oldResourceVersion, TaskStatus.REQUESTED.toCode(),
818+
TaskStatus.FAILED.toCode(), identity.getName(), same.get());
819+
820+
return Optional.empty();
821+
}
822+
}
797823
// INPROGRESS -> FAILED
798824
else if (TaskStatus.INPROGRESS.equals(oldResource.getStatus())
799825
&& TaskStatus.FAILED.equals(newResource.getStatus()))
@@ -895,9 +921,11 @@ private Optional<String> reasonNotSame(Task oldResource, Task newResource)
895921
List<ParameterComponent> newResourceInputs = newResource.getInput();
896922

897923
if (TaskStatus.REQUESTED.equals(oldResource.getStatus()) && !hasBusinessKey(oldResource)
898-
&& TaskStatus.INPROGRESS.equals(newResource.getStatus()) && hasBusinessKey(newResource))
924+
&& (TaskStatus.INPROGRESS.equals(newResource.getStatus())
925+
|| TaskStatus.FAILED.equals(newResource.getStatus()))
926+
&& hasBusinessKey(newResource))
899927
{
900-
// business-key added from requested to in-progress: removing for equality check
928+
// business-key added from requested to in-progress or failed: removing for equality check
901929
newResourceInputs = newResourceInputs.stream().filter(isBusinessKey().negate()).toList();
902930
}
903931

dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/dao/SubscriptionDao.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99
public interface SubscriptionDao extends ResourceDao<Subscription>
1010
{
1111
List<Subscription> readByStatus(SubscriptionStatus status) throws SQLException;
12+
13+
boolean existsByCriteriaChannelTypeAndChannelPayload(String criteria, String channelType, String channelPayload)
14+
throws SQLException;
1215
}

0 commit comments

Comments
 (0)