I'm looking for help on how to post a bundle containing multiple resources to a HAPI Server. I'm running the [test server][1], and I've tried using both the Jetty server and running it as a docker container. I'm able to successfully start the server, go to the UI and post a patient directly. And I can also post a patient directly from within Postman:
POST /hapi-fhir-jpaserver/fhir/Patient HTTP/1.1
Host: localhost:8080
Content-Type: application/fhir+json
{
"resourceType": "Patient",
"name": [
{
"use": "official",
"family": "Solo",
"given": [
"Han"
]
}
]
This all works fine. However, when I try to post this:
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"resource": {
"resourceType": "Patient",
"name": [
{
"use": "official",
"family": "Stark",
"given": [
"Anthony"
]
}
]
},
"request": {
"method": "PUT",
"url": "Patient"
}
}
]
}
I receive an "OperationOutcome" error: "Unable to store a Bundle resource on this server with a Bundle.type value of: transaction"
I get this error both from the web UI and from postman. I can change the type of Bundle to something like "message", and I don't get the same error. However, when I search, while the whole Bundle has been posted, the patient inside hasn't. Does anyone know how to get the server to read the resources inside a Bundle separately from the Bundle itself?
[1]: https://github.com/hapifhir/hapi-fhir-jpaserver-starter