# Generated by Django 3.1.7 on 2021-03-27 19:46

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ImagingStudy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(max_length=100, verbose_name='Идентификатор')),
                ('date', models.CharField(max_length=50, null=True, verbose_name='Дата исследования')),
                ('numberOfSeries', models.PositiveIntegerField(null=True, verbose_name='Количество серий')),
                ('numberOfInstances', models.PositiveIntegerField(null=True, verbose_name='Количество снимков')),
                ('reference', models.CharField(max_length=1000, null=True, verbose_name='Ссылка')),
                ('description', models.CharField(max_length=2000, null=True, verbose_name='Описание')),
            ],
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(max_length=100, null=True, verbose_name='Идентификатор')),
                ('given', models.CharField(max_length=100, null=True, verbose_name='Имя')),
                ('family', models.CharField(max_length=100, null=True, verbose_name='Фамилия')),
            ],
        ),
        migrations.CreateModel(
            name='Practitioner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(max_length=100, null=True, verbose_name='Идентификатор')),
                ('given', models.CharField(max_length=100, null=True, verbose_name='Имя')),
                ('family', models.CharField(max_length=100, null=True, verbose_name='Фамилия')),
            ],
        ),
        migrations.CreateModel(
            name='Series',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(max_length=100, verbose_name='Идентификатор')),
                ('date', models.CharField(max_length=50, null=True, verbose_name='Дата исследования')),
                ('numberOfInstances', models.PositiveIntegerField(null=True, verbose_name='Количество снимков')),
                ('reference', models.CharField(max_length=1000, null=True, verbose_name='Ссылка')),
                ('description', models.CharField(max_length=2000, null=True, verbose_name='Описание')),
                ('imaging_study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.imagingstudy', verbose_name='Исследование')),
            ],
        ),
        migrations.CreateModel(
            name='Instance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(max_length=100, verbose_name='Идентификатор')),
                ('date', models.CharField(max_length=50, null=True, verbose_name='Дата исследования')),
                ('description', models.CharField(max_length=2000, null=True, verbose_name='Описание')),
                ('image', models.ImageField(null=True, upload_to='instances/', verbose_name='Изображение')),
                ('reference', models.CharField(max_length=1000, null=True, verbose_name='Ссылка')),
                ('series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.series', verbose_name='Серия')),
            ],
        ),
        migrations.AddField(
            model_name='imagingstudy',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='main.patient', verbose_name='Пациент'),
        ),
        migrations.AddField(
            model_name='imagingstudy',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='main.practitioner', verbose_name='Специалист'),
        ),
        migrations.AddField(
            model_name='imagingstudy',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь'),
        ),
    ]
