POST
/
medical
/
v1
/
patient
/
match
curl --request POST \
  --url https://api.sandbox.metriport.com/medical/v1/patient/match \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "firstName": "<string>",
  "lastName": "<string>",
  "dob": "<string>",
  "genderAtBirth": "<string>",
  "personalIdentifiers": [
    {
      "type": "<string>",
      "state": "<string>",
      "value": "<string>"
    }
  ],
  "address": [
    {
      "addressLine1": "<string>",
      "addressLine2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "zip": "<string>",
      "country": "<string>"
    }
  ],
  "contact": [
    {
      "phone": "<string>",
      "email": "<string>"
    }
  ]
}'
import { MetriportMedicalApi, USState } from "@metriport/api-sdk";

const metriport = new MetriportMedicalApi("YOUR_API_KEY");

const patient = await metriport.matchPatient(
  {
    firstName: "Jose",
    lastName: "Juarez",
    dob: "1951-05-05",
    genderAtBirth: "M",
    personalIdentifiers: [
      {
        type: "driversLicense",
        state: USState.CA,
        value: "51227265",
      },
    ],
    address: [
      {
        zip: "12345",
        city: "San Diego",
        state: USState.CA,
        country: "USA",
        addressLine1: "Guadalajara Street",
      },
    ],
    contact: [
      {
        phone: "1234567899",
        email: "jose@domain.com",
      },
    ],
  },
);

Body

The more demographic information you can provide about a Patient, the higher chances Metriport will be able to find a match previously created in Metriport. For example: nicknames, old addresses, multiple phone numbers, a pre-marital last name, etc.

You may provide a comma/space delimited string to specify multiple first and last names. For example, the following inputs would be equivalent: "John,Jonathan" & "John Jonathan" - these would translate to ["John", "Jonathan"].

firstName
string
required

The Patient's first name(s).

lastName
string
required

The Patient's last name(s).

dob
string
required

The Patient's date of birth (DOB), formatted YYYY-MM-DD as per ISO 8601.

genderAtBirth
string
required

The Patient's gender at birth, can be one of M or F.

personalIdentifiers
PersonalIdentifier[]

An array of the Patient's personal IDs, such as a driver's license or SSN. May be empty.

address
Address[]
required

An array of Address objects, representing the Patient's current and/or previous addresses. May be empty.

contact
Contact[]

An array of Contact objects, representing the Patient's current and/or previous contact information. May be empty.

Response

id
string
required

The ID assigned to this Patient. This ID will be used to uniquely identify this Patient in medical documents.

externalId
string

An external Patient ID to associate to a Patient in Metriport.

firstName
string[]
required

The Patient's first name(s).

lastName
string[]
required

The Patient's last name(s).

dob
string
required

The Patient's date of birth (DOB), formatted YYYY-MM-DD as per ISO 8601.

genderAtBirth
string
required

The Patient's gender at birth, can be one of M or F.

personalIdentifiers
PersonalIdentifier[]

An array of the Patient's personal IDs, such as a driver's license. May be empty.

address
Address[]
required
contact
Contact[]
facilityIds
string[]
required

Array of the IDs of the Facilities where the Patient is receiving care.

import { MetriportMedicalApi, USState } from "@metriport/api-sdk";

const metriport = new MetriportMedicalApi("YOUR_API_KEY");

const patient = await metriport.matchPatient(
  {
    firstName: "Jose",
    lastName: "Juarez",
    dob: "1951-05-05",
    genderAtBirth: "M",
    personalIdentifiers: [
      {
        type: "driversLicense",
        state: USState.CA,
        value: "51227265",
      },
    ],
    address: [
      {
        zip: "12345",
        city: "San Diego",
        state: USState.CA,
        country: "USA",
        addressLine1: "Guadalajara Street",
      },
    ],
    contact: [
      {
        phone: "1234567899",
        email: "jose@domain.com",
      },
    ],
  },
);
{
  "id": "2.16.840.1.113883.3.666.777",
  "externalId": "1234567890",
  "firstName": "Jose",
  "lastName": "Juarez",
  "dob": "1951-05-05",
  "genderAtBirth": "M",
  "personalIdentifiers": [
    {
      "type": "driversLicense",
      "state": "CA",
      "value": "51227265"
    }
  ],
  "address": [
    {
      "zip": "12345",
      "city": "San Diego",
      "state": "CA",
      "country": "USA",
      "addressLine1": "Guadalajara St"
    }
  ],
  "contact": [
    {
      "phone": "1234567899",
      "email": "jose@domain.com"
    }
  ],
  "facilityIds": ["2.16.840.1.113883.3.666.5.2004.4.2005"]
}