{ setPageSize('A5') }{ setOrientation('P') }{ setLeftMargin(10.0) }{ setTopMargin(5.0) }{ setRightMargin(10.0) }{ setBottomMargin(10.0) } {: tissues = dict([])} {for: act in actions} {tissues.data.setdefault(act.takenTissueJournal, []).append(act)} {end:} {: eval_strings = ["*(-----)", "(*----)", "(-*---)", "(--*--)", "(---*-)", "(----*)", "(-----)*"]} {: norm_bottom = lambda norm : float(norm[:(norm.find("-") if norm.find("-") != -1 else len(norm))].replace(",", "."))} {: norm_top = lambda norm : float(norm[(norm.find("-")+1 if norm.find("-") != -1 else 0):].replace(",", "."))} {: int_evaluation = lambda result, norm, norm_bottom, norm_top: (-1 if result < norm_bottom(norm) else (int((float(result) - norm_bottom(norm))/(norm_top(norm) - norm_bottom(norm))*4.999999999) if result <= norm_top(norm) else 5))} {: string_evaluation = lambda result, norm, norm_bottom, norm_top, int_evaluation: ["*(-----)", "(*----)", "(-*---)", "(--*--)", "(---*-)", "(----*)", "(-----)*"][int_evaluation(result, norm, norm_bottom, norm_top) + 1]} {: shows = dialogs.dialMultiBool(u"Необходимость указания колонки", [u"Указывать колонку 'Единица измерения'", u"Указывать колонку 'Норма'", u"Указывать колонку 'Оценка'"]).getVar()} {: show_unit = shows[0]} {: show_norm = shows[1]} {: show_eval = shows[2]}
{for: (i, tissue) in enumerate(tissues.data)} {: actions = tissues.data[tissue]} {: event = actions[0].event if len(actions) else None}
| ||||||||||
Ф.И.О.: {tissue.client.shortName} Диагноз: {event.diagnosises[0].MKB.code if event and len(event.diagnosises) else ""} (пациента) Ф.И.О.: {event.execPerson.shortName if event else ""} Номер и/б: {tissue.client.identification.byCode["77"]} (врача) Дата рождения: {tissue.client.birthDate.date.toString("dd.MM.yy")} Пол {tissue.client.sex} Дата взятия анализа: {tissue.datetimeTaken.date.toString("dd.MM.yy")} Дата выдачи анализа: {currentDate.date.toString("dd.MM.yy")} | ||||||||||
| ||||||||||
{actionType.name if actionType.name else u"Результаты лабораторных исследований"} | ||||||||||
| ||||||||||
| ||||||||||
| ||||||||||
Врач КЛД___________________________________ |
.
{end:}