Class FhirAdapter

java.lang.Object
dev.dsf.fhir.adapter.AbstractAdapter
dev.dsf.fhir.adapter.FhirAdapter
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>, jakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>

@Provider @Consumes({"application/fhir+xml","application/xml+fhir","application/xml","text/xml","application/fhir+json","application/json+fhir","application/json"}) @Produces({"application/fhir+xml","application/xml+fhir","application/xml","text/xml","application/fhir+json","application/json+fhir","application/json"}) public class FhirAdapter extends AbstractAdapter implements jakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>, jakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>
  • Constructor Details

    • FhirAdapter

      public FhirAdapter(ca.uhn.fhir.context.FhirContext fhirContext)
  • Method Details

    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isWriteable in interface jakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>
    • writeTo

      public void writeTo(org.hl7.fhir.r4.model.BaseResource t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      writeTo in interface jakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException
    • isReadable

      public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isReadable in interface jakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>
    • readFrom

      public org.hl7.fhir.r4.model.BaseResource readFrom(Class<org.hl7.fhir.r4.model.BaseResource> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      readFrom in interface jakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException