P2P Execute Exchange

 

Overview

This is a custom operation Smile created to streamline the $member-match and $export process as a single operation for the Requesting Payer. The $sdh.s2s.invoke-export endpoint kicks off a server-to-server exchange of patient records between two PDex compliant servers. This operation initiates from the requesting system side.

What $invoke-export Does

 

This Smile CDR operation executes the following activities:

  1. Authenticates with source payer system.
  2. Queries $member-match to locate patient record, unless the source payer's Patient ID is provided in sourcePatientID.
  3. Executes bulk data export via $export operation.
  4. Stores and links retrieved files to local patient record.
  5. Creates Task resource for tracking status and output.

Sample Request

Endpoint

POST {base}/Patient/$sdh.s2s.invoke-export

Request Body

Parameters resource containing:

ParameterTypeRequiredDescription
localPatientreferenceYesReference to local Patient resource
sourceIssuerUrlstringYesIssuer URL from OIDC Server Definition
memberMatchParametersConditionalA Parameters resource containing MemberPatient, CoverageToMatch, CoverageToLink and Consent. Required if sourcePatientID is not provided
sourcePatientIDstringConditionalThe ID of the Patient on the source payer, if already known. Required if memberMatch is not provided. When present, the $member-match step is skipped, even if memberMatch is also provided
exportParameterYesExport parameters (_type, _since, etc.)

One of memberMatch or sourcePatientID must be provided. If both are provided, memberMatch must still be valid. For an example request with sourcePatientID, see Example - With Pre Matched Patient.

CoverageToMatch (inside memberMatch) must carry an id that resolves to a Coverage on the source payer, or an identifier with a value. Otherwise the source payer's $member-match responds with HTTP 422 and no member is matched.

Example Request

The memberMatch parameter carries a nested Parameters resource. MemberPatient must have a family name and a birth date, and the Consent must have a patient and at least one performer. For a complete example with a Consent that follows the HRex Consent profile, see Example - With Member Match.

POST https://requesting-payer.example.com/Patient/$sdh.s2s.invoke-export
Content-Type: application/fhir+json

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "export",
      "resource": {
        "resourceType": "Parameters",
        "parameter": [
          {
            "name": "_outputFormat",
            "valueString": "application/fhir+ndjson"
          },
          {
            "name": "_type",
            "valueString": "Patient, Observation, Appointment"
          }
        ]
      }
    },
    {
      "name": "localPatient",
      "valueReference": {
        "reference": "Patient/local-123"
      }
    },
    {
      "name": "sourceIssuerUrl",
      "valueString": "https://source-payer.example.com"
    },
    {
      "name": "memberMatch",
      "resource": {
        "resourceType": "Parameters",
        "parameter": [
          {
            "name": "MemberPatient",
            "resource": {
              "resourceType": "Patient",
              "name": [{"family": "Smith", "given": ["John"]}],
              "birthDate": "1980-01-01"
            }
          },
          {
            "name": "CoverageToMatch",
            "resource": {
              "resourceType": "Coverage",
              "status": "active",
              "identifier": [{
                "system": "http://source-payer.example.com/member-id",
                "value": "MEM-98765"
              }],
              "beneficiary": {"reference": "Patient/local-123"},
              "payor": [{"display": "Source Health Plan"}]
            }
          },
          {
            "name": "CoverageToLink",
            "resource": {
              "resourceType": "Coverage",
              "status": "active",
              "identifier": [{
                "system": "http://requesting-payer.example.com/member-id",
                "value": "NEW-12345"
              }],
              "beneficiary": {"reference": "Patient/local-123"},
              "payor": [{"display": "Requesting Health Plan"}]
            }
          },
          {
            "name": "Consent",
            "resource": {
              "resourceType": "Consent",
              "status": "active",
              "scope": {
                "coding": [{
                  "system": "http://terminology.hl7.org/CodeSystem/consentscope",
                  "code": "patient-privacy"
                }]
              },
              "patient": {"reference": "Patient/local-123"},
              "performer": [{"reference": "Patient/local-123"}],
              "policy": [{
                "uri": "http://hl7.org/fhir/us/davinci-hrex/StructureDefinition-hrex-consent.html#regular"
              }]
            }
          }
        ]
      }
    }
  ]
}

Success Response

Status: 200 OK

Headers:

Content-Location: Task/p2p-task-ab123

Body:

No response body.

Note: Export jobs can take time to process.