Search in sources :

Example 11 with ModelManager

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

the class TypeOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(TypeOperatorsTest.class.getResourceAsStream("../OperatorTests/TypeOperators.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 12 with ModelManager

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

the class CqlIntervalOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(CqlIntervalOperatorsTest.class.getResourceAsStream("../OperatorTests/CqlIntervalOperators.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 13 with ModelManager

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

the class CqlListOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(CqlListOperatorsTest.class.getResourceAsStream("../OperatorTests/CqlListOperators.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 14 with ModelManager

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

the class NullologicalOperatorsTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(NullologicalOperatorsTest.class.getResourceAsStream("../OperatorTests/NullologicalOperators.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 : ExpressionDef(org.hl7.elm.r1.ExpressionDef) CqlTranslator(org.cqframework.cql.cql2elm.CqlTranslator) LibraryManager(org.cqframework.cql.cql2elm.LibraryManager) Library(org.hl7.elm.r1.Library) ModelManager(org.cqframework.cql.cql2elm.ModelManager) BeforeTest(org.testng.annotations.BeforeTest)

Example 15 with ModelManager

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

the class QueryTest method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    CqlTranslator translator = CqlTranslator.fromStream(QueryTest.class.getResourceAsStream("../OperatorTests/Query.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