Skip to main content

Documentation 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.

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. The 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

Authorization: Bearer <your_jwt_token>
The global TokenValidationHandler validates JWT signature, issuer, audience, and lifetime before any controller action is invoked.

Common Response Envelope

Success
boolean
true when no unhandled exception occurred.
Warning
boolean
true when a business-rule rejection prevented the operation (e.g. the stored procedure returned an error message).
Message
string
Human-readable status message in Spanish.
Data
object | array | integer | null
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 calls Add2(), 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

Full ADM_ATENCIONDTO. Key required fields:
id_paciente
integer
required
Patient for whom the attendance is being opened.
id_tipo_atencion
integer
required
Attendance type (consulta externa, emergencia, etc.).
d_fecha_ingreso
string
required
Attendance date in ISO 8601 format.
id_profesional
integer
required
Attending healthcare professional.
UsuarioCreacion
string
required
Username written to the audit log.

Response

Data
integer
The new id_atencion assigned by the database on a successful insert.
Message
string
"Registro satisfactorio" on success.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/Add \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_paciente": 1042,
    "id_tipo_atencion": 1,
    "id_tipo_paciente": 2,
    "d_fecha_ingreso": "2024-11-15T00:00:00",
    "c_hora_ingreso": "10:00",
    "id_profesional": 7,
    "id_plan_seguro": 3,
    "id_categoria_pago": 1,
    "id_moneda": 1,
    "n_copago_fijo": 25.00,
    "id_tipo_facturacion": 1,
    "f_estado": 1,
    "UsuarioCreacion": "jperez"
  }'
{
  "Success": true,
  "Warning": false,
  "Message": "Registro satisfactorio",
  "Data": 3310
}

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 the d_fecha_registro_1 / d_fecha_registro_2 date-range fields to scope results to a time window.

Request Body

Any subset of ADM_ATENCIONDTO. Common filters:
id_paciente
integer
Filter by patient.
id_profesional
integer
Filter by attending professional.
d_fecha_registro_1
string
Start date (inclusive) for the registration date range.
d_fecha_registro_2
string
End date (inclusive) for the registration date range.
f_estado
integer
1 for open attendances; 0 for closed.

Response

Data
array
Array of ADM_ATENCIONDTO objects matching the filter.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/GetAllFilters \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "d_fecha_registro_1": "2024-11-01T00:00:00",
    "d_fecha_registro_2": "2024-11-30T00:00:00",
    "id_profesional": 7
  }'

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

idPaciente
integer
required
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

Data
array
Array of ADM_ATENCIONDTO objects for the specified patient.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/GetAllPaciente \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '1042'

POST /api/ADM_ATENCION/GetAtencionAllFilters

Returns a summarised, enriched list of attendances for a patient. Unlike GetAllPaciente, 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)

id_paciente
integer
required
The patient whose attendances to retrieve.

Response (ADM_ATENCION_ResponseGetAllActivesDTO)

Data
array
Array of attendance summary objects:
Data[].id_atencion
integer
Attendance primary key.
Data[].d_fecha_registro
string
Registration date.
Data[].c_hora_registro
string
Registration time.
Data[].HClinica
string
Clinical history number (as a string label).
Data[].Paciente
string
Full patient name.
Data[].Garante
string
Guarantor / insurer name.
Data[].Prestacion
string
Benefit / service rendered label.
Data[].TAtencion
string
Resolved attendance type label.
Data[].TPaciente
string
Resolved patient type label.
Data[].Estado
string
Attendance status label (e.g. "Abierto", "Cerrado").
Data[].FEstado
string
Financial status label.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/GetAtencionAllFilters \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "id_paciente": 1042 }'
{
  "Success": true,
  "Warning": false,
  "Message": null,
  "Data": [
    {
      "id_atencion": 3310,
      "d_fecha_registro": "2024-11-15T00:00:00",
      "c_hora_registro": "10:00",
      "HClinica": "5201",
      "Paciente": "QUISPE MAMANI, ANA LUCIA",
      "Garante": "EPS RIMAC",
      "Prestacion": "CONSULTA EXTERNA",
      "TAtencion": "CONSULTA",
      "TPaciente": "ASEGURADO",
      "Estado": "Abierto",
      "FEstado": "Pendiente"
    }
  ]
}

POST /api/ADM_ATENCION/GetById

Retrieves the full ADM_ATENCIONDTO record for a single attendance by its primary key.

Request Body (ADM_ATENCION_RequestDTO)

IdAtencion
integer
required
Primary key of the attendance to retrieve.

Response

Data
array
Single-element array containing the full ADM_ATENCIONDTO for the requested attendance.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/GetById \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "IdAtencion": 3310 }'

POST /api/ADM_ATENCION/Update

Updates an existing attendance record. Uses Update2() 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

Full ADM_ATENCIONDTO with id_atencion set. Include all fields that need to persist — the stored procedure will overwrite existing values.
id_atencion
integer
required
Attendance record to update.
UsuarioCreacion
string
required
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

Message
string
"Registro satisfactorio" on success; Item2 error message with Warning: true on failure.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/Update \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_atencion": 3310,
    "id_paciente": 1042,
    "id_tipo_atencion": 1,
    "id_profesional": 7,
    "d_fecha_cierre": "2024-11-15T00:00:00",
    "c_hora_cierre": "11:45",
    "n_a_total": 150.00,
    "n_p_total": 25.00,
    "n_g_total": 125.00,
    "f_estado": 0,
    "UsuarioCreacion": "jperez"
  }'
{
  "Success": true,
  "Warning": false,
  "Message": "Registro satisfactorio",
  "Data": null
}

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 a c_tipo_pendiente code. Typical flow:
OPEN (f_estado=1)
    ↓  Services rendered and charged
PENDING (c_tipo_pendiente set)
    ↓  Payment collected / authorisation received
CLOSED (f_estado=0, d_fecha_cierre set)
The 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.
Filter by id_usuario to show only the pending items that belong to a specific cashier’s queue, supporting multi-station clinic operations.

Request Body (ADM_ATENCION_PendingRequest)

id_atencion
integer
Specific attendance ID to filter on. Use 0 to query all pending attendances across the filter criteria.
c_tipo_pendiente
string
Pending-state type code. The permissible values are defined in your clinic’s configuration catalogue. Common examples: "C" = cobranza (collection), "A" = autorización.
c_tipo_facturacion
string
Billing document type code, e.g. "B" = Boleta de Venta, "F" = Factura.
c_idioma
string
Language code for generated document output. "ES" = Spanish (default).
id_usuario
integer
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)

Data
array
Array of pending attendance line items, each containing:
Data[].id_moneda
integer
FK to the currency catalogue (e.g. 1 = PEN, 2 = USD).
Data[].id_atencion
integer
Attendance FK.
Data[].t_paciente
string
Full patient name.
Data[].n_historia_clinica
integer
Clinical history number.
Data[].d_fecha_registro
string
Attendance registration date.
Data[].id_tipo_atencion
integer
Attendance type FK.
Data[].id_documento_identidad
integer
FK to the identity-document type catalogue.
Data[].c_documento_identidad
string
Patient identity document number.
Data[].t_adquiriente
string
Acquirer / payer name (for invoice purposes).
Data[].t_direccion
string
Acquirer address.
Data[].id_clasificacion_segus
integer
Fee-schedule classification FK.
Data[].t_clasificacion_segus
string
Resolved fee-schedule classification label.
Data[].id_tarifario_segus
integer
Fee-schedule item FK.
Data[].c_codigo_segus
string
Fee-schedule item code.
Data[].t_descripcion_segus
string
Fee-schedule item description.
Data[].n_precio
decimal
Unit price.
Data[].n_cantidad
decimal
Quantity.
Data[].n_subtotal
decimal
Line sub-total before discounts.
Data[].n_descuento
decimal
Discount amount.
Data[].n_total
decimal
Line total after discount.
Data[].id_profesional
integer
Attending professional FK.
Data[].id_naciones_unidas
integer
FK to the United Nations product/service classification catalogue, used for electronic billing compliance.
Data[].n_copago_fijo
decimal
Fixed co-payment amount.
Data[].n_anticipo
decimal
Advance/prepayment amount already collected.
Data[].n_gravado
decimal
Taxable amount total.
Data[].n_no_grabado
decimal
Non-taxable amount total.
Data[].n_impuesto
decimal
Tax (IGV) amount.
Data[].total
decimal
Grand total amount due.
Data[].id_forma_pago
integer
Payment method FK.
Data[].id_documento_pago
integer
Payment document type FK.

Example

curl -X POST https://your-api-host/api/ADM_ATENCION/GetAtencionPendingAllFilters \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_atencion": 0,
    "c_tipo_pendiente": "C",
    "c_tipo_facturacion": "B",
    "c_idioma": "ES",
    "id_usuario": 12
  }'
{
  "Success": true,
  "Warning": false,
  "Message": null,
  "Data": [
    {
      "id_atencion": 3305,
      "t_paciente": "QUISPE MAMANI, ANA LUCIA",
      "n_historia_clinica": 5201,
      "d_fecha_registro": "2024-11-10T00:00:00",
      "c_documento_identidad": "45678901",
      "t_adquiriente": "QUISPE MAMANI, ANA LUCIA",
      "c_codigo_segus": "700001",
      "t_descripcion_segus": "CONSULTA MÉDICA GENERAL",
      "n_precio": 80.00,
      "n_cantidad": 1.00,
      "n_subtotal": 80.00,
      "n_descuento": 0.00,
      "n_total": 80.00,
      "n_copago_fijo": 25.00,
      "n_gravado": 80.00,
      "n_no_grabado": 0.00,
      "n_impuesto": 14.40,
      "total": 94.40
    }
  ]
}

Build docs developers (and LLMs) love