Bad Request while calling ExecuteBundle

81 views
Skip to first unread message

Ashish Narnoli

unread,
Mar 26, 2024, 8:23:02 AM3/26/24
to GCP Healthcare Discuss
Hello,

I am trying upload attached bundle using ExecuteBundle function but it throws 400 Bad Request error message.

Can some please help to identify what actually causing this to failed?

I am integrating BlueButton 2.0 (https://bluebutton.cms.gov/) and pulled data from BB 2.0 and trying to upload in Google Healthcare API.

Thanks
sample-coverage.json

Truc Le

unread,
Mar 26, 2024, 9:42:50 AM3/26/24
to Ashish Narnoli, GCP Healthcare Discuss
Hi Ashish,

What is the exact curl command that you're using? Your example json contains header and many escape characters which could be the reason for the 400 error. You can refer to this example.

Thanks,
Truc


--
You received this message because you are subscribed to the Google Groups "GCP Healthcare Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gcp-healthcare-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gcp-healthcare-discuss/1b803663-273c-498e-bb9f-e46785db5cf7n%40googlegroups.com.

Ashish Narnoli

unread,
Mar 31, 2024, 8:23:49 PM3/31/24
to GCP Healthcare Discuss
Hi Truc,

Apologies - I shared the wrong file. Please see the plain json attached which I am using in node.

sample-json.txt

Paul Church

unread,
Mar 31, 2024, 8:49:17 PM3/31/24
to Ashish Narnoli, GCP Healthcare Discuss
When I try to execute this bundle I get an unparseable_resource error with diagnostics "expected array" and expression "Bundle.entry[0].resource.ofType(Patient).identifier".

Looking at the json, the Patient resource contains an identifier field that is not an array as it should be (see https://hl7.org/fhir/R4/patient.html#resource, identifier is "0..*" cardinality). This input is not a valid FHIR resource. Was this meant to be an "id" field?

If I delete that field, I get an invalid_bundle error saying "static reference to record to be created or deleted Patient/-10000010288010". This is because a batch bundle cannot have interdependencies between the entries in the bundle as they could be created in any order. It looks like this is supposed to be a transaction bundle?

If I change Bundle.type to "transaction", and remove the Patient.identifier field, then I can successfully execute the bundle.

Ashish Narnoli

unread,
Apr 9, 2024, 8:52:37 AM4/9/24
to GCP Healthcare Discuss
Thanks for your help. 

Removing Patient.identifier field worked for me. I don't know why BlueButton returns Patient.identifier as a String value rather than "array".

Just a quick question: How you get the "an unparseable_resource error with diagnostics "expected array" and expression "Bundle.entry[0].resource.ofType(Patient).identifier"?

I am calling Google Healthcare APIs but it didn't return the proper error message to understand issue, every time is return "400 Bad request".

For example: In attached Sample FHIR Bundle, something is wrong with ExplanationOfBenefit entry but I have no clue what. 
FHIR-Bundle.json

Paul Church

unread,
Apr 9, 2024, 11:00:10 AM4/9/24
to Ashish Narnoli, GCP Healthcare Discuss
The body of the API response should contain an OperationOutcome resource with those details in it. Depending on what client library you're using, you might need to parse that response - the GCP client libraries are somewhat generic and don't know that they should expect a FHIR resource with error details. I used curl to check these examples.

If you got that Patient resource from a BlueButton server, the server is definitely not conformant. That's not just a profile issue - it's not valid FHIR at all.

When I try to execute the attached sample bundle with the EOB, this is the API response:
{
  "issue": [
    {
      "code": "value",
      "details": {
        "text": "reference_not_found"
      },
      "diagnostics": "reference target(s) not found: Coverage/part-a--10000010254618",
      "severity": "error"
    }
  ],
  "resourceType": "OperationOutcome"
}

Reply all
Reply to author
Forward
0 new messages