patient_matching/
error.rs

1//! Error types for patient matching operations
2
3use thiserror::Error;
4
5/// Result type alias for matching operations
6pub type Result<T> = std::result::Result<T, MatchingError>;
7
8/// Errors that can occur during patient matching
9#[derive(Error, Debug)]
10pub enum MatchingError {
11    #[error("Invalid patient data: {0}")]
12    InvalidData(String),
13
14    #[error("Missing required field: {0}")]
15    MissingField(String),
16
17    #[error("Invalid NHS number: {0}")]
18    InvalidNhsNumber(String),
19
20    #[error("Invalid date format: {0}")]
21    InvalidDate(String),
22
23    #[error("Configuration error: {0}")]
24    ConfigError(String),
25}