Skip to content

Commit 6342ed6

Browse files
committed
Add More CQL Tests
1 parent f7e2973 commit 6342ed6

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

modules/cql/test/blaze/cql/translator_test.clj

+23
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,29 @@
8585
[1 :expression :operand 0 :operand :source :name] := "Patient"
8686
[1 :expression :operand 1 :type] := "Literal"))
8787

88+
(testing "Overlaps"
89+
(given-translation
90+
"library Test
91+
using FHIR version '4.0.0'
92+
include FHIRHelpers version '4.0.0'
93+
94+
codesystem snomed: 'http://snomed.info/sct'
95+
96+
define InInitialPopulation:
97+
exists
98+
from [Procedure: Code '431182000' from snomed] P
99+
where P.performed overlaps Interval[@2020-02-01, @2020-06-01]"
100+
[0 :name] := "InInitialPopulation"
101+
[0 :context] := "Patient"
102+
[0 :expression :type] := "Exists"
103+
[0 :expression :resultTypeName] := "{urn:hl7-org:elm-types:r1}Boolean"
104+
[0 :expression :operand :type] := "Query"
105+
[0 :expression :operand :where :type] := "Overlaps"
106+
[0 :expression :operand :where :operand 0 :type] := "FunctionRef"
107+
[0 :expression :operand :where :operand 0 :name] := "ToInterval"
108+
[0 :expression :operand :where :operand 0 :operand 0 :type] := "As"
109+
[0 :expression :operand :where :operand 0 :operand 0 :asType] := "{http://hl7.org/fhir}Period"))
110+
88111
(testing "Returns a valid :elm/library"
89112
(are [cql] (s/valid? :elm/library (translate cql))
90113
"library Test

modules/cql/test/blaze/elm/compiler/reusing_logic_test.clj

+3-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@
432432
:end nil}
433433
(interval/interval
434434
(system/date-time 2021 2 23 14 12 45)
435-
nil)))
435+
nil)
436+
nil
437+
nil))
436438

437439
(testing "expression is dynamic"
438440
(is (false? (core/-static expr))))

0 commit comments

Comments
 (0)