The pharmacy module (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.
FAR_*) is the backbone of Gestión Clínica’s drug and medical supply inventory. Every item dispensed from the clinic’s pharmacy — prescription medications, over-the-counter drugs, surgical supplies, and medical equipment — is represented as a FAR_PRODUCTO record. Products are richly described with pricing tiers, stock thresholds, regulatory codes (GTIN / UNSPSC), and linkages to the catalog reference tables (generic name, drug class, therapeutic family, typification, and product type). The three endpoints on FAR_PRODUCTOController cover the full write lifecycle — creation, update, and retrieval — and all of them require a valid bearer token in the Authorization header.
All
FAR_PRODUCTO endpoints are HTTP POST and expect a JSON body. Responses are wrapped in a JsonResponse envelope with Success (boolean), Message (string), optionally Warning (boolean), and Data (payload).Endpoints
POST /api/FAR_PRODUCTO/Add
Creates a new pharmaceutical product and returns its generated database ID.
Internally the controller maps FAR_PRODUCTOReqDTO → FAR_PRODUCTOReq and calls FAR_PRODUCTOBL.Instancia.Add2(), which returns a Tuple<int, string>. When Item1 > 0 the operation succeeded and Data is set to the new product’s id_producto. If Item1 == 0 the response carries Warning: true and Message contains the server-side error text from Item2.
Request body — FAR_PRODUCTOReqDTO
Response
Data contains the integer id_producto of the newly created record.
curl example
POST /api/FAR_PRODUCTO/Update
Updates an existing pharmaceutical product record. The request body is identical to the Add endpoint (FAR_PRODUCTOReqDTO) — populate id_producto with the target record’s ID. Internally calls FAR_PRODUCTOBL.Instancia.Update2().
A successful update returns an empty Data field; Message carries "Registro satisfactorio". On failure Warning: true and the business-layer message are returned.
Request body — same fields as Add (see above); id_producto must be a valid existing ID.
Response (success)
POST /api/FAR_PRODUCTO/GetById
Retrieves the full detail record for a single product by its primary key. The integer idProducto is passed as a query-string parameter on the POST request (the controller binds it from the URL, not from the JSON body).
Query parameter
The primary key of the product to retrieve (
id_producto).FAR_PRODUCTOByIdResDTO
curl example
Consignment Stock (FAR_CONSIGNACION)
Products can be linked to a consignment arrangement through the id_consignacion field on FAR_PRODUCTOReqDTO. Consignment in this context means the clinic holds supplier stock without having purchased it outright — payment is triggered only on actual dispensing. The FAR_CONSIGNACION table maintains a catalogue of these consignment arrangements; populate id_consignacion with 0 for products that are owned inventory.
Common Response Envelope
All responses from this controller share the same wrapper:| Field | Type | Description |
|---|---|---|
Success | boolean | true if no unhandled exception occurred. |
Warning | boolean | true when a business rule prevented the operation. |
Message | string | Human-readable result or error message (Spanish). |
Data | any | Payload; id_producto on Add, DTO array on GetById. |
All endpoints require an
Authorization: Bearer {token} header. Unauthenticated requests are rejected at the BaseController level before reaching any action method.