Skip to content

Commit d501be5

Browse files
committed
Merge hl7-eu/mapping into main
2 parents 3193aa3 + f17dfe7 commit d501be5

36 files changed

+2087
-1437
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build Container Images
2+
3+
on:
4+
push:
5+
tags:
6+
- "image/v*"
7+
paths-ignore:
8+
- "charts/**"
9+
pull_request:
10+
branches: [master]
11+
paths-ignore:
12+
- "charts/**"
13+
env:
14+
IMAGES: docker.io/hapiproject/hapi
15+
PLATFORMS: linux/amd64,linux/arm64/v8
16+
17+
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- name: Container meta for default (distroless) image
23+
id: docker_meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: ${{ env.IMAGES }}
27+
tags: |
28+
type=match,pattern=image/(.*),group=1,enable=${{github.event_name != 'pull_request'}}
29+
30+
31+
- name: Container meta for tomcat image
32+
id: docker_tomcat_meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: ${{ env.IMAGES }}
36+
tags: |
37+
type=match,pattern=image/(.*),group=1,enable=${{github.event_name != 'pull_request'}}
38+
flavor: |
39+
suffix=-tomcat,onlatest=true
40+
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v3
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
46+
47+
- name: Login to DockerHub
48+
uses: docker/login-action@v3
49+
if: github.event_name != 'pull_request'
50+
with:
51+
username: ${{ secrets.DOCKERHUB_USERNAME }}
52+
password: ${{ secrets.DOCKERHUB_TOKEN }}
53+
54+
- name: Cache Docker layers
55+
uses: actions/cache@v3
56+
with:
57+
path: /tmp/.buildx-cache
58+
key: ${{ runner.os }}-buildx-${{ github.sha }}
59+
restore-keys: |
60+
${{ runner.os }}-buildx-
61+
62+
- name: Build and push default (distroless) image
63+
id: docker_build
64+
uses: docker/build-push-action@v5
65+
with:
66+
cache-from: type=local,src=/tmp/.buildx-cache
67+
cache-to: type=local,dest=/tmp/.buildx-cache
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: ${{ steps.docker_meta.outputs.tags }}
70+
labels: ${{ steps.docker_meta.outputs.labels }}
71+
platforms: ${{ env.PLATFORMS }}
72+
target: default
73+
74+
- name: Build and push tomcat image
75+
id: docker_build_tomcat
76+
uses: docker/build-push-action@v5
77+
with:
78+
cache-from: type=local,src=/tmp/.buildx-cache
79+
cache-to: type=local,dest=/tmp/.buildx-cache
80+
push: ${{ github.event_name != 'pull_request' }}
81+
tags: ${{ steps.docker_tomcat_meta.outputs.tags }}
82+
labels: ${{ steps.docker_tomcat_meta.outputs.labels }}
83+
platforms: ${{ env.PLATFORMS }}
84+
target: tomcat

.github/workflows/smoke-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
distribution: zulu
3131

3232
- name: Build with Maven
33+
env:
34+
MAVEN_OPTS: -Xms256m -Xmx3g -XX:+UseG1GC
3335
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
3436

3537
- name: Docker Pull HTTP client

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ You can also use several profiles using coma-separated list of profiles in the v
175175
--e "--spring.profiles.active=qe,other"
176176
```
177177

178-
If you want to use this with docker-compose, here is an example file using a single external profile and a postgres container for database :
178+
If you want to use this with docker-compose, here is an example file using a single external profile and a postgres container for database :
179179

180180
```yaml
181181
version: "3.8"
@@ -209,14 +209,14 @@ volumes:
209209
hapi-fhir-postgres:
210210
```
211211
212-
You can retrieve the environment variables :
212+
You can retrieve the environment variables :
213213
214214
```
215215
SPRING_CONFIG_ADDITIONAL_LOCATION: "/profiles/"
216216
SPRING_PROFILES_ACTIVE: "qe"
217217
```
218218
219-
as well as the volume :
219+
as well as the volume :
220220
221221
```
222222
volumes:

docker-compose.test.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# docker-compose.test.yml
2+
# Test local des 3 conteneurs (R4, R5, mapping-service) depuis une seule image
3+
#
4+
# Usage :
5+
# docker compose -f docker-compose.test.yml build
6+
# docker compose -f docker-compose.test.yml up -d
7+
#
8+
# Endpoints :
9+
# - FHIR R4 : http://localhost:8080/fhir/metadata
10+
# - FHIR R5 : http://localhost:8081/fhir/metadata
11+
# - Mapping Service : http://localhost:8082/fhir/metadata
12+
13+
services:
14+
15+
# ──────────────────────────────────────────────
16+
# FHIR R4
17+
# ──────────────────────────────────────────────
18+
fhir-simulator-r4:
19+
build:
20+
context: .
21+
target: default
22+
container_name: fhir-simulator-r4
23+
restart: on-failure
24+
environment:
25+
HAPI_FHIR_FHIR_VERSION: "R4"
26+
SPRING_DATASOURCE_URL: "jdbc:postgresql://postgres-r4:5432/hapi_r4"
27+
SPRING_DATASOURCE_USERNAME: "admin"
28+
SPRING_DATASOURCE_PASSWORD: "admin"
29+
SPRING_DATASOURCE_DRIVERCLASSNAME: "org.postgresql.Driver"
30+
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: "ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect"
31+
ports:
32+
- "8080:8080"
33+
depends_on:
34+
postgres-r4:
35+
condition: service_healthy
36+
37+
postgres-r4:
38+
image: postgres:16-alpine
39+
container_name: postgres-r4
40+
restart: always
41+
environment:
42+
POSTGRES_DB: "hapi_r4"
43+
POSTGRES_USER: "admin"
44+
POSTGRES_PASSWORD: "admin"
45+
healthcheck:
46+
test: ["CMD-SHELL", "pg_isready -U admin -d hapi_r4"]
47+
interval: 10s
48+
timeout: 5s
49+
start_period: 5s
50+
retries: 5
51+
volumes:
52+
- postgres-r4-data:/var/lib/postgresql/data
53+
54+
# ──────────────────────────────────────────────
55+
# FHIR R5
56+
# ──────────────────────────────────────────────
57+
fhir-simulator-r5:
58+
build:
59+
context: .
60+
target: default
61+
container_name: fhir-simulator-r5
62+
restart: on-failure
63+
environment:
64+
HAPI_FHIR_FHIR_VERSION: "R5"
65+
SPRING_DATASOURCE_URL: "jdbc:postgresql://postgres-r5:5432/hapi_r5"
66+
SPRING_DATASOURCE_USERNAME: "admin"
67+
SPRING_DATASOURCE_PASSWORD: "admin"
68+
SPRING_DATASOURCE_DRIVERCLASSNAME: "org.postgresql.Driver"
69+
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: "ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect"
70+
ports:
71+
- "8081:8080"
72+
depends_on:
73+
postgres-r5:
74+
condition: service_healthy
75+
76+
postgres-r5:
77+
image: postgres:16-alpine
78+
container_name: postgres-r5
79+
restart: always
80+
environment:
81+
POSTGRES_DB: "hapi_r5"
82+
POSTGRES_USER: "admin"
83+
POSTGRES_PASSWORD: "admin"
84+
healthcheck:
85+
test: ["CMD-SHELL", "pg_isready -U admin -d hapi_r5"]
86+
interval: 10s
87+
timeout: 5s
88+
start_period: 5s
89+
retries: 5
90+
volumes:
91+
- postgres-r5-data:/var/lib/postgresql/data
92+
93+
# ──────────────────────────────────────────────
94+
# Mapping Service (R4 + moteur de mapping)
95+
# ──────────────────────────────────────────────
96+
mapping-service:
97+
build:
98+
context: .
99+
target: default
100+
container_name: mapping-service
101+
restart: on-failure
102+
environment:
103+
SPRING_PROFILES_ACTIVE: "mapping"
104+
SPRING_CONFIG_ADDITIONAL_LOCATION: "/profiles/"
105+
SPRING_DATASOURCE_URL: "jdbc:postgresql://postgres-mapping:5432/hapi_mapping"
106+
SPRING_DATASOURCE_USERNAME: "admin"
107+
SPRING_DATASOURCE_PASSWORD: "admin"
108+
SPRING_DATASOURCE_DRIVERCLASSNAME: "org.postgresql.Driver"
109+
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: "ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect"
110+
volumes:
111+
- ./profiles:/profiles:ro
112+
ports:
113+
- "8082:8080"
114+
depends_on:
115+
postgres-mapping:
116+
condition: service_healthy
117+
118+
postgres-mapping:
119+
image: postgres:16-alpine
120+
container_name: postgres-mapping
121+
restart: always
122+
environment:
123+
POSTGRES_DB: "hapi_mapping"
124+
POSTGRES_USER: "admin"
125+
POSTGRES_PASSWORD: "admin"
126+
healthcheck:
127+
test: ["CMD-SHELL", "pg_isready -U admin -d hapi_mapping"]
128+
interval: 10s
129+
timeout: 5s
130+
start_period: 5s
131+
retries: 5
132+
volumes:
133+
- postgres-mapping-data:/var/lib/postgresql/data
134+
135+
volumes:
136+
postgres-r4-data:
137+
postgres-r5-data:
138+
postgres-mapping-data:

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
SPRING_DATASOURCE_USERNAME: "admin"
88
SPRING_DATASOURCE_PASSWORD: "admin"
99
SPRING_DATASOURCE_DRIVERCLASSNAME: "org.postgresql.Driver"
10+
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
1011
SPRING_CONFIG_ADDITIONAL_LOCATION: "/profiles/"
1112
SPRING_PROFILES_ACTIVE: "mapping"
1213
volumes:

pom.xml

Lines changed: 29 additions & 6 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>4.2.0</clinical-reasoning.version>
9+
<clinical-reasoning.version>4.4.0</clinical-reasoning.version>
1010

1111
<!-- Plugins Versions -->
1212
<maven.failsafe.version>3.5.4</maven.failsafe.version>
@@ -21,6 +21,7 @@
2121
<commons.logging.version>1.3.5</commons.logging.version>
2222
<spring_boot_version>3.5.9</spring_boot_version>
2323
<postgresql.version>42.7.9</postgresql.version>
24+
<logback_version>1.5.25</logback_version>
2425
</properties>
2526

2627
<!-- one-liner to take you to the cloud with settings form the application.yaml file: -->
@@ -34,7 +35,7 @@
3435
<parent>
3536
<groupId>ca.uhn.hapi.fhir</groupId>
3637
<artifactId>hapi-fhir</artifactId>
37-
<version>8.6.1</version>
38+
<version>8.8.0</version>
3839
</parent>
3940

4041
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
@@ -211,12 +212,12 @@
211212
<dependency>
212213
<groupId>ch.qos.logback</groupId>
213214
<artifactId>logback-classic</artifactId>
214-
<version>1.5.19</version>
215+
<version>${logback_version}</version>
215216
</dependency>
216217
<dependency>
217218
<groupId>ch.qos.logback</groupId>
218219
<artifactId>logback-core</artifactId>
219-
<version>1.5.19</version>
220+
<version>${logback_version}</version>
220221
</dependency>
221222

222223
<!-- Needed for JEE/Servlet support -->
@@ -298,6 +299,30 @@
298299

299300

300301

302+
303+
<dependency>
304+
<groupId>org.json</groupId>
305+
<artifactId>json</artifactId>
306+
<version>20231013</version>
307+
</dependency>
308+
309+
<dependency>
310+
<groupId>ca.uhn.hapi</groupId>
311+
<artifactId>hapi-base</artifactId>
312+
<version>2.5.1</version>
313+
</dependency>
314+
315+
<dependency>
316+
<groupId>ca.uhn.hapi</groupId>
317+
<artifactId>hapi-structures-v21</artifactId>
318+
<version>2.5.1</version>
319+
</dependency>
320+
<dependency>
321+
<groupId>ca.uhn.hapi</groupId>
322+
<artifactId>hapi-structures-v251</artifactId>
323+
<version>2.5.1</version>
324+
</dependency>
325+
301326
<dependency>
302327
<groupId>org.json</groupId>
303328
<artifactId>json</artifactId>
@@ -365,13 +390,11 @@
365390
<dependency>
366391
<groupId>org.testcontainers</groupId>
367392
<artifactId>testcontainers-elasticsearch</artifactId>
368-
<version>2.0.2</version>
369393
<scope>test</scope>
370394
</dependency>
371395
<dependency>
372396
<groupId>org.testcontainers</groupId>
373397
<artifactId>testcontainers-junit-jupiter</artifactId>
374-
<version>2.0.2</version>
375398
<scope>test</scope>
376399
</dependency>
377400

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package ca.uhn.fhir.jpa.starter.common;
22

33
import ca.uhn.fhir.batch2.config.Batch2JobRegisterer;
4+
import ca.uhn.fhir.batch2.jobs.bulkmodify.reindex.ReindexProvider;
45
import ca.uhn.fhir.batch2.jobs.export.BulkDataExportProvider;
56
import ca.uhn.fhir.batch2.jobs.imprt.BulkDataImportProvider;
6-
import ca.uhn.fhir.batch2.jobs.reindex.ReindexProvider;
77
import ca.uhn.fhir.context.ConfigurationException;
88
import ca.uhn.fhir.context.FhirContext;
99
import ca.uhn.fhir.context.FhirVersionEnum;
@@ -50,11 +50,10 @@
5050
import ca.uhn.fhir.jpa.starter.annotations.OnImplementationGuidesPresent;
5151
import ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory;
5252
import ca.uhn.fhir.jpa.starter.elastic.ElasticsearchBootSvcImpl;
53+
import ca.uhn.fhir.jpa.starter.errorreport.ErrorReportingExceptionInterceptor;
5354
import ca.uhn.fhir.jpa.starter.ig.ExtendedPackageInstallationSpec;
5455
import ca.uhn.fhir.jpa.starter.ig.IImplementationGuideOperationProvider;
55-
import ca.uhn.fhir.jpa.starter.errorreport.ErrorReportingExceptionInterceptor;
5656
import ca.uhn.fhir.jpa.starter.mapping.provider.TransformProvider;
57-
import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper;
5857
import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor;
5958
import ca.uhn.fhir.jpa.util.ResourceCountCache;
6059
import ca.uhn.fhir.mdm.provider.MdmProviderLoader;
@@ -460,7 +459,7 @@ public RestfulServer restfulServer(
460459
fhirServer.registerProvider(binaryAccessProvider.get());
461460
}
462461

463-
errorReportingExceptionInterceptor.ifPresent(fhirServer::registerInterceptor);
462+
errorReportingExceptionInterceptor.ifPresent(fhirServer::registerInterceptor);
464463

465464
// Validation
466465

src/main/java/ca/uhn/fhir/jpa/starter/errorreport/ErrorReporter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
public interface ErrorReporter {
44
void reportException(Throwable t);
5+
56
void reportMessage(String message);
67
}

src/main/java/ca/uhn/fhir/jpa/starter/errorreport/ErrorReportingExceptionInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ public boolean handleException(RequestDetails requestDetails, BaseServerResponse
2020
errorReporter.reportException(ex);
2121
return true;
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)