Skip to content
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

Fix Patient Medical Record must be unique error when MRN has leading/traling whitespaces #94

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

xispa
Copy link
Member

@xispa xispa commented Oct 30, 2023

Description of the issue/feature this PR addresses

This Pull Request fixes a ValueError that arises when trying to create samples or partitions from another sample (either by copying or referred as primary) that has a MRN assigned with leading or trailing whitespaces, and for which a Patient was created earlier via Add sample's form temporary widget.

This is necessary because when creating a Patient object, while the MRN was automatically stripped in setMRN function, its value in AnalysisRequest was left without changes, leading to inconsistencies.

Current behavior before PR

ValueError: Patient Medical Record Number must be unique error when creating partitions from an existing sample

Desired behavior after PR is merged

Partitions are created without error, while MRN is kept.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@xispa xispa added the bug Something isn't working label Oct 30, 2023
@xispa xispa requested a review from ramonski October 30, 2023 12:11
@ramonski ramonski merged commit f9bacb5 into master Nov 2, 2023
@ramonski ramonski deleted the fix-empty-spaces branch November 2, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants