-
Notifications
You must be signed in to change notification settings - Fork 14
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
Auto create case #3238
Auto create case #3238
Conversation
# Conflicts: # api/directions/views.py # directions/models.py
api/views.py
Outdated
@@ -76,12 +77,14 @@ | |||
from utils.common import non_selected_visible_type | |||
from utils.dates import try_parse_range, try_strptime | |||
from utils.nsi_directories import NSI | |||
from utils.xh import get_all_hospitals | |||
from utils.xh import get_all_hospitals, save_tmp_file, simple_join_two_pdf_files, simple_save_pdf_file |
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.xh.save_tmp_file' imported but unused
utils/xh.py
Outdated
from api.directions.sql_func import get_lab_podr | ||
from appconf.manager import SettingManager | ||
from laboratory.settings import QRCODE_OFFSET_SIZE, LEFT_QRCODE_OFFSET_SIZE | ||
from utils.flowable import QrCodeSite | ||
import datetime |
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] <811> reported by reviewdog 🐶
redefinition of unused 'datetime' from line 1
utils/xh.py
Outdated
|
||
today = datetime.datetime.now() | ||
date_now1 = datetime.datetime.strftime(today, "%y%m%d%H%M%S%f")[:-3] | ||
date_now_str = str(date_now1) |
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] <841> reported by reviewdog 🐶
local variable 'date_now_str' is assigned to but never used
params={'direction_numbers': direction_numbers}, | ||
) | ||
rows = namedtuplefetchall(cursor) | ||
return rows |
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 🐶
return rows | |
return rows |
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>
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>
utils/xh.py
Outdated
|
||
today = datetime.datetime.now() | ||
date_now1 = datetime.datetime.strftime(today, "%y%m%d%H%M%S%f")[:-3] | ||
date_now_str = str(date_now1) |
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] <841> reported by reviewdog 🐶
local variable 'date_now_str' is assigned to but never used
api/views.py
Outdated
price_name=13, | ||
case_id=napravleniye_case.pk, | ||
case_by_direction=True, | ||
plan_start_date=plan_date_start_case |
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 🐶
plan_start_date=plan_date_start_case | |
plan_start_date=plan_date_start_case, |
utils/xh.py
Outdated
|
||
|
||
def simple_join_two_pdf_files(files_data): | ||
|
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 🐶
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
api/views.py
Outdated
price_name=13, | ||
case_id=napravleniye_case.pk, | ||
case_by_direction=True, | ||
plan_start_date=plan_date_start_case |
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 🐶
plan_start_date=plan_date_start_case | |
plan_start_date=plan_date_start_case, |
api/views.py
Outdated
price_name=13, | ||
case_id=napravleniye_case.pk, | ||
case_by_direction=True, | ||
plan_start_date=plan_date_start_case |
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 🐶
plan_start_date=plan_date_start_case | |
plan_start_date=plan_date_start_case, |
api/views.py
Outdated
price_name=13, | ||
case_id=napravleniye_case.pk, | ||
case_by_direction=True, | ||
plan_start_date=plan_date_start_case |
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 🐶
plan_start_date=plan_date_start_case | |
plan_start_date=plan_date_start_case, |
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>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
api/views.py
Outdated
@@ -23,7 +24,7 @@ | |||
UNLIMIT_PERIOD_STATISTIC_GROUP, | |||
TITLE_REPORT_FILTER_HAS_ALL_FIN_SOURCE, | |||
STATISTIC_TYPE_DEPARTMENT, | |||
USE_TFOMS_DISTRICT, | |||
USE_TFOMS_DISTRICT, TYPE_COMPANY_SET_DIRECTION_PDF, |
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 🐶
USE_TFOMS_DISTRICT, TYPE_COMPANY_SET_DIRECTION_PDF, | |
USE_TFOMS_DISTRICT, | |
TYPE_COMPANY_SET_DIRECTION_PDF, |
api/views.py
Outdated
price_name=13, | ||
case_id=case_direction_number, | ||
case_by_direction=True, | ||
plan_start_date=plan_date_start_case |
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 🐶
plan_start_date=plan_date_start_case | |
plan_start_date=plan_date_start_case, |
api/views.py
Outdated
napravleniye_case = directions.Napravleniya.gen_napravleniye( | ||
card_id, | ||
doc, | ||
financing_source, | ||
"", | ||
"", | ||
doc, | ||
-1, | ||
doc, | ||
price_name_id=13 | ||
) | ||
|
||
issledovaniye_case = directions.Issledovaniya( | ||
napravleniye=napravleniye_case, | ||
research=research_case, | ||
deferred=False, | ||
plan_start_date=plan_date_start_case | ||
) |
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 🐶
napravleniye_case = directions.Napravleniya.gen_napravleniye( | |
card_id, | |
doc, | |
financing_source, | |
"", | |
"", | |
doc, | |
-1, | |
doc, | |
price_name_id=13 | |
) | |
issledovaniye_case = directions.Issledovaniya( | |
napravleniye=napravleniye_case, | |
research=research_case, | |
deferred=False, | |
plan_start_date=plan_date_start_case | |
) | |
napravleniye_case = directions.Napravleniya.gen_napravleniye(card_id, doc, financing_source, "", "", doc, -1, doc, price_name_id=13) | |
issledovaniye_case = directions.Issledovaniya(napravleniye=napravleniye_case, research=research_case, deferred=False, plan_start_date=plan_date_start_case) |
api/views.py
Outdated
@@ -23,7 +24,7 @@ | |||
UNLIMIT_PERIOD_STATISTIC_GROUP, | |||
TITLE_REPORT_FILTER_HAS_ALL_FIN_SOURCE, | |||
STATISTIC_TYPE_DEPARTMENT, | |||
USE_TFOMS_DISTRICT, | |||
USE_TFOMS_DISTRICT, TYPE_COMPANY_SET_DIRECTION_PDF, |
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 🐶
USE_TFOMS_DISTRICT, TYPE_COMPANY_SET_DIRECTION_PDF, | |
USE_TFOMS_DISTRICT, | |
TYPE_COMPANY_SET_DIRECTION_PDF, |
api/views.py
Outdated
price_name=13, | ||
case_id=case_direction_number, | ||
case_by_direction=True, | ||
plan_start_date=plan_date_start_case |
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 🐶
plan_start_date=plan_date_start_case | |
plan_start_date=plan_date_start_case, |
api/views.py
Outdated
@@ -23,7 +24,7 @@ | |||
UNLIMIT_PERIOD_STATISTIC_GROUP, | |||
TITLE_REPORT_FILTER_HAS_ALL_FIN_SOURCE, | |||
STATISTIC_TYPE_DEPARTMENT, | |||
USE_TFOMS_DISTRICT, | |||
USE_TFOMS_DISTRICT, TYPE_COMPANY_SET_DIRECTION_PDF, |
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 🐶
USE_TFOMS_DISTRICT, TYPE_COMPANY_SET_DIRECTION_PDF, | |
USE_TFOMS_DISTRICT, | |
TYPE_COMPANY_SET_DIRECTION_PDF, |
api/views.py
Outdated
price_name=13, | ||
case_id=case_direction_number, | ||
case_by_direction=True, | ||
plan_start_date=plan_start_date_case |
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 🐶
plan_start_date=plan_start_date_case | |
plan_start_date=plan_start_date_case, |
api/views.py
Outdated
issledovaniye_case = directions.Issledovaniya( | ||
napravleniye=napravleniye_case, | ||
research=research_case, | ||
deferred=False, | ||
plan_start_date=plan_start_date_case | ||
) |
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 🐶
issledovaniye_case = directions.Issledovaniya( | |
napravleniye=napravleniye_case, | |
research=research_case, | |
deferred=False, | |
plan_start_date=plan_start_date_case | |
) | |
issledovaniye_case = directions.Issledovaniya(napravleniye=napravleniye_case, research=research_case, deferred=False, plan_start_date=plan_start_date_case) |
directions/models.py
Outdated
@@ -1563,7 +1557,6 @@ def gen_napravleniya_by_issledovaniya( | |||
hospital=hospital_override, | |||
external_order=external_order, | |||
price_name_id=price_name, | |||
slot_fact_id=slot_fact_id, |
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.
Тут что то странное происходит
directions/models.py
Outdated
if slot_fact_id: | ||
from doctor_schedule.models import SlotFact | ||
|
||
f = SlotFact.objects.get(pk=slot_fact_id) |
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.
И тут странное
api/views.py
Outdated
files_data.append(saved_file_pdf) | ||
|
||
buffer = simple_join_two_pdf_files(files_data) | ||
saved_file_pdf = simple_save_pdf_file(buffer) |
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.
А в чем смысл каждый раз тут что то сохранять?
А не печатать PDF как раньше?
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.
Почему не разделить процесс генерации случая и его печати?
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.
Тогда не надо делать так, как сделано:
- в api лежит печать
- каждый раз что то сохраняем
api/views.py
Outdated
from .dicom import search_dicom_study | ||
from .directions.sql_func import get_lab_podr | ||
from .sql_func import users_by_group, users_all, get_diagnoses, get_resource_researches, search_data_by_param, search_text_stationar | ||
from .sql_func import users_by_group, users_all, get_diagnoses, get_resource_researches, search_data_by_param, search_text_stationar, search_case_by_card_date |
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 🐶
'.sql_func.search_case_by_card_date' imported but unused
directions/views.py
Outdated
@@ -26,17 +26,21 @@ | |||
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, PageBreak | |||
from transliterate import translit | |||
|
|||
import directions |
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' imported but unused
@@ -1040,3 +1044,95 @@ def px(x=0.0): | |||
def pxr(x=0.0): | |||
x *= mm | |||
return w - x | |||
|
|||
def create_case_by_cards(cards): |
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
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>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
directions/views.py
Outdated
price_name=None, | ||
case_id=case_direction_number, | ||
case_by_direction=True, | ||
plan_start_date=plan_start_date_case |
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 🐶
plan_start_date=plan_start_date_case | |
plan_start_date=plan_start_date_case, |
directions/views.py
Outdated
issledovaniye_case = Issledovaniya( | ||
napravleniye=napravleniye_case, | ||
research=research_case, | ||
deferred=False, | ||
plan_start_date=plan_start_date_case | ||
) |
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 🐶
issledovaniye_case = Issledovaniya( | |
napravleniye=napravleniye_case, | |
research=research_case, | |
deferred=False, | |
plan_start_date=plan_start_date_case | |
) | |
issledovaniye_case = Issledovaniya(napravleniye=napravleniye_case, research=research_case, deferred=False, plan_start_date=plan_start_date_case) |
directions/views.py
Outdated
price_name=None, | ||
case_id=case_direction_number, | ||
case_by_direction=True, | ||
plan_start_date=plan_start_date_case |
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 🐶
plan_start_date=plan_start_date_case | |
plan_start_date=plan_start_date_case, |
|
||
|
||
|
||
def create_case_by_cards(cards): |
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] <303> reported by reviewdog 🐶
too many blank lines (3)
directions/views.py
Outdated
@@ -1040,3 +1043,92 @@ def px(x=0.0): | |||
def pxr(x=0.0): | |||
x *= mm | |||
return w - x | |||
|
|||
|
|||
|
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 🐶
Описание изменений
Auto create case, print set document for many people