This commit is contained in:
Ross
2021-11-23 19:34:50 +00:00
parent 92c52896d0
commit 70958dc4d7
4 changed files with 74 additions and 4 deletions
+68
View File
@@ -0,0 +1,68 @@
# Generated by Django 3.2.8 on 2021-11-23 19:28
import atlas.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import sortedm2m.fields
import tagulous.models.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('anatomy', '0053_anatomyquestion_structure'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('generic', '0014_alter_questionnote_note'),
]
operations = [
migrations.CreateModel(
name='Series',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.TextField(blank=True, help_text='Description of stack, for admin organisation, will not be visible when taking')),
('open_access', models.BooleanField(default=True, help_text='If a question should be freely available to browse')),
('author', models.ManyToManyField(blank=True, related_name='series', to=settings.AUTH_USER_MODEL)),
('contrast', models.ForeignKey(blank=True, help_text='MRI / CT contrast', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='atlas_series_contrast', to='generic.contrast')),
('examination', models.ForeignKey(help_text='Name of the examination', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='atlas_series_examination', to='generic.examination')),
('modality', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='atlas_series_modality', to='anatomy.modality')),
('plane', models.ForeignKey(blank=True, help_text='Plane of the examination', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='atlas_series_plane', to='generic.plane')),
],
),
migrations.CreateModel(
name='SeriesImage',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.FileField(upload_to=atlas.models.image_directory_path)),
('position', models.IntegerField(default=0)),
('upload_filename', models.CharField(blank=True, max_length=255)),
('series', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='images', to='atlas.series')),
],
options={
'ordering': ['position'],
},
),
migrations.CreateModel(
name='Case',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.TextField(blank=True, help_text='Description of the case, for admin organisation, will not be visible when taking')),
('history', models.TextField(blank=True, null=True)),
('findings', models.TextField(blank=True, null=True)),
('subpecialty', models.CharField(choices=[('BR', 'Breast'), ('CA', 'Cardiac'), ('GI', 'Gastrointestinal and hepatobiliary'), ('HN', 'Head and Neck'), ('MS', 'Musculoskeletal'), ('NE', 'Neuroradiology'), ('OG', 'Obstectric and Gynaecological'), ('PA', 'Paediatric'), ('UR', 'Uroradiology'), ('VA', 'Vascular'), ('HA', 'Haemotology and Oncology')], max_length=2)),
('verified', models.BooleanField(default=False)),
('created_date', models.DateTimeField(default=django.utils.timezone.now)),
('published_date', models.DateTimeField(blank=True, null=True)),
('scrapped', models.BooleanField(default=False, help_text='Question has been scrapped and will not be shown')),
('open_access', models.BooleanField(default=True, help_text='If a question should be freely available to browse')),
('author', models.ManyToManyField(blank=True, help_text='Author of question', related_name='atlas_authored_questions', to=settings.AUTH_USER_MODEL)),
('condition', tagulous.models.fields.TagField(_set_tag_meta=True, blank=True, help_text='Associated condition. Will allow searching / filtering and tips / hints to be displayed. Conditions with spaces must be enclosed in quotes "..."', to='generic.Condition')),
('series', sortedm2m.fields.SortedManyToManyField(help_text=None, related_name='atlas', to='atlas.Series')),
('sign', tagulous.models.fields.TagField(_set_tag_meta=True, blank=True, help_text='Radiological signs in the question', to='generic.Sign')),
],
),
]
+4 -4
View File
@@ -186,19 +186,19 @@ class SeriesImage(models.Model):
@reversion.register
class Series(models.Model):
modality = models.ForeignKey(
Modality, related_name="series_modality", on_delete=models.SET_NULL, null=True
Modality, related_name="atlas_series_modality", on_delete=models.SET_NULL, null=True
)
examination = models.ForeignKey(
Examination,
help_text="Name of the examination",
related_name="series_examination",
related_name="atlas_series_examination",
on_delete=models.SET_NULL,
null=True,
)
plane = models.ForeignKey(
Plane,
help_text="Plane of the examination",
related_name="series_plane",
related_name="atlas_series_plane",
on_delete=models.SET_NULL,
null=True,
blank=True,
@@ -206,7 +206,7 @@ class Series(models.Model):
contrast = models.ForeignKey(
Contrast,
help_text="MRI / CT contrast",
related_name="series_contrast",
related_name="atlas_series_contrast",
on_delete=models.SET_NULL,
null=True,
blank=True,
+1
View File
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'longs',
'sbas',
'wally',
'atlas',
"reversion",
"django_tables2",
"django_filters",
+1
View File
@@ -52,6 +52,7 @@ urlpatterns = [
path("longs/", include("longs.urls"), name="longs"),
path("sbas/", include("sbas.urls"), name="sbas"),
path("generic/", include("generic.urls"), name="generic"),
path("atlas/", include("atlas.urls"), name="atlas"),
path("accounts/", include("django.contrib.auth.urls")),
path("accounts/profile", views.profile, name="profile"),
path("", TemplateView.as_view(template_name="index.html"), name="home"),