Open makampf opened 2 years ago
https://camel.apache.org/components/3.11.x/fhir-component.html#_api_operation
Those are the supported method for the operation API.
Thank you very much, that pointed me in the right direction. I have to learn more about REST and Operation syntax.
With the following connector config:
{
"name": "my-fhir-source-connector",
"config": {
"connector.class": "org.apache.camel.kafkaconnector.fhir.CamelFhirSourceConnector",
"tasks.max": 1,
"topic": "fhir.input",
"camel.source.path.apiName": "OPERATION",
"camel.source.path.methodName": "onServer?name=$customOperation&useHttpGet=false&extraParameters=domain=testDomain",
"camel.source.endpoint.serverUrl": "https://url-of-fhir-api-com/fhir",
"camel.source.endpoint.delay": 60000,
"camel.source.endpoint.password": "password",
"camel.source.endpoint.username": "user",
"camel.component.fhir.fhirVersion": "R4"
}
}
I receive the following error:
Caused by: [org.apache.camel.RuntimeCamelException - Error invoking onServer with {name=$customOperation, useHttpGet=false, extraParameters={}}: theParameters can not be null] (org.apache.camel.component.fhir.FhirConsumer)
org.apache.camel.RuntimeCamelException: Error invoking onServer with {name=$customOperation, useHttpGet=false, extraParameters={}}: theParameters can not be null
at org.apache.camel.support.component.ApiMethodHelper.invokeMethod(ApiMethodHelper.java:530)
I tried different variants to pass the required domain
paramater, e.g. with parameters
instead of extraParameters
, or different kinds of brackets, but it doesnt help. Maybe you can help me on how to pass the domain parameter correctly? (domain=testDomain)
Thanks in advance
I want to add a source connector for polling Bundles from a FHIR API. Therefore I put together the following config:
(This results in the error message listed at the end.)
The
$customOperation
returns a Collection Bundle. Manually I am able to query this bundle by doing a POST on:https://url-of-fhir-api-com/fhir/$customOperation
with a request body:But I see no possibility to add a request body to the connector config. I played around with
camel.source.endpoint.inBody
but cannot get any result. How can I add parameters/body?And another question is, if the endpoint URL is correct? Because it seems the connector constructs the URL like:
https://url-of-fhir-api-com/fhir/operation/$customOperation
instead ofhttps://url-of-fhir-api-com/fhir/$customOperation
Is this also a problem?Also, the log does not show the full URL it is accessing. Does it ignore the
serverUrl
property?The error log:
Thanks in advance for any help or hints