use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class SelectRMIT method testAdminEntryDrillDown.
@Test
public void testAdminEntryDrillDown() throws IOException {
String rootPath = "a";
RMObject referenceNode = (RMObject) aComposition.itemsAtPath("/content[openEHR-EHR-SECTION.test_all_types.v1]/items[at0001]/items[openEHR-EHR-ADMIN_ENTRY.test_all_types.v1]").get(0);
String contains = "composition c[openEHR-EHR-COMPOSITION.test_all_types.v1]" + " contains section s[openEHR-EHR-SECTION.test_all_types.v1]" + " contains ADMIN_ENTRY a[openEHR-EHR-ADMIN_ENTRY.test_all_types.v1]";
String csvTestSet = dirPath + "/testAdminEntryDrillDown.csv";
assertThat(simpleSelectQueryEngine.testItemPaths(csvTestSet, rootPath, contains, referenceNode)).isTrue();
}
use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class SelectRMIT method testContextAttributesDrillDown.
@Test
public void testContextAttributesDrillDown() throws IOException {
String rootPath = "c/context";
RMObject referenceNode = aComposition.getContext();
String contains = "composition c[openEHR-EHR-COMPOSITION.test_all_types.v1]";
String csvTestSet = dirPath + "/testContextAttributesDrillDown.csv";
assertThat(simpleSelectQueryEngine.testItemPaths(csvTestSet, rootPath, contains, referenceNode)).isTrue();
}
use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class SelectRMIT method testEvaluationDrillDown.
@Test
public void testEvaluationDrillDown() throws IOException {
String rootPath = "eval";
RMObject referenceNode = (RMObject) aComposition.itemsAtPath("/content[openEHR-EHR-EVALUATION.test_all_types.v1]").get(0);
String contains = "composition c[openEHR-EHR-COMPOSITION.test_all_types.v1]" + " contains evaluation eval[openEHR-EHR-EVALUATION.test_all_types.v1]";
String csvTestSet = dirPath + "/testEvaluationDrillDown.csv";
assertThat(simpleSelectQueryEngine.testItemPaths(csvTestSet, rootPath, contains, referenceNode)).isTrue();
}
use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class TestQueryEngine method checkAutoWhereQuery.
protected void checkAutoWhereQuery(String csvPath, String rootPath, String contains, RMObject referenceNode) throws FileNotFoundException {
SimplePathExpressionSettings simplePathExpressionSettings = new SimplePathExpressionSettings();
CsvParser csvParser = new CsvParser(simplePathExpressionSettings.settings());
csvParser.parse(new FileReader(csvPath));
List<PathExpression> attributeDefinitions = simplePathExpressionSettings.getPathExpressionRow().getBeans();
for (PathExpression pathExpression : attributeDefinitions) {
if (pathExpression.getComment() == null) {
// conventionally, if params[1] exists, this means skip the test
String attributePath = pathExpression.getPath();
QueryResponseData result = performQueryWithWhere(rootPath, attributePath, contains, new AutoWhereCondition(rootPath, attributePath, referenceNode).condition());
if (result.getRows().isEmpty())
fail(rootPath + "/" + attributePath + ": no result");
List<Object> objectList = result.getRows().get(0);
assertThat(valueObject(objectList.get(0))).as(rootPath + "/" + attributePath).isEqualTo(attributeValueAt(referenceNode, attributePath));
}
}
}
use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class TestQueryEngine method checkAutoEhrStatusWhereQuery.
protected void checkAutoEhrStatusWhereQuery(String csvPath, String rootPath, RMObject referenceNode) throws FileNotFoundException {
SimplePathExpressionSettings simplePathExpressionSettings = new SimplePathExpressionSettings();
CsvParser csvParser = new CsvParser(simplePathExpressionSettings.settings());
csvParser.parse(new FileReader(csvPath));
List<PathExpression> attributeDefinitions = simplePathExpressionSettings.getPathExpressionRow().getBeans();
for (PathExpression pathExpression : attributeDefinitions) {
if (pathExpression.getComment() == null) {
String attributePath = pathExpression.getPath();
QueryResponseData result = performEhrStatusQueryWithAutoWhere(rootPath, attributePath, referenceNode);
if (result.getRows().isEmpty())
fail(rootPath + "/" + attributePath + ": no result");
List<Object> objectList = result.getRows().get(0);
assertThat(valueObject(objectList.get(0))).as(rootPath + "/" + attributePath).isEqualTo(attributeValueAt(referenceNode, attributePath));
}
}
}
Aggregations