Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add More CQL Tests #2220

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions modules/cql/test/blaze/cql/translator_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,29 @@
[1 :expression :operand 0 :operand :source :name] := "Patient"
[1 :expression :operand 1 :type] := "Literal"))

(testing "Overlaps"
(given-translation
"library Test
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem snomed: 'http://snomed.info/sct'

define InInitialPopulation:
exists
from [Procedure: Code '431182000' from snomed] P
where P.performed overlaps Interval[@2020-02-01, @2020-06-01]"
[0 :name] := "InInitialPopulation"
[0 :context] := "Patient"
[0 :expression :type] := "Exists"
[0 :expression :resultTypeName] := "{urn:hl7-org:elm-types:r1}Boolean"
[0 :expression :operand :type] := "Query"
[0 :expression :operand :where :type] := "Overlaps"
[0 :expression :operand :where :operand 0 :type] := "FunctionRef"
[0 :expression :operand :where :operand 0 :name] := "ToInterval"
[0 :expression :operand :where :operand 0 :operand 0 :type] := "As"
[0 :expression :operand :where :operand 0 :operand 0 :asType] := "{http://hl7.org/fhir}Period"))

(testing "Returns a valid :elm/library"
(are [cql] (s/valid? :elm/library (translate cql))
"library Test
Expand Down
4 changes: 3 additions & 1 deletion modules/cql/test/blaze/elm/compiler/reusing_logic_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@
:end nil}
(interval/interval
(system/date-time 2021 2 23 14 12 45)
nil)))
nil)
nil
nil))

(testing "expression is dynamic"
(is (false? (core/-static expr))))
Expand Down