<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.1">
  <web>PhenoTips</web>
  <name>DatabaseFilters</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1401822219000</creationDate>
  <parent>PhenoTips.Export</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1401822219000</date>
  <contentUpdateDate>1401822219000</contentUpdateDate>
  <version>1.1</version>
  <title/>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{velocity output=false}}
#set ($activeFields = $services.recordConfiguration.activeConfiguration.enabledFieldNames)
#set ($dateFormat = "MM/dd/yyyy")
##
##
#macro (__filters_dateRange $field_name $dateStart $dateEnd)
(% class="date-range" %)(((
#__filters_dateField ("after: " "${field_name}/after" $dateStart)

#__filters_dateField ("before: " "${field_name}/before" $dateEnd)
)))
#end
##
#macro (__filters_dateField $label $field_name $value)
{{html clean="false"}}&lt;label&gt;$label &lt;span class="xHint"&gt;(empty means no constraint)&lt;/span&gt;&lt;input class="xwiki-date" type="text" alt="#if($value)#formatdateISO($value)#end" value="$!xwiki.formatDate($value, $definedFormat)" name="${field_name}" title="${dateFormat}" /&gt;&lt;/label&gt;{{/html}}
#end

#macro(__filters_display $cssClass)
(% class="filters $!cssClass" %)
* By **referrer**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all referrers are considered)&lt;/p&gt;&lt;input type="text" class="suggestUsers multipleSelection" name="doc.creator" value=""/&gt;{{/html}}
* By **owner**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all are considered)&lt;/p&gt;&lt;input type="hidden" name="owner/class" value="PhenoTips.OwnerClass"/&gt;&lt;input type="text" class="suggestUsers multipleSelection" name="owner" value=""/&gt;{{/html}}
* By **last author**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all authors are considered)&lt;/p&gt;&lt;input type="text" class="suggestUsers multipleSelection" name="doc.author" value=""/&gt;{{/html}}
* By **creation date**: #__filters_dateRange("doc.creationDate")
* By **last modification date**: #__filters_dateRange("doc.date")
#if ($activeFields.contains('date_of_birth'))
  * By **date of birth** of the patient: #__filters_dateRange("date_of_birth")
#end
#if ($activeFields.contains('omim_id'))
  * By **disease**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all diseases are considered)&lt;/p&gt;&lt;input type="text" class="suggest multi suggestOmim generateCheckboxes" name="omim_id" value=""/&gt;{{/html}}
  ** Filter records presenting {{html clean="false"}}&lt;label&gt;&lt;input type="radio" name="omim_id/join_mode" value="AND"/&gt;all&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="omim_id/join_mode" value="OR" checked="checked"/&gt;at least one&lt;/label&gt;{{/html}} of the selected diseases.
#end
#if ($activeFields.contains('phenotype'))
  * By **phenotype**: {{html clean="false"}}&lt;p class="xHint"&gt;(an empty value list means all phenotypes are considered)&lt;/p&gt;&lt;input type="text" class="suggest multi suggestHpo generateCheckboxes" name="phenotype" value=""/&gt;{{/html}}
  ** Filter records presenting {{html clean="false"}}&lt;label&gt;&lt;input type="radio" name="phenotype/join_mode" value="AND"/&gt;all&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="phenotype/join_mode" value="OR" checked="checked"/&gt;at least one&lt;/label&gt;{{/html}} of the selected phenotypes.
  ** Filter records {{html clean="false"}}&lt;label&gt;&lt;input type="radio" name="phenotype_subterms" value="yes" checked="checked"/&gt;with all subcategories of&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="phenotype_subterms" value="no"/&gt;only matching exactly &lt;/label&gt;{{/html}} the selected phenotypes.
#end
#end
{{/velocity}}</content>
</xwikidoc><commit_msg>Issue #971: Allow filtering records by external identifier Done.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.1">
  <web>PhenoTips</web>
  <name>DatabaseFilters</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1401822219000</creationDate>
  <parent>PhenoTips.Export</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1401822219000</date>
  <contentUpdateDate>1401822219000</contentUpdateDate>
  <version>1.1</version>
  <title/>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{velocity output=false}}
#set ($activeFields = $services.recordConfiguration.activeConfiguration.enabledFieldNames)
#set ($dateFormat = "MM/dd/yyyy")
##
##
#macro (__filters_dateRange $field_name $dateStart $dateEnd)
(% class="date-range" %)(((
#__filters_dateField ("after: " "${field_name}/after" $dateStart)

#__filters_dateField ("before: " "${field_name}/before" $dateEnd)
)))
#end
##
#macro (__filters_dateField $label $field_name $value)
{{html clean="false"}}&lt;label&gt;$label &lt;span class="xHint"&gt;(empty means no constraint)&lt;/span&gt;&lt;input class="xwiki-date" type="text" alt="#if($value)#formatdateISO($value)#end" value="$!xwiki.formatDate($value, $definedFormat)" name="${field_name}" title="${dateFormat}" /&gt;&lt;/label&gt;{{/html}}
#end

#macro(__filters_display $cssClass)
(% class="filters $!cssClass" %)
#if ($activeFields.contains('external_id'))
* By **external identifier**: {{html clean=false}}&lt;p class="xHint"&gt;(The hospital ID manually entered)&lt;/p&gt;&lt;input type="text" name="external_id" value=""/&gt;{{/html}}
#end
* By **referrer**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all referrers are considered)&lt;/p&gt;&lt;input type="text" class="suggestUsers multipleSelection" name="doc.creator" value=""/&gt;{{/html}}
* By **owner**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all are considered)&lt;/p&gt;&lt;input type="hidden" name="owner/class" value="PhenoTips.OwnerClass"/&gt;&lt;input type="text" class="suggestUsers multipleSelection" name="owner" value=""/&gt;{{/html}}
* By **last author**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all authors are considered)&lt;/p&gt;&lt;input type="text" class="suggestUsers multipleSelection" name="doc.author" value=""/&gt;{{/html}}
* By **creation date**: #__filters_dateRange("doc.creationDate")
* By **last modification date**: #__filters_dateRange("doc.date")
#if ($activeFields.contains('date_of_birth'))
  * By **date of birth** of the patient: #__filters_dateRange("date_of_birth")
#end
#if ($activeFields.contains('omim_id'))
  * By **disease**: {{html clean=false}}&lt;p class="xHint"&gt;(an empty value list means all diseases are considered)&lt;/p&gt;&lt;input type="text" class="suggest multi suggestOmim generateCheckboxes" name="omim_id" value=""/&gt;{{/html}}
  ** Filter records presenting {{html clean="false"}}&lt;label&gt;&lt;input type="radio" name="omim_id/join_mode" value="AND"/&gt;all&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="omim_id/join_mode" value="OR" checked="checked"/&gt;at least one&lt;/label&gt;{{/html}} of the selected diseases.
#end
#if ($activeFields.contains('phenotype'))
  * By **phenotype**: {{html clean="false"}}&lt;p class="xHint"&gt;(an empty value list means all phenotypes are considered)&lt;/p&gt;&lt;input type="text" class="suggest multi suggestHpo generateCheckboxes" name="phenotype" value=""/&gt;{{/html}}
  ** Filter records presenting {{html clean="false"}}&lt;label&gt;&lt;input type="radio" name="phenotype/join_mode" value="AND"/&gt;all&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="phenotype/join_mode" value="OR" checked="checked"/&gt;at least one&lt;/label&gt;{{/html}} of the selected phenotypes.
  ** Filter records {{html clean="false"}}&lt;label&gt;&lt;input type="radio" name="phenotype_subterms" value="yes" checked="checked"/&gt;with all subcategories of&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="phenotype_subterms" value="no"/&gt;only matching exactly &lt;/label&gt;{{/html}} the selected phenotypes.
#end
#end
{{/velocity}}</content>
</xwikidoc>
{'fraction_non_alphanumeric': 0.17740511915269197, 'fraction_numerical': 0.012454643522604688, 'mean_word_length': 7.1258964143426295, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 2, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7390284', 'n_tokens_mistral': 3424, 'n_tokens_neox': 3259, 'n_words': 805}