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

Check for non-numerical values in numerical data count filter #11216

Open
wants to merge 4 commits into
base: demo-rfc80-poc
Choose a base branch
from

Conversation

onursumer
Copy link
Member

@onursumer onursumer commented Nov 20, 2024

Fix #11204

This only fixes numericalClinicalDataCountFilter.

Now applied the same fix to numericalGenomicDataFilter and numericalGenericAssayDataFilter as well by unifying the filter logic under one SQL.

TODO: add unit tests with variety of clinical, genomic, and generic assay data filter combinations

@onursumer onursumer changed the title Check for non-numerical values in numerical clinical data count filter Check for non-numerical values in numerical data count filter Nov 21, 2024
@onursumer onursumer force-pushed the check-non-numerical-values branch 2 times, most recently from add9f96 to 60ca4a0 Compare November 21, 2024 22:51
<include refid="isAttributeValueNA">
<property name="attribute_value" value="${attribute_value}"/>
</include>
</if>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we don't need to handle NA here if this SQL is used as the non-NA part? Just curious, it's also fine to have it here. And I think it's also possible to include the NA part as a whole SQL but this is great progress already. Appreciate it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this NA part was implemented before we added the additional logic for NA.

You're right. We should probably move the NA filter logic into this same SQL as well. Might be better to deal with it in a separate PR tough.

fuzhaoyuan
fuzhaoyuan previously approved these changes Nov 22, 2024
Copy link
Contributor

@fuzhaoyuan fuzhaoyuan left a comment

Choose a reason for hiding this comment

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

lgtm

-->
<if test="dataFilterValue.value != null">
AND (
<include refid="normalizeAttributeValue">
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't do the normalizeAttributeValue. You are just testing multiple values of NA?

Copy link
Member Author

Choose a reason for hiding this comment

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

normalizeAttributeValue used to normalize values other than NA but we got rid of that part at some point by upper casing everything. So I guess normalizing here is redundant now.

We are still doing this in multiple places where we filter categorical data. For example, see

<otherwise>
(
<include refid="normalizeAttributeValue">
<property name="attribute_value" value="attribute_value"/>
</include>
) ILIKE #{dataFilterValue.value}
</otherwise>

and
<otherwise>
(
<include refid="normalizeAttributeValue">
<property name="attribute_value" value="value"/>
</include>
) ILIKE #{dataFilterValue.value}
</otherwise>

These are also most likely redundant now, and I think we should address this duplication as well, but probably in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed normalizeAttributeValue from all these 3 places. We may still want to address the code duplication for categorical filters at some point.

Copy link
Collaborator

@haynescd haynescd left a comment

Choose a reason for hiding this comment

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

Looks good. Just had one question

Copy link

sonarcloud bot commented Nov 22, 2024

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.

3 participants