# Generated by Django 3.0 on 2019-12-18 07:01

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('address', models.CharField(max_length=100, null=True)),
                ('gender', models.CharField(choices=[('m', 'male'), ('f', 'female'), ('n', 'None')], default='n', max_length=1)),
                ('phone', models.CharField(max_length=11, null=True)),
                ('cnic', models.CharField(max_length=15, null=True)),
                ('age', models.PositiveIntegerField(default=0)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Appointment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notes', models.CharField(max_length=200, null=True)),
                ('cancelled', models.BooleanField(default=False)),
                ('time', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='LabTest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField(max_length=300)),
                ('price', models.PositiveIntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Lab Test',
            },
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField(max_length=1000)),
                ('picture', models.ImageField(upload_to='')),
            ],
            options={
                'verbose_name': 'Service',
            },
        ),
        migrations.CreateModel(
            name='Ward',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('capacity', models.PositiveIntegerField(default=1)),
            ],
            options={
                'verbose_name': 'Ward',
            },
        ),
        migrations.CreateModel(
            name='CustomUserAdmin',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('main.user',),
        ),
        migrations.CreateModel(
            name='DoctorAppointment',
            fields=[
                ('appointment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.Appointment')),
                ('fee', models.PositiveIntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Doctor Appointment',
            },
            bases=('main.appointment',),
        ),
        migrations.CreateModel(
            name='LabAppointment',
            fields=[
                ('appointment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.Appointment')),
            ],
            options={
                'verbose_name': 'Lab Appointment',
            },
            bases=('main.appointment',),
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('emergency_contact', models.CharField(max_length=11, null=True)),
            ],
            options={
                'verbose_name': 'Patient',
            },
            bases=('main.user',),
        ),
        migrations.CreateModel(
            name='Staff',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('joining_date', models.DateTimeField()),
                ('salary', models.PositiveIntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Staff',
                'verbose_name_plural': 'Staff',
            },
            bases=('main.user',),
        ),
        migrations.CreateModel(
            name='Prescription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('conditions', models.TextField(max_length=500, null=True)),
                ('notes', models.TextField(max_length=500, null=True)),
                ('tests', models.ManyToManyField(to='main.LabTest')),
                ('appointment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='main.DoctorAppointment')),
            ],
            options={
                'verbose_name': 'Prescription',
            },
        ),
        migrations.CreateModel(
            name='Drug',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('dose', models.CharField(max_length=100)),
                ('prescription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Prescription')),
            ],
            options={
                'verbose_name': 'Drug',
            },
        ),
        migrations.CreateModel(
            name='Admission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('from_date', models.DateTimeField()),
                ('number_of_days', models.PositiveIntegerField(default=1)),
                ('discharged', models.BooleanField(default=False)),
                ('ward', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Ward')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Patient')),
            ],
            options={
                'verbose_name': 'Admission',
            },
        ),
        migrations.CreateModel(
            name='Doctor',
            fields=[
                ('staff_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.Staff')),
                ('specialization', models.CharField(max_length=100, null=True)),
                ('starting_time', models.TimeField()),
                ('end_time', models.TimeField()),
            ],
            options={
                'verbose_name': 'Doctor',
                'verbose_name_plural': 'Doctors',
            },
            bases=('main.staff',),
        ),
        migrations.CreateModel(
            name='HelpingStaff',
            fields=[
                ('staff_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.Staff')),
                ('role', models.CharField(choices=[('ws', 'Ward Staff'), ('ls', 'Lab Staff'), ('n', 'None')], default='n', max_length=2)),
            ],
            options={
                'verbose_name': 'Helping Staff',
                'verbose_name_plural': 'Helping Staff',
            },
            bases=('main.staff',),
        ),
        migrations.CreateModel(
            name='SupportGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('participants', models.PositiveIntegerField(default=0)),
                ('timing', models.TimeField()),
                ('day', models.CharField(choices=[('mon', 'Monday'), ('tue', 'Tuesday'), ('wed', 'Wednesday'), ('thu', 'Thursday'), ('fri', 'Friday'), ('sat', 'Saturday'), ('sun', 'Sunday')], default='mon', max_length=3)),
                ('description', models.TextField(max_length=1000, null=True)),
                ('members', models.ManyToManyField(to='main.Patient')),
            ],
            options={
                'verbose_name': 'Support Group',
            },
        ),
        migrations.CreateModel(
            name='LabReport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(max_length=2000)),
                ('appointment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.LabAppointment')),
            ],
            options={
                'verbose_name': 'Lab Report',
            },
        ),
        migrations.AddField(
            model_name='labappointment',
            name='prescription',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.Prescription'),
        ),
        migrations.CreateModel(
            name='Bill',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('addmission', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.Admission')),
                ('doctor_appointment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.DoctorAppointment')),
                ('lab_appointment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.LabAppointment')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Patient')),
            ],
            options={
                'verbose_name': 'Bill',
            },
        ),
        migrations.AddField(
            model_name='appointment',
            name='patient',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Patient'),
        ),
        migrations.CreateModel(
            name='SupportGroupConductor',
            fields=[
                ('staff_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.Staff')),
                ('conducts', models.ManyToManyField(to='main.SupportGroup')),
            ],
            options={
                'verbose_name': 'Support Group Conductor',
            },
            bases=('main.staff',),
        ),
        migrations.AddField(
            model_name='supportgroup',
            name='support_group_conductor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.SupportGroupConductor'),
        ),
        migrations.AddField(
            model_name='patient',
            name='Lab_appointments',
            field=models.ManyToManyField(through='main.LabAppointment', to='main.HelpingStaff'),
        ),
        migrations.AddField(
            model_name='patient',
            name='doctor_appointments',
            field=models.ManyToManyField(through='main.DoctorAppointment', to='main.Doctor'),
        ),
        migrations.AddField(
            model_name='labappointment',
            name='conducted_by',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.HelpingStaff'),
        ),
        migrations.AddField(
            model_name='doctorappointment',
            name='doctor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Doctor'),
        ),
        migrations.AddField(
            model_name='admission',
            name='attendant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.HelpingStaff'),
        ),
    ]
