Skip to main content

snomed_ecl_engine/
lib.rs

1//! Evaluate SNOMED CT Expression Constraint Language against an index built from
2//! an RF2 Snapshot, inside your own process.
3//!
4//! [`store::NumericStore`] opens an index, [`ecl::parse`] parses an expression
5//! and [`eval::evaluate`] returns the matching concepts as ordinals, which
6//! resolve to SCTIDs through `store.ids`. Open the store once and reuse it.
7//!
8//! ```no_run
9//! use snomed_ecl_engine::{ecl, eval, store::NumericStore};
10//! use std::path::Path;
11//!
12//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
13//! let store = NumericStore::open(Path::new("uk.ecl"))?;
14//! let expression = ecl::parse("<< 64572001 |Disease|")?;
15//! let ordinals = eval::evaluate(&store, &expression)?;
16//! let codes: Vec<u64> = ordinals.iter().map(|&o| store.ids[o as usize]).collect();
17//! # Ok(())
18//! # }
19//! ```
20//!
21//! Features: `import` (default) builds indexes from RF2 archives; `unicode`
22//! links ICU for term matching in description filters. Without `import`, the
23//! crate can still open, query, pack and verify existing indexes.
24#![deny(unsafe_code)]
25
26pub mod config;
27pub mod decimal;
28pub mod detail;
29pub mod ecl;
30pub mod eval;
31#[cfg(feature = "import")]
32pub mod import;
33pub mod store;
34pub mod text;