use of com.ibm.cohort.cql.evaluation.CqlEvaluationRequests in project quality-measure-and-cohort-service by Alvearie.
the class SparkSchemaCreatorTest method testDuplicateElementInformation.
@Test(expected = IllegalArgumentException.class)
public void testDuplicateElementInformation() throws Exception {
cqlTranslator.registerModelInfo(new File("src/test/resources/schema-validation/duplicate-element-model-info.xml"));
ContextDefinitions contextDefinitions = makeContextDefinitions(Arrays.asList(makeContextDefinition("Context1Id", "Type1", "integer")));
CqlEvaluationRequests cqlEvaluationRequests = makeEvaluationRequests(Arrays.asList(makeEvaluationRequest(new CqlLibraryDescriptor().setLibraryId("Context1Id").setVersion("1.0.0"), new HashSet<>(Collections.singletonList("define_integer")), "Context1Id")));
SparkSchemaCreator schemaCreator = new SparkSchemaCreator(cqlLibraryProvider, cqlEvaluationRequests, contextDefinitions, outputColumnNameFactory, cqlTranslator);
schemaCreator.calculateSchemasForContexts(Arrays.asList("Context1Id"));
}
use of com.ibm.cohort.cql.evaluation.CqlEvaluationRequests in project quality-measure-and-cohort-service by Alvearie.
the class SparkSchemaCreatorTest method testUnsupportedKeyColumnType.
@Test(expected = UnsupportedOperationException.class)
public void testUnsupportedKeyColumnType() throws Exception {
ContextDefinitions contextDefinitions = makeContextDefinitions(Arrays.asList(makeContextDefinition("Context1Id", "Type1", "code")));
CqlEvaluationRequests cqlEvaluationRequests = makeEvaluationRequests(Arrays.asList(makeEvaluationRequest(new CqlLibraryDescriptor().setLibraryId("Context1Id").setVersion("1.0.0"), new HashSet<>(Collections.singletonList("define_integer")), "Context1Id")));
SparkSchemaCreator schemaCreator = new SparkSchemaCreator(cqlLibraryProvider, cqlEvaluationRequests, contextDefinitions, outputColumnNameFactory, cqlTranslator);
schemaCreator.calculateSchemasForContexts(Arrays.asList("Context1Id"));
}
use of com.ibm.cohort.cql.evaluation.CqlEvaluationRequests in project quality-measure-and-cohort-service by Alvearie.
the class SparkSchemaCreatorTest method testLibraryNotFound.
@Test(expected = IllegalArgumentException.class)
public void testLibraryNotFound() throws Exception {
ContextDefinitions contextDefinitions = makeContextDefinitions(Collections.singletonList(makeContextDefinition("Context1Id", "Type1", "id")));
CqlEvaluationRequests cqlEvaluationRequests = makeEvaluationRequests(Arrays.asList(makeEvaluationRequest(new CqlLibraryDescriptor().setLibraryId("NotExists").setVersion("1.0.0"), new HashSet<>(Collections.singletonList("bad-define")), "Context1Id")));
SparkSchemaCreator schemaCreator = new SparkSchemaCreator(cqlLibraryProvider, cqlEvaluationRequests, contextDefinitions, outputColumnNameFactory, cqlTranslator);
schemaCreator.calculateSchemasForContexts(Arrays.asList("Context1Id"));
}
use of com.ibm.cohort.cql.evaluation.CqlEvaluationRequests in project quality-measure-and-cohort-service by Alvearie.
the class SparkSchemaCreatorTest method testDefineNotFoundInLibrary.
@Test(expected = IllegalArgumentException.class)
public void testDefineNotFoundInLibrary() throws Exception {
ContextDefinitions contextDefinitions = makeContextDefinitions(Collections.singletonList(makeContextDefinition("Context1Id", "Type1", "id")));
CqlEvaluationRequests cqlEvaluationRequests = makeEvaluationRequests(Arrays.asList(makeEvaluationRequest(new CqlLibraryDescriptor().setLibraryId("Context1Id").setVersion("1.0.0"), new HashSet<>(Collections.singletonList("bad-define")), "Context1Id")));
SparkSchemaCreator schemaCreator = new SparkSchemaCreator(cqlLibraryProvider, cqlEvaluationRequests, contextDefinitions, outputColumnNameFactory, cqlTranslator);
schemaCreator.calculateSchemasForContexts(Arrays.asList("Context1Id"));
}
Aggregations