ЛИС Обработчики: различия между версиями
Admin (обсуждение | вклад) |
Admin (обсуждение | вклад) Нет описания правки |
||
| Строка 34: | Строка 34: | ||
{% endif %} | {% endif %} | ||
{{ response|json_dumps }} | {%- try -%} | ||
{{ response|json_dumps }} | |||
{%- catch -%} | |||
{{ response }} | |||
{%- endtry -%} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Текущая версия от 04:38, 26 июля 2024
Mindray BS120
{% set h = hl7_parse(data) %}
{% set response = {
'record': {
'id': str(h.segment('OBR')[2]).split()[0],
'timestamp': str(h.segment('OBR')[2]).split()[1]
},
'result': {
'message': {
'time': h.extract_field('MSH', 1, 7)
},
'request': {
'time_requested': h.extract_field('OBR', 1, 6),
'time_in': h.extract_field('OBR', 1, 7),
'time_out': h.extract_field('OBR', 1, 8)
},
'tests': {
'id': h.segment('OBX')[3][0],
'code': h.segment('OBX')[3][0],
'value': h.segment('OBX')[5][0],
'unit': h.segment('OBX')[6][0],
'references': h.segment('OBX')[7][0],
'abnormal': h.segment('OBX')[8][0],
'status': h.segment('OBX')[11][0],
'time': None
}
}
} %}
{% if h.segment('OBX')[14][0] %}
{% do pydash.set_with(response, 'result.tests.time', h.segment('OBX')[14][0]) %}
{% endif %}
{%- try -%}
{{ response|json_dumps }}
{%- catch -%}
{{ response }}
{%- endtry -%}