diff --git a/docs/rest/FhirPatchRequests.http b/docs/rest/FhirPatchRequests.http index 16e0c729b0..993389d6bb 100644 --- a/docs/rest/FhirPatchRequests.http +++ b/docs/rest/FhirPatchRequests.http @@ -337,4 +337,65 @@ Authorization: Bearer {{bearer.response.body.access_token}} ] } ] +} + +### Add a security tag. This will always add the elements to the end of the array if the array exists or not. +PATCH https://{{hostname}}/Patient/{{patient.response.body.id}} +content-type: application/fhir+json +Authorization: Bearer {{bearer.response.body.access_token}} + +{ + "resourceType": "Parameters", + "parameter": [ + { + "name": "operation", + "part": [ + { + "name": "type", + "valueCode": "add" + }, + { + "name": "path", + "valueString": "Patient.meta" + }, + { + "name": "name", + "valueString": "security" + }, + { + "name": "value", + "valueCoding": { + "system": "http://example.org/security-system", + "code": "SECURITY_TAG_CODE", + "display": "New Security Tag Display" + } + } + ] + }, + { + "name": "operation", + "part": [ + { + "name": "type", + "valueCode": "add" + }, + { + "name": "path", + "valueString": "Patient.meta" + }, + { + "name": "name", + "valueString": "security" + }, + { + "name": "value", + "valueCoding": { + "system": "http://example.org/security-system", + "code": "NEW_SECURITY_TAG_CODE", + "display": "New Security Tag Display" + } + } + ] + } + ] } \ No newline at end of file diff --git a/docs/rest/JsonPatchRequests.http b/docs/rest/JsonPatchRequests.http index f756afe977..a10d7e156c 100644 --- a/docs/rest/JsonPatchRequests.http +++ b/docs/rest/JsonPatchRequests.http @@ -186,7 +186,7 @@ Authorization: Bearer {{bearer.response.body.access_token}} } ### Conditional Patch -PATCH {{fhirurl}}/Patient?identifier=1032704 +PATCH {{hostname}}/Patient?identifier=1032704 content-type: application/json-patch+json Authorization: Bearer {{bearer.response.body.access_token}} @@ -202,3 +202,40 @@ Authorization: Bearer {{bearer.response.body.access_token}} } } ] + +### Add a security tag. Replaces entire array if it exists +PATCH https://{{hostname}}/Patient/{{patient.response.body.id}} +content-type: application/json-patch+json +Authorization: Bearer {{bearer.response.body.access_token}} + +[ + { + "op": "add", + "path": "/meta/security", + "value": [ + { + "system": "http://example.org/security-system", + "code": "SECURITY_TAG_CODE", + "display": "Security Tag Display" + } + ] + } +] + +### Add a security tag. Array must already exist. +# You cannot use JSON patch to add when you don't know if the array exists. Use FHIR Patch in this scenario. +PATCH https://{{hostname}}/Patient/{{patient.response.body.id}} +content-type: application/json-patch+json +Authorization: Bearer {{bearer.response.body.access_token}} + +[ + { + "op": "add", + "path": "/meta/security/-", + "value": { + "system": "http://example.org/security-system", + "code": "NEW_SECURITY_TAG_CODE", + "display": "New Security Tag Display" + } + } +]