# Generated by Django 4.2.14 on 2025-02-06 15:12

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


class Migration(migrations.Migration):

    dependencies = [
        ('diagnosticreports', '0004_rename_media_diagnosticreportmedia_and_more'),
        ('base', '0011_age_duration_simplequantity'),
        ('patients', '0007_patientorganizationreference'),
        ('practitioners', '0010_practitionerrole_endpoint'),
        ('encounters', '0008_alter_encounterlocation_location'),
        ('devices', '0007_alter_device_status_and_more'),
        ('observations', '0006_alter_observation_instantiates_reference_and_more'),
        ('relatedpersons', '0002_relatedperson_communication_relatedperson_gender'),
        ('bodystructures', '0001_initial'),
        ('conditions', '0002_alter_conditioncodeablereference_concept_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='condition',
            name='abatement_age',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_abatement_age', to='base.age'),
        ),
        migrations.AddField(
            model_name='condition',
            name='abatement_date_time',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='condition',
            name='abatement_period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_abatement_period', to='base.period'),
        ),
        migrations.AddField(
            model_name='condition',
            name='abatement_range',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_abatement_range', to='base.range'),
        ),
        migrations.AddField(
            model_name='condition',
            name='abatement_string',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='condition',
            name='body_structure',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_body_structure', to='bodystructures.bodystructure'),
        ),
        migrations.AddField(
            model_name='condition',
            name='encounter',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_encounter', to='encounters.encounterreference'),
        ),
        migrations.AddField(
            model_name='condition',
            name='evidence',
            field=models.ManyToManyField(blank=True, related_name='condition_evidence', to='base.codeablereference'),
        ),
        migrations.AddField(
            model_name='condition',
            name='note',
            field=models.ManyToManyField(blank=True, related_name='condition_note', to='base.annotation'),
        ),
        migrations.AddField(
            model_name='condition',
            name='onset_age',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_onset_age', to='base.age'),
        ),
        migrations.AddField(
            model_name='condition',
            name='onset_date_time',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='condition',
            name='onset_period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_onset_period', to='base.period'),
        ),
        migrations.AddField(
            model_name='condition',
            name='onset_range',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_onset_range', to='base.range'),
        ),
        migrations.AddField(
            model_name='condition',
            name='onset_string',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='condition',
            name='recorded_date_time',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='condition',
            name='subject',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_subject', to='patients.patientgroupreference'),
        ),
        migrations.CreateModel(
            name='ConditionStageAssessmentReference',
            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)),
                ('diagnostic_report', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_stage_assessment_reference_diagnostic_report', to='diagnosticreports.diagnosticreport')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_stage_assessment_reference_identifier', to='base.identifier')),
                ('observation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_stage_assessment_reference_observation', to='observations.observation')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ConditionStage',
            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)),
                ('assessment', models.ManyToManyField(blank=True, related_name='condition_stage_assessment', to='conditions.conditionstageassessmentreference')),
                ('summary', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_stage_summary', to='base.codeableconcept')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_stage_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ConditionRecorderReference',
            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)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_recorder_reference_identifier', to='base.identifier')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_recorder_reference_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_recorder_reference_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_recorder_reference_practitioner_role', to='practitioners.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_recorder_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ConditionAsserterReference',
            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)),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter_reference_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter_reference_identifier', to='base.identifier')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter_reference_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter_reference_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter_reference_practitioner_role', to='practitioners.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='condition',
            name='asserter',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_asserter', to='conditions.conditionasserterreference'),
        ),
        migrations.AddField(
            model_name='condition',
            name='recorder',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='condition_recorder', to='conditions.conditionrecorderreference'),
        ),
        migrations.AddField(
            model_name='condition',
            name='stage',
            field=models.ManyToManyField(blank=True, related_name='condition_stage', to='conditions.conditionstage'),
        ),
    ]
