Clients in OxygenDispatch represent the hospitals, home-care programmes, and unaffiliated recipients who receive medical gas cylinders. Each client record holds contact and identity information alongside an entity type that classifies the recipient for reporting purposes. A dedicated document-lookup endpoint lets the dispatch creation form auto-fill client details from a single document number, reducing data-entry errors during high-volume dispatch sessions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Janblack07/OxygenDispatch/llms.txt
Use this file to discover all available pages before exploring further.
Client fields
Full legal name or trade name of the client. Maximum 200 characters.
Classification of the recipient. Accepted values:
| Value | Constant | Label |
|---|---|---|
1 | ENTIDAD | Entidad |
2 | INTRADOMICILIARIO_IESS | Intradomiciliario IESS |
3 | NO_AFILIADO_APOYO | No afiliado / Apoyo |
Identity or RUC document number used to identify the client. Maximum 50 characters. This is the value used by the document-lookup endpoint — clients without a document number are excluded from the dispatch create form’s client selector.
Contact phone number. Maximum 50 characters.
Contact email address. Must be a valid email format. Maximum 120 characters.
Physical delivery address. Maximum 255 characters.
Entity types
Entity types are defined by theApp\Enums\EntityType backed enum and control how a dispatch recipient is classified:
entity_type value is copied onto the dispatches.entity_type column. This means historical dispatch reports reflect the classification that was in effect at dispatch time, even if the client’s entity type is later changed. The same three values are used as filter criteria in monthly dispatch volume reports broken down by recipient category.
Creating and editing clients
| Action | Method | Route |
|---|---|---|
| List all clients | GET | /clients |
| Show create form | GET | /clients/create |
| Save new client | POST | /clients |
| Show edit form | GET | /clients/{client}/edit |
| Save updates | PUT | /clients/{client} |
| Delete client | DELETE | /clients/{client} |
store and update actions validate the same set of fields described in Client fields above. A successful create redirects to the client list with a success flash message; a successful update does the same.
Deleting a client sets dispatches.client_id to NULL on all related dispatch records (null-on-delete foreign key constraint) rather than blocking the deletion.
Filtering the client list
GET /clients accepts three optional query parameters that can be combined freely:
Partial, case-insensitive match against
clients.document. For example, document=1234 matches any client whose document number contains 1234.Partial, case-insensitive match against
clients.name.Exact match on the entity type integer value (
1, 2, or 3).withQueryString(). When a search returns no results the view receives a searchStatus = 'error' flag and the message "No se encontraron clientes con esos filtros.".
Client lookup by document
The dispatch creation form supports a fast-fill flow: when a user types a document number, the UI can call this endpoint to retrieve the matching client without navigating away. Endpoint:GET /clients/find-by-document?document={value}
The document parameter is required (string, maximum 50 characters). The lookup performs an exact match against clients.document.
Responses:
id, name, and document fields are returned; the dispatch form uses the id to populate the hidden client_id input and displays name as a confirmation label to the operator.
Dispatches can be created without specifying a client —
client_id is nullable on the dispatches table. When no client is linked, the controller evaluates $client?->entity_type?->value, which resolves to null, so dispatches.entity_type is stored as NULL. This allows ad-hoc or emergency dispatches to be recorded immediately and attributed to a client retrospectively if needed.