# Generated by Django 4.2.14 on 2025-02-04 12:51

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('careteams', '0004_remove_careteamparticipant_role_and_more'),
        ('relatedpersons', '0002_relatedperson_communication_relatedperson_gender'),
        ('conditions', '0002_alter_conditioncodeablereference_concept_and_more'),
        ('nutritionproducts', '0003_remove_nutritionproductnutrients_allergen'),
        ('organizations', '0003_organization_endpoint'),
        ('devices', '0007_alter_device_status_and_more'),
        ('careplans', '0002_remove_careplan_goal_careplan_note'),
        ('locations', '0006_merge_20250129_1542'),
        ('encounters', '0008_alter_encounterlocation_location'),
        ('procedures', '0001_initial'),
        ('groups', '0004_group_code_group_combination_method_and_more'),
        ('servicerequests', '0004_alter_servicerequest_intent'),
        ('base', '0010_expression_relativetime'),
        ('observations', '0006_alter_observation_instantiates_reference_and_more'),
        ('diagnosticreports', '0004_rename_media_diagnosticreportmedia_and_more'),
        ('practitioners', '0010_practitionerrole_endpoint'),
        ('patients', '0007_patientorganizationreference'),
    ]

    operations = [
        migrations.CreateModel(
            name='NutritionIntake',
            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)),
                ('instantiates_uri', models.URLField(null=True)),
                ('status', models.CharField(choices=[('preparation', 'Preparation'), ('in-progress', 'In Progress'), ('not-done', 'Not Done'), ('on-hold', 'On Hold'), ('stopped', 'Stopped'), ('completed', 'Completed'), ('entered-in-error', 'Entered in Error'), ('unknown', 'Unknown')], max_length=200, null=True)),
                ('occurrence_datetime', models.DateTimeField(null=True)),
                ('recorded', models.DateTimeField(null=True)),
                ('reported_boolean', models.BooleanField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeReportedReference',
            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)),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference_group', to='groups.group')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference_practitioner', to='practitioners.practitioner')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeRefernce',
            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='nutrition_intake_reference_identifier', to='base.identifier')),
                ('nutrition_intake', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reference_nutrition_intake', to='nutritionintakes.nutritionintake')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeReasonReference',
            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.DO_NOTHING, related_name='nutrition_intake_reason_reference_condition', to='conditions.condition')),
                ('diagnostic_report', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reason_reference_diagnostic_report', to='diagnosticreports.diagnosticreport')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reason_reference_identifier', to='base.identifier')),
                ('observation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reason_reference_observation', to='observations.observation')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeReasonCodeableReference',
            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='nutrition_intake_reason_codeable_reference_concept', to='base.codeableconcept')),
                ('reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_codeable_reference_reference', to='nutritionintakes.nutritionintakereasonreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakePerformerActorReference',
            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)),
                ('care_team', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_care_team', to='careteams.careteam')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_device', to='devices.device')),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_group', to='groups.group')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_practitioner_role', to='practitioners.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_actor_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakePerformer',
            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)),
                ('actor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_reference_actor', to='nutritionintakes.nutritionintakeperformeractorreference')),
                ('function', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_performer_reference_function', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakePartOfReference',
            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='nutrition_intake_part_of_reference_identifier', to='base.identifier')),
                ('nutrition_intake', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_part_of_reference_nutrition_intake', to='nutritionintakes.nutritionintake')),
                ('observation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_part_of_reference_observation', to='observations.observation')),
                ('procedure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_part_of_reference_procedure', to='procedures.procedure')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeNutritionItemTotalIntake',
            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)),
                ('amount', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_total_intake_amount', to='base.quantity')),
                ('energy', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_total_intake_energy', to='base.quantity')),
                ('nutrient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_total_intake_nutrient', to='base.codeablereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeNutritionItemConsumedItem',
            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)),
                ('amount', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_consumed_item_amount', to='base.quantity')),
                ('rate_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_consumed_item_rate_quantity', to='base.quantity')),
                ('rate_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_consumed_item_rate_ratio', to='base.ratio')),
                ('schedule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_consumed_item_schedule', to='base.timing')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeNutritionItem',
            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)),
                ('not_consumed', models.BooleanField(default=False)),
                ('consumed_item', models.ManyToManyField(blank=True, related_name='nutrition_intake_nutrition_item_consumed_item', to='nutritionintakes.nutritionintakenutritionitemconsumeditem')),
                ('not_consumed_reason', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_not_consumed_reason', to='base.codeableconcept')),
                ('nutrition_product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_nutrition_product', to='nutritionproducts.nutritionproductcodeablereference')),
                ('total_intake', models.ManyToManyField(blank=True, related_name='nutrition_intake_nutrition_item_total_intake', to='nutritionintakes.nutritionintakenutritionitemtotalintake')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_nutrition_item_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeCodeableReference',
            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='nutrition_intake_codeable_reference_concept', to='base.codeableconcept')),
                ('reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_codeable_reference_reference', to='nutritionintakes.nutritionintakerefernce')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='NutritionIntakeBasedOnReference',
            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)),
                ('care_plan', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_based_on_reference_care_plan', to='careplans.careplan')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_based_on_reference_identifier', to='base.identifier')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_based_on_reference_service_request', to='servicerequests.servicerequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='based_on',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_based_on', to='nutritionintakes.nutritionintakebasedonreference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='code',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_code', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='derived_from',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_derived_from', to='base.reference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='encounter',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_encounter', to='encounters.encounterreference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='identifier',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='location',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_location', to='locations.locationreference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='note',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_note', to='base.annotation'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='nutrition_item',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_nutrition_item', to='nutritionintakes.nutritionintakenutritionitem'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='occurrence_period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_occurrence_period', to='base.period'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='part_of',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_part_of', to='nutritionintakes.nutritionintakepartofreference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='performer',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_performer', to='nutritionintakes.nutritionintakeperformer'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='reason_code',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_reason_code', to='nutritionintakes.nutritionintakereasoncodeablereference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='reported_reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_reported_reference', to='nutritionintakes.nutritionintakereportedreference'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='status_reason',
            field=models.ManyToManyField(blank=True, related_name='nutrition_intake_status_reason', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='nutritionintake',
            name='subject',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='nutrition_intake_subject', to='patients.patientgroupreference'),
        ),
    ]
