Data model
The visit lifecycle
A data model of the states a visit moves through across its course, and the events that carry it between those states.
A visit moves through a small set of states across its course. This page is the data model of those states, and of the events that carry a visit from one state to the next. Gate runs the lifecycle from arrival to discharge.
The states
A visit holds one of four states at any moment. Two are working states, and two are final.
| State | What it means | Final |
|---|---|---|
| Registered | The visit is open and pre-clinical. The patient is registered or scheduled. | no |
| Ongoing | Clinical contact has been made, and care is under way. | no |
| Completed | The visit has finished and the patient has left. | yes |
| Cancelled | A registered visit was cancelled before any service was used. | yes |
A visit in Registered or Ongoing counts as active, which is the platform's way of saying the patient is currently here.
Moving between states
Each move is an event that carries the visit forward. The events read plainly, and each one writes its own stamp on the record.
| From | To | What carries it |
|---|---|---|
| New | Registered | Registration or a converted appointment opens the visit. |
| Registered | Ongoing | The first clinical contact begins the visit. |
| Registered | Cancelled | The visit is cancelled before any service is used. |
| Registered | Completed | The visit closes with no clinician contact: a patient brought in deceased, a patient who leaves before care, or a self-referred or outpatient lab-only visit that finishes on its own. |
| Ongoing | Completed | Discharge closes the visit. |
Opening the visit
A visit is born Registered. The patient is registered or scheduled, and the visit is open but pre-clinical. Registration and admissions both land here, and a converted appointment lands here too.
Reaching the patient
When the first clinical contact is made, the visit becomes Ongoing. Care is under way, and clinical work records against the open visit. This is the state most of a stay sits in.
Closing the visit
Discharge carries an ongoing visit to Completed. Discharge asks for two things together: clinical readiness, and an account that is settled or arranged. Read discharge for the clinical side and the discharge finance gate for the account side.
A registered visit can also close directly, with no clinician contact, for a patient brought in deceased, a patient who leaves before care, or a self-referred or outpatient lab-only visit that finishes on its own.
Cancelling before care
A registered visit that used no service can be cancelled. Cancelled is reachable only from Registered. An ongoing visit is discharged rather than cancelled, because care has already begun.
Final states hold, and each move leaves a trail
Completed and Cancelled are final. A finished visit stays as it settled. Each move writes an audit entry in the same transaction as the change, so a committed change always carries its trail and the visit's course stays reconstructable.
Common questions
Can a completed visit reopen?
A completed visit stays completed. A fresh contact opens a new visit against the same record, so the history reads as a sequence of visits rather than one that reopens.
Can an ongoing visit be cancelled?
An ongoing visit is discharged rather than cancelled. Cancellation covers a registered visit that used no service, before care began.
Read visits and encounters to see what the record hangs on each visit.