cima-rs
Rust library providing access to the AEMPS CIMA (Centro de Información Online de Medicamentos de la AEMPS) nomenclator data and REST API.
Features
- XML Data Dumps: Download and parse CIMA nomenclator XML files to CSV
- REST API Client: Complete async client for the CIMA REST API
- Medication information (
medicamentos) - Commercial presentations (
presentaciones) - Supply problems (
psuministro) - Clinical descriptions (VMP/VMPP)
- Safety notes and informative materials
- Segmented documents (ficha técnica, prospecto)
- Master data catalogs
- Change logs
- Medication information (
- CLI Tool:
nomenclatorbinary for both CSV conversion and API queries
Installation
Usage
CLI Tool: nomenclator
The nomenclator binary provides two modes of operation:
CSV Mode: Download and Convert XML to CSV
# Download XML files and convert to CSV
# With custom concurrency
This will:
- Download the latest CIMA nomenclator ZIP file
- Extract all XML files
- Parse them in parallel to CSV format
- Generate 20+ CSV files ready for database import
API Mode: Query REST API
# Get specific medication by registration number
# Search medications
# Get presentation details
# Get supply problems
# Get safety notes
# Get changes since a date
# Query master data
Available master data types (--tipo):
pa- Principios activos (active ingredients)ff- Formas farmacéuticas (pharmaceutical forms)va- Vías de administración (administration routes)lab- Laboratorios (laboratories)atc- Códigos ATC (ATC codes)
Rust Library API
use ;
async
See examples/query_medicamento.rs for a complete example.
Multi-CSV Parser (Recommended)
use parse_prescription_xml_to_csvs;
use Result;
This generates multiple normalized CSV files:
API Endpoints
All endpoints return structured Rust types with serde serialization support:
get_medication()- Get medication detailssearch_medications()- Search medications with filterssearch_in_technical_sheet()- Search in technical sheetsget_presentation()- Get presentation detailssearch_presentations()- Search presentationsget_all_supply_problems()- Get all supply problemsget_supply_problems()- Get supply problems by CNsearch_clinical_descriptions()- Search clinical descriptionsget_safety_notes()- Get safety notesget_informative_materials()- Get informative materialsget_document_sections()- Get document sectionsget_document_content()- Get document contentget_master_data()- Get master data catalogsget_change_log()- Get change logs
Requirements
- Rust 1.91+
- Tokio async runtime
License
See LICENSE file.