---
title: By demographics
slug: by-demographics
docTags: 
createdAt: 2023-09-27T09:38:19.025Z
---

### Interaction

A patient can be queried for based on the known demographics of that patient by sending a  **GET** or a **POST** request to the Patient endpoint, depending on your [region](docId\:ncFf15xNu1WGlST2wNm-P): `<region>.founda.com/1/health/organizations/<org-x>/fhir/4/Patient`

The amount of patients that are returned in the response depends on the amount of matching patients that result from the API call: 0, 1 or N. In the case of N matches, the application can implement a heuristic to select the correct patient. Once the right patient is identified, its unique identifier can be used to retrieve the patient resource - as explained in the ["Retrieve Patient by identifier"](docId:_IeqA7s2qQuVWRZx_TW37) section.&#x20;

### Parameters

A combination of the parameters listed below can be used as search parameters.&#x20;

| **Parameter**        | **Type**  | **Required** | **Description**                                                                                                                                                 |
| -------------------- | --------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_id`                | `string`  |              | Resource (logical) identifier for the patient                                                                                                                   |
| `active`             | `boolean` |              | Search for active (true) or inactive (false) patients                                                                                                           |
| `family`             | `string`  |              | Family name or last name of the patient                                                                                                                         |
| `given`              | `string`  |              | Given name of the patient                                                                                                                                       |
| `identifier`         | `token`   |              | A patient identifier, formatted as: `<system>\|<value>`. Multiple identifiers can be added.                                                                     |
| `telecom`            | `token`   |              | Telecommunication details                                                                                                                                       |
| `birthdate`          | `date`    |              | Patient's birthday, e.g. "2000-10-01"                                                                                                                           |
| `address`            | `string`  |              | A known address for the patient                                                                                                                                 |
| `address-city`       | `string`  |              | The city the patient lives in                                                                                                                                   |
| `address-country`    | `string`  |              | The country the patient lives in                                                                                                                                |
| `address-postalcode` | `string`  |              | The postal code of the patient's address                                                                                                                        |
| `address-state`      | `string`  |              | The state the patient lives in                                                                                                                                  |
| `gender`             | `token`   |              | The patient's gender, from value set: [http://hl7.org/fhir/R4/valueset-administrative-gender.html](http://hl7.org/fhir/R4/valueset-administrative-gender.html)  |
| `mothersMaidenName`  | `string`  |              | The patient's mother's maiden name                                                                                                                              |
| `_profile`           |           | Yes          | The profile transaction URL that the request is for, e.g. `https://profiles.ihe.net/ITI/PDQm`.                                                                  |

### Profile

The Retrieve Patient interaction with the Founda Platform is based on the [IHE PDQm profile](https://profiles.ihe.net/ITI/PDQm/index.html). To indicate that the request and response should comply with ITI-78, the `_profile` parameter should be included to the search set: `.../Patient?_profile=https://profiles.ihe.net/ITI/PDQm`.

### Example API call

::::CodeDrawer{title="Retrieve Patient by demographics - GET" isResponseExpanded="true" autoGeneratedAnchorSlug="retrieve-patient-by-demographics-get" legacyHash="5QgA4mnrSspKFgbx7-RHx"}
:::CodeblockTabsExamples
```curl
curl --location 'https://api.eu.founda.com/1/health/organizations/org-4c5739ba994d4ce9b5255d3f84a2d367/fhir/4/Patient?given=Duck&family=Donald&birthdate=1924-06-09&_profile=https%3A%2F%2Fprofiles.ihe.net%2FITI%2FPDQm%2F' \
--header 'Authorization: Bearer ory_at_Rsh9ASri-M5WV6iVOHLorgo1lAvFi4-Kg9dPlWosdjM.NrSredmWdEzbONXaOYKkOSaweXAHzDXUueY5AAnavkU'
```
:::

:::CodeblockTabsResponses
```javascript
{
    "resourceType": "Bundle",
    "id": "eae206f2-1b2d-4b9b-acea-6727cab3e351",
    "meta": {
        "lastUpdated": "2023-10-05T14:34:11.283+00:00"
    },
    "type": "searchset",
    "total": 1,
    "link": [
        {
            "relation": "self",
            "url": "https://api.eu.founda.com/1/health/organizations/org-4c5739ba994d4ce9b5255d3f84a2d367/fhir/4/Patient?given=Duck&family=Donald&birthdate=1924-06-09&_profile=https://profiles.ihe.net/ITI/PDQm/"
        }
    ],
    "entry": [
        {
            "fullUrl": "https://api.eu.founda.com/1/health/organizations/org-4c5739ba994d4ce9b5255d3f84a2d367/fhir/4/Patient/2078",
            "resource": {
                "resourceType": "Patient",
                "id": "2078",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2023-10-05T14:29:14.124+00:00",
                    "source": "#o1vJX8Q904hvVeMp",
                    "tag": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "code": "HTEST",
                            "display": "test health data"
                        }
                    ]
                },
                "text": {
                    "status": "generated",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n      \n      <p>Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321</p>\n    \n    </div>"
                },
                "identifier": [
                    {
                        "use": "usual",
                        "type": {
                            "coding": [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "MR"
                                }
                            ]
                        },
                        "system": "urn:oid:0.1.2.3.4.5.6.7",
                        "value": "654321"
                    }
                ],
                "active": true,
                "name": [
                    {
                        "use": "official",
                        "family": "Donald",
                        "given": [
                            "Duck"
                        ]
                    }
                ],
                "gender": "male",
                "birthDate": "1924-06-09",
                "photo": [
                    {
                        "contentType": "image/gif",
                        "data": "R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7"
                    }
                ],
                "contact": [
                    {
                        "relationship": [
                            {
                                "coding": [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/v2-0131",
                                        "code": "E"
                                    }
                                ]
                            }
                        ],
                        "organization": {
                            "reference": "Organization/2072",
                            "display": "Walt Disney Corporation"
                        }
                    }
                ],
                "managingOrganization": {
                    "reference": "Organization/2072",
                    "display": "ACME Healthcare, Inc"
                }
            },
            "search": {
                "mode": "match"
            }
        }
    ]
}
```
:::
::::

::::CodeDrawer{title="Retrieve Patient by demographics - POST" isResponseExpanded="true" autoGeneratedAnchorSlug="retrieve-patient-by-demographics-post" legacyHash="xG78fQY90R29YMwG3_R0G"}
:::CodeblockTabsExamples
```curl
curl --location 'https://api.eu.founda.com/1/health/organizations/org-4c5739ba994d4ce9b5255d3f84a2d367/fhir/4/Patient/_search?_profile=https%3A%2F%2Fprofiles.ihe.net%2FITI%2FPDQm%2F' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer ory_at_Rsh9ASri-M5WV6iVOHLorgo1lAvFi4-Kg9dPlWosdjM.NrSredmWdEzbONXaOYKkOSaweXAHzDXUueY5AAnavkU' \
--data-urlencode 'given=Duck' \
--data-urlencode 'family=Donald' \
--data-urlencode 'birthdate=1924-06-09'
```
:::

:::CodeblockTabsResponses
```javascript
{
    "resourceType": "Bundle",
    "id": "eae206f2-1b2d-4b9b-acea-6727cab3e351",
    "meta": {
        "lastUpdated": "2023-10-05T14:34:11.283+00:00"
    },
    "type": "searchset",
    "total": 1,
    "link": [
        {
            "relation": "self",
            "url": "https://api.eu.founda.com/1/health/organizations/org-4c5739ba994d4ce9b5255d3f84a2d367/fhir/4/Patient/_search?_profile=https://profiles.ihe.net/ITI/PDQm/"
        }
    ],
    "entry": [
        {
            "fullUrl": "https://api.eu.founda.com/1/health/organizations/org-4c5739ba994d4ce9b5255d3f84a2d367/fhir/4/Patient/2078",
            "resource": {
                "resourceType": "Patient",
                "id": "2078",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2023-10-05T14:29:14.124+00:00",
                    "source": "#o1vJX8Q904hvVeMp",
                    "tag": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "code": "HTEST",
                            "display": "test health data"
                        }
                    ]
                },
                "text": {
                    "status": "generated",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n      \n      <p>Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321</p>\n    \n    </div>"
                },
                "identifier": [
                    {
                        "use": "usual",
                        "type": {
                            "coding": [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "MR"
                                }
                            ]
                        },
                        "system": "urn:oid:0.1.2.3.4.5.6.7",
                        "value": "654321"
                    }
                ],
                "active": true,
                "name": [
                    {
                        "use": "official",
                        "family": "Donald",
                        "given": [
                            "Duck"
                        ]
                    }
                ],
                "gender": "male",
                "birthDate": "1924-06-09",
                "photo": [
                    {
                        "contentType": "image/gif",
                        "data": "R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7"
                    }
                ],
                "contact": [
                    {
                        "relationship": [
                            {
                                "coding": [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/v2-0131",
                                        "code": "E"
                                    }
                                ]
                            }
                        ],
                        "organization": {
                            "reference": "Organization/2072",
                            "display": "Walt Disney Corporation"
                        }
                    }
                ],
                "managingOrganization": {
                    "reference": "Organization/2072",
                    "display": "ACME Healthcare, Inc"
                }
            },
            "search": {
                "mode": "match"
            }
        }
    ]
}
```
:::
::::

