Skip to content

Conversation

@oylenshpeegul
Copy link
Collaborator

@oylenshpeegul oylenshpeegul commented Jun 10, 2025

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

- add TermManagement::DropTerm
- match it in subroutine
- change term and comment accordingly

addresses ehrtools#87
Error message comes from the Rust side
Copy link
Collaborator

@em-baggie em-baggie left a 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()))
Copy link
Collaborator

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);
Copy link
Collaborator

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

Copy link
Collaborator

@CarolineMorton CarolineMorton left a 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

@CarolineMorton CarolineMorton merged commit 6ce204e into ehrtools:main Jun 11, 2025
7 checks passed
@oylenshpeegul oylenshpeegul deleted the truncate-discard branch June 11, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

truncate to 3 digits: medium term strategy

3 participants