Skip to main content

CimaClient

Struct CimaClient 

Source
pub struct CimaClient { /* private fields */ }
Expand description

Client for interacting with the CIMA REST API

Implementations§

Source§

impl CimaClient

Source

pub fn new() -> Result<Self>

Create a new CIMA client with default configuration

Source

pub fn with_base_url(base_url: &str) -> Result<Self>

Create a client with a custom base URL (useful for testing)

Source§

impl CimaClient

Source

pub async fn get_change_log( &self, date: &str, registration_numbers: Option<&[&str]>, ) -> Result<PaginatedResponse<ChangeRecord>>

Get change log from a specific date

Returns a paginated response with medication changes

§Arguments
  • date - Date in format “dd/mm/yyyy”
  • registration_numbers - Optional list of registration numbers to filter
Source§

impl CimaClient

Source

pub async fn search_clinical_descriptions( &self, params: &SearchClinicalDescriptionParams, ) -> Result<PaginatedResponse<ClinicalDescription>>

Search clinical descriptions (VMP/VMPP)

Returns a paginated response with clinical descriptions

Source§

impl CimaClient

Source

pub async fn get_document_sections( &self, doc_type: DocumentType, registration_number: &str, ) -> Result<Vec<Section>>

Get document sections list (without content)

Source

pub async fn get_document_content( &self, doc_type: DocumentType, registration_number: &str, section: Option<&str>, ) -> Result<Vec<Section>>

Get document section content

Source

pub async fn get_technical_sheet_html( &self, registration_number: &str, ) -> Result<String>

Get complete technical data sheet in HTML

Source

pub async fn get_technical_sheet_section_html( &self, registration_number: &str, section: &str, ) -> Result<String>

Get a specific section of the technical data sheet in HTML

Source

pub async fn get_package_leaflet_html( &self, registration_number: &str, ) -> Result<String>

Get complete package leaflet in HTML

Source

pub async fn get_package_leaflet_section_html( &self, registration_number: &str, section: &str, ) -> Result<String>

Get a specific section of the package leaflet in HTML

Source§

impl CimaClient

Source

pub async fn get_master_data( &self, data_type: MasterDataType, params: &MasterDataParams, ) -> Result<PaginatedResponse<MasterItem>>

Get elements from a master data catalog (reference catalog)

Important: The CIMA API requires at least one filter parameter to be set (name, id, code, narcotic, psychotropic, narcotic_or_psychotropic, or in_use). Without any filter, the API returns 204 No Content.

Returns a paginated response with master data items.

Source§

impl CimaClient

Source

pub async fn get_informative_materials( &self, registration_number: &str, ) -> Result<SafetyMaterial>

Get informative materials associated with a medication

Returns a single SafetyMaterial object (not an array)

Source§

impl CimaClient

Source

pub async fn get_medication( &self, registration_number: Option<&str>, national_code: Option<&str>, ) -> Result<Medication>

Get medication information by registration number or national code

Source

pub async fn search_medications( &self, params: &SearchMedicationsParams, ) -> Result<PaginatedResponse<MedicationSummary>>

Search medications according to specified parameters

Returns a paginated response with medication search results.

Source

pub async fn search_in_technical_sheet( &self, queries: &[TechnicalSheetQuery], ) -> Result<Vec<MedicationSummary>>

Search medications by content in technical data sheet

Source§

impl CimaClient

Source

pub async fn get_presentation( &self, national_code: &str, ) -> Result<Presentation>

Get presentation information by national code

Source

pub async fn search_presentations( &self, params: &SearchPresentationsParams, ) -> Result<PaginatedResponse<PresentationSummary>>

Search presentations according to specified parameters

Returns a paginated response with presentation search results.

Source§

impl CimaClient

Source

pub async fn get_safety_notes( &self, registration_number: &str, ) -> Result<Vec<SafetyNote>>

Get safety notes associated with a medication

Source§

impl CimaClient

Source

pub async fn get_all_supply_problems( &self, ) -> Result<PaginatedResponse<SupplyProblem>>

Get all current supply problems

Returns a paginated response with all active supply problems.

Source

pub async fn get_supply_problems( &self, national_code: &str, ) -> Result<PaginatedResponse<SupplyProblem>>

Get supply problems for a specific presentation by national code

Returns a paginated response with supply problems for the specified CN

Trait Implementations§

Source§

impl Clone for CimaClient

Source§

fn clone(&self) -> CimaClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CimaClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CimaClient

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more