const { data: allergy } = await clinik.allergies.create({
patientId: 'pt_abc123',
clinicalStatus: 'active',
verificationStatus: 'confirmed',
type: 'allergy',
category: ['medication'],
criticality: 'high',
code: {
system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
code: '7980',
display: 'Penicillin',
},
onsetDateTime: '2019-06-15',
recordedDate: '2024-01-10',
recorderId: 'pract_dr456',
reaction: [
{
substance: 'Amoxicillin',
manifestation: ['Hives', 'Angioedema'],
severity: 'severe',
onset: '2019-06-15T14:30:00Z',
exposureRoute: 'Oral',
note: 'Patient developed hives within 30 minutes of first dose.',
},
],
note: 'Confirmed penicillin allergy — avoid all beta-lactam antibiotics.',
});