# Generated by Django 4.2.14 on 2025-01-17 15:43

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base', '0006_alter_repeat_duration_unit_alter_repeat_period_unit'),
        ('patients', '0005_patientreference'),
        ('devices', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='BodyLandmarkOrientation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('clock_face_position', models.ManyToManyField(blank=True, related_name='body_landmark_orientation_clock_face_position', to='base.codeableconcept')),
                ('landmark_description', models.ManyToManyField(blank=True, related_name='body_landmark_orientation_landmark_description', to='base.codeableconcept')),
                ('surface_orientation', models.ManyToManyField(blank=True, to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BodyStructure',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('active', models.BooleanField(default=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ImagingSelectionReference',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='IncludedStructure',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('body_landmark_orientation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='included_structure_body_landmark_orientation', to='bodystructures.bodylandmarkorientation')),
                ('laterality', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='included_structure_laterality', to='base.codeableconcept')),
                ('qualifier', models.ManyToManyField(blank=True, to='base.codeableconcept')),
                ('spatial_reference', models.ManyToManyField(blank=True, to='bodystructures.imagingselectionreference')),
                ('structure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='included_structure_structure', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DistanceFromLandmark',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('device', models.ManyToManyField(blank=True, to='devices.device')),
                ('value', models.ManyToManyField(blank=True, to='base.quantity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BodyStructureReference',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('body_structure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='bodystructures.bodystructure')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='bodystructure',
            name='excluded_structure',
            field=models.ManyToManyField(blank=True, related_name='body_structure_excluded_structure', to='bodystructures.includedstructure'),
        ),
        migrations.AddField(
            model_name='bodystructure',
            name='identifier',
            field=models.ManyToManyField(blank=True, related_name='body_structure', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='bodystructure',
            name='imaging',
            field=models.ManyToManyField(blank=True, related_name='body_structure_imaging', to='base.attachment'),
        ),
        migrations.AddField(
            model_name='bodystructure',
            name='included_structure',
            field=models.ManyToManyField(blank=True, related_name='body_structure_included_structure', to='bodystructures.includedstructure'),
        ),
        migrations.AddField(
            model_name='bodystructure',
            name='morphology',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='body_structure_morphology', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='bodystructure',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='patients.patientreference'),
        ),
    ]
