drug-extraction-core

Crates.iodrug-extraction-core
lib.rsdrug-extraction-core
version0.1.2
sourcesrc
created_at2022-04-26 18:59:45.375231
updated_at2022-08-02 17:16:40.394417
descriptionA core library for extracting drugs from text records
homepage
repositoryhttps://github.com/UK-IPOP/drug-extraction
max_upload_size
id575656
size37,067
Nick Anthony (nanthony007)

documentation

README

Drug Extraction Core

This is the core library used by the CLI and Web application interfaces.

As noted in the main ToolBox documentation, this library's development will be driven heavily by the needs of the CLI application.

Full API documentation can be found on docs.rs.

Description

Drugs, as defined by the Drug type include a name, rx_cui, rx_class_id, and rx_class_relasource. Technically these could be manually compiled, but we recommend fetching from the RxClass API.

For an example, see fetch_drugs() from the CLI application.

Requires

  • cargo package manager (rust toolchain)
  • just (optional dev-dependency if you clone this repo)

Installation

Cargo is available as a part of the Rust toolchain and is readily available via curl + sh combo (see here).

To install the drug-extraction-core library, simply:

drug-extraction-core = 0.1.0

inside your Cargo.toml.

Usage

A simple usage example:

let search = DrugSearch::new(
    Algorithm::Levenshtein,
    levenshtein,
    None,
    None,
    &["hello", "world"]
);
let results = search.scan("hello world", None);
println!("{:?}", results);

We support both CSV and JSONL output.

Example Workflow

For analytical purposes, I would suggest combining all of these jsonlines files into one larger file and then you can process it with a tool like jq or Python - Pandas depending on your use case. 🙂

Support

If you encounter any issues or need support please either contact @nanthony007 or open an issue.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for more details. 😃

MIT License

LICENSE

Commit count: 366

cargo fmt