cima-rs 0.0.7

Rust library and CLI providing access to the Spanish AEMPS CIMA REST API and nomenclator XML parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::api_client::CimaClient;
use crate::models::SafetyNote;
use anyhow::{Context, Result};

impl CimaClient {
    /// Get safety notes associated with a medication
    pub async fn get_safety_notes(&self, registration_number: &str) -> Result<Vec<SafetyNote>> {
        let params = vec![("nregistro", registration_number.to_string())];

        self.get_with_params("notas", &params)
            .await
            .context("Failed to get safety notes")
    }
}