# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2017-05-07 09:27
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accounts', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_time', models.DateTimeField(null=True)),
                ('description', models.CharField(blank=True, max_length=256, null=True)),
                ('type', models.CharField(choices=[('create', 'create'), ('delete', 'delete'), ('update', 'update'), ('admit', 'admit'), ('discharge', 'discharge')], max_length=25)),
            ],
        ),
        migrations.CreateModel(
            name='AdmissionLog',
            fields=[
                ('log', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, serialize=False, to='log.Log')),
                ('reason', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='EventLog',
            fields=[
                ('log', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, serialize=False, to='log.Log')),
                ('eventdate', models.DateField()),
                ('eventtime', models.TimeField()),
                ('doctor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts.Doctor')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts.Patient')),
            ],
        ),
        migrations.CreateModel(
            name='MessageLog',
            fields=[
                ('log', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, serialize=False, to='log.Log')),
                ('message', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='PrescLog',
            fields=[
                ('log', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, serialize=False, to='log.Log')),
                ('drugname', models.CharField(max_length=50)),
                ('dosage', models.CharField(max_length=15)),
                ('start_date', models.DateField(null=True)),
                ('end_date', models.DateField(null=True)),
                ('refills', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='TestResultLog',
            fields=[
                ('log', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, serialize=False, to='log.Log')),
                ('date', models.DateField(null=True)),
                ('name', models.CharField(max_length=100)),
                ('information', models.CharField(max_length=2500)),
                ('file', models.FileField(blank=True, null=True, upload_to='')),
                ('is_released', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='TransferLog',
            fields=[
                ('log', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, serialize=False, to='log.Log')),
                ('destination', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts.Hospital')),
                ('newdoctor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts.Doctor')),
                ('prevdoctor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='previous_doctor', to='accounts.Doctor')),
                ('prevhospital', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='previous_hospital', to='accounts.Hospital')),
            ],
        ),
        migrations.AddField(
            model_name='log',
            name='actor',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='log_actor', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='log',
            name='hospital',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts.Hospital'),
        ),
        migrations.AddField(
            model_name='log',
            name='subject',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='log_subject', to=settings.AUTH_USER_MODEL),
        ),
    ]
