Class FhirProvider
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.FhirProvider
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractPlainProvider, SharedFhirProvider
Base class for all Resource Providers defined in IPF
- Author:
- Christian Ohr
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidconnect(RequestConsumer consumer, FhirRegistry registry) Connects the consumer to this provider and registers this provider at the registry.final voiddisconnect(RequestConsumer consumer, FhirRegistry registry) Disconnects the consumer from this provider and unregisters this provider from the registry, atomically.enrichParameters(FhirSearchParameters parameters, jakarta.servlet.http.HttpServletRequest httpServletRequest, RequestDetails requestDetails) Utility method the adds HTTP servlet request parameters and query parameters to a map of Camel headersprotected abstract FhirContextprotected abstract Optional<RequestConsumer> getRequestConsumer(RequestDetails requestDetails) Returns the first consumer that is able to handle the provided payloadstatic voidprocessOutHeaders(Map<String, Object> outHeaders, jakarta.servlet.http.HttpServletResponse httpServletResponse) booleanbooleanabstract voidsetConsumer(RequestConsumer consumer) Ensures that the provided consumer is considered by this providerabstract voidunsetConsumer(RequestConsumer consumer) Ensures that the provided consumer is not considered by this provider
-
Constructor Details
-
FhirProvider
public FhirProvider()
-
-
Method Details
-
getFhirContext
- Returns:
- FhirContext
-
getRequestConsumer
Returns the first consumer that is able to handle the provided payload- Parameters:
requestDetails- FHIR request- Returns:
- consumer or
Optional.empty()
-
setConsumer
Ensures that the provided consumer is considered by this provider- Parameters:
consumer- request consumer
-
unsetConsumer
Ensures that the provided consumer is not considered by this provider- Parameters:
consumer- request consumer
-
connect
Connects the consumer to this provider and registers this provider at the registry. Both happen atomically, because whether the provider is (de)registered depends on the number of its consumers, seerequiresRegistration().- Parameters:
consumer- request consumerregistry- FHIR registry- Since:
- 6.1
-
disconnect
Disconnects the consumer from this provider and unregisters this provider from the registry, atomically.- Parameters:
consumer- request consumerregistry- FHIR registry- Since:
- 6.1
- See Also:
-
requiresRegistration
public boolean requiresRegistration()- Returns:
- true if this provider must be registered at the
FhirRegistry - See Also:
-
requiresDeregistration
public boolean requiresDeregistration()- Returns:
- true if this provider must be unregistered at the
FhirRegistry - See Also:
-
enrichParameters
protected Map<String,Object> enrichParameters(FhirSearchParameters parameters, jakarta.servlet.http.HttpServletRequest httpServletRequest, RequestDetails requestDetails) Utility method the adds HTTP servlet request parameters and query parameters to a map of Camel headers- Parameters:
parameters- query parametershttpServletRequest- servlet requestrequestDetails- request details- Returns:
- enriched map of parameters
-
processOutHeaders
-