Giter Site home page Giter Site logo

aempsconn's Introduction

AEMPSconn

Library designed for interacting with the CIMA REST API (AEMPS). More information related to the official REST API can be found here.

Note: AEMPSconn is developed to make use of it with CIMA REST API v1.23.

Testing

Unit-tests for this new version are under development.

Installation

Use the package manager pip to install aempsconn.

pip install aempsconn

Usage

Each module has embedded in it the only type of filter it supports. The filters are created dynamically so depending on the type of data you want to obtain, it will ask for the type of value required for it.

If you want to filter by more than one value, simply concatenate all the desired filters, the query-builder will create the necessary query.

from aempsconn.aemps import AempsConn
from aempsconn.filter import (
    MaterialFilter,
    MedicamentoFilter,
    MedicamentosFilter,
    NotaFilter,
    PresentacionesFilter,
    RegistroCambiosFilter,
    VmppFilter,
)

aemps = AempsConn()

for med in aemps.medicamento.get(
    filter=MedicamentoFilter().nregistro.equals(value="62121")
):
    print(med.nombre)

for med in aemps.medicamentos.get(
    filter=MedicamentosFilter().nombre.startswith(value="meto")
):
    print(med.nombre)

for med in aemps.medicamentos.get(
    filter=MedicamentosFilter().nombre.startswith(value="")
):
    print(med.nombre)

for med in aemps.presentaciones.get(
    filter=PresentacionesFilter().vmp.equals("270671000140106")
):
    print(med.nombre)

for desc_cli in aemps.vmpp.get(filter=VmppFilter().nombre.contains("metotrexato")):
    print(desc_cli.vmpDesc)

for change in aemps.registro_cambios.get(
    filter=RegistroCambiosFilter().fecha.equals(value="20/12/2023")
):
    print(change)

for note in aemps.notas.get(filter=NotaFilter().nregistro.equals("69223")):
    print(note)

for material in aemps.materiales.get(
    filter=MaterialFilter().nregistro.equals("78632")
):
    print(material)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Disclaimer

The use of Spanish words or descriptions is intended to facilitate consistency between the official CIMA API and this library, so that the programmer does not hesitate with the name of each of the filters or data received.

This library is not official.

aempsconn's People

Contributors

fqlenos avatar snyk-bot avatar dependabot[bot] avatar

Stargazers

Josep Anguera Peralta avatar Alex Porcar avatar Florinel Olteanu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.