@Test public void testQryObservation() throws Exception { String query = "select a/uid/value as uid, a/composer/name\n" + "as author, a/context/start_time/value as date_created,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value/value as test_name,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[at0057]/value/value as conclusion,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[at0073]/value/value as status,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[at0075]/value/value as sample_taken,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0]/items[at0002]/items[at0001]/name/value as labResultName,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0]/items[at0002]/items[at0001]/name/defining_code/code_string as labResultCode,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0]/items[at0002]/items[at0001]/value/magnitude as labResultValue,\n" + "a_a/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0]/items[at0002]/items[at0001]/value/units as labResultUnits\n" + "from EHR e [ehr_id/value = 'cd8abecd-9925-4313-86af-93aab4930eae']\n" + "contains COMPOSITION a[openEHR-EHR-COMPOSITION.report-result.v1]\n" + "contains OBSERVATION a_a[openEHR-EHR-OBSERVATION.laboratory_test.v0]\n" + "where a/name/value='Laboratory test report'"; records = queryEngine.perform(query); assertNotNull(records); assertFalse(records.isEmpty()); System.out.print(records); }
public List<Record> perform(String query, boolean explain) throws SQLException { QueryProcessor queryProcessor = new QueryProcessor(context, knowledgeCache, introspectCache); QueryParser queryParser = new QueryParser(context, query); queryParser.pass1(); queryParser.pass2(); List<Record> records = (List<Record>)queryProcessor.execute(queryParser, serverNodeId, explain); return records; }
QueryEngine extends TemplateMetaData { public List<Record> perform(String query, boolean explain) throws SQLException { QueryProcessor queryProcessor = new QueryProcessor(context, knowledgeCache, introspectCache); QueryParser queryParser = new QueryParser(context, query); queryParser.pass1(); queryParser.pass2(); List<Record> records = (List<Record>)queryProcessor.execute(queryParser, serverNodeId, explain); return records; } }
QueryEngine extends TemplateMetaData { public List<Record> perform(String query, boolean explain) throws SQLException { QueryProcessor queryProcessor = new QueryProcessor(context, knowledgeCache, introspectCache); QueryParser queryParser = new QueryParser(context, query); queryParser.pass1(); queryParser.pass2(); List<Record> records = (List<Record>)queryProcessor.execute(queryParser, serverNodeId, explain); return records; } QueryEngine(DSLContext context, String serverNodeId);  QueryEngine(DSLContext context, String serverNodeId, I_KnowledgeCache knowledgeCache);  QueryEngine(DSLContext context, String serverNodeId, I_KnowledgeCache knowledgeCache, I_IntrospectCache introspectCache); }
QueryEngine extends TemplateMetaData { public List<Record> perform(String query, boolean explain) throws SQLException { QueryProcessor queryProcessor = new QueryProcessor(context, knowledgeCache, introspectCache); QueryParser queryParser = new QueryParser(context, query); queryParser.pass1(); queryParser.pass2(); List<Record> records = (List<Record>)queryProcessor.execute(queryParser, serverNodeId, explain); return records; } QueryEngine(DSLContext context, String serverNodeId);  QueryEngine(DSLContext context, String serverNodeId, I_KnowledgeCache knowledgeCache);  QueryEngine(DSLContext context, String serverNodeId, I_KnowledgeCache knowledgeCache, I_IntrospectCache introspectCache); List<Record> perform(String query, boolean explain); List<Record> perform(String query); }
QueryEngine extends TemplateMetaData { public List<Record> perform(String query, boolean explain) throws SQLException { QueryProcessor queryProcessor = new QueryProcessor(context, knowledgeCache, introspectCache); QueryParser queryParser = new QueryParser(context, query); queryParser.pass1(); queryParser.pass2(); List<Record> records = (List<Record>)queryProcessor.execute(queryParser, serverNodeId, explain); return records; } QueryEngine(DSLContext context, String serverNodeId);  QueryEngine(DSLContext context, String serverNodeId, I_KnowledgeCache knowledgeCache);  QueryEngine(DSLContext context, String serverNodeId, I_KnowledgeCache knowledgeCache, I_IntrospectCache introspectCache); List<Record> perform(String query, boolean explain); List<Record> perform(String query);  }