# Generated by Django 4.2.14 on 2025-01-19 14:36

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


class Migration(migrations.Migration):

    dependencies = [
        ('patients', '0005_patientreference'),
        ('practitioners', '0007_remove_practitionerrole_availability_and_more'),
        ('base', '0004_ratio'),
        ('relatedpersons', '0001_initial'),
        ('careteams', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='CareTeamParticipantOnBehalfOfReference',
            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)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='careteam',
            name='managing_organization',
            field=models.ManyToManyField(blank=True, related_name='care_teams_managing_organization', to='base.organizationreference'),
        ),
        migrations.AddField(
            model_name='careteam',
            name='name',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='careteam',
            name='note',
            field=models.ManyToManyField(blank=True, related_name='care_teams_note', to='base.annotation'),
        ),
        migrations.AddField(
            model_name='careteam',
            name='period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_teams_period', to='base.period'),
        ),
        migrations.AddField(
            model_name='careteam',
            name='subject',
            field=models.ManyToManyField(blank=True, related_name='care_teams_subject', to='patients.patientgroupreference'),
        ),
        migrations.AddField(
            model_name='careteam',
            name='telecom',
            field=models.ManyToManyField(blank=True, related_name='care_teams_telecom', to='base.contactpoint'),
        ),
        migrations.CreateModel(
            name='CareTeamParticipantMemberReference',
            fields=[
                ('careteamparticipantonbehalfofreference_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='careteams.careteamparticipantonbehalfofreference')),
            ],
            options={
                'abstract': False,
            },
            bases=('careteams.careteamparticipantonbehalfofreference',),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='care_team',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='careteams.careteam'),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_team_participant_on_behalf_of_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='organization',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_team_participant_on_behalf_of_reference_organization', to='base.organizationreference'),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='patients.patient'),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='practitioners.practitioner'),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='practitioner_role',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='practitioners.practitionerrole'),
        ),
        migrations.AddField(
            model_name='careteamparticipantonbehalfofreference',
            name='related_person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='relatedpersons.relatedperson'),
        ),
        migrations.CreateModel(
            name='CareTeamParticipant',
            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)),
                ('effective_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_team_participants_effective_period', to='base.period')),
                ('on_behalf_of', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_team_participants_on_behalf_of', to='careteams.careteamparticipantonbehalfofreference')),
                ('role', models.ManyToManyField(blank=True, related_name='care_team_participants_role', to='base.codeableconcept')),
                ('member', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='care_team_participants_member', to='careteams.careteamparticipantmemberreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='careteam',
            name='participant',
            field=models.ManyToManyField(blank=True, related_name='care_teams_participant', to='careteams.careteamparticipant'),
        ),
    ]
