Bundle transaction. When a client does not know the final ID of a target resource before submission, it can assign a temporary placeholder ID to the resource and then use this placeholder to complete the resource reference within the same Bundle.Parameter Name | Type | Required | Description |
HTTP Method | String | Yes | Fixed to POST. |
URL | String | Yes | The Bundle submission URL, usually [baseUrl]. |
Authorization | String | Yes | The authentication token, in the format Bearer <AccessToken>. The AccessToken is obtained via the GetAccessToken API in Calling Methods (or via the GetWebAccessToken API in the instance console scenario). |
Content-Type | String | Yes | The MIME type of the request body, with application/fhir+json as an example. |
Request Body | JSON Object | Yes | A transaction Bundle containing placeholder IDs and reference relationships. |
https://HOSTNAME/INSTANCE_ID/fhir
Field | Type | Required | Description |
entry[].fullUrl | String | No | A placeholder ID, typically in the format urn:uuid:{uuid}. It must be filled in when the entry needs to be referenced by other entries within the same Bundle; it can be omitted when only creating a resource without being referenced. |
entry[].resource | Object | Yes | The corresponding resource content. |
entry[].resource.subject.reference | String | No | A placeholder reference pointing to other entries. |
entry[].request.method | String | Yes | The request method for the entry, with POST as an example. |
entry[].request.url | String | Yes | The target resource path for the entry. |
200 OK or 201 Created is typically returned. The response headers contain the content type and request trace information, and the response body is usually a result Bundle that includes the resource location after actual write operations and the processing status.Parameter Name | Type | Description |
Status Code | Integer | Returns 200 OK or 201 Created when successful. |
Content-Type | String | The MIME type of the response body, typically application/fhir+json. |
x-request-id | String | Request trace ID. |
Field | Type | Description |
resourceType | String | Returns the resource type, which is fixed as Bundle. |
id | String | The unique ID of the response Bundle, generated by the server. |
type | String | The type of the response Bundle, which is fixed as transaction-response. |
link | Array | Navigation links, containing a self link that points to the current request address. |
link[].relation | String | The type of link relation, usually self. |
link[].url | String | The URL corresponding to the link. |
entry | Array | Execution results of the entries. |
entry[].response.status | String | The execution status of the entry, such as 201 Created. |
entry[].response.location | String | The actual location of the newly created resource. |
entry[].response.etag | String | Resource version identifier. |
entry[].response.lastModified | String | Last modification time of the resource. |
entry[].response.outcome | Object | Details of the entry execution outcome, which is the OperationOutcome resource and contains execution status information. |
POST /INSTANCE_ID/fhir HTTP/1.1Host: HOSTNAMEAuthorization: Bearer YOUR_ACCESS_TOKENContent-Type: application/fhir+json
{"resourceType": "Bundle","type": "transaction","entry": [{"fullUrl": "urn:uuid:e16eac01-a5ee-4904-b1c8-f4bd56e338d5","resource": {"resourceType": "Patient","identifier": [{"system": "http://acme.org/mrns","value": "013872"}],"name": [{"family": "Simpson","given": ["Homer"]}],"gender": "male"},"request": {"method": "POST","url": "Patient"}},{"fullUrl": "urn:uuid:499733fe-7ced-4d15-81ce-8a433a1fb71e","resource": {"resourceType": "Condition","clinicalStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/condition-clinical","code": "active"}]},"verificationStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status","code": "confirmed"}]},"category": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/condition-category","code": "problem-list-item","display": "Problem List Item"}]}],"code": {"coding": [{"system": "http://snomed.info/sct","code": "59621000","display": "Essential hypertension"}]},"subject": {"reference": "urn:uuid:e16eac01-a5ee-4904-b1c8-f4bd56e338d5"}},"request": {"method": "POST","url": "Condition"}}]}
HTTP/1.1 200 OKContent-Type: application/fhir+json;charset=UTF-8Location: https://HOSTNAME/INSTANCE_ID/fhir/Bundle/bundle-response-idContent-Location: https://HOSTNAME/INSTANCE_ID/fhir/Bundle/bundle-response-idx-request-id: <REQUEST_ID>
{"resourceType": "Bundle","id": "bundle-response-id","type": "transaction-response","link": [{"relation": "self","url": "https://HOSTNAME/INSTANCE_ID/fhir"}],"entry": [{"response": {"status": "201 Created","location": "Patient/patient-resource-id/_history/1","etag": "1","lastModified": "2022-02-23T10:00:00.000+08:00","outcome": {"resourceType": "OperationOutcome","issue": [{"severity": "information","code": "informational","details": {"coding": [{"system": "https://hapifhir.io/fhir/CodeSystem/hapi-fhir-storage-response-code","code": "SUCCESSFUL_CREATE","display": "Create succeeded."}]},"diagnostics": "Successfully created resource \\"Patient/patient-resource-id/_history/1\\"."}]}}},{"response": {"status": "201 Created","location": "Condition/condition-resource-id/_history/1","etag": "1","lastModified": "2022-02-23T10:00:00.000+08:00","outcome": {"resourceType": "OperationOutcome","issue": [{"severity": "information","code": "informational","details": {"coding": [{"system": "https://hapifhir.io/fhir/CodeSystem/hapi-fhir-storage-response-code","code": "SUCCESSFUL_CREATE","display": "Create succeeded."}]},"diagnostics": "Successfully created resource \\"Condition/condition-resource-id/_history/1\\"."}]}}}]}
Error Code | Description |
400 Bad Request | Placeholder ID format is incorrect, or the reference path is invalid. |
401 Unauthorized | Not authenticated, and valid credentials are missing. |
403 Forbidden | Authenticated but not authorized to perform Bundle operations. |
409 Conflict | Reference relationship conflict or resource state conflict |
422 Unprocessable Entity | The Bundle syntax is correct, but it fails business or rule validation. |
500 Internal Server Error | Internal server processing exception |
피드백