Skip to content

Commit 52f022a

Browse files
committed
Implement snomed usage data and add testing
1 parent 410377a commit 52f022a

6 files changed

Lines changed: 560 additions & 1 deletion

File tree

rust/codelist-builder-rs/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ description = "Builder library for medical codelists"
88
[dependencies]
99
codelist-rs = { path = "../codelist-rs" }
1010
serde = { version = "1.0", features = ["derive"] }
11+
serde_json = "1.0"
1112
thiserror = { version = "2.0.9" }
1213
thiserror-ext = { version = "0.2.1" }
14+
reqwest = { version = "0.12.2" }
15+
csv = { version = "1.3.1" }
16+
async-trait = "0.1"
1317

14-
18+
[dev-dependencies]
19+
tokio = { version = "1.0", features = ["full"] }
20+
wiremock = { version = "0.6.4" }
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//! This file contains custom errors for the codelist-builder library
2+
3+
/// Enum to represent the different types of errors that can occur in the
4+
/// codelist-builder library
5+
6+
#[derive(Debug, thiserror::Error, thiserror_ext::Construct)]
7+
pub enum CodeListBuilderError {
8+
#[error("Invalid usage year: {name}")]
9+
InvalidUsageYear { name: String },
10+
11+
#[error("Invalid usage data: {name}")]
12+
InvalidUsageData { name: String },
13+
14+
#[error("HTTP request error: {0}")]
15+
#[construct(skip)]
16+
ReqwestError(#[from] reqwest::Error),
17+
18+
#[error("CSV error: {0}")]
19+
#[construct(skip)]
20+
CSVError(#[from] csv::Error),
21+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub mod errors;
2+
pub mod snomed_usage_data;
3+
pub mod usage_year;

0 commit comments

Comments
 (0)