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

Commit

Permalink
Merge remote-tracking branch
Browse files Browse the repository at this point in the history
'origin/issues/274_highmed-processes-preparations' into develop
  • Loading branch information
hhund committed Nov 17, 2021
2 parents 3efc568 + e273665 commit 9eb71da
Show file tree
Hide file tree
Showing 96 changed files with 1,652 additions and 401 deletions.
9 changes: 9 additions & 0 deletions dsf-bpe/dsf-bpe-process-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<artifactId>dsf-fhir-auth</artifactId>
</dependency>

<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-pseudonymization-client</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-pseudonymization-medic</artifactId>
Expand All @@ -34,6 +38,11 @@
<artifactId>dsf-mpi-client</artifactId>
</dependency>

<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-consent-client</artifactId>
</dependency>

<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-openehr-model</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,50 @@ public interface ConstantsBase
String CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY = "correlation-key";
String CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR = "error";

/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE = "http://highmed.org/fhir/CodeSystem/organization-type";
/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_TTP} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP = "TTP";
/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_MEDIC} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC = "MeDIC";
/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_DTS} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_DTS = "DTS";
/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_COS} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_COS = "COS";
/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_CRR} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_CRR = "CRR";
/**
* @deprecated as of release 0.6.0, use {@link #CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_HRP} instead
*/
@Deprecated
String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_HRP = "HRP";

String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE = "http://highmed.org/fhir/CodeSystem/organization-role";
String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_TTP = "TTP";
String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_MEDIC = "MeDIC";
String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_DTS = "DTS";
String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_COS = "COS";
String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_CRR = "CRR";
String CODESYSTEM_HIGHMED_ORGANIZATION_ROLE_VALUE_HRP = "HRP";

String CODESYSTEM_HIGHMED_QUERY_TYPE = "http://highmed.org/fhir/CodeSystem/query-type";
String CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL = "application/x-aql-query";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,136 @@
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Identifier;
import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.OrganizationAffiliation;

public interface OrganizationProvider
{
String getDefaultIdentifierSystem();

/**
* @deprecated as of release 0.6.0, use {@link #getDefaultRoleSystem()} instead
*/
@Deprecated
String getDefaultTypeSystem();

String getDefaultRoleSystem();

String getLocalIdentifierValue();

Optional<Organization> getOrganization(String identifier);

Optional<Organization> getOrganization(String system, String identifier);

/**
* @return the local organization
* @return the active local organization
* @throws NoSuchElementException
* if no {@link Organization} with {@link #getDefaultIdentifierSystem()} and
* {@link #getLocalIdentifierValue()} could be found
*/
Organization getLocalOrganization();

/**
* @return {@link Organization}s with {@link #getDefaultIdentifierSystem()} and identifier other than
* @return active {@link Organization}s with {@link #getDefaultIdentifierSystem()} and identifier other than
* {@link #getLocalIdentifierValue()}
*/
List<Organization> getRemoteOrganizations();

/**
* @param type
* not <code>null</code>
* @return {@link Organization}s with {@link #getDefaultTypeSystem()} and given type
* @return active {@link Organization}s with {@link #getDefaultTypeSystem()} and given type
* @deprecated as of release 0.6.0, the organization type has moved into the OrganizationAffiliation resource, use
* {@link #getOrganizationsByRole(String)} instead
*/
@Deprecated
Stream<Organization> getOrganizationsByType(String type);

/**
* @param roleSystem
* not <code>null</code>
* @param roleValue
* not <code>null</code>
* @return active {@link Organization}s having an {@link OrganizationAffiliation} matching the given role
*/
Stream<Organization> getOrganizationsByRole(String roleSystem, String roleValue);

/**
* @param role
* specifies the roleValue, uses {@link #getDefaultRoleSystem()} as roleSystem, not <code>null</code>
* @return active {@link Organization}s having an {@link OrganizationAffiliation} matching
* {@link #getDefaultRoleSystem()} and the given role value
*/
default Stream<Organization> getOrganizationsByRole(String role)
{
return getOrganizationsByRole(getDefaultRoleSystem(), role);
}

/**
* @param consortiumIdentifierSystem
* not <code>null</code>
* @param consortiumIdentifierValue
* not <code>null</code>
* @return active {@link Organization}s having an {@link OrganizationAffiliation} using the given
* consortiumIdentifier
*/
Stream<Organization> getOrganizationsByConsortium(String consortiumIdentifierSystem,
String consortiumIdentifierValue);

/**
* @param consortiumIdentifier
* specifies the consortiumIdentifierValue, uses {@link #getDefaultIdentifierSystem()} as
* consortiumIdentifierSystem, not <code>null</code>
* @return active {@link Organization}s having an {@link OrganizationAffiliation} using
* {@link #getDefaultIdentifierSystem()} and the given consortiumIdentifier value
*/
default Stream<Organization> getOrganizationsByConsortium(String consortiumIdentifier)
{
return getOrganizationsByConsortium(getDefaultIdentifierSystem(), consortiumIdentifier);
}

/**
* @param consortiumIdentifierSystem
* not <code>null</code>
* @param consortiumIdentifierValue
* not <code>null</code>
* @param roleSystem
* not <code>null</code>
* @param roleValue
* not <code>null</code>
* @return active {@link Organization}s having an {@link OrganizationAffiliation} using the given
* consortiumIdentifier and role
*/
Stream<Organization> getOrganizationsByConsortiumAndRole(String consortiumIdentifierSystem,
String consortiumIdentifierValue, String roleSystem, String roleValue);

/**
* @param consortiumIdentifier
* specifies the consortiumIdentifierValue, uses {@link #getDefaultIdentifierSystem()} as
* consortiumIdentifierSystem, not <code>null</code>
* @param role
* specifies the roleValue, uses {@link #getDefaultRoleSystem()} as roleSystem, not <code>null</code>
* @return active {@link Organization}s having an {@link OrganizationAffiliation} using
* {@link #getDefaultIdentifierSystem()} and the given consortiumIdentifier value as well as matching
* {@link #getDefaultRoleSystem()} and the given role value
*/
default Stream<Organization> getOrganizationsByConsortiumAndRole(String consortiumIdentifier, String role)
{
return getOrganizationsByConsortiumAndRole(getDefaultIdentifierSystem(), consortiumIdentifier,
getDefaultRoleSystem(), role);
}

Identifier getLocalIdentifier();

/**
* @return {@link Organization}s {@link Identifier} with {@link #getDefaultIdentifierSystem()} and identifier other
* than {@link #getLocalIdentifierValue()}
* @return active {@link Organization}s {@link Identifier} with {@link #getDefaultIdentifierSystem()} and identifier
* other than {@link #getLocalIdentifierValue()}
*/
List<Identifier> getRemoteIdentifiers();

/**
* @param organizationId
* not <code>null</code>
* @return {@link Organization}s {@link Identifier} with idPart equal to the given organizationId, or
* @return active {@link Organization}s {@link Identifier} with idPart equal to the given organizationId, or
* {@link Optional#empty()} if not found
*/
Optional<Identifier> getIdentifier(IdType organizationId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public interface ConstantsExampleStarters
String ENV_DSF_CLIENT_CERTIFICATE_PATH = "DSF_CLIENT_CERTIFICATE_PATH";
String ENV_DSF_CLIENT_CERTIFICATE_PASSWORD = "DSF_CLIENT_CERTIFICATE_PASSWORD";

String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_CONSORTIUM_HIGHMED = "highmed.org";

String TTP_FHIR_BASE_URL = "https://ttp/fhir/";
String TTP_DOCKER_FHIR_BASE_URL = "https://ttp-docker/fhir/";
String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP";
Expand Down
61 changes: 8 additions & 53 deletions dsf-bpe/dsf-bpe-server-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-tools-db-migration</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-consent-client-stub</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-openehr-client-stub</artifactId>
Expand All @@ -27,6 +31,10 @@
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-mpi-client-stub</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-pseudonymization-client-stub</artifactId>
</dependency>

<dependency>
<groupId>de.hs-heilbronn.mi</groupId>
Expand Down Expand Up @@ -141,57 +149,4 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>copy-highmed-processes</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-process-plugins-for-testing</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-bpe-process-ping</artifactId>
<version>${project.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-bpe-process-update-allow-list</artifactId>
<version>${project.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-bpe-process-update-resources</artifactId>
<version>${project.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-bpe-process-feasibility</artifactId>
<version>${project.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-bpe-process-local-services</artifactId>
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>process</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
8 changes: 8 additions & 0 deletions dsf-bpe/dsf-bpe-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-mpi-client</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-consent-client</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-pseudonymization-client</artifactId>
</dependency>
<dependency>
<groupId>org.highmed.dsf</groupId>
<artifactId>dsf-tools-build-info-reader</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.highmed.dsf.bpe.spring.config;

import java.util.NoSuchElementException;

import org.highmed.consent.client.ConsentClientFactory;
import org.highmed.consent.client.ConsentClientServiceLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConsentConfig
{
private static final Logger logger = LoggerFactory.getLogger(ConsentConfig.class);

@Autowired
private PropertiesConfig propertiesConfig;

@Bean
public ConsentClientServiceLoader consentClientServiceLoader()
{
return new ConsentClientServiceLoader();
}

@Bean
public ConsentClientFactory consentClientFactory()
{
ConsentClientFactory factory = consentClientServiceLoader()
.getConsentClientFactory(propertiesConfig.getConsentClientFactoryClass())
.orElseThrow(() -> new NoSuchElementException("Consent client factory with classname='"
+ propertiesConfig.getConsentClientFactoryClass() + "' not found"));

if ("org.highmed.consent.client.stub.ConsentClientStubFactory".equals(factory.getClass().getName()))
logger.warn("Using {} as consent client factory", factory.getClass().getName());
else
logger.info("Using {} as consent client factory", factory.getClass().getName());

return factory;
}
}
Loading

0 comments on commit 9eb71da

Please sign in to comment.