Commit 69820975 authored by R.W.Majeed's avatar R.W.Majeed

javadoc, minor improvements with extractor

parent ddc58f2e
......@@ -4,12 +4,22 @@ import java.time.Instant;
/**
* Extracts observations from complex sources
* such as databases and data warehouses
* such as databases and data warehouses.
*
* @author R.W.Majeed
*
*/
public interface ObservationExtractor {
/**
* Extract observations with a start time stamp between the specified limits.
* Only observations with the specified notations are extracted.
*
* @param start_min minimum time for observation start (inclusive)
* @param start_max maximum time for observation start (inclusive)
* @param notations concept notations. Specifies which observations are extracted.
* @return supplier for the extracted observations. Must be closed after use.
* @throws ObservationException error (e.g. database failure)
*/
ObservationSupplier extract(Instant start_min, Instant start_max, Iterable<String> notations) throws ObservationException;
}
<aggregate xmlns="http://sekmi.de/ns/histream/export-v1">
</aggregate>
\ No newline at end of file
......@@ -22,6 +22,7 @@ to construct table data.
<concept notation="LOINC:26436-6:NEG" />
</group>
<group class="diag">
<!-- wildcard-notation only supported until ontology IRI queries are -->
<concept wildcard-notation="ICD10:*" />
<concept iri="http://data.dzl.de/ns/ont/xxx"/>
</group>
......@@ -44,8 +45,8 @@ to construct table data.
<column header="start" xpath="eav:start"/>
<!-- What is better? -->
<!-- (a) First column, then concepts with value -->
<column header="diagnostik_labort_ts" xpath="eav:fact[@class='d_lab']/@start"/>
<column header="diagnostik_labort" xpath="eav:fact[@class='d_lab']/@concept"/>
<column header="diagnostik_labor_ts" xpath="eav:fact[@class='d_lab']/@start"/>
<column header="diagnostik_labor" xpath="eav:fact[@class='d_lab']/@concept"/>
<!-- (b) first concepts then columns with value -->
<column header="diagnostik_labort_ts" xpath="eav:fact[@class='d_lab']/@start"/>
<column header="diagnostik_labort" xpath="eav:fact[@class='d_lab']/eav:modifier[@code='OPB' or @code='PB']/@code"/>
......@@ -64,4 +65,20 @@ to construct table data.
<column header="code" type="@concept"/>
<column header="primary" xpath="eav:modifier[@code='fuehrend']/@code"/>
</eav-table>
<!-- ... more eav-table -->
<!--
<aggregate id="gender-count" table-ref="patient" by="gender">
<function name="count" column="gender"/>
</aggregate>
<aggregate id="latest-visit" table-ref="visit">
<column name="latest" ref="start" function="max"/>
<function name="count" column="start"/>
<function name="count" column="diagnostik_labor" na="remove"/>
</aggregate>
<aggregate-table id="diag-count" table-ref="diag" by="code">
<column name="count" function="count" ref="start"/>
</aggregate-table>
XXX how indicate that a table is only for aggregation and should be removed after processing?
Aggregate tables can reference other aggregate tables
-->
</export>
\ No newline at end of file
......@@ -123,7 +123,7 @@ public class I2b2ExtractorFactory implements AutoCloseable, ObservationExtractor
* @throws SQLException error
*/
//@SuppressWarnings("resource")
public I2b2Extractor extract(Timestamp start_min, Timestamp start_max, Iterable<String> notations) throws SQLException{
protected I2b2Extractor extract(Timestamp start_min, Timestamp start_max, Iterable<String> notations) throws SQLException{
// TODO move connection and prepared statement to I2b2Extractor
Connection dbc = ds.getConnection();
PreparedStatement ps = null;
......@@ -138,10 +138,10 @@ public class I2b2ExtractorFactory implements AutoCloseable, ObservationExtractor
Iterable<String> ids = notations;
int wildcardCount = 0;
if( allowWildcardConceptCodes ){
// TODO check if wildcards actually used (search for *)
List<String>escaped = new ArrayList<>();
for( String id : ids ){
String es = escapeLikeString(id).replace('*', '%');
// check if wildcards actually used
if( false == es.equals(id) ){
wildcardCount ++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment