# Generated by Django 5.2.11 on 2026-02-25 13:53

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


class Migration(migrations.Migration):

    dependencies = [
        ("meta_lists", "0021_diagnosticdevices"),
        ("meta_prn", "0070_auto_20260224_2247"),
    ]

    operations = [
        migrations.AlterField(
            model_name="endofstudy",
            name="offstudy_reason",
            field=models.ForeignKey(
                limit_choices_to={
                    "name__in": [
                        "completed_followup",
                        "completed_followup_lt_36",
                        "completed_followup_lt_48",
                        "completed_followup_48",
                        "diabetes",
                        "delivery",
                        "pregnancy",
                        "clinical_withdrawal",
                        "dead",
                        "LTFU",
                        "toxicity",
                        "transferred",
                        "withdrawal",
                        "late_exclusion",
                        "OTHER",
                    ]
                },
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="meta_lists.offstudyreasons",
                verbose_name="Reason patient was terminated from the study",
            ),
        ),
        migrations.AlterField(
            model_name="historicalendofstudy",
            name="offstudy_reason",
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                limit_choices_to={
                    "name__in": [
                        "completed_followup",
                        "completed_followup_lt_36",
                        "completed_followup_lt_48",
                        "completed_followup_48",
                        "diabetes",
                        "delivery",
                        "pregnancy",
                        "clinical_withdrawal",
                        "dead",
                        "LTFU",
                        "toxicity",
                        "transferred",
                        "withdrawal",
                        "late_exclusion",
                        "OTHER",
                    ]
                },
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="meta_lists.offstudyreasons",
                verbose_name="Reason patient was terminated from the study",
            ),
        ),
        migrations.AlterField(
            model_name="historicaloffstudymedication",
            name="reason",
            field=models.CharField(
                choices=[
                    ("completed_followup", "Completed study follow up"),
                    ("pregnancy", "Pregnancy"),
                    ("sae", "Participant is experiencing a serious adverse event"),
                    (
                        "clinician",
                        "Other condition that justifies discontinuation of treatment in the clinician's opinion (specify below)",
                    ),
                    ("investigator", " Investigator decision"),
                    ("referral", "Referral to Diabetes clinic"),
                    ("patient", "Patient decision"),
                    ("OTHER", "Other reason (specify below)"),
                ],
                max_length=25,
                verbose_name="Reason for stopping study medication",
            ),
        ),
        migrations.AlterField(
            model_name="offstudymedication",
            name="reason",
            field=models.CharField(
                choices=[
                    ("completed_followup", "Completed study follow up"),
                    ("pregnancy", "Pregnancy"),
                    ("sae", "Participant is experiencing a serious adverse event"),
                    (
                        "clinician",
                        "Other condition that justifies discontinuation of treatment in the clinician's opinion (specify below)",
                    ),
                    ("investigator", " Investigator decision"),
                    ("referral", "Referral to Diabetes clinic"),
                    ("patient", "Patient decision"),
                    ("OTHER", "Other reason (specify below)"),
                ],
                max_length=25,
                verbose_name="Reason for stopping study medication",
            ),
        ),
    ]
