Every endpoint in the Gestión Clínica API — whether it creates a patient record, retrieves a list of insurance plans, or authenticates a user — returns the same JSON envelope. This uniformity means client code never needs to check HTTP status codes or parse exception bodies: all outcome signals live inside a predictable top-level object calledDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ttpullima/RomsoftBackEnd2021_v2/llms.txt
Use this file to discover all available pages before exploring further.
JsonResponse, defined in Romsoft.GESTIONCLINICA.Common.
Envelope Fields
Indicates whether the operation completed without a server-level error. A value of
true does not necessarily mean the business action succeeded — check Warning for that distinction. A value of false means an unhandled exception occurred; the client should show the Message and retry later.Raised to
true when the request was processed without error but a business rule prevented the desired change — for example, a duplicate patient record was detected or a related record would be orphaned. When Warning is true, Success is still true and Message contains the reason in Spanish.A human-readable explanation in Spanish. Present on warnings (
Warning=true) and errors (Success=false). Typically absent (null or empty string) on clean success responses. All standard messages are defined as static strings in Romsoft.GESTIONCLINICA.WebApi.Core.Mensajes.The payload of the response. Can be a single object, an array, a primitive value, or
null. The shape depends entirely on the endpoint — refer to each controller’s action documentation for the concrete type.The
Warning flag is the key to the three-outcome model. A false/false combination (no success, no warning) only occurs during unhandled exceptions. Any situation the business logic explicitly anticipates — duplicates, missing references, validation failures — is expressed as Success=true, Warning=true so the client knows the server is healthy and can display the reason message without treating it as an infrastructure failure.Response Scenarios
1. Clean Success
The operation completed and the payload is inData. Message is typically the localised confirmation string (e.g., "Se registró satisfactoriamente.").
Data field carries the result set:
2. Business Rule Warning
The request was valid and the server is healthy, but the action was blocked by a domain rule.Success remains true so the client knows this is an expected outcome, not an infrastructure failure.
Mensajes.cs:
| Scenario | Message |
|---|---|
| Duplicate record | "El registro ya existe." |
| Dependent data prevents deletion | "Hay datos que dependen de él, elimínelos para que pueda eliminar este registro." |
| Only one active allowed | "Solo puede haber un activo." |
| Registration failed (DB-level) | "No se pudo realizar el registro." |
3. Server / Exception Error
An unhandled exception was caught in the controller’scatch block. Success is false. LogError(ex) has already written the full stack trace to the log4net rolling file. The client receives a generic message and should not retry automatically.
C# Source Definition
TheJsonResponse class in Romsoft.GESTIONCLINICA.Common/JsonResponse.cs is minimal by design:
Paginated Endpoints
Endpoints that return potentially large result sets accept aPaginationParameter object in the POST body. The BL layer passes this to GetAllPaging on the repository, which translates the parameters into SQL OFFSET/FETCH or equivalent logic in the stored procedure.
Data field: