# Generated by Django 4.2.14 on 2025-01-29 12:28

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('groups', '0003_delete_groupspecimenreference'),
        ('base', '0009_remove_endpointreference_endpoint_and_more'),
        ('organizations', '0003_organization_endpoint'),
        ('patients', '0006_patientgroupreference_group_and_more'),
        ('relatedpersons', '0002_relatedperson_communication_relatedperson_gender'),
        ('practitioners', '0010_practitionerrole_endpoint'),
        ('persons', '0003_person_link'),
    ]

    operations = [
        migrations.CreateModel(
            name='PersonalRelationshipSourceReference',
            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.CASCADE, related_name='personal_relationship_source_reference_identifier', to='base.identifier')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_patient', to='patients.patient')),
                ('person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_person', to='persons.person')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PersonalRelationshipTargetReference',
            fields=[
                ('personalrelationshipsourcereference_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='personalrelationships.personalrelationshipsourcereference')),
            ],
            options={
                'abstract': False,
            },
            bases=('personalrelationships.personalrelationshipsourcereference',),
        ),
        migrations.CreateModel(
            name='PersonalRelationshipAsserterReference',
            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.CASCADE, related_name='personal_relationship_asserter_reference_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_asserter_reference_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_asserter_reference_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_asserter_reference_practitioner', to='practitioners.practitioner')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_asserter_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PersonalRelationship',
            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)),
                ('asserter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_asserter', to='base.organizationreference')),
                ('confidence', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_confidence', to='base.codeableconcept')),
                ('group', models.ManyToManyField(blank=True, related_name='personal_relationships_group', to='groups.groupreference')),
                ('period', models.ManyToManyField(blank=True, related_name='personal_relationships_period', to='base.period')),
                ('relationship_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_relationship_type', to='base.codeableconcept')),
                ('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_source', to='personalrelationships.personalrelationshipsourcereference')),
                ('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_target', to='personalrelationships.personalrelationshiptargetreference')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
