use alpha_id::pipeline::Pipeline; use alpha_id::model::{Config, Filter, Mode}; fn cfg() -> Config { Config::load("config/default.toml").unwrap() } #[test] fn mode_c_end_to_end_real_data() { let p = Pipeline::load(&cfg()).unwrap(); let dictation = "Patient mit Diabetes mellitus Typ 2\n\nArterielle Hypertonie"; let res = p.suggest(dictation, Mode::C, &Filter::default(), 10); assert!(!res.suggestions.is_empty()); assert!(res.suggestions.len() <= 10); assert!(res.suggestions.iter().any(|s| s.icd_code.starts_with("E11"))); assert!(res.suggestions.iter().any(|s| s.icd_code.starts_with("I10"))); assert_eq!(res.diagnostics.segment_count, 2); assert_eq!(res.diagnostics.mode, "C"); } #[test] fn billable_only_filter_excludes_three_digit_v_codes() { let p = Pipeline::load(&cfg()).unwrap(); let f = Filter { billable_only: true, valid_only: true, chapters: None, exclude_exotic: false }; let res = p.suggest("Cholera", Mode::C, &f, 10); assert!(res.suggestions.iter().all(|s| s.tags.billable && s.tags.valid)); }