Crates.io | drug-extraction-core |
lib.rs | drug-extraction-core |
version | 0.1.2 |
source | src |
created_at | 2022-04-26 18:59:45.375231 |
updated_at | 2022-08-02 17:16:40.394417 |
description | A core library for extracting drugs from text records |
homepage | |
repository | https://github.com/UK-IPOP/drug-extraction |
max_upload_size | |
id | 575656 |
size | 37,067 |
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.
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.
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
.
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.
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. 🙂
If you encounter any issues or need support please either contact @nanthony007 or open an issue.
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!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)See CONTRIBUTING.md for more details. 😃