Skip to content

Commit c591a5f

Browse files
committed
[WIP] Implement ValueSet References
Closes: #110
1 parent 6342ed6 commit c591a5f

File tree

63 files changed

+2297
-221
lines changed

Some content is hidden

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

63 files changed

+2297
-221
lines changed

.clj-kondo/root/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
blaze.middleware.fhir.db db
8181
blaze.rest-api.header header
8282
blaze.scheduler sched
83+
blaze.terminology-service ts
8384
blaze.test-util tu
8485
blaze.util u
8586
buddy.auth auth

.github/value-set-expand/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.github/value-set-expand/expand.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash -e
2+
3+
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
4+
. "$SCRIPT_DIR/../scripts/util.sh"
5+
6+
BASE="http://localhost:8080/fhir"
7+
8+
expand() {
9+
curl -sH "Accept: application/fhir+json" "$BASE/ValueSet/\$expand?url=$1" | jq -r '[.expansion.contains[].code] | join(",")'
10+
}
11+
12+
test "Abrechnungsart" "$(expand "http://fhir.de/ValueSet/dkgev/Abrechnungsart")" "AOP,HSA,PIA,SPZ,ASV,KIA,DRG,PEPP,VNSB,AP,SPB,WLU,WLA,PS,SZ,KV,BG,SL,KEK,IA,MVZ,IV,DMP,REHA,PSY"
13+
test "AbrechnungsDiagnoseProzedur" "$(expand "http://fhir.de/ValueSet/AbrechnungsDiagnoseProzedur")" "hospital-main-diagnosis,principle-DRG,secondary-DRG"
14+
test "Diagnosesubtyp" "$(expand "http://fhir.de/ValueSet/Diagnosesubtyp")" "surgery-diagnosis,department-main-diagnosis,infection-control-diagnosis,cause-of-death,AD,DD"
15+
16+
test "identifier-type-codes" "$(expand "https://www.medizininformatik-initiative.de/fhir/core/modul-fall/ValueSet/identifier-type-codes")" "ACSN,BRN,DL,DR,EN,FILL,JHN,MCN,MD,MR,NIIP,PLAC,PPN,PRN,SB,SNO,TAX,UDI,VN"
17+
test "location-physical-type" "$(expand "https://www.medizininformatik-initiative.de/fhir/core/modul-fall/ValueSet/location-physical-type")" "wa,ro,bd"
18+
test "mii-vs-consent-answer" "$(expand "https://www.medizininformatik-initiative.de/fhir/modul-consent/ValueSet/mii-vs-consent-answer")" "2.16.840.1.113883.3.1937.777.24.5.2.3,2.16.840.1.113883.3.1937.777.24.5.2.2,2.16.840.1.113883.3.1937.777.24.5.2.1"
19+
test "mii-vs-consent-policy" "$(expand "https://www.medizininformatik-initiative.de/fhir/modul-consent/ValueSet/mii-vs-consent-policy")" "2.16.840.1.113883.3.1937.777.24.5.3.1,2.16.840.1.113883.3.1937.777.24.5.3.44,2.16.840.1.113883.3.1937.777.24.5.3.48,2.16.840.1.113883.3.1937.777.24.5.3.10,2.16.840.1.113883.3.1937.777.24.5.3.14,2.16.840.1.113883.3.1937.777.24.5.3.18,2.16.840.1.113883.3.1937.777.24.5.3.24,2.16.840.1.113883.3.1937.777.24.5.3.50,2.16.840.1.113883.3.1937.777.24.5.3.54,2.16.840.1.113883.3.1937.777.24.5.3.26,2.16.840.1.113883.3.1937.777.24.5.3.30,2.16.840.1.113883.3.1937.777.24.5.3.32,2.16.840.1.113883.3.1937.777.24.5.3.35"
20+
test "mii-vs-consent-signaturetypes" "$(expand "https://www.medizininformatik-initiative.de/fhir/modul-consent/ValueSet/mii-vs-consent-signaturetypes")" "1.2.840.10065.1.12.1.7,1.2.840.10065.1.12.1.11"

.github/value-set-expand/package-lock.json

Lines changed: 400 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/value-set-expand/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"@mii-termserv/de.medizininformatikinitiative.kerndatensatz.terminology.bill-of-materials": "^2024.11.7"
4+
}
5+
}

.github/value-set-expand/upload.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -e
2+
3+
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
4+
5+
BASE="http://localhost:8080/fhir"
6+
7+
# Upload CodeSystem resources
8+
find "$SCRIPT_DIR/node_modules" -name "CodeSystem-*.json" -print0 | xargs -0 -P 4 -I {} curl -H "Content-Type: application/fhir+json" -H "Prefer: return=minimal" -d @"{}" "$BASE/CodeSystem"
9+
10+
# Upload ValueSet resources
11+
find "$SCRIPT_DIR/node_modules" -name "ValueSet-*.json" -print0 | xargs -0 -P 4 -I {} curl -H "Content-Type: application/fhir+json" -H "Prefer: return=minimal" -d @"{}" "$BASE/ValueSet"

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,44 @@ jobs:
12221222
- name: Docker Stats
12231223
run: docker stats --no-stream
12241224

1225+
integration-test-value-set-expand:
1226+
needs: build
1227+
runs-on: ubuntu-24.04
1228+
1229+
steps:
1230+
- name: Check out Git repository
1231+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1232+
1233+
- name: Setup Node
1234+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
1235+
with:
1236+
node-version: 21
1237+
1238+
- name: Download Blaze Image
1239+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
1240+
with:
1241+
name: blaze-image
1242+
path: /tmp
1243+
1244+
- name: Load Blaze Image
1245+
run: docker load --input /tmp/blaze.tar
1246+
1247+
- name: Run Blaze
1248+
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
1249+
1250+
- name: All KDS Terminology Resources
1251+
working-directory: .github/value-set-expand
1252+
run: npm install
1253+
1254+
- name: Wait for Blaze
1255+
run: .github/scripts/wait-for-url.sh http://localhost:8080/health
1256+
1257+
- name: Upload KDS Terminology Resources
1258+
run: .github/value-set-expand/upload.sh
1259+
1260+
- name: Expand KDS Terminology Resources
1261+
run: .github/value-set-expand/expand.sh
1262+
12251263
not-enforcing-referential-integrity-test:
12261264
needs: build
12271265
runs-on: ubuntu-24.04
@@ -2001,6 +2039,7 @@ jobs:
20012039
- integration-test
20022040
- integration-test-synthea-1000
20032041
- integration-test-patient-purge
2042+
- integration-test-value-set-expand
20042043
- not-enforcing-referential-integrity-test
20052044
- admin-api-test
20062045
- small-transactions-test

deps.edn

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
blaze/interaction
1414
{:local/root "modules/interaction"}
1515

16+
blaze/openid-auth
17+
{:local/root "modules/openid-auth"}
18+
1619
blaze.operation/compact
1720
{:local/root "modules/operation-compact"}
1821

@@ -31,8 +34,8 @@
3134
blaze.operation/totals
3235
{:local/root "modules/operation-totals"}
3336

34-
blaze/openid-auth
35-
{:local/root "modules/openid-auth"}
37+
blaze.operation/value-set-expand
38+
{:local/root "modules/operation-value-set-expand"}
3639

3740
blaze/page-store-cassandra
3841
{:local/root "modules/page-store-cassandra"}
@@ -46,6 +49,9 @@
4649
blaze/server
4750
{:local/root "modules/server"}
4851

52+
blaze/terminology-service
53+
{:local/root "modules/terminology-service"}
54+
4955
blaze/thread-pool-executor-collector
5056
{:local/root "modules/thread-pool-executor-collector"}
5157

docs/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ The following Operations are implemented:
193193
* [Measure $evaluate-measure](api/operation-measure-evaluate-measure.md)
194194
* [Patient $everything](api/operation-patient-everything.md)
195195
* [Patient $purge](api/operation-patient-purge.md)
196+
* [ValueSet $expand](api/operation-value-set-expand.md)
196197

197198
## Asynchronous Requests
198199

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Operation \$expand on ValueSet
2+
3+
> [!CAUTION]
4+
> The operation \$expand on ValueSet is currently **beta**. Only a basic functionality is implemented.
5+
6+
The \$expand operation can be used to expand all codes of a ValueSet.
7+
8+
```
9+
GET [base]/ValueSet/$expand
10+
GET [base]/ValueSet/[id]/$expand
11+
```
12+
13+
The official documentation can be found [here][1].
14+
15+
[1]: <http://hl7.org/fhir/R4/valueset-operation-expand.html>

0 commit comments

Comments
 (0)