# Generated by Django 4.2.14 on 2025-01-26 13:42

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


class Migration(migrations.Migration):

    dependencies = [
        ('base', '0007_merge_20250121_1502'),
        ('healthcareservices', '0005_remove_healthcareservicecodeablereference_healthcare_service'),
        ('observations', '0006_alter_observation_instantiates_reference_and_more'),
        ('practitioners', '0008_practitionerpractitionerrolereference'),
        ('conditions', '0002_alter_conditioncodeablereference_concept_and_more'),
        ('episodeofcare', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='EpisodeOfCareDiagnosis',
            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)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EpisodeOfCareReason',
            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)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EpisodeOfCareReasonValueCodeableReference',
            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)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='episodeofcare',
            name='care_manager',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='episode_of_care_care_manager', to='practitioners.practitionerpractitionerrolereference'),
        ),
        migrations.CreateModel(
            name='EpisodeOfCareStatusHistory',
            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)),
                ('status', models.CharField(choices=[('planned', 'Planned'), ('waitlist', 'Waitlist'), ('active', 'Active'), ('onhold', 'On Hold'), ('finished', 'Finished'), ('cancelled', 'Cancelled'), ('entered-in-error', 'Entered in Error')], max_length=255, null=True)),
                ('period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='episode_of_care_status_history_period', to='base.period')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EpisodeOfCareReasonValueReference',
            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)),
                ('condition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='episode_of_care_reason_value_reference_condition', to='conditions.condition')),
                ('healthcare_service', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='episode_of_care_reason_value_reference_healthcare_service', to='healthcareservices.healthcareservice')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='episode_of_care_reason_value_reference_identifier', to='base.identifier')),
                ('observation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='episode_of_care_reason_value_reference_observation', to='observations.observation')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
