.
This commit is contained in:
+18
-13
@@ -81,6 +81,8 @@ class Condition(models.Model):
|
||||
|
||||
primary_name = models.BooleanField(default="True")
|
||||
|
||||
subspecialty = models.ManyToManyField("subspecialty", blank=True)
|
||||
|
||||
def __str__(self) -> str:
|
||||
if self.synonym.count() == 0:
|
||||
return self.name
|
||||
@@ -88,21 +90,23 @@ class Condition(models.Model):
|
||||
synonyms = ",".join([i.name for i in self.synonym.all()])
|
||||
return f"{self.name} ({synonyms})"
|
||||
|
||||
class Subspecialty(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
@reversion.register
|
||||
class Case(models.Model):
|
||||
class SubspecialtyChoices(models.TextChoices):
|
||||
BREAST = "BR", _("Breast")
|
||||
CARDIAC = "CA", _("Cardiac")
|
||||
GASTRO = "GI", _("Gastrointestinal and hepatobiliary")
|
||||
HEADNECK = "HN", _("Head and Neck")
|
||||
MSK = "MS", _("Musculoskeletal")
|
||||
NEURO = "NE", _("Neuroradiology")
|
||||
OBSGYN = "OG", _("Obstectric and Gynaecological")
|
||||
PAED = "PA", _("Paediatric")
|
||||
URO = "UR", _("Uroradiology")
|
||||
VASC = "VA", _("Vascular")
|
||||
HAEMONC = "HA", _("Haemotology and Oncology")
|
||||
#class SubspecialtyChoices(models.TextChoices):
|
||||
# BREAST = "BR", _("Breast")
|
||||
# CARDIAC = "CA", _("Cardiac")
|
||||
# GASTRO = "GI", _("Gastrointestinal and hepatobiliary")
|
||||
# HEADNECK = "HN", _("Head and Neck")
|
||||
# MSK = "MS", _("Musculoskeletal")
|
||||
# NEURO = "NE", _("Neuroradiology")
|
||||
# OBSGYN = "OG", _("Obstectric and Gynaecological")
|
||||
# PAED = "PA", _("Paediatric")
|
||||
# URO = "UR", _("Uroradiology")
|
||||
# VASC = "VA", _("Vascular")
|
||||
# HAEMONC = "HA", _("Haemotology and Oncology")
|
||||
|
||||
title = models.CharField(max_length=255, help_text="Title of the case", default="")
|
||||
# author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
|
||||
@@ -116,7 +120,8 @@ class Case(models.Model):
|
||||
|
||||
findings = models.TextField(null=True, blank=True)
|
||||
|
||||
subspecialty = models.CharField(max_length=2, choices=SubspecialtyChoices.choices)
|
||||
#subspecialty = models.CharField(max_length=2, choices=SubspecialtyChoices.choices)
|
||||
subspecialty = models.ManyToManyField(Subspecialty, blank=True)
|
||||
|
||||
condition = models.ManyToManyField(Condition, blank=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user