Skip to content

Commit

Permalink
Merge pull request #1058 from samply/release-v0.22.1
Browse files Browse the repository at this point in the history
Release v0.22.1
  • Loading branch information
alexanderkiel authored Aug 22, 2023
2 parents a451304 + 647020a commit 23571b7
Show file tree
Hide file tree
Showing 328 changed files with 4,777 additions and 2,247 deletions.
2 changes: 1 addition & 1 deletion .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:lint-as
{blaze.test-util/with-system clojure.core/with-open}
{blaze.module.test-util/with-system clojure.core/with-open}

:linters
{:unsorted-required-namespaces
Expand Down
8 changes: 4 additions & 4 deletions .github/scripts/authenticated-request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ fi
BASE="http://localhost:8080/fhir"

if [ "200" = "$(curl -s --oauth2-bearer "$ACCESS_TOKEN" -o /dev/null -w '%{response_code}' "$BASE")" ]; then
echo "OK: successful authenticated system search request"
echo "OK 👍: successful authenticated system search request"
else
echo "Fail: failed authenticated system search request"
echo "Fail 😞: failed authenticated system search request"
exit 1
fi

if [ "200" = "$(curl -s --oauth2-bearer "$ACCESS_TOKEN" -H "Content-Type: application/fhir+json" -d @.github/openid-auth-test/batch-bundle.json "$BASE" | jq -r '.entry[].response.status')" ]; then
echo "OK: successful authenticated batch request"
echo "OK 👍: successful authenticated batch request"
else
echo "Fail: failed authenticated batch request"
echo "Fail 😞: failed authenticated batch request"
exit 1
fi
16 changes: 8 additions & 8 deletions .github/scripts/batch-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ RESULT=$(curl -sH "Content-Type: application/fhir+json" -d "$(bundle)" "$BASE")

RESOURCE_TYPE="$(echo "$RESULT" | jq -r .resourceType)"
if [ "$RESOURCE_TYPE" = "Bundle" ]; then
echo "OK: the resource type is Bundle"
echo "OK 👍: the resource type is Bundle"
else
echo "Fail: the resource type is $RESOURCE_TYPE, expected Bundle"
echo "Fail 😞: the resource type is $RESOURCE_TYPE, expected Bundle"
exit 1
fi

BUNDLE_TYPE="$(echo "$RESULT" | jq -r .type)"
if [ "$BUNDLE_TYPE" = "batch-response" ]; then
echo "OK: the bundle type is batch-response"
echo "OK 👍: the bundle type is batch-response"
else
echo "Fail: the bundle type is $BUNDLE_TYPE, expected batch-response"
echo "Fail 😞: the bundle type is $BUNDLE_TYPE, expected batch-response"
exit 1
fi

RESPONSE_STATUS="$(echo "$RESULT" | jq -r .entry[].response.status)"
if [ "$RESPONSE_STATUS" = "200" ]; then
echo "OK: the response status is 200"
echo "OK 👍: the response status is 200"
else
echo "Fail: the response status is $RESPONSE_STATUS, expected 200"
echo "Fail 😞: the response status is $RESPONSE_STATUS, expected 200"
exit 1
fi

RESPONSE_RESOURCE_TYPE="$(echo "$RESULT" | jq -r .entry[].resource.resourceType)"
if [ "$RESPONSE_RESOURCE_TYPE" = "CapabilityStatement" ]; then
echo "OK: resource type is CapabilityStatement"
echo "OK 👍: resource type is CapabilityStatement"
else
echo "Fail: resource type was $RESPONSE_RESOURCE_TYPE but should be CapabilityStatement"
echo "Fail 😞: resource type was $RESPONSE_RESOURCE_TYPE but should be CapabilityStatement"
exit 1
fi
16 changes: 8 additions & 8 deletions .github/scripts/batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,32 @@ RESULT=$(curl -sH "Content-Type: application/fhir+json" -d "$(bundle)" "$BASE")

RESOURCE_TYPE="$(echo "$RESULT" | jq -r .resourceType)"
if [ "$RESOURCE_TYPE" = "Bundle" ]; then
echo "OK: the resource type is Bundle"
echo "OK 👍: the resource type is Bundle"
else
echo "Fail: the resource type is $RESOURCE_TYPE, expected Bundle"
echo "Fail 😞: the resource type is $RESOURCE_TYPE, expected Bundle"
exit 1
fi

BUNDLE_TYPE="$(echo "$RESULT" | jq -r .type)"
if [ "$BUNDLE_TYPE" = "batch-response" ]; then
echo "OK: the bundle type is batch-response"
echo "OK 👍: the bundle type is batch-response"
else
echo "Fail: the bundle type is $BUNDLE_TYPE, expected batch-response"
echo "Fail 😞: the bundle type is $BUNDLE_TYPE, expected batch-response"
exit 1
fi

RESPONSE_STATUS="$(echo "$RESULT" | jq -r .entry[].response.status)"
if [ "$RESPONSE_STATUS" = "200" ]; then
echo "OK: the response status is 200"
echo "OK 👍: the response status is 200"
else
echo "Fail: the response status is $RESPONSE_STATUS, expected 200"
echo "Fail 😞: the response status is $RESPONSE_STATUS, expected 200"
exit 1
fi

RESPONSE_PATIENT_ID="$(echo "$RESULT" | jq -r .entry[].resource.id)"
if [ "$RESPONSE_PATIENT_ID" = "$PATIENT_ID" ]; then
echo "OK: patient id's match"
echo "OK 👍: patient id's match"
else
echo "Fail: response patient id was $RESPONSE_PATIENT_ID but should be $PATIENT_ID"
echo "Fail 😞: response patient id was $RESPONSE_PATIENT_ID but should be $PATIENT_ID"
exit 1
fi
4 changes: 2 additions & 2 deletions .github/scripts/chaining-without-referential-integrity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ curl -sXPUT -d '{"resourceType" : "Patient", "id": "0", "gender": "male"}' -H 'C
RESULT="$(curl -sH 'Prefer: handling=strict' -H 'Accept: application/fhir+json' "$BASE/Observation?patient.gender=male&_summary=count" | jq -r '.total')"

if [ "$RESULT" = "1" ]; then
echo "Success: chaining works"
echo "OK 👍: chaining works"
else
echo "Fail: chaining doesn't work"
echo "Fail 😞: chaining doesn't work"
exit 1
fi
2 changes: 1 addition & 1 deletion .github/scripts/check-date-search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ size() {
if [ "$DOWNLOAD_SIZE" = "$COUNT_SIZE" ]; then
echo "$DOWNLOAD_SIZE"
else
echo "Fail: the download size is $DOWNLOAD_SIZE, expected $COUNT_SIZE"
echo "Fail 😞: the download size is $DOWNLOAD_SIZE, expected $COUNT_SIZE"
exit 1
fi
}
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/check-referential-integrity-enforced.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ENFORCED=$(curl -s http://localhost:8080/fhir/metadata | jq -r 'isempty(.rest[].resource[].referencePolicy[] | select(. == "enforced")) | not')

if [ "true" = "$ENFORCED" ]; then
echo "Success"
echo "OK 👍"
else
echo "Fail"
echo "Fail 😞"
exit 1
fi
4 changes: 2 additions & 2 deletions .github/scripts/check-referential-integrity-not-enforced.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ENFORCED=$(curl -s http://localhost:8080/fhir/metadata | jq -r 'isempty(.rest[].resource[].referencePolicy[] | select(. == "enforced")) | not')

if [ "false" = "$ENFORCED" ]; then
echo "Success"
echo "OK 👍"
else
echo "Fail"
echo "Fail 😞"
exit 1
fi
8 changes: 4 additions & 4 deletions .github/scripts/conditional-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ STATUS=$(curl -sH "Content-Type: application/fhir+json" \
-d "$(bundle)" "$BASE" | jq -r '.entry[].response.status')

if [ "$STATUS" = "201" ]; then
echo "OK: first attempt created the Organization"
echo "OK 👍: first attempt created the Organization"
else
echo "Fail: status was ${STATUS} but should be 201"
echo "Fail 😞: status was ${STATUS} but should be 201"
exit 1
fi

STATUS=$(curl -sH "Content-Type: application/fhir+json" \
-d "$(bundle)" "$BASE" | jq -r '.entry[].response.status')

if [ "$STATUS" = "200" ]; then
echo "OK: second attempt returned the already created Organization"
echo "OK 👍: second attempt returned the already created Organization"
else
echo "Fail: status was ${STATUS} but should be 200"
echo "Fail 😞: status was ${STATUS} but should be 200"
exit 1
fi
20 changes: 10 additions & 10 deletions .github/scripts/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ PATIENT_HISTORY=$(curl -s "$BASE/Patient/$PATIENT_ID/_history")

TOTAL=$(echo "$PATIENT_HISTORY" | jq .total)
if [ "$TOTAL" = "1" ]; then
echo "OK: patient history has one entry"
echo "OK 👍: patient history has one entry"
else
echo "Fail: patient history has $TOTAL entries"
echo "Fail 😞: patient history has $TOTAL entries"
exit 1
fi

METHOD=$(echo "$PATIENT_HISTORY" | jq -r .entry[].request.method)
if [ "$METHOD" = "DELETE" ]; then
echo "OK: patient history entry has method DELETE"
echo "OK 👍: patient history entry has method DELETE"
else
echo "Fail: patient history entry has method $METHOD"
echo "Fail 😞: patient history entry has method $METHOD"
exit 1
fi

STATUS=$(echo "$PATIENT_HISTORY" | jq -r .entry[].response.status)
if [ "$STATUS" = "204" ]; then
echo "OK: patient history entry has status 204"
echo "OK 👍: patient history entry has status 204"
else
echo "Fail: patient history entry has status $STATUS"
echo "Fail 😞: patient history entry has status $STATUS"
exit 1
fi

PATIENT_STATUS=$(curl -is "$BASE/Patient/$PATIENT_ID" | grep HTTP | tr -d '\r\n')
if [ "$PATIENT_STATUS" = "HTTP/1.1 410 Gone" ]; then
echo "OK: patient status is HTTP/1.1 410 Gone"
echo "OK 👍: patient status is HTTP/1.1 410 Gone"
else
echo "Fail: patient status is $PATIENT_STATUS"
echo "Fail 😞: patient status is $PATIENT_STATUS"
exit 1
fi

PATIENT_OUTCOME=$(curl -s "$BASE/Patient/$PATIENT_ID")

CODE=$(echo "$PATIENT_OUTCOME" | jq -r .issue[].code)
if [ "$CODE" = "deleted" ]; then
echo "OK: patient outcome has code deleted"
echo "OK 👍: patient outcome has code deleted"
else
echo "Fail: patient outcome has code $CODE"
echo "Fail 😞: patient outcome has code $CODE"
exit 1
fi
16 changes: 8 additions & 8 deletions .github/scripts/download-resources-query-sort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ blazectl --no-progress --server "$BASE" download "$TYPE" -q "_sort=$SORT&$QUERY"

SIZE=$(wc -l "$FILE_NAME_PREFIX-get".ndjson | xargs | cut -d ' ' -f1)
if [ "$EXPECTED_SIZE" = "$SIZE" ]; then
echo "Success: download size matches for GET request"
echo "OK 👍: download size matches for GET request"
else
echo "Fail: download size was ${SIZE} but should be ${EXPECTED_SIZE} for GET request"
echo "Fail 😞: download size was ${SIZE} but should be ${EXPECTED_SIZE} for GET request"
exit 1
fi

blazectl --server "$BASE" download "$TYPE" -p -q "_sort=$SORT&$QUERY" -o "$FILE_NAME_PREFIX-post".ndjson

SIZE=$(wc -l "$FILE_NAME_PREFIX-post".ndjson | xargs | cut -d ' ' -f1)
if [ "$EXPECTED_SIZE" = "$SIZE" ]; then
echo "Success: download size matches for POST request"
echo "OK 👍: download size matches for POST request"
else
echo "Fail: download size was ${SIZE} but should be ${EXPECTED_SIZE} for POST request"
echo "Fail 😞: download size was ${SIZE} but should be ${EXPECTED_SIZE} for POST request"
exit 1
fi

if [ "$(diff "$FILE_NAME_PREFIX-get.ndjson" "$FILE_NAME_PREFIX-post.ndjson")" = "" ]; then
echo "Success: both downloads are identical"
echo "OK 👍: both downloads are identical"
else
echo "Fail: the GET and the POST download differ"
echo "Fail 😞: the GET and the POST download differ"
exit 1
fi

Expand All @@ -42,8 +42,8 @@ else
LAST_UPDATED_SORT=$(echo "$LAST_UPDATED" | sort)
fi
if [ "$LAST_UPDATED" = "$LAST_UPDATED_SORT" ]; then
echo "Success: resources are sorted"
echo "OK 👍: resources are sorted"
else
echo "Fail: resources are not sorted"
echo "Fail 😞: resources are not sorted"
exit 1
fi
12 changes: 6 additions & 6 deletions .github/scripts/download-resources-query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ blazectl --no-progress --server "$BASE" download "$TYPE" -q "$QUERY" -o "$FILE_N

SIZE=$(wc -l "$FILE_NAME_PREFIX-get".ndjson | xargs | cut -d ' ' -f1)
if [ "$EXPECTED_SIZE" = "$SIZE" ]; then
echo "Success: download size matches for GET request"
echo "OK 👍: download size matches for GET request"
else
echo "Fail: download size was ${SIZE} but should be ${EXPECTED_SIZE} for GET request"
echo "Fail 😞: download size was ${SIZE} but should be ${EXPECTED_SIZE} for GET request"
exit 1
fi

blazectl --server "$BASE" download "$TYPE" -p -q "$QUERY" -o "$FILE_NAME_PREFIX-post".ndjson

SIZE=$(wc -l "$FILE_NAME_PREFIX-post".ndjson | xargs | cut -d ' ' -f1)
if [ "$EXPECTED_SIZE" = "$SIZE" ]; then
echo "Success: download size matches for POST request"
echo "OK 👍: download size matches for POST request"
else
echo "Fail: download size was ${SIZE} but should be ${EXPECTED_SIZE} for POST request"
echo "Fail 😞: download size was ${SIZE} but should be ${EXPECTED_SIZE} for POST request"
exit 1
fi

if [ "$(diff "$FILE_NAME_PREFIX-get.ndjson" "$FILE_NAME_PREFIX-post.ndjson")" = "" ]; then
echo "Success: both downloads are identical"
echo "OK 👍: both downloads are identical"
else
echo "Fail: the GET and the POST download differ"
echo "Fail 😞: the GET and the POST download differ"
exit 1
fi
8 changes: 4 additions & 4 deletions .github/scripts/evaluate-measure-blazectl-stratifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ REPORT=$(blazectl --server "$BASE" evaluate-measure ".github/scripts/cql/$NAME.y
COUNT=$(echo "$REPORT" | jq '.group[0].population[0].count')

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

STRATIFIER_DATA=$(echo "$REPORT" | jq -r '.group[0].stratifier[0].stratum[] | [.value.text, .population[0].count] | @csv')
EXPECTED_STRATIFIER_DATA=$(cat ".github/scripts/cql/$NAME.csv")

if [ "$STRATIFIER_DATA" = "$EXPECTED_STRATIFIER_DATA" ]; then
echo "Success: stratifier data equals the expected stratifier data"
echo "OK 👍: stratifier data equals the expected stratifier data"
else
echo "Fail: stratifier data differs"
echo "Fail 😞: stratifier data differs"
echo "$STRATIFIER_DATA"
exit 1
fi
4 changes: 2 additions & 2 deletions .github/scripts/evaluate-measure-blazectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ EXPECTED_COUNT="$2"
COUNT=$(blazectl --server "$BASE" evaluate-measure ".github/scripts/cql/$NAME.yml" 2> /dev/null | jq '.group[0].population[0].count')

if [ "$COUNT" = "$EXPECTED_COUNT" ]; then
echo "Success: count ($COUNT) equals the expected count"
echo "OK 👍: count ($COUNT) equals the expected count"
else
echo "Fail: count ($COUNT) != $EXPECTED_COUNT"
echo "Fail 😞: count ($COUNT) != $EXPECTED_COUNT"
exit 1
fi
8 changes: 4 additions & 4 deletions .github/scripts/evaluate-measure-subject-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ REPORT=$(evaluate-measure "$BASE" "$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"
echo "OK 👍: count ($COUNT) equals the expected count"
else
echo "Fail: count ($COUNT) != $EXPECTED_COUNT"
echo "Fail 😞: count ($COUNT) != $EXPECTED_COUNT"
echo "Report:"
echo "$REPORT" | jq .
exit 1
Expand All @@ -134,9 +134,9 @@ PATIENT_BUNDLE=$(fetch-patients "$BASE" "$LIST_ID")
ID_COUNT=$(echo "$PATIENT_BUNDLE" | jq -r ".entry[].resource.id" | sort -u | wc -l | xargs)

if [ "$ID_COUNT" = "$EXPECTED_COUNT" ]; then
echo "Success: downloaded patient count ($ID_COUNT) equals the expected count"
echo "OK 👍: downloaded patient count ($ID_COUNT) equals the expected count"
else
echo "Fail: downloaded patient count ($ID_COUNT) != $EXPECTED_COUNT"
echo "Fail 😞: downloaded patient count ($ID_COUNT) != $EXPECTED_COUNT"
echo "Patient bundle:"
echo "$PATIENT_BUNDLE" | jq .
exit 1
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/evaluate-measure-timeout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ NAME="$1"
DIAGNOSTICS=$(blazectl --server "$BASE" evaluate-measure ".github/scripts/cql/$NAME.yml" 2> /dev/null | grep Diagnostics | cut -d: -f2 | xargs)

if [ "$DIAGNOSTICS" = "Timeout of 10 millis eclipsed while evaluating." ]; then
echo "Success: timeout happened"
echo "OK 👍: timeout happened"
else
echo "Fail: no timeout"
echo "Fail 😞: no timeout"
exit 1
fi
4 changes: 2 additions & 2 deletions .github/scripts/evaluate-measure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ REPORT=$(evaluate-measure "$BASE" "$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"
echo "OK 👍: count ($COUNT) equals the expected count"
else
echo "Fail: count ($COUNT) != $EXPECTED_COUNT"
echo "Fail 😞: count ($COUNT) != $EXPECTED_COUNT"
echo "Report:"
echo "$REPORT" | jq .
exit 1
Expand Down
Loading

0 comments on commit 23571b7

Please sign in to comment.