Bundle. When submitting resource content, the client does not directly specify a target resource ID but instead provides a search criteria. The server first queries the target resource based on this criteria and then decides whether to perform an update or a creation.Bundle.entry.resource.PUT, and the search expression is placed in Bundle.entry.request.url.Parameter Name | Type | Required | Description |
HTTP Method | String | Yes | Fixed to POST. |
URL | String | Yes | The Bundle submission URL, in the format [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 | No | The MIME type of the request body. For write-type requests, it is typically application/fhir+json; if not specified, the server will automatically infer it based on the request content. |
Request Body | JSON Object | Yes | A transaction Bundle containing conditional update entries. |
https://HOSTNAME/INSTANCE_ID/fhir
Field | Type | Required | Description |
entry[].resource | Object | Yes | Content of the resource to be updated |
entry[].request.method | String | Yes | Fixed as PUT |
entry[].request.url | String | Yes | Conditional update search expression |
200 OK is returned. The response headers contain the content type and request trace information, and the response body is a result Bundle that includes the execution status and resource location of each entry.Parameter Name | Type | Description |
Status Code | Integer | Returns 200 OK when successful. |
Location | String | The access URL for the result Bundle. |
Content-Location | String | The content location URL for the result Bundle. |
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, usually Bundle. |
id | String | The unique ID of the result Bundle. |
type | String | The Bundle type. Returns transaction-response for conditional updates. |
link | Array | Navigation links, containing the relation and url fields. When relation is self, it points to the current request address. |
entry | Array | Execution results of the entries. |
entry[].response.status | String | The execution status of the entry. Returns 200 OK when an existing resource is matched; returns 201 Created when no matching resource is found, resulting in the creation of a new one. |
entry[].response.location | String | The location of the updated or newly created resource. |
entry[].response.etag | String | Resource version identifier. |
entry[].response.outcome | Object | Details of the entry execution, containing OperationOutcome 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:95dbbf93-5829-46ba-9021-2545a1da3aa5","resource": {"resourceType": "Patient","identifier": [{"system": "http://acme.org/mrns","value": "013873"}],"name": [{"family": "Simpson","given": ["Homer"]}],"gender": "male"},"request": {"method": "PUT","url": "Patient?identifier=http://acme.org/mrns|013873"}},{"fullUrl": "urn:uuid:124ff3c8-f251-4bd9-8c44-cc6568180eae","resource": {"resourceType": "Condition","identifier": [{"system": "http://acme.org/cond","value": "46253"}],"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:95dbbf93-5829-46ba-9021-2545a1da3aa5"}},"request": {"method": "PUT","url": "Condition?identifier=http://acme.org/cond|46253"}}]}
HTTP/1.1 200 OKLocation: https://HOSTNAME/INSTANCE_ID/fhir/Bundle/<bundle-id>Content-Location: https://HOSTNAME/INSTANCE_ID/fhir/Bundle/<bundle-id>Content-Type: application/fhir+jsonx-request-id: <REQUEST_ID>
{"resourceType": "Bundle","id": "<bundle-id>","type": "transaction-response","link": [{"relation": "self","url": "https://HOSTNAME/INSTANCE_ID/fhir"}],"entry": [{"response": {"status": "200 OK","location": "Patient/95dbbf93-5829-46ba-9021-2545a1da3aa5/_history/2","etag": "2"}},{"response": {"status": "200 OK","location": "Condition/124ff3c8-f251-4bd9-8c44-cc6568180eae/_history/2","etag": "2"}}]}
Error Code | Description |
400 Bad Request | Conditional update expression format error |
401 Unauthorized | Not authenticated, and valid credentials are missing. |
403 Forbidden | Authenticated but not authorized to perform Bundle operations. |
409 Conflict | Resource state conflict |
412 Precondition Failed | The conditional update search criteria matched multiple resources, and a unique update target cannot be determined. |
422 Unprocessable Entity | The Bundle syntax is correct, but it fails business or rule validation. |
500 Internal Server Error | Internal server processing exception |
フィードバック