---
title: "Encounter data model"
url: "https://docs.unified.to/healthcare/encounter/model"
description: "The Encounter data model object in Unified's Encounter API: 14 fields, including created_at, updated_at and patient_id, with types and enum values."
---
# Encounter data model

 View field support, webhooks, and list parameters for each integration on the [Supported Integrations](https://docs.unified.to/healthcare/integrations.md) page. 

| Field                    | Type                                                                                               | Required | Description                                                                                                                               |
| ------------------------ | -------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| id                       | string                                                                                             | No       | Unique identifier for the encounter                                                                                                       |
| created\_at              | string (date-time)                                                                                 | No       | When the encounter record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                            |
| updated\_at              | string (date-time)                                                                                 | No       | When the encounter record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                       |
| patient\_id              | string                                                                                             | No       | The patient seen in the encounter                                                                                                         |
| practitioner\_ids        | string\[\]                                                                                         | No       | The practitioners who participated in the encounter                                                                                       |
| location\_id             | string                                                                                             | No       | Where the encounter took place                                                                                                            |
| appointment\_id          | string                                                                                             | No       | The appointment that scheduled this encounter                                                                                             |
| condition\_ids           | string\[\]                                                                                         | No       | Conditions diagnosed or addressed during the encounter                                                                                    |
| status                   | enum                                                                                               | No       | Status of the encounter Values: PLANNED, ARRIVED, TRIAGED, IN\_PROGRESS, ONLEAVE, FINISHED, CANCELLED, ENTERED\_IN\_ERROR, UNKNOWN, OTHER |
| type                     | enum                                                                                               | No       | Class of the encounter (e.g. ambulatory, inpatient) Values: AMBULATORY, EMERGENCY, INPATIENT, OBSERVATION, HOME\_HEALTH, VIRTUAL, OTHER   |
| reasons                  | [HealthcareCode](https://docs.unified.to/healthcare/encounter/model.md#HealthcareCode)\[\]         | No       | Codings for the reason for the encounter                                                                                                  |
| reasons\[\].system       | string                                                                                             | No       | The code system URI (e.g. http://loinc.org, http://snomed.info/sct)                                                                       |
| reasons\[\].code         | string                                                                                             | No       | The code within the system                                                                                                                |
| reasons\[\].display      | string                                                                                             | No       | Human-readable display text for the code                                                                                                  |
| start\_at                | string (date-time)                                                                                 | No       | When the encounter started (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                       |
| end\_at                  | string (date-time)                                                                                 | No       | When the encounter ended (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                         |
| metadata                 | [HealthcareMetadata](https://docs.unified.to/healthcare/encounter/model.md#HealthcareMetadata)\[\] | No       |                                                                                                                                           |
| metadata\[\].id          | string                                                                                             | No       |                                                                                                                                           |
| metadata\[\].value       | object                                                                                             | No       |                                                                                                                                           |
| metadata\[\].namespace   | string                                                                                             | No       |                                                                                                                                           |
| metadata\[\].format      | enum                                                                                               | No       | Values: TEXT, NUMBER, DATE, BOOLEAN, ARRAY, OBJECT                                                                                        |
| metadata\[\].extra\_data | object                                                                                             | No       |                                                                                                                                           |
| metadata\[\].slug        | string                                                                                             | No       |                                                                                                                                           |

## TypeScript

```typescript
export type HealthcareEncounter = {
	id?: string; // Unique identifier for the encounter
	created_at?: string-time; // When the encounter record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // When the encounter record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	patient_id?: string; // The patient seen in the encounter
	practitioner_ids?: string[]; // The practitioners who participated in the encounter
	location_id?: string; // Where the encounter took place
	appointment_id?: string; // The appointment that scheduled this encounter
	condition_ids?: string[]; // Conditions diagnosed or addressed during the encounter
	status?: 'PLANNED' | 'ARRIVED' | 'TRIAGED' | 'IN_PROGRESS' | 'ONLEAVE' | 'FINISHED' | 'CANCELLED' | 'ENTERED_IN_ERROR' | 'UNKNOWN' | 'OTHER'; // Status of the encounter
	type?: 'AMBULATORY' | 'EMERGENCY' | 'INPATIENT' | 'OBSERVATION' | 'HOME_HEALTH' | 'VIRTUAL' | 'OTHER'; // Class of the encounter (e.g. ambulatory, inpatient)
	reasons?: []; // Codings for the reason for the encounter
	start_at?: string-time; // When the encounter started (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	end_at?: string-time; // When the encounter ended (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	metadata?: [];
	raw?: any; // Raw data from integration
} 
```

## Zod

```typescript
import { z } from 'zod';

export const ZodHealthcareEncounter = z.object({
	id: z.string().optional().describe("Unique identifier for the encounter"),
	created_at: z.string-time().optional().describe("When the encounter record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("When the encounter record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	patient_id: z.string().optional().describe("The patient seen in the encounter"),
	practitioner_ids: z.array().optional().describe("The practitioners who participated in the encounter"),
	location_id: z.string().optional().describe("Where the encounter took place"),
	appointment_id: z.string().optional().describe("The appointment that scheduled this encounter"),
	condition_ids: z.array().optional().describe("Conditions diagnosed or addressed during the encounter"),
	status: z.enum("PLANNED", "ARRIVED", "TRIAGED", "IN_PROGRESS", "ONLEAVE", "FINISHED", "CANCELLED", "ENTERED_IN_ERROR", "UNKNOWN", "OTHER").optional().describe("Status of the encounter"),
	type: z.enum("AMBULATORY", "EMERGENCY", "INPATIENT", "OBSERVATION", "HOME_HEALTH", "VIRTUAL", "OTHER").optional().describe("Class of the encounter (e.g. ambulatory, inpatient)"),
	reasons: z.array().optional().describe("Codings for the reason for the encounter"),
	start_at: z.string-time().optional().describe("When the encounter started (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	end_at: z.string-time().optional().describe("When the encounter ended (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	metadata: z.array().optional(),

});
```

## Python

```python
import dataclasses

@dataclasses.dataclass
class HealthcareEncounterStatus(str, Enum):
	PLANNED = 'PLANNED'
	ARRIVED = 'ARRIVED'
	TRIAGED = 'TRIAGED'
	IN_PROGRESS = 'IN_PROGRESS'
	ONLEAVE = 'ONLEAVE'
	FINISHED = 'FINISHED'
	CANCELLED = 'CANCELLED'
	ENTERED_IN_ERROR = 'ENTERED_IN_ERROR'
	UNKNOWN = 'UNKNOWN'
	OTHER = 'OTHER'

@dataclasses.dataclass
class HealthcareEncounterType(str, Enum):
	AMBULATORY = 'AMBULATORY'
	EMERGENCY = 'EMERGENCY'
	INPATIENT = 'INPATIENT'
	OBSERVATION = 'OBSERVATION'
	HOME_HEALTH = 'HOME_HEALTH'
	VIRTUAL = 'VIRTUAL'
	OTHER = 'OTHER'

@dataclasses.dataclass
class HealthcareEncounter:
	"""Unique identifier for the encounter"""
	id: Optional[str]
	"""When the encounter record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""When the encounter record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""The patient seen in the encounter"""
	patient_id: Optional[str]
	"""The practitioners who participated in the encounter"""
	practitioner_ids: Optional[List[List[str]]]
	"""Where the encounter took place"""
	location_id: Optional[str]
	"""The appointment that scheduled this encounter"""
	appointment_id: Optional[str]
	"""Conditions diagnosed or addressed during the encounter"""
	condition_ids: Optional[List[List[str]]]
	"""Status of the encounter"""
	status: Optional[HealthcareEncounterStatus]
	"""Class of the encounter (e.g. ambulatory, inpatient)"""
	type: Optional[HealthcareEncounterType]
	"""Codings for the reason for the encounter"""
	reasons: Optional[PropertyHealthcareEncounterReasons]
	"""When the encounter started (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	start_at: Optional[str]
	"""When the encounter ended (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	end_at: Optional[str]
	metadata: Optional[PropertyHealthcareEncounterMetadata]

```
