Skip to content

Commit

Permalink
fix numericalClinicalDataCountFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
onursumer committed Jul 10, 2024
1 parent 9a805a5 commit bd8d8b6
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@
SELECT ${unique_id}
FROM ${table_name}
WHERE attribute_name = '${clinicalDataFilter.attributeId}' AND
type='${type}' AND
(attribute_value = '' OR match(attribute_value, '^[\d\.]+$'))
type='${type}'
<foreach item="dataFilterValue" collection="clinicalDataFilter.values" open=" AND ((" separator=") OR (" close="))">
<trim prefix="" prefixOverrides="AND">
<if test="dataFilterValue.value eq 'NA'">
Expand All @@ -146,19 +145,22 @@
<property name="attribute_value" value="attribute_value"/>
</include>
</if>
<choose>
<when test="dataFilterValue.start == dataFilterValue.end">
AND abs(minus(cast(attribute_value as float), ${dataFilterValue.start})) &lt; exp(-11)
</when>
<otherwise>
<if test="dataFilterValue.start != null">
AND cast(attribute_value as float) &gt; ${dataFilterValue.start}
</if>
<if test="dataFilterValue.end != null">
AND cast(attribute_value as float) &lt;= ${dataFilterValue.end}
</if>
</otherwise>
</choose>
<if test="dataFilterValue.start != null || dataFilterValue.end != null">
AND match(attribute_value, '^[\d\.]+$')
<choose>
<when test="dataFilterValue.start == dataFilterValue.end">
AND abs(minus(cast(attribute_value as float), ${dataFilterValue.start})) &lt; exp(-11)
</when>
<otherwise>
<if test="dataFilterValue.start != null">
AND cast(attribute_value as float) &gt; ${dataFilterValue.start}
</if>
<if test="dataFilterValue.end != null">
AND cast(attribute_value as float) &lt;= ${dataFilterValue.end}
</if>
</otherwise>
</choose>
</if>
</trim>
</foreach>

Expand Down

0 comments on commit bd8d8b6

Please sign in to comment.