Skip to content

Commit

Permalink
Release 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gematik-Entwicklung committed Feb 9, 2024
1 parent f097020 commit 328fb67
Show file tree
Hide file tree
Showing 116 changed files with 355 additions and 975 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 gematik GmbH
Copyright (c) 2024 gematik GmbH

Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![gematik GmbH](docs/img/Gematik_Logo_Flag.png)
<img align="right" width="250" height="47" src="docs/img/Gematik_Logo_Flag.png"/> <br/>

# Gematik Referenzvalidator

Expand Down Expand Up @@ -43,6 +43,9 @@ Siehe [Use Cases, Anforderungen, Architektur, Entwicklungsprozess](docs/concept/
> Die Verbindlichkeit des E-Rezept-Moduls vom Referenzvalidator in Abrechnungsprozessen wird in der [Technische Anlage 7, Anhang 2, zur Arzneimittelabrechnungsvereinbarung gemäß § 300 Absatz 3 SGB V](https://www.gkv-datenaustausch.de/leistungserbringer/apotheken/apotheken.jsp) festgelegt. Siehe auch [E-Rezept: Technische Verarbeitbarkeit, Schiedsrichter-Rolle und Problemlösungsverfahren](docs/concept/concept.md#e-rezept-technische-verarbeitbarkeit-schiedsrichter-rolle-und-probleml%C3%B6sungsverfahren).
> Die Verbindlichkeit anderer Validierungsmodule wurde bisher nicht festgelegt. Es besteht lediglich eine Nutzungsempfehlung seitens der gematik.
> **Warning**
> Der Betrieb des Referenzvalidators in bestehenden Anwendungen oder Anwendungslandschaften obliegt der Verantwortung der Nutzer. Die gematik trifft angemessene Maßnahmen, um die Sicherheit und Performance des Referenzvalidators zu gewährleisten. Sie übernimmt aber keine Verantwortung für etwaige Schäden, die durch die Integration des Referenzvalidators in Produktionssysteme entstehen (siehe auch Haftungsausschuss der [Apache 2.0-Lizenz](https://www.apache.org/licenses/LICENSE-2.0). Insbesondere müssen die Sicherheitsaspekte des Gesamtsystems unter Einbeziehung der technischen und organisatorischen Rahmenbedingungen der jeweiligen Betriebsumgebung durch die Nutzer selbst bewertet werden. Des Weiteren hängen die Performance-Eigenschaften des Validators stark von der jeweiligen Betriebsumgebung ab.
### Release Notes

Siehe [Release Notes](ReleaseNotes.md)
Expand Down Expand Up @@ -158,7 +161,7 @@ System.out.println(result.isValid());

### Voraussetzungen

Der Referenzvalidator wird als Java-Bibliothek und als Konsolenanwendung verteilt. Für die Verwendung ist JDK 11 erforderlich (z.B. [AdoptOpenJDK](https://adoptopenjdk.net/)).
Der Referenzvalidator wird als Java-Bibliothek und als Konsolenanwendung verteilt. Für die Verwendung ist JDK 11 erforderlich (z.B. [AdoptOpenJDK](https://adoptopenjdk.net/)).

### Installation

Expand Down
8 changes: 7 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
![gematik GmbH](docs/img/Gematik_Logo_Flag.png)
<img align="right" width="250" height="47" src="docs/img/Gematik_Logo_Flag.png"/> <br/>

# Release Notes Gematik Referenzvalidator

## Release 2.0.2

### fixed
- optimized usage of internal caches to mediate the memory leak issue https://github.com/hapifhir/org.hl7.fhir.core/issues/1412
- optimized package loading mechanism to reduce memory consumption

## Release 2.0.1

### fixed
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>referencevalidator</artifactId>
<groupId>de.gematik.refv</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>
<properties>
<integrationtest.folder>${basedir}/target/test-classes/pluginloader-integration-test</integrationtest.folder>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/java/de/gematik/refv/cli/PluginLoader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cli/src/test/java/de/gematik/refv/cli/ModuleSupportIT.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>referencevalidator</artifactId>
<groupId>de.gematik.refv</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion commons/src/main/java/de/gematik/refv/commons/Profile.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -59,6 +59,10 @@ public class GenericValidator {
public GenericValidator(FhirContext context) {
this.fhirContext = context;
this.hapiFhirValidatorFactory = new HapiFhirValidatorFactory(fhirContext);

// Do not evict internal cache of FhirInstanceValidator as the object itself is kept in memory and its cache is permanently required
// Mediates the memory leak issue https://github.com/hapifhir/org.hl7.fhir.core/issues/1412 (occurs in HAPI 6.6.2)
System.setProperty("TEST_SYSTEM_PROP_VALIDATION_RESOURCE_CACHES_MS", String.valueOf(Long.MAX_VALUE));
}

public ValidationResult validate(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -69,7 +69,7 @@ private FhirValidator createHapiFhirValidator(ValidationModuleConfiguration conf

private void addNpmPackagesToValidationSupportChain(Collection<String> packageFilenames, ValidationSupportChain validationSupportChain, ValidationModuleResourceProvider validationModuleResourceProvider) {
for (String packagePath : packageFilenames) {
var prePopulatedValidationSupport = packageCache.addOrGet(packagePath, validationModuleResourceProvider.getPackage(packagePath));
var prePopulatedValidationSupport = packageCache.addOrGet(packagePath, validationModuleResourceProvider);
validationSupportChain.addValidationSupport(prePopulatedValidationSupport);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,6 @@
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;

import java.io.InputStream;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand All @@ -32,18 +31,17 @@ class PackageCache {

private final Map<String, IValidationSupport> packages = new ConcurrentHashMap<>();


public PackageCache(FhirContext fhirContext) {
this.fhirContext = fhirContext;
}

public IValidationSupport addOrGet(String packagePath, InputStream inputStream) {
return packages.computeIfAbsent(packagePath, path -> createPrePopulatedSupportFromPackage(inputStream));
public IValidationSupport addOrGet(String packagePath, ValidationModuleResourceProvider validationModuleResourceProvider) {
return packages.computeIfAbsent(packagePath, path -> createPrePopulatedSupportFromPackage(packagePath, validationModuleResourceProvider));
}

@SneakyThrows
private IValidationSupport createPrePopulatedSupportFromPackage(InputStream inputStream) {
CustomNpmPackageValidationSupport validationSupport = new CustomNpmPackageValidationSupport(fhirContext);
validationSupport.loadPackageFromInputStream(inputStream);
return validationSupport;
private IValidationSupport createPrePopulatedSupportFromPackage(String packagePath, ValidationModuleResourceProvider validationModuleResourceProvider) {
return CustomNpmPackageValidationSupport.create(fhirContext, packagePath, validationModuleResourceProvider::getPackage);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 gematik GmbH
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 328fb67

Please sign in to comment.