# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-27 18:53
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('human_resources', '0015_employee_second_phone'),
        ('patients', '0004_auto_20160827_1808'),
    ]

    operations = [
        migrations.CreateModel(
            name='PatientVisit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('time', models.TimeField()),
                ('duration_in_minutes', models.SmallIntegerField()),
                ('is_durations_auto_calculated', models.BooleanField(default=False)),
                ('is_first_visit', models.BooleanField(default=False)),
                ('status', models.CharField(choices=[('PLANNED', 'visit status planned'), ('CANCELLED', 'visit status cancelled'), ('NEED_TO_TRANSFER', 'visit status need to transfer'), ('NEED_TO_CANCELL', 'visit status need to cancell'), ('LATENESS', 'visit status lateness'), ('LATE_ARRIVALS_TRANSFER', 'visit status late arrivals transfer'), ('TRANSFER', 'visit status transfer'), ('ABSENCE', 'visit status absence'), ('CLIENT_WAIT', 'visit status client wait'), ('IN_PROCESS', 'visit status in process'), ('CLIENT_READY', 'visit status client ready')], default='PLANNED', max_length=30, verbose_name='visit status')),
                ('status_comment', models.TextField(blank=True)),
                ('patient_is_notified', models.BooleanField(default=False)),
                ('comment', models.TextField(blank=True)),
                ('wait_duration', models.SmallIntegerField(null=True)),
                ('wait_status_start_time', models.DateTimeField(null=True)),
                ('procedure_duration', models.SmallIntegerField(null=True)),
                ('procedure_status_start_time', models.DateTimeField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('post_price', models.SmallIntegerField(null=True)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='created_by_employee_id', to='apps.human_resources.Employee')),
                ('doctor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='apps.human_resources.Employee')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='apps.patients.Patient')),
            ],
            options={
                'verbose_name_plural': 'patient visits',
                'verbose_name': 'patient visit',
            },
        ),
        migrations.CreateModel(
            name='VisitReason',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='visit reason name')),
                ('average_duration_minutes', models.SmallIntegerField(null=True, verbose_name='average durations in minutes')),
                ('average_price', models.SmallIntegerField(null=True, verbose_name='average price')),
            ],
            options={
                'verbose_name_plural': 'visit reasons',
                'verbose_name': 'visit reason',
            },
        ),
        migrations.AddField(
            model_name='patientvisit',
            name='reasons',
            field=models.ManyToManyField(to='apps.visit_planning.VisitReason'),
        ),
        migrations.AddField(
            model_name='patientvisit',
            name='updated_by',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='updated_by_employee_id', to='apps.human_resources.Employee'),
        ),
    ]
