Search in sources :

Example 1 with ExpandValueSetRequest

use of com.b2international.snowowl.fhir.core.model.valueset.ExpandValueSetRequest 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);
}
Also used : OperationOutcomeCode(com.b2international.snowowl.fhir.core.codesystems.OperationOutcomeCode) ValidationException(com.b2international.snowowl.fhir.core.exceptions.ValidationException) IssueSeverity(com.b2international.snowowl.fhir.core.codesystems.IssueSeverity) Parameter(com.b2international.snowowl.fhir.core.model.dt.Parameter) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Assert.assertTrue(org.junit.Assert.assertTrue) Fhir(com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir) Test(org.junit.Test) Uri(com.b2international.snowowl.fhir.core.model.dt.Uri) LookupRequest(com.b2international.snowowl.fhir.core.model.codesystem.LookupRequest) IssueType(com.b2international.snowowl.fhir.core.codesystems.IssueType) Json(com.b2international.snowowl.fhir.core.model.dt.Parameters.Json) ExpandValueSetRequest(com.b2international.snowowl.fhir.core.model.valueset.ExpandValueSetRequest) Issue(com.b2international.snowowl.fhir.core.model.Issue) Optional(java.util.Optional) Builder(com.b2international.snowowl.fhir.core.model.Issue.Builder) Parameters(com.b2international.snowowl.fhir.core.model.dt.Parameters) Coding(com.b2international.snowowl.fhir.core.model.dt.Coding) FhirExceptionIssueMatcher(com.b2international.snowowl.fhir.tests.FhirExceptionIssueMatcher) ExpandValueSetRequest(com.b2international.snowowl.fhir.core.model.valueset.ExpandValueSetRequest) Parameter(com.b2international.snowowl.fhir.core.model.dt.Parameter) Fhir(com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir) Json(com.b2international.snowowl.fhir.core.model.dt.Parameters.Json) Uri(com.b2international.snowowl.fhir.core.model.dt.Uri) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Aggregations

IssueSeverity (com.b2international.snowowl.fhir.core.codesystems.IssueSeverity)1 IssueType (com.b2international.snowowl.fhir.core.codesystems.IssueType)1 OperationOutcomeCode (com.b2international.snowowl.fhir.core.codesystems.OperationOutcomeCode)1 ValidationException (com.b2international.snowowl.fhir.core.exceptions.ValidationException)1 Issue (com.b2international.snowowl.fhir.core.model.Issue)1 Builder (com.b2international.snowowl.fhir.core.model.Issue.Builder)1 LookupRequest (com.b2international.snowowl.fhir.core.model.codesystem.LookupRequest)1 Coding (com.b2international.snowowl.fhir.core.model.dt.Coding)1 Parameter (com.b2international.snowowl.fhir.core.model.dt.Parameter)1 Parameters (com.b2international.snowowl.fhir.core.model.dt.Parameters)1 Fhir (com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir)1 Json (com.b2international.snowowl.fhir.core.model.dt.Parameters.Json)1 Uri (com.b2international.snowowl.fhir.core.model.dt.Uri)1 ExpandValueSetRequest (com.b2international.snowowl.fhir.core.model.valueset.ExpandValueSetRequest)1 FhirExceptionIssueMatcher (com.b2international.snowowl.fhir.tests.FhirExceptionIssueMatcher)1 FhirTest (com.b2international.snowowl.fhir.tests.FhirTest)1 Optional (java.util.Optional)1 Assert.assertTrue (org.junit.Assert.assertTrue)1 Test (org.junit.Test)1