# Generated by Django 3.0.9 on 2020-12-06 20:52

import uuid

import _socket
import django.core.validators
import django.db.models.deletion
import django_audit_fields.fields.hostname_modification_field
import django_audit_fields.fields.userfield
import django_audit_fields.fields.uuid_auto_field
import django_audit_fields.models.audit_model_mixin
import django_crypto_fields.fields.encrypted_char_field
import django_crypto_fields.fields.encrypted_text_field
import django_crypto_fields.fields.firstname_field
import django_crypto_fields.fields.lastname_field
import django_revision.revision_field
import edc_model.models.fields.other_charfield
import edc_model_fields.fields.other_charfield
import edc_screening.model_mixins.screening_fields_model_mixin
import edc_sites.models
import edc_utils.date
import simple_history.models
from django.conf import settings
from django.db import migrations, models

import mocca_screening.mocca_original_sites
import mocca_screening.models.mocca_register
import mocca_screening.models.mocca_register_contact


class Migration(migrations.Migration):

    replaces = [
        ("mocca_screening", "0001_initial"),
        ("mocca_screening", "0002_auto_20201203_0338"),
        ("mocca_screening", "0003_auto_20201203_1610"),
        ("mocca_screening", "0004_auto_20201203_1757"),
        ("mocca_screening", "0005_auto_20201204_0217"),
        ("mocca_screening", "0006_moccaregistercontact"),
        ("mocca_screening", "0007_auto_20201204_0232"),
        ("mocca_screening", "0008_auto_20201204_0312"),
        ("mocca_screening", "0009_auto_20201204_0323"),
        ("mocca_screening", "0010_auto_20201204_0330"),
        ("mocca_screening", "0011_auto_20201204_0347"),
        ("mocca_screening", "0012_auto_20201204_0352"),
        ("mocca_screening", "0013_auto_20201204_0613"),
        ("mocca_screening", "0014_auto_20201204_1949"),
        ("mocca_screening", "0015_auto_20201204_2339"),
        ("mocca_screening", "0016_auto_20201204_2347"),
        ("mocca_screening", "0017_auto_20201205_0401"),
        ("mocca_screening", "0018_auto_20201205_0424"),
        ("mocca_screening", "0019_auto_20201205_1834"),
        ("mocca_screening", "0020_auto_20201206_2110"),
        ("mocca_screening", "0021_auto_20201206_2122"),
        ("mocca_screening", "0022_auto_20201206_2140"),
        ("mocca_screening", "0023_auto_20201206_2205"),
        ("mocca_screening", "0024_auto_20201206_2352"),
    ]

    initial = True

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("mocca_lists", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="MoccaRegister",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(default=edc_utils.date.get_utcnow),
                ),
                (
                    "mocca_screening_identifier",
                    models.CharField(
                        blank=True,
                        help_text="If known",
                        max_length=15,
                        null=True,
                        verbose_name="MOCCA (original) screening identifier",
                    ),
                ),
                (
                    "mocca_study_identifier",
                    models.CharField(
                        help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                        max_length=25,
                        validators=[
                            django.core.validators.RegexValidator(
                                "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                                "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                            )
                        ],
                        verbose_name="MOCCA (original) study identifier",
                    ),
                ),
                (
                    "mocca_country",
                    models.CharField(
                        choices=[("uganda", "Uganda"), ("tanzania", "Tanzania")],
                        max_length=25,
                    ),
                ),
                (
                    "first_name",
                    django_crypto_fields.fields.firstname_field.FirstnameField(
                        blank=True,
                        help_text=" (Encryption: RSA local)",
                        max_length=71,
                        null=True,
                    ),
                ),
                (
                    "last_name",
                    django_crypto_fields.fields.lastname_field.LastnameField(
                        blank=True,
                        help_text=" (Encryption: RSA local)",
                        max_length=71,
                        null=True,
                    ),
                ),
                (
                    "initials",
                    django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                        blank=True,
                        help_text="Use UPPERCASE letters only. May be 2 or 3 letters. (Encryption: RSA local)",
                        max_length=71,
                        validators=[
                            django.core.validators.RegexValidator(
                                "[A-Z]{1,3}", "Invalid format"
                            ),
                            django.core.validators.MinLengthValidator(2),
                            django.core.validators.MaxLengthValidator(3),
                        ],
                    ),
                ),
                (
                    "gender",
                    models.CharField(choices=[("M", "Male"), ("F", "Female")], max_length=10),
                ),
                (
                    "age_in_years",
                    models.IntegerField(
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(18),
                            django.core.validators.MaxValueValidator(110),
                        ],
                    ),
                ),
                (
                    "birth_year",
                    models.IntegerField(
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(1900),
                            django.core.validators.MaxValueValidator(2002),
                        ],
                    ),
                ),
                ("dob", models.DateField(blank=True, null=True)),
                (
                    "survival_status",
                    models.CharField(
                        choices=[
                            ("alive", "Alive"),
                            ("dead", "Deceased"),
                            ("unknown", "Unknown"),
                        ],
                        default="unknown",
                        max_length=25,
                    ),
                ),
                (
                    "mocca_site",
                    models.ForeignKey(
                        limit_choices_to=mocca_screening.mocca_original_sites.get_mocca_site_limited_to,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="mocca_lists.MoccaOriginalSites",
                    ),
                ),
            ],
            options={
                "verbose_name": "MOCCA Patient Register",
                "verbose_name_plural": "MOCCA Patient Register",
                "ordering": ["mocca_country", "mocca_site"],
            },
        ),
        migrations.CreateModel(
            name="SubjectScreening",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("subject_identifier", models.CharField(max_length=50)),
                (
                    "subject_identifier_as_pk",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                (
                    "subject_identifier_aka",
                    models.CharField(
                        editable=False,
                        help_text="track a previously allocated identifier.",
                        max_length=50,
                        null=True,
                        verbose_name="Subject Identifier a.k.a",
                    ),
                ),
                (
                    "slug",
                    models.CharField(
                        db_index=True,
                        default="",
                        editable=False,
                        help_text="a field used for quick search",
                        max_length=250,
                        null=True,
                    ),
                ),
                (
                    "reference",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        unique=True,
                        verbose_name="Reference",
                    ),
                ),
                (
                    "screening_identifier",
                    models.CharField(
                        blank=True,
                        editable=False,
                        max_length=50,
                        unique=True,
                        verbose_name="Screening ID",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="Date and time of report.",
                        verbose_name="Report Date and Time",
                    ),
                ),
                (
                    "gender",
                    models.CharField(choices=[("M", "Male"), ("F", "Female")], max_length=10),
                ),
                (
                    "age_in_years",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(110),
                        ]
                    ),
                ),
                (
                    "consent_ability",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Participant or legal guardian/representative able and willing to give informed consent.",
                    ),
                ),
                (
                    "unsuitable_for_study",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="No",
                        help_text="If YES, patient NOT eligible, please give reason below.",
                        max_length=5,
                        verbose_name="Is there any other reason the patient is deemed to not be suitable for the study?",
                    ),
                ),
                (
                    "reasons_unsuitable",
                    models.TextField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="Reason not suitable for the study",
                    ),
                ),
                (
                    "unsuitable_agreed",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=5,
                        verbose_name="Does the study coordinator agree that the patient is not suitable for the study?",
                    ),
                ),
                ("eligible", models.BooleanField(default=False, editable=False)),
                (
                    "reasons_ineligible",
                    models.TextField(
                        editable=False,
                        max_length=150,
                        null=True,
                        verbose_name="Reason not eligible",
                    ),
                ),
                (
                    "eligibility_datetime",
                    models.DateTimeField(
                        editable=False,
                        help_text="Date and time eligibility was determined",
                        null=True,
                    ),
                ),
                ("consented", models.BooleanField(default=False, editable=False)),
                ("refused", models.BooleanField(default=False, editable=False)),
                (
                    "screening_consent",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Has the subject given his/her verbal consent to be screened for the MOCCA Extension trial?",
                    ),
                ),
                (
                    "mocca_participant",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Was the patient enrolled to the original MOCCA study?",
                    ),
                ),
                (
                    "mocca_study_identifier",
                    models.CharField(
                        help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                        max_length=25,
                        validators=[
                            django.core.validators.RegexValidator(
                                "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                                "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                            )
                        ],
                        verbose_name="Original MOCCA study identifier",
                    ),
                ),
                (
                    "initials",
                    django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                        blank=True,
                        help_text="Use UPPERCASE letters only. May be 2 or 3 letters. Use `F`irst`L`ast or `L`ast`F`irst depending on the country custom.  (Encryption: RSA local)",
                        max_length=71,
                        validators=[
                            django.core.validators.RegexValidator(
                                "[A-Z]{1,3}", "Invalid format"
                            ),
                            django.core.validators.MinLengthValidator(2),
                            django.core.validators.MaxLengthValidator(3),
                        ],
                    ),
                ),
                (
                    "birth_year",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1900),
                            django.core.validators.MaxValueValidator(2002),
                        ]
                    ),
                ),
                (
                    "mocca_register",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="mocca_screening.MoccaRegister",
                    ),
                ),
                (
                    "mocca_site",
                    models.ForeignKey(
                        limit_choices_to=mocca_screening.mocca_original_sites.get_mocca_site_limited_to,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="mocca_lists.MoccaOriginalSites",
                        verbose_name="Original MOCCA site",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subject Screening",
                "verbose_name_plural": "Subject Screening",
            },
            managers=[
                ("on_site", edc_sites.models.CurrentSiteManager()),
                (
                    "objects",
                    edc_screening.model_mixins.screening_fields_model_mixin.ScreeningManager(),
                ),
            ],
        ),
        migrations.CreateModel(
            name="SubjectRefusal",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("screening_identifier", models.CharField(max_length=50, unique=True)),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        verbose_name="Report Date and Time",
                    ),
                ),
                (
                    "reason",
                    models.CharField(
                        choices=[
                            ("unwilling_to_say", "I am unwilling to say"),
                            ("dont_have_time", "I don't have time"),
                            ("stigma", "I am worried about stigma"),
                            ("must_consult_spouse", "I need to consult my spouse"),
                            (
                                "dont_want_medication",
                                "I don't want to take any more medication",
                            ),
                            ("dont_want_to_join", "I don't want to take part"),
                            (
                                "need_to_think_about_it",
                                "I haven't had a chance to think about it",
                            ),
                            ("moving", "I am moving to another area"),
                            ("OTHER", "Other, please specify"),
                        ],
                        max_length=25,
                        verbose_name="Reason for refusal to join",
                    ),
                ),
                (
                    "other_reason",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "comment",
                    models.TextField(
                        blank=True, null=True, verbose_name="Additional Comments"
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subject Refusal",
                "verbose_name_plural": "Subject Refusals",
                "ordering": ("-modified", "-created"),
                "get_latest_by": "modified",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site", edc_sites.models.CurrentSiteManager()),
            ],
        ),
        migrations.CreateModel(
            name="HistoricalSubjectScreening",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                ("subject_identifier", models.CharField(max_length=50)),
                (
                    "subject_identifier_as_pk",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                (
                    "subject_identifier_aka",
                    models.CharField(
                        editable=False,
                        help_text="track a previously allocated identifier.",
                        max_length=50,
                        null=True,
                        verbose_name="Subject Identifier a.k.a",
                    ),
                ),
                (
                    "slug",
                    models.CharField(
                        db_index=True,
                        default="",
                        editable=False,
                        help_text="a field used for quick search",
                        max_length=250,
                        null=True,
                    ),
                ),
                (
                    "reference",
                    models.UUIDField(
                        db_index=True,
                        default=uuid.uuid4,
                        editable=False,
                        verbose_name="Reference",
                    ),
                ),
                (
                    "screening_identifier",
                    models.CharField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        max_length=50,
                        verbose_name="Screening ID",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="Date and time of report.",
                        verbose_name="Report Date and Time",
                    ),
                ),
                (
                    "gender",
                    models.CharField(choices=[("M", "Male"), ("F", "Female")], max_length=10),
                ),
                (
                    "age_in_years",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(110),
                        ]
                    ),
                ),
                (
                    "consent_ability",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Participant or legal guardian/representative able and willing to give informed consent.",
                    ),
                ),
                (
                    "unsuitable_for_study",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="No",
                        help_text="If YES, patient NOT eligible, please give reason below.",
                        max_length=5,
                        verbose_name="Is there any other reason the patient is deemed to not be suitable for the study?",
                    ),
                ),
                (
                    "reasons_unsuitable",
                    models.TextField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="Reason not suitable for the study",
                    ),
                ),
                (
                    "unsuitable_agreed",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=5,
                        verbose_name="Does the study coordinator agree that the patient is not suitable for the study?",
                    ),
                ),
                ("eligible", models.BooleanField(default=False, editable=False)),
                (
                    "reasons_ineligible",
                    models.TextField(
                        editable=False,
                        max_length=150,
                        null=True,
                        verbose_name="Reason not eligible",
                    ),
                ),
                (
                    "eligibility_datetime",
                    models.DateTimeField(
                        editable=False,
                        help_text="Date and time eligibility was determined",
                        null=True,
                    ),
                ),
                ("consented", models.BooleanField(default=False, editable=False)),
                ("refused", models.BooleanField(default=False, editable=False)),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "screening_consent",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Has the subject given his/her verbal consent to be screened for the MOCCA Extension trial?",
                    ),
                ),
                (
                    "mocca_participant",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Was the patient enrolled to the original MOCCA study?",
                    ),
                ),
                (
                    "mocca_study_identifier",
                    models.CharField(
                        help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                        max_length=25,
                        validators=[
                            django.core.validators.RegexValidator(
                                "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                                "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                            )
                        ],
                        verbose_name="Original MOCCA study identifier",
                    ),
                ),
                (
                    "initials",
                    django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                        blank=True,
                        help_text="Use UPPERCASE letters only. May be 2 or 3 letters. Use `F`irst`L`ast or `L`ast`F`irst depending on the country custom.  (Encryption: RSA local)",
                        max_length=71,
                        validators=[
                            django.core.validators.RegexValidator(
                                "[A-Z]{1,3}", "Invalid format"
                            ),
                            django.core.validators.MinLengthValidator(2),
                            django.core.validators.MaxLengthValidator(3),
                        ],
                    ),
                ),
                (
                    "birth_year",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1900),
                            django.core.validators.MaxValueValidator(2002),
                        ]
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "mocca_register",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="mocca_screening.MoccaRegister",
                    ),
                ),
                (
                    "mocca_site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        limit_choices_to=mocca_screening.mocca_original_sites.get_mocca_site_limited_to,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="mocca_lists.MoccaOriginalSites",
                        verbose_name="Original MOCCA site",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Subject Screening",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalSubjectRefusal",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "screening_identifier",
                    models.CharField(db_index=True, max_length=50),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        verbose_name="Report Date and Time",
                    ),
                ),
                (
                    "reason",
                    models.CharField(
                        choices=[
                            ("unwilling_to_say", "I am unwilling to say"),
                            ("dont_have_time", "I don't have time"),
                            ("stigma", "I am worried about stigma"),
                            ("must_consult_spouse", "I need to consult my spouse"),
                            (
                                "dont_want_medication",
                                "I don't want to take any more medication",
                            ),
                            ("dont_want_to_join", "I don't want to take part"),
                            (
                                "need_to_think_about_it",
                                "I haven't had a chance to think about it",
                            ),
                            ("moving", "I am moving to another area"),
                            ("OTHER", "Other, please specify"),
                        ],
                        max_length=25,
                        verbose_name="Reason for refusal to join",
                    ),
                ),
                (
                    "other_reason",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "comment",
                    models.TextField(
                        blank=True, null=True, verbose_name="Additional Comments"
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Subject Refusal",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalDailyClosingLog",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "log_date",
                    models.DateField(
                        default=edc_utils.date.get_utcnow, verbose_name="Clinic date"
                    ),
                ),
                (
                    "clinic_services",
                    models.CharField(
                        choices=[
                            (
                                "integrated",
                                "Integrated care day (HIV, Diabetes, Hypertension)",
                            ),
                            ("ncd", "NCD day (Diabetes + Hypertension)"),
                            ("HIV", "HIV only day"),
                            ("diabetes", "Diabetes only day"),
                            ("hypertension", "Hypertension only day"),
                        ],
                        max_length=25,
                        verbose_name="Which services are being offered at the clinic today?",
                    ),
                ),
                (
                    "attended",
                    models.IntegerField(
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Total number of patients who attended the clinic today",
                    ),
                ),
                (
                    "selection_method",
                    models.CharField(
                        choices=[
                            ("random_sampling", "Random sampling"),
                            ("systematic", "Systematically selected"),
                            ("sequential", "Sequentially selected"),
                            ("purposively_selected", "Purposively selected"),
                        ],
                        max_length=25,
                        verbose_name="How were patients selected to be approached?",
                    ),
                ),
                (
                    "approached",
                    models.IntegerField(
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Of those who attended, how many were approached by the study team",
                    ),
                ),
                (
                    "agreed_to_screen",
                    models.IntegerField(
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Of those approached, how many agreed to be screened",
                    ),
                ),
                (
                    "comment",
                    models.TextField(
                        blank=True, null=True, verbose_name="Additional Comments"
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Daily Closing Log",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="DailyClosingLog",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "log_date",
                    models.DateField(
                        default=edc_utils.date.get_utcnow, verbose_name="Clinic date"
                    ),
                ),
                (
                    "clinic_services",
                    models.CharField(
                        choices=[
                            (
                                "integrated",
                                "Integrated care day (HIV, Diabetes, Hypertension)",
                            ),
                            ("ncd", "NCD day (Diabetes + Hypertension)"),
                            ("HIV", "HIV only day"),
                            ("diabetes", "Diabetes only day"),
                            ("hypertension", "Hypertension only day"),
                        ],
                        max_length=25,
                        verbose_name="Which services are being offered at the clinic today?",
                    ),
                ),
                (
                    "attended",
                    models.IntegerField(
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Total number of patients who attended the clinic today",
                    ),
                ),
                (
                    "selection_method",
                    models.CharField(
                        choices=[
                            ("random_sampling", "Random sampling"),
                            ("systematic", "Systematically selected"),
                            ("sequential", "Sequentially selected"),
                            ("purposively_selected", "Purposively selected"),
                        ],
                        max_length=25,
                        verbose_name="How were patients selected to be approached?",
                    ),
                ),
                (
                    "approached",
                    models.IntegerField(
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Of those who attended, how many were approached by the study team",
                    ),
                ),
                (
                    "agreed_to_screen",
                    models.IntegerField(
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Of those approached, how many agreed to be screened",
                    ),
                ),
                (
                    "comment",
                    models.TextField(
                        blank=True, null=True, verbose_name="Additional Comments"
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
            ],
            options={
                "verbose_name": "Daily Closing Log",
                "verbose_name_plural": "Daily Closing Logs",
            },
            managers=[
                ("on_site", edc_sites.models.CurrentSiteManager()),
            ],
        ),
        migrations.AddIndex(
            model_name="moccaregister",
            index=models.Index(
                fields=["mocca_country", "mocca_site"],
                name="mocca_scree_mocca_c_7f1635_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="moccaregister",
            index=models.Index(
                fields=["mocca_study_identifier", "initials", "gender"],
                name="mocca_scree_mocca_s_a92e02_idx",
            ),
        ),
        migrations.AddConstraint(
            model_name="moccaregister",
            constraint=models.UniqueConstraint(
                fields=("mocca_screening_identifier",),
                name="unique_mocca_screening_identifier",
            ),
        ),
        migrations.AddConstraint(
            model_name="moccaregister",
            constraint=models.UniqueConstraint(
                fields=("mocca_study_identifier",), name="unique_mocca_study_identifier"
            ),
        ),
        migrations.AddConstraint(
            model_name="moccaregister",
            constraint=models.UniqueConstraint(
                fields=("first_name", "last_name"), name="unique_first_name__last_name"
            ),
        ),
        migrations.AddConstraint(
            model_name="dailyclosinglog",
            constraint=models.UniqueConstraint(
                fields=("log_date", "site"), name="unique_date_for_site"
            ),
        ),
        migrations.AlterModelManagers(
            name="moccaregister",
            managers=[
                ("on_site", edc_sites.models.CurrentSiteManager()),
                ("objects", mocca_screening.models.mocca_register.Manager()),
            ],
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="site",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="sites.Site",
            ),
        ),
        migrations.AlterField(
            model_name="historicalsubjectscreening",
            name="mocca_study_identifier",
            field=models.CharField(
                db_index=True,
                help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                max_length=25,
                validators=[
                    django.core.validators.RegexValidator(
                        "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                        "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                    )
                ],
                verbose_name="Original MOCCA study identifier",
            ),
        ),
        migrations.AlterField(
            model_name="moccaregister",
            name="initials",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text="Use UPPERCASE letters only. May be 2 or 3 letters. (Encryption: RSA local)",
                max_length=71,
                null=True,
                validators=[
                    django.core.validators.RegexValidator("[A-Z]{1,3}", "Invalid format"),
                    django.core.validators.MinLengthValidator(2),
                    django.core.validators.MaxLengthValidator(3),
                ],
            ),
        ),
        migrations.AlterField(
            model_name="subjectscreening",
            name="mocca_study_identifier",
            field=models.CharField(
                help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                max_length=25,
                unique=True,
                validators=[
                    django.core.validators.RegexValidator(
                        "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                        "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                    )
                ],
                verbose_name="Original MOCCA study identifier",
            ),
        ),
        migrations.AlterField(
            model_name="moccaregister",
            name="gender",
            field=models.CharField(
                choices=[("M", "Male"), ("F", "Female")], max_length=10, null=True
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="screening_identifier",
            field=models.CharField(
                max_length=15,
                null=True,
                verbose_name="MOCCA (ext) screening identifier",
            ),
        ),
        migrations.AlterField(
            model_name="historicalsubjectscreening",
            name="mocca_register",
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                limit_choices_to={"screening_identifier__isnull": True},
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="mocca_screening.MoccaRegister",
                verbose_name="Select one from the MOCCA (original) register",
            ),
        ),
        migrations.AlterField(
            model_name="subjectscreening",
            name="mocca_register",
            field=models.OneToOneField(
                limit_choices_to={"screening_identifier__isnull": True},
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="mocca_screening.MoccaRegister",
                verbose_name="Select one from the MOCCA (original) register",
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="contact_attempts",
            field=models.IntegerField(default=0),
        ),
        migrations.CreateModel(
            name="MoccaRegisterContact",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(default=edc_utils.date.get_utcnow),
                ),
                (
                    "contacted",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="No",
                        max_length=15,
                    ),
                ),
                (
                    "survival_status",
                    models.CharField(
                        choices=[
                            ("alive", "Alive"),
                            ("dead", "Deceased"),
                            ("unknown", "Unknown"),
                        ],
                        max_length=15,
                        null=True,
                    ),
                ),
                (
                    "willing_to_attend",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")], max_length=15, null=True
                    ),
                ),
                (
                    "call_again",
                    models.CharField(choices=[("Yes", "Yes"), ("No", "No")], max_length=15),
                ),
                (
                    "mocca_register",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="mocca_screening.MoccaRegister",
                    ),
                ),
            ],
            options={
                "verbose_name": "MOCCA Patient Register Contact",
                "verbose_name_plural": "MOCCA Patient Register Contacts",
            },
        ),
        migrations.AlterModelManagers(
            name="moccaregistercontact",
            managers=[
                ("on_site", edc_sites.models.CurrentSiteManager()),
                ("objects", mocca_screening.models.mocca_register_contact.Manager()),
            ],
        ),
        migrations.AddField(
            model_name="moccaregistercontact",
            name="site",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="sites.Site",
            ),
        ),
        migrations.RenameField(
            model_name="moccaregistercontact",
            old_name="contacted",
            new_name="answered",
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="call_again",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                max_length=15,
                verbose_name="Try again?",
            ),
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="survival_status",
            field=models.CharField(
                choices=[
                    ("alive", "Alive"),
                    ("dead", "Deceased"),
                    ("unknown", "Unknown"),
                ],
                default="unknown",
                max_length=15,
            ),
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="willing_to_attend",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("unknown", "Unknown")],
                default="unknown",
                max_length=15,
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="call",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")], default="Yes", max_length=15
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="notes",
            field=django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(
                blank=True,
                help_text=" (Encryption: AES local)",
                max_length=71,
                null=True,
            ),
        ),
        migrations.CreateModel(
            name="HistoricalMoccaRegisterContact",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(default=edc_utils.date.get_utcnow),
                ),
                (
                    "answered",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="No",
                        max_length=15,
                    ),
                ),
                (
                    "survival_status",
                    models.CharField(
                        choices=[
                            ("alive", "Alive"),
                            ("dead", "Deceased"),
                            ("unknown", "Unknown"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                    ),
                ),
                (
                    "willing_to_attend",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("not_sure", "Not sure"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                    ),
                ),
                (
                    "call_again",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Try again?",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "mocca_register",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="mocca_screening.MoccaRegister",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "respondent",
                    models.CharField(
                        choices=[
                            ("patient", "Patient"),
                            ("family", "Family"),
                            ("friend", "friend"),
                            ("other", "other"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical MOCCA Patient Register Contact",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddField(
            model_name="moccaregistercontact",
            name="respondent",
            field=models.CharField(
                choices=[
                    ("patient", "Patient"),
                    ("family", "Family"),
                    ("friend", "friend"),
                    ("other", "other"),
                    ("N/A", "Not applicable"),
                ],
                default="N/A",
                max_length=15,
            ),
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="survival_status",
            field=models.CharField(
                choices=[
                    ("alive", "Alive"),
                    ("dead", "Deceased"),
                    ("unknown", "Unknown"),
                    ("N/A", "Not applicable"),
                ],
                default="N/A",
                max_length=15,
            ),
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="willing_to_attend",
            field=models.CharField(
                choices=[
                    ("Yes", "Yes"),
                    ("No", "No"),
                    ("not_sure", "Not sure"),
                    ("N/A", "Not applicable"),
                ],
                default="N/A",
                max_length=15,
            ),
        ),
        migrations.CreateModel(
            name="HistoricalMoccaRegister",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(default=edc_utils.date.get_utcnow),
                ),
                (
                    "mocca_screening_identifier",
                    models.CharField(
                        blank=True,
                        help_text="If known",
                        max_length=15,
                        null=True,
                        verbose_name="MOCCA (original) screening identifier",
                    ),
                ),
                (
                    "mocca_study_identifier",
                    models.CharField(
                        help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                        max_length=25,
                        validators=[
                            django.core.validators.RegexValidator(
                                "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                                "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                            )
                        ],
                        verbose_name="MOCCA (original) study identifier",
                    ),
                ),
                (
                    "mocca_country",
                    models.CharField(
                        choices=[("uganda", "Uganda"), ("tanzania", "Tanzania")],
                        max_length=25,
                    ),
                ),
                (
                    "first_name",
                    django_crypto_fields.fields.firstname_field.FirstnameField(
                        blank=True,
                        help_text=" (Encryption: RSA local)",
                        max_length=71,
                        null=True,
                    ),
                ),
                (
                    "last_name",
                    django_crypto_fields.fields.lastname_field.LastnameField(
                        blank=True,
                        help_text=" (Encryption: RSA local)",
                        max_length=71,
                        null=True,
                    ),
                ),
                (
                    "initials",
                    django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                        blank=True,
                        help_text="Use UPPERCASE letters only. May be 2 or 3 letters. (Encryption: RSA local)",
                        max_length=71,
                        null=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "[A-Z]{1,3}", "Invalid format"
                            ),
                            django.core.validators.MinLengthValidator(2),
                            django.core.validators.MaxLengthValidator(3),
                        ],
                    ),
                ),
                (
                    "gender",
                    models.CharField(
                        choices=[("M", "Male"), ("F", "Female")],
                        max_length=10,
                        null=True,
                    ),
                ),
                (
                    "age_in_years",
                    models.IntegerField(
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(18),
                            django.core.validators.MaxValueValidator(110),
                        ],
                    ),
                ),
                (
                    "birth_year",
                    models.IntegerField(
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(1900),
                            django.core.validators.MaxValueValidator(2002),
                        ],
                    ),
                ),
                ("dob", models.DateField(blank=True, null=True)),
                (
                    "survival_status",
                    models.CharField(
                        choices=[
                            ("alive", "Alive"),
                            ("dead", "Deceased"),
                            ("unknown", "Unknown"),
                        ],
                        default="unknown",
                        max_length=25,
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "mocca_site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        limit_choices_to=mocca_screening.mocca_original_sites.get_mocca_site_limited_to,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="mocca_lists.MoccaOriginalSites",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "screening_identifier",
                    models.CharField(
                        max_length=15,
                        null=True,
                        verbose_name="MOCCA (ext) screening identifier",
                    ),
                ),
                ("contact_attempts", models.IntegerField(default=0)),
                (
                    "call",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="Yes",
                        max_length=15,
                    ),
                ),
                (
                    "notes",
                    django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(
                        blank=True,
                        help_text=" (Encryption: AES local)",
                        max_length=71,
                        null=True,
                    ),
                ),
                ("date_last_called", models.DateField(null=True)),
            ],
            options={
                "verbose_name": "historical MOCCA Patient Register",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="date_last_called",
            field=models.DateField(null=True),
        ),
        migrations.RemoveConstraint(
            model_name="moccaregister",
            name="unique_first_name__last_name",
        ),
        migrations.AlterModelOptions(
            name="moccaregistercontact",
            options={
                "ordering": ["report_datetime"],
                "verbose_name": "MOCCA Patient Register Contact",
                "verbose_name_plural": "MOCCA Patient Register Contacts",
            },
        ),
        migrations.AlterField(
            model_name="historicalmoccaregister",
            name="call",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                default="Yes",
                max_length=15,
                verbose_name="Call?",
            ),
        ),
        migrations.AlterField(
            model_name="moccaregister",
            name="call",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                default="Yes",
                max_length=15,
                verbose_name="Call?",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregister",
            name="tel_one",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text=" (Encryption: RSA local)",
                max_length=71,
                null=True,
                verbose_name="Tel/Mobile(1)",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregister",
            name="tel_three",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text=" (Encryption: RSA local)",
                max_length=71,
                null=True,
                verbose_name="Tel/Mobile(3)",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregister",
            name="tel_two",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text=" (Encryption: RSA local)",
                max_length=71,
                null=True,
                verbose_name="Tel/Mobile(2)",
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="tel_one",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text=" (Encryption: RSA local)",
                max_length=71,
                null=True,
                verbose_name="Tel/Mobile(1)",
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="tel_three",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text=" (Encryption: RSA local)",
                max_length=71,
                null=True,
                verbose_name="Tel/Mobile(3)",
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="tel_two",
            field=django_crypto_fields.fields.encrypted_char_field.EncryptedCharField(
                blank=True,
                help_text=" (Encryption: RSA local)",
                max_length=71,
                null=True,
                verbose_name="Tel/Mobile(2)",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregister",
            name="best_tel",
            field=models.CharField(
                blank=True,
                choices=[
                    ("tel_1", "Tel/Mobile(1)"),
                    ("tel_2", "Tel/Mobile(2)"),
                    ("tel_3", "Tel/Mobile(3)"),
                ],
                help_text="If any, select the best telephone/mobile from above",
                max_length=15,
                null=True,
                verbose_name="Prefered Telephone / Mobile",
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="best_tel",
            field=models.CharField(
                blank=True,
                choices=[
                    ("tel_1", "Tel/Mobile(1)"),
                    ("tel_2", "Tel/Mobile(2)"),
                    ("tel_3", "Tel/Mobile(3)"),
                ],
                help_text="If any, select the best telephone/mobile from above",
                max_length=15,
                null=True,
                verbose_name="Prefered Telephone / Mobile",
            ),
        ),
        migrations.AlterField(
            model_name="historicalmoccaregistercontact",
            name="answered",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")], max_length=15, null=True
            ),
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="answered",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")], max_length=15, null=True
            ),
        ),
        migrations.AlterField(
            model_name="historicalmoccaregistercontact",
            name="call_again",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                max_length=15,
                verbose_name="Call again?",
            ),
        ),
        migrations.AlterField(
            model_name="moccaregistercontact",
            name="call_again",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                max_length=15,
                verbose_name="Call again?",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregister",
            name="next_appt_date",
            field=models.DateField(
                blank=True, help_text="auto-updated", null=True, verbose_name="Appt"
            ),
        ),
        migrations.AddField(
            model_name="moccaregister",
            name="next_appt_date",
            field=models.DateField(
                blank=True, help_text="auto-updated", null=True, verbose_name="Appt"
            ),
        ),
        migrations.AlterField(
            model_name="historicalmoccaregister",
            name="contact_attempts",
            field=models.IntegerField(default=0, help_text="auto-updated"),
        ),
        migrations.AlterField(
            model_name="historicalmoccaregister",
            name="date_last_called",
            field=models.DateField(help_text="auto-updated", null=True),
        ),
        migrations.AlterField(
            model_name="historicalmoccaregister",
            name="notes",
            field=django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(
                blank=True,
                help_text=" (Encryption: AES local)",
                max_length=71,
                null=True,
                verbose_name="General notes",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregistercontact",
            name="comment",
            field=django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(
                blank=True,
                help_text=" (Encryption: AES local)",
                max_length=71,
                null=True,
                verbose_name="Note",
            ),
        ),
        migrations.AddField(
            model_name="historicalmoccaregistercontact",
            name="next_appt_date",
            field=models.DateField(blank=True, null=True, verbose_name="Next Appt."),
        ),
        migrations.AlterField(
            model_name="moccaregister",
            name="contact_attempts",
            field=models.IntegerField(default=0, help_text="auto-updated"),
        ),
        migrations.AlterField(
            model_name="moccaregister",
            name="date_last_called",
            field=models.DateField(help_text="auto-updated", null=True),
        ),
        migrations.AlterField(
            model_name="moccaregister",
            name="notes",
            field=django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(
                blank=True,
                help_text=" (Encryption: AES local)",
                max_length=71,
                null=True,
                verbose_name="General notes",
            ),
        ),
        migrations.AddField(
            model_name="moccaregistercontact",
            name="comment",
            field=django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(
                blank=True,
                help_text=" (Encryption: AES local)",
                max_length=71,
                null=True,
                verbose_name="Note",
            ),
        ),
        migrations.AddField(
            model_name="moccaregistercontact",
            name="next_appt_date",
            field=models.DateField(blank=True, null=True, verbose_name="Next Appt."),
        ),
        migrations.AddField(
            model_name="historicalmoccaregistercontact",
            name="death_date",
            field=models.DateField(blank=True, null=True, verbose_name="Date of death"),
        ),
        migrations.AddField(
            model_name="moccaregistercontact",
            name="death_date",
            field=models.DateField(blank=True, null=True, verbose_name="Date of death"),
        ),
        migrations.AddField(
            model_name="historicalmoccaregistercontact",
            name="icc",
            field=models.CharField(
                blank=True,
                choices=[("Yes", "Yes"), ("No", "No")],
                help_text="Either at this facility or elsewhere",
                max_length=25,
                null=True,
                verbose_name="Does the patient currently receive regular integrated care",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="care_not_in_reason",
            field=models.CharField(
                blank=True,
                max_length=25,
                null=True,
                verbose_name="If not in care, why?",
            ),
        ),
        migrations.AddField(
            model_name="moccaregistercontact",
            name="icc",
            field=models.CharField(
                blank=True,
                choices=[("Yes", "Yes"), ("No", "No")],
                help_text="Either at this facility or elsewhere",
                max_length=25,
                null=True,
                verbose_name="Does the patient currently receive regular integrated care",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="care_not_in_reason",
            field=models.CharField(
                blank=True,
                max_length=25,
                null=True,
                verbose_name="If not in care, why?",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="care",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("unknown", "Unknown")],
                default="-",
                max_length=25,
                verbose_name="Is the patient in care?",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="care_facility_location",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
                default="N/A",
                help_text="Either integrated care or vertical care",
                max_length=25,
                verbose_name="Does the patient receive care in this facility",
            ),
        ),
        migrations.AlterField(
            model_name="historicalsubjectscreening",
            name="mocca_participant",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                default="Yes",
                max_length=25,
                verbose_name="Was the patient enrolled to the original MOCCA study?",
            ),
        ),
        migrations.AlterField(
            model_name="historicalsubjectscreening",
            name="mocca_study_identifier",
            field=models.CharField(
                db_index=True,
                help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                max_length=25,
                validators=[
                    django.core.validators.RegexValidator(
                        "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                        "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                    )
                ],
                verbose_name="MOCCA (original) study identifier",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="care",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("unknown", "Unknown")],
                default="-",
                max_length=25,
                verbose_name="Is the patient in care?",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="care_facility_location",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
                default="N/A",
                help_text="Either integrated care or vertical care",
                max_length=25,
                verbose_name="Does the patient receive care in this facility",
            ),
        ),
        migrations.AlterField(
            model_name="subjectscreening",
            name="mocca_participant",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                default="Yes",
                max_length=25,
                verbose_name="Was the patient enrolled to the original MOCCA study?",
            ),
        ),
        migrations.AlterField(
            model_name="subjectscreening",
            name="mocca_study_identifier",
            field=models.CharField(
                help_text="Format must match original identifier. e.g. 12-3456 for UG, 123456 for TZ",
                max_length=25,
                unique=True,
                validators=[
                    django.core.validators.RegexValidator(
                        "0[0-9]{1}\\-0[0-9]{3}|[0-9]{6}",
                        "Invalid format. Expected 12-3456 for UG, 123456 for TZ",
                    )
                ],
                verbose_name="MOCCA (original) study identifier",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="care_comment",
            field=models.TextField(
                blank=True,
                null=True,
                verbose_name="Additional comments relevant to this patient's care",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="icc_not_in_reason",
            field=models.CharField(
                choices=[
                    (
                        "icc_not_available",
                        "ICC not available (or closed) in this facility",
                    ),
                    ("moved", "Moved out of area"),
                    (
                        "dont_want",
                        "Personally chose not to continue with integrated care",
                    ),
                    (
                        "advised_to_vertical",
                        "Healthcare staff asked patient to return to vertical care",
                    ),
                    ("referred_out", "Referred to another facility without an ICC"),
                    ("N/A", "Not applicable"),
                ],
                default="N/A",
                max_length=25,
                verbose_name="If not integrated care, why not?",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="care_comment",
            field=models.TextField(
                blank=True,
                null=True,
                verbose_name="Additional comments relevant to this patient's care",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="icc_not_in_reason",
            field=models.CharField(
                choices=[
                    (
                        "icc_not_available",
                        "ICC not available (or closed) in this facility",
                    ),
                    ("moved", "Moved out of area"),
                    (
                        "dont_want",
                        "Personally chose not to continue with integrated care",
                    ),
                    (
                        "advised_to_vertical",
                        "Healthcare staff asked patient to return to vertical care",
                    ),
                    ("referred_out", "Referred to another facility without an ICC"),
                    ("N/A", "Not applicable"),
                ],
                default="N/A",
                max_length=25,
                verbose_name="If not integrated care, why not?",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="icc",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
                default="N/A",
                help_text="Either at this facility or elsewhere",
                max_length=25,
                verbose_name="Does the patient <u>currently</u> receive integrated care",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="icc_since_mocca",
            field=models.CharField(
                choices=[
                    ("no_interruption", "Yes, without interruption"),
                    ("some_interruption", "Yes, with some interruption"),
                    (
                        "No",
                        "No, not since completing follow up with the MOCCA (original) trial.",
                    ),
                    ("unknown", "Unknown"),
                ],
                max_length=25,
                verbose_name="Has the patient received integrated care since the leaving the MOCCA (orig) trial until now?",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="icc_since_mocca_comment",
            field=edc_model_fields.fields.other_charfield.OtherCharField(
                blank=True,
                max_length=35,
                null=True,
                verbose_name="If some interruption in integrated care, please explain",
            ),
        ),
        migrations.AlterField(
            model_name="historicalsubjectscreening",
            name="mocca_register",
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="mocca_screening.MoccaRegister",
                verbose_name="MOCCA (original) register details",
            ),
        ),
        migrations.AddField(
            model_name="historicalsubjectscreening",
            name="willing_to_consent",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
                default="N/A",
                help_text="If Yes, begin the informed consent process.",
                max_length=25,
                verbose_name="Is the patient willing and able to participate in the `MOCCA extension` trial",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="icc",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
                default="N/A",
                help_text="Either at this facility or elsewhere",
                max_length=25,
                verbose_name="Does the patient <u>currently</u> receive integrated care",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="icc_since_mocca",
            field=models.CharField(
                choices=[
                    ("no_interruption", "Yes, without interruption"),
                    ("some_interruption", "Yes, with some interruption"),
                    (
                        "No",
                        "No, not since completing follow up with the MOCCA (original) trial.",
                    ),
                    ("unknown", "Unknown"),
                ],
                max_length=25,
                verbose_name="Has the patient received integrated care since the leaving the MOCCA (orig) trial until now?",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="icc_since_mocca_comment",
            field=edc_model_fields.fields.other_charfield.OtherCharField(
                blank=True,
                max_length=35,
                null=True,
                verbose_name="If some interruption in integrated care, please explain",
            ),
        ),
        migrations.AlterField(
            model_name="subjectscreening",
            name="mocca_register",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="mocca_screening.MoccaRegister",
                verbose_name="MOCCA (original) register details",
            ),
        ),
        migrations.AddField(
            model_name="subjectscreening",
            name="willing_to_consent",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
                default="N/A",
                help_text="If Yes, begin the informed consent process.",
                max_length=25,
                verbose_name="Is the patient willing and able to participate in the `MOCCA extension` trial",
            ),
        ),
    ]
