-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The environment variable FHIR_OPERATION_EVALUATE_MEASURE_TIMEOUT can be used to set a evaluate measure timeout in milliseconds. The default value will be 1 hour in order to prevent overly long evaluations from slowing down Blaze. At the same time the default should not change the behaviour of normal evaluations.
- Loading branch information
1 parent
0619211
commit f40de05
Showing
21 changed files
with
296 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
BASE="http://localhost:8080/fhir" | ||
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" | ||
else | ||
echo "Fail: no timeout" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
...les/operation-measure-evaluate-measure/src/blaze/fhir/operation/evaluate_measure/spec.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
(ns blaze.fhir.operation.evaluate-measure.spec | ||
(:require | ||
[blaze.executors :as ex] | ||
[clojure.spec.alpha :as s])) | ||
[blaze.fhir.operation.evaluate-measure :as-alias measure] | ||
[clojure.spec.alpha :as s] | ||
[java-time.api :as time])) | ||
|
||
|
||
(s/def :blaze.fhir.operation.evaluate-measure/executor | ||
(s/def ::measure/executor | ||
ex/executor?) | ||
|
||
|
||
(s/def :blaze.fhir.operation.evaluate-measure/num-threads | ||
(s/def ::measure/num-threads | ||
pos-int?) | ||
|
||
|
||
(s/def ::measure/timeout | ||
time/duration?) | ||
|
||
|
||
(s/def :blaze.fhir.operation.evaluate-measure.timeout/millis | ||
nat-int?) |
31 changes: 31 additions & 0 deletions
31
...peration-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/cql/spec.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(ns blaze.fhir.operation.evaluate-measure.cql.spec | ||
(:require | ||
[blaze.elm.compiler :as-alias compiler] | ||
[blaze.fhir.operation.evaluate-measure.cql :as-alias cql] | ||
[clojure.spec.alpha :as s] | ||
[java-time.api :as time])) | ||
|
||
|
||
(s/def ::cql/now | ||
time/offset-date-time?) | ||
|
||
|
||
(s/def ::cql/timeout-eclipsed? | ||
ifn?) | ||
|
||
|
||
(s/def ::cql/timeout | ||
time/duration?) | ||
|
||
|
||
(s/def ::cql/context | ||
(s/keys :req-un [:blaze.db/db ::cql/now ::cql/timeout-eclipsed? ::cql/timeout | ||
::compiler/expression-defs])) | ||
|
||
|
||
(s/def ::cql/parameters | ||
(s/map-of string? any?)) | ||
|
||
|
||
(s/def ::cql/individual-context | ||
(s/merge ::cql/context (s/keys :opt-un [::cql/parameters]))) |
31 changes: 7 additions & 24 deletions
31
...peration-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/cql_spec.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.