An atención (attendance) in Gestión Clínica is the core transactional record that ties a patient to a specific clinical visit — capturing the date, time, attending professional, insurance coverage details, diagnosis, co-payment amounts, and billing state. 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_ATENCION controller exposes seven endpoints covering creation, retrieval, and update of attendance records, including a dedicated pending-attendance workflow that allows billing staff to filter outstanding items by type, billing category, language, and user. All endpoints use POST and return the standard JsonResponse envelope. A valid JWT bearer token is required on every call.
Unlike the patient
Add endpoint, ADM_ATENCION/Add does not perform a duplicate-existence check before inserting. It directly calls Add2(), which returns a Tuple<int, string> — Item1 is the new attendance ID on success; Item2 carries any server-side error message on failure.Authentication
TokenValidationHandler validates JWT signature, issuer, audience, and lifetime before any controller action is invoked.
Common Response Envelope
true when no unhandled exception occurred.true when a business-rule rejection prevented the operation (e.g. the stored procedure returned an error message).Human-readable status message in Spanish.
For
Add: the new id_atencion integer. For queries: an array of DTOs. For Update: null.ADM_ATENCIONDTO — Field Reference
ADM_ATENCIONDTO is both the request body for write operations and the element type in most query responses. It inherits EntityAuditableDTO audit fields.
POST /api/ADM_ATENCION/Add
Creates a new attendance record for a patient. The business layer callsAdd2(), which returns a Tuple<int, string>. When Item1 > 0 the insert succeeded and Data is set to the new id_atencion; otherwise Warning: true is returned with Item2 as the error message.
Request Body
FullADM_ATENCIONDTO. Key required fields:
Patient for whom the attendance is being opened.
Attendance type (consulta externa, emergencia, etc.).
Attendance date in ISO 8601 format.
Attending healthcare professional.
Username written to the audit log.
Response
The new
id_atencion assigned by the database on a successful insert."Registro satisfactorio" on success.Example
POST /api/ADM_ATENCION/GetAllFilters
Returns a filtered list of attendance records using the non-null / non-zero fields of the request body as query criteria. Use thed_fecha_registro_1 / d_fecha_registro_2 date-range fields to scope results to a time window.
Request Body
Any subset ofADM_ATENCIONDTO. Common filters:
Filter by patient.
Filter by attending professional.
Start date (inclusive) for the registration date range.
End date (inclusive) for the registration date range.
1 for open attendances; 0 for closed.Response
Array of
ADM_ATENCIONDTO objects matching the filter.Example
POST /api/ADM_ATENCION/GetAllPaciente
Returns all attendance records for a single patient, passed as a plain integer query parameter in the request body.Request Body
The
id_paciente whose attendances should be retrieved.This endpoint accepts a bare
int (idPaciente) directly in the body, not wrapped in a DTO. Send Content-Type: application/json with the integer value, e.g. 5 or a JSON object {"idPaciente": 1042} depending on your ASP.NET model binding setup. Test with both forms if you encounter binding errors.Response
Array of
ADM_ATENCIONDTO objects for the specified patient.Example
POST /api/ADM_ATENCION/GetAtencionAllFilters
Returns a summarised, enriched list of attendances for a patient. UnlikeGetAllPaciente, the result is shaped as ADM_ATENCION_ResponseGetAllActivesDTO — a compact view designed for display in patient history grids, with resolved labels for patient name, guarantor, and status flags.
Request Body (ADM_ATENCION_RequestGetAllActiveDTO)
The patient whose attendances to retrieve.
Response (ADM_ATENCION_ResponseGetAllActivesDTO)
Array of attendance summary objects:
Attendance primary key.
Registration date.
Registration time.
Clinical history number (as a string label).
Full patient name.
Guarantor / insurer name.
Benefit / service rendered label.
Resolved attendance type label.
Resolved patient type label.
Attendance status label (e.g.
"Abierto", "Cerrado").Financial status label.
Example
POST /api/ADM_ATENCION/GetById
Retrieves the fullADM_ATENCIONDTO record for a single attendance by its primary key.
Request Body (ADM_ATENCION_RequestDTO)
Primary key of the attendance to retrieve.
Response
Single-element array containing the full
ADM_ATENCIONDTO for the requested attendance.Example
POST /api/ADM_ATENCION/Update
Updates an existing attendance record. UsesUpdate2() which also returns a Tuple<int, string>. A return of Item1 > 0 indicates success; otherwise Warning: true is set with Item2 as the message.
Request Body
FullADM_ATENCIONDTO with id_atencion set. Include all fields that need to persist — the stored procedure will overwrite existing values.
Attendance record to update.
Username written to the audit log (note: the audit log uses
UsuarioCreacion even for updates in this controller — a known quirk of the implementation).Response
"Registro satisfactorio" on success; Item2 error message with Warning: true on failure.Example
POST /api/ADM_ATENCION/GetAtencionPendingAllFilters
Retrieves attendances that are in a pending state, filtered by attendance ID, pending type, billing type, language, and user. This endpoint powers the billing and cashier workflows, where staff need to see all outstanding items that require collection or authorisation before closure.Pending Attendance Workflow
Attendances progress through states tracked by ac_tipo_pendiente code. Typical flow:
c_tipo_pendiente code indicates why the attendance is pending, and c_tipo_facturacion determines the billing document to generate (e.g. boleta vs. factura). Language code c_idioma controls the language of any generated documents.
Request Body (ADM_ATENCION_PendingRequest)
Specific attendance ID to filter on. Use
0 to query all pending attendances across the filter criteria.Pending-state type code. The permissible values are defined in your clinic’s configuration catalogue. Common examples:
"C" = cobranza (collection), "A" = autorización.Billing document type code, e.g.
"B" = Boleta de Venta, "F" = Factura.Language code for generated document output.
"ES" = Spanish (default).User ID of the cashier or billing staff member. Filters results to the items assigned to or created by this user.
Response (ADM_ATENCION_PendingResponseDTO)
Array of pending attendance line items, each containing:
FK to the currency catalogue (e.g.
1 = PEN, 2 = USD).Attendance FK.
Full patient name.
Clinical history number.
Attendance registration date.
Attendance type FK.
FK to the identity-document type catalogue.
Patient identity document number.
Acquirer / payer name (for invoice purposes).
Acquirer address.
Fee-schedule classification FK.
Resolved fee-schedule classification label.
Fee-schedule item FK.
Fee-schedule item code.
Fee-schedule item description.
Unit price.
Quantity.
Line sub-total before discounts.
Discount amount.
Line total after discount.
Attending professional FK.
FK to the United Nations product/service classification catalogue, used for electronic billing compliance.
Fixed co-payment amount.
Advance/prepayment amount already collected.
Taxable amount total.
Non-taxable amount total.
Tax (IGV) amount.
Grand total amount due.
Payment method FK.
Payment document type FK.