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

Auto create case #3238

Merged
merged 35 commits into from
Nov 21, 2023
Merged

Auto create case #3238

merged 35 commits into from
Nov 21, 2023

Conversation

urchinpro
Copy link
Collaborator

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

Auto create case, print set document for many people

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

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

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/sql_func.py Outdated Show resolved Hide resolved
params={'direction_numbers': direction_numbers},
)
rows = namedtuplefetchall(cursor)
return rows
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
return rows
return rows

api/views.py Outdated Show resolved Hide resolved
api/views.py Outdated Show resolved Hide resolved
api/views.py Outdated Show resolved Hide resolved
api/views.py Outdated Show resolved Hide resolved
directions/models.py Outdated Show resolved Hide resolved
directions/models.py Show resolved Hide resolved
utils/xh.py Outdated Show resolved Hide resolved
utils/xh.py Show resolved Hide resolved
urchinpro and others added 5 commits November 20, 2023 14:44
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)
Copy link
Contributor

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

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

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
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
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
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
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
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
plan_start_date=plan_date_start_case
plan_start_date=plan_date_start_case,

directions/models.py Outdated Show resolved Hide resolved
urchinpro and others added 5 commits November 20, 2023 14:51
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,
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
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
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
plan_start_date=plan_date_start_case
plan_start_date=plan_date_start_case,

api/views.py Outdated
Comment on lines 3357 to 3374
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
)
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
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,
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
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
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
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,
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
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
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
plan_start_date=plan_start_date_case
plan_start_date=plan_start_date_case,

api/views.py Outdated
Comment on lines 3370 to 3375
issledovaniye_case = directions.Issledovaniya(
napravleniye=napravleniye_case,
research=research_case,
deferred=False,
plan_start_date=plan_start_date_case
)
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
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)

@@ -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,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут что то странное происходит

if slot_fact_id:
from doctor_schedule.models import SlotFact

f = SlotFact.objects.get(pk=slot_fact_id)
Copy link
Owner

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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А в чем смысл каждый раз тут что то сохранять?
А не печатать PDF как раньше?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему не разделить процесс генерации случая и его печати?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тогда не надо делать так, как сделано:

  1. в api лежит печать
  2. каждый раз что то сохраняем

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
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 🐶
'.sql_func.search_case_by_card_date' imported but unused

@@ -26,17 +26,21 @@
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, PageBreak
from transliterate import translit

import directions
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' 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):
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

directions/views.py Show resolved Hide resolved
directions/views.py Outdated Show resolved Hide resolved
directions/views.py Outdated Show resolved Hide resolved
utils/xh.py Outdated Show resolved Hide resolved
urchinpro and others added 5 commits November 21, 2023 08:39
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>
price_name=None,
case_id=case_direction_number,
case_by_direction=True,
plan_start_date=plan_start_date_case
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
plan_start_date=plan_start_date_case
plan_start_date=plan_start_date_case,

Comment on lines 1105 to 1110
issledovaniye_case = Issledovaniya(
napravleniye=napravleniye_case,
research=research_case,
deferred=False,
plan_start_date=plan_start_date_case
)
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
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)

price_name=None,
case_id=case_direction_number,
case_by_direction=True,
plan_start_date=plan_start_date_case
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
plan_start_date=plan_start_date_case
plan_start_date=plan_start_date_case,




def create_case_by_cards(cards):
Copy link
Contributor

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)

@@ -1040,3 +1043,92 @@ def px(x=0.0):
def pxr(x=0.0):
x *= mm
return w - x



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

@mikhailprivalov mikhailprivalov merged commit 35cfdbe into develop Nov 21, 2023
6 checks passed
@delete-merged-branch delete-merged-branch bot deleted the autoCreateCase branch November 21, 2023 02:33
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