{
  "resourceType": "Parameters",
  "id": "parameters-merge-output-example",
  "meta": {
    "profile": [
      "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-parameters-merge-output"
    ]
  },
  "parameter": [
    {
      "name": "input",
      "resource": {
        "resourceType": "Parameters",
        "id": "parameters-merge-input-example",
        "meta": {
          "profile": [
            "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-parameters-merge-input"
          ]
        },
        "parameter": [
          {
            "name": "merge-reason",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "duplicate-record",
                  "system": "https://ehealthontario.ca/fhir/CodeSystem/pcr-merge-reason",
                  "display": "Duplicate patient record"
                }
              ],
              "text": "Duplicate record identified through governed reconciliation process."
            }
          },
          {
            "name": "merge-requester",
            "valueIdentifier": {
              "system": "https://hospital.example.ca/user-id",
              "value": "USER12345"
            }
          },
          {
            "name": "source-patient",
            "valueReference": {
              "reference": "Patient/patient-contribution-source-example"
            }
          },
          {
            "name": "source-patient-identifier",
            "valueIdentifier": {
              "system": "https://hospital.example.ca/mrn",
              "value": "MRN123456",
              "type": {
                "coding": [
                  {
                    "code": "MR",
                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203"
                  }
                ]
              }
            }
          },
          {
            "name": "target-patient",
            "valueReference": {
              "reference": "Patient/patient-contribution-target-example"
            }
          },
          {
            "name": "target-patient-identifier",
            "valueIdentifier": {
              "system": "https://hospital.example.ca/mrn",
              "value": "MRN999999",
              "type": {
                "coding": [
                  {
                    "code": "MR",
                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203"
                  }
                ]
              }
            }
          },
          {
            "name": "result-patient",
            "resource": {
              "resourceType": "Patient",
              "id": "patient-contribution-merged-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"
                      }
                    ]
                  }
                },
                {
                  "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"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "name": "result",
      "resource": {
        "resourceType": "Patient",
        "id": "patient-contribution-merged-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"
                }
              ]
            }
          },
          {
            "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"
          }
        ]
      }
    },
    {
      "name": "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": "Patient/patient-contribution-source-example was merged into Patient/patient-contribution-target-example. Patient/patient-contribution-merged-example is the retained patient identity."
            }
          }
        ]
      }
    }
  ]
}