Skip to content

Commit 2ba89af

Browse files
committed
Merge remote-tracking branch 'origin/master' into rel_8_3_tracking
2 parents 3103c00 + 8224cae commit 2ba89af

36 files changed

+304
-304
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ local.properties
124124
.factorypath
125125
.project
126126
.settings
127-
.springBeans
128127
.sts4-cache
129128

130129
# Code Recommenders

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ HAPI looks in the environment variables for properties in the [application.yaml]
5151

5252
### Configuration via overridden application.yaml file and using Docker
5353

54-
You can customize HAPI by telling HAPI to look for the configuration file in a different location, eg.:
54+
You can customize HAPI by telling HAPI to look for the configuration file in a different location, e.g.:
5555

5656
```
5757
docker run -p 8090:8080 -v $(pwd)/yourLocalFolder:/configs -e "--spring.config.location=file:///configs/another.application.yaml" hapiproject/hapi:latest
@@ -237,7 +237,7 @@ The Server will then be accessible at http://localhost:8888/fhir and the Capabil
237237
```bash
238238
mvn clean spring-boot:run -Pboot
239239
```
240-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following:
240+
Server will then be accessible at http://localhost:8080/ and e.g. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following:
241241

242242
```yaml
243243
tester:
@@ -253,7 +253,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
253253
```bash
254254
mvn clean package spring-boot:repackage -DskipTests=true -Pboot && java -jar target/ROOT.war
255255
```
256-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
256+
Server will then be accessible at http://localhost:8080/ and e.g. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
257257

258258
```yaml
259259
tester:
@@ -268,7 +268,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
268268
```bash
269269
mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 distroless-hapi
270270
```
271-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
271+
Server will then be accessible at http://localhost:8080/ and e.g. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
272272

273273
```yaml
274274
tester:
@@ -284,7 +284,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
284284
```bash
285285
./build-docker-image.sh && docker run -p 8080:8080 hapi-fhir/hapi-fhir-jpaserver-starter:latest
286286
```
287-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
287+
Server will then be accessible at http://localhost:8080/ and e.g. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
288288

289289
```yaml
290290
tester:
@@ -384,7 +384,7 @@ Several template files that can be customized are found in the following directo
384384

385385
Using the Maven-Embedded Jetty method above is convenient, but it is not a good solution if you want to leave the server running in the background.
386386

387-
Most people who are using HAPI FHIR JPA as a server that is accessible to other people (whether internally on your network or publically hosted) will do so using an Application Server, such as [Apache Tomcat](http://tomcat.apache.org/) or [Jetty](https://www.eclipse.org/jetty/). Note that any Servlet 3.0+ compatible Web Container will work (e.g Wildfly, Websphere, etc.).
387+
Most people who are using HAPI FHIR JPA as a server that is accessible to other people (whether internally on your network or publicly hosted) will do so using an Application Server, such as [Apache Tomcat](http://tomcat.apache.org/) or [Jetty](https://www.eclipse.org/jetty/). Note that any Servlet 3.0+ compatible Web Container will work (e.g. Wildfly, Websphere, etc.).
388388

389389
Tomcat is very popular, so it is a good choice simply because you will be able to find many tutorials online. Jetty is a great alternative due to its fast startup time and good overall performance.
390390

@@ -402,7 +402,7 @@ Again, browse to the following link to use the server (note that the port 8080 m
402402

403403
You will then be able to access the JPA server e.g. using http://localhost:8080/fhir/metadata.
404404

405-
If you would like it to be hosted at eg. hapi-fhir-jpaserver, eg. http://localhost:8080/hapi-fhir-jpaserver/ or http://localhost:8080/hapi-fhir-jpaserver/fhir/metadata - then rename the WAR file to ```hapi-fhir-jpaserver.war``` and adjust the overlay configuration accordingly e.g.
405+
If you would like it to be hosted at e.g. hapi-fhir-jpaserver, e.g. http://localhost:8080/hapi-fhir-jpaserver/ or http://localhost:8080/hapi-fhir-jpaserver/fhir/metadata - then rename the WAR file to ```hapi-fhir-jpaserver.war``` and adjust the overlay configuration accordingly e.g.
406406

407407
```yaml
408408
tester:
@@ -525,7 +525,7 @@ Set `hapi.fhir.store_resource_in_lucene_index_enabled` in the [application.yaml]
525525

526526
## Changing cached search results time
527527

528-
It is possible to change the cached search results time. The option `reuse_cached_search_results_millis` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) is 6000 miliseconds by default.
528+
It is possible to change the cached search results time. The option `reuse_cached_search_results_millis` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) is 6000 milliseconds by default.
529529
Set `reuse_cached_search_results_millis: -1` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to ignore the cache time every search.
530530

531531
## Build the distroless variant of the image (for lower footprint and improved security)

charts/hapi-fhir-jpaserver/Chart.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
repository: oci://registry-1.docker.io/bitnamicharts
1515
version: 2.31.3
1616
appVersion: 8.2.0
17-
version: 0.20.0
17+
version: 0.20.1
1818
annotations:
1919
artifacthub.io/license: Apache-2.0
2020
artifacthub.io/containsSecurityUpdates: "false"
@@ -27,14 +27,4 @@ annotations:
2727
# When using the list of objects option the valid supported kinds are
2828
# added, changed, deprecated, removed, fixed, and security.
2929
- kind: changed
30-
description: "updated postgresql sub-chart to 16.7.11"
31-
- kind: changed
32-
description: "updated common sub-chart to 2.31.3"
33-
- kind: changed
34-
description: "updated curlimages/curl to 8.14.1"
35-
- kind: changed
36-
description: "updated hapiproject/hapi to v8.2.0-1"
37-
- kind: changed
38-
description: "use ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect dialect"
39-
- kind: changed
40-
description: "made the init container waiting for the database to be ready configurable"
30+
description: "fixed typo in README.md"

charts/hapi-fhir-jpaserver/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HAPI FHIR JPA Server Starter Helm Chart
22

3-
![Version: 0.20.0](https://img.shields.io/badge/Version-0.20.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.2.0](https://img.shields.io/badge/AppVersion-8.2.0-informational?style=flat-square)
3+
![Version: 0.20.1](https://img.shields.io/badge/Version-0.20.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.2.0](https://img.shields.io/badge/AppVersion-8.2.0-informational?style=flat-square)
44

55
This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes environment.
66

@@ -98,7 +98,7 @@ INFO[2021-11-20T12:38:04Z] Found Chart directories [charts/hapi-fhir-jpaserver]
9898
INFO[2021-11-20T12:38:04Z] Generating README Documentation for chart /usr/src/app/charts/hapi-fhir-jpaserver
9999
```
100100

101-
## Enable Distributed Tracing based on the OpenTelemtry Java Agent
101+
## Enable Distributed Tracing based on the OpenTelemetry Java Agent
102102

103103
The container image includes the [OpenTelemetry Java agent JAR](https://github.com/open-telemetry/opentelemetry-java-instrumentation)
104104
which can be used to enable distributed tracing. It can be configured entirely using environment variables,

charts/hapi-fhir-jpaserver/README.md.gotmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ INFO[2021-11-20T12:38:04Z] Found Chart directories [charts/hapi-fhir-jpaserver]
2727
INFO[2021-11-20T12:38:04Z] Generating README Documentation for chart /usr/src/app/charts/hapi-fhir-jpaserver
2828
```
2929

30-
## Enable Distributed Tracing based on the OpenTelemtry Java Agent
30+
## Enable Distributed Tracing based on the OpenTelemetry Java Agent
3131

3232
The container image includes the [OpenTelemetry Java agent JAR](https://github.com/open-telemetry/opentelemetry-java-instrumentation)
3333
which can be used to enable distributed tracing. It can be configured entirely using environment variables,

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<properties>
77
<java.version>17</java.version>
88
<hapi.fhir.jpa.server.starter.revision>1</hapi.fhir.jpa.server.starter.revision>
9-
<clinical-reasoning.version>3.23.0</clinical-reasoning.version>
9+
<clinical-reasoning.version>3.24.0</clinical-reasoning.version>
1010
</properties>
1111

1212
<!-- one-liner to take you to the cloud with settings form the application.yaml file: -->
@@ -195,7 +195,7 @@
195195
<scope>provided</scope>
196196
</dependency>
197197

198-
<!-- If you are using HAPI narrative generation, you will need to include Thymeleaf as well. Otherwise the following can be omitted. -->
198+
<!-- If you are using HAPI narrative generation, you will need to include Thymeleaf as well. Otherwise, the following can be omitted. -->
199199
<dependency>
200200
<groupId>org.thymeleaf</groupId>
201201
<artifactId>thymeleaf</artifactId>

src/main/java/ca/uhn/fhir/jpa/starter/Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void main(String[] args) {
4545

4646
SpringApplication.run(Application.class, args);
4747

48-
// Server is now accessible at eg. http://localhost:8080/fhir/metadata
48+
// Server is now accessible at e.g. http://localhost:8080/fhir/metadata
4949
// UI is now accessible at http://localhost:8080/
5050
}
5151

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/CdsHooksServlet.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@
2222
import org.springframework.beans.factory.annotation.Qualifier;
2323

2424
import java.io.IOException;
25+
import java.io.Serial;
2526
import java.util.stream.Collectors;
2627

2728
import static org.opencds.cqf.fhir.cr.hapi.config.test.TestCdsHooksConfig.CDS_HOOKS_OBJECT_MAPPER_FACTORY;
2829

2930
@Configurable
3031
public class CdsHooksServlet extends HttpServlet {
3132
private static final Logger logger = LoggerFactory.getLogger(CdsHooksServlet.class);
33+
34+
@Serial
3235
private static final long serialVersionUID = 1L;
3336

3437
@Autowired

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/ModuleConfigurationPrefetchSvc.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,8 @@ private boolean resourceExists(IBaseResource resource) {
179179
return true;
180180
}
181181
if (resource instanceof IBaseBundle) {
182-
return BundleUtil.toListOfEntries(fhirContext, (IBaseBundle) resource)
183-
.size()
184-
> 0;
182+
return !BundleUtil.toListOfEntries(fhirContext, (IBaseBundle) resource)
183+
.isEmpty();
185184
}
186185
return false;
187186
}

src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -41,37 +41,43 @@ public class FhirServerConfigCommon {
4141
private static final Logger ourLog = LoggerFactory.getLogger(FhirServerConfigCommon.class);
4242

4343
public FhirServerConfigCommon(AppProperties appProperties) {
44-
ourLog.info("Server configured to " + (appProperties.getAllow_contains_searches() ? "allow" : "deny")
45-
+ " contains searches");
46-
ourLog.info("Server configured to " + (appProperties.getAllow_multiple_delete() ? "allow" : "deny")
47-
+ " multiple deletes");
48-
ourLog.info("Server configured to " + (appProperties.getAllow_external_references() ? "allow" : "deny")
49-
+ " external references");
50-
ourLog.info("Server configured to " + (appProperties.getDao_scheduling_enabled() ? "enable" : "disable")
51-
+ " DAO scheduling");
52-
ourLog.info("Server configured to " + (appProperties.getDelete_expunge_enabled() ? "enable" : "disable")
53-
+ " delete expunges");
5444
ourLog.info(
55-
"Server configured to " + (appProperties.getExpunge_enabled() ? "enable" : "disable") + " expunges");
45+
"Server configured to {} contains searches",
46+
appProperties.getAllow_contains_searches() ? "allow" : "deny");
5647
ourLog.info(
57-
"Server configured to " + (appProperties.getAllow_override_default_search_params() ? "allow" : "deny")
58-
+ " overriding default search params");
59-
ourLog.info("Server configured to "
60-
+ (appProperties.getAuto_create_placeholder_reference_targets() ? "allow" : "disable")
61-
+ " auto-creating placeholder references");
48+
"Server configured to {} multiple deletes",
49+
appProperties.getAllow_multiple_delete() ? "allow" : "deny");
50+
ourLog.info(
51+
"Server configured to {} external references",
52+
appProperties.getAllow_external_references() ? "allow" : "deny");
53+
ourLog.info(
54+
"Server configured to {} DAO scheduling",
55+
appProperties.getDao_scheduling_enabled() ? "enable" : "disable");
56+
ourLog.info(
57+
"Server configured to {} delete expunges",
58+
appProperties.getDelete_expunge_enabled() ? "enable" : "disable");
59+
ourLog.info("Server configured to {} expunges", appProperties.getExpunge_enabled() ? "enable" : "disable");
60+
ourLog.info(
61+
"Server configured to {} overriding default search params",
62+
appProperties.getAllow_override_default_search_params() ? "allow" : "deny");
63+
ourLog.info(
64+
"Server configured to {} auto-creating placeholder references",
65+
appProperties.getAuto_create_placeholder_reference_targets() ? "allow" : "disable");
6266
ourLog.info(
6367
"Server configured to auto-version references at paths {}",
6468
appProperties.getAuto_version_reference_at_paths());
6569

6670
if (appProperties.getSubscription().getEmail() != null) {
6771
AppProperties.Subscription.Email email =
6872
appProperties.getSubscription().getEmail();
69-
ourLog.info("Server is configured to enable email with host '" + email.getHost() + "' and port "
70-
+ email.getPort());
71-
ourLog.info("Server will use '" + email.getFrom() + "' as the from email address");
73+
ourLog.info(
74+
"Server is configured to enable email with host '{}' and port {}",
75+
email.getHost(),
76+
email.getPort());
77+
ourLog.info("Server will use '{}' as the from email address", email.getFrom());
7278

7379
if (!Strings.isNullOrEmpty(email.getUsername())) {
74-
ourLog.info("Server is configured to use username '" + email.getUsername() + "' for email");
80+
ourLog.info("Server is configured to use username '{}' for email", email.getUsername());
7581
}
7682

7783
if (!Strings.isNullOrEmpty(email.getPassword())) {
@@ -91,17 +97,19 @@ public FhirServerConfigCommon(AppProperties appProperties) {
9197
ourLog.info("Indexed on contained resource enabled");
9298
}
9399

94-
ourLog.info("Server configured to " + (appProperties.getPre_expand_value_sets() ? "enable" : "disable")
95-
+ " value set pre-expansion");
96100
ourLog.info(
97-
"Server configured to " + (appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable")
98-
+ " value set pre-expansion task");
99-
ourLog.info("Server configured for pre-expand value set default count of "
100-
+ (appProperties.getPre_expand_value_sets_default_count().toString()));
101-
ourLog.info("Server configured for pre-expand value set max count of "
102-
+ (appProperties.getPre_expand_value_sets_max_count().toString()));
103-
ourLog.info("Server configured for maximum expansion size of "
104-
+ (appProperties.getMaximum_expansion_size().toString()));
101+
"Server configured to {} value set pre-expansion",
102+
appProperties.getPre_expand_value_sets() ? "enable" : "disable");
103+
ourLog.info(
104+
"Server configured to {} value set pre-expansion task",
105+
appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable");
106+
ourLog.info(
107+
"Server configured for pre-expand value set default count of {}",
108+
appProperties.getPre_expand_value_sets_default_count());
109+
ourLog.info(
110+
"Server configured for pre-expand value set max count of {}",
111+
appProperties.getPre_expand_value_sets_max_count());
112+
ourLog.info("Server configured for maximum expansion size of {}", appProperties.getMaximum_expansion_size());
105113
}
106114

107115
@Bean
@@ -194,8 +202,9 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
194202

195203
Integer maxFetchSize = appProperties.getMax_page_size();
196204
jpaStorageSettings.setFetchSizeDefaultMaximum(maxFetchSize);
197-
ourLog.info("Server configured to have a maximum fetch size of "
198-
+ (maxFetchSize == Integer.MAX_VALUE ? "'unlimited'" : maxFetchSize));
205+
ourLog.info(
206+
"Server configured to have a maximum fetch size of {}",
207+
maxFetchSize == Integer.MAX_VALUE ? "'unlimited'" : maxFetchSize);
199208

200209
Long reuseCachedSearchResultsMillis = appProperties.getReuse_cached_search_results_millis();
201210
jpaStorageSettings.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis);
@@ -237,19 +246,21 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
237246
// Set and/or recommend default Server ID Strategy of UUID when using the ANY Client ID Strategy
238247
if (appProperties.getClient_id_strategy() == JpaStorageSettings.ClientIdStrategyEnum.ANY) {
239248
if (appProperties.getServer_id_strategy() == null) {
240-
ourLog.info("Defaulting server to use '" + JpaStorageSettings.IdStrategyEnum.UUID
241-
+ "' Server ID Strategy when using the '" + JpaStorageSettings.ClientIdStrategyEnum.ANY
242-
+ "' Client ID Strategy");
249+
ourLog.info(
250+
"Defaulting server to use '{}' Server ID Strategy when using the '{}' Client ID Strategy",
251+
JpaStorageSettings.IdStrategyEnum.UUID,
252+
JpaStorageSettings.ClientIdStrategyEnum.ANY);
243253
appProperties.setServer_id_strategy(JpaStorageSettings.IdStrategyEnum.UUID);
244254
} else if (appProperties.getServer_id_strategy() != JpaStorageSettings.IdStrategyEnum.UUID) {
245-
ourLog.warn("WARNING: '" + JpaStorageSettings.IdStrategyEnum.UUID
246-
+ "' Server ID Strategy is highly recommended when using the '"
247-
+ JpaStorageSettings.ClientIdStrategyEnum.ANY + "' Client ID Strategy");
255+
ourLog.warn(
256+
"WARNING: '{}' Server ID Strategy is highly recommended when using the '{}' Client ID Strategy",
257+
JpaStorageSettings.IdStrategyEnum.UUID,
258+
JpaStorageSettings.ClientIdStrategyEnum.ANY);
248259
}
249260
}
250261
if (appProperties.getServer_id_strategy() != null) {
251262
jpaStorageSettings.setResourceServerIdStrategy(appProperties.getServer_id_strategy());
252-
ourLog.info("Server configured to use '" + appProperties.getServer_id_strategy() + "' Server ID Strategy");
263+
ourLog.info("Server configured to use '{}' Server ID Strategy", appProperties.getServer_id_strategy());
253264
}
254265

255266
// to Disable the Resource History

0 commit comments

Comments
 (0)