This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions
Patient Administration Work Group | Maturity Level: N/A | Standards Status: Informative |
Raw Turtle (+ also see Turtle/RDF Format Specification)
Operation Definition
@prefix fhir: <http://hl7.org/fhir/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . # - resource ------------------------------------------------------------------- <http://hl7.org/fhir/OperationDefinition/Encounter-merge> a fhir:OperationDefinition ; fhir:nodeRole fhir:treeRoot ; fhir:id [ fhir:v "Encounter-merge"] ; # fhir:text [ fhir:status [ fhir:v "generated" ] ; fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition Encounter-merge</b></p><a name=\"Encounter-merge\"> </a><a name=\"hcEncounter-merge\"> </a><p>URL: [base]/Encounter/$merge</p><h3>Parameters</h3><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>source-encounter</td><td/><td>0..1</td><td><a href=\"references.html#Reference\">Reference</a> (<a href=\"encounter.html\" title=\"http://hl7.org/fhir/StructureDefinition/Encounter\">Encounter</a>)</td><td/><td><div><p>A direct resource reference to the <strong>source</strong> encounter resource (this may include an identifier).</p>\n</div></td></tr><tr><td>IN</td><td>source-encounter-identifier</td><td/><td>0..*</td><td><a href=\"datatypes.html#Identifier\">Identifier</a></td><td/><td><div><p>When source-encounter-identifiers are provided, the server is expected to perform an internal lookup to identify the <strong>source</strong> encounter. The server SHALL reject the request if the provided identifiers do not resolve to a single encounter record. This resolution MAY occur asynchronously, for example, as part of a review by a user.</p>\n</div></td></tr><tr><td>IN</td><td>target-encounter</td><td/><td>0..1</td><td><a href=\"references.html#Reference\">Reference</a> (<a href=\"encounter.html\" title=\"http://hl7.org/fhir/StructureDefinition/Encounter\">Encounter</a>)</td><td/><td><div><p>A direct resource reference to the <strong>target</strong> encounter resource.</p>\n<p>This is the surviving encounter resource, the target for the merge.</p>\n</div></td></tr><tr><td>IN</td><td>target-encounter-identifier</td><td/><td>0..*</td><td><a href=\"datatypes.html#Identifier\">Identifier</a></td><td/><td><div><p>When target-encounter-identifiers are provided, the server is expected to perform an internal lookup to identify the target encounter record. The server SHALL reject the request if the provided identifiers do not resolve to a single encounter record. This resolution MAY occur asynchronously, for example, as part of a review by a user.</p>\n</div></td></tr><tr><td>IN</td><td>result-encounter</td><td/><td>0..1</td><td><a href=\"encounter.html\">Encounter</a></td><td/><td><div><p>The details of the Encounter resource that is expected to be updated to complete with and must have the same encounter.id and provided identifiers included.</p>\n<p>This resource MUST have the record-linkage extension with a link=replaces referencing the source encounter resource.</p>\n<p>It will be used to perform an update on the target encounter resource.</p>\n<p>In the absence of this parameter the servers should copy all identifiers from the source encounter into the target encounter, and include the record-linkage extension (as shown in the example below).</p>\n<p>This is often used when properties from the source encounter are desired to be included in the target resource.</p>\n<p>The receiving system may also apply other internal business rules onto the merge which may make the resource different from what is provided here.</p>\n</div></td></tr><tr><td>IN</td><td>preview</td><td/><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>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.</p>\n<p>e.g. Issue.details.text \"Preview only Encounter merge - no issues detected\"</p>\n<p>e.g. Issue.diagnostics \"Merge would update: 10 years of content or 120 resources\"</p>\n<p>The resulting target encounter resource will also be returned in the result.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"parameters.html\">Parameters</a></td><td/><td><div><p>The status of the response will be one of:</p>\n<ul>\n<li>200 OK - If the merge request doesn't expect any issues (although warning may be present) for a preview, or was completed without issues if not a preview</li>\n<li>202 Accepted - The merge request has been accepted and does not expect any issues and will continue processing the merge in the background, and you can monitor the Task for completion</li>\n<li>400 Bad Request - There are errors in the input parameters that need to corrected</li>\n<li>422 Unprocessable Entity - Business rules prevent this merge from completing</li>\n</ul>\n<p>The Parameters resource will include:</p>\n<ul>\n<li>The Input parameters to the operation</li>\n<li>An OperationOutcome containing errors, warnings, and information messages</li>\n<li>The resulting merged Encounter resource (or an encounter reference if the encounter is not committed)</li>\n<li>Optionally a Task resource to track any additional processing that was required.</li>\n</ul>\n<p>Note: as this is the only out parameter, it is a resource, and it has the name 'return', the result of this operation is returned directly as a resource</p>\n</div></td></tr></table><div><p>There must be exactly 1 source encounter, which may be identified by either the source-encounter or source-encounter-identifier parameters. Similarly, there must be exactly 1 target encounter, identified by either the target-encounter or target-encounter-identifier parameters. In both cases, either a reference to the encounter or a list of identifiers that can be used to identify the encounter may be provided, but not both.</p>\n<p>The result-encounter.id must be the same as the target encounter reference (if the encounter reference is provided as an input parameter).</p>\n<p>If a client needs the server to create a new encounter merged from the 2 encounter resources, the client should create a new encounter record and then call the merge operation to merge each source encounter resource into the newly created encounter resource.</p>\n<p>A server may decide to delete the source record, but this is not defined by the standard merge operation, and if this occurs then the target encounter's link property will remain unchanged.</p>\n</div></div>"^^rdf:XMLLiteral ] ; # fhir:extension ( [ fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm"^^xsd:anyURI ] ; fhir:value [ a fhir:integer ; fhir:v 0 ] ] [ fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status"^^xsd:anyURI ] ; fhir:value [ a fhir:code ; fhir:v "trial-use" ] ] [ fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"^^xsd:anyURI ] ; fhir:value [ a fhir:code ; fhir:v "pa" ] ] ) ; # fhir:url [ fhir:v "http://hl7.org/fhir/OperationDefinition/Encounter-merge"^^xsd:anyURI] ; # fhir:version [ fhir:v "6.0.0-ballot3"] ; # fhir:name [ fhir:v "Merge"] ; # fhir:title [ fhir:v "Encounter Merge"] ; # fhir:status [ fhir:v "draft"] ; # fhir:kind [ fhir:v "operation"] ; # fhir:experimental [ fhir:v false] ; # fhir:date [ fhir:v "2025-08-30T14:16:05+00:00"^^xsd:dateTime] ; # fhir:publisher [ fhir:v "HL7 International / Patient Administration"] ; # fhir:contact ( [ fhir:telecom ( [ fhir:system [ fhir:v "url" ] ; fhir:value [ fhir:v "http://hl7.org/fhir" ] ] [ fhir:system [ fhir:v "email" ] ; fhir:value [ fhir:v "fhir@lists.hl7.org" ] ] ) ] [ fhir:telecom ( [ fhir:system [ fhir:v "url" ] ; fhir:value [ fhir:v "http://www.hl7.org/Special/committees/pafm" ] ] ) ] ) ; # fhir:description [ fhir:v "The merge operation is used to request two encounter resources be merged. One of the two encounter is identified as the source and one as the target. The target is the remaining encounter resource (survivor), the source will be marked as inactive (or in some systems deleted).\r\rThe source-encounter resource will be updated to add a new link reference to the target-encounter resource (link-type=replaced-by in the record-linkage extension), and also update the status to inactive (unless the resource was deleted)\r\rThe target-encounter resource will be updated to add a new link reference to the source-encounter resource (link-type=replaces in the record-linkage extension) - and must be included in the result-encounter parameter if used (if the source encounter is deleted, then this link is not required)."] ; # fhir:jurisdiction ( [ fhir:coding ( [ fhir:system [ fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm"^^xsd:anyURI ] ; fhir:code [ fhir:v "001" ] ; fhir:display [ fhir:v "World" ] ] ) ] ) ; # fhir:affectsState [ fhir:v true] ; # fhir:code [ fhir:v "merge"] ; # fhir:comment [ fhir:v "There must be exactly 1 source encounter, which may be identified by either the source-encounter or source-encounter-identifier parameters. Similarly, there must be exactly 1 target encounter, identified by either the target-encounter or target-encounter-identifier parameters. In both cases, either a reference to the encounter or a list of identifiers that can be used to identify the encounter may be provided, but not both.\r\rThe result-encounter.id must be the same as the target encounter reference (if the encounter reference is provided as an input parameter).\r\rIf a client needs the server to create a new encounter merged from the 2 encounter resources, the client should create a new encounter record and then call the merge operation to merge each source encounter resource into the newly created encounter resource.\r\rA server may decide to delete the source record, but this is not defined by the standard merge operation, and if this occurs then the target encounter's link property will remain unchanged.\r"] ; # fhir:resource ( [ fhir:v "Encounter"] ) ; # fhir:system [ fhir:v false] ; # fhir:type [ fhir:v true] ; # fhir:instance [ fhir:v false] ; # fhir:parameter ( [ fhir:name [ fhir:v "source-encounter" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "A direct resource reference to the **source** encounter resource (this may include an identifier)." ] ; fhir:type [ fhir:v "Reference" ] ; fhir:targetProfile ( [ fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ; fhir:link <http://hl7.org/fhir/StructureDefinition/Encounter> ] ) ] [ fhir:name [ fhir:v "source-encounter-identifier" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "*" ] ; fhir:documentation [ fhir:v "When source-encounter-identifiers are provided, the server is expected to perform an internal lookup to identify the **source** encounter. The server SHALL reject the request if the provided identifiers do not resolve to a single encounter record. This resolution MAY occur asynchronously, for example, as part of a review by a user." ] ; fhir:type [ fhir:v "Identifier" ] ] [ fhir:name [ fhir:v "target-encounter" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "A direct resource reference to the **target** encounter resource.\r\rThis is the surviving encounter resource, the target for the merge." ] ; fhir:type [ fhir:v "Reference" ] ; fhir:targetProfile ( [ fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ; fhir:link <http://hl7.org/fhir/StructureDefinition/Encounter> ] ) ] [ fhir:name [ fhir:v "target-encounter-identifier" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "*" ] ; fhir:documentation [ fhir:v "When target-encounter-identifiers are provided, the server is expected to perform an internal lookup to identify the target encounter record. The server SHALL reject the request if the provided identifiers do not resolve to a single encounter record. This resolution MAY occur asynchronously, for example, as part of a review by a user." ] ; fhir:type [ fhir:v "Identifier" ] ] [ fhir:name [ fhir:v "result-encounter" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "The details of the Encounter resource that is expected to be updated to complete with and must have the same encounter.id and provided identifiers included.\r\rThis resource MUST have the record-linkage extension with a link=replaces referencing the source encounter resource.\r\rIt will be used to perform an update on the target encounter resource.\r\rIn the absence of this parameter the servers should copy all identifiers from the source encounter into the target encounter, and include the record-linkage extension (as shown in the example below).\r\rThis is often used when properties from the source encounter are desired to be included in the target resource.\r\rThe receiving system may also apply other internal business rules onto the merge which may make the resource different from what is provided here." ] ; fhir:type [ fhir:v "Encounter" ] ] [ fhir:name [ fhir:v "preview" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "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.\r\re.g. Issue.details.text \"Preview only Encounter merge - no issues detected\"\r\re.g. Issue.diagnostics \"Merge would update: 10 years of content or 120 resources\"\r\rThe resulting target encounter resource will also be returned in the result." ] ; fhir:type [ fhir:v "boolean" ] ] [ fhir:name [ fhir:v "return" ] ; fhir:use [ fhir:v "out" ] ; fhir:min [ fhir:v "1"^^xsd:nonNegativeInteger ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "The status of the response will be one of:\r\r* 200 OK - If the merge request doesn't expect any issues (although warning may be present) for a preview, or was completed without issues if not a preview\r* 202 Accepted - The merge request has been accepted and does not expect any issues and will continue processing the merge in the background, and you can monitor the Task for completion\r* 400 Bad Request - There are errors in the input parameters that need to corrected\r* 422 Unprocessable Entity - Business rules prevent this merge from completing\r\rThe Parameters resource will include:\r\r* The Input parameters to the operation\r* An OperationOutcome containing errors, warnings, and information messages\r* The resulting merged Encounter resource (or an encounter reference if the encounter is not committed)\r* Optionally a Task resource to track any additional processing that was required.\r\rNote: as this is the only out parameter, it is a resource, and it has the name 'return', the result of this operation is returned directly as a resource" ] ; fhir:type [ fhir:v "Parameters" ] ] ) . # # -------------------------------------------------------------------------------------
Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.
FHIR ®© HL7.org 2011+. FHIR R6 hl7.fhir.core#6.0.0-ballot3 generated on Sat, Aug 30, 2025 14:27+0000.
Links: Search |
Version History |
Contents |
Glossary |
QA |
Compare to R5 |
|
Propose a change