TheDocumentation 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.
ADM_PACIENTE controller is the central hub for all patient demographic management within Gestión Clínica. It supports the full lifecycle of a patient record — from initial registration with duplicate-detection, through searching by flexible filters, to soft deletion — as well as a rich combined query that returns both patient demographics and their associated attendance history in a single call. A companion controller, ADM_PACIENTECONSULTADNI, integrates with an external Peruvian DNI verification service so that staff can auto-populate demographic data directly from RENIEC without manual data entry. Every endpoint in both controllers requires a valid JWT bearer token.
All routes follow the pattern
POST /api/{controller}/{action}. The API does not use GET requests — even read operations are POST so that filter payloads can be sent in the request body.Authentication
Every request must include aBearer token in the Authorization header. The server validates the JWT signature, issuer, audience, and expiry on every call via a global TokenValidationHandler. Missing or invalid tokens receive an HTTP 401 Unauthorized response before the controller action is reached.
Common Response Envelope
All endpoints return the sameJsonResponse wrapper:
true when the operation completed without an unhandled exception. Note that Success: true with Warning: true means the business rule rejected the request (e.g., duplicate record).true when a non-fatal business rule was triggered (duplicate patient, missing record, etc.). The Message field contains a human-readable explanation.Human-readable status message in Spanish (e.g.,
"Registro satisfactorio", "Ya existe el registro").The operation payload.
null for write operations that do not return data; an array of DTOs for queries; the new record ID (integer) for Add.ADM_PACIENTEDTO — Field Reference
TheADM_PACIENTEDTO object is used as both the request body for write operations and the element type in list responses. It extends EntityAuditableDTO, which contributes audit fields shared across the entire API.
POST /api/ADM_PACIENTE/Add
Registers a new patient in the system. Before inserting, the business layer callsExists() to check for duplicate records. If a duplicate is found the response returns Success: true, Warning: true with the message "Ya existe el registro" — no insert occurs. On a successful insert, Data is null; the new record ID is not returned by this endpoint.
Request Body
Send a fullADM_PACIENTEDTO object. All identity and contact fields listed above are accepted. Key required fields:
Paternal surname. Used in the duplicate-existence check.
Maternal surname.
Given names.
Identity-document type FK.
Identity-document number.
Date of birth in ISO 8601 format.
Username performing the action — written to the audit log.
Response
true if no unhandled exception occurred.true when a duplicate patient was detected ("Ya existe el registro")."Registro satisfactorio" on success, or an error/warning description.Always
null. This endpoint does not return the new record ID.Example
POST /api/ADM_PACIENTE/GetAllFilters
Returns a list of patient records filtered by the non-null / non-zero fields in the request body. The business layer builds a dynamic SQL query using the providedADM_PACIENTEDTO fields as filter criteria. Send only the fields you want to filter by; unused fields should be omitted or set to their zero-values.
Request Body
Any subset ofADM_PACIENTEDTO fields. Common filter patterns:
Filter by paternal surname (typically an exact or
LIKE match depending on the stored procedure).Filter by document number — useful for quick patient lookup.
1 to return only active patients; 0 for inactive. Omit to return all.Filter on the full concatenated name field.
Response
Array of
ADM_PACIENTEDTO objects matching the filter criteria. Returns an empty array when no records match.Example
POST /api/ADM_PACIENTE/GetById
Retrieves full details for a single patient by their primary key.Request Body
The surrogate key of the patient to retrieve.
Response
Single-element array containing the full
ADM_PACIENTEDTO for the requested patient.Example
POST /api/ADM_PACIENTE/Update
Updates an existing patient record. The entireADM_PACIENTEDTO object (including all fields to be retained) should be provided. The business layer calls Update() which returns an integer row-count; a count of 0 sets Warning: true.
Request Body
FullADM_PACIENTEDTO including id_paciente (required to identify the record) and UsuarioModificacion.
Identifies the patient record to update.
Username performing the update — written to the audit log.
Response
"Actualización satisfactoria" on success; "Actualización fallida" with Warning: true if no rows were affected.Example
POST /api/ADM_PACIENTE/Delete
Marks a patient record as deleted. The business layer callsDelete() and checks the integer row-count; a count of 0 sets Warning: true.
Request Body
The primary key of the patient to delete.
Username performing the deletion — written to the audit log.
Response
"Eliminación satisfactoria" on success; "Eliminación fallida" with Warning: true otherwise.Example
POST /api/ADM_PACIENTE/GetAllPacienteAtencionFilters
This endpoint performs a combined patient + attendance search and is the primary entry point for the clinic reception workflow. It accepts a single search string (t_dato) along with a type discriminator (tipo_dato) and returns a rich payload that joins patient demographics with their attendance history. The search string is automatically converted to uppercase before querying.
Request Body (ADM_PACIENTEATENCIONReqDTO)
The value to search for. The controller calls
.ToUpper() on this string before passing it to the business layer — you may send mixed-case values safely.Specifies the semantic meaning of
t_dato. Accepted values:| Code | Meaning |
|---|---|
F | Full name (t_paciente field) |
P | Patient ID (id_paciente) |
H | Clinical history number |
C | Identity document number |
Response
When no records match,Data is an empty array and Message is set to "No existe información con los datos enviados.".
Array of
ADM_PACIENTEATENCIONResDTO objects. Each element contains the full patient demographic block plus the associated attendance record fields.Example
POST /api/ADM_PACIENTECONSULTADNI/GetPacienteConsultaDNI
Queries the external Peruvian RENIEC/DNI verification service configured in the application’sWeb.config (UrlServicioConsultaDNI + TokenConsultaDNI). The API constructs the external URL as {UrlServicioConsultaDNI}?dni={dni}&token={TokenConsultaDNI}, calls it via an HTTP GET, and deserializes the response back to the client. This avoids exposing the service token to the front-end.
Request Body (ADM_PACIENTE_CONSULTADTO)
Eight-digit Peruvian DNI number to look up.
Response
Deserialized response from the external DNI service, shaped as
ADM_PACIENTE_CONSULTADTO:The queried DNI number (echoed back).
Paternal surname as registered in RENIEC.
Maternal surname as registered in RENIEC.
Given names as registered in RENIEC.
Registered domicile address from RENIEC.