Skip to content

Commit

Permalink
Переопределение шаблонов для стационара по подразделению
Browse files Browse the repository at this point in the history
  • Loading branch information
urchinpro committed Jul 1, 2024
1 parent 0fb4160 commit 458770d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/stationar/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def hosp_services_by_type(request):
hosp_research = i.research
if int(data['hospResearch']) > -1:
hosp_research = int(data['hospResearch'])
if request.user.doctorprofile.podrazdeleniye.hosp_research_default_id:
hosp_research = request.user.doctorprofile.podrazdeleniye.hosp_research_default_id
for hs in HospitalService.objects.filter(site_type=type_by_key, main_research=hosp_research, hide=False):
result.append(
{
Expand Down
1 change: 1 addition & 0 deletions podrazdeleniya/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Podrazdeleniya(models.Model): # Модель подразделений
n3_id = models.CharField(max_length=40, help_text='N3_ID', blank=True, default="")
print_additional_page_direction = models.CharField(max_length=255, default="", blank=True, verbose_name="Дополнительные формы при печати направления для подразделения")
profile_ecp_code = models.CharField(max_length=16, default="", blank=True, verbose_name="Профиль отделения код ecp")
hosp_research_default = models.ForeignKey('directory.Researches', blank=True, default=None, null=True, verbose_name="Услуга стационара по котрой по умолчанию подгружаются шаблоны", on_delete=models.CASCADE)

def get_title(self):
return self.short_title or self.title
Expand Down

0 comments on commit 458770d

Please sign in to comment.