-
Notifications
You must be signed in to change notification settings - Fork 3
Truncate drop_term #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- add TermManagement::DropTerm - match it in subroutine - change term and comment accordingly addresses ehrtools#87
Error message comes from the Rust side
em-baggie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, and tests are very comprehensive
| TermManagement::First => Some(format!("{code} truncated to 3 digits")), | ||
| let (term, comment) = match term_management { | ||
| TermManagement::DropTerm => { | ||
| (None, Some("Truncated to 3 digits, term discarded".to_string())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, with clear comments for each term management
|
|
||
| observed_codelist.truncate_to_3_digits(TermManagement::DropTerm)?; | ||
|
|
||
| assert_eq!(observed_codelist, expected_codelist); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clear tests, I like how you set it up as observed vs expected codelist, it's very easy to read
CarolineMorton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realy great work here @oylenshpeegul
Added the DropTerm option to TermManagement as in #87
Updated the Python bindings too, which is good because I found a problem with error.rs back on the Rust side.
Closes #87