# Generated by Django 3.0.9 on 2020-12-15 00:41

import _socket
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_revision.revision_field
import edc_model_fields.fields.other_charfield
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("mocca_screening", "0002_auto_20201215_0241"),
    ]

    operations = [
        migrations.CreateModel(
            name="CareStatus",
            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, unique=True)),
                (
                    "care",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No"), ("unknown", "Unknown")],
                        max_length=25,
                        verbose_name="Is the patient in care?",
                    ),
                ),
                (
                    "care_not_in_reason",
                    models.CharField(
                        blank=True,
                        max_length=25,
                        null=True,
                        verbose_name="If not in care, why?",
                    ),
                ),
                (
                    "care_facility_location",
                    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",
                    ),
                ),
                (
                    "icc_since_mocca",
                    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?",
                    ),
                ),
                (
                    "icc_since_mocca_comment",
                    edc_model_fields.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If some interruption in integrated care, please explain",
                    ),
                ),
                (
                    "icc",
                    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",
                    ),
                ),
                (
                    "icc_not_in_reason",
                    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?",
                    ),
                ),
                (
                    "care_comment",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name="Additional comments relevant to this patient's care",
                    ),
                ),
                (
                    "mocca_register",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="mocca_screening.MoccaRegister",
                        verbose_name="MOCCA (original) register details",
                    ),
                ),
            ],
            options={
                "verbose_name": "Care Status",
                "verbose_name_plural": "Care Status",
                "ordering": ("-modified", "-created"),
                "get_latest_by": "modified",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
        ),
    ]
