Skip to content

Commit 42f76b0

Browse files
committed
Support XML FHIR bundles in test env
1 parent c59019f commit 42f76b0

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/dev/tum-fhir-bundles
1111
/dev/tum-obds-data
1212
/dev/json-bundles-from-dresden
13+
/dev/json-bundles-from-tum-obds2fhir
Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
wget -qO - https://github.com/samply/blazectl/releases/download/v0.17.0/blazectl-0.17.0-linux-amd64.tar.gz | tar -xzf - blazectl
2-
./blazectl --server http://blaze:8080/fhir upload json-fhir-bundles
1+
#!/bin/sh
2+
3+
# Install curl if not available
4+
apk add --no-cache curl
5+
6+
BLAZE_URL="http://blaze:8080/fhir"
7+
BUNDLE_DIR="fhir-bundles"
8+
9+
echo "Starting to upload FHIR bundles to $BLAZE_URL"
10+
11+
# Upload all JSON files
12+
echo "Uploading JSON bundles..."
13+
for file in "$BUNDLE_DIR"/*.json; do
14+
if [ -f "$file" ]; then
15+
echo "Uploading $file"
16+
curl -X POST -H "Content-Type: application/fhir+json" -d @"$file" "$BLAZE_URL"
17+
echo ""
18+
fi
19+
done
20+
21+
# Upload all XML files
22+
echo "Uploading XML bundles..."
23+
for file in "$BUNDLE_DIR"/*.xml; do
24+
if [ -f "$file" ]; then
25+
echo "Uploading $file"
26+
curl -X POST -H "Content-Type: application/fhir+xml" -d @"$file" "$BLAZE_URL"
27+
echo ""
28+
fi
29+
done
30+
31+
echo "Upload complete!"

dev/docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
services:
22
blaze:
33
image: samply/blaze:latest
4+
environment:
5+
ENFORCE_REFERENTIAL_INTEGRITY: false
46
healthcheck:
57
test: curl -f http://localhost:8080/fhir/metadata
68
start_period: 1m
79

810
blaze-loader:
9-
image: alpine:3.21
11+
image: alpine:latest
1012
depends_on:
1113
blaze:
1214
condition: service_healthy
1315
volumes:
1416
- ./container-setup-scripts/blaze-loader.sh:/blaze-loader.sh:ro
15-
- ./json-fhir-bundles:/json-fhir-bundles:ro
17+
- ./json-fhir-bundles:/fhir-bundles:ro
1618
command: sh /blaze-loader.sh
1719

1820
postgres:

0 commit comments

Comments
 (0)