Skip to content

Commit

Permalink
Merge pull request #1043 from samply/release-v0.22.0
Browse files Browse the repository at this point in the history
Release v0.22.0
  • Loading branch information
alexanderkiel authored Jul 2, 2023
2 parents 6d8bb1f + f39c04d commit a451304
Show file tree
Hide file tree
Showing 398 changed files with 32,136 additions and 1,753 deletions.
4 changes: 4 additions & 0 deletions .github/scripts/check-capability-statement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ CAPABILITY_STATEMENT=$(curl -sH 'Accept: application/fhir+json' "$BASE/metadata"

test "software name" "$(echo "$CAPABILITY_STATEMENT" | jq -r .software.name)" "Blaze"
test "URL" "$(echo "$CAPABILITY_STATEMENT" | jq -r .implementation.url)" "http://localhost:8080/fhir"

test "Operation Measure \$evaluate-measure Definition" "$(echo "$CAPABILITY_STATEMENT" | jq -r '.rest[0].resource[] | select(.type == "Measure") .operation[] | select(.name == "evaluate-measure") | .definition')" "http://hl7.org/fhir/OperationDefinition/Measure-evaluate-measure"
test "Operation Patient \$everything Definition" "$(echo "$CAPABILITY_STATEMENT" | jq -r '.rest[0].resource[] | select(.type == "Patient") .operation[] | select(.name == "everything") | .definition')" "http://hl7.org/fhir/OperationDefinition/Patient-everything"
test "Operation Patient \$everything Documentation" "$(echo "$CAPABILITY_STATEMENT" | jq -r '.rest[0].resource[] | select(.type == "Patient") .operation[] | select(.name == "everything") | .documentation')" "Returns all resources from the patient compartment of one concrete patient including the patient. Has a fix limit of 10,000 resources. Paging ist not supported. No params are supported."
36 changes: 36 additions & 0 deletions .github/scripts/check-frontend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash -e

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
. "$SCRIPT_DIR/util.sh"

BASE="http://localhost:8080/fhir"

echo "checking index.html using the Accept header..."
HEADERS=$(curl -s -H 'Accept: text/html' -o /dev/null -D - "$BASE")
CONTENT_TYPE_HEADER=$(echo "$HEADERS" | grep -i 'Content-Type' | tr -d '\r' | cut -d' ' -f2)

test "Content-Type header" "$CONTENT_TYPE_HEADER" "text/html"

echo "checking index.html using the _format query param..."
HEADERS=$(curl -s -o /dev/null -D - "$BASE?_format=html")
CONTENT_TYPE_HEADER=$(echo "$HEADERS" | grep -i 'Content-Type' | tr -d '\r' | cut -d' ' -f2)

test "Content-Type header" "$CONTENT_TYPE_HEADER" "text/html"

echo "checking version.json..."
HEADERS=$(curl -s -H 'Accept: text/html' -o /dev/null -D - "$BASE/__frontend/version.json")
CONTENT_TYPE_HEADER=$(echo "$HEADERS" | grep -i 'Content-Type' | tr -d '\r' | cut -d' ' -f2)

test "Content-Type header" "$CONTENT_TYPE_HEADER" "application/json"

echo "checking system-search using the Accept header..."
HEADERS=$(curl -s -H 'Accept: application/fhir+json' -o /dev/null -D - "$BASE")
CONTENT_TYPE_HEADER=$(echo "$HEADERS" | grep -i 'Content-Type' | tr -d '\r' | cut -d' ' -f2)

test "Content-Type header" "$CONTENT_TYPE_HEADER" "application/fhir+json;charset=utf-8"

echo "checking system-search using the _format query param..."
HEADERS=$(curl -s -o /dev/null -D - "$BASE?_format=json")
CONTENT_TYPE_HEADER=$(echo "$HEADERS" | grep -i 'Content-Type' | tr -d '\r' | cut -d' ' -f2)

test "Content-Type header" "$CONTENT_TYPE_HEADER" "application/fhir+json;charset=utf-8"
14 changes: 14 additions & 0 deletions .github/scripts/patient-everything.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -e

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
. "$SCRIPT_DIR/util.sh"

BASE="http://localhost:8080/fhir"
PATIENT_IDENTIFIER="X79746011X"
PATIENT_ID=$(curl -s "$BASE/Patient?identifier=$PATIENT_IDENTIFIER" | jq -r '.entry[0].resource.id')
BUNDLE=$(curl -s "$BASE/Patient/$PATIENT_ID/\$everything")
ACTUAL_SIZE=$(echo "$BUNDLE" | jq -r .total)

test "size" "$ACTUAL_SIZE" "3424"

test "type counts" "$(echo "$BUNDLE" | jq -r '.entry | group_by(.resource.resourceType)[] | [.[0].resource.resourceType, length] | @csv')" "$(cat "$SCRIPT_DIR/patient-everything/$PATIENT_IDENTIFIER-type-counts.csv")"
16 changes: 16 additions & 0 deletions .github/scripts/patient-everything/X79746011X-type-counts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"CarePlan",5
"CareTeam",10
"Claim",176
"Condition",15
"DiagnosticReport",231
"DocumentReference",78
"Encounter",78
"ExplanationOfBenefit",78
"ImagingStudy",45
"Immunization",13
"MedicationAdministration",180
"MedicationRequest",98
"Observation",2265
"Patient",1
"Procedure",150
"Provenance",1
49 changes: 49 additions & 0 deletions .github/scripts/patient-identical-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash -e

#
# This script tests that an update without changes of the resource content
# doesn't create a new history entry.
#

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
. "$SCRIPT_DIR/util.sh"

bundle() {
cat <<END
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"resource": $1,
"request": {
"method": "PUT",
"url": "Patient/$2"
}
}
]
}
END
}

BASE="http://localhost:8080/fhir"
PATIENT_IDENTIFIER="X79746011X"
PATIENT=$(curl -sH "Accept: application/fhir+json" "$BASE/Patient?identifier=$PATIENT_IDENTIFIER" | jq -cM '.entry[0].resource')
ID="$(echo "$PATIENT" | jq -r .id)"
VERSION_ID="$(echo "$PATIENT" | jq -r .meta.versionId)"

# Update Interaction
RESULT=$(curl -sXPUT -H "Content-Type: application/fhir+json" -d "$PATIENT" "$BASE/Patient/$ID")
RESULT_VERSION_ID="$(echo "$RESULT" | jq -r .meta.versionId)"

test "update versionId" "$RESULT_VERSION_ID" "$VERSION_ID"

# Transaction Interaction
RESULT=$(curl -sH "Content-Type: application/fhir+json" -H "Prefer: return=representation" -d "$(bundle "$PATIENT" "$ID")" "$BASE")
RESULT_VERSION_ID="$(echo "$RESULT" | jq -r '.entry[0].resource.meta.versionId')"

test "transaction versionId" "$RESULT_VERSION_ID" "$VERSION_ID"

HISTORY_TOTAL=$(curl -sH "Accept: application/fhir+json" "$BASE/Patient/$ID/_history" | jq -r '.total')

test "history total" "$HISTORY_TOTAL" "1"
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
- kv
- luid
- metrics
- module-base
- openid-auth
- operation-graphql
- operation-measure-evaluate-measure
Expand Down Expand Up @@ -617,6 +618,12 @@ jobs:
- name: Read Ignores T
run: .github/scripts/read-ignores-t.sh

- name: Patient Everything
run: .github/scripts/patient-everything.sh

- name: Patient Identical Update
run: .github/scripts/patient-identical-update.sh

not-enforcing-referential-integrity-test:
needs: build
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -1060,6 +1067,32 @@ jobs:
- name: Download Both Resources
run: test "2" = "$(curl -s http://localhost:8080/fhir/Binary | jq .total)"

frontend-test:
needs: build
runs-on: ubuntu-22.04

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Download Blaze Image
uses: actions/download-artifact@v3
with:
name: blaze-image
path: /tmp

- name: Load Blaze Image
run: docker load --input /tmp/blaze.tar

- name: Run Blaze
run: docker run --name blaze -d -e JAVA_TOOL_OPTIONS=-Xmx2g -e ENABLE_FRONTEND=true -p 8080:8080 -v blaze-data:/app/data blaze:latest

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

- name: Check Frontend
run: .github/scripts/check-frontend.sh

missing-resource-content-test:
needs: build
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -1487,6 +1520,12 @@ jobs:
- name: Read Ignores T
run: .github/scripts/read-ignores-t.sh

- name: Patient Everything
run: .github/scripts/patient-everything.sh

- name: Patient Identical Update
run: .github/scripts/patient-identical-update.sh

- name: Docker Stats
run: docker stats --no-stream

Expand Down Expand Up @@ -1586,9 +1625,11 @@ jobs:
- openid-auth-test
- doc-copy-data-test
- big-binary-test
- frontend-test
- missing-resource-content-test
- distributed-test
- jepsen-distributed-test
- custom-search-parameters-test
runs-on: ubuntu-22.04
permissions:
packages: write
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ target
classes
.cpcache
.cache
blaze-load-tests/node_modules
.nrepl-port
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## v0.22.0

It's not recommended to downgrade from this version to an older version because [#1041](https://github.com/samply/blaze/pull/1041) introduces a new transaction command called `keep` that would be ignored by older versions. However the transaction log is only read at the moment transactions happen or if the index is rebuild. So it will be ok to downgrade in emergency without rebuilding the index.

### New Features

* Implement Operation Patient $everything ([#1037](https://github.com/samply/blaze/pull/1037))
* Add Basic Frontend ([#951](https://github.com/samply/blaze/pull/951))

### Enhancements

* Ensure History Changes only if Resource Changes ([#1041](https://github.com/samply/blaze/pull/1041))

### Performance

* Improve Database Sync Efficiency ([#1039](https://github.com/samply/blaze/pull/1039))

### Bugfixes

* Fix Evaluate Measure Generating Duplicate List IDs ([#1036](https://github.com/samply/blaze/pull/1036))
* Fix Comparison of Length Result not Possible in CQL ([#1035](https://github.com/samply/blaze/pull/1035))

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

## v0.21.0

### New Features
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:17.0.7_7-jre-jammy

RUN apt-get update && apt-get upgrade -y && \
apt-get install libjemalloc2 -y && \
Expand All @@ -7,14 +7,15 @@ RUN apt-get update && apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/

RUN mkdir -p /app/data && chown 1001:1001 /app/data
COPY target/blaze-0.21.0-standalone.jar /app/
COPY target/blaze-0.22.0-standalone.jar /app/

WORKDIR /app
USER 1001

ENV LD_PRELOAD="libjemalloc.so.2"
ENV STORAGE="standalone"
ENV INDEX_DB_DIR="/app/data/index"
ENV TRANSACTION_DB_DIR="/app/data/transaction"
ENV RESOURCE_DB_DIR="/app/data/resource"

CMD ["sh", "-c", "LD_PRELOAD=/usr/lib/$(arch)-linux-gnu/libjemalloc.so.2 exec java -jar blaze-0.21.0-standalone.jar"]
CMD ["java", "-jar", "blaze-0.22.0-standalone.jar"]
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ clean-root:

clean: $(MODULES) clean-root

uberjar: prep
build-frontend:
$(MAKE) -C modules/frontend build

uberjar: prep build-frontend
clojure -T:build uber

outdated:
Expand All @@ -35,4 +38,4 @@ deps-tree:
deps-list:
clojure -X:deps list

.PHONY: $(MODULES) lint-root lint prep test-root test test-coverage clean-root clean uberjar outdated deps-tree deps-list
.PHONY: $(MODULES) lint-root lint prep test-root test test-coverage clean-root clean build-frontend uberjar outdated deps-tree deps-list
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The goal of this project is to provide a FHIR® Store with an internal CQL Evalu

Blaze passes all [Touchstone FHIR 4.0.1 Basic Tests][12] and almost all [CQL Tests][3]. Please refer to the [Conformance](docs/conformance.md) section and report any issues you encounter during evaluation.

Latest release: [v0.21.0][5]
Latest release: [v0.22.0][5]

## Quick Start

Expand All @@ -25,7 +25,7 @@ In order to run Blaze just execute the following:

```sh
docker volume create blaze-data
docker run -p 8080:8080 -v blaze-data:/app/data samply/blaze:0.21
docker run -p 8080:8080 -v blaze-data:/app/data samply/blaze:0.22
```

Blaze will create multiple directories inside the `blaze-data` volume on its first start and use the same directories on subsequent starts.
Expand Down Expand Up @@ -74,7 +74,7 @@ Unless required by applicable law or agreed to in writing, software distributed

[3]: <https://cql.hl7.org/tests.html>
[4]: <https://alexanderkiel.gitbook.io/blaze/deployment>
[5]: <https://github.com/samply/blaze/releases/tag/v0.21.0>
[5]: <https://github.com/samply/blaze/releases/tag/v0.22.0>
[6]: <https://www.yourkit.com/java/profiler/>
[7]: <https://www.yourkit.com/.net/profiler/>
[8]: <https://www.yourkit.com/youmonitor/>
Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require [clojure.tools.build.api :as b]))

(def lib 'samply/blaze)
(def version "0.21.0")
(def version "0.22.0")
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
Expand Down
18 changes: 13 additions & 5 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{:paths ["src" "resources"]

:deps
{blaze/db-resource-store-cassandra
{blaze/admin-api
{:local/root "modules/admin-api"}

blaze/db-resource-store-cassandra
{:local/root "modules/db-resource-store-cassandra"}

blaze/db-tx-log-kafka
{:local/root "modules/db-tx-log-kafka"}

blaze/frontend
{:local/root "modules/frontend"}

blaze/interaction
{:local/root "modules/interaction"}

Expand All @@ -16,6 +22,9 @@
blaze.operation/measure-evaluate-measure
{:local/root "modules/operation-measure-evaluate-measure"}

blaze.operation/patient-everything
{:local/root "modules/operation-patient-everything"}

blaze/openid-auth
{:local/root "modules/openid-auth"}

Expand Down Expand Up @@ -69,7 +78,7 @@
:kaocha
{:extra-deps
{lambdaisland/kaocha
{:mvn/version "1.71.1119"}}
{:mvn/version "1.85.1342"}}

:main-opts ["-m" "kaocha.runner"]}

Expand All @@ -83,7 +92,7 @@
:outdated
{:replace-deps
{com.github.liquidz/antq
{:mvn/version "2.4.1070"}
{:mvn/version "2.5.1095"}

org.slf4j/slf4j-nop
{:mvn/version "2.0.7"}}
Expand Down Expand Up @@ -133,5 +142,4 @@
"--exclude" "com.taoensso/timbre"
"--exclude" "org.antlr/antlr4"
"--exclude" "org.clojure/alpha.spec"
"--exclude" "com.walmartlabs/lacinia"
"--exclude" "lambdaisland/kaocha"]}}}
"--exclude" "com.walmartlabs/lacinia"]}}}
4 changes: 1 addition & 3 deletions dev/blaze/dev.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
[clojure.spec.test.alpha :as st]
[clojure.tools.namespace.repl :refer [refresh]]
[java-time.api :as time]
[taoensso.timbre :as log])
(:import
[com.github.benmanes.caffeine.cache Cache]))
[taoensso.timbre :as log]))


;; Spec Instrumentation
Expand Down
3 changes: 3 additions & 0 deletions dev/blaze/dev/rocksdb.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@
:db (.getDbName status)
:cf (.getCfName status)})
(.getThreadList (Env/getDefault)))

(rocksdb/table-properties (index-kv-store) :resource-as-of-index)

)
Loading

0 comments on commit a451304

Please sign in to comment.