# Generated by Django 2.2.28 on 2025-06-01 09:58

import django.core.validators
from django.db import migrations, models
import patient.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MedicalRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('record_type', models.CharField(choices=[('general', 'General'), ('diabetes', 'Diabetes'), ('hypertension', 'Hypertension'), ('pregnancy', 'Pregnancy'), ('heart', 'Heart Disease'), ('allergy', 'Allergy'), ('other', 'Other')], max_length=20)),
                ('diagnosis_date', models.DateField(blank=True, null=True)),
                ('medications', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('status', models.CharField(choices=[('active', 'Active - Under Treatment'), ('controlled', 'Controlled'), ('recovered', 'Recovered')], default='active', max_length=20)),
                ('diabetes_type', models.CharField(blank=True, choices=[('', ''), ('type1', 'Type 1'), ('type2', 'Type 2'), ('gestational', 'Gestational')], max_length=20, null=True)),
                ('blood_pressure', models.CharField(blank=True, max_length=20, null=True)),
                ('pregnancy_week', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=100, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('phone_number', models.CharField(blank=True, max_length=15, null=True, validators=[django.core.validators.RegexValidator(message='Phone number must contain only numeric characters.', regex='^\\d+$')])),
                ('date_of_birth', models.DateField(validators=[patient.models.validate_future_date])),
                ('gender', models.CharField(choices=[('Male', 'Male'), ('Female', 'Female'), ('None', 'None')], default='None', max_length=8)),
                ('reference_type', models.CharField(choices=[('', ''), ('Person', 'Person'), ('SocialMedia', 'SocialMedia')], default='', max_length=18)),
                ('social_media_type', models.CharField(choices=[('', ''), ('Instagram', 'Instagram'), ('Telegram', 'Telegram'), ('WhatsApp', 'WhatsApp'), ('Viber', 'Viber'), ('Facebook', 'Facebook'), ('TikTok', 'TikTok'), ('Others', 'Others')], default='', max_length=18)),
                ('identifier_name', models.CharField(blank=True, max_length=18, null=True)),
                ('identifier_phone', models.CharField(blank=True, max_length=18, null=True)),
                ('address', models.CharField(blank=True, max_length=100, null=True)),
                ('profile_picture', models.ImageField(blank=True, null=True, upload_to='images/patient_profile')),
                ('medical_history', models.TextField(blank=True, null=True)),
                ('identifier', models.IntegerField(blank=True, default=patient.models.generate_random_id, null=True)),
                ('biography', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='PatientImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='images/patient_gallery/%Y/%m/%d/')),
                ('description', models.CharField(blank=True, max_length=200)),
                ('image_type', models.CharField(choices=[('before', 'Before Treatment'), ('after', 'After Treatment'), ('during', 'During Treatment'), ('other', 'Other')], max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
