Search in sources :

Example 6 with Vines

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());
}
Also used : Vines(com.ibm.streamsx.health.vines.model.Vines) Test(org.junit.Test)

Example 7 with Vines

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());
}
Also used : Vines(com.ibm.streamsx.health.vines.model.Vines) Test(org.junit.Test)

Example 8 with Vines

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());
}
Also used : ITermValue(com.ibm.streamsx.health.vines.model.ITermValue) Vines(com.ibm.streamsx.health.vines.model.Vines) Channel(com.ibm.streamsx.health.vines.model.Channel) Terms(com.ibm.streamsx.health.vines.model.Terms) ITerm(com.ibm.streamsx.health.vines.model.ITerm) ITerm(com.ibm.streamsx.health.vines.model.ITerm) Term(com.ibm.streamsx.health.vines.model.Term) TermValueString(com.ibm.streamsx.health.vines.model.TermValueString) TermValueMap(com.ibm.streamsx.health.vines.model.TermValueMap) Test(org.junit.Test)

Example 9 with Vines

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());
}
Also used : Vines(com.ibm.streamsx.health.vines.model.Vines) Test(org.junit.Test)

Example 10 with Vines

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"));
}
Also used : Vines(com.ibm.streamsx.health.vines.model.Vines) Channel(com.ibm.streamsx.health.vines.model.Channel) Terms(com.ibm.streamsx.health.vines.model.Terms) Test(org.junit.Test)

Aggregations

Vines (com.ibm.streamsx.health.vines.model.Vines)10 Test (org.junit.Test)9 Channel (com.ibm.streamsx.health.vines.model.Channel)3 Terms (com.ibm.streamsx.health.vines.model.Terms)3 ITerm (com.ibm.streamsx.health.vines.model.ITerm)2 ITermValue (com.ibm.streamsx.health.vines.model.ITermValue)2 Term (com.ibm.streamsx.health.vines.model.Term)2 TermValueMap (com.ibm.streamsx.health.vines.model.TermValueMap)2 TermValueString (com.ibm.streamsx.health.vines.model.TermValueString)2 Gson (com.google.gson.Gson)1 Location (com.ibm.streamsx.health.vines.model.Location)1 Name (com.ibm.streamsx.health.vines.model.Name)1 NameList (com.ibm.streamsx.health.vines.model.NameList)1 Patient (com.ibm.streamsx.health.vines.model.Patient)1 Service (com.ibm.streamsx.health.vines.model.Service)1 ServiceId (com.ibm.streamsx.health.vines.model.ServiceId)1 TermArray (com.ibm.streamsx.health.vines.model.TermArray)1