# 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 = [
        ('appointments', '0004_initial'),
        ('base', '0005_initial'),
        ('careplans', '0004_initial'),
        ('careteams', '0004_initial'),
        ('devices', '0001_initial'),
        ('medicationrequests', '0002_initial'),
        ('organizations', '0001_initial'),
        ('patients', '0002_initial'),
        ('practitionerroles', '0002_initial'),
        ('practitioners', '0001_initial'),
        ('relatedpersons', '0001_initial'),
        ('servicerequests', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='careplanbasedonreference',
            name='service_request',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_based_on_service_request', to='servicerequests.servicerequest'),
        ),
        migrations.AddField(
            model_name='careplan',
            name='based_on',
            field=models.ManyToManyField(blank=True, related_name='care_plan_based_on', to='careplans.careplanbasedonreference'),
        ),
        migrations.CreateModel(
            name='CarePlanContributorReference',
            fields=[
                ('careplancustodianreference_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='careplans.careplancustodianreference')),
            ],
            options={
                'abstract': False,
            },
            bases=('careplans.careplancustodianreference',),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='care_team',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='careteams.careteam'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='device',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='devices.device'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='custodian_contributor_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='organization',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='organizations.organization'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='patients.patient'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='practitioners.practitioner'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='practitioner_role',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='practitionerroles.practitionerrole'),
        ),
        migrations.AddField(
            model_name='careplancustodianreference',
            name='related_person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='relatedpersons.relatedperson'),
        ),
        migrations.AddField(
            model_name='careplan',
            name='custodian',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_plan_custodian', to='careplans.careplancustodianreference'),
        ),
        migrations.AddField(
            model_name='careplandevicerequestreference',
            name='care_plan',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_device_request_reference_care_plan', to='careplans.careplan'),
        ),
        migrations.AddField(
            model_name='careplandevicerequestreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_device_request_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='careplanplannedactivityreference',
            name='appointment',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_planned_activity_reference_appointment', to='appointments.appointment'),
        ),
        migrations.AddField(
            model_name='careplanplannedactivityreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.identifier'),
        ),
        migrations.AddField(
            model_name='careplanplannedactivityreference',
            name='medication_request',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_planned_activity_reference_medication_request', to='medicationrequests.medicationrequest'),
        ),
        migrations.AddField(
            model_name='careplanplannedactivityreference',
            name='service_request',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_planned_activity_reference_service_request', to='servicerequests.servicerequest'),
        ),
        migrations.AddField(
            model_name='careplanactivity',
            name='planned_activity_reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_activity_planned_activity_reference', to='careplans.careplanplannedactivityreference'),
        ),
        migrations.AddField(
            model_name='careplanreference',
            name='care_plan',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_reference_care_plan', to='careplans.careplan'),
        ),
        migrations.AddField(
            model_name='careplanreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='care_plan_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='careplan',
            name='part_of',
            field=models.ManyToManyField(blank=True, related_name='care_plan_part_of', to='careplans.careplanreference'),
        ),
        migrations.AddField(
            model_name='careplan',
            name='replaces',
            field=models.ManyToManyField(blank=True, related_name='care_plan_replaces', to='careplans.careplanreference'),
        ),
        migrations.AddField(
            model_name='careplan',
            name='contributor',
            field=models.ManyToManyField(blank=True, related_name='care_plan_contributor', to='careplans.careplancontributorreference'),
        ),
    ]
