Skip to content

Commit

Permalink
Merge pull request #521 from samply/release-0.13.1
Browse files Browse the repository at this point in the history
Release v0.13.1
  • Loading branch information
alexanderkiel authored Nov 5, 2021
2 parents a5eb492 + 4fe9c09 commit dc0d779
Show file tree
Hide file tree
Showing 70 changed files with 775 additions and 408 deletions.
142 changes: 142 additions & 0 deletions .github/scripts/evaluate-measure-subject-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#!/usr/bin/env bash

# Usage: ./evaluate-measure-subject-list.sh -f <query>.cql <expected-count>

# Takes a CQL file, creates a Library resource from it, references that from a
# Measure resource and calls $evaluate-measure with reportType subject-list on it.

library() {
cat <<END
{
"resourceType": "Library",
"status": "active",
"type" : {
"coding" : [
{
"system": "http://terminology.hl7.org/CodeSystem/library-type",
"code" : "logic-library"
}
]
},
"content": [
{
"contentType": "text/cql"
}
]
}
END
}

measure() {
cat <<END
{
"resourceType": "Measure",
"status": "active",
"scoring": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
"code": "cohort"
}
]
},
"group": [
{
"population": [
{
"code": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-population",
"code": "initial-population"
}
]
},
"criteria": {
"language": "text/cql",
"expression": "InInitialPopulation"
}
}
]
}
]
}
END
}

parameters() {
cat <<END
{
"resourceType": "Parameters",
"parameter": [
{
"name": "periodStart",
"value": "2000"
},
{
"name": "periodEnd",
"value": "2030"
},
{
"name": "reportType",
"value": "subject-list"
}
]
}
END
}

create-library() {
library | jq -cM ".url = \"urn:uuid:$1\" | .content[0].data = \"$2\""
}

create-measure() {
measure | jq -cM ".url = \"urn:uuid:$1\" | .library[0] = \"urn:uuid:$2\""
}

post() {
curl -sH "Content-Type: application/fhir+json" -d @- "http://localhost:8080/fhir/$1"
}

evaluate-measure() {
parameters | curl -sH "Content-Type: application/fhir+json" -d @- "http://localhost:8080/fhir/Measure/$1/\$evaluate-measure"
}

fetch-patients() {
curl -s "http://localhost:8080/fhir/Patient?_list=$1&_count=100"
}

FILE=$1
EXPECTED_COUNT=$2

DATA=$(base64 "$FILE" | tr -d '\n')
LIBRARY_URI=$(uuidgen | tr '[:upper:]' '[:lower:]')
MEASURE_URI=$(uuidgen | tr '[:upper:]' '[:lower:]')

create-library "$LIBRARY_URI" "$DATA" | post "Library" > /dev/null

MEASURE_ID=$(create-measure "$MEASURE_URI" "$LIBRARY_URI" | post "Measure" | jq -r .id)
REPORT=$(evaluate-measure "$MEASURE_ID")
COUNT=$(echo "$REPORT" | jq -r ".group[0].population[0].count")

if [ "$COUNT" = "$EXPECTED_COUNT" ]; then
echo "Success: count ($COUNT) equals the expected count"
else
echo "Fail: count ($COUNT) != $EXPECTED_COUNT"
echo "Report:"
echo "$REPORT" | jq .
exit 1
fi

LIST_ID=$(echo "$REPORT" | jq -r '.group[0].population[0].subjectResults.reference | split("/")[1]')
PATIENT_BUNDLE=$(fetch-patients "$LIST_ID")
ID_COUNT=$(echo "$PATIENT_BUNDLE" | jq -r ".entry[].resource.id" | sort -u | wc -l | xargs | cut -d ' ' -f1)

if [ "$ID_COUNT" = "$EXPECTED_COUNT" ]; then
echo "Success: downloaded patient count ($ID_COUNT) equals the expected count"
else
echo "Fail: downloaded patient count ($ID_COUNT) != $EXPECTED_COUNT"
echo "Patient bundle:"
echo "$PATIENT_BUNDLE" | jq .
exit 1
fi
42 changes: 34 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- rest-util
- scheduler
- search-param-registry
- thread-pool-executor-collector

java-version:
- '11'
Expand All @@ -79,7 +80,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Check out Git repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -128,6 +129,7 @@ jobs:
- rest-util
- scheduler
- search-param-registry
- thread-pool-executor-collector

runs-on: ubuntu-20.04

Expand All @@ -141,7 +143,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Check out Git repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -183,7 +185,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Check out Git repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -211,7 +213,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Check out Git repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -296,7 +298,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Install Blazectl
run: .github/scripts/install-blazectl.sh
Expand Down Expand Up @@ -383,18 +385,30 @@ jobs:
- name: Evaluate CQL Query 1
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q1-query.cql 56

- name: Evaluate CQL Query 1 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q1-query.cql 56

- name: Evaluate CQL Query 1 on Individual Patients
run: .github/scripts/evaluate-patient-q1-measure.sh

- name: Evaluate CQL Query 2
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q2-query.cql 42

- name: Evaluate CQL Query 2 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q2-query.cql 42

- name: Evaluate CQL Query 7
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q7-query.cql 81

- name: Evaluate CQL Query 7 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q7-query.cql 81

- name: Evaluate CQL Query 14
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q14-query.cql 96

- name: Evaluate CQL Query 14 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q14-query.cql 96

- name: Forwarded Header HTTPS
run: .github/scripts/forwarded-header.sh https

Expand Down Expand Up @@ -436,7 +450,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Check out Git repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -528,7 +542,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: APT Update
run: sudo apt-get update
Expand Down Expand Up @@ -636,18 +650,30 @@ jobs:
- name: Evaluate CQL Query 1
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q1-query.cql 56

- name: Evaluate CQL Query 1 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q1-query.cql 56

- name: Evaluate CQL Query 1 on Individual Patients
run: .github/scripts/evaluate-patient-q1-measure.sh

- name: Evaluate CQL Query 2
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q2-query.cql 42

- name: Evaluate CQL Query 2 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q2-query.cql 42

- name: Evaluate CQL Query 7
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q7-query.cql 81

- name: Evaluate CQL Query 7 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q7-query.cql 81

- name: Evaluate CQL Query 14
run: .github/scripts/evaluate-measure.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q14-query.cql 96

- name: Evaluate CQL Query 14 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q14-query.cql 96

- name: Forwarded Header HTTPS
run: .github/scripts/forwarded-header.sh https

Expand Down Expand Up @@ -692,7 +718,7 @@ jobs:
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.986'
tools-deps: '1.10.3.1013'

- name: Check out Git repository
uses: actions/checkout@v2
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v0.13.1

### Bugfixes

* Fix Encoding of Parameters at Operation POST Requests ([#513](https://github.com/samply/blaze/issues/513))

### Other

* Move to OpenJDK ([#518](https://github.com/samply/blaze/issues/518))

The full changelog can be found [here](https://github.com/samply/blaze/milestone/16?closed=1).

## v0.13.0

### New Features
Expand Down
13 changes: 13 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Development

## Release Checklist

* create a release branch called `release-v<version>` like `release-v0.13.1`
* rename every occurance of the old version, say `0.13.0` into the new version, say `0.13.1`
* update the last changed date in `blaze.rest-api.capabilities`
* update the CHANGELOG based on the milestone
* create a commit with the title `Release v<version>`
* create a PR from the release branch into master
* merge that PR
* create and push a tag called `v<version>` like `v0.13.1` on master at the merge commit
* merge the release branch back into develop
* create release notes on GitHub

## Style Guide

The Clojure code in this project follows the [Clojure Style Guide][2].
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-focal
FROM openjdk:17

RUN mkdir -p /app/data && chown 1001:1001 /app/data
COPY target/blaze-standalone.jar /app/
Expand Down
10 changes: 5 additions & 5 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
{:local/root "modules/thread-pool-executor-collector"}

io.netty/netty-codec-http
{:mvn/version "4.1.69.Final"}
{:mvn/version "4.1.70.Final"}

io.netty/netty-handler-proxy
{:mvn/version "4.1.69.Final"}
{:mvn/version "4.1.70.Final"}

io.netty/netty-resolver-dns
{:mvn/version "4.1.69.Final"}
{:mvn/version "4.1.70.Final"}

io.netty/netty-transport-native-epoll$linux-x86_64
{:mvn/version "4.1.69.Final"}
{:mvn/version "4.1.70.Final"}

io.prometheus/simpleclient_hotspot
{:mvn/version "0.11.0"}
Expand Down Expand Up @@ -85,7 +85,7 @@
{:mvn/version "0.4.6"}

lambdaisland/kaocha
{:mvn/version "1.0.902"}
{:mvn/version "1.60.945"}

org.clojure/tools.namespace
{:mvn/version "1.1.0"}}
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Each Blaze Process runs in a [JVM][6]. In the standalone case, in addition to th

## Other Work

The architecture of Blaze is inspired by the architecture of [CRUX][9] but optimized for the FHIR use-case.
The architecture of Blaze is inspired by the architecture of [XTDB][9] but optimized for the FHIR use-case.

[1]: <https://rocksdb.org>
[2]: <https://en.wikipedia.org/wiki/ACID>
Expand All @@ -44,4 +44,4 @@ The architecture of Blaze is inspired by the architecture of [CRUX][9] but optim
[6]: <https://en.wikipedia.org/wiki/Java_virtual_machine>
[7]: <https://www.hl7.org/fhir/http.html#history>
[8]: <https://www.hl7.org/fhir/http.html>
[9]: <https://www.opencrux.com>
[9]: <https://xtdb.com>
2 changes: 1 addition & 1 deletion docs/cql-queries/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Under `group[0].population[0].count` the result of the query can be found.
By default, the evaluation results in a MeasureReport of type `summary`. Such a MeasureReport contains only the number of resources of each population. However, if you also need the resources itself, you can have a MeasureReport of type `subject-list` generated. This works as follows:

```sh
curl -sXPOST 'http://localhost:8080/fhir/Measure/$evaluate-measure?measure=urn:uuid:49f4c7de-3320-4208-8e60-ecc0d8824e08&periodStart=2000&periodEnd=2030&reportType=subject-list'
curl -sd '{"resourceType": "Parameters", "parameter": [{"name": "periodStart", "value": "2000"}, {"name": "periodEnd", "value": "2030"}, {"name": "measure", "value": "urn:uuid:49f4c7de-3320-4208-8e60-ecc0d8824e08"}, {"name": "reportType", "value": "subject-list"}]}' -H "Content-Type: application/fhir+json" 'http://localhost:8080/fhir/Measure/$evaluate-measure'
```

the result should be the following MeasureReport:
Expand Down
Loading

0 comments on commit dc0d779

Please sign in to comment.