---
title: "Allergy data model"
url: "https://docs.unified.to/healthcare/allergy/model"
description: "The Allergy data model object in Unified's Allergy API: 16 fields, including created_at, updated_at and patient_id, with types and enum values."
---
# Allergy 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 allergy/intolerance                                       |
| created\_at              | string (date-time)                                                                               | No       | When the allergy record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)        |
| updated\_at              | string (date-time)                                                                               | No       | When the allergy record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)   |
| patient\_id              | string                                                                                           | No       | The patient who has the allergy                                                     |
| encounter\_id            | string                                                                                           | No       | The encounter in which the allergy was recorded                                     |
| practitioner\_id         | string                                                                                           | No       | The practitioner who recorded or asserted the allergy                               |
| name                     | string                                                                                           | No       | Human-readable name of the substance                                                |
| codes                    | [HealthcareCode](https://docs.unified.to/healthcare/allergy/model.md#HealthcareCode)\[\]         | No       | Codings for the substance (e.g. RxNorm, SNOMED CT)                                  |
| codes\[\].system         | string                                                                                           | No       | The code system URI (e.g. http://loinc.org, http://snomed.info/sct)                 |
| codes\[\].code           | string                                                                                           | No       | The code within the system                                                          |
| codes\[\].display        | string                                                                                           | No       | Human-readable display text for the code                                            |
| status                   | enum                                                                                             | No       | Clinical status of the allergy Values: ACTIVE, INACTIVE, RESOLVED, OTHER            |
| type                     | enum                                                                                             | No       | Category of the substance Values: FOOD, MEDICATION, ENVIRONMENT, BIOLOGIC, OTHER    |
| criticality              | enum                                                                                             | No       | Potential severity of future reactions Values: LOW, HIGH, UNABLE\_TO\_ASSESS, OTHER |
| reactions                | [HealthcareCode](https://docs.unified.to/healthcare/allergy/model.md#HealthcareCode)\[\]         | No       | Codings for observed reaction manifestations (e.g. hives, anaphylaxis)              |
| reactions\[\].system     | string                                                                                           | No       | The code system URI (e.g. http://loinc.org, http://snomed.info/sct)                 |
| reactions\[\].code       | string                                                                                           | No       | The code within the system                                                          |
| reactions\[\].display    | string                                                                                           | No       | Human-readable display text for the code                                            |
| onset\_at                | string (date-time)                                                                               | No       | When the allergy was first identified (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)      |
| recorded\_at             | string (date-time)                                                                               | No       | When the allergy was recorded (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)              |
| notes                    | string                                                                                           | No       | Free-text notes about the allergy                                                   |
| metadata                 | [HealthcareMetadata](https://docs.unified.to/healthcare/allergy/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 HealthcareAllergy = {
	id?: string; // Unique identifier for the allergy/intolerance
	created_at?: string-time; // When the allergy record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // When the allergy record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	patient_id?: string; // The patient who has the allergy
	encounter_id?: string; // The encounter in which the allergy was recorded
	practitioner_id?: string; // The practitioner who recorded or asserted the allergy
	name?: string; // Human-readable name of the substance
	codes?: []; // Codings for the substance (e.g. RxNorm, SNOMED CT)
	status?: 'ACTIVE' | 'INACTIVE' | 'RESOLVED' | 'OTHER'; // Clinical status of the allergy
	type?: 'FOOD' | 'MEDICATION' | 'ENVIRONMENT' | 'BIOLOGIC' | 'OTHER'; // Category of the substance
	criticality?: 'LOW' | 'HIGH' | 'UNABLE_TO_ASSESS' | 'OTHER'; // Potential severity of future reactions
	reactions?: []; // Codings for observed reaction manifestations (e.g. hives, anaphylaxis)
	onset_at?: string-time; // When the allergy was first identified (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	recorded_at?: string-time; // When the allergy was recorded (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	notes?: string; // Free-text notes about the allergy
	metadata?: [];
	raw?: any; // Raw data from integration
} 
```

## Zod

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

export const ZodHealthcareAllergy = z.object({
	id: z.string().optional().describe("Unique identifier for the allergy/intolerance"),
	created_at: z.string-time().optional().describe("When the allergy record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("When the allergy record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	patient_id: z.string().optional().describe("The patient who has the allergy"),
	encounter_id: z.string().optional().describe("The encounter in which the allergy was recorded"),
	practitioner_id: z.string().optional().describe("The practitioner who recorded or asserted the allergy"),
	name: z.string().optional().describe("Human-readable name of the substance"),
	codes: z.array().optional().describe("Codings for the substance (e.g. RxNorm, SNOMED CT)"),
	status: z.enum("ACTIVE", "INACTIVE", "RESOLVED", "OTHER").optional().describe("Clinical status of the allergy"),
	type: z.enum("FOOD", "MEDICATION", "ENVIRONMENT", "BIOLOGIC", "OTHER").optional().describe("Category of the substance"),
	criticality: z.enum("LOW", "HIGH", "UNABLE_TO_ASSESS", "OTHER").optional().describe("Potential severity of future reactions"),
	reactions: z.array().optional().describe("Codings for observed reaction manifestations (e.g. hives, anaphylaxis)"),
	onset_at: z.string-time().optional().describe("When the allergy was first identified (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	recorded_at: z.string-time().optional().describe("When the allergy was recorded (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	notes: z.string().optional().describe("Free-text notes about the allergy"),
	metadata: z.array().optional(),

});
```

## Python

```python
import dataclasses

@dataclasses.dataclass
class HealthcareAllergyStatus(str, Enum):
	ACTIVE = 'ACTIVE'
	INACTIVE = 'INACTIVE'
	RESOLVED = 'RESOLVED'
	OTHER = 'OTHER'

@dataclasses.dataclass
class HealthcareAllergyType(str, Enum):
	FOOD = 'FOOD'
	MEDICATION = 'MEDICATION'
	ENVIRONMENT = 'ENVIRONMENT'
	BIOLOGIC = 'BIOLOGIC'
	OTHER = 'OTHER'

@dataclasses.dataclass
class HealthcareAllergyCriticality(str, Enum):
	LOW = 'LOW'
	HIGH = 'HIGH'
	UNABLE_TO_ASSESS = 'UNABLE_TO_ASSESS'
	OTHER = 'OTHER'

@dataclasses.dataclass
class HealthcareAllergy:
	"""Unique identifier for the allergy/intolerance"""
	id: Optional[str]
	"""When the allergy record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""When the allergy record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""The patient who has the allergy"""
	patient_id: Optional[str]
	"""The encounter in which the allergy was recorded"""
	encounter_id: Optional[str]
	"""The practitioner who recorded or asserted the allergy"""
	practitioner_id: Optional[str]
	"""Human-readable name of the substance"""
	name: Optional[str]
	"""Codings for the substance (e.g. RxNorm, SNOMED CT)"""
	codes: Optional[PropertyHealthcareAllergyCodes]
	"""Clinical status of the allergy"""
	status: Optional[HealthcareAllergyStatus]
	"""Category of the substance"""
	type: Optional[HealthcareAllergyType]
	"""Potential severity of future reactions"""
	criticality: Optional[HealthcareAllergyCriticality]
	"""Codings for observed reaction manifestations (e.g. hives, anaphylaxis)"""
	reactions: Optional[PropertyHealthcareAllergyReactions]
	"""When the allergy was first identified (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	onset_at: Optional[str]
	"""When the allergy was recorded (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	recorded_at: Optional[str]
	"""Free-text notes about the allergy"""
	notes: Optional[str]
	metadata: Optional[PropertyHealthcareAllergyMetadata]

```
