Skip to content

Commit

Permalink
Merge pull request #762 from samply/release-v0.17.10
Browse files Browse the repository at this point in the history
Release v0.17.10
  • Loading branch information
alexanderkiel authored Jul 4, 2022
2 parents 580ec32 + d8bf662 commit ac423e8
Show file tree
Hide file tree
Showing 21 changed files with 452 additions and 88 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v0.17.10

### Bugfixes

* Fix Reference Resolution on Extended Primitive References

### Other Improvements ([#758](https://github.com/samply/blaze/issues/758))

* Implement CQL ConvertsToTime ([#759](https://github.com/samply/blaze/pull/759))

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

## v0.17.9

### Other Improvements
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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.17.9][5]
Latest release: [v0.17.10][5]

## Quick Start

Expand Down Expand Up @@ -72,7 +72,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.17.9>
[5]: <https://github.com/samply/blaze/releases/tag/v0.17.10>
[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 deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
:outdated
{:replace-deps
{com.github.liquidz/antq
{:mvn/version "1.7.804"}
{:mvn/version "1.8.847"}

org.slf4j/slf4j-nop
{:mvn/version "1.7.36"}}
Expand Down
64 changes: 32 additions & 32 deletions docs/conformance/cql.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,38 +322,38 @@ The section numbers refer to the documentation of the [ELM Specification](https:
### 22. Type Operators

| Num | Group | Expression | State | Notes |
|--------|--------------------|------------|---------------|-------|
| 22.1. | As | ! | no strictness | |
| 22.2. | CanConvert | | | |
| 22.3. | CanConvertQuantity | | | |
| 22.4. | Children | | | |
| 22.5. | Convert | | | |
| 22.6. | ConvertQuantity | | | |
| 22.7. | ConvertsToBoolean | | | |
| 22.8. | ConvertsToDate | | | |
| 22.9. | ConvertsToDateTime | | | |
| 22.10. | ConvertsToDecimal | | | |
| 22.11. | ConvertsToLong | | | |
| 22.12. | ConvertsToInteger | | | |
| 22.13. | ConvertsToQuantity | | | |
| 22.14. | ConvertsToRatio | | | |
| 22.15. | ConvertsToString | | | |
| 22.16. | ConvertsToTime | | | |
| 22.17. | Descendents | | | |
| 22.18. | Is | | | |
| 22.19. | ToBoolean | | | |
| 22.20. | ToChars | | | |
| 22.21. | ToConcept | | | |
| 22.22. | ToDate | | | |
| 22.23. | ToDateTime | | | |
| 22.24. | ToDecimal | | | |
| 22.25. | ToInteger | | | |
| 22.26. | ToList | | | |
| 22.27. | ToLong | | | |
| 22.28. | ToQuantity | | | |
| 22.29. | ToRatio | | | |
| 22.30. | ToString | | | |
| 22.31. | ToTime | | | |
|--------|--------------------|-----------|---------------|-------|
| 22.1. | As | ! | no strictness | |
| 22.2. | CanConvert || | |
| 22.3. | CanConvertQuantity || | |
| 22.4. | Children || | |
| 22.5. | Convert || | |
| 22.6. | ConvertQuantity || | |
| 22.7. | ConvertsToBoolean | | | |
| 22.8. | ConvertsToDate | | | |
| 22.9. | ConvertsToDateTime | | | |
| 22.10. | ConvertsToDecimal | | | |
| 22.11. | ConvertsToLong | | | |
| 22.12. | ConvertsToInteger | | | |
| 22.13. | ConvertsToQuantity | | | |
| 22.14. | ConvertsToRatio || | |
| 22.15. | ConvertsToString | | | |
| 22.16. | ConvertsToTime | | | |
| 22.17. | Descendents || | |
| 22.18. | Is || | |
| 22.19. | ToBoolean | | | |
| 22.20. | ToChars | | | |
| 22.21. | ToConcept || | |
| 22.22. | ToDate || | |
| 22.23. | ToDateTime || | |
| 22.24. | ToDecimal || | |
| 22.25. | ToInteger || | |
| 22.26. | ToList || | |
| 22.27. | ToLong || | |
| 22.28. | ToQuantity || | |
| 22.29. | ToRatio || | |
| 22.30. | ToString || | |
| 22.31. | ToTime | | | |

### 23. Clinical Operators

Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/docker-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Blaze should log something like this:
2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:64] - JVM version: 16.0.2
2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:65] - Maximum available memory: 1738 MiB
2021-06-27T11:02:37.835Z ee086ef908c1 main INFO [blaze.core:66] - Number of available processors: 8
2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.17.9 in 8.2 seconds
2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.17.10 in 8.2 seconds
```

In order to test connectivity, query the health endpoint:
Expand All @@ -47,7 +47,7 @@ that should return:
```json
{
"name": "Blaze",
"version": "0.17.9"
"version": "0.17.10"
}
```

Expand Down
12 changes: 6 additions & 6 deletions docs/deployment/manual-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

The installation works under Windows, Linux and macOS. The only dependency is an installed OpenJDK 11. Blaze is tested with [AdoptOpenJDK][1].

Blaze runs on the JVM and comes as single JAR file. Download the most recent version [here](https://github.com/samply/blaze/releases/tag/v0.17.9). Look for `blaze-0.17.9-standalone.jar`.
Blaze runs on the JVM and comes as single JAR file. Download the most recent version [here](https://github.com/samply/blaze/releases/tag/v0.17.10). Look for `blaze-0.17.10-standalone.jar`.

After the download, you can start blaze with the following command (Linux, macOS):

```sh
java -jar blaze-0.17.9-standalone.jar -m blaze.core
java -jar blaze-0.17.10-standalone.jar -m blaze.core
```

Blaze will run with an in-memory, volatile database for testing and demo purposes.
Expand All @@ -17,14 +17,14 @@ Blaze can be run with durable storage by setting the environment variables `STOR
Under Linux/macOS:

```sh
STORAGE=standalone java -jar blaze-0.17.9-standalone.jar -m blaze.core
STORAGE=standalone java -jar blaze-0.17.10-standalone.jar -m blaze.core
```

Under Windows, you need to set the Environment variables in the PowerShell before starting Blaze:

```powershell
$Env:STORAGE="standalone"
java -jar blaze-0.17.9-standalone.jar -m blaze.core
java -jar blaze-0.17.10-standalone.jar -m blaze.core
```

This will create three directories called `index`, `transaction` and `resource` inside the current working directory, one for each database part used.
Expand All @@ -42,7 +42,7 @@ The output should look like this:
2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:64] - JVM version: 16.0.2
2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:65] - Maximum available memory: 1738 MiB
2021-06-27T11:02:37.835Z ee086ef908c1 main INFO [blaze.core:66] - Number of available processors: 8
2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.17.9 in 8.2 seconds
2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.17.10 in 8.2 seconds
```

In order to test connectivity, query the health endpoint:
Expand All @@ -62,7 +62,7 @@ that should return:
```json
{
"name": "Blaze",
"version": "0.17.9"
"version": "0.17.10"
}
```

Expand Down
53 changes: 50 additions & 3 deletions modules/cql/src/blaze/elm/compiler/type_operators.clj
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,41 @@
(some? (p/to-boolean operand))))


;; TODO 22.8. ConvertsToDate
;; 22.8. ConvertsToDate
(defrecord ConvertsToDateOperatorExpression [operand]
core/Expression
(-eval [_ {:keys [now] :as context} resource scope]
(when-let [operand (core/-eval operand context resource scope)]
(when (some? operand)
(some? (p/to-date operand now)))))
(-form [_]
(list 'converts-to-date (core/-form operand))))


(defmethod core/compile* :elm.compiler.type/converts-to-date
[context {:keys [operand]}]
(when-let [operand (core/compile* context operand)]
(->ConvertsToDateOperatorExpression operand)))


;; 22.9. ConvertsToDateTime
(defrecord ConvertsToDateTimeOperatorExpression [operand]
core/Expression
(-eval [_ {:keys [now] :as context} resource scope]
(when-let [operand (core/-eval operand context resource scope)]
(when (some? operand)
(some? (p/to-date-time operand now)))))
(-form [_]
(list 'converts-to-date-time (core/-form operand))))


(defmethod core/compile* :elm.compiler.type/converts-to-date-time
[context {:keys [operand]}]
(when-let [operand (core/compile* context operand)]
(if (system/date? operand)
(some? (p/to-date-time operand nil))
(->ConvertsToDateTimeOperatorExpression operand))))

;; TODO 22.9. ConvertsToDateTime

;; 22.10. ConvertsToDecimal
(defunop converts-to-decimal [operand]
Expand Down Expand Up @@ -166,7 +198,22 @@
(some? (p/to-string operand))))


;; TODO 22.16. ConvertsToTime
;; 22.16. ConvertsToTime
(defrecord ConvertsToTimeOperatorExpression [operand]
core/Expression
(-eval [_ {:keys [now] :as context} resource scope]
(when-let [operand (core/-eval operand context resource scope)]
(when (some? operand)
(some? (p/to-time operand now)))))
(-form [_]
(list 'converts-to-time (core/-form operand))))


(defmethod core/compile* :elm.compiler.type/converts-to-time
[context {:keys [operand]}]
(when-let [operand (core/compile* context operand)]
(->ConvertsToTimeOperatorExpression operand)))


;; 22.17. Descendents
(defrecord DescendentsOperatorExpression [source]
Expand Down
97 changes: 94 additions & 3 deletions modules/cql/test/blaze/elm/compiler/type_operators_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
expr (c/compile compile-ctx elm)]
(is (= '(converts-to-boolean (param-ref "x")) (core/-form expr))))))

;; TODO 22.8. ConvertsToDate
;; 22.8. ConvertsToDate
;;
;; The ConvertsToDate operator returns true if the value of its argument is or
;; can be converted to a Date value.
Expand All @@ -404,8 +404,38 @@
;; As with date literals, date values may be specified to any precision.
;;
;; If the argument is null, the result is null.
(deftest compile-converts-to-date-test
(let [eval #(core/-eval % {:now tu/now} nil nil)]
(testing "String"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-date elm/string x)))
"2019"
"2019-01"
"2019-01-01")

(are [x] (false? (eval (tu/compile-unop elm/converts-to-date elm/string x)))
"aaaa"
"2019-13"
"2019-02-29"))

(testing "Date"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-date elm/date x)))
"2019"
"2019-01"
"2019-01-01"))

(testing "DateTime"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-date elm/date-time x)))
"2019"
"2019-01"
"2019-01-01"
"2019-01-01T12:13")))

(tu/testing-unary-null elm/converts-to-date)

;; TODO 22.9. ConvertsToDateTime
(tu/testing-unary-form elm/converts-to-date))


;; 22.9. ConvertsToDateTime
;;
;; The ConvertsToDateTime operator returns true if the value of its argument is
;; or can be converted to a DateTime value.
Expand All @@ -428,6 +458,33 @@
;; evaluation request timestamp is assumed.
;;
;; If the argument is null, the result is null.
(deftest compile-converts-to-date-time-test
(let [eval #(core/-eval % {:now tu/now} nil nil)]
(testing "String"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-date-time elm/string x)))
"2020-03-08T12:54:00+01:00")

(are [x] (false? (eval (tu/compile-unop elm/converts-to-date-time elm/string x)))
"2019-13"
"2019-02-29"))

(testing "Date"
(testing "Static"
(are [x] (true? (tu/compile-unop elm/converts-to-date-time elm/date x))
"2020"
"2020-03"
"2020-03-08")))

(testing "DateTime"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-date-time elm/date-time x)))
"2020"
"2020-03"
"2020-03-08"
"2020-03-08T12:13" )))

(tu/testing-unary-null elm/converts-to-date-time)

(tu/testing-unary-form elm/converts-to-date-time))


;; 22.10. ConvertsToDecimal
Expand Down Expand Up @@ -772,7 +829,7 @@
expr (c/compile compile-ctx elm)]
(is (= '(converts-to-string (param-ref "x")) (core/-form expr))))))

;; TODO 22.16. ConvertsToTime
;; 22.16. ConvertsToTime
;;
;; The ConvertsToTime operator returns true if the value of its argument is or
;; can be converted to a Time value.
Expand All @@ -795,6 +852,40 @@
;; evaluation request timestamp is assumed.
;;
;; If the argument is null, the result is null.
(deftest compile-converts-to-time-test
(let [eval #(core/-eval % {:now tu/now} nil nil)]
(testing "String"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-time elm/string x)))
"12:54:30"
"12:54:30.010")

(are [x] (false? (eval (tu/compile-unop elm/converts-to-time elm/string x)))
"aaaa"
"12:54"
"24:54:00"
"23:60:00"
"14-30-00.0"))

(testing "Time"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-time elm/time x)))
"12:54"
"12:54:00"
"12:54:30.010"))

(testing "DateTime"
(are [x] (true? (eval (tu/compile-unop elm/converts-to-time elm/date-time x)))
"2020-03-08T12:54:00"
"2020-03-08T12:54:30.010"))

(testing "dynamic"
(are [x] (true? (tu/dynamic-compile-eval (elm/converts-to-time x)))
#elm/parameter-ref "12:54:00"
#elm/parameter-ref "2020-01-02T03:04:05.006Z")))

(tu/testing-unary-null elm/converts-to-time)

(tu/testing-unary-form elm/converts-to-time))


;; 22.17. Descendents
;;
Expand Down
Loading

0 comments on commit ac423e8

Please sign in to comment.