Medication data model

View field support, webhooks, and list parameters for each integration on the Supported Integrations page.

FieldTypeRequiredDescription
idstringNoUnique identifier for the medication order/prescription
created_atstring (date-time)NoWhen the medication record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atstring (date-time)NoWhen the medication record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
patient_idstringNoThe patient the medication is for
encounter_idstringNoThe encounter in which the medication was ordered
practitioner_idstringNoThe practitioner who prescribed the medication
namestringNoHuman-readable name of the medication
codesHealthcareCode[]NoCodings for the medication (e.g. RxNorm)
codes[].systemstringNoThe code system URI (e.g. http://loinc.org, http://snomed.info/sct)
codes[].codestringNoThe code within the system
codes[].displaystringNoHuman-readable display text for the code
statusenumNoStatus of the medication order Values: DRAFT, ACTIVE, ON_HOLD, COMPLETED, STOPPED, CANCELLED, ENTERED_IN_ERROR, UNKNOWN, OTHER
dosagestringNoFree-text dosage instructions (e.g. "1 tablet by mouth twice daily")
refill_countnumberNoNumber of refills authorized
authored_atstring (date-time)NoWhen the medication was prescribed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
start_atstring (date-time)NoWhen the patient should start taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
end_atstring (date-time)NoWhen the patient should stop taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
notesstringNoFree-text notes about the medication
metadataHealthcareMetadata[]No
metadata[].idstringNo
metadata[].valueobjectNo
metadata[].namespacestringNo
metadata[].formatenumNoValues: TEXT, NUMBER, DATE, BOOLEAN, ARRAY, OBJECT
metadata[].extra_dataobjectNo
metadata[].slugstringNo

TypeScript

TypeScript
export type HealthcareMedication = {
	id?: string; // Unique identifier for the medication order/prescription
	created_at?: string-time; // When the medication record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // When the medication record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	patient_id?: string; // The patient the medication is for
	encounter_id?: string; // The encounter in which the medication was ordered
	practitioner_id?: string; // The practitioner who prescribed the medication
	name?: string; // Human-readable name of the medication
	codes?: []; // Codings for the medication (e.g. RxNorm)
	status?: 'DRAFT' | 'ACTIVE' | 'ON_HOLD' | 'COMPLETED' | 'STOPPED' | 'CANCELLED' | 'ENTERED_IN_ERROR' | 'UNKNOWN' | 'OTHER'; // Status of the medication order
	dosage?: string; // Free-text dosage instructions (e.g. "1 tablet by mouth twice daily")
	refill_count?: number; // Number of refills authorized
	authored_at?: string-time; // When the medication was prescribed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	start_at?: string-time; // When the patient should start taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	end_at?: string-time; // When the patient should stop taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	notes?: string; // Free-text notes about the medication
	metadata?: [];
	raw?: any; // Raw data from integration
} 

Zod

Zod
import { z } from 'zod';

export const ZodHealthcareMedication = z.object({
	id: z.string().optional().describe("Unique identifier for the medication order/prescription"),
	created_at: z.string-time().optional().describe("When the medication record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("When the medication record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	patient_id: z.string().optional().describe("The patient the medication is for"),
	encounter_id: z.string().optional().describe("The encounter in which the medication was ordered"),
	practitioner_id: z.string().optional().describe("The practitioner who prescribed the medication"),
	name: z.string().optional().describe("Human-readable name of the medication"),
	codes: z.array().optional().describe("Codings for the medication (e.g. RxNorm)"),
	status: z.enum("DRAFT", "ACTIVE", "ON_HOLD", "COMPLETED", "STOPPED", "CANCELLED", "ENTERED_IN_ERROR", "UNKNOWN", "OTHER").optional().describe("Status of the medication order"),
	dosage: z.string().optional().describe("Free-text dosage instructions (e.g. "1 tablet by mouth twice daily")"),
	refill_count: z.number().optional().describe("Number of refills authorized"),
	authored_at: z.string-time().optional().describe("When the medication was prescribed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	start_at: z.string-time().optional().describe("When the patient should start taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	end_at: z.string-time().optional().describe("When the patient should stop taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	notes: z.string().optional().describe("Free-text notes about the medication"),
	metadata: z.array().optional(),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class HealthcareMedicationStatus(str, Enum):
	DRAFT = 'DRAFT'
	ACTIVE = 'ACTIVE'
	ON_HOLD = 'ON_HOLD'
	COMPLETED = 'COMPLETED'
	STOPPED = 'STOPPED'
	CANCELLED = 'CANCELLED'
	ENTERED_IN_ERROR = 'ENTERED_IN_ERROR'
	UNKNOWN = 'UNKNOWN'
	OTHER = 'OTHER'

@dataclasses.dataclass
class HealthcareMedication:
	"""Unique identifier for the medication order/prescription"""
	id: Optional[str]
	"""When the medication record was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""When the medication record was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""The patient the medication is for"""
	patient_id: Optional[str]
	"""The encounter in which the medication was ordered"""
	encounter_id: Optional[str]
	"""The practitioner who prescribed the medication"""
	practitioner_id: Optional[str]
	"""Human-readable name of the medication"""
	name: Optional[str]
	"""Codings for the medication (e.g. RxNorm)"""
	codes: Optional[PropertyHealthcareMedicationCodes]
	"""Status of the medication order"""
	status: Optional[HealthcareMedicationStatus]
	"""Free-text dosage instructions (e.g. "1 tablet by mouth twice daily")"""
	dosage: Optional[str]
	"""Number of refills authorized"""
	refill_count: Optional[int]
	"""When the medication was prescribed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	authored_at: Optional[str]
	"""When the patient should start taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	start_at: Optional[str]
	"""When the patient should stop taking the medication (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	end_at: Optional[str]
	"""Free-text notes about the medication"""
	notes: Optional[str]
	metadata: Optional[PropertyHealthcareMedicationMetadata]
Are we missing anything? Let us know
Was this page helpful?