{% extends 'base.html.twig' %} {% block title %}Import {{ importer.label }}{% endblock %} {% block content %}

Import {{ importer.label }} from CSV

{{ include('parts/flash.html.twig') }}

How the sheet is read

A row with an id changes that record; a row without one is matched on its name, and added when no record has that name. The quickest way to update existing data is Export Current Data, edit it in Excel, and upload it back.

A column you leave out of the sheet is left as it is in the database, so a sheet of just id and snomed_code is a valid way to fill in codes and nothing else. A column that is in the sheet with an empty cell clears that field.

Nothing is saved unless every row is good. If any row has a problem, the whole file is rejected and the lines to fix are listed here. Up to {{ max_rows|number_format }} rows and 2 MB per file.

Save as "CSV UTF-8 (Comma delimited)" from Excel.
{% for name, option in importer.options %}
{{ option.help }}
{% endfor %}
Reports what the upload would change without touching the database.
{% if result %}

{% if result.hasErrors %} Nothing was saved {% elseif result.dryRun %} Check only — nothing was saved {% else %} Import finished {% endif %}

{% set tiles = { 'Rows read': result.total, 'Added': result.created, 'Updated': result.updated, 'Already up to date': result.unchanged, 'Skipped': result.skippedCount, 'Rows with problems': result.errorCount } %} {% for label, count in tiles %}

{{ label }}

{{ count }}
{% endfor %}
{% if ignored_headers is not empty %} {% endif %} {% if result.hasErrors %}
Rows to fix
{% for error in result.errors|slice(0, 200) %} {% endfor %} {% if result.errorCount > 200 %} {% endif %}
Line in file Problem
{{ error.line }} {{ error.message }}
and {{ result.errorCount - 200 }} more…
{% endif %} {% if result.skipped is not empty %}
Rows skipped
{% for skipped in result.skipped|slice(0, 200) %} {% endfor %} {% if result.skippedCount > 200 %} {% endif %}
Line in file Reason
{{ skipped.line }} {{ skipped.message }}
and {{ result.skippedCount - 200 }} more…
{% endif %} {% endif %}

Columns

{% for column in importer.columns %} {% endfor %}
Header in the file Meaning Required Notes
{{ column.name }} {{ column.label }} {% if column.required %} Yes {% else %} — {% endif %} {{ column.help }}

Required columns must hold a value on any row that adds a new {{ importer.recordLabel }}. On a row that changes an existing one they may be left out of the sheet altogether.

{% for title, values in importer.referenceLists %}
{{ title }} accepted in the sheet
{% for value in values %}
{{ value }}
{% else %}

None yet.

{% endfor %}
{% endfor %}
{% endblock %}