.
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
# Generated by Django 3.2.4 on 2021-11-28 14:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('atlas', '0005_condition_primary_name'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Subspecialty',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=255)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='case',
|
||||||
|
name='subspecialty',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='condition',
|
||||||
|
name='subspecialty',
|
||||||
|
field=models.ManyToManyField(blank=True, to='atlas.Subspecialty'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='case',
|
||||||
|
name='subspecialty',
|
||||||
|
field=models.ManyToManyField(blank=True, to='atlas.Subspecialty'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+18
-13
@@ -81,6 +81,8 @@ class Condition(models.Model):
|
|||||||
|
|
||||||
primary_name = models.BooleanField(default="True")
|
primary_name = models.BooleanField(default="True")
|
||||||
|
|
||||||
|
subspecialty = models.ManyToManyField("subspecialty", blank=True)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
if self.synonym.count() == 0:
|
if self.synonym.count() == 0:
|
||||||
return self.name
|
return self.name
|
||||||
@@ -88,21 +90,23 @@ class Condition(models.Model):
|
|||||||
synonyms = ",".join([i.name for i in self.synonym.all()])
|
synonyms = ",".join([i.name for i in self.synonym.all()])
|
||||||
return f"{self.name} ({synonyms})"
|
return f"{self.name} ({synonyms})"
|
||||||
|
|
||||||
|
class Subspecialty(models.Model):
|
||||||
|
name = models.CharField(max_length=255)
|
||||||
|
|
||||||
@reversion.register
|
@reversion.register
|
||||||
class Case(models.Model):
|
class Case(models.Model):
|
||||||
class SubspecialtyChoices(models.TextChoices):
|
#class SubspecialtyChoices(models.TextChoices):
|
||||||
BREAST = "BR", _("Breast")
|
# BREAST = "BR", _("Breast")
|
||||||
CARDIAC = "CA", _("Cardiac")
|
# CARDIAC = "CA", _("Cardiac")
|
||||||
GASTRO = "GI", _("Gastrointestinal and hepatobiliary")
|
# GASTRO = "GI", _("Gastrointestinal and hepatobiliary")
|
||||||
HEADNECK = "HN", _("Head and Neck")
|
# HEADNECK = "HN", _("Head and Neck")
|
||||||
MSK = "MS", _("Musculoskeletal")
|
# MSK = "MS", _("Musculoskeletal")
|
||||||
NEURO = "NE", _("Neuroradiology")
|
# NEURO = "NE", _("Neuroradiology")
|
||||||
OBSGYN = "OG", _("Obstectric and Gynaecological")
|
# OBSGYN = "OG", _("Obstectric and Gynaecological")
|
||||||
PAED = "PA", _("Paediatric")
|
# PAED = "PA", _("Paediatric")
|
||||||
URO = "UR", _("Uroradiology")
|
# URO = "UR", _("Uroradiology")
|
||||||
VASC = "VA", _("Vascular")
|
# VASC = "VA", _("Vascular")
|
||||||
HAEMONC = "HA", _("Haemotology and Oncology")
|
# HAEMONC = "HA", _("Haemotology and Oncology")
|
||||||
|
|
||||||
title = models.CharField(max_length=255, help_text="Title of the case", default="")
|
title = models.CharField(max_length=255, help_text="Title of the case", default="")
|
||||||
# author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
|
# author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
|
||||||
@@ -116,7 +120,8 @@ class Case(models.Model):
|
|||||||
|
|
||||||
findings = models.TextField(null=True, blank=True)
|
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)
|
condition = models.ManyToManyField(Condition, blank=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user