{% extends 'ddm/admin/generic/page_with_form.html' %} {% load static %} {% block page_title %}Edit File Blueprint{% endblock %} {% block main_heading %}Edit File Blueprint "{{ object.name }}"{% endblock %} {% block main_form %}
{% csrf_token %} {{ form.media }} {{ form.non_field_errors }}
{% for field in form %} {% if field.name not in "expected_fields,regex_path,exp_file_format,csv_delimiter" %}

{{ field.label_tag }} {{ field.errors }} {{ field.help_text }}
{{ field }}

{% endif %} {% endfor %}
Data Extraction Settings

Data Extraction is a two-step process:

1. File Validation

First, it is checked whether the file that you expect is included in the download. This means that if the associated File Uploader expects a ZIP Upload, it tries to find the correct file according to the file path you defined (this is skipped for single file uploads).

Next, it is checked whether the uploaded file has the expected format defined in the Expected File Format setting (and other settings, depending on the file format).

Lastly, it is checked whether the identified file contains the expected fields defined in the Expected Fields setting.
If any of these validation steps fail, the participant will be shown an exception message explaining what went wrong and the file upload and extraction is aborted.

{% for field in form %} {% if field.name in "expected_fields,regex_path,exp_file_format,csv_delimiter" %}

{{ field.label_tag }} {{ field.errors }} {{ field.help_text }} {{ field }}

{% endif %} {% endfor %}
2. Data Extraction

For the data extraction, the Data Donation Module follows the data sparsity paradigm. This means that the base assumption is, that you do not want any data from your participants, and you have to explicitly indicate which data fields you want to have included.

To keep data in the data donation, you must define Extraction Rules.
An Extraction Rule is always related to one field/column in the uploaded data file and a data field will only be kept in a participant's donation if it is explicitly mentioned in at least one of the extraction rules.

An extraction rule can either indicate to just keep a field in the donation (by mentioning the field/column in an extraction rule without defining any concrete comparison operator), use data contained in a field to delete data entries (i.e., rows) from the donation (e.g., to delete all entries where the date is < 01.01.2020) or alter the data contained in a field (e.g., anonymize an e-mail address by replacing "name@mail.com" with "EMAIL").
For this, there are several comparison and regex operations available. For the comparison operations, a match means that a data entry will be deleted. The rules are applied to the uploaded file in the indicated order.

{{ formset.management_form }}
Extraction Rules
{% for form in formset%} {% if forloop.first %} {% for field in form.visible_fields %} {% if field.name in 'name,field' %} {% endif %} {% endfor %} {% endif %} {{ form.non_field_errors }} {% with loop_id=forloop.counter0 %} {% for field in form.visible_fields %} {% if field.name in 'name,field,execution_order' %} {% endif %} {% endfor %} {% endwith %} {% for field in form.visible_fields %} {% if field.name in 'DELETE' %} {% endif %} {% endfor %} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} {% endfor %}
Order{{ field.label }}Description Delete
{{ field.errors }} {{ field.value }} Configure Step {{ field.errors }} {{ field }}
  Add Extraction Rule
{% for form in formset%} {% with modal_id_postfix=forloop.counter0|stringformat:"i" button_id_postfix=forloop.counter0|stringformat:"i" %} {% include "ddm/admin/data_donation/processing_rule_modal.html" with modal_id="configuration-"|add:modal_id_postfix form=form button_id="ddm-modal-ok-"|add:button_id_postfix %} {% endwith %} {% empty %} {% include "ddm/admin/data_donation/processing_rule_modal.html" with modal_id="configuration-template" form=formset.empty_form button_id="ddm-modal-ok-__prefix__" %} {% endfor %} {% for field in formset.empty_form %} {% if field.name in 'name,field,execution_order' %} {% endif %} {% endfor %} {% for field in formset.empty_form.visible_fields %} {% if field.name in 'DELETE' %} {% endif %} {% endfor %} {% for hidden in formset.empty_form.hidden_fields %} {{ hidden }} {% endfor %}

🠐 Back

{{ file_uploader_meta|json_script:'file_uploader_meta' }} {% endblock %} {% block breadcrumbs %} Projects / "{{ project.name|truncatechars:15 }}" Project / Data Donation / Edit Blueprint {% endblock %} {% block scripts %} {{ block.super }} {% endblock scripts %}