-
Notifications
You must be signed in to change notification settings - Fork 7
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
Blinding date_produced for samples and keeping samples order for send… #2001
Conversation
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.
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 }
CI failure is fine: it's a
|
app/documents/label_pdf.rb
Outdated
@@ -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")}", |
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.
That's... confusing :/
What's wrong with the block variant?
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.
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!
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.
LGTM!
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.