Skip to content

Commit 9033cfa

Browse files
committed
Implement FHIR Types in Java
1 parent 4fcd9b9 commit 9033cfa

File tree

293 files changed

+15950
-6815
lines changed

Some content is hidden

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

293 files changed

+15950
-6815
lines changed

.github/scripts/check-bloom-filter.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ BASE="http://localhost:8080/fhir"
77
HASH="$1"
88
PATIENT_COUNT="$2"
99

10-
test "patient count" "$(curl -s "$BASE/__admin/cql/bloom-filters" | jq -r ".[] | select(.hash == \"$HASH\") | .patientCount")" "$PATIENT_COUNT"
10+
BLOOM_FILTERS="$(curl -s "$BASE/__admin/cql/bloom-filters")"
11+
12+
echo "All Bloom filters:"
13+
echo "$BLOOM_FILTERS" | jq -r '.[]'
14+
15+
test "patient count" "$(echo "$BLOOM_FILTERS" | jq -r ".[] | select(.hash == \"$HASH\") | .patientCount")" "$PATIENT_COUNT"

.github/workflows/build.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,39 @@ jobs:
252252
- name: Test
253253
run: make -C modules/${{ matrix.module }} test-slow
254254

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

654687
- name: Check Bloom Filter
655-
run: .github/scripts/check-bloom-filter.sh fbb79d85457069c8e1926c949690deecd60d751942d5b0cd0b61c08e6029224c 86
688+
run: .github/scripts/check-bloom-filter.sh 017a0f079c2a76a731db3cdf68637afc8e4fac34409b032b5ac93958923e0501 86
656689

657690
- name: Evaluate CQL Query 36 - Subject List
658691
run: .github/scripts/evaluate-measure-subject-list.sh q36-parameter 86
@@ -664,7 +697,7 @@ jobs:
664697
run: .github/scripts/evaluate-measure.sh q37-overlaps 24
665698

666699
- name: Check Bloom Filter
667-
run: .github/scripts/check-bloom-filter.sh 9fe779d821d7647831331b490939aa0cdf314d76c9b2a9518ffaf559353db043 24
700+
run: .github/scripts/check-bloom-filter.sh e7d79fd90bce0a8c5abad06027e3b6d57b448076ff41fa36827e5e3b65ca10c2 24
668701

669702
- name: Evaluate CQL Query 37 - Blazectl
670703
run: .github/scripts/evaluate-measure-blazectl.sh q37-overlaps 24
@@ -2686,6 +2719,7 @@ jobs:
26862719
- lint
26872720
- test
26882721
- test-slow
2722+
- test-mem-size
26892723
- test-root
26902724
- image-scan
26912725
- 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.1.2-standalone.jar"]
26+
CMD ["sh", "-c", "JAVA_TOOL_OPTIONS=\"${BASE_JAVA_TOOL_OPTIONS} ${JAVA_TOOL_OPTIONS}\" exec java -jar blaze-1.1.2-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/performance/cql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ cql/search.sh medication-7
422422
|---------|--------|-------:|---------:|-------:|-------:|
423423
| 100k | LEA58 | 5.2 M | 12.79 | 0.325 | 7.8 k |
424424
| 1M | LEA58 | 52.3 M | 399.64 | 11.966 | 2.5 k |
425-
| 1M | A5N46 | 52.3 M | 267.65 | 4.829 | 3.7 k |
425+
| 1M | A5N46 | 52.3 M | 252.74 | 1.111 | 4.0 k |
426426

427427
### CQL Queries
428428

docs/performance/fhir-search.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ curl -s "http://localhost:8080/fhir/Observation?code=http://loinc.org|$CODE&_sum
6363
| LEA58 | 1M | 8310-5 | 1.1 M | 0.39 | 0.009 | 3.0 M |
6464
| LEA58 | 1M | 55758-7 | 10.1 M | 2.84 | 0.026 | 3.6 M |
6565
| LEA58 | 1M | 72514-3 | 27.3 M | 7.52 | 0.138 | 3.6 M |
66-
| A5N46 | 1M | 8310-5 | 1.1 M | 0.20 | 0.008 | 5.8 M |
67-
| A5N46 | 1M | 55758-7 | 10.1 M | 2.35 | 0.016 | 4.3 M |
68-
| A5N46 | 1M | 72514-3 | 27.3 M | 4.75 | 0.074 | 5.8 M |
66+
| A5N46 | 1M | 8310-5 | 1.1 M | 0.17 | 0.010 | 6.7 M |
67+
| A5N46 | 1M | 55758-7 | 10.1 M | 1.99 | 0.029 | 5.1 M |
68+
| A5N46 | 1M | 72514-3 | 27.3 M | 4.02 | 0.017 | 6.8 M |
6969

7070
¹ resources per second
7171

@@ -81,26 +81,26 @@ Downloads were performed using the following `blazectl` command:
8181
blazectl download --server http://localhost:8080/fhir Observation -q "code=http://loinc.org|$CODE&_count=1000" > /dev/null
8282
```
8383

84-
| System | Dataset | Code | # Hits | Time (s) | StdDev | Res/s ¹ |
85-
|--------|---------|---------|-------:|---------:|-------:|---------:|
86-
| LEA36 | 100k | 8310-5 | 115 k | 1.90 | 0.016 | 60.53 k |
87-
| LEA36 | 100k | 55758-7 | 1.0 M | 15.45 | 0.121 | 64.72 k |
88-
| LEA36 | 100k | 72514-3 | 2.7 M | 41.09 | 0.530 | 65.71 k |
89-
| LEA47 | 100k | 8310-5 | 115 k | 2.00 | 0.021 | 57.50 k |
90-
| LEA47 | 100k | 55758-7 | 1.0 M | 15.99 | 0.147 | 62.54 k |
91-
| LEA47 | 100k | 72514-3 | 2.7 M | 43.48 | 0.128 | 62.10 k |
92-
| LEA58 | 100k | 8310-5 | 115 k | 1.96 | 0.039 | 58.67 k |
93-
| LEA58 | 100k | 55758-7 | 1.0 M | 16.61 | 0.161 | 60.20 k |
94-
| LEA58 | 100k | 72514-3 | 2.7 M | 43.84 | 0.124 | 61.59 k |
95-
| LEA47 | 1M | 8310-5 | 1.1 M | 15.43 | 0.034 | 75.1 k |
96-
| LEA47 | 1M | 55758-7 | 10.1 M | 155.78 | 0.976 | 65.1 k ² |
97-
| LEA47 | 1M | 72514-3 | 10.1 M | 114.41 | 0.438 | 88.6 k ² |
98-
| LEA58 | 1M | 8310-5 | 1.1 M | 15.35 | 0.135 | 75.5 k |
99-
| LEA58 | 1M | 55758-7 | 10.1 M | 136.48 | 0.236 | 74.3 k |
100-
| LEA58 | 1M | 72514-3 | 27.3 M | 416.05 | 22.655 | 65.7 k ² |
101-
| A5N46 | 1M | 8310-5 | 1.1 M | 7.78 | 0.040 | 148.9 k |
102-
| A5N46 | 1M | 55758-7 | 10.1 M | 148.39 | 1.776 | 68.3 k ² |
103-
| A5N46 | 1M | 72514-3 | 27.3 M | 413.87 | 0.165 | 66.1 k ² |
84+
| System | Dataset | Code | # Hits | Time (s) | StdDev | Res/s ¹ |
85+
|--------|---------|---------|-------:|---------:|-------:|----------:|
86+
| LEA36 | 100k | 8310-5 | 115 k | 1.90 | 0.016 | 60.53 k |
87+
| LEA36 | 100k | 55758-7 | 1.0 M | 15.45 | 0.121 | 64.72 k |
88+
| LEA36 | 100k | 72514-3 | 2.7 M | 41.09 | 0.530 | 65.71 k |
89+
| LEA47 | 100k | 8310-5 | 115 k | 2.00 | 0.021 | 57.50 k |
90+
| LEA47 | 100k | 55758-7 | 1.0 M | 15.99 | 0.147 | 62.54 k |
91+
| LEA47 | 100k | 72514-3 | 2.7 M | 43.48 | 0.128 | 62.10 k |
92+
| LEA58 | 100k | 8310-5 | 115 k | 1.96 | 0.039 | 58.67 k |
93+
| LEA58 | 100k | 55758-7 | 1.0 M | 16.61 | 0.161 | 60.20 k |
94+
| LEA58 | 100k | 72514-3 | 2.7 M | 43.84 | 0.124 | 61.59 k |
95+
| LEA47 | 1M | 8310-5 | 1.1 M | 15.43 | 0.034 | 75.1 k |
96+
| LEA47 | 1M | 55758-7 | 10.1 M | 155.78 | 0.976 | 65.1 k ² |
97+
| LEA47 | 1M | 72514-3 | 10.1 M | 114.41 | 0.438 | 88.6 k ² |
98+
| LEA58 | 1M | 8310-5 | 1.1 M | 15.35 | 0.135 | 75.5 k |
99+
| LEA58 | 1M | 55758-7 | 10.1 M | 136.48 | 0.236 | 74.3 k |
100+
| LEA58 | 1M | 72514-3 | 27.3 M | 416.05 | 22.655 | 65.7 k ² |
101+
| A5N46 | 1M | 8310-5 | 1.1 M | 7.03 | 0.021 | 164.8 k |
102+
| A5N46 | 1M | 55758-7 | 10.1 M | 116.01 | 9.946 | 87.4 k ² |
103+
| A5N46 | 1M | 72514-3 | 27.3 M | 254.89 | 4.042 | 107.3 k ² |
104104

105105
¹ resources per second, ² resource cache size is smaller than the number of resources returned
106106

@@ -133,9 +133,9 @@ blazectl download --server http://localhost:8080/fhir Observation -q "code=http:
133133
| LEA58 | 1M | 8310-5 | 1.1 M | 10.61 | 0.120 | 109.2 k |
134134
| LEA58 | 1M | 55758-7 | 10.1 M | 88.05 | 1.587 | 115.2 k |
135135
| LEA58 | 1M | 72514-3 | 27.3 M | 259.91 | 2.506 | 105.2 k ² |
136-
| A5N46 | 1M | 8310-5 | 1.1 M | 5.08 | 0.054 | 228.3 k |
137-
| A5N46 | 1M | 55758-7 | 10.1 M | 105.87 | 0.544 | 95.8 k ² |
138-
| A5N46 | 1M | 72514-3 | 27.3 M | 318.80 | 7.558 | 85.8 k ² |
136+
| A5N46 | 1M | 8310-5 | 1.1 M | 4.60 | 0.019 | 251.8 k |
137+
| A5N46 | 1M | 55758-7 | 10.1 M | 78.03 | 1.621 | 129.9 k ² |
138+
| A5N46 | 1M | 72514-3 | 27.3 M | 209.98 | 4.923 | 130.2 k ² |
139139

140140
¹ resources per second, ² resource cache size is smaller than the number of resources returned
141141

docs/tuning-guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ As a general rule of thumb, 1/4 of the available memory should be assigned to th
2323

2424
The list of all environment variables can be found in the [Environment Variables Section](deployment/environment-variables.md) under [Deployment](deployment.md). The variables important here are:
2525

26-
| Name | Use for | Default | Description |
27-
|:-----------------------|----------------|:--------|:----------------------------------------------------------|
28-
| JAVA_TOOL_OPTIONS | Heap Mem || eg. -Xmx2g, -Xmx4g, -Xmx8g, -Xmx16g, -Xmx32g or -Xmx64g |
29-
| DB_BLOCK_CACHE_SIZE | Block Cache | 128 | eg. 2048, 4096, 8192, 16384, 32768 or 65536 |
30-
| DB_RESOURCE_CACHE_SIZE | Resource Cache | 100000 | eg. 50000, 100000, 2500000, 5000000, 10000000 or 20000000 |
31-
| CQL_EXPR_CACHE_SIZE | Resource Cache || eg. 128, 512, 1024 |
26+
| Name | Use for | Default | Description |
27+
|:-----------------------|----------------------|:--------|:----------------------------------------------------------|
28+
| JAVA_TOOL_OPTIONS | Heap Mem || eg. -Xmx2g, -Xmx4g, -Xmx8g, -Xmx16g, -Xmx32g or -Xmx64g |
29+
| DB_BLOCK_CACHE_SIZE | Block Cache | 128 | eg. 2048, 4096, 8192, 16384, 32768 or 65536 (in megabyte) |
30+
| DB_RESOURCE_CACHE_SIZE | Resource Cache | 100000 | eg. 50000, 100000, 2500000, 5000000, 10000000 or 20000000 |
31+
| CQL_EXPR_CACHE_SIZE | CQL Expression Cache || eg. 128, 512, 1024 (in megabyte) |
3232

3333
### Other Tuning Options
3434

modules/admin-api/test/blaze/admin_api_test.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@
729729
{:system #fhir/uri "https://samply.github.io/blaze/fhir/CodeSystem/JobType"
730730
:code #fhir/code "re-index"
731731
:display #fhir/string "(Re)Index a Search Parameter"}]}
732-
:authoredOn #fhir/dateTime "2024-04-13T10:05:20.927Z"
732+
:authoredOn #fhir/dateTime #system/date-time "2024-04-13T10:05:20.927Z"
733733
:input
734734
[{:fhir/type :fhir.Task/input
735735
:type #fhir/CodeableConcept
@@ -750,7 +750,7 @@
750750
{:system #fhir/uri "https://samply.github.io/blaze/fhir/CodeSystem/JobType"
751751
:code #fhir/code "compact"
752752
:display #fhir/string "Compact a Database Column Family"}]}
753-
:authoredOn #fhir/dateTime "2024-04-13T10:05:20.927Z"
753+
:authoredOn #fhir/dateTime #system/date-time "2024-04-13T10:05:20.927Z"
754754
:input
755755
[{:fhir/type :fhir.Task/input
756756
:type #fhir/CodeableConcept

modules/byte-buffer/build.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
{:basis (b/create-basis {:project "deps.edn"})
88
:src-dirs ["java"]
99
:class-dir "target/classes"
10-
:javac-opts ["-Xlint:all" "-proc:none" "--release" "17"]}))
10+
:javac-opts ["-Xlint:all" "-proc:none" "--release" "21"]}))

modules/coll/build.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
{:basis (b/create-basis {:project "deps.edn"})
88
:src-dirs ["java"]
99
:class-dir "target/classes"
10-
:javac-opts ["-Xlint:all" "-proc:none" "--release" "17"]}))
10+
:javac-opts ["-Xlint:all" "-proc:none" "--release" "21"]}))

0 commit comments

Comments
 (0)