# 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 = [
        ('base', '0003_initial'),
        ('patients', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='RelatedPerson',
            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)),
                ('active', models.BooleanField(default=True)),
                ('gender', models.CharField(blank=True, choices=[('male', 'male'), ('female', 'female'), ('other', 'other'), ('unknown', 'unknown')], max_length=20, null=True)),
                ('birth_date', models.DateField(null=True)),
                ('address', models.ManyToManyField(blank=True, related_name='relatedpersons_address', to='base.address')),
                ('communication', models.ManyToManyField(blank=True, related_name='relatedpersons_communication', to='base.communication')),
                ('identifier', models.ManyToManyField(blank=True, related_name='relatedpersons_identifier', to='base.identifier')),
                ('name', models.ManyToManyField(blank=True, related_name='relatedpersons_name', to='base.humanname')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='relatedpersons_patient', to='patients.patientreference')),
                ('period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='relatedpersons_period', to='base.period')),
                ('photo', models.ManyToManyField(blank=True, related_name='relatedpersons_photo', to='base.attachment')),
                ('relationship', models.ManyToManyField(blank=True, related_name='relatedpersons_relationship', to='base.codeableconcept')),
                ('role', models.ManyToManyField(blank=True, related_name='relatedpersons_role', to='base.codeableconcept')),
                ('telecom', models.ManyToManyField(blank=True, related_name='relatedpersons_telecom', to='base.contactpoint')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='RelatedPersonReference',
            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='related_person_reference_identifier', to='base.identifier')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='related_person_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
