Search in sources :

Example 11 with LibraryManager

use of org.cqframework.cql.cql2elm.LibraryManager 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 12 with LibraryManager

use of org.cqframework.cql.cql2elm.LibraryManager 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)

Example 13 with LibraryManager

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

the class EscapeSequenceTests method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    LibraryManager libraryManager = new LibraryManager(modelManager);
    CqlTranslator translator = CqlTranslator.fromStream(org.cqframework.cql.cql2elm.EscapeSequenceTests.class.getResourceAsStream("EscapeSequenceTests.cql"), modelManager, libraryManager);
    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) BeforeTest(org.testng.annotations.BeforeTest)

Example 14 with LibraryManager

use of org.cqframework.cql.cql2elm.LibraryManager 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 15 with LibraryManager

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

the class EscapeSequenceWithBacktickTests method setup.

@BeforeTest
public void setup() throws IOException {
    ModelManager modelManager = new ModelManager();
    LibraryManager libraryManager = new LibraryManager(modelManager);
    CqlTranslator translator = CqlTranslator.fromStream(org.cqframework.cql.cql2elm.EscapeSequenceTests.class.getResourceAsStream("EscapeSequenceWithBacktickTests.cql"), modelManager, libraryManager);
    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) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

LibraryManager (org.cqframework.cql.cql2elm.LibraryManager)26 CqlTranslator (org.cqframework.cql.cql2elm.CqlTranslator)24 ModelManager (org.cqframework.cql.cql2elm.ModelManager)19 BeforeTest (org.testng.annotations.BeforeTest)16 CqlTranslatorException (org.cqframework.cql.cql2elm.CqlTranslatorException)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ArrayList (java.util.ArrayList)2 FhirLibrarySourceProvider (org.cqframework.cql.cql2elm.FhirLibrarySourceProvider)2 ExpressionDef (org.hl7.elm.r1.ExpressionDef)2 Library (org.hl7.elm.r1.Library)2 FhirContext (ca.uhn.fhir.context.FhirContext)1 CqlLibrary (com.ibm.cohort.cql.library.CqlLibrary)1 CqlLibraryDescriptor (com.ibm.cohort.cql.library.CqlLibraryDescriptor)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 JAXBException (javax.xml.bind.JAXBException)1 LibraryBuilder (org.cqframework.cql.cql2elm.LibraryBuilder)1 TranslatedLibrary (org.cqframework.cql.cql2elm.model.TranslatedLibrary)1 Library (org.cqframework.cql.elm.execution.Library)1