Search in sources :

Example 1 with HeartRateDataGenerator

use of com.ibm.streamsx.health.simulate.beacon.generators.HeartRateDataGenerator in project streamsx.health by IBMStreams.

the class HealthDataBeaconService method build.

public void build() {
    TStream<Observation> ecgIStream = topo.periodicSource(new HealthcareDataGenerator(DEFAULT_PATIENT_ID, "src/main/resources/ecgI.csv", ReadingTypeCode.ECG_LEAD_I.getCode()), ECG_PERIOD, ECG_PERIOD_TIMEUNIT);
    TStream<Observation> respStream = topo.periodicSource(new HealthcareDataGenerator(DEFAULT_PATIENT_ID, "src/main/resources/resp.csv", ReadingTypeCode.RESP_RATE.getCode()), RESP_PERIOD, RESP_PERIOD_TIMEUNIT);
    TStream<Observation> abpDiasStream = topo.periodicSource(new ABPDiastolicDataGenerator(DEFAULT_PATIENT_ID), VITALS_PERIOD, VITALS_PERIOD_TIMEUNIT);
    TStream<Observation> abpSysStream = topo.periodicSource(new ABPSystolicDataGenerator(DEFAULT_PATIENT_ID), VITALS_PERIOD, VITALS_PERIOD_TIMEUNIT);
    TStream<Observation> hrStream = topo.periodicSource(new HeartRateDataGenerator(DEFAULT_PATIENT_ID), VITALS_PERIOD, VITALS_PERIOD_TIMEUNIT);
    TStream<Observation> spo2Stream = topo.periodicSource(new SpO2DataGenerator(DEFAULT_PATIENT_ID), VITALS_PERIOD, VITALS_PERIOD_TIMEUNIT);
    TStream<Observation> temperatureStream = topo.periodicSource(new TemperatureDataGenerator(DEFAULT_PATIENT_ID), VITALS_PERIOD, VITALS_PERIOD_TIMEUNIT);
    Set<TStream<Observation>> observations = new HashSet<TStream<Observation>>();
    observations.add(respStream);
    observations.add(abpDiasStream);
    observations.add(abpSysStream);
    observations.add(hrStream);
    observations.add(spo2Stream);
    observations.add(temperatureStream);
    TStream<Observation> allStreams = ecgIStream.union(observations);
    TStream<Observation> multiplePatientStream = allStreams.multiTransform(new Multiplier(numPatientsSupplier, patientPrefixSupplier));
    multiplePatientStream.print();
    PublishConnector.publishObservation(multiplePatientStream, getPublishedTopic());
}
Also used : TStream(com.ibm.streamsx.topology.TStream) ABPDiastolicDataGenerator(com.ibm.streamsx.health.simulate.beacon.generators.ABPDiastolicDataGenerator) TemperatureDataGenerator(com.ibm.streamsx.health.simulate.beacon.generators.TemperatureDataGenerator) SpO2DataGenerator(com.ibm.streamsx.health.simulate.beacon.generators.SpO2DataGenerator) HealthcareDataGenerator(com.ibm.streamsx.health.simulate.beacon.generators.HealthcareDataGenerator) Observation(com.ibm.streamsx.health.ingest.types.model.Observation) HeartRateDataGenerator(com.ibm.streamsx.health.simulate.beacon.generators.HeartRateDataGenerator) ABPSystolicDataGenerator(com.ibm.streamsx.health.simulate.beacon.generators.ABPSystolicDataGenerator) HashSet(java.util.HashSet)

Aggregations

Observation (com.ibm.streamsx.health.ingest.types.model.Observation)1 ABPDiastolicDataGenerator (com.ibm.streamsx.health.simulate.beacon.generators.ABPDiastolicDataGenerator)1 ABPSystolicDataGenerator (com.ibm.streamsx.health.simulate.beacon.generators.ABPSystolicDataGenerator)1 HealthcareDataGenerator (com.ibm.streamsx.health.simulate.beacon.generators.HealthcareDataGenerator)1 HeartRateDataGenerator (com.ibm.streamsx.health.simulate.beacon.generators.HeartRateDataGenerator)1 SpO2DataGenerator (com.ibm.streamsx.health.simulate.beacon.generators.SpO2DataGenerator)1 TemperatureDataGenerator (com.ibm.streamsx.health.simulate.beacon.generators.TemperatureDataGenerator)1 TStream (com.ibm.streamsx.topology.TStream)1 HashSet (java.util.HashSet)1