Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8ca62c0
moved fhir and bpe resource to unique folders for execution in same JVM
hhund Feb 10, 2025
1ae7912
version fix 1.7.0 -> 2.0.0-SNAPSHOT
hhund Feb 10, 2025
846299e
removed not needed dependency
hhund Feb 10, 2025
d151de8
added comment to make sure workaround is not removed
hhund Feb 10, 2025
829b73d
added Task and QuestionnaireResponse status checks
hhund Feb 10, 2025
8cfbcca
Adds :exact modifier to usage of Subscription.criteria search parameter
hhund Feb 10, 2025
7f381fd
code cleanup to remove compiler warnings
hhund Feb 10, 2025
47d5c5d
code cleanup
hhund Feb 10, 2025
7f66f3a
not null check to safeguard against not fully established connections
hhund Feb 10, 2025
69dca48
dependency and general cleanup
hhund Feb 10, 2025
6d8b153
exploded process plugins and FHIR version upgrade
hhund Feb 10, 2025
c5280c0
first v1 and v2 plugin api integration tests
hhund Feb 10, 2025
728cb8f
code cleanup, typo fixes
hhund Feb 11, 2025
985d8d1
absolute normalized paths in error logs
hhund Feb 11, 2025
ee61211
moved test-data-generator exec to install phase, mvn to single thread
hhund Feb 11, 2025
0036271
added api class path check
hhund Feb 11, 2025
bc4e466
api dependencies copy now in pre-integration-test phase
hhund Feb 11, 2025
0c85690
added plugins as test dependencies to influence build order
hhund Feb 11, 2025
41f8709
additional check to see if filename resolves in expected directory
hhund Feb 11, 2025
e3918e0
test ports bound to localhost, improved jetty log messages, code cleanup
hhund Feb 11, 2025
3f5de14
configured *.conf as eol=lf in .gitattributes
hhund Feb 12, 2025
eae5494
renamed methods
hhund Feb 12, 2025
18329d9
NumberFormatException catch, some cleanup
hhund Feb 12, 2025
65b373a
refactored code to use List.of, fixed log messages
hhund Feb 13, 2025
9ba5647
Integration test for v1 OrganizationProvider
hhund Feb 13, 2025
17b627e
Modifications to the v2 OrganizationProvider, implementation for #81
hhund Feb 13, 2025
b4acc64
removed empty lines
hhund Feb 13, 2025
2b9f788
Integration test for v2 OrganizationProvider
hhund Feb 13, 2025
734a26b
code cleanup
hhund Feb 13, 2025
db593fe
EndpointProvider integration test, modifications to v2 EndpointProvider
hhund Feb 16, 2025
d0aefe5
typo fix
hhund Feb 16, 2025
dc0b62a
fixed handling of channel.payload in auth rule and db unique function
hhund Feb 16, 2025
aae6943
refactored code: removed not needed EnumSet.copyOf construct
hhund Feb 16, 2025
c273645
refactored code: switched to List.of, Set.of and Map.of where possible
hhund Feb 16, 2025
5c39d81
typo fix
hhund Feb 17, 2025
2183992
added comments
hhund Feb 17, 2025
2b203b3
typo fix
hhund Feb 17, 2025
febd6a1
replaced system.err call with logger
hhund Mar 4, 2025
a1271c9
log message typo fix
hhund Mar 4, 2025
73094ba
modified javadoc, added "active" constraints
hhund Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Declare files that will always have certain line endings on checkout.
*.bat text eol=crlf
*.sh text eol=lf
*.conf text eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
java-version: 21
cache: 'maven'
- name: Build with Maven
run: mvn --batch-mode --fail-at-end --threads 1C -DforkCount=2 -Dgpg.skip clean verify
run: mvn --batch-mode --fail-at-end -DforkCount=2 -Dgpg.skip clean verify
2 changes: 1 addition & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Publish with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode --fail-at-end --threads 1C -DforkCount=2 -Dgpg.skip clean deploy
run: mvn --batch-mode --fail-at-end -DforkCount=2 -Dgpg.skip clean deploy
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
###
# dsf-bpe ignores
###
dsf-bpe/dsf-bpe-server-jetty/api/v1/*.jar
dsf-bpe/dsf-bpe-server-jetty/api/v2/*.jar
dsf-bpe/dsf-bpe-server-jetty/conf/config.properties
dsf-bpe/dsf-bpe-server-jetty/docker/api/v1/*.jar
dsf-bpe/dsf-bpe-server-jetty/docker/api/v2/*.jar
Expand Down
152 changes: 145 additions & 7 deletions dsf-bpe/dsf-bpe-process-api-v1-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<artifactId>dsf-bpe-pom</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>dev.dsf</groupId>
Expand All @@ -27,10 +27,6 @@
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
Expand All @@ -48,10 +44,10 @@

<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
<version>${hapi.fhir.version.v1}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
Expand All @@ -63,4 +59,146 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-api-v1-dependencies-to-docker</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>../dsf-bpe-server-jetty/docker/api/v1</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>dev.dsf</groupId>
<artifactId>dsf-bpe-process-api-v1</artifactId>
</artifactItem>
<artifactItem>
<groupId>dev.dsf</groupId>
<artifactId>dsf-bpe-process-api-v1-impl</artifactId>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.r4</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-converter</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.convertors</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.r5</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<artifactItem>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.5.1-5</version>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.validation</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
<!--<artifactItem>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.4c</version>
</artifactItem>
<artifactItem>
<groupId>xpp3</groupId>
<artifactId>xpp3_xpath</artifactId>
<version>1.1.4c</version>
</artifactItem>-->
<artifactItem>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</artifactItem>
<artifactItem>
<groupId>org.fhir</groupId>
<artifactId>ucum</artifactId>
<version>1.0.2</version>
</artifactItem>
<artifactItem>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.7.0</version>
</artifactItem>
<artifactItem>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>2.6.0</version>
</artifactItem>
<artifactItem>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.3.3</version>
</artifactItem>
<artifactItem>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</artifactItem>
<artifactItem>
<groupId>de.hs-heilbronn.mi</groupId>
<artifactId>crypto-utils</artifactId>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
</artifactItem>
<artifactItem>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>${hapi.fhir.version.v1}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>../dsf-bpe-server-jetty/docker/api</directory>
<includes>
<include>v1/*.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ processUrl, getCurrentTime(), continueTaskUrl, requester, businessKey, correlati
logger.info("Continuing process {} at {} [task: {}, requester: {}, business-key: {}, message: {}]",
processUrl, getCurrentTime(), continueTaskUrl, requester, businessKey, messageName);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.ProcessPluginDefinition;
import dev.dsf.bpe.v1.ProcessPluginDeploymentStateListener;
import dev.dsf.bpe.v1.constants.CodeSystems;
import dev.dsf.bpe.v1.constants.CodeSystems.BpmnMessage;
import dev.dsf.bpe.v1.constants.NamingSystems.OrganizationIdentifier;
import dev.dsf.bpe.v1.constants.NamingSystems.TaskIdentifier;
import dev.dsf.bpe.v1.variables.FhirResourceValues;
Expand Down Expand Up @@ -143,21 +143,18 @@ else if (filename.endsWith(XML_SUFFIX))
})
: Optional.empty();

Predicate<Task> hasTaskInputMessageName = t -> t
.getInput().stream().filter(
i -> i.getType().getCoding().stream()
.anyMatch(c -> CodeSystems.BpmnMessage.URL.equals(c.getSystem())
&& CodeSystems.BpmnMessage.Codes.MESSAGE_NAME.equals(c.getCode())))
Predicate<Task> hasTaskInputMessageName = t -> t.getInput().stream()
.filter(i -> i.getType().getCoding().stream().anyMatch(c -> BpmnMessage.URL.equals(c.getSystem())
&& BpmnMessage.Codes.MESSAGE_NAME.equals(c.getCode())))
.count() == 1;

return new ProcessPluginFhirConfig<>(ActivityDefinition.class, CodeSystem.class, Library.class, Measure.class,
NamingSystem.class, Questionnaire.class, StructureDefinition.class, Task.class, ValueSet.class,
OrganizationIdentifier.SID, TaskIdentifier.SID, TaskStatus.DRAFT.toCode(), CodeSystems.BpmnMessage.URL,
CodeSystems.BpmnMessage.Codes.MESSAGE_NAME, parseResource, encodeResource, getResourceName,
hasMetadataResourceUrl, hasMetadataResourceVersion, getMetadataResourceVersion,
getActivityDefinitionUrl, NamingSystem::hasName, getTaskInstantiatesCanonical, getTaskIdentifierValue,
isTaskStatusDraft, getRequester, getRecipient, Task::hasInput, hasTaskInputMessageName,
Task::hasOutput);
OrganizationIdentifier.SID, TaskIdentifier.SID, TaskStatus.DRAFT.toCode(), BpmnMessage.URL,
BpmnMessage.Codes.MESSAGE_NAME, parseResource, encodeResource, getResourceName, hasMetadataResourceUrl,
hasMetadataResourceVersion, getMetadataResourceVersion, getActivityDefinitionUrl, NamingSystem::hasName,
getTaskInstantiatesCanonical, getTaskIdentifierValue, isTaskStatusDraft, getRequester, getRecipient,
Task::hasInput, hasTaskInputMessageName, Task::hasOutput);
}

private IParser newXmlParser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.hl7.fhir.instance.model.api.IBaseBundle.LINK_NEXT;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -72,9 +71,9 @@ protected final <R extends Resource> List<R> search(Class<? extends Resource> se
private Bundle search(Class<? extends Resource> searchType, Map<String, List<String>> parameters, int page)
{
Map<String, List<String>> parametersAndPage = new HashMap<>(parameters);
parametersAndPage.put("_page", Collections.singletonList(String.valueOf(page)));
parametersAndPage.put("_page", List.of(String.valueOf(page)));
if (!parameters.containsKey("_sort"))
parametersAndPage.put("_sort", Collections.singletonList("_id"));
parametersAndPage.put("_sort", List.of("_id"));

return clientProvider.getLocalWebserviceClient().searchWithStrictHandling(searchType, parametersAndPage);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.dsf.bpe.v1.service;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -30,8 +29,7 @@ public EndpointProviderImpl(FhirWebserviceClientProvider clientProvider, String
public Optional<Endpoint> getLocalEndpoint()
{
Bundle resultBundle = clientProvider.getLocalWebserviceClient().searchWithStrictHandling(Endpoint.class,
Map.of("status", Collections.singletonList("active"), "address",
Collections.singletonList(localEndpointAddress)));
Map.of("status", List.of("active"), "address", List.of(localEndpointAddress)));

if (resultBundle == null || resultBundle.getEntry() == null || resultBundle.getEntry().size() != 1
|| resultBundle.getEntryFirstRep().getResource() == null
Expand Down Expand Up @@ -61,8 +59,8 @@ public Optional<Endpoint> getEndpoint(Identifier endpointIdentifier)

String endpointIdSp = toSearchParameter(endpointIdentifier);

Bundle resultBundle = clientProvider.getLocalWebserviceClient().searchWithStrictHandling(Endpoint.class, Map.of(
"status", Collections.singletonList("active"), "identifier", Collections.singletonList(endpointIdSp)));
Bundle resultBundle = clientProvider.getLocalWebserviceClient().searchWithStrictHandling(Endpoint.class,
Map.of("status", List.of("active"), "identifier", List.of(endpointIdSp)));

if (resultBundle == null || resultBundle.getEntry() == null || resultBundle.getTotal() != 1
|| resultBundle.getEntryFirstRep().getResource() == null
Expand All @@ -81,17 +79,17 @@ public Optional<Endpoint> getEndpoint(Identifier parentOrganizationIdentifier,
{
if (parentOrganizationIdentifier == null)
{
logger.debug("Parent organiztion identifier is null");
logger.debug("Parent organization identifier is null");
return Optional.empty();
}
else if (memberOrganizationIdentifier == null)
{
logger.debug("Member organiztion identifier is null");
logger.debug("Member organization identifier is null");
return Optional.empty();
}
else if (memberOrganizationRole == null)
{
logger.debug("Member organiztion role is null");
logger.debug("Member organization role is null");
return Optional.empty();
}

Expand All @@ -101,11 +99,9 @@ else if (memberOrganizationRole == null)

Bundle resultBundle = clientProvider.getLocalWebserviceClient().searchWithStrictHandling(
OrganizationAffiliation.class,
Map.of("active", Collections.singletonList("true"), "primary-organization:identifier",
Collections.singletonList(parentOrganizationIdSp), "participating-organization:identifier",
Collections.singletonList(memberOrganizationIdSp), "role",
Collections.singletonList(memberOrganizationRoleSp), "_include",
Collections.singletonList("OrganizationAffiliation:endpoint")));
Map.of("active", List.of("true"), "primary-organization:identifier", List.of(parentOrganizationIdSp),
"participating-organization:identifier", List.of(memberOrganizationIdSp), "role",
List.of(memberOrganizationRoleSp), "_include", List.of("OrganizationAffiliation:endpoint")));

if (resultBundle == null || resultBundle.getEntry() == null || resultBundle.getTotal() != 1
|| resultBundle.getEntryFirstRep().getResource() == null
Expand Down Expand Up @@ -141,22 +137,21 @@ public List<Endpoint> getEndpoints(Identifier parentOrganizationIdentifier, Codi
{
if (parentOrganizationIdentifier == null)
{
logger.debug("Parent organiztion identifier is null");
return Collections.emptyList();
logger.debug("Parent organization identifier is null");
return List.of();
}
else if (memberOrganizationRole == null)
{
logger.debug("Member organiztion role is null");
return Collections.emptyList();
logger.debug("Member organization role is null");
return List.of();
}

String parentOrganizationIdSp = toSearchParameter(parentOrganizationIdentifier);
String memberOrganizationRoleSp = toSearchParameter(memberOrganizationRole);

Map<String, List<String>> parameters = Map.of("active", Collections.singletonList("true"),
"primary-organization:identifier", Collections.singletonList(parentOrganizationIdSp), "role",
Collections.singletonList(memberOrganizationRoleSp), "_include",
Collections.singletonList("OrganizationAffiliation:endpoint"));
Map<String, List<String>> parameters = Map.of("active", List.of("true"), "primary-organization:identifier",
List.of(parentOrganizationIdSp), "role", List.of(memberOrganizationRoleSp), "_include",
List.of("OrganizationAffiliation:endpoint"));

return search(OrganizationAffiliation.class, parameters, SearchEntryMode.INCLUDE, Endpoint.class,
e -> EndpointStatus.ACTIVE.equals(e.getStatus()));
Expand Down
Loading