use of com.b2international.snowowl.fhir.core.model.dt.Uri in project snow-owl by b2ihealthcare.
the class QuantityTest 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());
assertEquals(QuantityComparator.GREATER_OR_EQUAL_TO.getCode(), quantity.getComparator());
}
use of com.b2international.snowowl.fhir.core.model.dt.Uri 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.Uri in project snow-owl by b2ihealthcare.
the class ExpandValueSetRequestDeserializationTest method deserializationTest.
@Test
public void deserializationTest() throws Exception {
ExpandValueSetRequest request = ExpandValueSetRequest.builder().url("http://valueset.url").valueSetVersion("20190101").contextDirection("direction-code").count(1).addDesignation("uk_en").addDesignation("us_en").date(TEST_DATE_STRING).filter("filter").build();
Json json = new Parameters.Json(request);
// System.out.println("JSON params:" + json);
Fhir fhirParameters = new Parameters.Fhir(request);
// fhirParameters.getParameters().forEach(p -> System.out.println(p));
Optional<Parameter> findFirst = fhirParameters.getParameters().stream().filter(p -> {
Uri url = (Uri) p.getValue();
return url.getUriValue().equals("http://valueset.url");
}).findFirst();
assertTrue(findFirst.isPresent());
// Fhir fhir = new Parameters.Fhir(json.parameters());
// printPrettyJson(fhir);
// String fhirJson = objectMapper.writeValueAsString(fhir);
// System.out.println("This is the JSON request from the client: " + fhirJson);
}
use of com.b2international.snowowl.fhir.core.model.dt.Uri in project snow-owl by b2ihealthcare.
the class ValueSetConceptTest method validate.
private void validate(ValueSetConcept concept) {
assertEquals(new Code("code"), concept.getCode());
assertEquals("display", concept.getDisplay());
Designation designation = concept.getDesignations().iterator().next();
assertEquals("gb_en", designation.getLanguage());
assertEquals("designationValue", designation.getValue());
assertEquals(new Code("internal"), designation.getUse().getCode());
assertEquals(new Uri("http://b2i.sg/test"), designation.getUse().getSystem());
}
use of com.b2international.snowowl.fhir.core.model.dt.Uri in project snow-owl by b2ihealthcare.
the class ContactPointTest method build.
@Test
public void build() {
assertEquals("element_id", contactPoint.getId());
assertEquals(Integer.valueOf(1), contactPoint.getRank());
assertEquals(new Code("system"), contactPoint.getSystem());
assertEquals(new Code("use"), contactPoint.getUse());
assertEquals("value", contactPoint.getValue());
assertEquals(new Uri("url"), contactPoint.getExtensions().iterator().next().getUrl());
}
Aggregations