Skip to content

Commit

Permalink
Merge pull request #3359 from mikhailprivalov/complexService
Browse files Browse the repository at this point in the history
Complex service
  • Loading branch information
Wellheor1 authored Jan 10, 2024
2 parents f3d39fe + 6455ea5 commit 4375650
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions directory/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,18 @@ class SetAuxService(admin.ModelAdmin):
)


class SetComplexService(admin.ModelAdmin):
list_display = (
'main_research',
'slave_research',
'hide',
)
list_display_links = (
'main_research',
'slave_research',
)


admin.site.register(models.ResearchSite, RefSiteType)
admin.site.register(models.ResearchGroup)
admin.site.register(models.Researches, ResAdmin)
Expand Down Expand Up @@ -302,3 +314,6 @@ class SetAuxService(admin.ModelAdmin):
admin.site.register(models.SetResearch, SetResearchAdmin)
admin.site.register(models.SetOrderResearch, SetOrderResearchAdmin)
admin.site.register(models.AuxService, SetAuxService)
admin.site.register(models.ComplexService, SetComplexService)
admin.site.register(models.LaboratoryMaterial)
admin.site.register(models.SubGroup)
39 changes: 39 additions & 0 deletions directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,28 @@ class Meta:
verbose_name_plural = 'Методика анализа'


class LaboratoryMaterial(models.Model):
title = models.CharField(max_length=64, help_text="Биоматериал")

def __str__(self):
return "%s" % self.title

class Meta:
verbose_name = 'Биоматериал'
verbose_name_plural = 'Биоматериалы'


class SubGroup(models.Model):
title = models.CharField(max_length=64, help_text="Подгруппа услуги")

def __str__(self):
return "%s" % self.title

class Meta:
verbose_name = 'Погруппа услуги'
verbose_name_plural = 'Подгруппы услуг'


class Researches(models.Model):
"""
Вид исследования
Expand Down Expand Up @@ -250,6 +272,7 @@ class Researches(models.Model):
is_expertise = models.BooleanField(default=False, blank=True, help_text="Это экспертиза", db_index=True)
is_aux = models.BooleanField(default=False, blank=True, help_text="Это вспомогательный", db_index=True)
is_case = models.BooleanField(default=False, blank=True, help_text="Это случай", db_index=True)
is_complex = models.BooleanField(default=False, blank=True, help_text="Это комплексная услуга", db_index=True)
site_type = models.ForeignKey(ResearchSite, default=None, null=True, blank=True, help_text='Место услуги', on_delete=models.SET_NULL, db_index=True)
need_vich_code = models.BooleanField(default=False, blank=True, help_text="Необходимость указания кода вич в направлении")
paraclinic_info = models.TextField(blank=True, default="", help_text="Если это параклиническое исследование - здесь указывается подготовка и кабинет")
Expand Down Expand Up @@ -306,6 +329,9 @@ class Researches(models.Model):
cda_template_file = models.CharField(max_length=50, db_index=True, blank=True, default="", null=True, help_text="название шаблона cda-шаблона")
n3_id_med_document_type = models.SmallIntegerField(default=0, blank=True, help_text="N3 id_med_document_type")
ecp_id = models.CharField(max_length=16, default='', blank=True, verbose_name='Код услуги в ЕЦП')
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='Срок выполнения')

@staticmethod
def save_plan_performer(tb_data):
Expand Down Expand Up @@ -685,6 +711,19 @@ def __str__(self):
return f"{self.main_research.title} - {self.aux_research.title} - {self.hide}"


class ComplexService(models.Model):
main_research = models.ForeignKey(Researches, help_text="Комплексная услуга", on_delete=models.CASCADE, db_index=True)
slave_research = models.ForeignKey(Researches, related_name='slave_service', help_text="Простая услуга", on_delete=models.CASCADE)
hide = models.BooleanField(default=False, blank=True, help_text='Скрытие услуги', db_index=True)

class Meta:
verbose_name = 'Комплексная услуга'
verbose_name_plural = 'Комплексные услуги'

def __str__(self):
return f"{self.main_research.title} - {self.slave_research.title} - {self.hide}"


class ParaclinicInputGroups(models.Model):
title = models.CharField(max_length=255, help_text='Название группы')
show_title = models.BooleanField()
Expand Down

0 comments on commit 4375650

Please sign in to comment.