Search in sources :

Example 6 with ModelManager

use of org.cqframework.cql.cql2elm.ModelManager in project clinical_quality_language by cqframework.

the class DateTimeOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(DateTimeOperatorsTest.class.getResourceAsStream("../OperatorTests/DateTimeOperators.cql"), modelManager, new LibraryManager(modelManager));
    assertThat(translator.getErrors().size(), is(0));
    Library library = translator.toELM();
    defs = new HashMap<>();
    for (ExpressionDef def : library.getStatements().getDef()) {
        defs.put(def.getName(), def);
    }
}
Also used : CqlTranslator(org.cqframework.cql.cql2elm.CqlTranslator) LibraryManager(org.cqframework.cql.cql2elm.LibraryManager) ModelManager(org.cqframework.cql.cql2elm.ModelManager) BeforeTest(org.testng.annotations.BeforeTest)

Example 7 with ModelManager

use of org.cqframework.cql.cql2elm.ModelManager in project clinical_quality_language by cqframework.

the class ListOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(ListOperatorsTest.class.getResourceAsStream("../OperatorTests/ListOperators.cql"), modelManager, new LibraryManager(modelManager));
    assertThat(translator.getErrors().size(), is(0));
    Library library = translator.toELM();
    defs = new HashMap<>();
    for (ExpressionDef def : library.getStatements().getDef()) {
        defs.put(def.getName(), def);
    }
}
Also used : CqlTranslator(org.cqframework.cql.cql2elm.CqlTranslator) LibraryManager(org.cqframework.cql.cql2elm.LibraryManager) ModelManager(org.cqframework.cql.cql2elm.ModelManager) BeforeTest(org.testng.annotations.BeforeTest)

Example 8 with ModelManager

use of org.cqframework.cql.cql2elm.ModelManager in project clinical_quality_language by cqframework.

the class TimeOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(TimeOperatorsTest.class.getResourceAsStream("../OperatorTests/TimeOperators.cql"), modelManager, new LibraryManager(modelManager));
    assertThat(translator.getErrors().size(), is(0));
    Library library = translator.toELM();
    defs = new HashMap<>();
    for (ExpressionDef def : library.getStatements().getDef()) {
        defs.put(def.getName(), def);
    }
}
Also used : CqlTranslator(org.cqframework.cql.cql2elm.CqlTranslator) LibraryManager(org.cqframework.cql.cql2elm.LibraryManager) ModelManager(org.cqframework.cql.cql2elm.ModelManager) BeforeTest(org.testng.annotations.BeforeTest)

Example 9 with ModelManager

use of org.cqframework.cql.cql2elm.ModelManager in project clinical_quality_language by cqframework.

the class AggregateOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(AggregateOperatorsTest.class.getResourceAsStream("../OperatorTests/AggregateOperators.cql"), modelManager, new LibraryManager(modelManager));
    assertThat(translator.getErrors().size(), is(0));
    Library library = translator.toELM();
    defs = new HashMap<>();
    if (library.getStatements() != null) {
        for (ExpressionDef def : library.getStatements().getDef()) {
            defs.put(def.getName(), def);
        }
    }
}
Also used : CqlTranslator(org.cqframework.cql.cql2elm.CqlTranslator) LibraryManager(org.cqframework.cql.cql2elm.LibraryManager) ModelManager(org.cqframework.cql.cql2elm.ModelManager) BeforeTest(org.testng.annotations.BeforeTest)

Example 10 with ModelManager

use of org.cqframework.cql.cql2elm.ModelManager in project clinical_quality_language by cqframework.

the class ArithmeticOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(ArithmeticOperatorsTest.class.getResourceAsStream("../OperatorTests/ArithmeticOperators.cql"), modelManager, new LibraryManager(modelManager));
    assertThat(translator.getErrors().size(), is(0));
    Library library = translator.toELM();
    defs = new HashMap<>();
    for (ExpressionDef def : library.getStatements().getDef()) {
        defs.put(def.getName(), def);
    }
}
Also used : CqlTranslator(org.cqframework.cql.cql2elm.CqlTranslator) LibraryManager(org.cqframework.cql.cql2elm.LibraryManager) ModelManager(org.cqframework.cql.cql2elm.ModelManager) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

ModelManager (org.cqframework.cql.cql2elm.ModelManager)21 LibraryManager (org.cqframework.cql.cql2elm.LibraryManager)19 CqlTranslator (org.cqframework.cql.cql2elm.CqlTranslator)17 BeforeTest (org.testng.annotations.BeforeTest)14 ByteArrayInputStream (java.io.ByteArrayInputStream)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 CqlTranslatorException (org.cqframework.cql.cql2elm.CqlTranslatorException)2 FhirLibrarySourceProvider (org.cqframework.cql.cql2elm.FhirLibrarySourceProvider)2 Library (org.cqframework.cql.elm.execution.Library)2 ExpressionDef (org.hl7.elm.r1.ExpressionDef)2 Library (org.hl7.elm.r1.Library)2 FhirContext (ca.uhn.fhir.context.FhirContext)1 CqlEvaluationRequest (com.ibm.cohort.cql.evaluation.CqlEvaluationRequest)1 CqlEvaluationRequests (com.ibm.cohort.cql.evaluation.CqlEvaluationRequests)1 CqlLibrary (com.ibm.cohort.cql.library.CqlLibrary)1 CqlLibraryDescriptor (com.ibm.cohort.cql.library.CqlLibraryDescriptor)1 CqlLibraryProvider (com.ibm.cohort.cql.library.CqlLibraryProvider)1 Format (com.ibm.cohort.cql.library.Format)1 ContextDefinition (com.ibm.cohort.cql.spark.aggregation.ContextDefinition)1