# Generated by Django 2.0.3 on 2018-04-18 01:08

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import drdown.users.utils.validators


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0005_auto_20180325_2215'),
    ]

    operations = [
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cpf', models.CharField(help_text='Please, enter a valid CPF in the following format: XXX.XXX.XXX-XX', max_length=14, unique=True, validators=[drdown.users.utils.validators.validate_cpf])),
                ('departament', models.CharField(choices=[('SP_TH', 'Speech Therapy'), ('OC_TH', 'Occupational Therapy'), ('CARD', 'Cardiology'), ('NEURO', 'Neurology'), ('PED', 'Pediatrics'), ('PSY', 'Psychology'), ('PHYS', 'Physiotherapy'), ('SEC', 'Secretary'), ('ADM', 'Administration'), ('NUR', 'Nursery'), ('OTH', 'Other')], help_text='The departament where this user works.', max_length=30, verbose_name='Departament')),
            ],
            options={
                'verbose_name': 'Employee',
                'verbose_name_plural': 'Employees',
            },
        ),
        migrations.CreateModel(
            name='Health_Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cpf', models.CharField(help_text='Please, use enter a valid CPF in the following format:XXX.XXX.XXX-XX', max_length=14, unique=True, validators=[drdown.users.utils.validators.validate_cpf])),
                ('council_acronym', models.CharField(choices=[('CRM', 'CRM'), ('CRP', 'CRP'), ('COFFITO', 'COFFITO')], help_text='The Regional Council.', max_length=30, verbose_name='Council Acronym')),
                ('register_number', models.CharField(help_text='Use enter a valid register number. \nEnter 7 digits', max_length=7, validators=[drdown.users.utils.validators.validate_register_number])),
                ('registration_state', models.CharField(choices=[('AC', 'AC'), ('AL', 'AL'), ('AP', 'AP'), ('BA', 'BA'), ('CE', 'CE'), ('DF', 'DF'), ('ES', 'ES'), ('GO', 'GO'), ('MA', 'MA'), ('MG', 'MG'), ('MS', 'MS'), ('MT', 'MT'), ('PA', 'PA'), ('PB', 'PB'), ('PE', 'PE'), ('PI', 'PI'), ('PR', 'PR'), ('RJ', 'RJ'), ('RN', 'RN'), ('RO', 'RO'), ('RR', 'RR'), ('RS', 'RS'), ('SC', 'SC'), ('SE', 'SE'), ('SP', 'SP'), ('TO', 'TO')], help_text='The registration state of member of health team.', max_length=30, verbose_name='State')),
                ('speciality', models.CharField(choices=[('Speech Therapy', 'Speech Therapy'), ('Occupational Therapy', 'Occupational Therapy'), ('Cardiology', 'Cardiology'), ('Neurology', 'Neurology'), ('Pediatrics', 'Pediatrics'), ('Psychology', 'Psychology'), ('Physiotherapy', 'Physiotherapy'), ('Doctor', 'Doctor')], help_text='The speciality that this member of health team works.', max_length=30, verbose_name='Speciality')),
            ],
            options={
                'verbose_name': 'Health_Team',
                'verbose_name_plural': 'Health_Teams',
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ses', models.CharField(help_text='Please, enter the valid SES number', max_length=9, unique=True, validators=[drdown.users.utils.validators.validate_ses])),
                ('priority', models.IntegerField(choices=[(5, 'Not urgent'), (4, 'Not very urgent'), (3, 'Urgent'), (2, 'Very urgent'), (1, 'Emerging')], help_text='Please, insert the degree of priority of the patient', verbose_name='Priority')),
                ('mother_name', models.CharField(help_text='Please, insert your mother name', max_length=80, validators=[drdown.users.utils.validators.validate_names])),
                ('father_name', models.CharField(help_text='Please, insert your father name', max_length=80, validators=[drdown.users.utils.validators.validate_names], verbose_name='Name of father')),
                ('ethnicity', models.IntegerField(choices=[(5, 'White'), (4, 'Black'), (3, 'Yellow'), (2, 'Brown'), (1, 'Indigenous')], help_text='Please insert the ethnicity of the patient', verbose_name='Ethnicity')),
                ('sus_number', models.CharField(help_text='Please, enter valid SUS in format: XXXXXXXXXXXXXXX', max_length=15, unique=True, validators=[drdown.users.utils.validators.validate_sus], verbose_name='SUS number')),
                ('civil_registry_of_birth', models.CharField(default='', help_text='Please, enter the civil registry of birth number', max_length=11, unique=True, validators=[drdown.users.utils.validators.validate_generic_number], verbose_name='Civil register of birth')),
                ('declaration_of_live_birth', models.CharField(default='', help_text='Please, enter the declaration of live birth number', max_length=11, unique=True, validators=[drdown.users.utils.validators.validate_generic_number], verbose_name='Declaration of live birth')),
            ],
        ),
        migrations.CreateModel(
            name='Responsible',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cpf', models.CharField(help_text='Please, use enter a valid CPF inthe following format: XXX.XXX.XXX-XX', max_length=14, unique=True, validators=[drdown.users.utils.validators.validate_cpf])),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='created_at',
            field=models.DateField(null=True, verbose_name='Created at'),
        ),
        migrations.AddField(
            model_name='user',
            name='has_specialization',
            field=models.BooleanField(default=False, editable=False),
        ),
        migrations.AddField(
            model_name='user',
            name='photo',
            field=models.ImageField(blank=True, help_text='Photo of user.', null=True, upload_to='media/', verbose_name='Photo'),
        ),
        migrations.AddField(
            model_name='user',
            name='updated_at',
            field=models.DateField(null=True, verbose_name='Updated at'),
        ),
        migrations.AlterField(
            model_name='user',
            name='birthday',
            field=models.DateField(help_text='xx/xx/xxxx', null=True, verbose_name='Birthday'),
        ),
        migrations.AlterField(
            model_name='user',
            name='gender',
            field=models.CharField(choices=[('Male', 'Male'), ('Female', 'Female')], max_length=6, null=True, verbose_name='Gender'),
        ),
        migrations.AlterField(
            model_name='user',
            name='last_name',
            field=models.CharField(blank=True, max_length=150, verbose_name='last name'),
        ),
        migrations.AlterField(
            model_name='user',
            name='name',
            field=models.CharField(help_text='Full user name', max_length=255, verbose_name='Name'),
        ),
        migrations.AlterField(
            model_name='user',
            name='telephone',
            field=models.CharField(help_text='(xx)xxxxx-xxxx or (xx)xxxx-xxxx', max_length=14, null=True, validators=[drdown.users.utils.validators.validate_phone], verbose_name='Telephone'),
        ),
        migrations.AddField(
            model_name='responsible',
            name='user',
            field=models.OneToOneField(limit_choices_to=models.Q(has_specialization=False), on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='patient',
            name='responsible',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.Responsible'),
        ),
        migrations.AddField(
            model_name='patient',
            name='user',
            field=models.OneToOneField(limit_choices_to=models.Q(has_specialization=False), on_delete=django.db.models.deletion.CASCADE, related_name='patient', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='health_team',
            name='user',
            field=models.OneToOneField(limit_choices_to=models.Q(has_specialization=False), on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='employee',
            name='user',
            field=models.OneToOneField(limit_choices_to=models.Q(has_specialization=False), on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='health_team',
            unique_together={('registration_state', 'register_number', 'council_acronym')},
        ),
    ]
