In the Peruvian health system, clinics enter formal agreements (convenios) with insurance providers (SEGUS — Seguros) that are regulated and monitored by SUSALUD (Superintendencia Nacional de Salud). Each agreement is represented in Gestión Clínica as a CVN_PLAN_SEGURO record — the insurance plan master — which links a guarantor contact, a contracting party, a payment category, and an optional insurance product. The plan is bounded by a contractual validity window (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.
d_fecha_i_vigencia / d_fecha_f_vigencia) and carries IAFA classification codes required for SUSALUD compliance reporting. Plan line items — the individual covered benefits, co-payment amounts, and currency rules — live in the child table CVN_PLAN_SEGURO_DETALLE. The CVN_PRODUCTO_PLAN table lets you associate specific product offerings to a plan, and CVN_BENEFICIO provides the master catalog of healthcare benefits that can be included in plan details.
Common Response Envelope
Every endpoint in the Gestión Clínica API returns the sameJsonResponse wrapper:
| Field | Type | Description |
|---|---|---|
Success | boolean | true when the operation completed without an unhandled exception. |
Warning | boolean | true when the operation completed but a business rule was violated. |
Message | string | Human-readable result message (Spanish). |
Data | any | Payload returned for read operations; null for mutations. |
CVN_PLAN_SEGURO Endpoints
POST /api/CVN_PLAN_SEGURO/Add
Creates a new insurance plan record. Before inserting, the business layer callsCVN_PLAN_SEGUROBL.Instancia.Exists() to detect duplicates — if a matching record already exists the response is returned with Warning: true and the plan is not created.
A duplicate check is performed before every insert. If
Warning: true is returned alongside Success: true, no record was written — inspect Message for the reason (typically "Ya existe el registro").CVN_PLAN_SEGURODTO
ID of the guarantor contact (insurance company) from the contacts master.
ID of the contracting party (employer, fund, or individual) contact.
ID of the payment category (
CVN_CATEGORIA_PAGO) that defines price factors for this plan.ID of the insurance product (
CVN_PRODUCTO_PLAN) associated with this plan.Short alphanumeric code that uniquely identifies the plan.
Full descriptive name of the plan.
Free-text observation or internal notes.
IAFA code required by SUSALUD for regulatory reporting.
Plan validity start date (
YYYY-MM-DD).Plan validity end date (
YYYY-MM-DD).Contract reference number.
Certificate reference number.
Status flag:
1 = active, 0 = inactive.Username of the authenticated user creating the record (audit field).
Numeric user ID of the creator (audit field).
POST /api/CVN_PLAN_SEGURO/GetAllFilters
Returns a filtered list of insurance plans. Pass any combination ofCVN_PLAN_SEGURODTO fields as filter criteria; the business layer builds a dynamic query from non-null values.
Free-text search value applied across searchable text columns.
Filter by status:
1 active, 0 inactive. Omit to return all statuses.Filter by payment category ID.
POST /api/CVN_PLAN_SEGURO/GetAllActives
Returns all active insurance plans without any filter criteria. Send an empty JSON body{}.
Example request
POST /api/CVN_PLAN_SEGURO/GetById
Retrieves a single plan record by its primary key.Primary key of the insurance plan to retrieve.
POST /api/CVN_PLAN_SEGURO/Update
Updates an existing insurance plan. Send the fullCVN_PLAN_SEGURODTO object including the id_plan_seguro primary key and the UsuarioModificacion / id_usuarioModifica audit fields.
Primary key of the plan to update.
Username of the user performing the update (audit field).
Numeric user ID of the modifier (audit field).
CVN_PLAN_SEGURO Response Fields
When plan records are returned inData, each object exposes the following fields:
Auto-generated primary key of the insurance plan.
Plan code.
Plan description / name.
IAFA regulatory code.
Validity start date (ISO 8601).
Validity end date (ISO 8601).
Contract reference number.
Certificate reference number.
Resolved name of the guarantor contact (denormalized for display).
Resolved name of the contracting party (denormalized for display).
Resolved product name from
CVN_PRODUCTO_PLAN (denormalized for display).Human-readable status label (e.g.,
"Activo" / "Inactivo").Raw status flag:
1 = active, 0 = inactive.CVN_PLAN_SEGURO_DETALLE Endpoints
Plan details store the benefit-level coverage rules for each plan — which benefits are covered, the co-payment amounts (fixed and variable), and the currency applicable. The detail table is a child ofCVN_PLAN_SEGURO joined via id_plan_seguro.
POST /api/CVN_PLAN_SEGURO_DETALLE/Add
Adds a benefit detail line to an existing insurance plan. Performs a duplicate check before inserting; returns the new detail’sid_plan_seguro_detalle in Data on success.
A duplicate check runs before every insert. If
Warning: true is returned, the benefit line was not added — it already exists for this plan.Parent plan ID to which this benefit detail belongs.
Benefit ID from the
CVN_BENEFICIO catalog.Currency ID from the
CVN_MONEDA catalog (e.g., Soles or USD).Fixed co-payment amount in the specified currency.
Variable co-payment percentage applied to the service cost.
Variable co-payment percentage applied specifically to pharmacy charges.
Status flag:
1 = active, 0 = inactive.Audit: username of the record creator.
POST /api/CVN_PLAN_SEGURO_DETALLE/Delete
Performs a logical or physical deletion of a plan benefit detail line.Primary key of the detail record to delete.
Audit: username of the user performing the deletion.
POST /api/CVN_PLAN_SEGURO_DETALLE/GetAllActivesFilters
Returns all active benefit detail lines for a given plan, optionally filtered by benefit or currency.Parent plan ID whose detail lines should be retrieved.
Optionally filter by a specific benefit.
Related Catalog Endpoints
CVN_BENEFICIO — Benefit Catalog
The benefit catalog (CVN_BENEFICIO) lists all healthcare services and coverages that can be assigned to a plan detail line. Use the following endpoint to populate benefit selection lists in the UI.
POST /api/CVN_BENEFICIO/GetAllActives — Returns all active benefits. Send an empty body {}.
CVN_PRODUCTO_PLAN — Plan Products
The plan product table (CVN_PRODUCTO_PLAN) represents specific insurance product offerings that can be linked to insurance plans. Two endpoints are available:
POST /api/CVN_PRODUCTO_PLAN/GetAllActives — Returns the complete list of active plan products (empty body).
POST /api/CVN_PRODUCTO_PLAN/GetAllActivesFilters — Returns filtered plan products.
Filter by specific product ID.
Audit Fields (EntityAuditableDTO)
All mutable DTOs extendEntityAuditableDTO. Include these fields in every create/update request:
| Field | Type | Description |
|---|---|---|
UsuarioCreacion | string | Username of the record creator. |
UsuarioModificacion | string | Username of the last modifier. |
id_usuarioCreacion | integer | Numeric user ID of the creator. |
id_usuarioModifica | integer | Numeric user ID of the last modifier. |
FechaCreacion | datetime | Set automatically by the server. |
FechaModificacion | datetime | Set automatically by the server. |