AllergyList
ComplexClinical
<co-allergy-list>AllergyList is the Allergies card: each allergy with type, reaction, severity and status, plus the NKA and not-reviewed states.
import { AllergyList } from 'health-components';
Examples
States
No Known Allergies
Not Reviewed
Read Only
Usage
<AllergyList items={allergies} reviewed="10/09/2026 by Lisa Chen RN" />
When to use
- Chart Allergies section, intake review.
When not to use
- Banners: AllergyBadge.
Variants and states
| Variant | What it is |
|---|---|
| list | Rows with severity tags. |
| NKA | Empty array: green No Known Allergies. |
| not reviewed | undefined: amber warning before prescribing. |
| readOnly | No actions. |
Accessibility
- Severity has icon and word.
Do and don't
- Do: Record "Entered in Error" instead of deleting.
- Don't: Treat an empty list as "no allergies" when nobody asked.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | AllergyItem[] | — | Allergies. `[]` shows No Known Allergies (NKA); `undefined` means not reviewed and shows a warning. Array<{substance, type?, reaction?, severity, onset?, status?}> | [] | undefined |
reviewed | string | none (Not reviewed this visit) | Review date and person ("10/09/2026 by Lisa Chen RN") |
readOnly | boolean | false | Hides Mark Reviewed, Add Allergy and the row menus |
onMarkReviewed | () => void | none | Mark Reviewed clicked |
onAdd | () => void | none | Add Allergy clicked |
onItemAction | (action: AllergyAction, item: AllergyItem) => void | none | A row menu item was chosen |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-allergy-list>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.
Angular template
<co-allergy-list reviewed="…" read-only [items]="items" (co-mark-reviewed)="onMarkReviewed($event.detail)"></co-allergy-list>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | items | Allergies. `[]` shows No Known Allergies (NKA); `undefined` means not reviewed and shows a warning. Array<{substance, type?, reaction?, severity, onset?, status?}> | [] | undefined; default undefined |
| attribute | reviewed | Review date and person ("10/09/2026 by Lisa Chen RN"); default none (Not reviewed this visit) |
| attribute | read-only / readOnly | Hides Mark Reviewed, Add Allergy and the row menus; default false |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-mark-reviewed | Mark Reviewed clicked; default none (React: onMarkReviewed) |
| event | co-add | Add Allergy clicked; default none (React: onAdd) |
| event | co-item-action | A row menu item was chosen; default none (React: onItemAction) |