The queue tracks the visit, not the entitlement. A benefit instance’s own
status (
benefit_entities.status) says whether a member is entitled; the
queue says where they are in today’s process. They are separate on purpose —
see Why not a benefit status.A consumer admits; an operator advances. Rows are created automatically
when a benefit instance is created, and moved through the workflow by clinic
staff.Row shape
The workflow
CREATED— admitted; the member is expected but has not arrived.IN_PROGRESS— the member has reached the clinic and is being seen.COMPLETED— terminal.
CREATED → COMPLETED directly is allowed, so an operator correcting a row that
was never a real visit does not have to click through the check-in step.
The permitted edges are configuration, not code — served per
benefit_type and benefit_id, so one clinic can narrow its own workflow
without a release. A refused transition returns 400 with CQE_1905.Admission
Listing
Responses use the standard
{ data, total, limit, offset } envelope.
Advancing a row
200 and the unchanged row.
Why not a benefit status
The obvious-looking alternative is a new value onbenefit_entities.status.
It was considered and rejected for three reasons.
One entitlement can produce several visits
One entitlement can produce several visits
A member who no-shows and returns next week is a second visit against the
same entitlement. Encoded as a status, the first visit is overwritten, and
“no-showed, then returned” cannot be represented at all.
The two states the queue distinguishes collapse to one
The two states the queue distinguishes collapse to one
An insurance policy that is
Pending and one that is under Verification
both project onto the same benefit status. The ledger literally cannot tell
“waiting” from “at the clinic” — the distinction the queue exists to make.A front-desk click would sit on a column that moves money
A front-desk click would sit on a column that moves money
A benefit instance going
ACTIVE is one of the two preconditions for
autopay. Putting the queue’s workflow on that column would let a
receptionist’s action start a payment flow.