use of com.b2international.snowowl.fhir.core.model.dt.Code in project snow-owl by b2ihealthcare.
the class SimpleQuantityTest method build.
@Test
public void build() throws Exception {
assertEquals(Double.valueOf(12.3), quantity.getValue());
assertEquals("mg", quantity.getUnit());
assertEquals(new Uri("uri:LOINC"), quantity.getSystem());
assertEquals(new Code("code"), quantity.getCode());
}
use of com.b2international.snowowl.fhir.core.model.dt.Code 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.Code in project snow-owl by b2ihealthcare.
the class CodingTest method deserializeFromJson.
@Test
public void deserializeFromJson() throws Exception {
String jsonCoding = "{\"code\":\"1234\"," + "\"system\":\"http://snomed.info/sct/version/20180131\"," + "\"userSelected\":false}";
Coding coding = objectMapper.readValue(jsonCoding, Coding.class);
Assert.assertEquals(new Code("1234"), coding.getCode());
Assert.assertEquals(new Uri("http://snomed.info/sct/version/20180131"), coding.getSystem());
}
use of com.b2international.snowowl.fhir.core.model.dt.Code in project snow-owl by b2ihealthcare.
the class IncludeTest method validate.
private void validate(Include include) {
assertEquals(new Uri("system"), include.getSystem());
assertEquals("version", include.getVersion());
assertEquals("valueSetUri", include.getValueSets().iterator().next().getUriValue());
ValueSetFilter filter = include.getFilters().iterator().next();
assertEquals(new Code("filterProperty"), filter.getProperty());
assertEquals(FilterOperator.EQUALS.getCode(), filter.getOperator());
assertEquals(new Code("1234567"), filter.getValue());
ValueSetConcept concept = include.getConcepts().iterator().next();
assertEquals("code", concept.getCode().getCodeValue());
assertEquals("display", concept.getDisplay());
Designation designation = concept.getDesignations().iterator().next();
assertEquals("gb_en", designation.getLanguage());
assertEquals("designationValue", designation.getValue());
assertEquals("internal", designation.getUse().getCode().getCodeValue());
}
use of com.b2international.snowowl.fhir.core.model.dt.Code in project snow-owl by b2ihealthcare.
the class ValueSetFilterTest method validate.
private void validate(ValueSetFilter filter) {
assertEquals(FilterOperator.EQUALS.getCode(), filter.getOperator());
assertEquals(new Code("1234567"), filter.getValue());
assertEquals(new Code("filterProperty"), filter.getProperty());
}
Aggregations