public class I2b2ExtractorFactory extends Object implements AutoCloseable, ObservationExtractor
Allows simple queries against the i2b2 observation_fact table and retrieval of facts.
TODO add/use interface from histream-core| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOW_WILDCARD_CONCEPT_CODES
Boolean feature whether to allow wildcard concept keys.
|
| Constructor and Description |
|---|
I2b2ExtractorFactory(DataSource crc_ds,
ObservationFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ObservationSupplier |
extract(Instant start_min,
Instant start_max,
Iterable<String> notations) |
protected I2b2Extractor |
extract(Timestamp start_min,
Timestamp start_max,
Iterable<String> notations)
Extract observations for given concept codes with
observation.start between start_min and start_end. |
ObservationFactory |
getObservationFactory() |
PreparedStatement |
prepareStatement(Connection dbc,
String sql) |
void |
setFeature(String feature,
Object value) |
void |
setProperty(String property,
Object value) |
public static String ALLOW_WILDCARD_CONCEPT_CODES
Use with caution: Unexpected results might happen if wildcard concepts overlap. (Such as query fails, duplicate facts, etc.)
public I2b2ExtractorFactory(DataSource crc_ds, ObservationFactory factory) throws SQLException
SQLExceptionpublic ObservationFactory getObservationFactory()
public PreparedStatement prepareStatement(Connection dbc, String sql) throws SQLException
SQLExceptionprotected I2b2Extractor extract(Timestamp start_min, Timestamp start_max, Iterable<String> notations) throws SQLException
observation.start between start_min and start_end.
The query can use the index of_idx_clusteredconcept for concept_cd
and of_idx_start_date for start_date.
TODO integration test without concepts, with normal concepts, with wildcard concepts, wildcard concepts with literal _ or % in id
start_min - start date of returned observations must be greater than start_minstart_max - start date of returned observations must be less than start_maxnotations - concept ids to extractSQLException - errorpublic void close()
throws SQLException
close in interface AutoCloseableSQLExceptionpublic ObservationSupplier extract(Instant start_min, Instant start_max, Iterable<String> notations) throws ObservationException
extract in interface ObservationExtractorObservationExceptionCopyright © 2013–2016 R.W.Majeed. All rights reserved.