Patient Merge Operation
info
Not all Netsmart solutions support Patient merge via CareConnect. See supported extended operations table above and consult your target solution's documentation for more information.
The Patient Merge operation allows for merging duplicate patients and is based on the draft HL7 FHIR Patient Merge Operation.
Authorization
This operation will require the application obtain authorization to update a Patient using one of the following SMART clinical scopes.
- v1:
[patient|user|system]/Patient.[write|*] - v2:
[patient|user|system]/Patient.[u](future)
Parameters
| Use | Name | Cardinality | Type | Documentation |
|---|---|---|---|---|
| IN | source-patient | 1..1 | Reference | A direct resource reference to the source patient resource. |
| IN | target-patient | 1..1 | Reference | A direct resource reference to the target patient resource. This is the surviving patient resource, the target for the merge. |
| IN | preview | 0..1 | boolean | This parameter is not yet supported by any Netsmart CareRecord or solution If this is set to true then the merge will not be actually performed; an OperationOutcome will be returned in the Parameters response that will indicate that no merge has occurred and may include other diagnostic info if desired, such as the scale of the merge. e.g. Issue.details.text "Preview only Patient merge - no issues detected" e.g. Issue.diagnostics "Merge would update: 10 years of content or 120 resources" The resulting target patient resource will also be returned in the result. |
| OUT | outcome | 1..1 | OperationOutcome | The outcome of the operation. On success this will provide a success statement or warnings related to the change. If the operation was unsuccessful, the OperationOutcome will include the reason for the failure. |
Examples
- Production
- Preview
curl -X POST 'https://fhir.netsmartcloud.com/v4/Patient/$merge' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d @payload.json
curl -X POST 'https://fhirtest.netsmartcloud.com/v4/Patient/$merge' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d @payload.json
Payloads
Sample Merge Request Payload
{
"resourceType": "Parameters",
"parameter": [
{
"name": "source-patient",
"valueReference": {
"reference": "Patient/1"
}
},
{
"name": "target-patient",
"valueReference": {
"reference": "Patient/2"
}
},
{
"name": "preview",
"valueBoolean": false
}
]
}
Sample Merge Response Payload
Merge Success
{
"resourceType": "Parameters",
"parameter": [
{
"name": "source-patient",
"valueReference": {
"reference": "Patient/1"
}
},
{
"name": "target-patient",
"valueReference": {
"reference": "Patient/2"
}
},
{
"name": "preview",
"valueBoolean": false
},
{
"name": "outcome",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "information",
"code": "informational",
"details": {
"text": "Success message"
}
}
]
}
}
]
}
Invalid Merge Payload or Other Unprocessable Request
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"details": {
"text": "Exception message"
}
}
]
}
Rejections or Other Merge Processing Errors
{
"resourceType": "Parameters",
"parameter": [
{
"name": "source-patient",
"valueReference": {
"reference": "Patient/1"
}
},
{
"name": "target-patient",
"valueReference": {
"reference": "Patient/2"
}
},
{
"name": "preview",
"valueBoolean": false
},
{
"name": "outcome",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"details": {
"text": "err: Target Patient not found"
}
}
]
}
}
]
}
Errors
To be written.