From c357850ec6d5acab72cdd3169ce2b4bd6ed543e1 Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 20 Dec 2024 14:48:11 -0700 Subject: [PATCH] Change tests to expect JAXB flavored JSON/XML --- .../main/groovy/cql.java-conventions.gradle | 4 +- .../main/groovy/cql.xjc-conventions.gradle | 2 +- Src/java/cql-to-elm-cli/build.gradle | 4 +- Src/java/cql-to-elm/build.gradle | 5 +- .../cql/cql2elm/CMS146XmlTest.java | 7 +- .../CMS146v2_Expected_SignatureLevel_All.json | 945 +++++++++++------- .../CMS146v2_Expected_SignatureLevel_All.xml | 790 ++++++--------- ...6v2_Expected_SignatureLevel_Differing.json | 732 ++++++++------ ...46v2_Expected_SignatureLevel_Differing.xml | 530 +++++----- ...CMS146v2_Expected_SignatureLevel_None.json | 726 +++++++++----- .../CMS146v2_Expected_SignatureLevel_None.xml | 518 +++++----- ...6v2_Expected_SignatureLevel_Overloads.json | 781 +++++++++------ ...46v2_Expected_SignatureLevel_Overloads.xml | 604 +++++------ Src/java/elm-test/build.gradle | 3 +- Src/java/engine/build.gradle | 4 +- 15 files changed, 3034 insertions(+), 2621 deletions(-) diff --git a/Src/java/buildSrc/src/main/groovy/cql.java-conventions.gradle b/Src/java/buildSrc/src/main/groovy/cql.java-conventions.gradle index f87081ecf..5a8cfc4aa 100644 --- a/Src/java/buildSrc/src/main/groovy/cql.java-conventions.gradle +++ b/Src/java/buildSrc/src/main/groovy/cql.java-conventions.gradle @@ -25,12 +25,12 @@ repositories { } dependencies { - implementation 'org.slf4j:slf4j-api:1.7.36' + implementation 'org.slf4j:slf4j-api:2.0.13' testImplementation 'org.hamcrest:hamcrest-all:1.3' testImplementation 'uk.co.datumedge:hamcrest-json:0.2' testImplementation(platform('org.junit:junit-bom:5.10.2')) testImplementation('org.junit.jupiter:junit-jupiter') - testImplementation 'org.slf4j:slf4j-simple:1.7.36' + testImplementation 'org.slf4j:slf4j-simple:2.0.13' // These are JAXB dependencies excluded because the libraries need to work // on Android. But for test purposes we use them pretty much everywhere. diff --git a/Src/java/buildSrc/src/main/groovy/cql.xjc-conventions.gradle b/Src/java/buildSrc/src/main/groovy/cql.xjc-conventions.gradle index 8f9e15407..2c598fff9 100644 --- a/Src/java/buildSrc/src/main/groovy/cql.xjc-conventions.gradle +++ b/Src/java/buildSrc/src/main/groovy/cql.xjc-conventions.gradle @@ -17,7 +17,7 @@ dependencies { xjc 'org.glassfish.jaxb:jaxb-xjc:3.0.2' xjc 'org.glassfish.jaxb:jaxb-runtime:4.0.3' xjc 'org.eclipse.persistence:org.eclipse.persistence.moxy:4.0.2' - xjc 'org.slf4j:slf4j-simple:1.7.36' + xjc 'org.slf4j:slf4j-simple:2.0.13' api 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1' api 'codes.rafael.jaxb2_commons:jaxb2-basics-runtime:3.0.0' } diff --git a/Src/java/cql-to-elm-cli/build.gradle b/Src/java/cql-to-elm-cli/build.gradle index 332ac9c93..24a079c7d 100644 --- a/Src/java/cql-to-elm-cli/build.gradle +++ b/Src/java/cql-to-elm-cli/build.gradle @@ -14,11 +14,9 @@ dependencies { implementation project(':model-jaxb') implementation project(':elm-jaxb') implementation 'net.sf.jopt-simple:jopt-simple:4.7' - implementation 'org.slf4j:slf4j-simple:1.7.36' + implementation 'org.slf4j:slf4j-simple:2.0.13' implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5' implementation 'org.eclipse.persistence:org.eclipse.persistence.moxy:4.0.2' testImplementation project(':model-jaxb') - testImplementation project(':model-jackson') testImplementation project(':elm-jaxb') - testImplementation project(':elm-jackson') } \ No newline at end of file diff --git a/Src/java/cql-to-elm/build.gradle b/Src/java/cql-to-elm/build.gradle index 587df9f02..ddeff9006 100644 --- a/Src/java/cql-to-elm/build.gradle +++ b/Src/java/cql-to-elm/build.gradle @@ -19,10 +19,11 @@ dependencies { // libraries such that we could swap out jackson for something else. In the meantime, these are // "implementation" dependencies so that they are not exported downstream. implementation "com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:${jacksonVersion}" - testImplementation project(':elm-jackson') - testImplementation project(':model-jackson') + testImplementation project(':elm-jaxb') + testImplementation project(':model-jaxb') testImplementation project(':quick') testImplementation project(':qdm') + testImplementation 'org.xmlunit:xmlunit-assertj:2.10.0' testImplementation 'com.github.reinert:jjschema:1.16' testImplementation 'com.tngtech.archunit:archunit:1.2.1' testImplementation 'org.skyscreamer:jsonassert:1.5.1' diff --git a/Src/java/cql-to-elm/src/test/java/org/cqframework/cql/cql2elm/CMS146XmlTest.java b/Src/java/cql-to-elm/src/test/java/org/cqframework/cql/cql2elm/CMS146XmlTest.java index 098a21bc9..12ff1b970 100644 --- a/Src/java/cql-to-elm/src/test/java/org/cqframework/cql/cql2elm/CMS146XmlTest.java +++ b/Src/java/cql-to-elm/src/test/java/org/cqframework/cql/cql2elm/CMS146XmlTest.java @@ -1,8 +1,5 @@ package org.cqframework.cql.cql2elm; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; - import java.io.File; import java.io.IOException; import java.net.URL; @@ -13,6 +10,7 @@ import org.cqframework.cql.cql2elm.LibraryBuilder.SignatureLevel; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import org.xmlunit.assertj.XmlAssert; class CMS146XmlTest { @@ -37,7 +35,8 @@ void cms146SignatureLevels(String fileName, SignatureLevel expectedSignatureLeve new LibraryManager( modelManager, new CqlCompilerOptions(ErrorSeverity.Warning, expectedSignatureLevel))); final String actualXml = translator.toXml().trim(); - assertThat(actualXml, equalTo(expectedXml)); + + XmlAssert.assertThat(actualXml).and(expectedXml).ignoreWhitespace().areIdentical(); } private static String getXml(String name) throws IOException { diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.json b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.json index 596361251..65ca5ab2f 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.json +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.json @@ -1,918 +1,1141 @@ { "library" : { - "type" : "Library", + "annotation" : [ { + "translatorOptions" : "", + "signatureLevel" : "All", + "type" : "CqlToElmInfo" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve membership operator for terminology target of the retrieve.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + } ], "identifier" : { - "type" : "VersionedIdentifier", "id" : "CMS146", "version" : "2" }, "schemaIdentifier" : { - "type" : "VersionedIdentifier", "id" : "urn:hl7-org:elm", "version" : "r1" }, "usings" : { - "type" : "Library$Usings", "def" : [ { - "type" : "UsingDef", "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1" + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] }, { - "type" : "UsingDef", "localIdentifier" : "QUICK", - "uri" : "http://hl7.org/fhir" + "uri" : "http://hl7.org/fhir", + "annotation" : [ ] } ] }, "parameters" : { - "type" : "Library$Parameters", "def" : [ { - "type" : "ParameterDef", + "name" : "MeasurementPeriod", + "accessLevel" : "Public", + "annotation" : [ ], "default" : { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "NamedTypeSpecifier", + "annotation" : [ ] + } ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2013" + "value" : "2013", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" - }, + "value" : "0", + "type" : "Literal", + "annotation" : [ ] + } + }, + "high" : { + "type" : "DateTime", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - } ] - }, - "high" : { - "type" : "DateTime", + "annotation" : [ ] + } ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2014" + "value" : "2014", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" - }, - "signature" : [ { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - }, { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - }, { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - }, { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - }, { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - }, { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - }, { - "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" - } ] - }, - "lowClosed" : true, - "highClosed" : false - }, - "name" : "MeasurementPeriod", - "accessLevel" : "Public" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] + } + } + } } ] }, "valueSets" : { - "type" : "Library$ValueSets", "def" : [ { - "type" : "ValueSetDef", "name" : "Acute Pharyngitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1011", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Acute Tonsillitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Ambulatory/ED Visit", "id" : "2.16.840.1.113883.3.464.1003.101.12.1061", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Antibiotic Medications", "id" : "2.16.840.1.113883.3.464.1003.196.12.1001", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Group A Streptococcus Test", "id" : "2.16.840.1.113883.3.464.1003.198.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] } ] }, "contexts" : { - "type" : "Library$Contexts", "def" : [ { - "type" : "ContextDef", - "name" : "Patient" + "name" : "Patient", + "annotation" : [ ] } ] }, "statements" : { - "type" : "Library$Statements", "def" : [ { - "type" : "ExpressionDef", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], "expression" : { "type" : "SingletonFrom", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Retrieve", "dataType" : "{http://hl7.org/fhir}Patient", - "templateId" : "patient-qicore-qicore-patient" + "templateId" : "patient-qicore-qicore-patient", + "type" : "Retrieve", + "annotation" : [ ], + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } - }, - "name" : "Patient", - "context" : "Patient" + } }, { - "type" : "ExpressionDef", + "name" : "InDemographic", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : [ { "type" : "GreaterOrEqual", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] } ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2" + "value" : "2", + "type" : "Literal", + "annotation" : [ ] } ] }, { "type" : "Less", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] } ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "18" + "value" : "18", + "type" : "Literal", + "annotation" : [ ] } ] } ] - }, - "name" : "InDemographic", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Pharyngitis", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Union", + "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}Condition" + "annotation" : [ ] } }, { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}Condition" + "annotation" : [ ] } } ], "operand" : [ { + "dataType" : "{http://hl7.org/fhir}Condition", + "templateId" : "condition-qicore-qicore-condition", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Pharyngitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + }, { "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "condition-qicore-qicore-condition", "codeProperty" : "code", - "codeComparator" : "in" - }, { + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Tonsillitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Condition", - "templateId" : "condition-qicore-qicore-condition", - "codeProperty" : "code", - "codeComparator" : "in" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } ] - }, - "name" : "Pharyngitis", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Antibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}MedicationPrescription", + "templateId" : "medicationprescription-qicore-qicore-medicationprescription", + "codeProperty" : "medication.code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Antibiotic Medications", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}MedicationPrescription", - "templateId" : "medicationprescription-qicore-qicore-medicationprescription", - "codeProperty" : "medication.code", - "codeComparator" : "in" - }, - "name" : "Antibiotics", - "context" : "Patient", - "accessLevel" : "Public" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "TargetEncounters", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "E", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Encounter", + "templateId" : "encounter-qicore-qicore-encounter", + "codeProperty" : "type", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Ambulatory/ED Visit", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Encounter", - "templateId" : "encounter-qicore-qicore-encounter", - "codeProperty" : "type", - "codeComparator" : "in" - }, - "alias" : "E" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "P", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "P" + } }, { + "alias" : "A", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : [ { "type" : "In", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : false, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Start", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, "high" : { "type" : "Add", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Quantity" + "annotation" : [ ] } ], "operand" : [ { "type" : "Start", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, { - "type" : "Quantity", "value" : 3, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] - }, - "lowClosed" : false, - "highClosed" : true + } } ] }, { "type" : "Not", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : { "type" : "IsNull", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Any", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Any" + "annotation" : [ ] } ], "operand" : { "type" : "Start", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } } } } ] - }, - "alias" : "A" + } } ], "where" : { "type" : "IncludedIn", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] } - }, - "name" : "TargetEncounters", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "TargetDiagnoses", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "P", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" - }, - "alias" : "P" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "E", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "E" + } } ] - }, - "name" : "TargetDiagnoses", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasPriorAntibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}MedicationPrescription", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}MedicationPrescription" + "annotation" : [ ] } } ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "A", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" - }, - "alias" : "A" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "D", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetDiagnoses", "type" : "ExpressionRef", - "name" : "TargetDiagnoses" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : [ { "type" : "In", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Subtract", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Quantity" + "annotation" : [ ] } ], "operand" : [ { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] }, { - "type" : "Quantity", "value" : 30, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] }, "high" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" - }, - "lowClosed" : true, - "highClosed" : false + "scope" : "D", + "type" : "Property", + "annotation" : [ ] + } } ] }, { "type" : "Not", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : { "type" : "IsNull", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Any", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Any" + "annotation" : [ ] } ], "operand" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] } } } ] - }, - "alias" : "D" + } } ] } - }, - "name" : "HasPriorAntibiotics", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasTargetEncounter", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}Encounter", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}Encounter" + "annotation" : [ ] } } ], "operand" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] } - }, - "name" : "HasTargetEncounter", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "InInitialPopulation", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : [ { + "name" : "InDemographic", "type" : "ExpressionRef", - "name" : "InDemographic" + "annotation" : [ ] }, { + "name" : "HasTargetEncounter", "type" : "ExpressionRef", - "name" : "HasTargetEncounter" + "annotation" : [ ] } ] - }, - "name" : "InInitialPopulation", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", - "expression" : { - "type" : "Literal", - "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", - "value" : "true" - }, "name" : "InDenominator", "context" : "Patient", - "accessLevel" : "Public" - }, { - "type" : "ExpressionDef", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { - "type" : "ExpressionRef", - "name" : "HasPriorAntibiotics" - }, + "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", + "value" : "true", + "type" : "Literal", + "annotation" : [ ] + } + }, { "name" : "InDenominatorExclusions", "context" : "Patient", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "expression" : { + "name" : "HasPriorAntibiotics", + "type" : "ExpressionRef", + "annotation" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "InNumerator", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}Observation" + "annotation" : [ ] } } ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "R", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Observation", + "templateId" : "observation-qicore-qicore-observation", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Group A Streptococcus Test", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Observation", - "templateId" : "observation-qicore-qicore-observation", - "codeProperty" : "code", - "codeComparator" : "in" - }, - "alias" : "R" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], + "relationship" : [ ], "where" : { "type" : "And", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : [ { "type" : "In", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "issued", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] }, { "type" : "Not", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Boolean" + "annotation" : [ ] } ], "operand" : { "type" : "IsNull", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Any", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Any" + "annotation" : [ ] } ], "operand" : { - "type" : "Property", "path" : "valueQuantity", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] } } } ] } } - }, - "name" : "InNumerator", - "context" : "Patient", - "accessLevel" : "Public" + } } ] - }, - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorOptions" : "", - "signatureLevel" : "All" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", - "errorType" : "semantic", - "errorSeverity" : "warning" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve membership operator for terminology target of the retrieve.", - "errorType" : "semantic", - "errorSeverity" : "warning" - } ] + } } } \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.xml b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.xml index 5fcf1c5d6..05bd8dee8 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.xml +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_All.xml @@ -1,460 +1,330 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.json b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.json index 3f9cdd3e4..d2ab4df4e 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.json +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.json @@ -1,647 +1,821 @@ { "library" : { - "type" : "Library", + "annotation" : [ { + "translatorOptions" : "", + "signatureLevel" : "Differing", + "type" : "CqlToElmInfo" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve membership operator for terminology target of the retrieve.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + } ], "identifier" : { - "type" : "VersionedIdentifier", "id" : "CMS146", "version" : "2" }, "schemaIdentifier" : { - "type" : "VersionedIdentifier", "id" : "urn:hl7-org:elm", "version" : "r1" }, "usings" : { - "type" : "Library$Usings", "def" : [ { - "type" : "UsingDef", "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1" + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] }, { - "type" : "UsingDef", "localIdentifier" : "QUICK", - "uri" : "http://hl7.org/fhir" + "uri" : "http://hl7.org/fhir", + "annotation" : [ ] } ] }, "parameters" : { - "type" : "Library$Parameters", "def" : [ { - "type" : "ParameterDef", + "name" : "MeasurementPeriod", + "accessLevel" : "Public", + "annotation" : [ ], "default" : { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2013" + "value" : "2013", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] } }, "high" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2014" + "value" : "2014", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] } - }, - "lowClosed" : true, - "highClosed" : false - }, - "name" : "MeasurementPeriod", - "accessLevel" : "Public" + } + } } ] }, "valueSets" : { - "type" : "Library$ValueSets", "def" : [ { - "type" : "ValueSetDef", "name" : "Acute Pharyngitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1011", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Acute Tonsillitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Ambulatory/ED Visit", "id" : "2.16.840.1.113883.3.464.1003.101.12.1061", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Antibiotic Medications", "id" : "2.16.840.1.113883.3.464.1003.196.12.1001", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Group A Streptococcus Test", "id" : "2.16.840.1.113883.3.464.1003.198.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] } ] }, "contexts" : { - "type" : "Library$Contexts", "def" : [ { - "type" : "ContextDef", - "name" : "Patient" + "name" : "Patient", + "annotation" : [ ] } ] }, "statements" : { - "type" : "Library$Statements", "def" : [ { - "type" : "ExpressionDef", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], "expression" : { "type" : "SingletonFrom", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Retrieve", "dataType" : "{http://hl7.org/fhir}Patient", - "templateId" : "patient-qicore-qicore-patient" + "templateId" : "patient-qicore-qicore-patient", + "type" : "Retrieve", + "annotation" : [ ], + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } - }, - "name" : "Patient", - "context" : "Patient" + } }, { - "type" : "ExpressionDef", + "name" : "InDemographic", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "GreaterOrEqual", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2" + "value" : "2", + "type" : "Literal", + "annotation" : [ ] } ] }, { "type" : "Less", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "18" + "value" : "18", + "type" : "Literal", + "annotation" : [ ] } ] } ] - }, - "name" : "InDemographic", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Pharyngitis", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Union", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "dataType" : "{http://hl7.org/fhir}Condition", + "templateId" : "condition-qicore-qicore-condition", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Pharyngitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + }, { "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "condition-qicore-qicore-condition", "codeProperty" : "code", - "codeComparator" : "in" - }, { + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Tonsillitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Condition", - "templateId" : "condition-qicore-qicore-condition", - "codeProperty" : "code", - "codeComparator" : "in" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } ] - }, - "name" : "Pharyngitis", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Antibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}MedicationPrescription", + "templateId" : "medicationprescription-qicore-qicore-medicationprescription", + "codeProperty" : "medication.code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Antibiotic Medications", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}MedicationPrescription", - "templateId" : "medicationprescription-qicore-qicore-medicationprescription", - "codeProperty" : "medication.code", - "codeComparator" : "in" - }, - "name" : "Antibiotics", - "context" : "Patient", - "accessLevel" : "Public" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "TargetEncounters", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "E", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Encounter", + "templateId" : "encounter-qicore-qicore-encounter", + "codeProperty" : "type", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Ambulatory/ED Visit", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Encounter", - "templateId" : "encounter-qicore-qicore-encounter", - "codeProperty" : "type", - "codeComparator" : "in" - }, - "alias" : "E" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "P", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "P" + } }, { + "alias" : "A", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : false, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, "high" : { "type" : "Add", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, { - "type" : "Quantity", "value" : 3, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] - }, - "lowClosed" : false, - "highClosed" : true + } } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Any", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Any" + "annotation" : [ ] } ], "operand" : { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } } } } ] - }, - "alias" : "A" + } } ], "where" : { "type" : "IncludedIn", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] } - }, - "name" : "TargetEncounters", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "TargetDiagnoses", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "P", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" - }, - "alias" : "P" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "E", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "E" + } } ] - }, - "name" : "TargetDiagnoses", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasPriorAntibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "A", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" - }, - "alias" : "A" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "D", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetDiagnoses", "type" : "ExpressionRef", - "name" : "TargetDiagnoses" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Subtract", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] }, { - "type" : "Quantity", "value" : 30, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] }, "high" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" - }, - "lowClosed" : true, - "highClosed" : false + "scope" : "D", + "type" : "Property", + "annotation" : [ ] + } } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Any", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Any" + "annotation" : [ ] } ], "operand" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] } } } ] - }, - "alias" : "D" + } } ] } - }, - "name" : "HasPriorAntibiotics", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasTargetEncounter", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] } - }, - "name" : "HasTargetEncounter", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "InInitialPopulation", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "name" : "InDemographic", "type" : "ExpressionRef", - "name" : "InDemographic" + "annotation" : [ ] }, { + "name" : "HasTargetEncounter", "type" : "ExpressionRef", - "name" : "HasTargetEncounter" + "annotation" : [ ] } ] - }, - "name" : "InInitialPopulation", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", - "expression" : { - "type" : "Literal", - "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", - "value" : "true" - }, "name" : "InDenominator", "context" : "Patient", - "accessLevel" : "Public" - }, { - "type" : "ExpressionDef", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { - "type" : "ExpressionRef", - "name" : "HasPriorAntibiotics" - }, + "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", + "value" : "true", + "type" : "Literal", + "annotation" : [ ] + } + }, { "name" : "InDenominatorExclusions", "context" : "Patient", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "expression" : { + "name" : "HasPriorAntibiotics", + "type" : "ExpressionRef", + "annotation" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "InNumerator", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "R", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Observation", + "templateId" : "observation-qicore-qicore-observation", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Group A Streptococcus Test", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Observation", - "templateId" : "observation-qicore-qicore-observation", - "codeProperty" : "code", - "codeComparator" : "in" - }, - "alias" : "R" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], + "relationship" : [ ], "where" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "issued", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Any", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Any" + "annotation" : [ ] } ], "operand" : { - "type" : "Property", "path" : "valueQuantity", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] } } } ] } } - }, - "name" : "InNumerator", - "context" : "Patient", - "accessLevel" : "Public" + } } ] - }, - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorOptions" : "", - "signatureLevel" : "Differing" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", - "errorType" : "semantic", - "errorSeverity" : "warning" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve membership operator for terminology target of the retrieve.", - "errorType" : "semantic", - "errorSeverity" : "warning" - } ] + } } } \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.xml b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.xml index 062d60db1..c63f3f145 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.xml +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Differing.xml @@ -1,299 +1,231 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.json b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.json index d9375521e..f23f5bf6d 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.json +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.json @@ -1,635 +1,809 @@ { "library" : { - "type" : "Library", + "annotation" : [ { + "translatorOptions" : "", + "signatureLevel" : "None", + "type" : "CqlToElmInfo" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve membership operator for terminology target of the retrieve.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + } ], "identifier" : { - "type" : "VersionedIdentifier", "id" : "CMS146", "version" : "2" }, "schemaIdentifier" : { - "type" : "VersionedIdentifier", "id" : "urn:hl7-org:elm", "version" : "r1" }, "usings" : { - "type" : "Library$Usings", "def" : [ { - "type" : "UsingDef", "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1" + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] }, { - "type" : "UsingDef", "localIdentifier" : "QUICK", - "uri" : "http://hl7.org/fhir" + "uri" : "http://hl7.org/fhir", + "annotation" : [ ] } ] }, "parameters" : { - "type" : "Library$Parameters", "def" : [ { - "type" : "ParameterDef", + "name" : "MeasurementPeriod", + "accessLevel" : "Public", + "annotation" : [ ], "default" : { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2013" + "value" : "2013", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] } }, "high" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2014" + "value" : "2014", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] } - }, - "lowClosed" : true, - "highClosed" : false - }, - "name" : "MeasurementPeriod", - "accessLevel" : "Public" + } + } } ] }, "valueSets" : { - "type" : "Library$ValueSets", "def" : [ { - "type" : "ValueSetDef", "name" : "Acute Pharyngitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1011", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Acute Tonsillitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Ambulatory/ED Visit", "id" : "2.16.840.1.113883.3.464.1003.101.12.1061", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Antibiotic Medications", "id" : "2.16.840.1.113883.3.464.1003.196.12.1001", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Group A Streptococcus Test", "id" : "2.16.840.1.113883.3.464.1003.198.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] } ] }, "contexts" : { - "type" : "Library$Contexts", "def" : [ { - "type" : "ContextDef", - "name" : "Patient" + "name" : "Patient", + "annotation" : [ ] } ] }, "statements" : { - "type" : "Library$Statements", "def" : [ { - "type" : "ExpressionDef", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], "expression" : { "type" : "SingletonFrom", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Retrieve", "dataType" : "{http://hl7.org/fhir}Patient", - "templateId" : "patient-qicore-qicore-patient" + "templateId" : "patient-qicore-qicore-patient", + "type" : "Retrieve", + "annotation" : [ ], + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } - }, - "name" : "Patient", - "context" : "Patient" + } }, { - "type" : "ExpressionDef", + "name" : "InDemographic", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "GreaterOrEqual", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2" + "value" : "2", + "type" : "Literal", + "annotation" : [ ] } ] }, { "type" : "Less", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "18" + "value" : "18", + "type" : "Literal", + "annotation" : [ ] } ] } ] - }, - "name" : "InDemographic", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Pharyngitis", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Union", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "dataType" : "{http://hl7.org/fhir}Condition", + "templateId" : "condition-qicore-qicore-condition", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Pharyngitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + }, { "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "condition-qicore-qicore-condition", "codeProperty" : "code", - "codeComparator" : "in" - }, { + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Tonsillitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Condition", - "templateId" : "condition-qicore-qicore-condition", - "codeProperty" : "code", - "codeComparator" : "in" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } ] - }, - "name" : "Pharyngitis", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Antibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}MedicationPrescription", + "templateId" : "medicationprescription-qicore-qicore-medicationprescription", + "codeProperty" : "medication.code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Antibiotic Medications", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}MedicationPrescription", - "templateId" : "medicationprescription-qicore-qicore-medicationprescription", - "codeProperty" : "medication.code", - "codeComparator" : "in" - }, - "name" : "Antibiotics", - "context" : "Patient", - "accessLevel" : "Public" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "TargetEncounters", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "E", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Encounter", + "templateId" : "encounter-qicore-qicore-encounter", + "codeProperty" : "type", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Ambulatory/ED Visit", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Encounter", - "templateId" : "encounter-qicore-qicore-encounter", - "codeProperty" : "type", - "codeComparator" : "in" - }, - "alias" : "E" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "P", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "P" + } }, { + "alias" : "A", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : false, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, "high" : { "type" : "Add", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, { - "type" : "Quantity", "value" : 3, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] - }, - "lowClosed" : false, - "highClosed" : true + } } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } } } } ] - }, - "alias" : "A" + } } ], "where" : { "type" : "IncludedIn", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] } - }, - "name" : "TargetEncounters", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "TargetDiagnoses", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "P", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" - }, - "alias" : "P" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "E", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "E" + } } ] - }, - "name" : "TargetDiagnoses", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasPriorAntibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "A", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" - }, - "alias" : "A" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "D", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetDiagnoses", "type" : "ExpressionRef", - "name" : "TargetDiagnoses" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Subtract", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] }, { - "type" : "Quantity", "value" : 30, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] }, "high" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" - }, - "lowClosed" : true, - "highClosed" : false + "scope" : "D", + "type" : "Property", + "annotation" : [ ] + } } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] } } } ] - }, - "alias" : "D" + } } ] } - }, - "name" : "HasPriorAntibiotics", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasTargetEncounter", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] } - }, - "name" : "HasTargetEncounter", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "InInitialPopulation", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "name" : "InDemographic", "type" : "ExpressionRef", - "name" : "InDemographic" + "annotation" : [ ] }, { + "name" : "HasTargetEncounter", "type" : "ExpressionRef", - "name" : "HasTargetEncounter" + "annotation" : [ ] } ] - }, - "name" : "InInitialPopulation", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", - "expression" : { - "type" : "Literal", - "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", - "value" : "true" - }, "name" : "InDenominator", "context" : "Patient", - "accessLevel" : "Public" - }, { - "type" : "ExpressionDef", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { - "type" : "ExpressionRef", - "name" : "HasPriorAntibiotics" - }, + "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", + "value" : "true", + "type" : "Literal", + "annotation" : [ ] + } + }, { "name" : "InDenominatorExclusions", "context" : "Patient", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "expression" : { + "name" : "HasPriorAntibiotics", + "type" : "ExpressionRef", + "annotation" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "InNumerator", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "R", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Observation", + "templateId" : "observation-qicore-qicore-observation", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Group A Streptococcus Test", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Observation", - "templateId" : "observation-qicore-qicore-observation", - "codeProperty" : "code", - "codeComparator" : "in" - }, - "alias" : "R" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], + "relationship" : [ ], "where" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "issued", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "valueQuantity", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] } } } ] } } - }, - "name" : "InNumerator", - "context" : "Patient", - "accessLevel" : "Public" + } } ] - }, - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorOptions" : "", - "signatureLevel" : "None" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", - "errorType" : "semantic", - "errorSeverity" : "warning" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve membership operator for terminology target of the retrieve.", - "errorType" : "semantic", - "errorSeverity" : "warning" - } ] + } } } \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.xml b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.xml index e24aa6200..626db1ed4 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.xml +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_None.xml @@ -1,290 +1,228 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.json b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.json index d92cc0903..b93077f62 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.json +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.json @@ -1,724 +1,913 @@ { "library" : { - "type" : "Library", + "annotation" : [ { + "translatorOptions" : "", + "signatureLevel" : "Overloads", + "type" : "CqlToElmInfo" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "libraryId" : "CMS146", + "libraryVersion" : "2", + "startLine" : 22, + "startChar" : 5, + "endLine" : 22, + "endChar" : 54, + "message" : "Could not resolve membership operator for terminology target of the retrieve.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + } ], "identifier" : { - "type" : "VersionedIdentifier", "id" : "CMS146", "version" : "2" }, "schemaIdentifier" : { - "type" : "VersionedIdentifier", "id" : "urn:hl7-org:elm", "version" : "r1" }, "usings" : { - "type" : "Library$Usings", "def" : [ { - "type" : "UsingDef", "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1" + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] }, { - "type" : "UsingDef", "localIdentifier" : "QUICK", - "uri" : "http://hl7.org/fhir" + "uri" : "http://hl7.org/fhir", + "annotation" : [ ] } ] }, "parameters" : { - "type" : "Library$Parameters", "def" : [ { - "type" : "ParameterDef", + "name" : "MeasurementPeriod", + "accessLevel" : "Public", + "annotation" : [ ], "default" : { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2013" + "value" : "2013", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] } }, "high" : { "type" : "DateTime", + "annotation" : [ ], + "signature" : [ ], "year" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2014" + "value" : "2014", + "type" : "Literal", + "annotation" : [ ] }, "month" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "day" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1" + "value" : "1", + "type" : "Literal", + "annotation" : [ ] }, "hour" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "minute" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "second" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] }, "millisecond" : { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0" + "value" : "0", + "type" : "Literal", + "annotation" : [ ] } - }, - "lowClosed" : true, - "highClosed" : false - }, - "name" : "MeasurementPeriod", - "accessLevel" : "Public" + } + } } ] }, "valueSets" : { - "type" : "Library$ValueSets", "def" : [ { - "type" : "ValueSetDef", "name" : "Acute Pharyngitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1011", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Acute Tonsillitis", "id" : "2.16.840.1.113883.3.464.1003.102.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Ambulatory/ED Visit", "id" : "2.16.840.1.113883.3.464.1003.101.12.1061", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Antibiotic Medications", "id" : "2.16.840.1.113883.3.464.1003.196.12.1001", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] }, { - "type" : "ValueSetDef", "name" : "Group A Streptococcus Test", "id" : "2.16.840.1.113883.3.464.1003.198.12.1012", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "codeSystem" : [ ] } ] }, "contexts" : { - "type" : "Library$Contexts", "def" : [ { - "type" : "ContextDef", - "name" : "Patient" + "name" : "Patient", + "annotation" : [ ] } ] }, "statements" : { - "type" : "Library$Statements", "def" : [ { - "type" : "ExpressionDef", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], "expression" : { "type" : "SingletonFrom", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Retrieve", "dataType" : "{http://hl7.org/fhir}Patient", - "templateId" : "patient-qicore-qicore-patient" + "templateId" : "patient-qicore-qicore-patient", + "type" : "Retrieve", + "annotation" : [ ], + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } - }, - "name" : "Patient", - "context" : "Patient" + } }, { - "type" : "ExpressionDef", + "name" : "InDemographic", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "GreaterOrEqual", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] } ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2" + "value" : "2", + "type" : "Literal", + "annotation" : [ ] } ] }, { "type" : "Less", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Integer", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Integer" + "annotation" : [ ] } ], "operand" : [ { + "precision" : "Year", "type" : "CalculateAgeAt", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } ], "operand" : [ { + "path" : "birthDate", "type" : "Property", + "annotation" : [ ], "source" : { + "name" : "Patient", "type" : "ExpressionRef", - "name" : "Patient" - }, - "path" : "birthDate" + "annotation" : [ ] + } }, { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } - } ], - "precision" : "Year" + } ] }, { - "type" : "Literal", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "18" + "value" : "18", + "type" : "Literal", + "annotation" : [ ] } ] } ] - }, - "name" : "InDemographic", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Pharyngitis", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Union", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "dataType" : "{http://hl7.org/fhir}Condition", + "templateId" : "condition-qicore-qicore-condition", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Pharyngitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + }, { "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "condition-qicore-qicore-condition", "codeProperty" : "code", - "codeComparator" : "in" - }, { + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Acute Tonsillitis", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Condition", - "templateId" : "condition-qicore-qicore-condition", - "codeProperty" : "code", - "codeComparator" : "in" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } ] - }, - "name" : "Pharyngitis", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "Antibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}MedicationPrescription", + "templateId" : "medicationprescription-qicore-qicore-medicationprescription", + "codeProperty" : "medication.code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Antibiotic Medications", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}MedicationPrescription", - "templateId" : "medicationprescription-qicore-qicore-medicationprescription", - "codeProperty" : "medication.code", - "codeComparator" : "in" - }, - "name" : "Antibiotics", - "context" : "Patient", - "accessLevel" : "Public" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "TargetEncounters", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "E", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Encounter", + "templateId" : "encounter-qicore-qicore-encounter", + "codeProperty" : "type", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Ambulatory/ED Visit", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Encounter", - "templateId" : "encounter-qicore-qicore-encounter", - "codeProperty" : "type", - "codeComparator" : "in" - }, - "alias" : "E" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "P", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "P" + } }, { + "alias" : "A", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : false, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, "high" : { "type" : "Add", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Quantity" + "annotation" : [ ] } ], "operand" : [ { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } }, { - "type" : "Quantity", "value" : 3, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] - }, - "lowClosed" : false, - "highClosed" : true + } } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Start", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } } } } ] - }, - "alias" : "A" + } } ], "where" : { "type" : "IncludedIn", + "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] } - }, - "name" : "TargetEncounters", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "TargetDiagnoses", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "P", + "annotation" : [ ], "expression" : { + "name" : "Pharyngitis", "type" : "ExpressionRef", - "name" : "Pharyngitis" - }, - "alias" : "P" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "E", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] }, "suchThat" : { "type" : "OverlapsAfter", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "lowClosed" : true, + "highClosed" : true, "type" : "Interval", + "annotation" : [ ], "low" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "P" + "scope" : "P", + "type" : "Property", + "annotation" : [ ] }, "high" : { - "type" : "Property", "path" : "abatementDate", - "scope" : "P" - }, - "lowClosed" : true, - "highClosed" : true + "scope" : "P", + "type" : "Property", + "annotation" : [ ] + } }, { - "type" : "Property", "path" : "period", - "scope" : "E" + "scope" : "E", + "type" : "Property", + "annotation" : [ ] } ] - }, - "alias" : "E" + } } ] - }, - "name" : "TargetDiagnoses", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasPriorAntibiotics", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "A", + "annotation" : [ ], "expression" : { + "name" : "Antibiotics", "type" : "ExpressionRef", - "name" : "Antibiotics" - }, - "alias" : "A" + "annotation" : [ ] + } } ], + "let" : [ ], "relationship" : [ { + "alias" : "D", "type" : "With", + "annotation" : [ ], "expression" : { + "name" : "TargetDiagnoses", "type" : "ExpressionRef", - "name" : "TargetDiagnoses" + "annotation" : [ ] }, "suchThat" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "dateWritten", - "scope" : "A" + "scope" : "A", + "type" : "Property", + "annotation" : [ ] }, { + "lowClosed" : true, + "highClosed" : false, "type" : "Interval", + "annotation" : [ ], "low" : { "type" : "Subtract", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}Quantity" + "annotation" : [ ] } ], "operand" : [ { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] }, { - "type" : "Quantity", "value" : 30, - "unit" : "days" + "unit" : "days", + "type" : "Quantity", + "annotation" : [ ] } ] }, "high" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" - }, - "lowClosed" : true, - "highClosed" : false + "scope" : "D", + "type" : "Property", + "annotation" : [ ] + } } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "onsetDateTime", - "scope" : "D" + "scope" : "D", + "type" : "Property", + "annotation" : [ ] } } } ] - }, - "alias" : "D" + } } ] } - }, - "name" : "HasPriorAntibiotics", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "HasTargetEncounter", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}Encounter", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}Encounter" + "annotation" : [ ] } } ], "operand" : { + "name" : "TargetEncounters", "type" : "ExpressionRef", - "name" : "TargetEncounters" + "annotation" : [ ] } - }, - "name" : "HasTargetEncounter", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", + "name" : "InInitialPopulation", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { + "name" : "InDemographic", "type" : "ExpressionRef", - "name" : "InDemographic" + "annotation" : [ ] }, { + "name" : "HasTargetEncounter", "type" : "ExpressionRef", - "name" : "HasTargetEncounter" + "annotation" : [ ] } ] - }, - "name" : "InInitialPopulation", - "context" : "Patient", - "accessLevel" : "Public" + } }, { - "type" : "ExpressionDef", - "expression" : { - "type" : "Literal", - "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", - "value" : "true" - }, "name" : "InDenominator", "context" : "Patient", - "accessLevel" : "Public" - }, { - "type" : "ExpressionDef", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { - "type" : "ExpressionRef", - "name" : "HasPriorAntibiotics" - }, + "valueType" : "{urn:hl7-org:elm-types:r1}Boolean", + "value" : "true", + "type" : "Literal", + "annotation" : [ ] + } + }, { "name" : "InDenominatorExclusions", "context" : "Patient", - "accessLevel" : "Public" + "accessLevel" : "Public", + "annotation" : [ ], + "expression" : { + "name" : "HasPriorAntibiotics", + "type" : "ExpressionRef", + "annotation" : [ ] + } }, { - "type" : "ExpressionDef", + "name" : "InNumerator", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ ], "expression" : { "type" : "Exists", + "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", + "annotation" : [ ], "elementType" : { + "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier", - "name" : "{http://hl7.org/fhir}Observation" + "annotation" : [ ] } } ], "operand" : { "type" : "Query", + "annotation" : [ ], "source" : [ { - "type" : "AliasedQuerySource", + "alias" : "R", + "annotation" : [ ], "expression" : { + "dataType" : "{http://hl7.org/fhir}Observation", + "templateId" : "observation-qicore-qicore-observation", + "codeProperty" : "code", + "codeComparator" : "in", "type" : "Retrieve", + "annotation" : [ ], "codes" : { - "type" : "ValueSetRef", "name" : "Group A Streptococcus Test", - "preserve" : true + "preserve" : true, + "type" : "ValueSetRef", + "annotation" : [ ] }, - "dataType" : "{http://hl7.org/fhir}Observation", - "templateId" : "observation-qicore-qicore-observation", - "codeProperty" : "code", - "codeComparator" : "in" - }, - "alias" : "R" + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } ], + "let" : [ ], + "relationship" : [ ], "where" : { "type" : "And", + "annotation" : [ ], + "signature" : [ ], "operand" : [ { "type" : "In", + "annotation" : [ ], "signature" : [ { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] }, { "type" : "IntervalTypeSpecifier", + "annotation" : [ ], "pointType" : { + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "type" : "NamedTypeSpecifier", - "name" : "{urn:hl7-org:elm-types:r1}DateTime" + "annotation" : [ ] } } ], "operand" : [ { - "type" : "Property", "path" : "issued", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] }, { + "name" : "MeasurementPeriod", "type" : "ParameterRef", - "name" : "MeasurementPeriod" + "annotation" : [ ] } ] }, { "type" : "Not", + "annotation" : [ ], + "signature" : [ ], "operand" : { "type" : "IsNull", + "annotation" : [ ], + "signature" : [ ], "operand" : { - "type" : "Property", "path" : "valueQuantity", - "scope" : "R" + "scope" : "R", + "type" : "Property", + "annotation" : [ ] } } } ] } } - }, - "name" : "InNumerator", - "context" : "Patient", - "accessLevel" : "Public" + } } ] - }, - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorOptions" : "", - "signatureLevel" : "Overloads" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve code path medication.code for the type of the retrieve QUICK.MedicationPrescription.", - "errorType" : "semantic", - "errorSeverity" : "warning" - }, { - "type" : "CqlToElmError", - "libraryId" : "CMS146", - "libraryVersion" : "2", - "startLine" : 22, - "startChar" : 5, - "endLine" : 22, - "endChar" : 54, - "message" : "Could not resolve membership operator for terminology target of the retrieve.", - "errorType" : "semantic", - "errorSeverity" : "warning" - } ] + } } } \ No newline at end of file diff --git a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.xml b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.xml index 2721f5a87..925faaaa3 100644 --- a/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.xml +++ b/Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/CMS146v2_Expected_SignatureLevel_Overloads.xml @@ -1,344 +1,260 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/java/elm-test/build.gradle b/Src/java/elm-test/build.gradle index 0e9c83526..d6e14a29c 100644 --- a/Src/java/elm-test/build.gradle +++ b/Src/java/elm-test/build.gradle @@ -4,8 +4,7 @@ plugins { dependencies { implementation project(':cql-to-elm') - // implementation project(':model-jaxb') + implementation project(':model-jaxb') implementation project(':elm-jaxb') - implementation project(':model-jackson') implementation project(':elm-jackson') } diff --git a/Src/java/engine/build.gradle b/Src/java/engine/build.gradle index 03212da9a..c8fb511cd 100644 --- a/Src/java/engine/build.gradle +++ b/Src/java/engine/build.gradle @@ -6,8 +6,8 @@ dependencies { api project(':elm') api project(':cql-to-elm') - testImplementation project(':model-jackson') - testImplementation project(':elm-jackson') + testImplementation project(':model-jaxb') + testImplementation project(':elm-jaxb') testImplementation 'org.mockito:mockito-core:5.4.0' }