# Generated by Django 4.2.14 on 2025-03-24 22:28

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


class Migration(migrations.Migration):

    dependencies = [
        ('devices', '0007_alter_device_status_and_more'),
        ('biologicallyderivedproducts', '0001_initial'),
        ('devicedefinitions', '0002_devicedefinitiondeviceversion_and_more'),
        ('practitioners', '0011_practitionerrolereference'),
        ('specimens', '0002_rename_specimencollections_specimencollection_and_more'),
        ('locations', '0006_merge_20250129_1542'),
        ('patients', '0007_patientorganizationreference'),
        ('substances', '0002_substancecodeablereference'),
        ('relatedpersons', '0002_relatedperson_communication_relatedperson_gender'),
        ('careteams', '0004_remove_careteamparticipant_role_and_more'),
        ('medications', '0004_medicationreference_medicationcodeablereference'),
        ('organizations', '0004_organizationcodeablereference'),
        ('base', '0018_merge_20250307_1944'),
        ('healthcareservices', '0006_remove_healthcareservice_endpoint'),
        ('groups', '0004_group_code_group_combination_method_and_more'),
        ('endpoints', '0006_alter_endpoint_connection_type'),
        ('activitydefinitions', '0002_activitydefinition_related_artifact_and_more'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='activitydefinitionparticipant',
            name='location',
        ),
        migrations.AddField(
            model_name='activitydefinitionparticipant',
            name='function',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_function', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='activitydefinitionparticipanttypereference',
            name='biologically_derived_product',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_biologically_derived_product_reference_biologically_derived_product', to='biologicallyderivedproducts.biologicallyderivedproduct'),
        ),
        migrations.AddField(
            model_name='activitydefinitionparticipanttypereference',
            name='medication',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_medication', to='medications.medication'),
        ),
        migrations.AddField(
            model_name='activitydefinitionparticipanttypereference',
            name='specimen',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_specimen', to='specimens.specimen'),
        ),
        migrations.AddField(
            model_name='activitydefinitionparticipanttypereference',
            name='substance',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_substance', to='substances.substance'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='care_team',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_practitioner_type_reference_care_plan', to='careteams.careteam'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='device',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_device_reference_idevice', to='devices.device'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='device_definition',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_device_definition_reference_device_definition', to='devicedefinitions.devicedefinition'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='endpoint',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_endpoint', to='endpoints.endpoint'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='group',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_group', to='groups.group'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='healthcare_service',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_healthcare_service', to='healthcareservices.healthcareservice'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_identifier', to='base.identifier'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='location',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_location', to='locations.location'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='organization',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_organization', to='organizations.organization'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_patient', to='patients.patient'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_practitioner_type_reference_practitioner', to='practitioners.practitioner'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='practitioner_role',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_practitioner_type_reference_practitioner_role', to='practitioners.practitionerrole'),
        ),
        migrations.AlterField(
            model_name='activitydefinitionparticipanttypereference',
            name='related_person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_participant_type_reference_related_person', to='relatedpersons.relatedperson'),
        ),
        migrations.CreateModel(
            name='ActivityDefinitionProductProductReference',
            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='activity_definition_product_product_reference_identifier', to='base.identifier')),
                ('medication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_product_product_reference_medication', to='medications.medication')),
                ('substance', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_product_product_reference_substance', to='substances.substance')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterField(
            model_name='activitydefinition',
            name='product_reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='activity_definition_product_reference', to='activitydefinitions.activitydefinitionproductproductreference'),
        ),
        migrations.DeleteModel(
            name='ActivityDefinitionProductReference',
        ),
    ]
