Skip to content

Commit

Permalink
IBMStreams#10: Contribute physionet adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
chanskw committed Dec 3, 2016
1 parent 9adf40d commit 9481e46
Show file tree
Hide file tree
Showing 32 changed files with 2,662 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ingest/physionet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# streamsx.health

This community is focused on using Streams in the health care industry. Go to the wiki to participate in the discussion.

https://github.com/IBMStreams/streamsx.health/wiki


Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="impl/java/bin" path="impl/java/src"/>
<classpathentry exported="true" kind="con" path="com.ibm.streams.java/com.ibm.streams.operator"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="impl/java/bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.apt_generated/
/.toolkitList
/output/
/toolkit.xml
/com.ibm.streamsx.health.physionet.PhysionetIngestService_temp.json
29 changes: 29 additions & 0 deletions ingest/physionet/com.ibm.streamsx.health.ingest.physionet/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.streamsx.health.ingest.physionet</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.streams.studio.splproject.builder.SPLProjectBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>com.ibm.streams.studio.splproject.SPLProjectNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http:https://java.sun.com/dtd/properties.dtd">
<properties>
<comment>SPL Build Configuration: BuildConfig</comment>
<entry key="com.ibm.streams.studio.splproject:STATIC_LINKING">F</entry>
<entry key="com.ibm.streams.studio.splproject:OPTIMIZED_CODE">T</entry>
<entry key="com.ibm.streams.studio.splproject:FUSION_MODE">FDEF</entry>
<entry key="com.ibm.streams.studio.splproject:MAIN_COMPOSITE">application::PhysionetIngestService</entry>
<entry key="com.ibm.streams.studio.splproject:NAME">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:GCC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:SC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:ACTIVE">T</entry>
<entry key="com.ibm.streams.studio.splproject:LD_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:PRE_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:DATA_DIR"/>
<entry key="com.ibm.streams.studio.splproject:POST_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:REPLACE_ENVIRONMENT">F</entry>
<entry key="com.ibm.streams.studio.splproject:USE_PROJECT_DATA_DIR">T</entry>
<entry key="com.ibm.streams.studio.splproject:PROFILING"/>
<entry key="com.ibm.streams.studio.splproject:SDB">F</entry>
<entry key="com.ibm.streams.studio.splproject:DEFAULT_POOL_SIZE"/>
<entry key="com.ibm.streams.studio.splproject:OUTPUT_DIR">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:SAMPLING_RATE"/>
<entry key="com.ibm.streams.studio.splproject:STANDALONE">F</entry>
</properties>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http:https://java.sun.com/dtd/properties.dtd">
<properties>
<comment>SPL Build Configuration: BuildConfig</comment>
<entry key="com.ibm.streams.studio.splproject:STATIC_LINKING">F</entry>
<entry key="com.ibm.streams.studio.splproject:OPTIMIZED_CODE">T</entry>
<entry key="com.ibm.streams.studio.splproject:FUSION_MODE">FDEF</entry>
<entry key="com.ibm.streams.studio.splproject:MAIN_COMPOSITE">com.ibm.streamsx.health.ingest.physionet.service::PhysionetIngestService</entry>
<entry key="com.ibm.streams.studio.splproject:NAME">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:GCC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:SC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:ACTIVE">T</entry>
<entry key="com.ibm.streams.studio.splproject:LD_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:PRE_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:DATA_DIR"/>
<entry key="com.ibm.streams.studio.splproject:POST_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:REPLACE_ENVIRONMENT">F</entry>
<entry key="com.ibm.streams.studio.splproject:USE_PROJECT_DATA_DIR">T</entry>
<entry key="com.ibm.streams.studio.splproject:PROFILING"/>
<entry key="com.ibm.streams.studio.splproject:SDB">F</entry>
<entry key="com.ibm.streams.studio.splproject:DEFAULT_POOL_SIZE"/>
<entry key="com.ibm.streams.studio.splproject:OUTPUT_DIR">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:SAMPLING_RATE"/>
<entry key="com.ibm.streams.studio.splproject:STANDALONE">F</entry>
</properties>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http:https://java.sun.com/dtd/properties.dtd">
<properties>
<comment>SPL Build Configuration: BuildConfig</comment>
<entry key="com.ibm.streams.studio.splproject:STATIC_LINKING">F</entry>
<entry key="com.ibm.streams.studio.splproject:OPTIMIZED_CODE">T</entry>
<entry key="com.ibm.streams.studio.splproject:FUSION_MODE">FDEF</entry>
<entry key="com.ibm.streams.studio.splproject:MAIN_COMPOSITE">com.ibm.streamsx.health.ingest.physionet.service.test::PhysionetIngestTest</entry>
<entry key="com.ibm.streams.studio.splproject:NAME">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:GCC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:SC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:ACTIVE">T</entry>
<entry key="com.ibm.streams.studio.splproject:LD_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:PRE_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:DATA_DIR"/>
<entry key="com.ibm.streams.studio.splproject:POST_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:REPLACE_ENVIRONMENT">F</entry>
<entry key="com.ibm.streams.studio.splproject:USE_PROJECT_DATA_DIR">T</entry>
<entry key="com.ibm.streams.studio.splproject:PROFILING"/>
<entry key="com.ibm.streams.studio.splproject:SDB">F</entry>
<entry key="com.ibm.streams.studio.splproject:DEFAULT_POOL_SIZE"/>
<entry key="com.ibm.streams.studio.splproject:OUTPUT_DIR">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:SAMPLING_RATE"/>
<entry key="com.ibm.streams.studio.splproject:STANDALONE">F</entry>
</properties>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http:https://java.sun.com/dtd/properties.dtd">
<properties>
<comment>SPL Build Configuration: BuildConfig</comment>
<entry key="com.ibm.streams.studio.splproject:STATIC_LINKING">F</entry>
<entry key="com.ibm.streams.studio.splproject:OPTIMIZED_CODE">T</entry>
<entry key="com.ibm.streams.studio.splproject:FUSION_MODE">FDEF</entry>
<entry key="com.ibm.streams.studio.splproject:MAIN_COMPOSITE">com.ibm.streamsx.health.physionet::PhysionetIngestService</entry>
<entry key="com.ibm.streams.studio.splproject:NAME">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:GCC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:SC_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:ACTIVE">T</entry>
<entry key="com.ibm.streams.studio.splproject:LD_OPTS"/>
<entry key="com.ibm.streams.studio.splproject:PRE_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:DATA_DIR"/>
<entry key="com.ibm.streams.studio.splproject:POST_BUILD_CMD"/>
<entry key="com.ibm.streams.studio.splproject:REPLACE_ENVIRONMENT">F</entry>
<entry key="com.ibm.streams.studio.splproject:USE_PROJECT_DATA_DIR">T</entry>
<entry key="com.ibm.streams.studio.splproject:PROFILING"/>
<entry key="com.ibm.streams.studio.splproject:SDB">F</entry>
<entry key="com.ibm.streams.studio.splproject:DEFAULT_POOL_SIZE"/>
<entry key="com.ibm.streams.studio.splproject:OUTPUT_DIR">BuildConfig</entry>
<entry key="com.ibm.streams.studio.splproject:SAMPLING_RATE"/>
<entry key="com.ibm.streams.studio.splproject:STANDALONE">F</entry>
</properties>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
line.separator=\n
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.reconcileEnabled=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.processAnnotations=enabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Physionet Ingest Service

Ingest data from physionet.org. To use this service, submit the following application:

* com.ibm.streamsx.health.ingest.physionet.service::PhysionetIngestService

This service requires the following submission parameter:

* record.name - indicates what record to retrieve from Physionet.

This service exports data with the following topic:

* ingest-physionet

Data is exported as JSON with the following schema:

`type PublishJson_T = rstring jsonString;`

To consume data in SPL, subscribe to the topic, the output schema of the susbribe operator should be PublishJson_T.

To process data, convert JSON to the following SPL type:

`type SignalECG_T = float64 ts, int32 ch1, int32 ch2 ;
type PatientECG_T = SignalECG_T, tuple<rstring patientId> ;`


See com.ibm.streamsx.health.ingest.physionet.service.test::PhysionetIngestTest for details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// begin_generated_IBM_copyright_prolog
//
// This is an automatically generated copyright prolog.
// After initializing, DO NOT MODIFY OR MOVE
//****************************************************************************
// Copyright (C) 2016 International Business Machines Corporation
// All Rights Reserved
//****************************************************************************
// end_generated_IBM_copyright_prolog
namespace com.ibm.streamsx.health.ingest.physionet.service.test ;

use com.ibm.streamsx.health.ingest.physionet.service::* ;
use com.ibm.streamsx.topology.topic::Subscribe ;
use com.ibm.streamsx.json::JSONToTuple ;
use com.ibm.streamsx.health.ingest.physionet.service::PatientECG_T ;
use com.ibm.streamsx.inet.rest::HTTPTupleView ;

use com.ibm.streamsx.health.ingest.types::*;

composite PhysionetIngestTest
{
graph
(stream<PublishJson_T> Subscribe_1_out0) as Subscribe_1 = Subscribe()
{
param
topic : TOPIC() ;
streamType : PublishJson_T ;
}

() as Custom_2 = Custom(JSONToTuple_3_out0 as inputStream)
{
logic
onTuple inputStream :
{
printStringLn((rstring) inputStream) ;
}

}

(stream<Observation_T> JSONToTuple_3_out0) as JSONToTuple_3 =
JSONToTuple(Subscribe_1_out0)
{
}

() as ECGSignal = HTTPTupleView(JSONToTuple_3_out0 as inPort0Alias)
{
window
inPort0Alias : sliding, count(1000), time(1.0) ;
param
port: 8080;
}

}

Loading

0 comments on commit 9481e46

Please sign in to comment.