Merge branch 'rel_5_7'

This commit is contained in:
Tadgh 2022-02-07 12:11:35 -08:00
commit 0ccf1bfa52
11 changed files with 51 additions and 12 deletions

View File

@ -25,7 +25,7 @@ public final class Msg {
/**
* IMPORTANT: Please update the following comment after you add a new code
* Last code value: 2023
* Last code value: 2024
*/
private Msg() {}

View File

@ -0,0 +1,4 @@
---
type: add
issue: 3347
title: "Added ability to load Implementation Guide packages from filesystem by supporting the file:/ syntax of url."

View File

@ -12,6 +12,7 @@
<li>Guava (All): 30.1.1-jre -> 31.0.1-jre</li>
<li>JDOM (XML Patch Support): 2.0.6 -> 2.0.6.1 (Addresses CVE-2021-33813)</li>
<li>Spring (JPA): 5.3.7 -> 5.3.15</li>
<li>Spring (JPA): 5.3.7 -> 5.3.15</li>
<li>Spring-Data (JPA): 2.5.0 -> 2.6.1</li>
<li>Hibernate ORM (JPA): 5.4.30.Final -> 5.6.2.Final</li>
<li>Flyway (JPA): 6.5.4 -> 8.4.1</li>
@ -26,6 +27,8 @@
<li>Spring Boot (Boot): 2.5.0 -> 2.6.2</li>
<li>Swagger UI (OpenAPI): 3.46.0 -> 4.1.3</li>
<li>Resteasy (JAX-RS): 4.0.0.Beta3 -> 5.0.2.Final</li>
<li>Postgresql (JPA): 42.3.1 -> 42.3.2</li>
<li>Spring Security Oauth2(Oauth): 2.0.2.RELEASE -> 2.0.17.RELEASE</li>
</ul>
"

View File

@ -88,7 +88,11 @@ import javax.transaction.Transactional;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -473,7 +477,14 @@ public class JpaPackageCache extends BasePackageCacheManager implements IHapiPac
protected byte[] loadPackageUrlContents(String thePackageUrl) {
if (thePackageUrl.startsWith("classpath:")) {
return ClasspathUtil.loadResourceAsByteArray(thePackageUrl.substring("classpath:".length()));
return ClasspathUtil.loadResourceAsByteArray(thePackageUrl.substring("classpath:" .length()));
} else if (thePackageUrl.startsWith("file:")) {
try {
byte[] bytes = Files.readAllBytes(Paths.get(new URI(thePackageUrl)));
return bytes;
} catch (IOException | URISyntaxException e) {
throw new InternalErrorException(Msg.code(2024) + "Error loading \"" + thePackageUrl + "\": " + e.getMessage());
}
} else {
HttpClientConnectionManager connManager = new BasicHttpClientConnectionManager();
try (CloseableHttpResponse request = HttpClientBuilder

View File

@ -59,6 +59,8 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -924,20 +926,39 @@ public class NpmR4Test extends BaseJpaR4Test {
map.add(StructureDefinition.SP_URL, new UriParam("https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/LogicalModel/Laborbefund"));
IBundleProvider result = myStructureDefinitionDao.search(map);
assertEquals(1, result.sizeOrThrowNpe());
List<IBaseResource> resources = result.getResources(0,1);
assertFalse(((StructureDefinition)resources.get(0)).hasSnapshot());
List<IBaseResource> resources = result.getResources(0, 1);
assertFalse(((StructureDefinition) resources.get(0)).hasSnapshot());
// Confirm that DiagnosticLab (a resource StructureDefinition with differential but no snapshot) was created with a generated snapshot.
map = SearchParameterMap.newSynchronous();
map.add(StructureDefinition.SP_URL, new UriParam("https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/DiagnosticReportLab"));
result = myStructureDefinitionDao.search(map);
assertEquals(1, result.sizeOrThrowNpe());
resources = result.getResources(0,1);
assertTrue(((StructureDefinition)resources.get(0)).hasSnapshot());
resources = result.getResources(0, 1);
assertTrue(((StructureDefinition) resources.get(0)).hasSnapshot());
});
}
@Test
public void testInstallR4PackageFromFile() {
Path currentRelativePath = Paths.get("");
String s = currentRelativePath.toAbsolutePath().toString();
System.out.println("Current absolute path is: " + s);
String fileUrl = "file:" + s + "/src/test/resources/packages/de.basisprofil.r4-1.2.0.tgz";
myPackageInstallerSvc.install(new PackageInstallationSpec()
.setName("de.basisprofil.r4")
.setVersion("1.2.0")
.setPackageUrl(fileUrl)
);
runInTransaction(() -> {
assertTrue(myPackageVersionDao.findByPackageIdAndVersion("de.basisprofil.r4", "1.2.0").isPresent());
});
}
static class FakeNpmServlet extends HttpServlet {
private final Map<String, byte[]> myResponses = new HashMap<>();

View File

@ -36,7 +36,7 @@
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.2.RELEASE</version>
<version>2.0.17.RELEASE</version>
</dependency>
<!-- Server -->

View File

@ -188,7 +188,7 @@
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.10</version>
<version>1.10.11</version>
</dependency>
<!-- This is just used for -->

View File

@ -852,7 +852,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<ebay_cors_filter_version>1.0.1</ebay_cors_filter_version>
<elastic_apm_version>1.24.0</elastic_apm_version>
<elastic_apm_version>1.28.4</elastic_apm_version>
<!-- CQL Support -->
<cql-engine.version>1.5.1</cql-engine.version>
<cql-evaluator.version>1.2.0</cql-evaluator.version>
@ -1716,7 +1716,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.3.1</version>
<version>42.3.2</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>

View File

@ -2,7 +2,7 @@ source 'https://rubygems.org'
group :lint do
gem 'foodcritic', '~> 3.0'
gem 'rubocop', '~> 0.23'
gem 'rubocop', '~> 0.49.0'
gem 'rainbow', '< 2.0'
end

View File

@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem 'berkshelf', '~> 2.0'
gem 'chefspec', '~> 3.1'
gem 'foodcritic', '~> 3.0'
gem 'rubocop', '~> 0.12'
gem 'rubocop', '~> 0.49.0'
group :integration do
gem 'test-kitchen', '~> 1.2.1'