Skip to content

Commit 9e96dff

Browse files
committed
Merge branch 'move' of /tmp/highmed-dsf into move/dsf-bpe
merging split dsf-bpe process modules
2 parents fbd4a59 + 0c2dbc6 commit 9e96dff

File tree

138 files changed

+12701
-0
lines changed

Some content is hidden

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

138 files changed

+12701
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<artifactId>dsf-bpe-process-feasibility</artifactId>
7+
8+
<parent>
9+
<artifactId>dsf-bpe-pom</artifactId>
10+
<groupId>org.highmed.dsf</groupId>
11+
<version>0.4.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.highmed.dsf</groupId>
17+
<artifactId>dsf-bpe-process-base</artifactId>
18+
<scope>provided</scope>
19+
</dependency>
20+
21+
<dependency>
22+
<groupId>de.hs-heilbronn.mi</groupId>
23+
<artifactId>log4j2-utils</artifactId>
24+
<scope>test</scope>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.highmed.dsf</groupId>
28+
<artifactId>dsf-fhir-validation</artifactId>
29+
<scope>test</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.highmed.dsf</groupId>
33+
<artifactId>dsf-bpe-process-base</artifactId>
34+
<scope>test</scope>
35+
<type>test-jar</type>
36+
</dependency>
37+
</dependencies>
38+
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-dependency-plugin</artifactId>
44+
<executions>
45+
<execution>
46+
<id>copy-process-plugin-to-docker-test-setup</id>
47+
<phase>package</phase>
48+
<goals>
49+
<goal>copy</goal>
50+
</goals>
51+
<configuration>
52+
<artifactItems>
53+
<artifactItem>
54+
<groupId>${project.groupId}</groupId>
55+
<artifactId>${project.artifactId}</artifactId>
56+
<version>${project.version}</version>
57+
</artifactItem>
58+
</artifactItems>
59+
<outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory>
60+
</configuration>
61+
</execution>
62+
<execution>
63+
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id>
64+
<phase>package</phase>
65+
<goals>
66+
<goal>copy</goal>
67+
</goals>
68+
<configuration>
69+
<artifactItems>
70+
<artifactItem>
71+
<groupId>${project.groupId}</groupId>
72+
<artifactId>${project.artifactId}</artifactId>
73+
<version>${project.version}</version>
74+
</artifactItem>
75+
</artifactItems>
76+
<outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory>
77+
</configuration>
78+
</execution>
79+
<execution>
80+
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id>
81+
<phase>package</phase>
82+
<goals>
83+
<goal>copy</goal>
84+
</goals>
85+
<configuration>
86+
<artifactItems>
87+
<artifactItem>
88+
<groupId>${project.groupId}</groupId>
89+
<artifactId>${project.artifactId}</artifactId>
90+
<version>${project.version}</version>
91+
</artifactItem>
92+
</artifactItems>
93+
<outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory>
94+
</configuration>
95+
</execution>
96+
<execution>
97+
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id>
98+
<phase>package</phase>
99+
<goals>
100+
<goal>copy</goal>
101+
</goals>
102+
<configuration>
103+
<artifactItems>
104+
<artifactItem>
105+
<groupId>${project.groupId}</groupId>
106+
<artifactId>${project.artifactId}</artifactId>
107+
<version>${project.version}</version>
108+
</artifactItem>
109+
</artifactItems>
110+
<outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory>
111+
</configuration>
112+
</execution>
113+
<execution>
114+
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id>
115+
<phase>package</phase>
116+
<goals>
117+
<goal>copy</goal>
118+
</goals>
119+
<configuration>
120+
<artifactItems>
121+
<artifactItem>
122+
<groupId>${project.groupId}</groupId>
123+
<artifactId>${project.artifactId}</artifactId>
124+
<version>${project.version}</version>
125+
</artifactItem>
126+
</artifactItems>
127+
<outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory>
128+
</configuration>
129+
</execution>
130+
</executions>
131+
</plugin>
132+
<plugin>
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-clean-plugin</artifactId>
135+
<configuration>
136+
<filesets>
137+
<fileset>
138+
<directory>../../dsf-docker-test-setup/bpe/app/process</directory>
139+
<includes>
140+
<include>${project.artifactId}-${project.version}.jar</include>
141+
</includes>
142+
<followSymlinks>false</followSymlinks>
143+
</fileset>
144+
<fileset>
145+
<directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory>
146+
<includes>
147+
<include>${project.artifactId}-${project.version}.jar</include>
148+
</includes>
149+
<followSymlinks>false</followSymlinks>
150+
</fileset>
151+
<fileset>
152+
<directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory>
153+
<includes>
154+
<include>${project.artifactId}-${project.version}.jar</include>
155+
</includes>
156+
<followSymlinks>false</followSymlinks>
157+
</fileset>
158+
<fileset>
159+
<directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory>
160+
<includes>
161+
<include>${project.artifactId}-${project.version}.jar</include>
162+
</includes>
163+
<followSymlinks>false</followSymlinks>
164+
</fileset>
165+
<fileset>
166+
<directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory>
167+
<includes>
168+
<include>${project.artifactId}-${project.version}.jar</include>
169+
</includes>
170+
<followSymlinks>false</followSymlinks>
171+
</fileset>
172+
</filesets>
173+
</configuration>
174+
</plugin>
175+
</plugins>
176+
</build>
177+
</project>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package org.highmed.dsf.bpe;
2+
3+
import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE;
4+
import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION;
5+
6+
public interface ConstantsFeasibility
7+
{
8+
String BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY = "researchStudy";
9+
String BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK = "needsConsentCheck";
10+
String BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE = "needsRecordLinkage";
11+
String BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG = "bloomFilterConfig";
12+
String BPMN_EXECUTION_VARIABLE_COHORTS = "cohorts";
13+
String BPMN_EXECUTION_VARIABLE_QUERIES = "queries";
14+
String BPMN_EXECUTION_VARIABLE_QUERY_RESULTS = "queryResults";
15+
String BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS = "finalQueryResults";
16+
17+
String BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT = "errorMultiMedicFeasibilityResult";
18+
19+
// Must be 3 or larger, as otherwise it is possible to draw conclusions about the individual MeDICs
20+
// (if I already know the cohort size in my MeDIC)
21+
int MIN_PARTICIPATING_MEDICS = 3;
22+
int MIN_COHORT_DEFINITIONS = 1;
23+
String FEASIBILITY_QUERY_PREFIX = "select count";
24+
25+
String CODESYSTEM_HIGHMED_FEASIBILITY = "http://highmed.org/fhir/CodeSystem/feasibility";
26+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY = "medic-correlation-key";
27+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK = "needs-consent-check";
28+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE = "needs-record-linkage";
29+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG = "bloom-filter-configuration";
30+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT = "single-medic-result";
31+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE = "single-medic-result-reference";
32+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT = "participating-medics";
33+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NOT_ENOUGH_PARTICIPATION = "not-enough-participation";
34+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT = "multi-medic-result";
35+
String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE = "research-study-reference";
36+
37+
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-request-feasibility";
38+
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;
41+
String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME = "requestFeasibilityMessage";
42+
43+
String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "localServicesIntegration/";
44+
45+
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-execute-feasibility";
46+
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;
49+
String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeFeasibilityMessage";
50+
51+
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-compute-feasibility";
52+
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;
55+
String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeFeasibilityMessage";
56+
57+
String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility";
58+
String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultSingleMedicFeasibilityMessage";
59+
60+
String PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility";
61+
String PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultMultiMedicFeasibilityMessage";
62+
63+
String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility";
64+
String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME = "errorMultiMedicFeasibilityMessage";
65+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package org.highmed.dsf.bpe;
2+
3+
import java.util.Arrays;
4+
import java.util.List;
5+
import java.util.Map;
6+
import java.util.stream.Stream;
7+
8+
import org.highmed.dsf.bpe.spring.config.FeasibilityConfig;
9+
import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig;
10+
import org.highmed.dsf.fhir.resources.AbstractResource;
11+
import org.highmed.dsf.fhir.resources.ActivityDefinitionResource;
12+
import org.highmed.dsf.fhir.resources.CodeSystemResource;
13+
import org.highmed.dsf.fhir.resources.ResourceProvider;
14+
import org.highmed.dsf.fhir.resources.StructureDefinitionResource;
15+
import org.highmed.dsf.fhir.resources.ValueSetResource;
16+
17+
import ca.uhn.fhir.context.FhirContext;
18+
19+
public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition
20+
{
21+
public static final String VERSION = "0.4.0";
22+
23+
@Override
24+
public String getName()
25+
{
26+
return "dsf-bpe-process-feasibility";
27+
}
28+
29+
@Override
30+
public String getVersion()
31+
{
32+
return VERSION;
33+
}
34+
35+
@Override
36+
public Stream<String> getBpmnFiles()
37+
{
38+
return Stream.of("bpe/requestFeasibility.bpmn", "bpe/computeFeasibility.bpmn", "bpe/executeFeasibility.bpmn");
39+
}
40+
41+
@Override
42+
public Stream<Class<?>> getSpringConfigClasses()
43+
{
44+
return Stream.of(FeasibilityConfig.class, FeasibilitySerializerConfig.class);
45+
}
46+
47+
@Override
48+
public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader)
49+
{
50+
var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-computeFeasibility.xml");
51+
var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeFeasibility.xml");
52+
var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestFeasibility.xml");
53+
54+
var cF = CodeSystemResource.file("fhir/CodeSystem/highmed-feasibility.xml");
55+
56+
var sTCom = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-compute-feasibility.xml");
57+
var sTErr = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-error-feasibility.xml");
58+
var sTExe = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-execute-feasibility.xml");
59+
var sTResM = StructureDefinitionResource
60+
.file("fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml");
61+
var sTReq = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-request-feasibility.xml");
62+
var sTResS = StructureDefinitionResource
63+
.file("fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml");
64+
65+
var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml");
66+
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));
71+
72+
return ResourceProvider
73+
.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader,
74+
resourcesByProcessKeyAndVersion);
75+
}
76+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package org.highmed.dsf.bpe.message;
2+
3+
import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG;
4+
import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK;
5+
import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE;
6+
import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY;
7+
import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY;
8+
import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG;
9+
import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK;
10+
import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE;
11+
import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE;
12+
13+
import java.util.stream.Stream;
14+
15+
import org.camunda.bpm.engine.delegate.DelegateExecution;
16+
import org.highmed.dsf.bpe.variables.BloomFilterConfig;
17+
import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
18+
import org.highmed.dsf.fhir.organization.OrganizationProvider;
19+
import org.highmed.dsf.fhir.task.AbstractTaskMessageSend;
20+
import org.highmed.dsf.fhir.task.TaskHelper;
21+
import org.hl7.fhir.r4.model.IdType;
22+
import org.hl7.fhir.r4.model.Reference;
23+
import org.hl7.fhir.r4.model.ResearchStudy;
24+
import org.hl7.fhir.r4.model.Task.ParameterComponent;
25+
26+
import ca.uhn.fhir.context.FhirContext;
27+
28+
public class SendMedicRequest extends AbstractTaskMessageSend
29+
{
30+
public SendMedicRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper,
31+
OrganizationProvider organizationProvider, FhirContext fhirContext)
32+
{
33+
super(clientProvider, taskHelper, organizationProvider, fhirContext);
34+
}
35+
36+
@Override
37+
protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution)
38+
{
39+
ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY);
40+
IdType researchStudyId = new IdType(
41+
getFhirWebserviceClientProvider().getLocalBaseUrl() + "/" + researchStudy.getId());
42+
43+
ParameterComponent inputResearchStudyReference = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY,
44+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE,
45+
new Reference().setReference(researchStudyId.toVersionless().getValueAsString()));
46+
47+
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);
51+
52+
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);
56+
57+
if (needsRecordLinkage)
58+
{
59+
BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution
60+
.getVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG);
61+
ParameterComponent inputBloomFilterConfig = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY,
62+
CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG, bloomFilterConfig.toBytes());
63+
64+
return Stream.of(inputResearchStudyReference, inputNeedsConsentCheck, inputNeedsRecordLinkage,
65+
inputBloomFilterConfig);
66+
}
67+
else
68+
return Stream.of(inputResearchStudyReference, inputNeedsConsentCheck, inputNeedsRecordLinkage);
69+
}
70+
}

0 commit comments

Comments
 (0)