Skip to content

Commit 74c9d6e

Browse files
committed
Implement FHIR Types in Java
1 parent 5dcda54 commit 74c9d6e

File tree

302 files changed

+20100
-7673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+20100
-7673
lines changed

.github/distributed-test/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ services:
122122
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
123123
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
124124
DB_BLOCK_CACHE_SIZE: "128"
125-
DB_RESOURCE_CACHE_SIZE: "100000"
126125
DB_RESOURCE_INDEXER_THREADS: "8"
127126
ALLOW_MULTIPLE_DELETE: "true"
128127
ENABLE_INTERACTION_DELETE_HISTORY: "true"
@@ -156,7 +155,6 @@ services:
156155
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
157156
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
158157
DB_BLOCK_CACHE_SIZE: "128"
159-
DB_RESOURCE_CACHE_SIZE: "100000"
160158
DB_RESOURCE_INDEXER_THREADS: "8"
161159
ALLOW_MULTIPLE_DELETE: "true"
162160
ENABLE_INTERACTION_DELETE_HISTORY: "true"

.github/scripts/age-test.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash -e
2+
3+
#
4+
# This script test that the complex data type Age works as expected
5+
#
6+
7+
script_dir="$(dirname "$(readlink -f "$0")")"
8+
. "$script_dir/util.sh"
9+
10+
base="http://localhost:8080/fhir"
11+
12+
echo "ℹ️ Age as polymorph data element in Condition"
13+
14+
condition() {
15+
cat <<END
16+
{
17+
"resourceType": "Condition",
18+
"onsetAge": {
19+
"value": 42,
20+
"unit": "year",
21+
"system": "http://unitsofmeasure.org",
22+
"code": "a"
23+
}
24+
}
25+
END
26+
}
27+
28+
response="$(condition | create "$base/Condition")"
29+
30+
test "age value" "$(echo "$response" | jq -r .onsetAge.value)" "42"
31+
test "age unit" "$(echo "$response" | jq -r .onsetAge.unit)" "year"
32+
33+
echo "ℹ️ Age as extension value"
34+
35+
patient() {
36+
cat <<END
37+
{
38+
"resourceType": "Patient",
39+
"extension": [
40+
{
41+
"url": "foo",
42+
"valueAge": {
43+
"value": 42,
44+
"unit": "year",
45+
"system": "http://unitsofmeasure.org",
46+
"code": "a"
47+
}
48+
}
49+
]
50+
}
51+
END
52+
}
53+
54+
response="$(patient | create "$base/Patient")"
55+
56+
test "age value" "$(echo "$response" | jq -r .extension[0].valueAge.value)" "42"
57+
test "age unit" "$(echo "$response" | jq -r .extension[0].valueAge.unit)" "year"

.github/scripts/count-test.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash -e
2+
3+
#
4+
# This script test that the complex data type Count works as expected
5+
#
6+
7+
script_dir="$(dirname "$(readlink -f "$0")")"
8+
. "$script_dir/util.sh"
9+
10+
base="http://localhost:8080/fhir"
11+
12+
echo "ℹ️ Count as extension value"
13+
14+
patient() {
15+
cat <<END
16+
{
17+
"resourceType": "Patient",
18+
"extension": [
19+
{
20+
"url": "foo",
21+
"valueCount": {
22+
"value": 23,
23+
"system": "http://unitsofmeasure.org",
24+
"code": "1"
25+
}
26+
}
27+
]
28+
}
29+
END
30+
}
31+
32+
response="$(patient | create "$base/Patient")"
33+
34+
test "count value" "$(echo "$response" | jq -r .extension[0].valueCount.value)" "23"
35+
test "count code" "$(echo "$response" | jq -r .extension[0].valueCount.code)" "1"

.github/scripts/distance-test.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash -e
2+
3+
#
4+
# This script test that the complex data type Distance works as expected
5+
#
6+
7+
script_dir="$(dirname "$(readlink -f "$0")")"
8+
. "$script_dir/util.sh"
9+
10+
base="http://localhost:8080/fhir"
11+
12+
echo "ℹ️ Distance as extension value"
13+
14+
patient() {
15+
cat <<END
16+
{
17+
"resourceType": "Patient",
18+
"extension": [
19+
{
20+
"url": "foo",
21+
"valueDistance": {
22+
"value": 23,
23+
"unit": "km",
24+
"system": "http://unitsofmeasure.org",
25+
"code": "km"
26+
}
27+
}
28+
]
29+
}
30+
END
31+
}
32+
33+
response="$(patient | create "$base/Patient")"
34+
35+
test "distance value" "$(echo "$response" | jq -r .extension[0].valueDistance.value)" "23"
36+
test "distance unit" "$(echo "$response" | jq -r .extension[0].valueDistance.unit)" "km"

.github/scripts/duration-test.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash -e
2+
3+
#
4+
# This script test that the complex data type Duration works as expected
5+
#
6+
7+
script_dir="$(dirname "$(readlink -f "$0")")"
8+
. "$script_dir/util.sh"
9+
10+
base="http://localhost:8080/fhir"
11+
12+
echo "ℹ️ Duration as polymorph data element in ActivityDefinition"
13+
14+
activity_definition() {
15+
cat <<END
16+
{
17+
"resourceType": "ActivityDefinition",
18+
"timingDuration": {
19+
"value": 23,
20+
"unit": "second",
21+
"system": "http://unitsofmeasure.org",
22+
"code": "s"
23+
}
24+
}
25+
END
26+
}
27+
28+
response="$(activity_definition | create "$base/ActivityDefinition")"
29+
30+
test "duration value" "$(echo "$response" | jq -r .timingDuration.value)" "23"
31+
test "duration unit" "$(echo "$response" | jq -r .timingDuration.unit)" "second"
32+
33+
echo "ℹ️ Duration as extension value"
34+
35+
patient() {
36+
cat <<END
37+
{
38+
"resourceType": "Patient",
39+
"extension": [
40+
{
41+
"url": "foo",
42+
"valueDuration": {
43+
"value": 23,
44+
"unit": "second",
45+
"system": "http://unitsofmeasure.org",
46+
"code": "s"
47+
}
48+
}
49+
]
50+
}
51+
END
52+
}
53+
54+
response="$(patient | create "$base/Patient")"
55+
56+
test "duration value" "$(echo "$response" | jq -r .extension[0].valueDuration.value)" "23"
57+
test "duration unit" "$(echo "$response" | jq -r .extension[0].valueDuration.unit)" "second"

.github/workflows/build.yml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,39 @@ jobs:
256256
- name: Test
257257
run: make -C modules/${{ matrix.module }} test-slow
258258

259+
test-mem-size:
260+
runs-on: ubuntu-24.04
261+
262+
steps:
263+
- name: Setup Java
264+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
265+
with:
266+
distribution: 'temurin'
267+
java-version: '25'
268+
269+
- name: Setup Clojure
270+
uses: DeLaGuardo/setup-clojure@3fe9b3ae632c6758d0b7757b0838606ef4287b08 # 13.4
271+
with:
272+
cli: '1.12.3.1577'
273+
274+
- name: Check out Git repository
275+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
276+
277+
- name: Cache Local Maven Repo
278+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
279+
with:
280+
path: ~/.m2/repository
281+
key: ${{ runner.os }}-temurin-25-maven-fhir-structure-${{ hashFiles('modules/fhir-structure/deps.edn') }}
282+
283+
- name: Cache Clojure GitLibs
284+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
285+
with:
286+
path: ~/.gitlibs
287+
key: ${{ runner.os }}-gitlibs-fhir-structure-${{ hashFiles('modules/fhir-structure/deps.edn') }}
288+
289+
- name: Test
290+
run: make -C modules/fhir-structure test-mem-size
291+
259292
# Special treatment, because it runs much longer as the other modules.
260293
test-coverage-db:
261294
strategy:
@@ -656,7 +689,7 @@ jobs:
656689
run: .github/scripts/evaluate-measure.sh q36-parameter 86
657690

658691
- name: Check Bloom Filter
659-
run: .github/scripts/check-bloom-filter.sh fbb79d85457069c8e1926c949690deecd60d751942d5b0cd0b61c08e6029224c 86
692+
run: .github/scripts/check-bloom-filter.sh 017a0f079c2a76a731db3cdf68637afc8e4fac34409b032b5ac93958923e0501 86
660693

661694
- name: Evaluate CQL Query 36 - Subject List
662695
run: .github/scripts/evaluate-measure-subject-list.sh q36-parameter 86
@@ -668,7 +701,7 @@ jobs:
668701
run: .github/scripts/evaluate-measure.sh q37-overlaps 24
669702

670703
- name: Check Bloom Filter
671-
run: .github/scripts/check-bloom-filter.sh 9fe779d821d7647831331b490939aa0cdf314d76c9b2a9518ffaf559353db043 24
704+
run: .github/scripts/check-bloom-filter.sh e7d79fd90bce0a8c5abad06027e3b6d57b448076ff41fa36827e5e3b65ca10c2 24
672705

673706
- name: Evaluate CQL Query 37 - Blazectl
674707
run: .github/scripts/evaluate-measure-blazectl.sh q37-overlaps 24
@@ -1318,6 +1351,18 @@ jobs:
13181351
- name: Control Character Handling
13191352
run: .github/scripts/control-character-handling.sh
13201353

1354+
- name: Age Test
1355+
run: .github/scripts/age-test.sh
1356+
1357+
- name: Count Test
1358+
run: .github/scripts/count-test.sh
1359+
1360+
- name: Distance Test
1361+
run: .github/scripts/distance-test.sh
1362+
1363+
- name: Duration Test
1364+
run: .github/scripts/duration-test.sh
1365+
13211366
- name: Prometheus Metrics
13221367
run: .github/scripts/test-metrics.sh
13231368
if: ${{ matrix.variant == 'standalone' }}
@@ -2439,7 +2484,7 @@ jobs:
24392484
run: docker load --input /tmp/blaze.tar
24402485

24412486
- name: Run Blaze
2442-
run: docker run --name blaze -d -e JAVA_TOOL_OPTIONS=-Xmx2g -e DB_RESOURCE_CACHE_SIZE=0 -p 8080:8080 --read-only --tmpfs /tmp:exec -v blaze-data:/app/data blaze:latest
2487+
run: docker run --name blaze -d -e JAVA_TOOL_OPTIONS=-Xmx2g -p 8080:8080 --read-only --tmpfs /tmp:exec -v blaze-data:/app/data blaze:latest
24432488

24442489
- name: Wait for Blaze
24452490
run: .github/scripts/wait-for-url.sh http://localhost:8080/health
@@ -2735,6 +2780,7 @@ jobs:
27352780
- lint
27362781
- test
27372782
- test-slow
2783+
- test-mem-size
27382784
- test-root
27392785
- image-scan
27402786
- cql-expr-cache-test

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:21.0.8_9-jre-noble@sha256:20e7f7288e1c18eebe8f06a442c9f7183342d9b022d3b9a9677cae2b558ddddd
1+
FROM eclipse-temurin:25-jre-noble
22

33
ENV DEBIAN_FRONTEND=noninteractive
44

@@ -15,11 +15,12 @@ WORKDIR /app
1515
USER 1001
1616

1717
ENV LD_PRELOAD="libjemalloc.so.2"
18+
ENV BASE_JAVA_TOOL_OPTIONS="-XX:+UseCompactObjectHeaders --enable-native-access=ALL-UNNAMED"
1819
ENV STORAGE="standalone"
1920
ENV INDEX_DB_DIR="/app/data/index"
2021
ENV TRANSACTION_DB_DIR="/app/data/transaction"
2122
ENV RESOURCE_DB_DIR="/app/data/resource"
2223
ENV ADMIN_INDEX_DB_DIR="/app/data/admin-index"
2324
ENV ADMIN_TRANSACTION_DB_DIR="/app/data/admin-transaction"
2425

25-
CMD ["java", "-jar", "blaze-1.3.1-standalone.jar"]
26+
CMD ["sh", "-c", "JAVA_TOOL_OPTIONS=\"${BASE_JAVA_TOOL_OPTIONS} ${JAVA_TOOL_OPTIONS}\" exec java -jar blaze-1.3.1-standalone.jar"]

cljfmt.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
reg-collector [[:block 1]]
1717
deftests [[:block 1]]
1818
satisfies-prop [[:block 1]]
19+
mem-size-test [[:block 1]]
1920
clojure.test.check.properties/for-all [[:block 1]]
2021
blaze.metrics.core/collector [[:block 0]]
2122
reify-expr [[:inner 0] [:inner 1]]

docs/deployment/distributed-backend.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ blaze-1:
160160
DB_CASSANDRA_CONTACT_POINTS: "cassandra-1:9042,cassandra-2:9042"
161161
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
162162
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
163-
DB_RESOURCE_CACHE_SIZE: "100000"
164163
ENABLE_ADMIN_API: "true"
165164
LOG_LEVEL: "debug"
166165
ports:

docs/deployment/distributed/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ services:
121121
DB_CASSANDRA_CONTACT_POINTS: "cassandra-1:9042,cassandra-2:9042"
122122
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
123123
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
124-
DB_RESOURCE_CACHE_SIZE: "100000"
125124
ENABLE_ADMIN_API: "true"
126125
LOG_LEVEL: "debug"
127126
ports:
@@ -151,7 +150,6 @@ services:
151150
DB_CASSANDRA_CONTACT_POINTS: "cassandra-1:9042,cassandra-2:9042"
152151
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
153152
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
154-
DB_RESOURCE_CACHE_SIZE: "100000"
155153
ENABLE_ADMIN_API: "true"
156154
LOG_LEVEL: "debug"
157155
ports:

0 commit comments

Comments
 (0)