Skip to content

Commit 13195b9

Browse files
authored
Merge pull request #13 from highmed/issues/12_formatter_impsort
Issues/12 formatter impsort
2 parents 0f1d6dc + 5847cf4 commit 13195b9

File tree

52 files changed

+808
-311
lines changed

Some content is hidden

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

52 files changed

+808
-311
lines changed

.github/workflows/maven-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Build with Maven
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
run: mvn -B verify --file pom.xml
22+
run: mvn -B verify -fae --file pom.xml

dsf-bpe-process-feasibility/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<groupId>org.highmed.dsf</groupId>
1111
<version>0.5.0-SNAPSHOT</version>
1212
</parent>
13+
14+
<properties>
15+
<main.basedir>${project.basedir}/..</main.basedir>
16+
</properties>
1317

1418
<dependencies>
1519
<dependency>

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ public interface ConstantsFeasibility
3636

3737
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-request-feasibility";
3838
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "requestFeasibility/";
39-
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION =
40-
PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI + VERSION;
39+
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI
40+
+ VERSION;
4141
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME = "requestFeasibilityMessage";
4242

4343
String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "localServicesIntegration/";
4444

4545
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-execute-feasibility";
4646
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "executeFeasibility/";
47-
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION =
48-
PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI + VERSION;
47+
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI
48+
+ VERSION;
4949
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeFeasibilityMessage";
5050

5151
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-compute-feasibility";
5252
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "computeFeasibility/";
53-
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION =
54-
PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI + VERSION;
53+
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI
54+
+ VERSION;
5555
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeFeasibilityMessage";
5656

5757
String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility";

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader
6464

6565
var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml");
6666

67-
Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of(
68-
"computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sTCom, sTResS, vF),
69-
"executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, sTExe, vF),
70-
"requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF));
67+
Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("computeFeasibility/" + VERSION,
68+
Arrays.asList(aCom, cF, sTCom, sTResS, vF), "executeFeasibility/" + VERSION,
69+
Arrays.asList(aExe, cF, sTExe, vF), "requestFeasibility/" + VERSION,
70+
Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF));
7171

72-
return ResourceProvider
73-
.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader,
74-
resourcesByProcessKeyAndVersion);
72+
return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false),
73+
classLoader, resourcesByProcessKeyAndVersion);
7574
}
7675
}

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,12 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut
4545
new Reference().setReference(researchStudyId.toVersionless().getValueAsString()));
4646

4747
boolean needsConsentCheck = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK);
48-
ParameterComponent inputNeedsConsentCheck = getTaskHelper()
49-
.createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK,
50-
needsConsentCheck);
48+
ParameterComponent inputNeedsConsentCheck = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY,
49+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, needsConsentCheck);
5150

5251
boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE);
53-
ParameterComponent inputNeedsRecordLinkage = getTaskHelper()
54-
.createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE,
55-
needsRecordLinkage);
52+
ParameterComponent inputNeedsRecordLinkage = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY,
53+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, needsRecordLinkage);
5654

5755
if (needsRecordLinkage)
5856
{

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut
3030
{
3131
Task task = getLeadingTaskFromExecutionVariables();
3232

33-
String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task" , task.getIdElement().getIdPart()))
34-
.getReference();
33+
String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task",
34+
task.getIdElement().getIdPart())).getReference();
3535

36-
Task.ParameterComponent input = getTaskHelper()
37-
.createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR,
38-
"An error occurred while calculating the multi medic feasibility result for "
39-
+ "all defined cohorts, see task with url='" + taskUrl + "'");
36+
Task.ParameterComponent input = getTaskHelper().createInput(CODESYSTEM_HIGHMED_BPMN,
37+
CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR,
38+
"An error occurred while calculating the multi medic feasibility result for "
39+
+ "all defined cohorts, see task with url='" + taskUrl + "'");
4040
return Stream.of(input);
4141
}
4242
}

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,12 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut
4848

4949
private Stream<ParameterComponent> toInputs(FinalFeasibilityQueryResult result)
5050
{
51-
ParameterComponent input1 = getTaskHelper()
52-
.createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY,
53-
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT,
54-
result.getCohortSize());
51+
ParameterComponent input1 = getTaskHelper().createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY,
52+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, result.getCohortSize());
5553
input1.addExtension(createCohortIdExtension(result.getCohortId()));
5654

57-
ParameterComponent input2 = getTaskHelper()
58-
.createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY,
59-
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT,
60-
result.getParticipatingMedics());
55+
ParameterComponent input2 = getTaskHelper().createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY,
56+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, result.getParticipatingMedics());
6157
input2.addExtension(createCohortIdExtension(result.getCohortId()));
6258

6359
return Stream.of(input1, input2);
@@ -79,10 +75,10 @@ private Stream<ParameterComponent> getErrorInput(DelegateExecution execution)
7975
String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task",
8076
task.getIdElement().getIdPart())).getReference();
8177

82-
Task.ParameterComponent input = getTaskHelper()
83-
.createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR,
84-
"Errors occurred for missing cohorts while calculating their multi medic feasibility "
85-
+ "result, see task with url='" + taskUrl + "'");
78+
Task.ParameterComponent input = getTaskHelper().createInput(CODESYSTEM_HIGHMED_BPMN,
79+
CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR,
80+
"Errors occurred for missing cohorts while calculating their multi medic feasibility "
81+
+ "result, see task with url='" + taskUrl + "'");
8682
return Stream.of(input);
8783
}
8884

@@ -91,8 +87,9 @@ private Stream<ParameterComponent> getErrorInput(DelegateExecution execution)
9187

9288
private boolean hasErrorOutput(List<Task.TaskOutputComponent> outputs)
9389
{
94-
return outputs.stream().anyMatch(output -> output.getType().getCoding().stream().anyMatch(
95-
coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_BPMN) && coding.getCode()
96-
.equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)));
90+
return outputs.stream()
91+
.anyMatch(output -> output.getType().getCoding().stream()
92+
.anyMatch(coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_BPMN)
93+
&& coding.getCode().equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)));
9794
}
9895
}

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ else if (result.isIdResultSetUrlResult())
6262
}
6363
else
6464
{
65-
logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result
66-
.getCohortId());
65+
logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID "
66+
+ result.getCohortId());
6767
throw new RuntimeException(
68-
"Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result
69-
.getCohortId());
68+
"Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID "
69+
+ result.getCohortId());
7070
}
7171
}
7272

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateE
3737
target.getCorrelationKey()));
3838

3939
boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE);
40-
Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper()
41-
.createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE,
42-
needsRecordLinkage);
40+
Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY,
41+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, needsRecordLinkage);
4342

4443
return Stream.concat(inputTargets, Stream.of(inputNeedsRecordLinkage));
4544
}

dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ private List<FinalFeasibilityQueryResult> calculateResults(List<FeasibilityQuery
4141
Map<String, List<FeasibilityQueryResult>> byCohortId = results.stream()
4242
.collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId));
4343

44-
return byCohortId.entrySet().stream().map(e -> new FinalFeasibilityQueryResult(e.getKey(),
45-
toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()),
46-
toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum())))
44+
return byCohortId.entrySet().stream()
45+
.map(e -> new FinalFeasibilityQueryResult(e.getKey(),
46+
toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()),
47+
toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum())))
4748
.collect(Collectors.toList());
4849
}
4950

0 commit comments

Comments
 (0)