Skip to content

Commit

Permalink
add examples for patching to security tag (#4698)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelweave authored Oct 24, 2024
1 parent 5bb52a6 commit 0d9f7a1
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
61 changes: 61 additions & 0 deletions docs/rest/FhirPatchRequests.http
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
}
]
}
39 changes: 38 additions & 1 deletion docs/rest/JsonPatchRequests.http
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

Expand All @@ -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"
}
}
]

0 comments on commit 0d9f7a1

Please sign in to comment.