use of com.b2international.snowowl.fhir.core.model.dt.SimpleQuantity in project snow-owl by b2ihealthcare.
the class RangeUsageContextTest method validate.
private void validate(RangeUsageContext usageContext) {
assertEquals("usageContextId", usageContext.getId());
assertEquals("coding", usageContext.getCode().getCodeValue());
SimpleQuantity low = usageContext.getValue().getLow();
assertEquals("1", low.getCode().getCodeValue());
assertEquals("id", low.getId());
assertEquals(Double.valueOf(1), low.getValue());
assertEquals("ms", low.getUnit());
SimpleQuantity high = usageContext.getValue().getHigh();
assertEquals("10", high.getCode().getCodeValue());
assertEquals("id2", high.getId());
assertEquals(Double.valueOf(10), high.getValue());
assertEquals("ms", high.getUnit());
}
use of com.b2international.snowowl.fhir.core.model.dt.SimpleQuantity in project snow-owl by b2ihealthcare.
the class RangeTest method deserialize.
@Test
public void deserialize() throws Exception {
Range readRange = objectMapper.readValue(objectMapper.writeValueAsString(range), Range.class);
assertEquals("id", readRange.getId());
SimpleQuantity low = readRange.getLow();
assertEquals(Double.valueOf(12.3), low.getValue());
assertEquals("mg", low.getUnit());
assertEquals(new Code("code1"), low.getCode());
SimpleQuantity high = range.getHigh();
assertEquals(Double.valueOf(120.3), high.getValue());
assertEquals("mg", high.getUnit());
assertEquals(new Code("code2"), high.getCode());
}
use of com.b2international.snowowl.fhir.core.model.dt.SimpleQuantity in project snow-owl by b2ihealthcare.
the class RangeTest method setup.
@Before
public void setup() throws Exception {
SimpleQuantity low = SimpleQuantity.builder().value(12.3).unit("mg").system("uri:LOINC").code("code1").build();
SimpleQuantity high = (SimpleQuantity) SimpleQuantity.builder().value(120.3).unit("mg").system("uri:LOINC").code("code2").build();
range = Range.builder().low(low).high(high).id("id").build();
}
use of com.b2international.snowowl.fhir.core.model.dt.SimpleQuantity in project snow-owl by b2ihealthcare.
the class SimpleQuantityTest method deserialize.
@Test
public void deserialize() throws Exception {
SimpleQuantity readQuantity = objectMapper.readValue(objectMapper.writeValueAsString(quantity), SimpleQuantity.class);
assertEquals(Double.valueOf(12.3), readQuantity.getValue());
assertEquals("mg", readQuantity.getUnit());
assertEquals(new Uri("uri:LOINC"), readQuantity.getSystem());
assertEquals(new Code("code"), readQuantity.getCode());
}
use of com.b2international.snowowl.fhir.core.model.dt.SimpleQuantity in project snow-owl by b2ihealthcare.
the class RangeTest method build.
@Test
public void build() throws Exception {
assertEquals("id", range.getId());
SimpleQuantity low = range.getLow();
assertEquals(Double.valueOf(12.3), low.getValue());
assertEquals("mg", low.getUnit());
assertEquals(new Code("code1"), low.getCode());
SimpleQuantity high = range.getHigh();
assertEquals(Double.valueOf(120.3), high.getValue());
assertEquals("mg", high.getUnit());
assertEquals(new Code("code2"), high.getCode());
}
Aggregations