Skip to content
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

Merged
merged 37 commits into from
Oct 17, 2023
Merged

Print result form pdf #3129

merged 37 commits into from
Oct 17, 2023

Conversation

urchinpro
Copy link
Collaborator

Описание изменений

Подготовка формы резултатат для дополнительных данных. Возможность формирвоать любой бланк

@@ -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)
Copy link
Contributor

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.

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
Copy link
Contributor

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

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
Copy link
Contributor

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

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
Copy link
Contributor

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

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
Copy link
Contributor

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

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") ))
Copy link
Contributor

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 ')'

@@ -1,4 +1,7 @@
import pytz_deprecation_shim as pytz

import directions.models
Copy link
Contributor

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):
Copy link
Contributor

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

[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)]
Copy link
Contributor

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")
Copy link
Contributor

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]
Copy link
Contributor

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 🐶

Suggested change
} for i in prices]
}
for i in prices
]

Comment on lines +156 to +157
'<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)),
Copy link
Contributor

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 🐶

Suggested change
'<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/laboratory_form.py Outdated Show resolved Hide resolved
results/laboratory_form.py Outdated Show resolved Hide resolved
results/laboratory_form.py Outdated Show resolved Hide resolved
results/prepare_data.py Outdated Show resolved Hide resolved
results/prepare_data.py Outdated Show resolved Hide resolved
Comment on lines 382 to 383
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)]

Copy link
Contributor

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 🐶

Suggested change
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)]
[Paragraph(f"Заказчик: {direction.hospital.safe_short_title}", styleBold), Paragraph(f"", styleText)],

results/prepare_data.py Outdated Show resolved Hide resolved
results/views.py Outdated Show resolved Hide resolved
results/prepare_data.py Outdated Show resolved Hide resolved
urchinpro and others added 3 commits October 16, 2023 03:11
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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Comment on lines 50 to 51
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
Copy link
Contributor

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 🐶

Suggested change
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,
)

urchinpro and others added 3 commits October 16, 2023 03:13
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>
Comment on lines 266 to 268
data.append(
[Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])]
)
Copy link
Contributor

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 🐶

Suggested change
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"])])

Comment on lines 747 to 748
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}",
styleLeft),
Copy link
Contributor

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 🐶

Suggested change
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),

Paragraph(
"* Референсные значения приводятся с учетом возраста, пола, фазы менструального цикла, срока беременности. "
"Результаты исследований не являются диагнозом, необходима консультация специалиста.",
styleLeftFont7),
Copy link
Contributor

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 🐶

Suggested change
styleLeftFont7),
styleLeftFont7,
),

Comment on lines 266 to 268
data.append(
[Paragraph('<font face="FreeSans" size="8">S - чувствителен; R - резистентен; I - промежуточная чувствительность;</font>', styleSheet["BodyText"])]
)
Copy link
Contributor

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 🐶

Suggested change
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"])])

Comment on lines 302 to 304
Paragraph(
'<font face="FreeSans" size="8">%s</font>' % ("Не подтверждено" if not iss.time_confirmation else strdate(iss.time_confirmation)), styleSheet["BodyText"]
),
Copy link
Contributor

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 🐶

Suggested change
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"]),

Comment on lines 749 to 750
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}",
styleLeft),
Copy link
Contributor

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 🐶

Suggested change
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),

Paragraph(
"* Референсные значения приводятся с учетом возраста, пола, фазы менструального цикла, срока беременности. "
"Результаты исследований не являются диагнозом, необходима консультация специалиста.",
styleLeftFont7),
Copy link
Contributor

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 🐶

Suggested change
styleLeftFont7),
styleLeftFont7,
),

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Comment on lines 745 to 746
Paragraph(f"Дата, время выполнения: {strdate(iss.time_confirmation, short_year=False)} {strtime(iss.time_confirmation)[0:5]}{laboratory_analyzer}",
styleLeft),
Copy link
Contributor

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 🐶

Suggested change
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 Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Comment on lines 376 to 377
[Paragraph(f"Пол/Возраст: {direction.client.individual.sex} / {individual_birthday} {direction.client.individual.age_s(direction=direction)}", styleBold),
data_get],
Copy link
Contributor

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 🐶

Suggested change
[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],

urchinpro and others added 4 commits October 16, 2023 11:15
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):
Copy link
Contributor

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

@urchinpro urchinpro requested review from mikhailprivalov and removed request for mikhailprivalov October 16, 2023 03:37
@mikhailprivalov mikhailprivalov merged commit bb5d459 into develop Oct 17, 2023
@delete-merged-branch delete-merged-branch bot deleted the printResult_formPdf branch October 17, 2023 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants