# Generated by Django 5.2 on 2025-04-23 12:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base', '0004_initial'),
        ('biologicallyderivedproducts', '0001_initial'),
        ('contracts', '0002_initial'),
        ('devices', '0001_initial'),
        ('inventoryitems', '0002_initial'),
        ('locations', '0001_initial'),
        ('medications', '0001_initial'),
        ('nutritionproducts', '0001_initial'),
        ('organizations', '0001_initial'),
        ('patients', '0001_initial'),
        ('practitionerroles', '0001_initial'),
        ('practitioners', '0001_initial'),
        ('substances', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='SupplyDelivery',
            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=[('in-progress', 'In Progress'), ('completed', 'Completed'), ('abandoned', 'Abandoned'), ('entered-in-error', 'Entered In Error')], max_length=255, null=True)),
                ('occurrence_date_time', models.DateTimeField(blank=True, null=True)),
                ('identifier', models.ManyToManyField(blank=True, related_name='supply_delivery_identifier', to='base.identifier')),
                ('occurrence_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_occurrence_period', to='base.period')),
                ('occurrence_timing', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_occurrence', to='base.timing')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_patient', to='patients.patientreference')),
                ('stage', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_stage', to='base.codeableconcept')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SupplyDeliverReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_reference_identifier', to='base.identifier')),
                ('supply_delivery', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_reference_contract', to='supplydeliveries.supplydelivery')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SupplyDeliveryContractReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('contract', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_contracts_reference_contract', to='contracts.contract')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_contracts_reference_identifier', to='base.identifier')),
                ('supply_delivery', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_contracts_supply_delivery', to='supplydeliveries.supplydelivery')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='supplydelivery',
            name='part_of',
            field=models.ManyToManyField(blank=True, related_name='supply_delivery_part_of', to='supplydeliveries.supplydeliverycontractreference'),
        ),
        migrations.CreateModel(
            name='SupplyDeliveryDestinationReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_destination_references_identifier', to='base.identifier')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_destination_references_location', to='locations.location')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_destination_references_organization', to='organizations.organization')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_destination_references_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_destination_references_practitioner_role', to='practitionerroles.practitionerrole')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='supplydelivery',
            name='destination',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_destination', to='supplydeliveries.supplydeliverydestinationreference'),
        ),
        migrations.CreateModel(
            name='SupplyDeliveryReceiverReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_receiver_references_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_receiver_references_organization', to='organizations.organization')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_receiver_references_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_receiver_references_practitioner_role', to='practitionerroles.practitionerrole')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='supplydelivery',
            name='receiver',
            field=models.ManyToManyField(blank=True, related_name='supply_delivery_receiver', to='supplydeliveries.supplydeliveryreceiverreference'),
        ),
        migrations.CreateModel(
            name='SupplyDeliverySuppliedItem',
            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)),
                ('condition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_condition', to='base.codeableconcept')),
                ('item_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_codealbe_concept', to='base.codeableconcept')),
                ('quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_quantity', to='base.simplequantity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='supplydelivery',
            name='supplied_item',
            field=models.ManyToManyField(blank=True, related_name='supply_delivery_supplied_item', to='supplydeliveries.supplydeliverysupplieditem'),
        ),
        migrations.CreateModel(
            name='SupplyDeliverySuppliedItemItemReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('biologically_derived_product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_biologically_derived_product', to='biologicallyderivedproducts.biologicallyderivedproduct')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_identifier', to='base.identifier')),
                ('inventory_item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_inventory_item', to='inventoryitems.inventoryitem')),
                ('medication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_medication', to='medications.medication')),
                ('nutrition_product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_nutrition_product', to='nutritionproducts.nutritionproduct')),
                ('sustance', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_references_substance', to='substances.substance')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='supplydeliverysupplieditem',
            name='item_reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplied_item_item_reference', to='supplydeliveries.supplydeliverysupplieditemitemreference'),
        ),
        migrations.CreateModel(
            name='SupplyDeliverySupplierReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplier_references_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplier_references_organization', to='organizations.organization')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplier_references_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplier_references_practitioner_role', to='practitionerroles.practitionerrole')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='supplydelivery',
            name='supplier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='supply_delivery_supplier', to='supplydeliveries.supplydeliverysupplierreference'),
        ),
    ]
