Patch

The FHIR Patch operation can also be performed in a transaction bundle. When using the FHIR Patch mechanism for patching, the FHIR Patch document is placed in Bundle.entry.resource. In the case of JSON Patch the contents are placed in a Binary resource and then placed into Bundle.entry.resource. In all cases, the HTTP verb/method is PATCH.

The following example shows a simple FHIR Patch in a transaction.

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [ {
    "resource": {
 "resourceType": "Parameters”, > The FHIR Patch document
      "parameter": [ {
        "name": "operation",
        "part": [ {
          "name": "type",
          "valueCode": "replace"
        }, {
          "name": "path",
          "valueString": "Patient.identifier"
        }, {
          "name": "value",
          "valueIdentifier": {
            "system": "http://new-system",
            "value": "0001"
          }
        } ]
      } ]
	    },
    "request": {
      "method": "PATCH",
      "url": "Patient/123" > The identity of the resource to patch
	    }
  } ]
}