# Generated by Django 4.2.14 on 2025-01-06 22:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('organizations', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Medication',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('status', models.CharField(choices=[('active', 'Active'), ('inactive', 'Inactive'), ('entered_in_error', 'Entered in error')], max_length=255)),
                ('total_volume', models.IntegerField(null=True)),
                ('lot_number', models.CharField(max_length=255, null=True)),
                ('expiration_date', models.DateTimeField(null=True)),
                ('definition', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationCodes',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationDoseForm',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationIngredientItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationIngredient',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('strength', models.CharField(choices=[('sufficient', 'Sufficient'), ('small_amount', 'Small amount')], max_length=255)),
                ('strength_ratio', models.CharField(max_length=255, null=True)),
                ('strength_quantity', models.IntegerField(null=True)),
                ('item', models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_ingredient_item', to='medications.medicationingredientitem')),
                ('medication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_ingredient_medication', to='medications.medication')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medication',
            name='code',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='medications.medicationcodes'),
        ),
        migrations.AddField(
            model_name='medication',
            name='dose_form',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='medications.medicationdoseform'),
        ),
        migrations.AddField(
            model_name='medication',
            name='marketing_authorization_holder',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_organization', to='organizations.organization'),
        ),
    ]
