# Find Patient

## Get a list of all patient submissions

<mark style="color:blue;">`GET`</mark> `https://api.formdr.com/api/v1/practice/{practiceId}`

#### Path Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| practiceId | String | Practice ID |

#### Query Parameters

| Name                                        | Type   | Description        |
| ------------------------------------------- | ------ | ------------------ |
| firstName<mark style="color:red;">\*</mark> | String | Patient First Name |
| lastName<mark style="color:red;">\*</mark>  | String | Patient Last Name  |

{% tabs %}
{% tab title="200: OK " %}

```javascript
[{
    submissionId: number,
    practiceId: number,
    formUuid: string,
    recordId: number,
    demographics: {
        firstName: string,
        middleName: string,
        lastName: string,
        preferredName: string,
        sex: string,
        birthday: string,
        email: string,
        primaryPhone: string,
        cellPhone: string,
        address: {
            address: string,
            address2: string,
            city: string,
            state: string,
            zip: string
        }
    }
}]
```

{% endtab %}

{% tab title="401: Unauthorized If you use a different practice ID, you will receive an unauthorized error." %}

```javascript
{
    "Not authorized"
}
```

{% endtab %}

{% tab title="404: Not Found When a record is not found" %}

```javascript
{
    name: "Error",
    message: "No Record Found",
    "errors": []
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you are seeing multiple patient records of the same name, ensure that you form has a DOB field named "birthday". In order to match patient records and ensure submissions are going to the same patient record, firstName, lastName and birthday are the matchers.
{% endhint %}

#### Get a list of all submissions by Record ID

<mark style="color:blue;">`GET`</mark> `https://api.formdr.com/api/v1/practice/{practiceId}`

#### Query Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| recordId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
[{
    submissionId: number,
    practiceId: number,
    formUuid: string,
    recordId: number,
    demographics: {
        firstName: string,
        middleName: string,
        lastName: string,
        preferredName: string,
        sex: string,
        birthday: string,
        email: string,
        primaryPhone: string,
        cellPhone: string,
        address: {
            address: string,
            address2: string,
            city: string,
            state: string,
            zip: string
        }
    }
}]
```

{% endtab %}
{% endtabs %}

### Testing

For additional security, when you are testing using the test access tokens, you will not be able to retrieve any PHI data. The only data that will return is the firstName and lastName variables. The remaining variables with simply return a string of the key name.
