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

Commit

Permalink
0.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
holger-stenzhorn committed Apr 5, 2022
1 parent 6e29b27 commit b7658d0
Show file tree
Hide file tree
Showing 11 changed files with 10,390 additions and 5,207 deletions.
13 changes: 6 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

<groupId>de.difuture.uds</groupId>
<artifactId>odm2fhir</artifactId>
<version>0.7.6</version>
<version>0.7.7</version>

<name>ODM2FHIR</name>
<description>Mapper for GECCO based study/patient data in CDISC ODM to HL7 FHIR</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.4</version>
<version>2.6.6</version>
</parent>

<properties>
Expand All @@ -25,18 +25,17 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<hapi-fhir.version>5.7.0</hapi-fhir.version>
<hapi-fhir.version>5.7.2</hapi-fhir.version>
<jackson.version>2.13.2</jackson.version>
<kafka-fhir-serializer.version>1.0.2</kafka-fhir-serializer.version>
<lombok.version>1.18.22</lombok.version>
<spring-boot.version>${project.parent.version}</spring-boot.version>
<spring-retry.version>1.3.2</spring-retry.version>
<woodstox.version>6.2.8</woodstox.version>

<maven-antrun-plugin.version>3.0.0</maven-antrun-plugin.version>
<maven-compiler-plugin.version>3.9.0</maven-compiler-plugin.version>
<maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.10.0</maven-site-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-project-info-reports-plugin.version>3.2.2</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.11.0</maven-site-plugin.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.parser.StrictErrorHandler;

Expand All @@ -30,15 +29,16 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.PostConstruct;

import static ca.uhn.fhir.context.FhirContext.forR4Cached;

import static de.difuture.uds.odm2fhir.util.HTTPHelper.HTTP_CLIENT;

public abstract class FHIRBundleWriter {

@Value("${fhir.errorhandling.strict:false}")
protected boolean errorhandlingStrict;

protected static final FhirContext FHIR_CONTEXT = FhirContext.forR4();
protected static final IParser JSON_PARSER = FHIR_CONTEXT.newJsonParser().setPrettyPrint(true);
protected static final IParser JSON_PARSER = forR4Cached().newJsonParser().setPrettyPrint(true);

public static final AtomicInteger RESOURCES_NUMBER = new AtomicInteger();
public static final AtomicInteger BUNDLES_NUMBER = new AtomicInteger();
Expand All @@ -50,7 +50,7 @@ private void init() {
if (errorhandlingStrict) {
JSON_PARSER.setParserErrorHandler(new StrictErrorHandler());
}
FHIR_CONTEXT.getRestfulClientFactory().setHttpClient(HTTP_CLIENT);
forR4Cached().getRestfulClientFactory().setHttpClient(HTTP_CLIENT);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import javax.annotation.Nullable;
import javax.annotation.PostConstruct;

import static ca.uhn.fhir.context.FhirContext.forR4Cached;
import static ca.uhn.fhir.validation.ResultSeverityEnum.ERROR;
import static ca.uhn.fhir.validation.ResultSeverityEnum.WARNING;

Expand All @@ -66,7 +67,6 @@
import static de.difuture.uds.odm2fhir.fhir.util.CommonCodeSystem.SNOMED_CT;
import static de.difuture.uds.odm2fhir.fhir.util.IdentifierHelper.getIdentifierSystem;
import static de.difuture.uds.odm2fhir.fhir.util.NUMStructureDefinition.GECCO_BUNDLE;
import static de.difuture.uds.odm2fhir.fhir.writer.FHIRBundleWriter.FHIR_CONTEXT;
import static de.difuture.uds.odm2fhir.fhir.writer.FHIRBundleWriter.JSON_PARSER;
import static de.difuture.uds.odm2fhir.util.HTTPHelper.createAuthInterceptor;

Expand Down Expand Up @@ -132,7 +132,7 @@ private void init() throws IOException {
Locale.setDefault(ENGLISH);

@SuppressWarnings("unchecked")
var prePopulatedValidationSupport = new PrePopulatedValidationSupport(FHIR_CONTEXT) {
var prePopulatedValidationSupport = new PrePopulatedValidationSupport(forR4Cached()) {
@Override
public ValueSetExpansionOutcome expandValueSet(ValidationSupportContext validationSupportContext,
@Nullable ValueSetExpansionOptions valueSetExpansionOptions,
Expand All @@ -150,27 +150,27 @@ public ValueSetExpansionOutcome expandValueSet(ValidationSupportContext validati
.map(JSON_PARSER::parseResource)
.forEach(prePopulatedValidationSupport::addResource);

var unknownCodeSystemWarningValidationSupport = new UnknownCodeSystemWarningValidationSupport(FHIR_CONTEXT);
var unknownCodeSystemWarningValidationSupport = new UnknownCodeSystemWarningValidationSupport(forR4Cached());
unknownCodeSystemWarningValidationSupport.setNonExistentCodeSystemSeverity(IssueSeverity.WARNING);

var validationSupportChain = new ValidationSupportChain(
new DefaultProfileValidationSupport(FHIR_CONTEXT),
new CommonCodeSystemsTerminologyService(FHIR_CONTEXT),
new InMemoryTerminologyServerValidationSupport(FHIR_CONTEXT),
new DefaultProfileValidationSupport(forR4Cached()),
new CommonCodeSystemsTerminologyService(forR4Cached()),
new InMemoryTerminologyServerValidationSupport(forR4Cached()),
unknownCodeSystemWarningValidationSupport,
new SnapshotGeneratingValidationSupport(FHIR_CONTEXT),
new SnapshotGeneratingValidationSupport(forR4Cached()),
prePopulatedValidationSupport);

if (terminologyserverUrl.isAbsolute()) {
var remoteTerminologyServiceValidationSupport = new RemoteTerminologyServiceValidationSupport(FHIR_CONTEXT);
var remoteTerminologyServiceValidationSupport = new RemoteTerminologyServiceValidationSupport(forR4Cached());
remoteTerminologyServiceValidationSupport.setBaseUrl(terminologyserverUrl.toString());
remoteTerminologyServiceValidationSupport.addClientInterceptor(
createAuthInterceptor(terminologyserverBasicauthUsername, terminologyserverBasicauthPassword,
terminologyserverOauth2TokenURL, terminologyserverOauth2ClientId, terminologyserverOauth2ClientSecret));
validationSupportChain.addValidationSupport(remoteTerminologyServiceValidationSupport);
}

fhirValidator = FHIR_CONTEXT.newValidator()
fhirValidator = forR4Cached().newValidator()
.registerValidatorModule(new FhirInstanceValidator(new CachingValidationSupport(validationSupportChain)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

import static de.difuture.uds.odm2fhir.util.HTTPHelper.createAuthInterceptor;

import static ca.uhn.fhir.context.FhirContext.forR4Cached;

@ConditionalOnExpression("!'${fhir.server.url:}'.empty")
@Service
@Slf4j
Expand Down Expand Up @@ -66,7 +68,7 @@ public class ServerFHIRBundleWriter extends FHIRBundleWriter {
private RetryTemplate retryTemplate;

private void init() throws IOException {
genericClient = FHIR_CONTEXT.getRestfulClientFactory().newGenericClient(url.toString());
genericClient = forR4Cached().getRestfulClientFactory().newGenericClient(url.toString());
genericClient.registerInterceptor(
createAuthInterceptor(basicauthUsername, basicauthPassword, oauth2TokenURL, oauth2ClientId, oauth2ClientSecret));

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/de/difuture/uds/odm2fhir/util/HTTPHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public void setHttpClient(Environment environment) throws Exception {

HTTP_CLIENT = HttpClientBuilder.create()
.useSystemProperties()
.setMaxConnTotal(100)
.setMaxConnPerRoute(100)
.setSSLContext(sslContextBuilder.build())
.setSSLHostnameVerifier(new NoopHostnameVerifier())
.build();
Expand Down
Loading

0 comments on commit b7658d0

Please sign in to comment.