Медицина/Документы Jinja
Версия от 23:57, 1 мая 2023; Galaktionov (обсуждение | вклад)
Некешируемое изображение
<img src="{{ src }}?{{ timestamp() }}" />
Медицинский осмотр
{{ record.case }}
{% for service in record.case.get_services(include_complex_service=True) %}
<p>{{ service.name }}</p>
{% endfor %}
Шаблоны (jinja2)
"Документация":http://jinja.pocoo.org/docs/2.10/templates/
Pymorphy2
https://pymorphy2.readthedocs.io/en/latest/user/grammemes.html
{{ "Хомяк ест"|inflect("datv", "plur") }}
{{ "Хомяк"|agree_with_number(4) }}
Petrovich
{{ "Иванов Иван Иванович"|inflectfio(case, gender) }}
post= [0...4]
gender = [0...1]
# Родительный
GENITIVE = 0
# Дательный
DATIVE = 1
# Винительный
ACCUSATIVE = 2
# Творительный
INSTRUMENTAL = 3
# Предложный
PREPOSITIONAL = 4
Barcode
{{ barcode128('PATIENT', patient.id) }}
{{ barcode128('PATIENT', patient.id, separator='~', width='300px', height='200px') }}
Qrcode
{{ qrcode('PATIENT', patient.id) }}
{{ qrcode('PATIENT', patient.id, separator='~', size='50px') }}
Даты
{{ now() }}
{{ now('%d.%m.%Y %H:%M') }}
{{ today() }}
{{ today('%d.%m.%Y') }}
Функции
{{ render_layout('name') }}