Search in sources :

Example 31 with IBaseMetaType

use of org.hl7.fhir.instance.model.api.IBaseMetaType in project camel-spring-boot by apache.

the class FhirMetaTest method testGetFromResource.

@Test
public void testGetFromResource() throws Exception {
    final Map<String, Object> headers = new HashMap<>();
    // parameter type is Class
    headers.put("CamelFhir.metaType", Meta.class);
    // parameter type is org.hl7.fhir.instance.model.api.IIdType
    headers.put("CamelFhir.id", this.patient.getIdElement());
    IBaseMetaType result = requestBodyAndHeaders("direct://GET_FROM_RESOURCE", null, headers);
    LOG.debug("getFromResource: " + result);
    assertNotNull(result, "getFromResource result");
    assertEquals(0, result.getTag().size());
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) CamelSpringBootTest(org.apache.camel.test.spring.junit5.CamelSpringBootTest)

Example 32 with IBaseMetaType

use of org.hl7.fhir.instance.model.api.IBaseMetaType in project camel-spring-boot by apache.

the class FhirMetaTest method testGetFromType.

@Test
public void testGetFromType() throws Exception {
    final Map<String, Object> headers = new HashMap<>();
    // parameter type is Class
    headers.put("CamelFhir.metaType", Meta.class);
    // parameter type is String
    headers.put("CamelFhir.resourceType", "Patient");
    IBaseMetaType result = requestBodyAndHeaders("direct://GET_FROM_TYPE", null, headers);
    LOG.debug("getFromType: " + result);
    assertNotNull(result, "getFromType result");
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) CamelSpringBootTest(org.apache.camel.test.spring.junit5.CamelSpringBootTest)

Example 33 with IBaseMetaType

use of org.hl7.fhir.instance.model.api.IBaseMetaType in project camel-spring-boot by apache.

the class FhirMetaIT method testGetFromType.

@Test
public void testGetFromType() throws Exception {
    final Map<String, Object> headers = new HashMap<>();
    // parameter type is Class
    headers.put("CamelFhir.metaType", Meta.class);
    // parameter type is String
    headers.put("CamelFhir.resourceType", "Patient");
    IBaseMetaType result = requestBodyAndHeaders("direct://GET_FROM_TYPE", null, headers);
    LOG.debug("getFromType: " + result);
    assertNotNull(result, "getFromType result");
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) CamelSpringBootTest(org.apache.camel.test.spring.junit5.CamelSpringBootTest)

Example 34 with IBaseMetaType

use of org.hl7.fhir.instance.model.api.IBaseMetaType in project camel-spring-boot by apache.

the class FhirMetaIT method testGetFromServer.

@Test
public void testGetFromServer() throws Exception {
    // using Class message body for single parameter "metaType"
    IBaseMetaType result = requestBody("direct://GET_FROM_SERVER", Meta.class);
    assertNotNull(result, "getFromServer result");
    LOG.debug("getFromServer: " + result);
}
Also used : IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) CamelSpringBootTest(org.apache.camel.test.spring.junit5.CamelSpringBootTest)

Aggregations

IBaseMetaType (org.hl7.fhir.instance.model.api.IBaseMetaType)34 HashMap (java.util.HashMap)32 JsonObject (javax.json.JsonObject)24 Path (javax.ws.rs.Path)24 Produces (javax.ws.rs.Produces)24 GET (javax.ws.rs.GET)12 CamelSpringBootTest (org.apache.camel.test.spring.junit5.CamelSpringBootTest)10 Test (org.junit.jupiter.api.Test)10 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)10 DELETE (javax.ws.rs.DELETE)6 POST (javax.ws.rs.POST)6 Meta (org.hl7.fhir.dstu3.model.Meta)4 Meta (org.hl7.fhir.r4.model.Meta)4 IdDt (ca.uhn.fhir.model.primitive.IdDt)3 IdType (org.hl7.fhir.dstu2.model.IdType)3 IdType (org.hl7.fhir.dstu2016may.model.IdType)3 IdType (org.hl7.fhir.dstu3.model.IdType)3 IdType (org.hl7.fhir.r4.model.IdType)3 IdType (org.hl7.fhir.r5.model.IdType)3 MetaDt (ca.uhn.fhir.model.dstu2.composite.MetaDt)2