{
  "resourceType": "Parameters",
  "id": "parameters-unmerge-output-example",
  "meta": {
    "profile": [
      "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-parameters-unmerge-output"
    ]
  },
  "parameter": [
    {
      "name": "input",
      "resource": {
        "resourceType": "Parameters",
        "id": "parameters-unmerge-input-example",
        "meta": {
          "profile": [
            "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-parameters-unmerge-input"
          ]
        },
        "parameter": [
          {
            "name": "merged-patient",
            "valueReference": {
              "reference": "Patient/patient-contribution-merged-example"
            }
          },
          {
            "name": "restore-patient",
            "valueReference": {
              "reference": "Patient/patient-contribution-source-example"
            }
          },
          {
            "name": "prior-merge-id",
            "valueIdentifier": {
              "system": "https://ehealthontario.ca/fhir/NamingSystem/pcr-merge-event-id",
              "value": "MERGE-20260806-00001"
            }
          },
          {
            "name": "unmerge-reason",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "incorrect-merge",
                  "system": "https://ehealthontario.ca/fhir/CodeSystem/pcr-unmerge-reason",
                  "display": "Incorrect Merge"
                }
              ],
              "text": "Prior merge was determined to be incorrect following governed identity review."
            }
          },
          {
            "name": "unmerge-requester",
            "valueIdentifier": {
              "system": "https://hospital.example.ca/user-id",
              "value": "USER12345"
            }
          }
        ]
      }
    },
    {
      "name": "operation-outcome",
      "resource": {
        "resourceType": "OperationOutcome",
        "id": "operationoutcome-example-success",
        "meta": {
          "profile": [
            "http://ontariohealth.ca/fhir/pcr/StructureDefinition/pcr-operationoutcome-contribution"
          ]
        },
        "issue": [
          {
            "severity": "information",
            "code": "informational",
            "details": {
              "text": "Prior merge MERGE-20260806-00001 was reversed. Patient/patient-contribution-source-example was restored and Patient/patient-contribution-target-example remains active as a separate identity."
            }
          }
        ]
      }
    },
    {
      "name": "retained-patient-result",
      "resource": {
        "resourceType": "Patient",
        "id": "patient-contribution-target-example",
        "meta": {
          "profile": [
            "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-patient-contribution"
          ]
        },
        "name": [
          {
            "given": [
              "Michael",
              "John"
            ],
            "_given": [
              {
                "extension": [
                  {
                    "url": "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier",
                    "valueCode": "MID"
                  }
                ]
              },
              null
            ],
            "use": "official",
            "family": "Smith"
          }
        ],
        "identifier": [
          {
            "system": "https://hospital.example.ca/mrn",
            "value": "MRN999999",
            "type": {
              "coding": [
                {
                  "code": "MR",
                  "system": "http://terminology.hl7.org/CodeSystem/v2-0203"
                }
              ]
            }
          }
        ],
        "active": true,
        "gender": "male",
        "birthDate": "1985-06-15",
        "address": [
          {
            "use": "home",
            "type": "postal",
            "line": [
              "100 Main Street"
            ],
            "city": "Toronto",
            "state": "ON",
            "postalCode": "M5V2T6",
            "country": "CAN"
          }
        ]
      }
    },
    {
      "name": "restored-patient-result",
      "resource": {
        "resourceType": "Patient",
        "id": "patient-contribution-source-example",
        "meta": {
          "profile": [
            "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-patient-contribution"
          ]
        },
        "name": [
          {
            "given": [
              "Michael",
              "John"
            ],
            "_given": [
              {
                "extension": [
                  {
                    "url": "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier",
                    "valueCode": "MID"
                  }
                ]
              },
              null
            ],
            "use": "official",
            "family": "Smith"
          }
        ],
        "identifier": [
          {
            "system": "https://hospital.example.ca/mrn",
            "value": "MRN123456",
            "type": {
              "coding": [
                {
                  "code": "MR",
                  "system": "http://terminology.hl7.org/CodeSystem/v2-0203"
                }
              ]
            }
          }
        ],
        "active": true,
        "gender": "male",
        "birthDate": "1985-06-15",
        "address": [
          {
            "use": "home",
            "type": "postal",
            "line": [
              "100 Main Street"
            ],
            "city": "Toronto",
            "state": "ON",
            "postalCode": "M5V2T6",
            "country": "CAN"
          }
        ]
      }
    }
  ]
}