Querying Patients
Once several records have been added to the Identity service, you can retrieve this information in various ways.
These examples assume that we have previously added some record information for John Smith, as described in Understanding Record Groups.
Querying By Record (Source System)
We have a record for John from Community Clinic and want to find out what other records exist for him.
We use the Get Person By Record operation, querying with the Community Clinic source system (CommunityClinic
) and internal identifier (12345
):
GET /mpi/v1/record/CommunityClinic/12345
{
"id": "a46ee8bd-9dd1-41e6-bced-f2578ce37ae0",
"records": [
{
"source": "CommunityClinic",
"identifier": "12345"
},
{
"source": "AnytownUrgentCare",
"identifier": "AZ67889"
}
],
...
}
From this response, we can find John’s Person ID (a46e...
) in the id
field.
The records
field shows the Community Clinic record (which we used to search), and also tells us that John has a record from Anytown Urgent Care with internal identifier AZ67889
.
No demographics are returned; only source systems and their internal identifiers. The Identity service does not retain clear-text demographic information after it is submitted, so there is no way to retrieve it. This highlights why it’s important to never use business identifiers (MRNs, SSNs, etc.) as the internal identifier when adding records.
Querying By Person ID
Alternately, if we already know John’s Person ID (from some previous operation), we can use that to find out what records he has using the Get Person by ID operation.
GET /mpi/v1/person/a46ee8bd-9dd1-41e6-bced-f2578ce37ae0
{
"id": "a46ee8bd-9dd1-41e6-bced-f2578ce37ae0",
"records": [
{
"source": "CommunityClinic",
"identifier": "12345"
},
{
"source": "AnytownUrgentCare",
"identifier": "AZ67889"
}
],
...
}
Notice that the response data is identical whether querying by Person ID or by record (as in the previous example). No demographics are returned.
Querying with Demographics
Less commonly, we may wish to determine if any source systems know of an individual without actually adding or updating specific records. In this case, we can use the Match Demographics operation.
POST /mpi/v1/match
{
"firstName":"John",
"lastName":"Smith",
"gender":"male",
"dob":"2003/01/02",
"street":"123 Shady Lane",
"city":"Anytown",
"zipCode":"48105"
}
{
"id": "a46ee8bd-9dd1-41e6-bced-f2578ce37ae0",
"records": [
{
"source": "CommunityClinic",
"identifier": "12345"
},
{
"source": "AnytownUrgentCare",
"identifier": "AZ67889"
}
],
...
}
Notice that the response data is identical whether querying by Person ID, by record (as in the previous example), or by demographics. No demographics are returned.