Hi,
I'm new to HAPI and trying to use the HAPI FHIR client to utilize the async request flow documented here:
Async Request Pattern. I'm trying to POST a request to a service I own which then does some processing and makes resulting FHIR bundles available when it's finished. The process can take a few seconds up to about 15 minutes.
It seems the only way to get the "x-progress" header from the Response is to use MethodOutcome obtained by a call like:
MethodOutcome resp = client.operation().onInstance(outcome.getId()).named("$query").withNoParameters(Parameters.class).useHttpGet().returnMethodOutcome().execute();
Unfortunately, once the process is complete and the data is available, the process throws an error. HAPI doesn't support the model returned by our server, which is based on the example response model returned on the page.
Exception in thread "main" ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to parse response from server when performing GET to URL https://{server}/R4/Person/queryid/$query - ca.uhn.fhir.parser.DataFormatException: Invalid JSON content detected, missing required element: 'resourceType'
Obviously, I can make a generic rest call using a rest client but I wanted to try building out the entire flow using the HAPI client. Any suggestions?
Thanks,
Garrett