Skip to content

Commit

Permalink
Генерация СЭМД, Карта не совершеннолетнего. Расчет стоимости. (#3175)
Browse files Browse the repository at this point in the history
* Генерация СЭМД, Карта не совершеннолетнего. Расчет стоимости.

* Update api/directions/views.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* rename

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
urchinpro and github-actions[bot] authored Oct 30, 2023
1 parent e9ae16f commit 8e826d9
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 4 deletions.
20 changes: 18 additions & 2 deletions api/directions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from django.core.paginator import Paginator
from cda.integration import cdator_gen_xml, render_cda
from contracts.models import PriceCategory
from contracts.models import PriceCategory, PriceCoast
from ecp_integration.integration import get_ecp_time_table_list_patient, get_ecp_evn_direction, fill_slot_ecp_free_nearest
from integration_framework.common_func import directions_pdf_result
from l2vi.integration import gen_cda_xml, send_cda_xml
Expand Down Expand Up @@ -137,14 +137,17 @@ def directions_generate(request):
return JsonResponse(result)
fin_source = p.get("fin_source", -1)
fin_source_pk = int(fin_source) if (isinstance(fin_source, int) or str(fin_source).isdigit()) else fin_source
type_generate = p.get("type")
researches = p.get("researches")

args = [
card_pk,
p.get("diagnos"),
fin_source_pk,
p.get("history_num"),
p.get("ofname_pk"),
request.user.doctorprofile,
p.get("researches"),
researches,
p.get("comments"),
p.get("for_rmis"),
p.get("rmis_data", {}),
Expand All @@ -168,6 +171,19 @@ def directions_generate(request):
case_id=p.get("caseId", -2),
case_by_direction=p.get("caseByDirection", False),
)
if type_generate == "calculate-cost":
fin_source_obj = IstochnikiFinansirovaniya.objects.filter(pk=fin_source_pk).first()
calculate_researches = []
for values in researches.values():
calculate_researches.extend(values)
result_coast = 0
if fin_source_obj.title.lower() in ["платно", "средства граждан"]:
data_coast = PriceCoast.objects.filter(price_name=fin_source_obj.contracts.price, research_id__in=calculate_researches)
for dc in data_coast:
result_coast += dc.coast
result = {"ok": True, "directions": [], "directionsStationar": [], "message": result_coast}
return JsonResponse(result)

for _ in range(p.get("directions_count", 1)):
rc = Napravleniya.gen_napravleniya_by_issledovaniya(*args, **kwargs)
result["ok"] = rc["r"]
Expand Down
1 change: 1 addition & 0 deletions appconf/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def l2_modules() -> dict:
"hide_show_count_param",
"fraction_comment",
"required_choose_case",
"calculate_researches",
]
},
"consults_module": SettingManager.get("consults_module", default='false', default_type='b'),
Expand Down
2 changes: 1 addition & 1 deletion clients/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ def get_data_individual(self, empty=False, full_empty=False, only_json_serializa
ind_data['oms']['polis_serial'] = None if empty else '________'
# ind_data['oms']['polis_date_start'] = ind_documents["polis"]["date_start"]
ind_data['oms']['polis_issued'] = (None if empty else '') if not ind_documents["polis"]["issued"] else ind_documents["polis"]["issued"]
ind_data['oms']['issueOrgName'] = (None if empty else '') if not ind_documents["polis"]["issued"] else ind_documents["polis"]["issued"]
ind_data['oms']['issueOrgName'] = '' if not ind_documents["polis"]["issued"] else ind_documents["polis"]["issued"]
ind_data['insurer_full_code'] = '' if not ind_documents["polis"]["insurer_full_code"] else ind_documents["polis"]["insurer_full_code"]
ind_data['oms']['issueOrgCode'] = ind_data['insurer_full_code']
ind_data['ecp_id'] = self.individual.ecp_id
Expand Down
1 change: 1 addition & 0 deletions directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class Researches(models.Model):
enabled_add_files = models.BooleanField(blank=True, default=False, help_text="Можно добавить файлы")
convert_to_doc_call = models.BooleanField(blank=True, default=False, help_text="Конвертировать форму в заявку DocCall")
oid_kind = models.CharField(max_length=5, null=True, blank=True, default="", help_text="oid-документа 1.2.643.5.1.13.13.11.1520")
oid_title = models.CharField(max_length=255, default="", db_index=True, help_text="oid-название документа 1.2.643.5.1.13.13.11.1520")
uet_refferal_doc = models.FloatField(default=0, verbose_name='УЕТы врача', blank=True)
uet_refferal_co_executor_1 = models.FloatField(default=0, verbose_name='УЕТы со-исполнителя 1', blank=True)
print_additional_page_direction = models.CharField(max_length=255, default="", blank=True, verbose_name="Дополнительные формы при печати направления услуги")
Expand Down
1 change: 1 addition & 0 deletions integration_framework/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def direction_data(request):
"department_oid": iss[iss_index].doc_confirmation.podrazdeleniye.oid if iss[iss_index].doc_confirmation else None,
"department_name": iss[iss_index].doc_confirmation.podrazdeleniye.nsi_title if iss[iss_index].doc_confirmation else None,
"kind": iss[iss_index].research.oid_kind if iss[iss_index].doc_confirmation else None,
"researchName": iss[iss_index].research.oid_title if iss[iss_index].doc_confirmation else None,
"finSourceTitle": direction.istochnik_f.title if direction.istochnik_f else "другое",
"finSourceCode": direction.istochnik_f.get_n3_code() if direction.istochnik_f else "6",
"finSourceEcpCode": direction.istochnik_f.get_ecp_code() if direction.istochnik_f else "380101000000023",
Expand Down
4 changes: 4 additions & 0 deletions l2-frontend/src/registerHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export default (instance: Vue): void => {
priceCategory,
caseId,
caseByDirection,
type,
})
.then(data => {
instance.$store.dispatch(actions.DEC_LOADING);
Expand All @@ -224,6 +225,9 @@ export default (instance: Vue): void => {
${data.messageLimit}`);
} else if (type === 'save-and-open-embedded-form' && monitoring) {
instance.$root.$emit('embedded-form:open', data.directions[0]);
} else if (type === 'calculate-cost') {
instance.$root.$emit('msg', 'ok', `Сумма: ${data.message}`, 10000);
return;
}
instance.$root.$emit(`researches-picker:clear_all${kk}`);
instance.$root.$emit(`researches-picker:directions_created${kk}`);
Expand Down
13 changes: 13 additions & 0 deletions l2-frontend/src/ui-cards/SelectedResearches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@
>
<span>Набор документов</span>
</button>
<button
v-if="show_calculate_researches"
v-tippy
class="btn btn-blue-nb top-inner-select"
:disabled="!can_save"
title="Рассчитать стоимость"
@click="generate('calculate-cost')"
>
<span>Сумма</span>
</button>
</template>
</div>

Expand Down Expand Up @@ -763,6 +773,9 @@ export default {
hide_show_count_param() {
return this.$store.getters.modules.l2_hide_show_count_param;
},
show_calculate_researches() {
return this.$store.getters.modules.l2_calculate_researches;
},
external_organizations_enabled() {
return this.$store.getters.modules.l2_external_organizations && this.kk !== 'stationar';
},
Expand Down
2 changes: 1 addition & 1 deletion podrazdeleniya/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Podrazdeleniya(models.Model): # Модель подразделений
can_has_pacs = models.BooleanField(default=False, blank=True)
odii_type = models.PositiveSmallIntegerField(choices=ODII_TYPES, default=None, null=True, blank=True, help_text="Оказываемые виды инструментальных услуг")
oid = models.CharField(max_length=55, default="", blank=True, help_text='OID подразделения')
nsi_title = models.CharField(max_length=50, default='', blank=True, help_text='по ФРМО')
nsi_title = models.CharField(max_length=255, default='', blank=True, help_text='по ФРМО')
hospital = models.ForeignKey('hospitals.Hospitals', db_index=True, blank=True, default=None, null=True, on_delete=models.SET_NULL)
ecp_code = models.CharField(max_length=16, default="", blank=True, verbose_name="Код для ECP")
n3_id = models.CharField(max_length=40, help_text='N3_ID', blank=True, default="")
Expand Down

0 comments on commit 8e826d9

Please sign in to comment.