Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.7.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hhund committed Oct 17, 2022
2 parents c92a331 + 5e66fdc commit 8cfdbc7
Show file tree
Hide file tree
Showing 103 changed files with 733 additions and 488 deletions.
2 changes: 1 addition & 1 deletion dsf-bpe-process-data-sharing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>dsf-bpe-highmed-processes-pom</artifactId>
<groupId>org.highmed.dsf</groupId>
<version>0.6.0</version>
<version>0.7.0</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public class DataSharingProcessPluginDefinition implements ProcessPluginDefinition
{
public static final String VERSION = "0.6.0";
public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 5, 10);
public static final String VERSION = "0.7.0";
public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 10, 18);

@Override
public String getName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public SendErrors(FhirWebserviceClientProvider clientProvider, TaskHelper taskHe
@Override
protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution)
{
Task task = getLeadingTaskFromExecutionVariables();
Task task = getLeadingTaskFromExecutionVariables(execution);
String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task",
task.getIdElement().getIdPart())).getReference();
String errorMessage = createErrorMessage(taskUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@ public AbstractCheckResults(FhirWebserviceClientProvider clientProvider, TaskHel
protected void doExecute(DelegateExecution execution)
{
QueryResults results = (QueryResults) execution.getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS);
List<QueryResult> filteredResults = filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(results);
List<QueryResult> postProcessedResults = postProcessAllPassingResults(filteredResults);
List<QueryResult> filteredResults = filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(execution, results);
List<QueryResult> postProcessedResults = postProcessAllPassingResults(execution, filteredResults);

execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS,
QueryResultsValues.create(new QueryResults(postProcessedResults)));
}

private List<QueryResult> filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(QueryResults results)
private List<QueryResult> filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(DelegateExecution execution,
QueryResults results)
{
Task task = getLeadingTaskFromExecutionVariables();
Task task = getLeadingTaskFromExecutionVariables(execution);
return results.getResults().stream().filter(r -> testResultAndAddPossibleError(r, task))
.collect(Collectors.toList());
}
Expand All @@ -60,12 +61,15 @@ protected boolean testResultAndAddPossibleError(QueryResult result, Task task)
}

/**
* @param execution
* not <code>null</code>
* @param passedResults
* all {@link QueryResult} objects that passed the checks executed by
* {@link #testResultAndAddPossibleError(QueryResult, Task)}
* @return a list of {@link QueryResult} objects after post processing
*/
protected List<QueryResult> postProcessAllPassingResults(List<QueryResult> passedResults)
protected List<QueryResult> postProcessAllPassingResults(DelegateExecution execution,
List<QueryResult> passedResults)
{
return passedResults;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;

import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.highmed.dsf.bpe.variable.QueryResult;
import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper;
import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
Expand All @@ -34,17 +35,18 @@ protected boolean testResultAndAddPossibleError(QueryResult result, Task task)
}

@Override
protected List<QueryResult> postProcessAllPassingResults(List<QueryResult> passedResults)
protected List<QueryResult> postProcessAllPassingResults(DelegateExecution execution,
List<QueryResult> passedResults)
{
if (!atLeastOneResultExists(passedResults))
if (!atLeastOneResultExists(execution, passedResults))
throw new BpmnError(BPMN_EXECUTION_ERROR_CODE_SINGLE_MEDIC_DATA_SHARING_RESULT);

return passedResults;
}

private boolean atLeastOneResultExists(List<QueryResult> results)
private boolean atLeastOneResultExists(DelegateExecution execution, List<QueryResult> results)
{
Task leadingTask = getLeadingTaskFromExecutionVariables();
Task leadingTask = getLeadingTaskFromExecutionVariables(execution);
String taskId = leadingTask.getId();
String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN,
CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;

import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.highmed.dsf.bpe.variable.QueryResult;
import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper;
import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
Expand All @@ -34,17 +35,18 @@ protected boolean testResultAndAddPossibleError(QueryResult result, Task task)
}

@Override
protected List<QueryResult> postProcessAllPassingResults(List<QueryResult> passedResults)
protected List<QueryResult> postProcessAllPassingResults(DelegateExecution execution,
List<QueryResult> passedResults)
{
if (!atLeastOneResultExists(passedResults))
if (!atLeastOneResultExists(execution, passedResults))
throw new BpmnError(BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_PSEUDONYMIZED_DATA_SHARING_RESULT);

return passedResults;
}

private boolean atLeastOneResultExists(List<QueryResult> results)
private boolean atLeastOneResultExists(DelegateExecution execution, List<QueryResult> results)
{
Task leadingTask = getLeadingTaskFromExecutionVariables();
Task leadingTask = getLeadingTaskFromExecutionVariables(execution);
String taskId = leadingTask.getId();
String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN,
CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;

import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.highmed.dsf.bpe.variable.QueryResult;
import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper;
import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
Expand All @@ -34,17 +35,18 @@ protected boolean testResultAndAddPossibleError(QueryResult result, Task task)
}

@Override
protected List<QueryResult> postProcessAllPassingResults(List<QueryResult> passedResults)
protected List<QueryResult> postProcessAllPassingResults(DelegateExecution execution,
List<QueryResult> passedResults)
{
if (!atLeastOneResultExists(passedResults))
if (!atLeastOneResultExists(execution, passedResults))
throw new BpmnError(BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_PSEUDONYMIZED_DATA_SHARING_RESULT);

return passedResults;
}

private boolean atLeastOneResultExists(List<QueryResult> results)
private boolean atLeastOneResultExists(DelegateExecution execution, List<QueryResult> results)
{
Task leadingTask = getLeadingTaskFromExecutionVariables();
Task leadingTask = getLeadingTaskFromExecutionVariables(execution);
String taskId = leadingTask.getId();
String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN,
CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void afterPropertiesSet() throws Exception
@Override
protected void doExecute(DelegateExecution execution)
{
Task task = getCurrentTaskFromExecutionVariables();
Task task = getCurrentTaskFromExecutionVariables(execution);

IdType researchStudyId = getResearchStudyId(task);
FhirWebserviceClient client = getWebserviceClient(researchStudyId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public DownloadMultiMedicResults(FhirWebserviceClientProvider clientProvider, Ta
@Override
protected List<QueryResult> getQueryResults(DelegateExecution execution)
{
Task task = getCurrentTaskFromExecutionVariables();
Task task = getCurrentTaskFromExecutionVariables(execution);
Reference requester = task.getRequester();

return getTaskHelper().getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_DATA_SHARING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void afterPropertiesSet() throws Exception
@Override
protected void doExecute(DelegateExecution execution)
{
Task task = getLeadingTaskFromExecutionVariables();
Task task = getLeadingTaskFromExecutionVariables(execution);
FhirWebserviceClient client = getFhirWebserviceClientProvider().getLocalWebserviceClient();

IdType researchStudyId = getResearchStudyId(task);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public HandleErrorMultiMedicResults(FhirWebserviceClientProvider clientProvider,
@Override
protected void doExecute(DelegateExecution execution)
{
Task currentTask = getCurrentTaskFromExecutionVariables();
Task leadingTask = getLeadingTaskFromExecutionVariables();
Task currentTask = getCurrentTaskFromExecutionVariables(execution);
Task leadingTask = getLeadingTaskFromExecutionVariables(execution);

currentTask.getInput().stream().filter(this::isErrorInput)
.forEach(input -> transformToOutput(currentTask.getId(), input, leadingTask));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public void afterPropertiesSet() throws Exception
@Override
protected void doExecute(DelegateExecution execution) throws Exception
{
String medicIndentifier = getLeadingTaskFromExecutionVariables().getRequester().getIdentifier().getValue();
String medicIndentifier = getLeadingTaskFromExecutionVariables(execution).getRequester().getIdentifier()
.getValue();

Endpoint endpoint = endpointProvider.getFirstConsortiumEndpoint(
NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM, CODESYSTEM_HIGHMED_ORGANIZATION_ROLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void afterPropertiesSet() throws Exception
protected void doExecute(DelegateExecution execution)
{
String ttpIdentifier = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER);
String correlationKey = getCorrelationKey();
String correlationKey = getCorrelationKey(execution);

Endpoint endpoint = endpointProvider.getFirstConsortiumEndpoint(
NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM, CODESYSTEM_HIGHMED_ORGANIZATION_ROLE,
Expand All @@ -59,9 +59,9 @@ protected void doExecute(DelegateExecution execution)
execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(ttpTarget));
}

private String getCorrelationKey()
private String getCorrelationKey(DelegateExecution execution)
{
Task task = getCurrentTaskFromExecutionVariables();
Task task = getCurrentTaskFromExecutionVariables(execution);
return getTaskHelper()
.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN,
CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public StoreCorrelationKeys(FhirWebserviceClientProvider clientProvider, TaskHel
@Override
protected void doExecute(DelegateExecution execution)
{
Task task = getCurrentTaskFromExecutionVariables();
Task task = getCurrentTaskFromExecutionVariables(execution);

String leadingMedicIdentifier = getLeadingMedicIdentifier(task);
execution.setVariable(BPMN_EXECUTION_VARIABLE_LEADING_MEDIC_IDENTIFIER, leadingMedicIdentifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ protected String getSecurityIdentifier(DelegateExecution execution)
@Override
protected List<QueryResult> postProcessStoredResults(List<QueryResult> storedResults, DelegateExecution execution)
{
Task currentTask = getCurrentTaskFromExecutionVariables();
Task leadingTask = getLeadingTaskFromExecutionVariables();
Task currentTask = getCurrentTaskFromExecutionVariables(execution);
Task leadingTask = getLeadingTaskFromExecutionVariables(execution);

storedResults.forEach(result -> addOutput(leadingTask, result));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public StoreSingleMedicResultLinks(FhirWebserviceClientProvider clientProvider,
protected void doExecute(DelegateExecution execution)
{
QueryResults currentResults = (QueryResults) execution.getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS);
List<QueryResult> newResults = getNewResults();
List<QueryResult> newResults = getNewResults(execution);

List<QueryResult> extendedResults = Stream.of(currentResults.getResults(), newResults)
.flatMap(Collection::stream).collect(Collectors.toList());
Expand All @@ -42,9 +42,9 @@ protected void doExecute(DelegateExecution execution)
QueryResultsValues.create(new QueryResults(extendedResults)));
}

private List<QueryResult> getNewResults()
private List<QueryResult> getNewResults(DelegateExecution execution)
{
Task task = getCurrentTaskFromExecutionVariables();
Task task = getCurrentTaskFromExecutionVariables(execution);
Reference requester = task.getRequester();

return getTaskHelper().getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_DATA_SHARING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<fixedString value="request-form-reference" />
<binding>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="ResearchStudy.relatedArtifact:request-form-reference.url">
Expand All @@ -70,7 +70,7 @@
<fixedString value="contract-reference" />
<binding>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="ResearchStudy.relatedArtifact:contract-reference.url">
Expand All @@ -93,7 +93,7 @@
<fixedString value="feasibility-query-reference" />
<binding>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="ResearchStudy.relatedArtifact:feasibility-query-reference.url">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:medic-correlation-key.type.coding">
Expand Down Expand Up @@ -115,7 +115,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:needs-record-linkage.type.coding">
Expand Down Expand Up @@ -155,7 +155,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:research-study-identifier.type.coding">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:research-study.type.coding">
Expand Down Expand Up @@ -117,7 +117,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:needs-record-linkage.type.coding">
Expand Down Expand Up @@ -157,7 +157,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:needs-consent-check.type.coding">
Expand Down Expand Up @@ -197,7 +197,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:bloom-filter-configuration.type.coding">
Expand Down Expand Up @@ -237,7 +237,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:mdat-aes-key.type.coding">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<valueString value="TaskInputParameterType" />
</extension>
<strength value="required" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing" />
<valueSet value="http://highmed.org/fhir/ValueSet/data-sharing|#{version}" />
</binding>
</element>
<element id="Task.input:multi-medic-result-set-reference.type.coding">
Expand Down
Loading

0 comments on commit 8cfdbc7

Please sign in to comment.