Skip to content

Commit

Permalink
Merge pull request #45 from medizininformatik-initiative/release-v1.1.0
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
bastianschaffer authored Oct 30, 2024
2 parents 45634e4 + 18427b3 commit 9eff347
Show file tree
Hide file tree
Showing 45 changed files with 3,155 additions and 232 deletions.
29 changes: 29 additions & 0 deletions .github/integration-test/basic-auth/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
fhir-server:
image: "samply/blaze:0.30"
environment:
BASE_URL: "http://fhir-server:8080"
JAVA_TOOL_OPTIONS: "-Xmx1g"
LOG_LEVEL: "debug"
ENFORCE_REFERENTIAL_INTEGRITY: false
ports:
- "8082:8080"
volumes:
- "data-store-data:/app/data"
proxy:
image: "nginx:1.27.0"
volumes:
- "./nginx.conf:/etc/nginx/nginx.conf"
- "./proxy.htpasswd:/etc/auth/.htpasswd"
fhir-data-evaluator:
image: fhir-data-evaluator
environment:
CONVERT_TO_CSV: ${FDE_CONVERT_TO_CSV:-true}
FHIR_SERVER: "http://proxy:8080/fhir"
FHIR_USER: "test"
FHIR_PASSWORD: "bar"
volumes:
- "${FDE_INPUT_MEASURE:-../Documentation/example-measures/example-measure-kds.json}:/app/measure.json"
- "${FDE_OUTPUT_DIR:-../output}:/app/output"
volumes:
data-store-data:
5 changes: 5 additions & 0 deletions .github/integration-test/basic-auth/load-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e

DIR="$1"

blazectl --no-progress --server http://localhost:8082/fhir upload "$DIR"
37 changes: 37 additions & 0 deletions .github/integration-test/basic-auth/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;

server {
listen 8080;
listen [::]:8080;

location / {
root /usr/share/nginx/html;
index index.html;
}

location /fhir {
auth_basic "Test Area";
auth_basic_user_file /etc/auth/.htpasswd;

proxy_pass http://fhir-server:8080;
proxy_read_timeout 43200s;
}
}
}
1 change: 1 addition & 0 deletions .github/integration-test/basic-auth/proxy.htpasswd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test:$apr1$ZHbwVw0h$6uvjvv1NqGY47sVmYEvwE0
20 changes: 0 additions & 20 deletions .github/integration-test/docker-compose.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/integration-test/evaluate-and-post-different-doc-ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash -e

PROJECT_IDENTIFIER_VALUE="$1"

DOCKER_COMPOSE_FILE=.github/integration-test/no-auth/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/icd10-measure.json
export FDE_CONVERT_TO_CSV=false
export FDE_FHIR_REPORT_DESTINATION_SERVER=http://fhir-server:8080/fhir
export FDE_AUTHOR_IDENTIFIER_SYSTEM=http://dsf.dev/sid/organization-identifier
export FDE_AUTHOR_IDENTIFIER_VALUE=Test_DIC1
export FDE_PROJECT_IDENTIFIER_SYSTEM=http://medizininformatik-initiative.de/sid/project-identifier
export FDE_PROJECT_IDENTIFIER_VALUE="$PROJECT_IDENTIFIER_VALUE"
export FDE_SEND_REPORT_TO_SERVER=true

docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

reference_response=$(curl -s "http://localhost:8082/fhir/DocumentReference" \
-H "Content-Type: application/fhir+json")

reference_count=$(echo "$reference_response" | jq -r '.entry | length')

EXPECTED_REFERENCE_COUNT=2
if [ "$reference_count" = "$EXPECTED_REFERENCE_COUNT" ]; then
echo "OK 👍: reference count ($reference_count) equals the expected count"
else
echo "Fail 😞: reference count ($reference_count) != ($EXPECTED_REFERENCE_COUNT)"
exit 1
fi
50 changes: 50 additions & 0 deletions .github/integration-test/evaluate-and-post-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash -e

PROJECT_IDENTIFIER_VALUE="$1"
DOCKER_COMPOSE_FILE=.github/integration-test/no-auth/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/icd10-measure.json
export FDE_CONVERT_TO_CSV=false
export FDE_FHIR_REPORT_DESTINATION_SERVER=http://fhir-server:8080/fhir
export FDE_AUTHOR_IDENTIFIER_SYSTEM=http://dsf.dev/sid/organization-identifier
export FDE_AUTHOR_IDENTIFIER_VALUE=Test_DIC1
export FDE_PROJECT_IDENTIFIER_SYSTEM=http://medizininformatik-initiative.de/sid/project-identifier
export FDE_PROJECT_IDENTIFIER_VALUE="$PROJECT_IDENTIFIER_VALUE"
export FDE_SEND_REPORT_TO_SERVER=true

docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

report_response=$(curl -s "http://localhost:8082/fhir/MeasureReport" \
-H "Content-Type: application/fhir+json")

reference_response=$(curl -s "http://localhost:8082/fhir/DocumentReference" \
-H "Content-Type: application/fhir+json")

report_url=MeasureReport/$(echo "$report_response" | jq -r '.entry[0].resource.id')
reference_url=$(echo "$reference_response" | jq -r '.entry[0].resource.content[0].attachment.url')

if [ "$report_url" = "$reference_url" ]; then
echo "OK 👍: Id of MeasureReport is the same as the referenced attachment in the DocumentReference"
else
echo "Fail 😞: Id of MeasureReport ($report_url) is not the same as the referenced attachment in the DocumentReference ($reference_url)"
exit 1
fi

REPORT=$(echo "$report_response" | jq '.entry[0].resource')
EXPECTED_POPULATION_COUNT=2
EXPECTED_STRATIFIER_COUNT=2

POPULATION_COUNT=$(echo "$REPORT" | jq '.group[0].population[0].count')
if [ "$POPULATION_COUNT" = "$EXPECTED_POPULATION_COUNT" ]; then
echo "OK 👍: population count ($POPULATION_COUNT) equals the expected count"
else
echo "Fail 😞: population count ($POPULATION_COUNT) != ($EXPECTED_POPULATION_COUNT)"
exit 1
fi

STRATIFIER_COUNT=$(echo "$REPORT" | jq -r '.group[0].stratifier[0].stratum[0].population[0].count')
if [ "$STRATIFIER_COUNT" = "$EXPECTED_STRATIFIER_COUNT" ]; then
echo "OK 👍: stratifier count ($STRATIFIER_COUNT) equals the expected count"
else
echo "Fail 😞: stratifier ($STRATIFIER_COUNT) != ($EXPECTED_STRATIFIER_COUNT)"
exit 1
fi
51 changes: 51 additions & 0 deletions .github/integration-test/evaluate-and-post-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash -e

PROJECT_IDENTIFIER_VALUE="$1"

DOCKER_COMPOSE_FILE=.github/integration-test/no-auth/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/icd10-measure.json
export FDE_CONVERT_TO_CSV=false
export FDE_FHIR_REPORT_DESTINATION_SERVER=http://fhir-server:8080/fhir
export FDE_AUTHOR_IDENTIFIER_SYSTEM=http://dsf.dev/sid/organization-identifier
export FDE_AUTHOR_IDENTIFIER_VALUE=Test_DIC1
export FDE_PROJECT_IDENTIFIER_SYSTEM=http://medizininformatik-initiative.de/sid/project-identifier
export FDE_PROJECT_IDENTIFIER_VALUE="$PROJECT_IDENTIFIER_VALUE"
export FDE_SEND_REPORT_TO_SERVER=true

reference_response=$(curl -s "http://localhost:8082/fhir/DocumentReference" \
-H "Content-Type: application/fhir+json")
reference_url_before=$(echo "$reference_response" | jq -r '.entry[0].resource.content[0].attachment.url')

docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

report_response=$(curl -s "http://localhost:8082/fhir/MeasureReport" \
-H "Content-Type: application/fhir+json")
reference_response=$(curl -s "http://localhost:8082/fhir/DocumentReference" \
-H "Content-Type: application/fhir+json")

report_count=$(echo "$report_response" | jq -r '.entry | length')
reference_count=$(echo "$reference_response" | jq -r '.entry | length')
reference_url_after=$(echo "$reference_response" | jq -r '.entry[0].resource.content[0].attachment.url')

EXPECTED_REPORT_COUNT=2
if [ "$report_count" = "$EXPECTED_REPORT_COUNT" ]; then
echo "OK 👍: report count ($report_count) equals the expected count"
else
echo "Fail 😞: report count ($report_count) != ($EXPECTED_REPORT_COUNT)"
exit 1
fi

EXPECTED_REFERENCE_COUNT=1
if [ "$reference_count" = "$EXPECTED_REFERENCE_COUNT" ]; then
echo "OK 👍: reference count ($reference_count) equals the expected count"
else
echo "Fail 😞: reference count ($reference_count) != ($EXPECTED_REFERENCE_COUNT)"
exit 1
fi

if [ "$reference_url_before" != "$reference_url_after" ]; then
echo "OK 👍: referenced measure report url changed"
else
echo "Fail 😞: referenced measure report url did not change"
exit 1
fi
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-code.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-code-test
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/code-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-code-test
export FDE_CONVERT_TO_CSV=false

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e TZ="$(cat /etc/timezone)" --network integration-test_testing-network fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
REPORT="$OUTPUT_DIR/measure-report.json"

EXPECTED_POPULATION_COUNT=2
Expand Down
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-exists.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-exists-test
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/exists-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-exists-test
export FDE_CONVERT_TO_CSV=false

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e TZ="$(cat /etc/timezone)" --network integration-test_testing-network fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
REPORT="$OUTPUT_DIR/measure-report.json"

EXPECTED_POPULATION_COUNT=2
Expand Down
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-icd10-to-csv.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-icd10-test-to-csv-test
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/icd10-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-icd10-to-csv-test
export FDE_CONVERT_TO_CSV=true

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e CONVERT_TO_CSV=true -e TZ="$(cat /etc/timezone)" --network integration-test_testing-network fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)

#wait for csv file creation
sleep 1
Expand Down
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-icd10.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-icd10-test
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/icd10-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-icd10-test
export FDE_CONVERT_TO_CSV=false

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e TZ="$(cat /etc/timezone)" --network integration-test_testing-network fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
REPORT=$(cat "$OUTPUT_DIR"/measure-report.json)

EXPECTED_POPULATION_COUNT=2
Expand Down
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-icd10WithStatus-to-csv.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-icd10WithStatus-to-csv-test
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/icd10withStatus-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-icd10withStatus-to-csv-test
export FDE_CONVERT_TO_CSV=true

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e CONVERT_TO_CSV=true -e TZ="$(cat /etc/timezone)" --network integration-test_testing-network fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)

#wait for csv file creation
sleep 1
Expand Down
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-multiple-stratifiers.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-multiple-stratifiers
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/multiple-stratifiers-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-multiple-stratifiers-test
export FDE_CONVERT_TO_CSV=false

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e TZ="$(cat /etc/timezone)" --network integration-test_testing-network fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
REPORT="$OUTPUT_DIR/measure-report.json"

find_stratum() {
Expand Down
13 changes: 7 additions & 6 deletions .github/integration-test/evaluate-unique-count-to-csv.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-unique-count-with-components-test
mkdir "$BASE_OUTPUT_DIR"
DOCKER_COMPOSE_FILE=.github/integration-test/$1/docker-compose.yml
export FDE_INPUT_MEASURE=/${PWD}/.github/integration-test/measures/unique-count-measure.json
export FDE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-unique-count-to-csv-test
export FDE_CONVERT_TO_CSV=true

docker run -v "$INPUT_MEASURE":/app/measure.json -v "$BASE_OUTPUT_DIR":/app/output/ -e FHIR_SERVER=http://fhir-server:8080/fhir \
-e TZ="$(cat /etc/timezone)" --network integration-test_testing-network -e CONVERT_TO_CSV=true fhir-data-evaluator
mkdir "$FDE_OUTPUT_DIR"
docker compose -f "$DOCKER_COMPOSE_FILE" run -e TZ="$(cat /etc/timezone)" fhir-data-evaluator

today=$(date +"%Y-%m-%d")
OUTPUT_DIR=$(find "$BASE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)
OUTPUT_DIR=$(find "$FDE_OUTPUT_DIR" -type d -name "*$today*" | head -n 1)

#wait for csv file creation
sleep 1
Expand Down
Loading

0 comments on commit 9eff347

Please sign in to comment.