Skip to content

Commit

Permalink
Merge pull request #3463 from mikhailprivalov/sendEGISZ
Browse files Browse the repository at this point in the history
condition send egisz
  • Loading branch information
Wellheor1 authored Feb 1, 2024
2 parents c19a571 + 9abba70 commit 774462f
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 21 deletions.
9 changes: 8 additions & 1 deletion api/directions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,9 @@ def directions_paraclinic_form(request):

iss = {
"pk": i.pk,
"amd": d.amd_status,
"amd_number": d.amd_number,
"direction_pk": d.pk,
"research": {
"pk": i.research_id,
"title": i.research.title,
Expand All @@ -1645,6 +1648,7 @@ def directions_paraclinic_form(request):
"r_type": i.research.r_type,
"show_more_services": i.research.show_more_services and not i.research.is_form and not i.research.is_microbiology,
"enabled_add_files": i.research.enabled_add_files,
"is_need_send_egisz": i.research.is_need_send_egisz,
},
"pacs": None if not i.research.podrazdeleniye or not i.research.podrazdeleniye.can_has_pacs else search_dicom_study(d.pk),
"examination_date": i.get_medical_examination(),
Expand Down Expand Up @@ -2596,14 +2600,17 @@ def directions_paraclinic_history(request):
"all_saved": True,
"amd": direction.amd_status,
"amd_number": direction.amd_number,
"is_need_send_egisz": True,
}
for i in Issledovaniya.objects.filter(napravleniye=direction).order_by("pk"):
iss = {"title": i.research.get_title(), "saved": i.time_save is not None, "confirmed": i.time_confirmation is not None}
iss = {"title": i.research.get_title(), "saved": i.time_save is not None, "confirmed": i.time_confirmation is not None, "is_need_send_egisz": i.research.is_need_send_egisz}
d["iss"].append(iss)
if not iss["saved"]:
d["all_saved"] = False
if not iss["confirmed"]:
d["all_confirmed"] = False
if not iss["is_need_send_egisz"]:
d["is_need_send_egisz"] = False
response["directions"].append(d)
return JsonResponse(response)

Expand Down
1 change: 1 addition & 0 deletions directions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ class Napravleniya(models.Model):
amd_number = models.CharField(max_length=20, default=None, blank=True, null=True, db_index=True, help_text='Номер документа в АМД')
error_amd = models.BooleanField(default=False, blank=True, help_text='Ошибка отправка в АМД?')
amd_excluded = models.BooleanField(default=False, blank=True, help_text='Исключить из выгрузки в АМД?')
amd_message = models.TextField(blank=True, null=True, default=None, help_text="Сообщение об ошибке АМД")
purpose = models.CharField(max_length=64, null=True, blank=True, default=None, db_index=True, choices=PURPOSES, help_text="Цель направления")
external_organization = models.ForeignKey(ExternalOrganization, default=None, blank=True, null=True, help_text='Внешняя организация', on_delete=models.SET_NULL)
harmful_factor = models.CharField(max_length=255, blank=True, default='')
Expand Down
1 change: 1 addition & 0 deletions directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ class Researches(models.Model):
laboratory_material = models.ForeignKey(LaboratoryMaterial, blank=True, default=None, null=True, help_text='Биоматериал', on_delete=models.SET_NULL)
sub_group = models.ForeignKey(SubGroup, blank=True, default=None, null=True, help_text='Подгруппа', on_delete=models.SET_NULL)
laboratory_duration = models.CharField(max_length=3, default='', blank=True, verbose_name='Срок выполнения')
is_need_send_egisz = models.BooleanField(blank=True, default=False, help_text="Требуется отправка документав ЕГИСЗ")

@staticmethod
def save_plan_performer(tb_data):
Expand Down
40 changes: 20 additions & 20 deletions l2-frontend/src/pages/ResultsParaclinic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,30 +119,30 @@
</div>
</div>
<hr>
<template v-if="direction.amd !== 'not_need'">
<template v-if="direction.amd !== 'not_need' && direction.is_need_send_egisz">
<div
v-if="direction.amd === 'need'"
class="amd amd-need"
>
АМД: не отправлено
ЕГИСЗ: не отправлено
</div>
<div
v-else-if="direction.amd === 'ok'"
class="amd amd-ok"
>
АМД: отправлено ({{ direction.amd_number }})
ЕГИСЗ: отправлено ({{ direction.amd_number }})
</div>
<div
v-else-if="direction.amd === 'error'"
class="amd amd-error"
>
АМД: ошибка
ЕГИСЗ: ошибка
</div>
<div
v-else-if="direction.amd === 'planned'"
class="amd amd-planned"
>
АМД: запланировано
ЕГИСЗ: запланировано
</div>
<hr>
</template>
Expand Down Expand Up @@ -327,7 +327,7 @@
href="#"
target="_blank"
@click.prevent="send_amd"
>отправить в амд</a>
>отправить в ЕГИСЗ</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -1394,39 +1394,39 @@
v-if="data.direction.amd === 'planned'"
class="amd amd-planned"
>
АМД: запланировано
ЕГИСЗ: очередь
</div>
<div
v-if="data.direction.amd === 'error' && row.confirmed"
class="amd amd-error"
>
АМД: ошибка
ЕГИСЗ: ошибка
</div>
<div
v-if="data.direction.amd === 'need' && row.confirmed"
class="amd amd-need"
>
АМД: не отправлено
ЕГИСЗ: не отправлено
</div>
<div
v-if="data.direction.amd === 'ok'"
class="amd amd-ok"
>
АМД: отправлено ({{ data.direction.amd_number }})
ЕГИСЗ: отправлено ({{ data.direction.amd_number }})
</div>
<button
v-if="can_reset_amd && data.direction.amd !== 'not_need' && data.direction.amd !== 'need'"
class="btn btn-blue-nb"
@click="reset_amd([data.direction.pk])"
>
Сброс статуса АМД
Сброс статуса ЕГИЗ
</button>
<button
v-if="data.direction.amd === 'need' || data.direction.amd === 'error'"
class="btn btn-blue-nb"
@click="send_to_amd([data.direction.pk])"
>
Отправить в АМД
Отправить в ЕГИСЗ
</button>
</template>
<EDSDirection
Expand Down Expand Up @@ -1470,39 +1470,39 @@
v-if="data.direction.amd === 'planned'"
class="amd amd-planned"
>
АМД: запланировано
ЕГИСЗ: запланировано
</div>
<div
v-if="data.direction.amd === 'error' && row.confirmed"
class="amd amd-error"
>
АМД: ошибка
ЕГИСЗ: ошибка
</div>
<div
v-if="data.direction.amd === 'need' && row.confirmed"
class="amd amd-need"
>
АМД: не отправлено
ЕГИСЗ: не отправлено
</div>
<div
v-if="data.direction.amd === 'ok'"
class="amd amd-ok"
>
АМД: отправлено ({{ data.direction.amd_number }})
ЕГИСЗ: отправлено ({{ data.direction.amd_number }})
</div>
<button
v-if="can_reset_amd && data.direction.amd !== 'not_need' && data.direction.amd !== 'need'"
class="btn btn-blue-nb"
@click="reset_amd([data.direction.pk])"
>
Сброс статуса АМД
Сброс статуса ЕГИСЗ
</button>
<button
v-if="data.direction.amd === 'need' || data.direction.amd === 'error'"
class="btn btn-blue-nb"
@click="send_to_amd([data.direction.pk])"
>
Отправить в АМД
Отправить в ЕГИСЗ
</button>
</template>
<EDSDirection
Expand Down Expand Up @@ -2161,7 +2161,7 @@ export default {
},
can_reset_amd() {
for (const g of this.$store.getters.user_data.groups || []) {
if (g === 'Управление отправкой в АМД') {
if (g === 'Управление отправкой в ЕГИСЗ') {
return true;
}
}
Expand Down Expand Up @@ -3161,7 +3161,7 @@ export default {
},
async reset_amd(pks) {
try {
await this.$dialog.confirm('Подтвердите сброс статуса отправки в АМД');
await this.$dialog.confirm('Подтвердите сброс статуса отправки в ЕГИСЗ');
await this.$store.dispatch(actions.INC_LOADING);
await directionsPoint.resetAMD({ pks });
this.load_pk(this.data.direction.pk);
Expand Down
65 changes: 65 additions & 0 deletions l2-frontend/src/pages/Stationar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,41 @@
>
Сброс подтверждения
</button>

<template v-if="amd && row.research.is_need_send_egisz">
<div
v-if="row.amd === 'planned'"
class="amd amd-planned"
>
ЕГИСЗ
</div>
<div
v-if="row.amd === 'error' && row.confirmed"
class="amd amd-error"
>
ЕГИСЗ
</div>
<div
v-if="row.amd === 'need' && row.confirmed"
class="amd amd-need"
>
ЕГИСЗ
</div>
<div
v-if="row.amd === 'ok'"
class="amd amd-ok"
>
ЕГИСЗ
</div>
<button
v-if="row.amd === 'need' || row.amd === 'error'"
class="btn btn-blue-nb"
@click="send_to_amd([row.direction_pk])"
>
Отправить в ЕГИСЗ
</button>
</template>

<button
class="btn btn-blue-nb"
@click="close_form"
Expand Down Expand Up @@ -1168,6 +1203,9 @@ export default {
}
return false;
},
amd() {
return this.$store.getters.modules.l2_amd;
},
},
watch: {
pk() {
Expand Down Expand Up @@ -1221,6 +1259,13 @@ export default {
});
},
methods: {
async send_to_amd(pks) {
await this.$store.dispatch(actions.INC_LOADING);
await directionsPoint.sendAMD({ pks });
this.$root.$emit('msg', 'ok', 'Отправка запланирована');
this.reload_if_need();
await this.$store.dispatch(actions.DEC_LOADING);
},
getDepartmentTitle(pk) {
return this.departments.find((d) => d.id === pk)?.label || '';
},
Expand Down Expand Up @@ -2297,4 +2342,24 @@ export default {
.service-top-padding {
padding-top: 10px;
}
.amd {
font-weight: bold;
&-need {
color: #0c698b;
}
&-error {
color: #cf3a24;
}
&-planned {
color: #d9be00;
}
&-ok {
color: #049372;
}
}
</style>

0 comments on commit 774462f

Please sign in to comment.