-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print result form pdf #3129
Print result form pdf #3129
Conversation
# Conflicts: # results/views.py
api/laboratory/views.py
Outdated
@@ -820,6 +820,7 @@ def receive_history(request): | |||
date1 = datetime_safe.datetime.today().replace(hour=0, minute=0, second=0, microsecond=0) | |||
date2 = datetime_safe.datetime.now() | |||
lpk = request_data["currentLaboratory"] | |||
print(lpk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <201> reported by reviewdog 🐶
print found.
results/laboratory_form.py
Outdated
from appconf.manager import SettingManager | ||
from directions.models import Result | ||
from refprocessor.common import RANGE_IN, RANGE_NOT_IN | ||
from utils.flowable import InteractiveTextField, QrCodeSite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'utils.flowable.QrCodeSite' imported but unused
results/laboratory_form.py
Outdated
from directions.models import Result | ||
from refprocessor.common import RANGE_IN, RANGE_NOT_IN | ||
from utils.flowable import InteractiveTextField, QrCodeSite | ||
from reportlab.platypus import PageBreak, Spacer, KeepTogether, Flowable, Frame, PageTemplate, NextPageTemplate, BaseDocTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'reportlab.platypus.PageBreak' imported but unused
results/laboratory_form.py
Outdated
from directions.models import Result | ||
from refprocessor.common import RANGE_IN, RANGE_NOT_IN | ||
from utils.flowable import InteractiveTextField, QrCodeSite | ||
from reportlab.platypus import PageBreak, Spacer, KeepTogether, Flowable, Frame, PageTemplate, NextPageTemplate, BaseDocTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'reportlab.platypus.KeepTogether' imported but unused
results/laboratory_form.py
Outdated
from directions.models import Result | ||
from refprocessor.common import RANGE_IN, RANGE_NOT_IN | ||
from utils.flowable import InteractiveTextField, QrCodeSite | ||
from reportlab.platypus import PageBreak, Spacer, KeepTogether, Flowable, Frame, PageTemplate, NextPageTemplate, BaseDocTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'reportlab.platypus.Flowable' imported but unused
results/laboratory_form.py
Outdated
def self_watermarks_func(canvas_mark): | ||
canvas_mark.line(10 * mm, 10.7 * mm, 200 * mm, 10.7 * mm) | ||
canvas_mark.setFont('FreeSans', 7) | ||
canvas_mark.drawString(120 * mm, 8 * mm, 'Исследования выполнены в {} {} {}'.format(SettingManager.get("org_title"), SettingManager.get("org_www"), SettingManager.get("org_phones") )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [flake8] <202> reported by reviewdog 🐶
whitespace before ')'
results/prepare_data.py
Outdated
@@ -1,4 +1,7 @@ | |||
import pytz_deprecation_shim as pytz | |||
|
|||
import directions.models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'directions.models' imported but unused
return "" | ||
return data_t.strftime("%d.%m.%Y %H:%M") | ||
|
||
def gen_hospital_stamp(direction): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1
results/prepare_data.py
Outdated
[Paragraph(f"Пол/Возраст: {direction.client.individual.sex} / {individual_birthday} {direction.client.individual.age_s(direction=direction)}", styleBold), | ||
data_get], | ||
[Paragraph(f"Медкарта: {direction.client.number}", styleBold), data_receive], | ||
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <541> reported by reviewdog 🐶
f-string is missing placeholders
results/views.py
Outdated
t.setStyle(style_t) | ||
fwb.append(t) | ||
laboratory_form = import_string('results.laboratory_form.' + RESULT_LABORATORY_FORM) | ||
print("custom") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <201> reported by reviewdog 🐶
print found.
"title": i.title, | ||
"dateStart": i.date_start, | ||
"dateEnd": i.date_end, | ||
} for i in prices] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
} for i in prices] | |
} | |
for i in prices | |
] |
'<font face="FreeSansBold" size="7">%s</font>' | ||
% ("" if not iss.tubes.exists() or not iss.tubes.first().time_get else strdate(iss.tubes.first().time_get)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
'<font face="FreeSansBold" size="7">%s</font>' | |
% ("" if not iss.tubes.exists() or not iss.tubes.first().time_get else strdate(iss.tubes.first().time_get)), | |
'<font face="FreeSansBold" size="7">%s</font>' % ("" if not iss.tubes.exists() or not iss.tubes.first().time_get else strdate(iss.tubes.first().time_get)), |
results/prepare_data.py
Outdated
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)] | |
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)], |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
results/views.py
Outdated
@@ -47,14 +47,16 @@ | |||
from clients.models import CardBase | |||
from directions.models import Issledovaniya, Result, Napravleniya, ParaclinicResult, Recipe, DirectionDocument, DocumentSign | |||
from laboratory.decorators import logged_in_or_token | |||
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS | |||
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS, \ | |||
RESULT_LABORATORY_FORM, SELF_WATERMARKS | |||
from laboratory.settings import FONTS_FOLDER | |||
from laboratory.utils import strdate, strtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'laboratory.utils.strtime' imported but unused
results/views.py
Outdated
@@ -47,14 +47,16 @@ | |||
from clients.models import CardBase | |||
from directions.models import Issledovaniya, Result, Napravleniya, ParaclinicResult, Recipe, DirectionDocument, DocumentSign | |||
from laboratory.decorators import logged_in_or_token | |||
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS | |||
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS, \ | |||
RESULT_LABORATORY_FORM, SELF_WATERMARKS | |||
from laboratory.settings import FONTS_FOLDER | |||
from laboratory.utils import strdate, strtime | |||
from podrazdeleniya.models import Podrazdeleniya | |||
from refprocessor.common import RANGE_NOT_IN, RANGE_IN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'refprocessor.common.RANGE_NOT_IN' imported but unused
results/views.py
Outdated
@@ -47,14 +47,16 @@ | |||
from clients.models import CardBase | |||
from directions.models import Issledovaniya, Result, Napravleniya, ParaclinicResult, Recipe, DirectionDocument, DocumentSign | |||
from laboratory.decorators import logged_in_or_token | |||
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS | |||
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS, \ | |||
RESULT_LABORATORY_FORM, SELF_WATERMARKS | |||
from laboratory.settings import FONTS_FOLDER | |||
from laboratory.utils import strdate, strtime | |||
from podrazdeleniya.models import Podrazdeleniya | |||
from refprocessor.common import RANGE_NOT_IN, RANGE_IN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <401> reported by reviewdog 🐶
'refprocessor.common.RANGE_IN' imported but unused
results/views.py
Outdated
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS, \ | ||
RESULT_LABORATORY_FORM, SELF_WATERMARKS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
from laboratory.settings import DEATH_RESEARCH_PK, LK_USER, SYSTEM_AS_VI, QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE, GISTOLOGY_RESEARCH_PK, RESEARCHES_NOT_PRINT_FOOTERS, \ | |
RESULT_LABORATORY_FORM, SELF_WATERMARKS | |
from laboratory.settings import ( | |
DEATH_RESEARCH_PK, | |
LK_USER, | |
SYSTEM_AS_VI, | |
QRCODE_OFFSET_SIZE, | |
LEFT_QRCODE_OFFSET_SIZE, | |
GISTOLOGY_RESEARCH_PK, | |
RESEARCHES_NOT_PRINT_FOOTERS, | |
RESULT_LABORATORY_FORM, | |
SELF_WATERMARKS, | |
) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
results/laboratory_form.py
Outdated
data.append( | ||
[Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
data.append( | |
[Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])] | |
) | |
data.append([Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])]) |
results/laboratory_form.py
Outdated
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", | ||
styleLeft), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", | |
styleLeft), | |
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", styleLeft), |
results/laboratory_form.py
Outdated
Paragraph( | ||
"* Референсные значения приводятся с учетом возраста, пола, фазы менструального цикла, срока беременности. " | ||
"Результаты исследований не являются диагнозом, необходима консультация специалиста.", | ||
styleLeftFont7), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
styleLeftFont7), | |
styleLeftFont7, | |
), |
results/laboratory_form.py
Outdated
data.append( | ||
[Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
data.append( | |
[Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])] | |
) | |
data.append([Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])]) |
results/laboratory_form.py
Outdated
Paragraph( | ||
'<font face="FreeSans" size="8">%s</font>' % ("Не подтверждено" if not iss.time_confirmation else strdate(iss.time_confirmation)), styleSheet["BodyText"] | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
Paragraph( | |
'<font face="FreeSans" size="8">%s</font>' % ("Не подтверждено" if not iss.time_confirmation else strdate(iss.time_confirmation)), styleSheet["BodyText"] | |
), | |
Paragraph('<font face="FreeSans" size="8">%s</font>' % ("Не подтверждено" if not iss.time_confirmation else strdate(iss.time_confirmation)), styleSheet["BodyText"]), |
results/laboratory_form.py
Outdated
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", | ||
styleLeft), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", | |
styleLeft), | |
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", styleLeft), |
results/laboratory_form.py
Outdated
Paragraph( | ||
"* Референсные значения приводятся с учетом возраста, пола, фазы менструального цикла, срока беременности. " | ||
"Результаты исследований не являются диагнозом, необходима консультация специалиста.", | ||
styleLeftFont7), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
styleLeftFont7), | |
styleLeftFont7, | |
), |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
results/laboratory_form.py
Outdated
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", | ||
styleLeft), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", | |
styleLeft), | |
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}", styleLeft), |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
results/prepare_data.py
Outdated
[Paragraph(f"Пол/Возраст: {direction.client.individual.sex} / {individual_birthday} {direction.client.individual.age_s(direction=direction)}", styleBold), | ||
data_get], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black-format] reported by reviewdog 🐶
[Paragraph(f"Пол/Возраст: {direction.client.individual.sex} / {individual_birthday} {direction.client.individual.age_s(direction=direction)}", styleBold), | |
data_get], | |
[Paragraph(f"Пол/Возраст: {direction.client.individual.sex} / {individual_birthday} {direction.client.individual.age_s(direction=direction)}", styleBold), data_get], |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
return "" | ||
return data_t.strftime("%d.%m.%Y %H:%M") | ||
|
||
def gen_hospital_stamp(direction): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1
Описание изменений
Подготовка формы резултатат для дополнительных данных. Возможность формирвоать любой бланк