Медицина/Отчеты
Версия от 00:44, 13 декабря 2025; Admin (обсуждение | вклад)
jinja2
[% set conditions_1 = build_conditions(["created::date", "device_id"], operator="OR", wrap=True) %]
[% set conditions_2 = build_conditions(["created::date>=", "device_id<>"], operator="AND", wrap=True) %]
[% set final_conditions = [conditions_1, conditions_2] | select | join(" OR ") %]
[[ final_conditions ]]
(created::date = '2025-12-13' OR device_id = '1') OR (created::date >= '2025-12-13' AND device_id <> '1')
Отчет с XML
Разделители строк CR LF / LF
Для разделения строк CR LF в поле Кодировка установить cp1251
Пример синтаксиса шаблона
{% set lines = results.result.lines %}<?xml version="1.0" encoding="windows-1251"?>
{% filter pretty_xml %}
<Файл ВерсФорм="5.01">
<Документ КНД="1184043" ДатаДок="11.02.2025" КодНО="2511" />
{% for line in lines %}
<НППлатМедУсл>
<ФИО>{{ line.last_name }}</ФИО>
</НППлатМедУсл>
{% endfor %}
</Файл>
{% endfilter %}