-
Notifications
You must be signed in to change notification settings - Fork 0
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
Results table modal #79
Conversation
jhughes982
commented
Oct 14, 2022
- Added modal to display check for cascade testing,
- Also added fallback modals in case there are no patients to iterate through,
- Feedback welcome on the use of guard clauses to prevent undefined data... Is there a better way of doing this?
- closes Add modal or notification if patient has a positive finding and there is only one patient with that family number #62
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.
🎉 thanks for doing this - not sure if my comment on guard clauses is that astounding but does save a small bit I hope
if ( | ||
!patient.id || | ||
!patient.identifier || | ||
!patient.identifier[0].value || | ||
!patient.name || | ||
!patient.name[0].given || | ||
!patient.name[0].family | ||
) { |
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.
We could make this a bit more clear by ?
and also using !(with && and && linking). so maybe something like this?
if ( | |
!patient.id || | |
!patient.identifier || | |
!patient.identifier[0].value || | |
!patient.name || | |
!patient.name[0].given || | |
!patient.name[0].family | |
) { | |
if (!( | |
patient.id && | |
patient.identifier?.get(0)?.value && | |
patient.name?.get(0)?.given && | |
patient.name?.get(0)?.family | |
)) { |
if (component?.code?.coding?.[0].code === HGVS_CDNA_LOINC) { | ||
return component?.valueCodeableConcept?.coding?.[0].display; | ||
if ( | ||
!component || |
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.
I don't think this line is necessary in the guard as it's covered below
Thanks for the suggestions. I think that is now a bit leaner and more semantically correct. Needs a bit of concentration to follow through the logic though unfortunately. |