# Generated by Django 4.2.14 on 2025-03-07 19:45

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


class Migration(migrations.Migration):

    dependencies = [
        ("observations", "0009_documentreferenceobservationreference"),
        ("base", "0018_merge_20250307_1944"),
        ("conditions", "0006_merge_20250217_1423"),
        ("diagnosticreports", "0005_diagnosticreportdocumentreferencereference"),
        ("immunizations", "0005_immunization_manufacturer"),
    ]

    operations = [
        migrations.CreateModel(
            name="ImmunizationReasonReference",
            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)),
                (
                    "condition",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="immunization_reason_references_condition",
                        to="conditions.condition",
                    ),
                ),
                (
                    "diagnostic_report",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="immunization_reason_references_diagnostic_report",
                        to="diagnosticreports.diagnosticreport",
                    ),
                ),
                (
                    "identifier",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="immunization_reason_references_identifier",
                        to="base.identifier",
                    ),
                ),
                (
                    "observation",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="immunization_reason_references_observation",
                        to="observations.observation",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="ImmunizationReasonCodeableReference",
            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)),
                (
                    "concept",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="immunization_reason_codeable_references_identifier",
                        to="base.codeableconcept",
                    ),
                ),
                (
                    "reference",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="immunization_reason_codeable_references_reference",
                        to="immunizations.immunizationreasonreference",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AlterField(
            model_name="immunization",
            name="reason",
            field=models.ManyToManyField(
                blank=True,
                related_name="immunization_reason",
                to="immunizations.immunizationreasoncodeablereference",
            ),
        ),
    ]
