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

Blinding date_produced for samples and keeping samples order for send… #2001

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

leandroradusky
Copy link
Contributor

As requested by the client: Blinding date_produced for samples and keeping samples order for sender institution.

Note: for the date field, in order to make things work when blinded, I had to compare to "Blinded" string, which does not feel like the best solution possible.

Copy link
Contributor

@ysbaddaden ysbaddaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for the "Blinded" string is indeed prone to break in very unexpected ways. Maybe you can reuse #blinded_attribute(name, &) that we use in the forms? It's meant to print "Blinded" or do something else that depends on the context.

sample.blinded_attribute(:date_produced) { sample.date_produced.to_date }

@ysbaddaden
Copy link
Contributor

ysbaddaden commented Apr 18, 2024

CI failure is fine: it's a pending spec that unexpectedly passes 🤷

  1) Patients without name should display 'Unknown name' in test result and in patient page FIXED
     Expected pending 'always fails on github actions' to fail. No error was raised.
     # ./spec/features/patient_spec.rb:18

@@ -41,7 +41,7 @@ def render_sample_details(sample)
text_lines [
"I.N. #{sample.isolate_name}".truncate(22),
"I.M. #{sample.inactivation_method}".truncate(22),
"P.D. #{sample.date_produced == "Blinded" ? "Blinded" : sample.date_produced.strftime("%m/%d/%Y")}",
"P.D. #{sample.blinded_attribute?(:date_produced) ? sample.date_produced : sample.date_produced.strftime("%m/%d/%Y")}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's... confusing :/

What's wrong with the block variant?

Copy link
Contributor Author

@leandroradusky leandroradusky Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry Julien :(
I didn't understood what you meant first, I did things fast because I thought you were suggesting to do what I did. Now I think is fixed. Thanks!

Copy link
Contributor

@ysbaddaden ysbaddaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@leandroradusky leandroradusky merged commit e4b2505 into main Apr 19, 2024
5 of 6 checks passed
@leandroradusky leandroradusky deleted the fix/blinding-date-produced-label-ordering branch April 19, 2024 09:53
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.

2 participants