# Generated by Django 4.2.14 on 2025-01-10 10:41

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


class Migration(migrations.Migration):

    dependencies = [
        ('practitioners', '0007_remove_practitionerrole_availability_and_more'),
        ('servicerequests', '0001_initial'),
        ('medicationrequests', '0002_initial'),
        ('patients', '0004_patientgroupreference'),
        ('base', '0003_communication'),
        ('locations', '0001_initial'),
        ('observations', '0002_initial'),
        ('healthcareservices', '0005_remove_healthcareservicecodeablereference_healthcare_service'),
        ('appointments', '0006_appointment_based_on_appointment_identifier_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='AppointmentBasedOnReference',
            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='appointment_based_on_reference_identifier', to='base.identifier')),
                ('medication_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_based_on_reference_medication_request', to='medicationrequests.medicationrequest')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_based_on_reference_service_request', to='servicerequests.servicerequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AppointmentParticipantActor',
            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)),
                ('healthcareservice', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_participant_actor_healthcareservice', to='healthcareservices.healthcareservice')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_participant_actor_identifier', to='base.identifier')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_participant_actor_location', to='locations.location')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_participant_actor_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_participant_actor_practitioner', to='practitioners.practitioner')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AppointmentReasonCodeableReference',
            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)),
                ('concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_reason_concept', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AppointmentReasonReference',
            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='appointment_reason_identifier', to='base.identifier')),
                ('observation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_reason_observation', to='observations.observation')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='cprocobimmunreccodedablereference',
            name='concept',
        ),
        migrations.RemoveField(
            model_name='cprocobimmunreccodedablereference',
            name='observation',
        ),
        migrations.RemoveField(
            model_name='cprocobimmunreccodedablereference',
            name='reference',
        ),
        migrations.RemoveField(
            model_name='cprocobimmunrecreference',
            name='identifier',
        ),
        migrations.RemoveField(
            model_name='cprocobimmunrecreference',
            name='observation',
        ),
        migrations.RemoveField(
            model_name='patgrpprctprctrlcaretmrelperdvhlcaserlocref',
            name='healthcareservice',
        ),
        migrations.RemoveField(
            model_name='patgrpprctprctrlcaretmrelperdvhlcaserlocref',
            name='identifier',
        ),
        migrations.RemoveField(
            model_name='patgrpprctprctrlcaretmrelperdvhlcaserlocref',
            name='location',
        ),
        migrations.RemoveField(
            model_name='patgrpprctprctrlcaretmrelperdvhlcaserlocref',
            name='patient',
        ),
        migrations.RemoveField(
            model_name='patgrpprctprctrlcaretmrelperdvhlcaserlocref',
            name='practitioner',
        ),
        migrations.RemoveField(
            model_name='appointment',
            name='based_on',
        ),
        migrations.RemoveField(
            model_name='appointment',
            name='reason',
        ),
        migrations.RemoveField(
            model_name='appointmentparticipant',
            name='end_date_time',
        ),
        migrations.RemoveField(
            model_name='appointmentparticipant',
            name='start_date_time',
        ),
        migrations.RemoveField(
            model_name='appointmentparticipant',
            name='type',
        ),
        migrations.AlterField(
            model_name='appointmentparticipant',
            name='period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_participant_period', to='base.period'),
        ),
        migrations.AlterField(
            model_name='appointmentparticipant',
            name='status',
            field=models.CharField(choices=[('accepted', 'Accepted'), ('declined', 'Declined'), ('tentative', 'Tentative'), ('needs-action', 'Needs Action')], max_length=255, null=True),
        ),
        migrations.DeleteModel(
            name='CPlanDRqstMRqstSRqstROrchNOrderVPrescIRecomRef',
        ),
        migrations.DeleteModel(
            name='CProcObImmunRecCodedableReference',
        ),
        migrations.DeleteModel(
            name='CProcObImmunRecReference',
        ),
        migrations.AddField(
            model_name='appointmentreasoncodeablereference',
            name='reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='appointment_reason_reference', to='appointments.appointmentreasonreference'),
        ),
        migrations.AlterField(
            model_name='appointmentparticipant',
            name='actor',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='appointment_participant_actor', to='appointments.appointmentparticipantactor'),
        ),
        migrations.DeleteModel(
            name='PatGrpPrctPrctRlCareTmRelPerDvHlCaSerLocRef',
        ),
    ]
