<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>ExportPreferences</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1401822206000</creationDate>
  <parent>PhenoTips.Export</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1401822206000</date>
  <contentUpdateDate>1401822206000</contentUpdateDate>
  <version>1.1</version>
  <title/>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{include document="PhenoTips.DatabaseFilters" /}}

{{velocity output=false}}
## if $simple is true the meta fields and the code fields are not rendered
#macro(__export__displayFieldList $xclassName $targetFieldName $customValues $ignored $codeFields $valueList $simple $activeFields)
  {{html clean="false"}}
    #set($xclass = $xwiki.getDocument($xclassName).getxWikiClass())
    &lt;ul class="field-list"&gt;
      #foreach($customVal in $customValues.keySet())
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${customVal}"&gt;
            &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${customVal}" value="$customVal"#if ($valueList.contains($customVal) || true) checked="checked"#end/&gt;
            ${customValues.get($customVal)}
          &lt;/label&gt;
        &lt;/li&gt;
      #end
      #foreach ($field in $xclass.properties)
        #if (($activeFields.size() == 0 || $activeFields.contains(${field.name})) &amp;&amp; !$ignored.fields.contains(${field.name}) &amp;&amp; !$ignored.types.contains(${field.type}))
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}" value="${field.name}" #if($valueList.contains(${field.name}) || true) checked="checked" #end /&gt;
          ${field.prettyName}
        &lt;/li&gt;
        #if ($codeFields.contains(${field.name}) &amp;&amp; !${simple})
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_code"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_code" value="${field.name}_code" #if($valueList.contains("${field.name}_code")) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term ID)
        &lt;/li&gt;
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_combined"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_combined" value="${field.name}_combined" #if($valueList.contains("${field.name}_combined")) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term ID and term name)
        &lt;/li&gt;
        #end
        #if ($metaFields.contains(${field.name}) &amp;&amp; !${simple})
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_code_meta"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_code_meta" value="${field.name}_code_meta" #if($valueList.contains("${field.name}_code_meta")) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term and metadata IDs)
        &lt;/li&gt;
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_meta"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_meta" value="${field.name}_meta" #if($valueList.contains("${field.name}_meta") || true) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term and metadata names)
        &lt;/li&gt;
        #end
        #end
      #end
    &lt;/ul&gt;
    &lt;input type="hidden" name="${targetFieldName}" value="" /&gt;
  {{/html}}
#end
{{/velocity}}

{{velocity}}
{{html clean="false" filter="indent"}}&lt;form class="xform" action="${escapetool.xml($request.get('export_endpoint'))}" method="post"&gt;&lt;div&gt;{{/html}}
(% class="section filters"%)(((
=== (% class="step" %)1(%%) Filter records you wish to export ===

#__filters_display('export-filters')

{{info}}**(% id="filter-match-count"%) (%%)** matching records {{/info}}
)))##section filters

(% class="section columns"%)(((
#if ($request.multipatient)
=== (% class="step" %)2(%%) Select the fields to be included in pushed data ===
  #set($activeFields = ['external_id', 'gender', 'phenotype', 'negative_phenotype', 'omim_id'])
  #set($ignored = {})
  #set($customValues = {})
  #set($codeFields = [])
  #set($metaFields = [])
  #set($selectedValues = [])
  #__export__displayFieldList( "PhenoTips.PatientClass" 'columns' $customValues $ignored $codeFields $selectedValues false $activeFields)
  #set($exportTitle = "Push to " + $request.remoteserver)
  #set($exportButtonID = "push-multiple-patients")
#else
=== (% class="step" %)2(%%) Select the fields to be exported ===
  #set($ignored = {
    'fields' : ['reports_history', 'pedigree', 'extended_negative_phenotype', 'extended_phenotype', 'extended_prenatal_phenotype', 'extended_negative_prenatal_phenotype'],
    'types'  : []
  })
  #if (${request.export_id} == 'phenotips_json_export')
    #set ($simple = true)
    #set ($discard = $ignored.fields.add('negative_phenotype'))
  #else
    #set ($simple = false)
  #end
  #set($customValues = {
       'doc.name' : "Report identifier",
       'referrer' : "Referrer (report creator)",
       'creationDate' : "Report creation date",
       'author' : "Last modified by",
       'date' : "Last modification date",
       'genes': "Candidate genes list.",
       'rejectedGenes': "Previously investigated and/or excluded genes list"
  })
  #set($codeFields = ['phenotype', 'negative_phenotype', 'prenatal_phenotype', 'omim_id'])
  #set($metaFields = ['phenotype'])
  #set($selectedValues = ['phenotype'])
  #__export__displayFieldList( "PhenoTips.PatientClass" 'columns' $customValues $ignored $codeFields $selectedValues $simple)
  #set($exportTitle = "Export")
  #set($exportButtonID = "export-multiple-patients")
#end
)))##section columns

(% class="buttons"%)(((
{{html clean="false"}}&lt;input type="hidden" name="space" value="$!request.space"/&gt;&lt;input type="hidden" name="outputSyntax" value="plain"/&gt;&lt;span class="buttonwrapper"&gt;&lt;input type="submit" id="$exportButtonID" value="$exportTitle" class="button" id="export_submit"/&gt;&lt;/span&gt; &lt;span class="buttonwrapper"&gt;&lt;input type="button" value="Cancel" class="button secondary" id="export_cancel"/&gt;&lt;/span&gt;{{/html}}
{{html clean="false"}}&lt;/div&gt;&lt;/form&gt;{{/html}}
)))
{{/velocity}}</content>
</xwikidoc><commit_msg>Issue-#1167:Candidate and rejected genes not included in database export<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>ExportPreferences</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1401822206000</creationDate>
  <parent>PhenoTips.Export</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1401822206000</date>
  <contentUpdateDate>1401822206000</contentUpdateDate>
  <version>1.1</version>
  <title/>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{include document="PhenoTips.DatabaseFilters" /}}

{{velocity output=false}}
## if $simple is true the meta fields and the code fields are not rendered
#macro(__export__displayFieldList $xclassName $targetFieldName $customValues $ignored $codeFields $valueList $simple $activeFields)
  {{html clean="false"}}
    #set($xclass = $xwiki.getDocument($xclassName).getxWikiClass())
    &lt;ul class="field-list"&gt;
      #foreach($customVal in $customValues.keySet())
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${customVal}"&gt;
            &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${customVal}" value="$customVal"#if ($valueList.contains($customVal) || true) checked="checked"#end/&gt;
            ${customValues.get($customVal)}
          &lt;/label&gt;
        &lt;/li&gt;
      #end
      #foreach ($field in $xclass.properties)
        #if (($activeFields.size() == 0 || $activeFields.contains(${field.name})) &amp;&amp; !$ignored.fields.contains(${field.name}) &amp;&amp; !$ignored.types.contains(${field.type}))
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}" value="${field.name}" #if($valueList.contains(${field.name}) || true) checked="checked" #end /&gt;
          ${field.prettyName}
        &lt;/li&gt;
        #if ($codeFields.contains(${field.name}) &amp;&amp; !${simple})
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_code"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_code" value="${field.name}_code" #if($valueList.contains("${field.name}_code")) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term ID)
        &lt;/li&gt;
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_combined"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_combined" value="${field.name}_combined" #if($valueList.contains("${field.name}_combined")) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term ID and term name)
        &lt;/li&gt;
        #end
        #if ($metaFields.contains(${field.name}) &amp;&amp; !${simple})
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_code_meta"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_code_meta" value="${field.name}_code_meta" #if($valueList.contains("${field.name}_code_meta")) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term and metadata IDs)
        &lt;/li&gt;
        &lt;li&gt;
          &lt;label for="${targetFieldName}_${field.name}_meta"&gt;
          &lt;input type="checkbox" name="${targetFieldName}" id="${targetFieldName}_${field.name}_meta" value="${field.name}_meta" #if($valueList.contains("${field.name}_meta") || true) checked="checked" #end /&gt;
          ${field.prettyName} (ontology term and metadata names)
        &lt;/li&gt;
        #end
        #end
      #end
    &lt;/ul&gt;
    &lt;input type="hidden" name="${targetFieldName}" value="" /&gt;
  {{/html}}
#end
{{/velocity}}

{{velocity}}
{{html clean="false" filter="indent"}}&lt;form class="xform" action="${escapetool.xml($request.get('export_endpoint'))}" method="post"&gt;&lt;div&gt;{{/html}}
(% class="section filters"%)(((
=== (% class="step" %)1(%%) Filter records you wish to export ===

#__filters_display('export-filters')

{{info}}**(% id="filter-match-count"%) (%%)** matching records {{/info}}
)))##section filters

(% class="section columns"%)(((
#if ($request.multipatient)
=== (% class="step" %)2(%%) Select the fields to be included in pushed data ===
  #set($activeFields = ['external_id', 'gender', 'phenotype', 'negative_phenotype', 'omim_id'])
  #set($ignored = {})
  #set($customValues = {})
  #set($codeFields = [])
  #set($metaFields = [])
  #set($selectedValues = [])
  #__export__displayFieldList( "PhenoTips.PatientClass" 'columns' $customValues $ignored $codeFields $selectedValues false $activeFields)
  #set($exportTitle = "Push to " + $request.remoteserver)
  #set($exportButtonID = "push-multiple-patients")
#else
=== (% class="step" %)2(%%) Select the fields to be exported ===
  #set($ignored = {
    'fields' : ['reports_history', 'pedigree', 'extended_negative_phenotype', 'extended_phenotype', 'extended_prenatal_phenotype', 'extended_negative_prenatal_phenotype'],
    'types'  : []
  })
  #if (${request.export_id} == 'phenotips_json_export')
    #set ($simple = true)
    #set ($discard = $ignored.fields.add('negative_phenotype'))
  #else
    #set ($simple = false)
  #end
  #set($customValues = {
       'doc.name' : "Report identifier",
       'referrer' : "Referrer (report creator)",
       'creationDate' : "Report creation date",
       'author' : "Last modified by",
       'date' : "Last modification date",
       'genes': "Candidate genes list.",
       'genes_comments': "Candidate genes list with comments",
       'rejectedGenes': "Previously investigated genes.",
       'rejectedGenes_comments': "Previously investigated genes with comments."
  })
  #set($codeFields = ['phenotype', 'negative_phenotype', 'prenatal_phenotype', 'omim_id'])
  #set($metaFields = ['phenotype'])
  #set($selectedValues = ['phenotype'])
  #__export__displayFieldList( "PhenoTips.PatientClass" 'columns' $customValues $ignored $codeFields $selectedValues $simple)
  #set($exportTitle = "Export")
  #set($exportButtonID = "export-multiple-patients")
#end
)))##section columns

(% class="buttons"%)(((
{{html clean="false"}}&lt;input type="hidden" name="space" value="$!request.space"/&gt;&lt;input type="hidden" name="outputSyntax" value="plain"/&gt;&lt;span class="buttonwrapper"&gt;&lt;input type="submit" id="$exportButtonID" value="$exportTitle" class="button" id="export_submit"/&gt;&lt;/span&gt; &lt;span class="buttonwrapper"&gt;&lt;input type="button" value="Cancel" class="button secondary" id="export_cancel"/&gt;&lt;/span&gt;{{/html}}
{{html clean="false"}}&lt;/div&gt;&lt;/form&gt;{{/html}}
)))
{{/velocity}}</content>
</xwikidoc>
{'fraction_non_alphanumeric': 0.18489026995533114, 'fraction_numerical': 0.008804298569301483, 'mean_word_length': 4.873764258555133, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 2, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '17889', 'n_tokens_mistral': 5037, 'n_tokens_neox': 4854, 'n_words': 1040}