Claus Ibsen created CAMEL-27969:
-----------------------------------

             Summary: camel-fhir: operation onInstance keeps the version, read 
with throwError=false throws, a shared FhirContext gets per-endpoint settings
                 Key: CAMEL-27969
                 URL: https://issues.apache.org/jira/browse/CAMEL-27969
             Project: Camel
          Issue Type: Bug
          Components: camel-fhir
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-fhir for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31200).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. operation onInstance keeps the version of the ID
{{FhirOperation.onInstance}} (camel-fhir-api) calls 
client.operation().onInstanceVersion(id) instead of onInstance(id). In HAPI 
FHIR 9.0.0 onInstance applies id.toVersionless() and onInstanceVersion does 
not, so a versioned ID invokes the operation on that version 
(Patient/1/_history/2/$op); the old description said the version is stripped.
Proposed change: call client.operation().onInstance(id).

h4. 2. read with throwError=false still throws
{{FhirRead.processOptionalParams}} uses else if (throwError != null), so 
NotModifiedException is thrown also when throwError=false. When 
ifVersionMatches is set without returnNull, returnResource or throwError, it 
only logs a WARN and drops the If-None-Match header.
Proposed change: Boolean.TRUE.equals(throwError).

h4. 3. A user FhirContext is changed by every endpoint
{{FhirHelper.createClient}} changes a FhirContext the user supplied 
(fhirContext option, often set once on the component): it sets 
DEFERRED_MODEL_SCANNING and setRestfulClientFactory, and sets the timeouts, 
proxy and validationMode on fhirContext.getRestfulClientFactory(). That factory 
is shared by every endpoint using the context, so the last endpoint created 
decides these settings for all of them.
Proposed change: use a client factory per endpoint, or document it.

h4. 4. Smaller issues
With both username and accessToken set, BasicAuthInterceptor and 
BearerTokenAuthInterceptor are both registered and the request gets two 
Authorization headers. serverUrl is only checked when no fhirContext is set. 
The ExtraParameters keys only appear in the catalog through the extraParameters 
description.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to