# ovok_sdk.resources.patient

Canonical page: https://docs.ovok.com/python-sdk/reference/resources/patient

FHIR reads for the signed-in patient: appointments, measurements, care plans and more.

## FhirListResource [#fhirlistresource]

```python
FhirListResource(fhir: FhirResource, resource_type: str)
```

Lists one FHIR resource type, returning the first page as a list.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `fhir` | `FhirResource` |  | The FHIR client. |
| `resource_type` | `str` |  | FHIR resource type to list. |

### list() [#list]

```python
list(params: QueryParams | None = None) -> list[Resource]
```

List resources of this type.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `params` | `QueryParams \| None` | `None` | FHIR search parameters. |

**Returns**

- `list[Resource]`: The resources on the first page of results.

## FhirRecordsResource [#fhirrecordsresource]

```python
FhirRecordsResource()
```

Bases: `FhirListResource`

Lists and reads one FHIR resource type.

### retrieve() [#retrieve]

```python
retrieve(resource_id: str) -> Resource
```

Read one resource by ID.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `resource_id` | `str` |  | The resource's logical ID. |

**Returns**

- `Resource`: The resource.

**Raises**

- `OvokNotFoundError`: The resource does not exist.

## AppointmentsResource [#appointmentsresource]

```python
AppointmentsResource(fhir: FhirResource)
```

Bases: `FhirRecordsResource`

Lists, reads, creates and updates FHIR Appointments.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `fhir` | `FhirResource` |  | The FHIR client. |

### create() [#create]

```python
create(appointment: Resource) -> Resource
```

Create an Appointment.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `appointment` | `Resource` |  | The Appointment resource. |

**Returns**

- `Resource`: The created Appointment.

### update() [#update]

```python
update(appointment_id: str, appointment: Resource) -> Resource
```

Replace an Appointment.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `appointment_id` | `str` |  | The Appointment's ID; it overrides any `id` in `appointment`. |
| `appointment` | `Resource` |  | The full Appointment resource. |

**Returns**

- `Resource`: The updated Appointment.

## PatientResource [#patientresource]

```python
PatientResource(http: HttpClient, fhir: FhirResource)
```

Patient-facing FHIR data, one attribute per resource type.

Created by `Ovok`; access it as `ovok.patient`. Attributes: `appointments`, `schedules`,
`slots`, `measurements` (Observations), `care_plans`, `questionnaires`,
`questionnaire_responses`, `devices` and `notifications` (CommunicationRequests).

### latest_observations() [#latest_observations]

```python
latest_observations(params: QueryParams | None = None) -> Resource
```

Read the latest Observations per code with FHIR `$lastn`.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `params` | `QueryParams \| None` | `None` | `$lastn` search parameters, such as `patient`, `code` or `max`. |

**Returns**

- `Resource`: A searchset Bundle.

### dashboard() [#dashboard]

```python
dashboard(params: dict[str, Any] | None = None) -> dict[str, Any]
```

Load the signed-in patient's profile, latest Observations, history and care plans.

Each search defaults its `patient` parameter to the signed-in patient.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `params` | `dict[str, Any] \| None` | `None` | Optional search parameters keyed by `latest_observations`, `measurement_history` and `care_plans`. |

**Returns**

- `dict[str, Any]`: A dict with `profile`, `latest_observations`, `measurement_history` and `care_plans`.
