# Generated by Django 2.2.11 on 2023-02-14 07:56

import uuid

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


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("facility", "0335_auto_20230207_1914"),
    ]

    operations = [
        migrations.CreateModel(
            name="Policy",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "external_id",
                    models.UUIDField(db_index=True, default=uuid.uuid4, unique=True),
                ),
                (
                    "created_date",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                (
                    "modified_date",
                    models.DateTimeField(auto_now=True, db_index=True, null=True),
                ),
                ("deleted", models.BooleanField(db_index=True, default=False)),
                ("subscriber_id", models.TextField(blank=True, null=True)),
                ("policy_id", models.TextField(blank=True, null=True)),
                ("insurer_id", models.TextField(blank=True, null=True)),
                ("insurer_name", models.TextField(blank=True, null=True)),
                (
                    "status",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("active", "Active"),
                            ("cancelled", "Cancelled"),
                            ("draft", "Draft"),
                            ("entered-in-error", "Entered in Error"),
                        ],
                        default=None,
                        max_length=20,
                        null=True,
                    ),
                ),
                (
                    "priority",
                    models.CharField(
                        choices=[
                            ("stat", "Immediate"),
                            ("normal", "Normal"),
                            ("deferred", "Deferred"),
                        ],
                        default="normal",
                        max_length=20,
                    ),
                ),
                (
                    "purpose",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("auth-requirements", "Auth Requirements"),
                            ("benefits", "Benefits"),
                            ("discovery", "Discovery"),
                            ("validation", "Validation"),
                        ],
                        default=None,
                        max_length=20,
                        null=True,
                    ),
                ),
                (
                    "outcome",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("queued", "Queued"),
                            ("complete", "Processing Complete"),
                            ("error", "Error"),
                            ("partial", "Partial Processing"),
                        ],
                        default=None,
                        max_length=20,
                        null=True,
                    ),
                ),
                ("error_text", models.TextField(blank=True, null=True)),
                (
                    "patient",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="facility.PatientRegistration",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
