Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/issues/4_new_organization_roles'
Browse files Browse the repository at this point in the history
into develop
  • Loading branch information
hhund committed Jul 24, 2023
2 parents 63b4187 + 8e99bc6 commit e65e028
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 56 deletions.
41 changes: 21 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<compileSource>17</compileSource>
<compileTarget>17</compileTarget>

<dsf.version>1.0.0-M1</dsf.version>
<dsf.version>1.0.0</dsf.version>
<dsf.location>../dsf</dsf.location>
</properties>

Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>6.0.8</version>
<version>6.0.10</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -92,7 +92,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -114,21 +114,22 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<!-- 3.1.0 not working, no git commit hash as buildnumber -->
<version>1.4</version>
<executions>
<execution>
Expand All @@ -146,15 +147,15 @@
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.22.0</version>
<version>2.23.0</version>
<configuration>
<configFile>eclipse-formatter-config.xml</configFile>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.8.0</version>
<version>1.9.0</version>
<configuration>
<compliance>17</compliance>
<groups>java.,javax.,org.,com.</groups>
Expand Down Expand Up @@ -294,7 +295,7 @@
</configuration>
</execution>
<execution>
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id>
<id>copy-process-plugin-to-docker-test-setup-3dic-ttp/dic1</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
Expand All @@ -307,11 +308,11 @@
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</outputDirectory>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic1/bpe/process</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id>
<id>copy-process-plugin-to-docker-test-setup-3dic-ttp/dic2</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
Expand All @@ -324,11 +325,11 @@
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</outputDirectory>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic2/bpe/process</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id>
<id>copy-process-plugin-to-docker-test-setup-3dic-ttp/dic3</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
Expand All @@ -341,11 +342,11 @@
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</outputDirectory>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic3/bpe/process</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id>
<id>copy-process-plugin-to-docker-test-setup-3dic-ttp/ttp</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
Expand All @@ -358,7 +359,7 @@
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</outputDirectory>
<outputDirectory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/ttp/bpe/process</outputDirectory>
</configuration>
</execution>
</executions>
Expand All @@ -376,28 +377,28 @@
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</directory>
<directory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic1/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</directory>
<directory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic2/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</directory>
<directory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic3/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</directory>
<directory>${dsf.location}/dsf-docker-test-setup-3dic-ttp/ttp/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
</includes>
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/dev/dsf/bpe/PingProcessPluginDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ public Map<String, List<String>> getFhirResourcesByProcessId()
var sStopPingAutostart = "fhir/StructureDefinition/dsf-task-stop-ping-autostart.xml";

var tStartPing = "fhir/Task/dsf-task-start-ping.xml";
var tStartPingAutoStart = "fhir/Task/dsf-task-start-ping-autostart.xml";
var tStopPingAutoStart = "fhir/Task/dsf-task-stop-ping-autostart.xml";

var vPing = "fhir/ValueSet/dsf-ping.xml";
var vPingStatus = "fhir/ValueSet/dsf-ping-status.xml";
var vPongStatus = "fhir/ValueSet/dsf-pong-status.xml";

return Map.of(ConstantsPing.PROCESS_NAME_FULL_PING,
Arrays.asList(aPing, cPing, cPingStatus, sPingStatus, sStartPing, sPong, tStartPing, vPing,
vPingStatus),
Arrays.asList(
aPing, cPing, cPingStatus, sPingStatus, sStartPing, sPong, tStartPing, vPing, vPingStatus),
ConstantsPing.PROCESS_NAME_FULL_PING_AUTOSTART,
Arrays.asList(aPingAutostart, cPing, sStartPingAutostart, sStopPingAutostart, vPing),
Arrays.asList(aPingAutostart, cPing, sStartPingAutostart, sStopPingAutostart, tStartPingAutoStart,
tStopPingAutoStart, vPing),
ConstantsPing.PROCESS_NAME_FULL_PONG,
Arrays.asList(aPong, cPing, cPingStatus, sPingStatus, sPing, vPing, vPongStatus));
}
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/dev/dsf/bpe/service/SelectPingTargets.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public SelectPingTargets(ProcessPluginApi api)
protected void doExecute(DelegateExecution execution, Variables variables) throws BpmnError, Exception
{
Stream<Endpoint> targetEndpoints = getTargetEndpointsSearchParameter(variables).map(this::searchForEndpoints)
.orElse(allEndpointsNotLocal());
.orElse(allEndpoints()).filter(isLocalEndpoint().negate());

List<Organization> remoteOrganizations = api.getOrganizationProvider().getRemoteOrganizations();
Map<String, Identifier> organizationIdentifierByOrganizationId = remoteOrganizations.stream().collect(
Expand Down Expand Up @@ -132,9 +132,9 @@ private Optional<Class<? extends Resource>> getResourceType(UriComponents search
}
}

private Stream<Endpoint> allEndpointsNotLocal()
private Stream<Endpoint> allEndpoints()
{
return allEndpoints(1, 0).filter(isLocalEndpoint().negate());
return allEndpoints(1, 0);
}

private Predicate<? super Endpoint> isLocalEndpoint()
Expand All @@ -144,8 +144,10 @@ private Predicate<? super Endpoint> isLocalEndpoint()

private Stream<Endpoint> allEndpoints(int page, int currentTotal)
{
Bundle searchResult = api.getFhirWebserviceClientProvider().getLocalWebserviceClient()
.searchWithStrictHandling(Endpoint.class, Map.of("status", Collections.singletonList("active"), "_page",
Bundle searchResult = api.getFhirWebserviceClientProvider().getLocalWebserviceClient().searchWithStrictHandling(
Endpoint.class,
Map.of("status", Collections.singletonList("active"), "identifier",
Collections.singletonList("http://dsf.dev/sid/endpoint-identifier|"), "_page",
Collections.singletonList(String.valueOf(page))));

if (searchResult.getTotal() > currentTotal + searchResult.getEntry().size())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
<code value="LOCAL_ALL" />
</valueCoding>
</extension>
<extension url="requester">
<valueCoding>
<extension url="http://dsf.dev/fhir/StructureDefinition/extension-process-authorization-practitioner">
<valueCoding>
<system value="http://dsf.dev/fhir/CodeSystem/practitioner-role" />
<code value="DSF_ADMIN" />
</valueCoding>
</extension>
<system value="http://dsf.dev/fhir/CodeSystem/process-authorization" />
<code value="LOCAL_ALL_PRACTITIONER" />
</valueCoding>
</extension>
<extension url="recipient">
<valueCoding>
<system value="http://dsf.dev/fhir/CodeSystem/process-authorization" />
Expand All @@ -38,6 +50,18 @@
<code value="LOCAL_ALL" />
</valueCoding>
</extension>
<extension url="requester">
<valueCoding>
<extension url="http://dsf.dev/fhir/StructureDefinition/extension-process-authorization-practitioner">
<valueCoding>
<system value="http://dsf.dev/fhir/CodeSystem/practitioner-role" />
<code value="DSF_ADMIN" />
</valueCoding>
</extension>
<system value="http://dsf.dev/fhir/CodeSystem/process-authorization" />
<code value="LOCAL_ALL_PRACTITIONER" />
</valueCoding>
</extension>
<extension url="recipient">
<valueCoding>
<system value="http://dsf.dev/fhir/CodeSystem/process-authorization" />
Expand All @@ -48,7 +72,7 @@
<url value="http://dsf.dev/bpe/Process/pingAutostart" />
<!-- version managed by bpe -->
<version value="#{version}" />
<name value="Ping Autostart" />
<name value="PingAutostart" />
<title value="PING Autostart process" />
<subtitle value="Autostart Communication Testing Process" />
<!-- status managed by bpe -->
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/fhir/ActivityDefinition/dsf-ping.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
<code value="LOCAL_ALL" />
</valueCoding>
</extension>
<extension url="requester">
<valueCoding>
<extension url="http://dsf.dev/fhir/StructureDefinition/extension-process-authorization-practitioner">
<valueCoding>
<system value="http://dsf.dev/fhir/CodeSystem/practitioner-role" />
<code value="DSF_ADMIN" />
</valueCoding>
</extension>
<system value="http://dsf.dev/fhir/CodeSystem/process-authorization" />
<code value="LOCAL_ALL_PRACTITIONER" />
</valueCoding>
</extension>
<extension url="recipient">
<valueCoding>
<system value="http://dsf.dev/fhir/CodeSystem/process-authorization" />
Expand Down
56 changes: 56 additions & 0 deletions src/main/resources/fhir/Task/dsf-task-start-ping-autostart.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<Task xmlns="http://hl7.org/fhir">
<meta>
<profile value="http://dsf.dev/fhir/StructureDefinition/task-start-ping-autostart|#{version}"/>
</meta>
<identifier>
<system value="http://dsf.dev/sid/task-identifier"/>
<value value="http://dsf.dev/bpe/Process/pingAutostart/#{version}/task-start-ping-autostart"/>
</identifier>
<instantiatesCanonical value="http://dsf.dev/bpe/Process/pingAutostart|#{version}"/>
<status value="draft"/>
<intent value="order"/>
<authoredOn value="#{date}"/>
<requester>
<type value="Organization"/>
<identifier>
<system value="http://dsf.dev/sid/organization-identifier"/>
<value value="#{organization}"/>
</identifier>
</requester>
<restriction>
<recipient>
<type value="Organization"/>
<identifier>
<system value="http://dsf.dev/sid/organization-identifier"/>
<value value="#{organization}"/>
</identifier>
</recipient>
</restriction>
<input>
<type>
<coding>
<system value="http://dsf.dev/fhir/CodeSystem/bpmn-message"/>
<code value="message-name"/>
</coding>
</type>
<valueString value="startPingAutostart"/>
</input>
<input>
<type>
<coding>
<system value="http://dsf.dev/fhir/CodeSystem/ping"></system>
<code value="target-endpoints"></code>
</coding>
</type>
<valueString value="Endpoint?status=active&amp;identifier=http://dsf.dev/sid/endpoint-identifier|"></valueString>
</input>
<input>
<type>
<coding>
<system value="http://dsf.dev/fhir/CodeSystem/ping"></system>
<code value="timer-interval"></code>
</coding>
</type>
<valueString value="PT24H"></valueString>
</input>
</Task>
38 changes: 38 additions & 0 deletions src/main/resources/fhir/Task/dsf-task-stop-ping-autostart.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Task xmlns="http://hl7.org/fhir">
<meta>
<profile value="http://dsf.dev/fhir/StructureDefinition/task-stop-ping-autostart|#{version}"/>
</meta>
<identifier>
<system value="http://dsf.dev/sid/task-identifier"/>
<value value="http://dsf.dev/bpe/Process/pingAutostart/#{version}/task-stop-ping-autostart"/>
</identifier>
<instantiatesCanonical value="http://dsf.dev/bpe/Process/pingAutostart|#{version}"/>
<status value="draft"/>
<intent value="order"/>
<authoredOn value="#{date}"/>
<requester>
<type value="Organization"/>
<identifier>
<system value="http://dsf.dev/sid/organization-identifier"/>
<value value="#{organization}"/>
</identifier>
</requester>
<restriction>
<recipient>
<type value="Organization"/>
<identifier>
<system value="http://dsf.dev/sid/organization-identifier"/>
<value value="#{organization}"/>
</identifier>
</recipient>
</restriction>
<input>
<type>
<coding>
<system value="http://dsf.dev/fhir/CodeSystem/bpmn-message"/>
<code value="message-name"/>
</coding>
</type>
<valueString value="stopPingAutostart"/>
</input>
</Task>
1 change: 1 addition & 0 deletions src/main/resources/fhir/ValueSet/dsf-ping-status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<compose>
<include>
<system value="http://dsf.dev/fhir/CodeSystem/ping-status" />
<version value="#{version}" />
<concept>
<code value="not-allowed" />
<display value="Not allowed" />
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/fhir/ValueSet/dsf-ping.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<compose>
<include>
<system value="http://dsf.dev/fhir/CodeSystem/ping" />
<version value="#{version}" />
</include>
</compose>
</ValueSet>
Loading

0 comments on commit e65e028

Please sign in to comment.