Skip to content

Commit 96f9089

Browse files
authored
Merge branch 'master' into expose-search-prefetch-thresholds
2 parents f4695b5 + 3066622 commit 96f9089

File tree

7 files changed

+108
-26
lines changed

7 files changed

+108
-26
lines changed

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,7 @@
4343
<dependencyManagement>
4444
<dependencies>
4545

46-
<!-- Temporarily override CR depedencies for debugging -->
47-
<!-- <dependency>-->
48-
<!-- <groupId>org.opencds.cqf.fhir</groupId>-->
49-
<!-- <artifactId>cqf-fhir-bom</artifactId>-->
50-
<!-- <version>3.4.0</version>-->
51-
<!-- <type>pom</type>-->
52-
<!-- <scope>import</scope>-->
53-
<!-- </dependency>-->
54-
<dependency>
46+
<dependency>
5547
<groupId>org.glassfish.jaxb</groupId>
5648
<artifactId>jaxb-runtime</artifactId>
5749
<version>2.3.8</version>
@@ -364,6 +356,14 @@
364356
<version>1.13.3</version>
365357
</dependency>
366358

359+
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus-simpleclient -->
360+
<dependency>
361+
<groupId>io.micrometer</groupId>
362+
<artifactId>micrometer-registry-prometheus-simpleclient</artifactId>
363+
<version>1.13.3</version>
364+
</dependency>
365+
366+
367367
<dependency>
368368
<groupId>com.zaxxer</groupId>
369369
<artifactId>HikariCP</artifactId>

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public class AppProperties {
103103
private final List<String> custom_interceptor_classes = new ArrayList<>();
104104

105105
private final List<String> custom_provider_classes = new ArrayList<>();
106+
private Boolean upliftedRefchains_enabled = false;
106107

107108
private List<Integer> search_prefetch_thresholds = new ArrayList<>();
108109

@@ -653,8 +654,15 @@ public void setSearch_prefetch_thresholds(List<Integer> thePrefetchThresholds)
653654
this.search_prefetch_thresholds = thePrefetchThresholds;
654655
}
655656

657+
public boolean getUpliftedRefchains_enabled() {
658+
return upliftedRefchains_enabled;
659+
}
660+
661+
public void setUpliftedRefchains_enabled(boolean upliftedRefchains_enabled) {
662+
this.upliftedRefchains_enabled = upliftedRefchains_enabled;
663+
}
656664

657-
public static class Cors {
665+
public static class Cors {
658666
private Boolean allow_Credentials = true;
659667
private List<String> allowed_origin = List.of("*");
660668

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
149149
jpaStorageSettings.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled());
150150
jpaStorageSettings.setExpungeEnabled(appProperties.getExpunge_enabled());
151151
jpaStorageSettings.setLanguageSearchParameterEnabled(appProperties.getLanguage_search_parameter_enabled());
152+
jpaStorageSettings.setIndexOnUpliftedRefchains(appProperties.getUpliftedRefchains_enabled());
152153

153154

154155
if (!appProperties.getSearch_prefetch_thresholds().isEmpty()) {

src/main/resources/application.yaml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
#Uncomment the "servlet" and "context-path" lines below to make the fhir endpoint available at /example/path/fhir instead of the default value of /fhir
22
server:
3-
# servlet:
4-
# context-path: /example/path
3+
# servlet:
4+
# context-path: /example/path
55
port: 8080
66
#Adds the option to go to eg. http://localhost:8080/actuator/health for seeing the running configuration
77
#see https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints
88
management:
9+
#The following configuration will enable the actuator endpoints at /actuator/health, /actuator/info, /actuator/prometheus, /actuator/metrics. For security purposes, only /actuator/health is enabled by default.
10+
endpoints:
11+
enabled-by-default: false
12+
web:
13+
exposure:
14+
include: 'health' # or e.g. 'info,health,prometheus,metrics' or '*' for all'
915
endpoint:
10-
endpoints:
11-
enabled-by-default: false
12-
web:
13-
exposure:
14-
include: health,prometheus
16+
info:
17+
enabled: true
18+
metrics:
19+
enabled: true
1520
health:
1621
enabled: true
1722
probes:
1823
enabled: true
19-
livenessState:
20-
enabled: true
21-
readinessState:
22-
enabled: true
24+
group:
25+
liveness:
26+
include:
27+
- livenessState
28+
- readinessState
2329
prometheus:
2430
enabled: true
25-
metrics:
26-
export:
27-
enabled: true
28-
31+
prometheus:
32+
metrics:
33+
export:
34+
enabled: true
2935
spring:
3036
main:
3137
allow-circular-references: true
@@ -184,6 +190,7 @@ hapi:
184190
# enable_index_missing_fields: false
185191
# enable_index_of_type: true
186192
# enable_index_contained_resource: false
193+
# upliftedRefchains_enabled: true
187194
# resource_dbhistory_enabled: false
188195
### !!Extended Lucene/Elasticsearch Indexing is still a experimental feature, expect some features (e.g. _total=accurate) to not work as expected!!
189196
### more information here: https://hapifhir.io/hapi-fhir/docs/server_jpa/elastic.html

src/main/resources/cds.application.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,32 @@ server:
66
#Adds the option to go to eg. http://localhost:8080/actuator/health for seeing the running configuration
77
#see https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints
88
management:
9+
#The following configuration will enable the actuator endpoints at /actuator/health, /actuator/info, /actuator/prometheus, /actuator/metrics. For security purposes, only /actuator/health is enabled by default.
910
endpoints:
11+
enabled-by-default: false
1012
web:
1113
exposure:
12-
include: "health,prometheus"
14+
include: 'health' # or e.g. 'info,health,prometheus,metrics' or '*' for all'
15+
endpoint:
16+
info:
17+
enabled: true
18+
metrics:
19+
enabled: true
20+
health:
21+
enabled: true
22+
probes:
23+
enabled: true
24+
group:
25+
liveness:
26+
include:
27+
- livenessState
28+
- readinessState
29+
prometheus:
30+
enabled: true
31+
prometheus:
32+
metrics:
33+
export:
34+
enabled: true
1335
spring:
1436
main:
1537
allow-circular-references: true

src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
import jakarta.websocket.ContainerProvider;
1414
import jakarta.websocket.Session;
1515
import jakarta.websocket.WebSocketContainer;
16+
import org.apache.http.client.methods.CloseableHttpResponse;
17+
import org.apache.http.client.methods.HttpGet;
18+
import org.apache.http.impl.client.CloseableHttpClient;
19+
import org.apache.http.impl.client.HttpClients;
1620
import org.hl7.fhir.instance.model.api.IBaseResource;
1721
import org.hl7.fhir.instance.model.api.IIdType;
1822
import org.hl7.fhir.r4.model.Bundle;
@@ -29,6 +33,8 @@
2933
import org.junit.jupiter.api.BeforeEach;
3034
import org.junit.jupiter.api.Order;
3135
import org.junit.jupiter.api.Test;
36+
import org.junit.jupiter.params.ParameterizedTest;
37+
import org.junit.jupiter.params.provider.ValueSource;
3238
import org.springframework.beans.factory.annotation.Autowired;
3339
import org.springframework.boot.test.context.SpringBootTest;
3440
import org.springframework.boot.test.web.server.LocalServerPort;
@@ -306,6 +312,17 @@ private int activeSubscriptionCount() {
306312
.size();
307313
}
308314

315+
@ParameterizedTest
316+
@ValueSource(strings = {"prometheus", "health", "metrics", "info"})
317+
void testActuatorEndpointExists(String endpoint) throws IOException {
318+
319+
CloseableHttpClient httpclient = HttpClients.createDefault();
320+
CloseableHttpResponse response = httpclient.execute(new HttpGet("http://localhost:" + port + "/actuator/" + endpoint));
321+
int statusCode = response.getStatusLine().getStatusCode();
322+
assertEquals(200, statusCode);
323+
324+
}
325+
309326
@BeforeEach
310327
void beforeEach() {
311328

src/test/resources/application.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
management:
2+
#The following configuration will enable the actuator endpoints at /actuator/health, /actuator/info, /actuator/prometheus
3+
endpoints:
4+
enabled-by-default: false
5+
web:
6+
exposure:
7+
include: 'info,health,prometheus,metrics' # or '*' for all'
8+
endpoint:
9+
info:
10+
enabled: true
11+
metrics:
12+
enabled: true
13+
health:
14+
enabled: true
15+
probes:
16+
enabled: true
17+
group:
18+
liveness:
19+
include:
20+
- livenessState
21+
- readinessState
22+
prometheus:
23+
enabled: true
24+
prometheus:
25+
metrics:
26+
export:
27+
enabled: true
128
spring:
229
main:
330
allow-circular-references: true

0 commit comments

Comments
 (0)