# Generated by Django 5.1 on 2024-10-04 12:59

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
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("intecomm_reports", "0020_auto_20240829_1604"),
        ("sites", "0002_alter_domain_unique"),
    ]

    operations = [
        migrations.CreateModel(
            name="OnStudyMissingLabValues",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("original_id", models.UUIDField(null=True)),
                ("label_lower", models.CharField(max_length=150, null=True)),
                ("subject_visit_id", models.UUIDField(null=True)),
                ("report_datetime", models.DateTimeField(null=True)),
                ("label", models.CharField(max_length=50, null=True)),
                ("visit_code", models.CharField(max_length=25, null=True)),
                ("visit_code_sequence", models.IntegerField(null=True)),
                ("schedule_name", models.CharField(max_length=25, null=True)),
                ("modified", models.DateTimeField(null=True)),
                ("report_model", models.CharField(max_length=50)),
                ("subject_identifier", models.CharField(max_length=25)),
                ("created", models.DateTimeField()),
            ],
            options={
                "verbose_name": "Missing Lab values for on-study patient",
                "verbose_name_plural": "Missing Lab values for on-study patients",
                "db_table": "onstudy_missing_lab_values_view",
                "managed": False,
                "default_permissions": ("view", "export", "viewallsites"),
            },
        ),
        migrations.CreateModel(
            name="OnStudyMissingValues",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("original_id", models.UUIDField(null=True)),
                ("label_lower", models.CharField(max_length=150, null=True)),
                ("subject_visit_id", models.UUIDField(null=True)),
                ("report_datetime", models.DateTimeField(null=True)),
                ("label", models.CharField(max_length=50, null=True)),
                ("visit_code", models.CharField(max_length=25, null=True)),
                ("visit_code_sequence", models.IntegerField(null=True)),
                ("schedule_name", models.CharField(max_length=25, null=True)),
                ("modified", models.DateTimeField(null=True)),
                ("report_model", models.CharField(max_length=50)),
                ("subject_identifier", models.CharField(max_length=25)),
                ("created", models.DateTimeField()),
            ],
            options={
                "verbose_name": "Missing values for on-study patient",
                "verbose_name_plural": "Missing values for on-study patients",
                "db_table": "onstudy_missing_values_view",
                "managed": False,
                "default_permissions": ("view", "export", "viewallsites"),
            },
        ),
        migrations.CreateModel(
            name="ApptLocationQa",
            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",
                    ),
                ),
                (
                    "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,
                        verbose_name="Hostname created",
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                        verbose_name="Hostname modified",
                    ),
                ),
                (
                    "device_created",
                    models.CharField(blank=True, max_length=10, verbose_name="Device created"),
                ),
                (
                    "device_modified",
                    models.CharField(
                        blank=True, max_length=10, verbose_name="Device modified"
                    ),
                ),
                (
                    "locale_created",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale created",
                    ),
                ),
                (
                    "locale_modified",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale modified",
                    ),
                ),
                (
                    "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)),
                ("created", models.DateTimeField()),
                (
                    "report_model",
                    models.CharField(default="meta_reports.appttype", max_length=50),
                ),
                ("visit_code", models.CharField(blank=True, max_length=50, null=True)),
                ("visit_code_sequence", models.IntegerField(default=0)),
                (
                    "site",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING, to="sites.site"
                    ),
                ),
            ],
            options={
                "verbose_name": "Appointment location QA",
                "verbose_name_plural": "Appointment location QA",
                "abstract": False,
                "default_permissions": ("view", "export", "viewallsites"),
                "default_manager_name": "objects",
                "indexes": [
                    models.Index(
                        fields=["modified", "created"], name="intecomm_re_modifie_4638df_idx"
                    ),
                    models.Index(
                        fields=["user_modified", "user_created"],
                        name="intecomm_re_user_mo_927bd2_idx",
                    ),
                ],
            },
        ),
    ]
