# Generated by Django 4.2.14 on 2025-02-03 12:26

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('servicerequests', '0004_alter_servicerequest_intent'),
        ('patients', '0007_patientorganizationreference'),
        ('base', '0010_expression_relativetime'),
        ('procedures', '0001_initial'),
        ('practitioners', '0010_practitionerrole_endpoint'),
    ]

    operations = [
        migrations.CreateModel(
            name='BiologicallyDerivedProduct',
            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)),
                ('division', models.CharField(max_length=255, null=True)),
                ('expiration_date', models.DateTimeField(null=True)),
                ('biological_source_event', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_products_biological_source_event', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BiologicallyDerivedProductReference',
            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.CASCADE, related_name='biologically_derived_product_reference_biologically_derived_product', to='biologicallyderivedproducts.biologicallyderivedproduct')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BiologicallyDerivedProductProperty',
            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)),
                ('value_boolean', models.BooleanField(null=True)),
                ('value_integer', models.IntegerField(null=True)),
                ('value_string', models.CharField(max_length=255, null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_type', to='base.codeableconcept')),
                ('value_attachment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_value_attachment', to='base.attachment')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_value_codeable_concept', to='base.codeableconcept')),
                ('value_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_value_period', to='base.period')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_value_quantity', to='base.quantity')),
                ('value_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_value_range', to='base.range')),
                ('value_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_properties_value_ratio', to='base.ratio')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BiologicallyDerivedProductCollection',
            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)),
                ('collected_date_time', models.DateTimeField(null=True)),
                ('collected_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_collections_collected_period', to='base.period')),
                ('collector', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_collections_collector', to='practitioners.practitionerpractitionerrolereference')),
                ('procedure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_collections_procedure', to='procedures.procedure')),
                ('source', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_product_collections_source', to='patients.patientorganizationreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='collection',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_products_collection', to='biologicallyderivedproducts.biologicallyderivedproductcollection'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='identifier',
            field=models.ManyToManyField(blank=True, related_name='biologically_derived_products_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='parent',
            field=models.ManyToManyField(blank=True, related_name='biologically_derived_products_parent', to='biologicallyderivedproducts.biologicallyderivedproductreference'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='processing_facility',
            field=models.ManyToManyField(blank=True, related_name='biologically_derived_products_processing_faciality', to='base.organizationreference'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='product_category',
            field=models.ManyToManyField(blank=True, related_name='biologically_derived_products_product_category', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='product_code',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_products_product_code', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='product_status',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_products_product_status', to='base.coding'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='property',
            field=models.ManyToManyField(blank=True, related_name='biologically_derived_products_property', to='biologicallyderivedproducts.biologicallyderivedproductproperty'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='request',
            field=models.ManyToManyField(blank=True, related_name='biologically_derived_products_request', to='servicerequests.servicerequestreference'),
        ),
        migrations.AddField(
            model_name='biologicallyderivedproduct',
            name='storage_temp_requirements',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='biologically_derived_products_storage_temp_requirements', to='base.range'),
        ),
    ]
