use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class VinesMessageParser method fromJson.
public static Vines fromJson(String jsonString) {
Gson gson = createGson();
Vines vinesMsg = gson.fromJson(jsonString, Vines.class);
vinesMsg.setRawMessage(jsonString);
return vinesMsg;
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method testPatient.
@Test
public void testPatient() {
Vines vines = VinesMessageParser.fromJson(simpleMessage);
Patient patient = vines.getData().getPatient();
Assert.assertEquals("537e1f98db23c810388ae214", patient.get_id());
Assert.assertEquals("HO60002", patient.getMRN());
Assert.assertEquals("VinesIHEAddin", patient.getMRNSource());
Assert.assertEquals("M", patient.getSex());
NameList nameList = patient.getNameList();
Assert.assertTrue(nameList.size() > 0);
Name name = nameList.get(0);
Assert.assertEquals("Charles", name.getFirstName());
Assert.assertEquals("Darwin", name.getLastName());
Assert.assertEquals("Robert", name.getMiddleName());
Assert.assertEquals("Mr.", name.getPrefix());
Assert.assertEquals("I", name.getSuffix());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method testLocation.
@Test
public void testLocation() {
Vines vines = VinesMessageParser.fromJson(simpleMessage);
Location location = vines.getData().getLocation();
Assert.assertEquals("537e1f98db23c810388ae216", location.get_id());
Assert.assertEquals("Default Patient Location", location.getName());
Assert.assertEquals(false, location.getIsDeleted());
Assert.assertEquals("537e1f98db23c810388ae214", location.getPatientId());
Assert.assertEquals(true, location.getIsDefault());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method testWaveformTerm.
@Test
public void testWaveformTerm() {
Vines vines = VinesMessageParser.fromJson(waveformMessage);
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"));
ITerm t = chan.getTerm("MDC_ATTR_WAV");
Assert.assertTrue(t instanceof TermArray);
TermArray ta = (TermArray) t;
Assert.assertTrue(ta.size() > 0);
ITermValue itv = ta.get(0);
Assert.assertTrue(itv instanceof TermValueMap);
TermValueMap tvm = (TermValueMap) itv;
Assert.assertTrue(tvm.containsKey("MDC_PRESS_BLD_ART_ABP"));
t = tvm.get("MDC_PRESS_BLD_ART_ABP");
Assert.assertTrue(t instanceof Term);
Term term = (Term) t;
itv = term.getValue();
Assert.assertTrue(itv instanceof TermValueString);
TermValueString tvs = (TermValueString) itv;
String waveformString = "115.3125^116.5^117.4375^118.1875^118.8125^119.25^119.625^119.9375^120.125^120.25^120.125^119.875^119.375^118.75^117.9375^117^115.875^114.5^113^11 1.3125^109.8125^108.4375^107.3125^106.375^105.5625^104.875^104.25^103.6875^103.1875^102.8125^102.875^103.5625";
Assert.assertEquals(waveformString, tvs.getValue());
/* Test vitals */
t = chan.getTerm("MDC_ATTR_SCALE_RANGE");
Assert.assertTrue(t instanceof Term);
term = (Term) t;
Assert.assertEquals("", term.getCode());
Assert.assertEquals("-40", term.getLowerValue());
Assert.assertEquals("520", term.getUpperValue());
Assert.assertEquals("MDC_DIM_MMHG", term.getUOM());
Assert.assertEquals("266016", term.getUOMCode());
}
use of com.ibm.streamsx.health.vines.model.Vines in project streamsx.health by IBMStreams.
the class Tests method serviceIdTest.
@Test
public void serviceIdTest() {
Vines vines = VinesMessageParser.fromJson(simpleMessage);
ServiceId serviceId = vines.getData().getBody().getServiceId();
Assert.assertTrue(serviceId.containsKey("Dopamine 475"));
Service service = serviceId.get("Dopamine 475");
Assert.assertEquals("2222", service.getCode());
}
Aggregations