---
title: "MPI API Sample"
slug: "mpi-api-sample"
updated: 2026-05-28T20:40:07Z
published: 2026-05-28T20:40:07Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.imat.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MPI API Sample

## MPI

IMAT Solutions uses FHIR as a means of exchanging electronic healthcare records and is used to link patient data across various systems.

Queries can be constructed with inbound facility name and MRN; first, middle, and last name; and optionally date of birth and SSN.

The MPI API call below is to retrieve an MRN for a specified facility. The interface will return an XML document with a series of "hit" elements, each containing the raw FHIR record associated with each patient. All of the parameters below should look familiar with the exception of `caller=mpi`. Use this each time when performing an MPI query. See [query parameters](/v1/docs//query-syntax#basic-query-parameters) for more information.

#### Example:

```
https://<ip_address>/search?caller=mpi&store=mpi-persona&report=exacttotal&limit=25&fields=uri,rawrecord&q=()first_name:"Ricky" family_name:"Ramsay"
```

#### Response:

```
<timestamp>2016-05-17 15:40:32</timestamp>
<hits total="10" sample="-1" skip="0" count="10" match="exact" grosscount="10">
  <hit ref="2" score="0" store="1101" space="1101">
    <uri>mpi/persona/12.MPI</uri>
    <rawrecord>
      <Patient xmlns="http://hl7.org/fhir">
        <id value="12.MPID"/>
        <contained>
          <Patient>
            <id value="53.PI"/>
            <identifier>
              <use value="usual"/>
              <type>
                <coding>
                  <system value="http://imat.us/fhir/codes/mpi"/>
                  <code value="PI"/>
                  <display value="Patient Information Identifier"/>
                </coding>
              </type>
              <system value="https://IMAT-MPI1.imat.io/mpi/0/"/>
              <value value="53.PI"/>
              <extension url="http://imat.us/fhir/extensions/mpi">
                <extension url="ParentPI">
                  <valueString value="0"/>
                </extension>
                <extension url="RulesVersion">
                  <valueString value="0"/>
                </extension>
                <extension url="Rule">
                  <valueString value="0"/>
                </extension>
                <extension url="OriginalTransactnum">
                  <valueString value="0"/>
                </extension>
              </extension>
            </identifier>
            <name>
              <family value="RAMSAY"/>
              <given value="RICKY"/>
            </name>
            <telecom>
              <system value="phone"/>
              <value value="590-555-7055"/>
            </telecom>
            <gender value="male"/>
            <birthDate value="1954-04-10"/>
            <address>
              <line value="8741 So Falls Boulevard"/>
              <city value="Norman"/>
              <state value="Nevada"/>
              <postalCode value="36049"/>
            </address>
          </Patient>
        </contained>
        <identifier>
          <use value="usual"/>
          <type>
            <coding>
              <system value="http://imat.us/fhir/codes/mpi"/>
              <code value="MPID"/>
              <display value="Master Patient Identifier"/>
            </coding>
          </type>
          <system value="https://IMAT-MPI1.imat.io/mpi/0/"/>
          <value value="12.MPID"/>
          <extension url="http://imat.us/fhir/extensions/mpi">
            <extension url="PIRecord">
              <valueString value="53.PI"/>
            </extension>
          </extension>
        </identifier>
        <identifier>
          <use value="usual"/>
          <type>
            <coding>
              <system value="http://imat.us/fhir/codes/mpi"/>
              <code value="PI"/>
              <display value="Patient Information Identifier"/>
            </coding>
          </type>
          <system value="https://IMAT-MPI1.imat.io/mpi/0/"/>
          <value value="53.PI"/>
          <extension url="http://imat.us/fhir/extensions/mpi">
            <extension url="ParentPI">
              <valueString value="0"/>
            </extension>
            <extension url="RulesVersion">
              <valueString value="0"/>
            </extension>
            <extension url="Rule">
              <valueString value="0"/>
            </extension>
            <extension url="OriginalTransactnum">
              <valueString value="0"/>
            </extension>
          </extension>
        </identifier>
        <name>
          <family value="RAMSAY"/>
          <given value="RICKY"/>
        </name>
        <telecom>
          <system value="phone"/>
          <value value="590-555-7055"/>
        </telecom>
        <gender value="male"/>
        <birthDate value="1954-04-10"/>
        <address>
          <line value="8741 So Falls Boulevard"/>
          <city value="Norman"/>
          <state value="Nevada"/>
          <postalCode value="36049"/>
        </address>
        <link>
          <other>
            <reference value="#53.PI."/>
          </other>
          <type value="seealso"/>
        </link>
      </Patient>
    </rawrecord>
  </hit>
...
</hits>
<query lang="eng">
  <q>()first_name:"Ricky" family_name:"Ramsay"</q>
</query>
<timing>
  <prep_sec>0.000032</prep_sec>
  <search>
    <engine_sec>0.000064</engine_sec>
    <total_search_sec>0.000152</total_search_sec>
  </search>
  <build_report_sec>0.000306</build_report_sec>
  <total_sec>0.000490</total_sec>
</timing>
```

Integrated Medical Analytics Technology

The Fast Healthcare Interoperability Resources is an HL7 standard that defines how healthcare information can be exchanged between computer systems regardless of how it is stored in those systems.

A Medical Record Number is a unique identifier assigned to a patient for tracking and lookup purposes. This number is assigned by the facility. It can also be called a FMRN, Facility Medical Record Number.
