Skip to main content

translate

Function translate 

Source
pub fn translate(
    concept_map: &Value,
    system: Option<&str>,
    code: &str,
) -> Result<Option<Translation>, String>
Expand description

Translates code (from system, when known) with a ConceptMap in R5 or R4 form, as the reference engine does: the first element for the code, and among its targets the one whose relationship is related-to, equivalent or source-is-narrower-than-target (or none); several such targets are ambiguous. Without an element for the code, the group’s unmapped rule applies (use-source-code, fixed, R4 provided). Ok(None): the ConceptMap does not know the code, and the reference engine leaves the target unset. An element whose targets are all unrelated is an error.