Search in sources :

Example 66 with Meta

use of org.hl7.fhir.r4b.model.Meta in project camel-quarkus by apache.

the class FhirDstu2Resource method metaGetFromResource.

@Path("/meta/getFromResource")
@GET
@Produces(MediaType.TEXT_PLAIN)
public int metaGetFromResource(@QueryParam("id") String id) {
    IdDt iIdType = new IdDt(id);
    final Map<String, Object> headers = new HashMap<>();
    headers.put("CamelFhir.metaType", MetaDt.class);
    headers.put("CamelFhir.id", iIdType);
    IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaGetFromResource-dstu2", null, headers, IBaseMetaType.class);
    return result.getTag().size();
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) IdDt(ca.uhn.fhir.model.primitive.IdDt) JsonObject(javax.json.JsonObject) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 67 with Meta

use of org.hl7.fhir.r4b.model.Meta in project camel-quarkus by apache.

the class FhirR4Resource method metaGetFromResource.

@Path("/meta/getFromResource")
@GET
@Produces(MediaType.TEXT_PLAIN)
public int metaGetFromResource(@QueryParam("id") String id) {
    IdType iIdType = new IdType(id);
    final Map<String, Object> headers = new HashMap<>();
    headers.put("CamelFhir.metaType", Meta.class);
    headers.put("CamelFhir.id", iIdType);
    IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaGetFromResource-r4", null, headers, IBaseMetaType.class);
    return result.getTag().size();
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) JsonObject(javax.json.JsonObject) IdType(org.hl7.fhir.r4.model.IdType) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 68 with Meta

use of org.hl7.fhir.r4b.model.Meta in project camel-quarkus by apache.

the class FhirR4Resource method metaGetFromType.

@Path("/meta/getFromType")
@GET
@Produces(MediaType.TEXT_PLAIN)
public int metaGetFromType(@QueryParam("preferResponseType") boolean preferResponseType) {
    Map<String, Object> headers = new HashMap<>();
    headers.put("CamelFhir.metaType", Meta.class);
    headers.put("CamelFhir.resourceType", "Patient");
    if (preferResponseType) {
        headers.put(ExtraParameters.PREFER_RESPONSE_TYPE.getHeaderName(), Patient.class);
    }
    IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaGetFromType-r4", null, headers, IBaseMetaType.class);
    return result.getTag().size();
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) JsonObject(javax.json.JsonObject) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 69 with Meta

use of org.hl7.fhir.r4b.model.Meta in project camel-quarkus by apache.

the class FhirDstu3Resource method metaDelete.

@Path("/meta")
@DELETE
@Produces(MediaType.TEXT_PLAIN)
public int metaDelete(@QueryParam("id") String id) {
    IdType iIdType = new IdType(id);
    Meta inMeta = new Meta();
    inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
    Map<String, Object> headers = new HashMap<>();
    headers.put("CamelFhir.meta", inMeta);
    headers.put("CamelFhir.id", iIdType);
    IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaDelete-dstu3", null, headers, IBaseMetaType.class);
    return result.getTag().size();
}
Also used : Meta(org.hl7.fhir.dstu3.model.Meta) HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) JsonObject(javax.json.JsonObject) IdType(org.hl7.fhir.dstu3.model.IdType) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE) Produces(javax.ws.rs.Produces)

Example 70 with Meta

use of org.hl7.fhir.r4b.model.Meta in project camel-quarkus by apache.

the class FhirDstu3Resource method metaGetFromType.

@Path("/meta/getFromType")
@GET
@Produces(MediaType.TEXT_PLAIN)
public int metaGetFromType(@QueryParam("preferResponseType") boolean preferResponseType) {
    Map<String, Object> headers = new HashMap<>();
    headers.put("CamelFhir.metaType", Meta.class);
    headers.put("CamelFhir.resourceType", "Patient");
    if (preferResponseType) {
        headers.put(ExtraParameters.PREFER_RESPONSE_TYPE.getHeaderName(), Patient.class);
    }
    IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaGetFromType-dstu3", null, headers, IBaseMetaType.class);
    return result.getTag().size();
}
Also used : HashMap(java.util.HashMap) IBaseMetaType(org.hl7.fhir.instance.model.api.IBaseMetaType) JsonObject(javax.json.JsonObject) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

Meta (org.hl7.fhir.r4.model.Meta)40 HashMap (java.util.HashMap)36 Date (java.util.Date)35 Meta (org.hl7.fhir.dstu3.model.Meta)31 IBaseMetaType (org.hl7.fhir.instance.model.api.IBaseMetaType)28 Reference (org.hl7.fhir.r4.model.Reference)26 JsonObject (javax.json.JsonObject)24 Path (javax.ws.rs.Path)24 Produces (javax.ws.rs.Produces)24 Code (org.mitre.synthea.world.concepts.HealthRecord.Code)20 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)18 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)17 DocumentReference (org.hl7.fhir.r4.model.DocumentReference)17 ArrayList (java.util.ArrayList)16 Coding (org.hl7.fhir.r4.model.Coding)16 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)15 Test (org.junit.jupiter.api.Test)15 Test (org.junit.Test)14 NotImplementedException (org.apache.commons.lang3.NotImplementedException)13 GET (javax.ws.rs.GET)12