Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.0 #37

Merged
merged 22 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7f0142e
Update KDS File
DeaDurro Aug 6, 2024
10c387c
Change Metadata In KDS Measure
bastianschaffer Aug 6, 2024
b092537
Prepare Next Dev
bastianschaffer Aug 8, 2024
af58ecf
Merge pull request #26 from medizininformatik-initiative/next-dev
bastianschaffer Aug 8, 2024
961c9a3
Update KDS measure
DeaDurro Aug 12, 2024
3910d05
separate pzn and atc stratifier, add consent stratifier per code
juliangruendner Aug 14, 2024
1196f0f
Merge pull request #22 from medizininformatik-initiative/update-kds-p…
juliangruendner Sep 3, 2024
4b1cba4
Add Retry to DataStore
bastianschaffer Sep 5, 2024
e74aefa
Fix Wrong Patcount
bastianschaffer Sep 17, 2024
c600146
Merge pull request #30 from medizininformatik-initiative/fix-patcount
juliangruendner Sep 17, 2024
9e359ae
Merge pull request #28 from medizininformatik-initiative/add-retry
juliangruendner Sep 17, 2024
7624b07
Add Write Permission Check
bastianschaffer Sep 16, 2024
1b134f6
Add below modifier to queries and add query for pseudonymised patients
juliangruendner Sep 17, 2024
62fbd16
Merge pull request #32 from medizininformatik-initiative/add-permissi…
juliangruendner Sep 17, 2024
7a10021
Improve Readme
juliangruendner Sep 17, 2024
9e98fdb
Merge pull request #35 from medizininformatik-initiative/11-improve-r…
juliangruendner Sep 17, 2024
8298839
Merge pull request #34 from medizininformatik-initiative/33-use-below…
juliangruendner Sep 17, 2024
915c3cf
Add docker compose
juliangruendner Sep 17, 2024
539556d
change default path for input measure docker compose
juliangruendner Sep 17, 2024
46228d1
Make Increment Population Immutable
bastianschaffer Sep 18, 2024
e948aac
Merge pull request #36 from medizininformatik-initiative/make-increme…
bastianschaffer Sep 24, 2024
217d323
Release v1.0.0
bastianschaffer Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/integration-test/evaluate-multiple-stratifiers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/bash -e

INPUT_MEASURE=$1
BASE_OUTPUT_DIR=$PWD/.github/integration-test/evaluate-multiple-stratifiers
mkdir "$BASE_OUTPUT_DIR"

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

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

find_stratum() {
local STRATIFIER_INDEX="$1"
local EXPECTED_VALUE="$2"
local STRATUM=$(jq -c --arg EXPECTED_VALUE "$EXPECTED_VALUE" --argjson STRATIFIER_INDEX "$STRATIFIER_INDEX" '
.group[0].stratifier[$STRATIFIER_INDEX].stratum[] | select(.value.coding[0].code == $EXPECTED_VALUE)' "$REPORT" )
echo "$STRATUM"
}

validate_stratum() {
local STRATUM="$1"
local STRATUM_VALUE="$2"
local EXPECTED_INITIAL_POP_COUNT="$3"
local EXPECTED_MEASURE_POP_COUNT="$4"
local EXPECTED_OBSERVATION_POP_COUNT="$5"
local EXPECTED_MEASURE_SCORE="$6"

local INITIAL_POP_COUNT=$(jq '.population[] | select(.code.coding[0].code == "initial-population").count' <<< "$STRATUM")
local MEASURE_POP_COUNT=$(jq '.population[] | select(.code.coding[0].code == "measure-population").count' <<< "$STRATUM")
local OBSERVATION_POP_COUNT=$(jq '.population[] | select(.code.coding[0].code == "measure-observation").count' <<< "$STRATUM")
local MEASURE_SCORE=$(jq '.measureScore.value' <<< "$STRATUM")



if [ "$INITIAL_POP_COUNT" = "$EXPECTED_INITIAL_POP_COUNT" ]; then
echo "OK 👍: initial population count ($INITIAL_POP_COUNT) equals the expected count for (value=$STRATUM_VALUE)"
else
echo "Fail 😞: stratum count ($INITIAL_POP_COUNT) != $EXPECTED_INITIAL_POP_COUNT for initial population (value=$STRATUM_VALUE)"
exit 1
fi

if [ "$MEASURE_POP_COUNT" = "$EXPECTED_MEASURE_POP_COUNT" ]; then
echo "OK 👍: measure population count ($MEASURE_POP_COUNT) equals the expected count for (value=$STRATUM_VALUE)"
else
echo "Fail 😞: stratum count ($MEASURE_POP_COUNT) != $EXPECTED_MEASURE_POP_COUNT for measure population (value=$STRATUM_VALUE)"
exit 1
fi

if [ "$OBSERVATION_POP_COUNT" = "$EXPECTED_OBSERVATION_POP_COUNT" ]; then
echo "OK 👍: observation population count ($OBSERVATION_POP_COUNT) equals the expected count for (value=$STRATUM_VALUE)"
else
echo "Fail 😞: stratum count ($OBSERVATION_POP_COUNT) != $EXPECTED_OBSERVATION_POP_COUNT for measure observation (value=$STRATUM_VALUE)"
exit 1
fi

if [ "$MEASURE_SCORE" = "$EXPECTED_MEASURE_SCORE" ]; then
echo "OK 👍: measure score ($MEASURE_SCORE) equals the expected count for (value=$STRATUM_VALUE)"
else
echo "Fail 😞: stratum count ($MEASURE_SCORE) != $EXPECTED_MEASURE_SCORE for measure score (value=$STRATUM_VALUE)"
exit 1
fi
}

get_stratum() {
local STRATIFIER_INDEX="$1"
local STRATUM_INDEX="$2"
echo $(jq --argjson STRATIFIER_INDEX "$STRATIFIER_INDEX" --argjson STRATUM_INDEX "STRATUM_INDEX" '.population[]
| select(.code.coding[0].code == "initial-population").count' "$STRATUM")
}


EXPECTED_STRATUM_VALUE_1="I48.0"
EXPECTED_STRATUM_INITIAL_POP_1=108
EXPECTED_STRATUM_MEASURE_POP_1=108
EXPECTED_STRATUM_OBESERVATION_POP_1=108
EXPECTED_STRATUM_MEASURE_SCORE_1=108

EXPECTED_STRATUM_VALUE_2="fail-no-value-found"
EXPECTED_STRATUM_INITIAL_POP_2=12072
EXPECTED_STRATUM_MEASURE_POP_2=12072
EXPECTED_STRATUM_OBESERVATION_POP_2=12072
EXPECTED_STRATUM_MEASURE_SCORE_2=12040


STRATUM=$(find_stratum 0 $EXPECTED_STRATUM_VALUE_1)
validate_stratum "$STRATUM" $EXPECTED_STRATUM_VALUE_1 $EXPECTED_STRATUM_INITIAL_POP_1 $EXPECTED_STRATUM_MEASURE_POP_1 \
$EXPECTED_STRATUM_OBESERVATION_POP_1 $EXPECTED_STRATUM_MEASURE_SCORE_1

STRATUM=$(find_stratum 1 $EXPECTED_STRATUM_VALUE_2)
validate_stratum "$STRATUM" $EXPECTED_STRATUM_VALUE_2 $EXPECTED_STRATUM_INITIAL_POP_2 $EXPECTED_STRATUM_MEASURE_POP_2 \
$EXPECTED_STRATUM_OBESERVATION_POP_2 $EXPECTED_STRATUM_MEASURE_SCORE_2
109 changes: 109 additions & 0 deletions .github/integration-test/measures/multiple-stratifiers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"resourceType": "Measure",
"meta": {
"profile": [
"http://fhir-data-evaluator/StructureDefinition/FhirDataEvaluatorContinuousVariableMeasure"
]
},
"version": "1.0",
"url": "https://medizininformatik-initiative.de/fhir/fdpg/Measure/ExampleCdsCriteria",
"status": "active",
"experimental": false,
"publisher": "FDPG-Plus",
"name": "ExampleCdsCriteria",
"title": "Example Measure To Count CDS Criteria",
"description": "Example measure to count CDS criteria",
"group": [
{
"population": [
{
"code": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-population",
"code": "initial-population"
}
]
},
"criteria": {
"language": "text/x-fhir-query",
"expression": "Condition?_profile=https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
},
"id": "initial-population-identifier-1"
},
{
"code": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-population",
"code": "measure-population"
}
]
},
"criteria": {
"language": "text/fhirpath",
"expression": "Condition"
},
"id": "measure-population-identifier-1"
},
{
"code": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-population",
"code": "measure-observation"
}
]
},
"criteria": {
"language": "text/fhirpath",
"expression": "Condition.subject.reference"
},
"extension": [
{
"url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
"valueCode": "unique-count"
},
{
"url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
"valueString": "measure-population-identifier-1"
}
],
"id": "measure-observation-identifier-1"
}
],
"stratifier": [
{
"criteria": {
"language": "text/fhirpath",
"expression": "Condition.code.coding.where(system='http://fhir.de/CodeSystem/bfarm/icd-10-gm')"
},
"code": {
"coding": [
{
"system": "http://fhir-evaluator/strat/system",
"code": "condition-icd10-code"
}
]
},
"id": "strat-1"
},
{
"criteria": {
"language": "text/fhirpath",
"expression": "Condition.code.coding.where(system='http://snomed.info/sct')"
},
"code": {
"coding": [
{
"system": "http://fhir-evaluator/strat/system",
"code": "condition-sct-code"
}
]
},
"id": "strat-2"
}
]
}
]
}
19 changes: 19 additions & 0 deletions .github/integration-test/missing-permissions-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -e

BASE_OUTPUT_DIR=$PWD/.github/integration-test/missing-permissions-test
mkdir "$BASE_OUTPUT_DIR"

# Allow docker to exit with an error
set +e
OUTPUT=$(docker run -v "$PWD"/.github/integration-test/measures/code-measure.json:/app/measure.json \
-v "$BASE_OUTPUT_DIR":/app/output:ro --network integration-test_testing-network -e FHIR_SERVER=http://fhir-server:8080/fhir \
fhir-data-evaluator 2>&1)
EXIT_CODE=$?
set -e

if [ "$OUTPUT" = "Missing writing permissions on output directory" ] && [ $EXIT_CODE = 1 ]; then
echo "OK 👍: docker container exited with code 1 and with the correct error message"
else
echo "Fail 😞: docker container did not exit with code 1 or with a different error message"
exit 1
fi
16 changes: 16 additions & 0 deletions .github/integration-test/test-data/get-mii-testdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

MII_TESTDATA_DOWNLOAD_URL="https://health-atlas.de/data_files/594/download?version=1"

wget -O testdata.zip "$MII_TESTDATA_DOWNLOAD_URL"
unzip testdata.zip -d testdata-temp
cd testdata-temp/Vorhofflimmern || exit

for file in *.json.zip
do
unzip -o "$file" -d ../../.github/integration-test/Vorhofflimmern
done

cd ../../
rm testdata.zip
rm -rf testdata-temp
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,27 @@ jobs:
- name: Run Integration Test for Unique Count with Components and with CSV
run: .github/integration-test/evaluate-unique-count-with-components-to-csv.sh /${PWD}/.github/integration-test/measures/unique-count-with-components-measure.json

- name: Run Integration Test to check if it correctly exits when there are insufficient writing permissions
run: .github/integration-test/missing-permissions-test.sh

- name: Remove Blaze volumes
run: docker compose -f .github/integration-test/docker-compose.yml down -v

- name: Run Blaze with fresh volumes
run: docker compose -f .github/integration-test/docker-compose.yml up -d

- name: Wait for Blaze
run: .github/scripts/wait-for-url.sh http://localhost:8082/health

- name: Download New Data
run: .github/integration-test/test-data/get-mii-testdata.sh

- name: Upload New Data
run: blazectl --no-progress --server http://localhost:8082/fhir upload .github/integration-test/Vorhofflimmern

- name: Run Integration Test multiple stratifiers
run: .github/integration-test/evaluate-multiple-stratifiers.sh /${PWD}/.github/integration-test/measures/multiple-stratifiers.json


push-image:
needs:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ build/

### VS Code ###
.vscode/
output

docker/.env
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed
### Security

## [1.0.0] - 2024-09-25

### Added
- Add Retry to DataStore
- Add Writing Permission Check to Docker Entrypoint
- Add Docker Compose File
- Add Immutable Individuals of Populations to Prevent Further Bugs

### Changed
- Update KDS Measure
- Improve Readme

### Fixed
- Fix Wrong Unique Count

## [0.1.0] - 2024-08-08

### Added
Expand Down
Loading