Skip to content

Commit

Permalink
Merge pull request #748 from samply/measure
Browse files Browse the repository at this point in the history
Switch to Media Type text/cql-identifier for CQL Expressions
  • Loading branch information
alexanderkiel authored Jun 29, 2022
2 parents bf7658e + 783f42e commit e853014
Show file tree
Hide file tree
Showing 48 changed files with 79 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/evaluate-measure-subject-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cat <<END
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/evaluate-measure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cat <<END
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/evaluate-patient-q1-measure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cat <<END
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/cql-queries/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The Measure resource represents the actual definition of the measure, which is e
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
2 changes: 1 addition & 1 deletion evaluate-measure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cat <<END
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:fhir/issue "required"
:fhir.issue/expression (population-path-fn))

(not= "text/cql" language)
(not (#{"text/cql" "text/cql-identifier"} language))
(ba/unsupported
(format "Unsupported language `%s`." language)
:fhir/issue "not-supported"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
(:require
[blaze.anomaly-spec]
[blaze.fhir.operation.evaluate-measure.measure.util :as u]
[blaze.test-util :refer [satisfies-prop]]
[clojure.spec.test.alpha :as st]
[clojure.test :as test :refer [deftest testing]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[cognitect.anomalies :as anom]
[juxt.iota :refer [given]]))

Expand Down Expand Up @@ -38,8 +41,22 @@

(testing "missing expression"
(given (u/expression (constantly "path-184642")
{:language #fhir/code"text/cql"})
{:language #fhir/code"text/cql-identifier"})
::anom/category := ::anom/incorrect
::anom/message := "Missing expression."
:fhir/issue := "required"
:fhir.issue/expression := "path-184642.criteria")))
:fhir.issue/expression := "path-184642.criteria"))

(testing "works with `text/cql-identifier`"
(satisfies-prop 10
(prop/for-all [expression gen/string]
(= expression (u/expression (constantly "foo")
{:language #fhir/code"text/cql-identifier"
:expression expression})))))

(testing "works with `text/cql`"
(satisfies-prop 10
(prop/for-all [expression gen/string]
(= expression (u/expression (constantly "foo")
{:language #fhir/code"text/cql"
:expression expression}))))))
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

(defn- cql-expression [expr]
{:fhir/type :fhir/Expression
:language #fhir/code"text/cql"
:language #fhir/code"text/cql-identifier"
:expression expr})


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -84,7 +84,7 @@
"text": "age-class"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "AgeClass"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -111,7 +111,7 @@
"text": "city"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "City"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -115,7 +115,7 @@
"text": "city"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "City"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -114,7 +114,7 @@
"text": "city"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "City"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -101,7 +101,7 @@
"text": "age-class"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "AgeClass"
}
},
Expand All @@ -110,7 +110,7 @@
"text": "gender"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "Gender"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -145,7 +145,7 @@
"text": "collection"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "Collection"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -108,7 +108,7 @@
"text": "bmi"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "Bmi"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -164,7 +164,7 @@
"text": "bmi"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "Bmi"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand All @@ -113,7 +113,7 @@
"text": "SampleMaterialTypeCategory"
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "SampleMaterialTypeCategory"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
]
},
"criteria": {
"language": "text/cql",
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
Expand Down
Loading

0 comments on commit e853014

Please sign in to comment.