MELIKA maintains a curated medications catalog that serves as the reference source for prescriptions written inside clinical records. Every medication is classified as either over-the-counter (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Imjuanisss/proyecto-melika/llms.txt
Use this file to discover all available pages before exploring further.
OTC) or prescription-only (Rx), linked to a medical specialty via id_especialidad, and searchable by commercial name or active ingredient. When a doctor prescribes during a consultation, the prescription text is stored in the medicamentos_recetados JSONB field of the historias_clinicas record, while structured per-drug rows go into the separate recetas_medicas table.
Medication Types
OTC — Over the Counter
Medications available without a prescription. Visible to all authenticated users in the catalog. Examples include common analgesics, antipyretics, and supplements.
Rx — Prescription Only
Medications that require a doctor’s prescription. Typically specialized or controlled substances. Only dispensed through a formal clinical record prescription.
Medication Data Model
| Field | Type | Description |
|---|---|---|
id | integer | Unique medication identifier |
nombre_comercial | varchar | Brand / commercial name (e.g., "Advil") |
principio_activo | varchar | Active pharmaceutical ingredient (e.g., "Ibuprofeno") |
laboratorio | varchar | Manufacturing laboratory or pharmaceutical company |
tipo | enum | 'OTC' or 'Rx' |
descripcion | text | Therapeutic description and indications |
presentaciones | text | Available forms and dosages (e.g., "Tabletas 200mg, 400mg, 600mg") |
imagen_url | varchar | URL to the medication’s product image |
id_especialidad | integer | FK linking the medication to a medical specialty |
activo | boolean | When FALSE, excluded from catalog and availability queries |
Querying the Medications Catalog
Filtered Listing
The main catalog endpoint supports three independent, combinable query parameters:- Filter by Type
- Filter by Specialty
- Search by Name
- Combined Filters
Return only OTC or only Rx medications. The
tipo parameter is validated against the set ['OTC', 'Rx'] — any other value is ignored.Single Medication
Retrieve full details for a specific active medication by ID:404 if the medication does not exist or has activo = FALSE.
Specialty Categories Listing
Returns the distinct specialty names that have at least one active medication linked to them. Use this to populate specialty-based filter labels in the catalog UI.especialidades.nombre dynamically via a JOIN on medicamentos.id_especialidad. Only specialties with at least one medication where activo = TRUE appear.
Example response:
This endpoint returns specialty names as plain strings, not full specialty objects. Use
GET /especialidades when you need full specialty records including id, precio_base, and imagen_url.Sample Medications in the Catalog
The following are representative medications available across the platform’s specialties:| Nombre Comercial | Principio Activo | Tipo | Specialty |
|---|---|---|---|
| Acetaminofén jarabe | Paracetamol | OTC | Medicina General |
| Ácido fólico | Ácido fólico | OTC | Ginecología |
| Amoxicilina | Amoxicilina | Rx | Medicina General |
| Atorvastatina | Atorvastatina cálcica | Rx | Cardiología |
| Ibuprofeno | Ibuprofeno | OTC | Medicina General |
| Losartán | Losartán potásico | Rx | Cardiología |
| Metformina | Metformina clorhidrato | Rx | Medicina General |
| Gabapentina | Gabapentina | Rx | Neurología |
| Tamsulosina | Tamsulosina clorhidrato | Rx | Urología |
Medications in Clinical Records
When a doctor prescribes during a consultation, prescriptions are captured in two complementary ways:medicamentos_recetados(JSONB onhistorias_clinicas) — stores a free-text prescription summary as{ "texto": "..." }.recetas_medicastable — stores structured per-drug rows submitted via therecetasarray inPOST /historias.
recetas_medicas contains:
| Field | Description |
|---|---|
medicamento | Drug name |
dosis | Dose amount |
frecuencia | Dosing frequency |
duracion | Treatment duration |
via_administracion | Route of administration (optional) |
indicaciones | Special instructions (optional) |
Admin Management
Administrators manage the medications catalog through standard CRUD endpoints. No separate/admin/ path prefix is used.
Admin Medication Endpoints
Admin Medication Endpoints
| Method | Endpoint | Action |
|---|---|---|
GET | /medicamentos/admin | Retrieve the full catalog including inactive medications |
POST | /medicamentos | Create a new medication entry |
PUT | /medicamentos/:id | Update all fields of an existing medication |