Class SharedFhirProvider

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public abstract class SharedFhirProvider
    extends FhirProvider
    Shared Resource provider, primarily (but not exclusively) meant for batch/transaction requests. Use this resource provider if you have several consumers that share the same FHIR interface. The request is dispatched to the first consumer that returns true on RequestConsumer.test(RequestDetails).

    Components/Endpoints that use this resource provider must reference a (shared) singleton instance of a concrete implementation of this class.

    Request consumers must share the same FhirContext instance.

    Christian Ohr
    See Also:
    Serialized Form
    • Constructor Detail

      • SharedFhirProvider

        public SharedFhirProvider()
    • Method Detail

      • requestTransaction

        protected final <T extends IBaseBundle> T requestTransaction​(Object payload,
                                                                     Class<T> bundleClass,
                                                                     javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                     javax.servlet.http.HttpServletResponse httpServletResponse,
                                                                     RequestDetails requestDetails)
        Submits a transaction request bundle, expecting a corresponding response bundle
        payload - transaction bundle
        httpServletRequest - servlet request
        httpServletResponse - servlet response
        result of processing
      • setConsumer

        public void setConsumer​(RequestConsumer consumer)
        Adds a request consumer for this resource provider
        Specified by:
        setConsumer in class FhirProvider
        consumer - request consumer
        IllegalStateException - if the consumer is already present or if the FhirContext is different compared to the FhirContext of the other consumers.
      • unsetConsumer

        public void unsetConsumer​(RequestConsumer consumer)
        Removes the request consumer. If the consumer was not registered, this method does nothing.
        Specified by:
        unsetConsumer in class FhirProvider
        consumer - request consumer