ClinicQueue
The doctor's live patient queue - a big Call next button, who is called or in the room, and a table of everyone else with call, call again, skip, start, finish and put back actions.
Code
import { ClinicQueue } from "@fadymondy/nasaq/web";<ClinicQueue entries={queue} onAction={async (action, id) => api.queue(action, id)} />Healthcare · beta
Live examples and controls: ClinicQueue in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/clinic-queue.jsonThe order comes from queue-math: urgent first, then appointments, then walk-ins, first come first served in each group. Every move is a row action, so it is also in the row menu, the context menu and the keyboard.
When to use
- The doctor or nurse works through the waiting list.
- Reception calls patients to rooms.
When not to use
- A shared board: use LobbyDisplay.
Import
import { ClinicQueueAction, ClinicQueue } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"Quick start
import { ClinicQueue } from "@fadymondy/nasaq/web";
<ClinicQueue entries={queue} onAction={async (action, id) => api.queue(action, id)} />Anatomy
ClinicQueue data-slot="clinic-queue"
├─ header next in line, QueueLiveIndicator, Call next
├─ alerts error, unanswered call
├─ active cards called and in the room, with their buttons
└─ DataTable ticket, patient, priority, status, wait; rowActionsAPI
Every div prop is passed through unless noted.
| Prop | Type | Default | Description |
|---|---|---|---|
entries | QueueEntry[] | required | The queue. Pass one doctor's entries or all. |
onAction | (action, id?) => Promise<void | { error? }> | required | action is "call-next", "call", "recall", "skip", "start", "finish" or "no-show". |
graceMinutes | number | 5 | Minutes a call may go unanswered before a warning. |
connection, updatedAt | "live" | Live indicator. | |
now | number | Epoch ms for stories. | |
labels | Partial<ClinicQueueLabels> | Override any string. |
Examples
Apply the rules in your handler
import { callNext, skipTicket } from "@fadymondy/nasaq/web";
const change = action === "call-next" ? callNext(list, { room: "1", at: Date.now() }) : skipTicket(list, id);Accessibility
- Actions are buttons with text. The table has a label and row names.
- An unanswered call shows a warning alert with the ticket.
RTL & i18n
- Table columns mirror; tickets stay left to right.
- Strings live in a
STRINGS = { en, ar }object and any of them can be replaced withlabels. The locale comes fromNasaqProvider.
Styling & tokens
- Colours, radii and type come from
--nq-*tokens; nothing is a raw colour. Spacing and alignment use logical classes. - Target
[data-slot="clinic-queue"]and the innerdata-slotparts shown in the anatomy.
Do / Don't
- Do keep the async callbacks honest: return
{ error }so the component can show the message. - Do pass
nowin tests and stories so the output stays the same. - Don't fetch inside the component: it is presentational and takes data and callbacks.
- Don't rely on colour for state: every state also has a word.
Related
Lab
https://docs.nasaqui.com/?path=/docs/components-healthcare-clinic-queue--docs
ClinicDashboard
Front-desk overview with waiting count and longest wait, doctors on duty, room use, a card per room and a row per doctor, each state shown with an icon and a word.
ClinicSchedule
A doctor's day on a timeline, with each appointment named and coloured by status, a summary by status, an in-visit card, the next patient with lateness and an overlap warning.