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

Applications modal #3060

Closed
wants to merge 214 commits into from
Closed
Show file tree
Hide file tree
Changes from 183 commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
10fd783
education data
urchinpro Aug 15, 2023
264f824
admin
urchinpro Aug 15, 2023
f22dbf0
Создание компонента
Wellheor1 Aug 16, 2023
b2ec98d
Merge remote-tracking branch 'origin/educationDocument' into list_enr…
Wellheor1 Aug 16, 2023
ce86683
.
Wellheor1 Aug 16, 2023
1f87ba6
Подключение к ММИС
Wellheor1 Aug 16, 2023
88aa003
black fix
Wellheor1 Aug 16, 2023
934fd15
Merge pull request #3011 from moodpulse/database_connection_new_param
urchinpro Aug 16, 2023
3b5b422
.
Wellheor1 Aug 16, 2023
cb0c5d0
Merge branch 'database_connection_new_param' into get_current_enrollee
Wellheor1 Aug 16, 2023
97f4d21
.
Wellheor1 Aug 16, 2023
d8f0722
Merge pull request #3012 from moodpulse/get_current_enrollee
urchinpro Aug 16, 2023
cc627c7
exclude hl7_rule
urchinpro Aug 17, 2023
a5325c4
Merge branch 'educationDocument' into list_enrollee
Wellheor1 Aug 17, 2023
246fdd6
.
Wellheor1 Aug 17, 2023
6768c00
.
Wellheor1 Aug 17, 2023
b4bbb7f
.
Wellheor1 Aug 17, 2023
ddc0f38
Панель фильтров - разметка
Wellheor1 Aug 18, 2023
51866f1
Update Enrollees.vue
Wellheor1 Aug 21, 2023
ceec0bf
Кнопки
Wellheor1 Aug 22, 2023
88dfff8
fix
Wellheor1 Aug 23, 2023
eac665d
API - справочники
Wellheor1 Aug 23, 2023
07d0ce5
API - справочники + абитуриенты
Wellheor1 Aug 24, 2023
16e1423
Образование - справочники
Wellheor1 Aug 24, 2023
a52ccd1
admin+fix
Wellheor1 Aug 24, 2023
e8d1930
Гражданство + fixы
Wellheor1 Aug 24, 2023
126992a
.
Wellheor1 Aug 24, 2023
f4b9a85
black
Wellheor1 Aug 24, 2023
77c1501
.
Wellheor1 Aug 25, 2023
06929c4
.
Wellheor1 Aug 25, 2023
94a994e
.
Wellheor1 Aug 25, 2023
d71f74c
Модели+админка
Wellheor1 Aug 25, 2023
c67c861
Update education/admin.py
Wellheor1 Aug 25, 2023
e409d33
fix
Wellheor1 Aug 25, 2023
0338a6f
fix 2
Wellheor1 Aug 25, 2023
df374b8
black
Wellheor1 Aug 25, 2023
0ced33c
Получение измененний по абитуриентам
Wellheor1 Aug 25, 2023
4237b7d
дата подачи заявления
Wellheor1 Aug 25, 2023
ce78a7f
.
Wellheor1 Aug 25, 2023
5a3e222
fix
Wellheor1 Aug 28, 2023
9fb6dd5
Merge pull request #3026 from moodpulse/handbooks_enrollees
urchinpro Aug 28, 2023
9735dde
Merge branch 'educationDocument' into get_mmis_data
Wellheor1 Aug 28, 2023
c96708b
fix admin-models
Wellheor1 Aug 28, 2023
c70f951
Merge branch 'develop' into educationDocument
urchinpro Aug 28, 2023
7a9c7ff
Merge remote-tracking branch 'origin/educationDocument' into educatio…
urchinpro Aug 28, 2023
f1e5f25
.
Wellheor1 Aug 28, 2023
3d36a6f
Merge branch 'educationDocument' into get_mmis_data
urchinpro Aug 28, 2023
ae0b55a
fix
Wellheor1 Aug 28, 2023
b4123cd
.
Wellheor1 Aug 28, 2023
d750224
Update education/sql_func.py
Wellheor1 Aug 28, 2023
40a307c
Merge pull request #3034 from moodpulse/get_mmis_data
urchinpro Aug 28, 2023
4ef1568
Merge branch 'develop' into list_enrollee
Wellheor1 Aug 28, 2023
5676490
Merge branch 'educationDocument' into list_enrollee
Wellheor1 Aug 28, 2023
70d9439
api
Wellheor1 Aug 28, 2023
1758448
API - справочники
Wellheor1 Aug 28, 2023
cf16635
Update users/models.py
Wellheor1 Aug 29, 2023
985836b
fix
Wellheor1 Aug 29, 2023
f22af4d
fix
urchinpro Aug 29, 2023
ddf1c0a
fix
urchinpro Aug 29, 2023
98e53d4
fix
urchinpro Aug 29, 2023
5f87c2f
fix
urchinpro Aug 29, 2023
7686049
fix
urchinpro Aug 29, 2023
3f2f749
Update education/main.py
urchinpro Aug 29, 2023
6642a0b
Update education/main.py
urchinpro Aug 29, 2023
3e08e34
Update education/views.py
urchinpro Aug 29, 2023
112e088
Update education/views.py
urchinpro Aug 29, 2023
b72e09b
Update laboratory/settings.py
urchinpro Aug 29, 2023
74eb68c
Merge pull request #3036 from moodpulse/educationDocument_settings
urchinpro Aug 29, 2023
ad907e7
Merge branch 'educationDocument' into list_enrollee
Wellheor1 Aug 29, 2023
9247b66
Merge pull request #3025 from moodpulse/list_enrollee
urchinpro Aug 29, 2023
251f121
fixs
Wellheor1 Aug 29, 2023
eed8832
import mmis reference books
urchinpro Aug 30, 2023
55779d2
модели, сохранение
urchinpro Aug 30, 2023
9ddc03c
fix
urchinpro Aug 30, 2023
a339cb6
Модалка с заявлением в карту
Wellheor1 Aug 30, 2023
0c68a41
fix
urchinpro Aug 30, 2023
b04ec1e
Update education/models.py
urchinpro Aug 30, 2023
723926b
Update education/views.py
urchinpro Aug 30, 2023
0b51578
Update education/models.py
urchinpro Aug 30, 2023
b9f8eed
Update education/management/commands/subject_import.py
urchinpro Aug 30, 2023
583785f
Update education/admin.py
urchinpro Aug 30, 2023
c26939a
Update education/admin.py
urchinpro Aug 30, 2023
e3412ab
Update education/admin.py
urchinpro Aug 30, 2023
6800d6c
Update education/admin.py
urchinpro Aug 30, 2023
2c98ed2
Update education/admin.py
urchinpro Aug 30, 2023
5ebc350
Update education/models.py
urchinpro Aug 30, 2023
dbf58ac
Update education/models.py
urchinpro Aug 30, 2023
bfb38a0
Merge pull request #3041 from moodpulse/educationDocument_updatePerson
urchinpro Aug 30, 2023
78b2272
fix
urchinpro Aug 30, 2023
9017a95
Merge branch 'educationDocument' into applications_modal
Wellheor1 Aug 31, 2023
f7244a3
fixs
Wellheor1 Aug 31, 2023
db6cf28
fixs
Wellheor1 Aug 31, 2023
b2a822f
созранение
urchinpro Aug 31, 2023
3748ca7
fix
urchinpro Aug 31, 2023
65758ff
fix
urchinpro Aug 31, 2023
4ca5404
fixs
Wellheor1 Aug 31, 2023
0cca98b
fix
urchinpro Aug 31, 2023
44fc48b
Update education/views.py
urchinpro Aug 31, 2023
c46a92e
Update education/views.py
urchinpro Aug 31, 2023
404f021
Update education/views.py
urchinpro Aug 31, 2023
d1a4ca7
Update education/views.py
urchinpro Aug 31, 2023
05ff66a
Update education/views.py
urchinpro Aug 31, 2023
a3c83a6
Update education/main.py
urchinpro Aug 31, 2023
f060726
Update education/main.py
urchinpro Aug 31, 2023
ecbe378
Update education/admin.py
urchinpro Aug 31, 2023
5731a2e
Update education/main.py
urchinpro Aug 31, 2023
2cd2249
Update education/main.py
urchinpro Aug 31, 2023
90259c7
fixs
Wellheor1 Aug 31, 2023
1ac3563
.
urchinpro Aug 31, 2023
ee2e28d
Merge remote-tracking branch 'origin/api_educationDocument' into api_…
urchinpro Aug 31, 2023
e53a09d
fix
urchinpro Aug 31, 2023
27874f3
Update education/views.py
urchinpro Aug 31, 2023
2e27c0b
Merge pull request #3043 from moodpulse/api_educationDocument
urchinpro Aug 31, 2023
0dac0d3
fix
urchinpro Aug 31, 2023
39ecd22
.
Wellheor1 Aug 31, 2023
b310907
Merge branch 'educationDocument' into applications_modal
Wellheor1 Aug 31, 2023
3b897cc
Получение абитуриентов
Wellheor1 Aug 31, 2023
e2e41f1
.
urchinpro Aug 31, 2023
e32f67f
fixs
Wellheor1 Aug 31, 2023
ef887b9
фильтр по специальностям
Wellheor1 Aug 31, 2023
93a87df
fix
urchinpro Sep 1, 2023
50ee3b0
fix
urchinpro Sep 1, 2023
6517ef5
fix
urchinpro Sep 1, 2023
5f6ddda
Merge pull request #3044 from moodpulse/req_educationDocument
urchinpro Sep 1, 2023
0aa49d4
Год набора + fix
Wellheor1 Sep 1, 2023
495439d
Merge branch 'educationDocument' into applications_modal
Wellheor1 Sep 1, 2023
fc2d72e
fixs
Wellheor1 Sep 1, 2023
e2d524b
fix
Wellheor1 Sep 1, 2023
9f05fd6
fixs
Wellheor1 Sep 1, 2023
7301b4c
filters
urchinpro Sep 1, 2023
5a52ced
fix
urchinpro Sep 1, 2023
75989e4
fix
urchinpro Sep 1, 2023
7cb11e0
Merge pull request #3047 from moodpulse/filters_education
Wellheor1 Sep 1, 2023
ceb950f
fix
urchinpro Sep 2, 2023
9317bb7
Merge pull request #3048 from moodpulse/filters_education
urchinpro Sep 2, 2023
f30fd29
Достижение, фио - в модалку, контракт на дашборд
Wellheor1 Sep 2, 2023
397fedd
fix
urchinpro Sep 2, 2023
4df4d39
fix
urchinpro Sep 2, 2023
363f083
fix
urchinpro Sep 2, 2023
866582d
Merge pull request #3049 from moodpulse/application_achievement
urchinpro Sep 2, 2023
7fba358
Merge branch 'applications_modal' into fix_achivment
Wellheor1 Sep 2, 2023
c9777db
.
Wellheor1 Sep 2, 2023
f059fbf
Год по умолчанию
Wellheor1 Sep 2, 2023
402ed66
lint fix
Wellheor1 Sep 2, 2023
f450de5
get direction confirm where research is contract
urchinpro Sep 2, 2023
c2ffcf7
Merge remote-tracking branch 'origin/contract_link' into fix_year_app…
Wellheor1 Sep 2, 2023
fe1fb2f
Ссылка на договор
Wellheor1 Sep 2, 2023
8c806c1
Merge pull request #3050 from moodpulse/fix_year_application
Wellheor1 Sep 2, 2023
c543381
зависимость специальности от года
urchinpro Sep 2, 2023
952ede6
fix
urchinpro Sep 2, 2023
9f15603
Update education/models.py
urchinpro Sep 2, 2023
537a2b3
Merge pull request #3051 from moodpulse/mod_filters
urchinpro Sep 2, 2023
698e5f4
fixs
Wellheor1 Sep 4, 2023
855a778
fixs
Wellheor1 Sep 4, 2023
71d3461
fix connections
Wellheor1 Sep 4, 2023
ed5ac60
.
Wellheor1 Sep 4, 2023
0190738
fix
urchinpro Sep 5, 2023
cf5d147
fix
urchinpro Sep 5, 2023
c7138c8
fix
urchinpro Sep 5, 2023
a3a1308
Порт для подключения
Wellheor1 Sep 5, 2023
354c0d7
fix None
Wellheor1 Sep 5, 2023
e5a3fcb
.
urchinpro Sep 5, 2023
e66b3f1
Merge remote-tracking branch 'origin/fix_connections' into fix_connec…
urchinpro Sep 5, 2023
2248c44
blake fix
Wellheor1 Sep 5, 2023
d0e8b32
Merge branch 'fix_connections' of https://github.com/moodpulse/l2 int…
Wellheor1 Sep 5, 2023
4cb35b1
Merge pull request #3054 from moodpulse/fix_connections
Wellheor1 Sep 5, 2023
23215cd
sql fast education -> has contract
urchinpro Sep 5, 2023
ae33460
sql fast education -> has contract
urchinpro Sep 5, 2023
b696d0b
Merge branch 'applications_modal' into sql_Fast_education
urchinpro Sep 5, 2023
6ef4d82
Merge pull request #3055 from moodpulse/sql_Fast_education
urchinpro Sep 5, 2023
6fa22b9
fix
urchinpro Sep 5, 2023
86bf5fc
label для поиска
Wellheor1 Sep 5, 2023
78617ff
.
Wellheor1 Sep 5, 2023
62db589
Merge pull request #3057 from moodpulse/soritng_column_enrollees
Wellheor1 Sep 6, 2023
ba71eaa
filters
Wellheor1 Sep 6, 2023
29778b3
black fix
Wellheor1 Sep 6, 2023
7791eaf
black fix
Wellheor1 Sep 6, 2023
00a787d
fix
Wellheor1 Sep 6, 2023
b37448f
.
Wellheor1 Sep 6, 2023
617a9c2
Update education/main.py
Wellheor1 Sep 6, 2023
0931d2f
poetry add pymssql
Wellheor1 Sep 7, 2023
2b7a2de
Merge branch 'applications_modal' of https://github.com/moodpulse/l2 …
Wellheor1 Sep 7, 2023
c0992d6
.
Wellheor1 Sep 7, 2023
02dd29b
Update l2-frontend/src/modals/EnrolleesApplication.vue
Wellheor1 Sep 9, 2023
651e00a
Update l2-frontend/src/modals/EnrolleesApplication.vue
Wellheor1 Sep 9, 2023
d9f76f3
Перенос EducationFinanceSource
Wellheor1 Sep 11, 2023
bb3ff60
fix
Wellheor1 Sep 11, 2023
ee513f7
.
Wellheor1 Sep 11, 2023
3774369
Исключения - обновление логов - fix
Wellheor1 Sep 11, 2023
5286c4e
black
Wellheor1 Sep 11, 2023
26b5f62
print - lint
Wellheor1 Sep 11, 2023
c6b230b
Договор + БД - модели
Wellheor1 Sep 11, 2023
c007b96
Логирование ошибок импорта
Wellheor1 Sep 12, 2023
423d8b7
black
Wellheor1 Sep 12, 2023
16de997
fix
Wellheor1 Sep 12, 2023
b1e3eb5
Merge branch 'develop' into applications_modal
Wellheor1 Sep 12, 2023
596ce6d
Update slog/models.py
Wellheor1 Sep 12, 2023
5a2b43c
Статика - динамика
Wellheor1 Sep 12, 2023
e2b3013
Update api/education/views.py
Wellheor1 Sep 12, 2023
200af2a
fix
Wellheor1 Sep 12, 2023
b86b4c3
Merge branch 'applications_modal' of https://github.com/moodpulse/l2 …
Wellheor1 Sep 12, 2023
ca4c7c1
fix enrollees modal
Wellheor1 Sep 13, 2023
000b5e4
Merge branch 'develop' into applications_modal
Wellheor1 Sep 13, 2023
65a70b1
Права на api/education/
Wellheor1 Sep 14, 2023
4f6224b
Merge branch 'applications_modal' of https://github.com/moodpulse/l2 …
Wellheor1 Sep 14, 2023
42072ec
fix
Wellheor1 Sep 15, 2023
4caf8b7
enrolleesTable - compositionApi
Wellheor1 Sep 18, 2023
6ecdfc0
fix
Wellheor1 Sep 19, 2023
328c835
fix
Wellheor1 Sep 20, 2023
2c7bf0e
Компонент - фильтры
Wellheor1 Sep 20, 2023
7a105b0
fix
Wellheor1 Sep 20, 2023
1fec99e
.
Wellheor1 Sep 20, 2023
3392dc8
loader
Wellheor1 Sep 22, 2023
a9de0a9
Merge branch 'develop' into applications_modal
Wellheor1 Sep 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added api/education/__init__.py
Empty file.
19 changes: 19 additions & 0 deletions api/education/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.urls import path

from . import views

urlpatterns = [
path('get-specialties', views.get_specialties),
path('get-pay-forms', views.get_pay_forms),
path('get-enrollment-orders', views.get_enrollment_orders),
path('get-citizenship', views.get_citizenship),
path('get-statement-filters', views.get_application_filters),
path('get-exams-filters', views.get_exams_filters),
path('get-achievements-filters', views.get_achievements_filters),
path('get-educations', views.get_education),
path('get-special-rights', views.get_special_rights),
path('get-applications-by-card', views.get_applications_by_card),
path('get-enrollees', views.get_enrollees),
path('get-columns', views.get_columns),
path('get-achievements-by-card', views.get_achievement_by_card),
]
103 changes: 103 additions & 0 deletions api/education/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import json

from django.http import JsonResponse

from clients.models import Citizenship
from directions.models import EducationFinanceSource
from education.models import ApplicationEducation, ExamType, Subjects, AchievementType, DocumentTypeEducation, SpecialRights, EducationSpeciality, Achievement
from education.views import get_all_enrollees
from laboratory.utils import current_year


def get_specialties(request):
request_data = json.loads(request.body)
year_start_study = request_data.get('yearStartStudy')
if not year_start_study:
year_start_study = current_year()
else:
year_start_study = year_start_study.get('value')
year_start_study = year_start_study.get('label')

result = EducationSpeciality.get_speciality(year_start_study)
return JsonResponse({"result": result})


def get_pay_forms(request):
result = EducationFinanceSource.get_sources()
return JsonResponse({"result": result})


def get_enrollment_orders(request):
result = []
return JsonResponse({"result": result})


def get_citizenship(request):
result = Citizenship.get_citizenship()
return JsonResponse({"result": result})


def get_application_filters(request):
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved
sources = []
statuses = [{"id": 1, "label": "Зачислен"}, {"id": 2, "label": "Отчислен"}]
stages = []
return JsonResponse({"sources": sources, "statuses": statuses, "stages": stages})


def get_exams_filters(request):
exam_types = ExamType.get_types()
subjects = Subjects.get_subjects()
return JsonResponse({"exam_types": exam_types, "subjects": subjects})


def get_achievements_filters(request):
achievements = AchievementType.get_types()
statuses = []
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved
return JsonResponse({"achievements": achievements, "statuses": statuses})


def get_education(request):
result = DocumentTypeEducation.get_education_documents_tree()
return JsonResponse({"result": result})


def get_special_rights(request):
result = SpecialRights.get_special_rights_tree()
return JsonResponse({"result": result})


def get_columns(request):
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved
columns = [
{"field": 'card', "key": 'card', "title": 'Дело'},
{"field": 'fio', "key": 'fio', "title": 'ФИО'},
{"field": 'applicationSpeciality', "key": 'applicationSpeciality', "title": 'Специальность'},
{"field": 'applicationPersonNumber', "key": 'applicationPersonNumber', "title": 'Номер'},
{"field": 'chemistry', "key": 'chemistry', "title": 'Хим.'},
{"field": 'biology', "key": 'biology', "title": 'Био.'},
{"field": 'russian_language', "key": 'russian_language', "title": 'Рус.'},
{"field": 'achievementPoint', "key": 'achievementPoint', "title": 'ИД'},
{"field": 'achievementСhecked', "key": 'achievementСhecked', "title": 'ИД+'},
{"field": 'totalPoints', "key": 'totalPoint', "title": 'Сумм'},
{"field": 'is_original', "key": 'is_original', "title": 'Оригинал'},
{"field": 'researchContractId', "key": 'researchContractId', "title": 'Договор'},
{"field": 'status', "key": 'status', "title": 'Статус'},
{"field": 'create_date', "key": 'create_date', "title": 'Создано'},
]
return JsonResponse({"result": columns})


def get_enrollees(request):
data = get_all_enrollees(request)
return JsonResponse({"data": data})


def get_applications_by_card(request):
request_data = json.loads(request.body)
result = ApplicationEducation.get_applications_by_card(request_data["card_pk"])
return JsonResponse({"result": result})


def get_achievement_by_card(request):
request_data = json.loads(request.body)
result = Achievement.get_achievement_by_card(request_data["card_pk"])
return JsonResponse({"result": result})
2 changes: 1 addition & 1 deletion api/patients/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def patients_search_card(request):
| Q(card__phone__in=normalized_phones)
| Q(card__doctorcall__phone__in=normalized_phones)
)
if is_ecp_search or ":" in query:
if is_ecp_search or ":" in query[0]:
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved
ecp_id = query.split(':')[1]
patient_data = search_patient_ecp_by_person_id(ecp_id)
if patient_data and (patient_data.get('PersonSnils_Snils') or patient_data.get('enp')):
Expand Down
1 change: 1 addition & 0 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
path('transfer-document/', include('api.transfer_document.urls')),
path('edit-forms/', include('api.edit_forms.urls')),
path('hospitals/', include('api.hospitals.urls')),
path('education/', include('api.education.urls')),
path('get-prices', views.get_prices),
path('get-price-data', views.get_price_data),
path('update-price', views.update_price),
Expand Down
1 change: 1 addition & 0 deletions appconf/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def l2_modules() -> dict:
"direction_purpose",
"external_organizations",
"vaccine",
"education",
"tfoms",
"doc_call",
"list_wait",
Expand Down
8 changes: 8 additions & 0 deletions clients/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,11 @@ class ResCardMovementRoom(admin.ModelAdmin):
'room_in',
)
raw_id_fields = ('card',)


class CitizenshipAdmin(admin.ModelAdmin):
list_display = ('title',)
list_display_links = ('title',)


admin.site.register(models.Citizenship, CitizenshipAdmin)
42 changes: 32 additions & 10 deletions clients/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Individual(models.Model):
time_add = models.DateTimeField(default=timezone.now, null=True, blank=True)
owner = models.ForeignKey('hospitals.Hospitals', default=None, blank=True, null=True, help_text="Организация-владелец данных", db_index=True, on_delete=models.PROTECT)
owner_patient_id = models.CharField(max_length=128, default=None, null=True, blank=True, db_index=True, help_text="Код в организации-владелеце")
mmis_id = models.CharField(max_length=128, default=None, null=True, blank=True, db_index=True, help_text="Код ММИС")

def first(self):
return self
Expand Down Expand Up @@ -754,7 +755,7 @@ def import_from_tfoms(data: Union[dict, List], individual: Union['Individual', N
return updated_data

@staticmethod
def import_from_simple_data(data: dict, owner, patient_id_company, email, phone):
def import_from_simple_data(data: dict, owner, mmis_id, email, phone, filter_mmis_id=False):
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved
family = data.get('family', '').title().strip()
name = data.get('name', '').title().strip()
patronymic = data.get('patronymic', '').title().strip()
Expand All @@ -768,14 +769,17 @@ def import_from_simple_data(data: dict, owner, patient_id_company, email, phone)
if family and name and sex and birthday:
birthday = datetime.strptime(birthday, "%d.%m.%Y" if '.' in birthday else "%Y-%m-%d").date()

indv = Individual.objects.filter(
family=family,
name=name,
patronymic=patronymic,
birthday=birthday,
sex=sex,
owner=owner,
)
if filter_mmis_id:
indv = Individual.objects.filter(mmis_id=mmis_id)
else:
indv = Individual.objects.filter(
family=family,
name=name,
patronymic=patronymic,
birthday=birthday,
sex=sex,
owner=owner,
)

if not indv or not indv.exists():
i = Individual(
Expand All @@ -785,7 +789,7 @@ def import_from_simple_data(data: dict, owner, patient_id_company, email, phone)
birthday=birthday,
sex=sex,
owner=owner,
owner_patient_id=patient_id_company,
mmis_id=mmis_id,
)
i.save()
else:
Expand Down Expand Up @@ -1064,6 +1068,22 @@ def as_json(factor):
return json


class Citizenship(models.Model):
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved
title = models.CharField(max_length=255, verbose_name="Наименование гражданства", help_text='Россия, Греция')

def __str__(self):
return self.title

@staticmethod
def get_citizenship() -> list[dict]:
citizenship = [{"id": i.pk, "label": i.title} for i in Citizenship.objects.all()]
return citizenship

class Meta:
verbose_name = 'Гражданство'
verbose_name_plural = 'Гражданства'


class Card(models.Model):
AGENT_CHOICES = (
('mother', "Мать"),
Expand Down Expand Up @@ -1131,6 +1151,8 @@ class Card(models.Model):

owner = models.ForeignKey('hospitals.Hospitals', default=None, blank=True, null=True, help_text="Организация-владелец карты", db_index=True, on_delete=models.PROTECT)

citizenship = models.ForeignKey(Citizenship, default=None, blank=True, null=True, help_text="Гражданство", on_delete=models.PROTECT)

@property
def main_address_full(self):
return json.dumps({'address': self.main_address, 'fias': self.main_address_fias, 'details': self.main_address_details})
Expand Down
1 change: 1 addition & 0 deletions context_processors/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def menu(request):
"module": "l2_send_orgs_email_results",
},
{"url": "/ui/utils", "title": "Инструменты", "nt": False, "access": ["Инструменты"]},
{"url": "/ui/enrollees", "title": "Абитуриенты", "nt": False, "access": ["Приемная комиссия: Абитуриенты"]},
]

hp = SettingManager.get(key="home_page", default="false")
Expand Down
2 changes: 2 additions & 0 deletions dashboards/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class DatabaseConnectSettings(models.Model):
database = models.CharField(max_length=255, default="", help_text='Название базы', db_index=True)
ip_address = models.CharField(max_length=255, default="", help_text='ip-address', db_index=True)
port = models.CharField(max_length=5, default="", help_text='Порт', db_index=False)
driver = models.CharField(max_length=128, default="", help_text='Драйвер', db_index=False)
encrypt = models.CharField(max_length=5, default="", help_text='Шифрование', db_index=False)

def __str__(self):
return f"{self.title} - {self.database}"
Expand Down
2 changes: 1 addition & 1 deletion dashboards/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def exec_query(dashboard_pk, dates_param):
metadata_charts = get_charts_dataset(dashboard_pk)
# обход по графикам датасетов
for md in metadata_charts:
if not check_server_port(md.ip_address, md.port):
if not check_server_port(md.ip_address, int(md.port)):
continue
if not data_chart.get(md.chart_id):
data_chart[md.chart_id] = [
Expand Down
2 changes: 2 additions & 0 deletions directions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from .models import (
IstochnikiFinansirovaniya,
EducationFinanceSource,
Napravleniya,
TubesRegistration,
Issledovaniya,
Expand Down Expand Up @@ -315,3 +316,4 @@ class NapravleniyaHL7FilesAdmin(admin.ModelAdmin):
admin.site.register(MicrobiologyResultPhenotype, MicrobiologyResultPhenotypeAdmin)
admin.site.register(RegisteredOrders, RegisteredOrdersAdmin)
admin.site.register(ExternalAdditionalOrder, ExternalAdditionalOrderAdmin)
admin.site.register(EducationFinanceSource)
16 changes: 16 additions & 0 deletions directions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,22 @@ class Meta:
verbose_name_plural = 'Источники финансирования'


class EducationFinanceSource(models.Model):
title = models.CharField(max_length=255, verbose_name='Наименование образовательного источника финансирования')
Wellheor1 marked this conversation as resolved.
Show resolved Hide resolved

def __str__(self):
return self.title

@staticmethod
def get_sources() -> list[dict]:
sources = [{"id": source.pk, "label": source.title} for source in EducationFinanceSource.objects.all()]
return sources

class Meta:
verbose_name = 'Образовательный источник финансирования'
verbose_name_plural = 'Образовательные источники финансирования'


class Diagnoses(models.Model):
M = (
(0, "Диапазон"),
Expand Down
Empty file added education/__init__.py
Empty file.
Loading