use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method testExchange.
@Test
public void testExchange() {
Vines vines = VinesMessageParser.fromJson(waveformMessage);
Assert.assertEquals("Wave", vines.getData().getExchange());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method bodyTest.
@Test
public void bodyTest() {
Vines vines = VinesMessageParser.fromJson(simpleMessage);
Assert.assertEquals("Vines", vines.getData().getBody().getUpdatedBy());
Assert.assertEquals("2014-05-22T16:02:30.0801253Z", vines.getData().getBody().getUpdatedTime());
Assert.assertEquals("2010-07-06T19:36:29-05:00", vines.getData().getBody().getStartTime());
Assert.assertEquals("2010-07-06T19:36:29-05:00", vines.getData().getBody().getEndTime());
Assert.assertEquals("AB12345^PCD-03", vines.getData().getBody().getPlacerId());
Assert.assertEquals("CD12345^HL7^ACDE48234567ABCD^EUI-64", vines.getData().getBody().getFillerId());
Assert.assertEquals("5501e53e-7480-49ff-9e65-509da2672951", vines.getData().getBody().getId());
Assert.assertEquals("0eff7854-6cc9-4a3a-b0e3-19147e058bac", vines.getData().getBody().getTherapyId());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method termsTest.
@Test
public void termsTest() {
Vines vines = VinesMessageParser.fromJson(simpleMessage);
Terms terms = vines.getData().getBody().getTerms();
Assert.assertTrue(terms.containsKey("CH1"));
Assert.assertTrue(terms.containsKey("CH2"));
Channel chan = terms.getChannel("CH1");
Assert.assertTrue(chan.containsKey("MDCX_ATTR_EVT_COND"));
Assert.assertTrue(chan.containsKey("MDC_DEV_PUMP_INFUS_CHAN_DELIVERY"));
Assert.assertTrue(chan.containsKey("MDC_PUMP_STAT"));
Assert.assertTrue(chan.containsKey("MDC_PUMP_MODE"));
Assert.assertTrue(chan.containsKey("MDC_FLOW_FLUID_PUMP"));
chan = terms.getChannel("CH2");
Assert.assertTrue(chan.containsKey("MDC_DEV_PUMP_INFUS_CHAN_SOURCE"));
Assert.assertTrue(chan.containsKey("MDC_DRUG_NAME_TYPE"));
Assert.assertTrue(chan.containsKey("MDC_CONC_DRUG"));
Assert.assertTrue(chan.containsKey("MDC_RATE_DOSE"));
Assert.assertTrue(chan.containsKey("MDC_FLOW_FLUID_PUMP"));
Assert.assertTrue(chan.containsKey("MDC_VOL_FLUID_TBI"));
Assert.assertTrue(chan.containsKey("MDC_VOL_FLUID_TBI_REMAIN"));
Assert.assertTrue(chan.containsKey("MDC_VOL_FLUID_DELIV"));
Assert.assertTrue(chan.containsKey("MDC_VOL_FLUID_DELIV_TOTAL_SET"));
/* Test Term containing a Map for the value */
ITerm t = terms.getChannel("CH1").getTerm("MDCX_ATTR_EVT_COND");
Assert.assertTrue(t instanceof Term);
Term term = (Term) t;
Assert.assertEquals("0", term.getCode());
ITermValue itv = term.getValue();
Assert.assertTrue(itv instanceof TermValueMap);
TermValueMap termValue = (TermValueMap) itv;
Assert.assertTrue(termValue.containsKey("MDCX_PUMP_DELIV_STOP"));
t = termValue.get("MDCX_PUMP_DELIV_STOP");
Assert.assertTrue(t instanceof Term);
term = (Term) t;
Assert.assertEquals("0", term.getCode());
/* Test Term containing a String for the value */
t = terms.getChannel("CH2").getTerm("MDC_VOL_FLUID_TBI");
Assert.assertTrue(t instanceof Term);
term = (Term) t;
Assert.assertEquals("999999", term.getCode());
Assert.assertEquals("MDC_DIM_MILLI_L", term.getUOM());
Assert.assertEquals("263762", term.getUOMCode());
Assert.assertEquals("2010-07-06T19:36:29-05:00", term.getDate());
itv = term.getValue();
Assert.assertTrue(itv instanceof TermValueString);
TermValueString tvs = (TermValueString) itv;
Assert.assertEquals("250", tvs.getValue());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method _idTest.
@Test
public void _idTest() {
Vines vines = VinesMessageParser.fromJson(simpleMessage);
Assert.assertEquals("581384c0d4355e094c65e542", vines.get_id().getOid());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method testWaveform2.
@Test
public void testWaveform2() {
Vines vines = VinesMessageParser.fromJson(waveformMessage2);
Terms terms = vines.getData().getBody().getTerms();
Assert.assertTrue(terms.containsKey("CH01"));
/* Test waveform */
Channel chan = terms.getChannel("CH01");
Assert.assertTrue(chan.containsKey("MDC_ATTR_WAV"));
}
Aggregations