# Generated by Django 4.1.4 on 2023-06-12 10:07

import atlas.models
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Case',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='', help_text='Title of the case', max_length=255)),
                ('description', models.TextField(blank=True, help_text='Description of the case')),
                ('history', models.TextField(blank=True, help_text='A (brief) summary of the relevant history', null=True)),
                ('discussion', models.TextField(blank=True, null=True)),
                ('report', models.TextField(blank=True, help_text='A model (sample) report for the case.', null=True)),
                ('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 case should be freely available to browse')),
            ],
        ),
        migrations.CreateModel(
            name='CaseCollection',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('publish_results', models.BooleanField(default=False, help_text='If a collection should published')),
                ('active', models.BooleanField(default=True, help_text='If a collection should be available')),
                ('show_title_pre', models.BooleanField(default=False, help_text='Show the title of the cases (pre exam)')),
                ('show_history_pre', models.BooleanField(default=False, help_text='Show the history of the cases (pre exam)')),
                ('show_description_pre', models.BooleanField(default=False, help_text='Show the description of the cases (pre exam)')),
                ('show_discussion_pre', models.BooleanField(default=False, help_text='Show the case discussion (pre exam)')),
                ('show_report_pre', models.BooleanField(default=False, help_text='Show the case report (pre exam)')),
                ('show_title_post', models.BooleanField(default=False, help_text='Show the title of the cases (post exam)')),
                ('show_history_post', models.BooleanField(default=False, help_text='Show the history of the cases (post exam)')),
                ('show_description_post', models.BooleanField(default=False, help_text='Show the description of the cases (post exam)')),
                ('show_discussion_post', models.BooleanField(default=False, help_text='Show the case discussion (post exam)')),
                ('show_report_post', models.BooleanField(default=False, help_text='Show the case report (post exam)')),
                ('archive', models.BooleanField(default=False)),
                ('exam_mode', models.BooleanField(default=False)),
                ('open_access', models.BooleanField(default=False, help_text='If the exam is freely accessible (to view and edit on the test system)')),
                ('collection_type', models.CharField(choices=[('REV', 'Review'), ('REP', 'Report')], default='REP', max_length=3)),
            ],
        ),
        migrations.CreateModel(
            name='CaseDetail',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort_order', models.IntegerField(default=1000)),
            ],
            options={
                'ordering': ('sort_order',),
            },
        ),
        migrations.CreateModel(
            name='CidReportAnswer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.TextField(blank=True)),
                ('feedback', models.TextField(blank=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('score', models.IntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(10), django.core.validators.MinValueValidator(0)])),
                ('cid', models.BigIntegerField(help_text='Candidate ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Condition',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('primary', models.BooleanField(default='True')),
            ],
            bases=(atlas.models.SynMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Differential',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Finding',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('primary', models.BooleanField(default='True')),
            ],
            bases=(atlas.models.SynMixin, models.Model),
        ),
        migrations.CreateModel(
            name='PathologicalProcess',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Presentation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        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 series should be freely available to browse')),
                ('author', models.ManyToManyField(blank=True, related_name='series', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        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.CreateModel(
            name='UserReportAnswer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.TextField(blank=True)),
                ('feedback', models.TextField(blank=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('score', models.IntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(10), django.core.validators.MinValueValidator(0)])),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atlas.casedetail')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Structure',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('primary', models.BooleanField(default='True')),
                ('synonym', models.ManyToManyField(blank=True, to='atlas.structure')),
            ],
            bases=(atlas.models.SynMixin, models.Model),
        ),
        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='SeriesFinding',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.TextField(blank=True, help_text='Findings on the series / stack', null=True)),
                ('annotation_json', models.TextField(blank=True, null=True)),
                ('viewport_json', models.TextField(blank=True, null=True)),
                ('findings', models.ManyToManyField(blank=True, to='atlas.finding')),
                ('series', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='findings', to='atlas.series')),
                ('structures', models.ManyToManyField(blank=True, to='atlas.structure')),
            ],
        ),
    ]
