Java Code Examples for org.cqframework.cql.cql2elm.CqlTranslator#fromStream()
The following examples show how to use
org.cqframework.cql.cql2elm.CqlTranslator#fromStream() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TranslatorHelper.java From cqf-ruler with Apache License 2.0 | 6 votes |
public static CqlTranslator getTranslator(InputStream cqlStream, LibraryManager libraryManager, ModelManager modelManager) { ArrayList<CqlTranslator.Options> options = new ArrayList<>(); options.add(CqlTranslator.Options.EnableAnnotations); options.add(CqlTranslator.Options.EnableLocators); options.add(CqlTranslator.Options.DisableListDemotion); options.add(CqlTranslator.Options.DisableListPromotion); options.add(CqlTranslator.Options.DisableMethodInvocation); CqlTranslator translator; try { translator = CqlTranslator.fromStream(cqlStream, modelManager, libraryManager, options.toArray(new CqlTranslator.Options[options.size()])); } catch (IOException e) { throw new IllegalArgumentException(String.format("Errors occurred translating library: %s", e.getMessage())); } return translator; }
Example 2
Source File: TimeOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 3
Source File: EscapeSequenceTests.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 4
Source File: CqlComparisonOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@BeforeTest public void setup() throws IOException { ModelManager modelManager = new ModelManager(); CqlTranslator translator = CqlTranslator.fromStream(CqlComparisonOperatorsTest.class.getResourceAsStream("../OperatorTests/CqlComparisonOperators.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); } } }
Example 5
Source File: NullologicalOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 6
Source File: TypeOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 7
Source File: ListOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 8
Source File: SortingTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@BeforeTest public void setup() throws IOException { ModelManager modelManager = new ModelManager(); CqlTranslator translator = CqlTranslator.fromStream(QueryTest.class.getResourceAsStream("../OperatorTests/Sorting.cql"), modelManager, new LibraryManager(modelManager)); // The alias test creates an error assertThat(translator.getErrors().size(), is(1)); Library library = translator.toELM(); defs = new HashMap<>(); for (ExpressionDef def: library.getStatements().getDef()) { defs.put(def.getName(), def); } }
Example 9
Source File: QueryTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 10
Source File: CqlIntervalOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } } }
Example 11
Source File: ArithmeticOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 12
Source File: CqlListOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } } }
Example 13
Source File: AggregateOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } } }
Example 14
Source File: AgeOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@BeforeTest public void setup() throws IOException { ModelManager modelManager = new ModelManager(); CqlTranslator translator = CqlTranslator.fromStream(AgeOperatorsTest.class.getResourceAsStream("../OperatorTests/AgeOperators.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); } } }
Example 15
Source File: StringOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@BeforeTest public void setup() throws IOException { ModelManager modelManager = new ModelManager(); CqlTranslator translator = CqlTranslator.fromStream(StringOperatorsTest.class.getResourceAsStream("../OperatorTests/StringOperators.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); } }
Example 16
Source File: DateTimeOperatorsTest.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }
Example 17
Source File: EscapeSequenceWithBacktickTests.java From clinical_quality_language with Apache License 2.0 | 5 votes |
@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); } }