# 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', '0004_initial'),
        ('biologicallyderivedproducts', '0001_initial'),
        ('careteams', '0003_initial'),
        ('devicedefinitions', '0001_initial'),
        ('devices', '0001_initial'),
        ('endpoints', '0001_initial'),
        ('groups', '0001_initial'),
        ('healthcareservices', '0001_initial'),
        ('locations', '0001_initial'),
        ('medications', '0001_initial'),
        ('organizations', '0001_initial'),
        ('patients', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='PlanDefinitionActionInput',
            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)),
                ('title', models.CharField(max_length=255, null=True)),
                ('related_data', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActionOutput',
            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)),
                ('title', models.CharField(max_length=255, null=True)),
                ('related_data', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActor',
            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)),
                ('title', models.CharField(max_length=255, null=True)),
                ('description', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionGoal',
            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='PlanDefinitionGoalTarget',
            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)),
                ('detail_string', models.CharField(max_length=255, null=True)),
                ('detail_boolean', models.BooleanField(null=True)),
                ('detail_integer', models.IntegerField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionSubjectReference',
            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)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefintionActorOption',
            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)),
                ('type', models.CharField(choices=[('care-team', 'Care Team'), ('device', 'Device'), ('group', 'Group'), ('healthcareservice', 'Healthcare Service'), ('location', 'Location'), ('organization', 'Organization'), ('patient', 'Patient'), ('practitioner', 'Practitioner'), ('practitionerrole', 'Practitioner Role'), ('relatedperson', 'Related Person')], default='patient', max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActionCondition',
            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)),
                ('kind', models.CharField(choices=[('applicability', 'Applicability'), ('start', 'Start'), ('stop', 'Stop')], default='applicability', max_length=255)),
                ('expression', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_condition_expression', to='base.expression')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActionDynamicValue',
            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)),
                ('path', models.CharField(max_length=255, null=True)),
                ('expression', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_dynamic_value_expression', to='base.expression')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActionParticipant',
            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)),
                ('type', models.CharField(choices=[('care-team', 'Care Team'), ('device', 'Device'), ('group', 'Group'), ('healthcareservice', 'Healthcare Service'), ('location', 'Location'), ('organization', 'Organization'), ('patient', 'Patient'), ('practitioner', 'Practitioner'), ('practitionerrole', 'Practitioner Role'), ('relatedperson', 'Related Person')], default='patient', max_length=255)),
                ('function', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_participant_function', to='base.codeableconcept')),
                ('role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_participant_role', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActionRelatedAction',
            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)),
                ('target_id', models.CharField(max_length=255, null=True)),
                ('relationship', models.CharField(choices=[('before-start', 'Before Start'), ('before', 'Before'), ('before-end', 'Before End'), ('concurrent-with-start', 'Concurrent with Start'), ('concurrent', 'Concurrent'), ('concurrent-with-end', 'Concurrent with End'), ('after-start', 'After Start'), ('after', 'After'), ('after-end', 'After End')], default='before-start', max_length=255)),
                ('end_relationship', models.CharField(choices=[('before-start', 'Before Start'), ('before', 'Before'), ('before-end', 'Before End'), ('concurrent-with-start', 'Concurrent with Start'), ('concurrent', 'Concurrent'), ('concurrent-with-end', 'Concurrent with End'), ('after-start', 'After Start'), ('after', 'After'), ('after-end', 'After End')], default='before-start', max_length=255)),
                ('offset_duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_related_action_offset_duration', to='base.duration')),
                ('offset_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_related_action_offset_range', to='base.range')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionAction',
            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)),
                ('link_id', models.CharField(max_length=255, null=True)),
                ('prefix', models.CharField(max_length=255, null=True)),
                ('title', models.CharField(max_length=255, null=True)),
                ('description', models.CharField(max_length=255, null=True)),
                ('text_equivalent', models.CharField(max_length=255, null=True)),
                ('priority', models.CharField(choices=[('routine', 'Routine'), ('urgent', 'Urgent'), ('asap', 'As soon as possible'), ('stat', 'Stat')], default='routine', max_length=255)),
                ('goal_id', models.CharField(max_length=255, null=True)),
                ('grouping_behavior', models.CharField(choices=[('visual-group', 'Visual Group'), ('logical-group', 'Logical Group'), ('sentence-group', 'Sentence Group')], default='logical-group', max_length=255)),
                ('selection_behavior', models.CharField(choices=[('any', 'Any'), ('all', 'All'), ('all-or-none', 'All or None'), ('exactly-one', 'Exactly One'), ('at-most-one', 'At Most One'), ('one-or-more', 'One or More')], default='all', max_length=255)),
                ('required_behavior', models.CharField(choices=[('must', 'Must'), ('could', 'Could'), ('must-unless-documented', 'Must unless Documented')], default='must', max_length=255)),
                ('precheck_behavior', models.CharField(choices=[('yes', 'Yes'), ('no', 'No')], default='yes', max_length=255)),
                ('cardinality_behavior', models.CharField(choices=[('single', 'Single'), ('multiple', 'Multiple')], default='single', max_length=255)),
                ('definition_uri', models.CharField(max_length=255, null=True)),
                ('action', models.ManyToManyField(blank=True, to='plandefinitions.plandefinitionaction')),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_action_code', to='base.codeableconcept')),
                ('documentation', models.ManyToManyField(blank=True, related_name='plan_definition_action_documentation', to='base.relatedartifact')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_location', to='locations.locationcodeablereference')),
                ('reason', models.ManyToManyField(blank=True, related_name='plan_definition_action_reason', to='base.codeableconcept')),
                ('subject_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_subject_codeable_concept', to='base.codeableconcept')),
                ('subject_reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_subject_reference', to='groups.groupreference')),
                ('timing_age', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_timing_age', to='base.age')),
                ('timing_duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_timing_duration', to='base.duration')),
                ('timing_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_timing_range', to='base.range')),
                ('timing_timing', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_timing_timing', to='base.timing')),
                ('trigger', models.ManyToManyField(blank=True, related_name='plan_definition_action_trigger', to='base.triggerdefinition')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_action_type', to='base.codeableconcept')),
                ('condition', models.ManyToManyField(related_name='plan_definition_action_condition', to='plandefinitions.plandefinitionactioncondition')),
                ('dynamic_value', models.ManyToManyField(blank=True, related_name='plan_definition_action_dynamic_value', to='plandefinitions.plandefinitionactiondynamicvalue')),
                ('input', models.ManyToManyField(blank=True, related_name='plan_definition_action_input', to='plandefinitions.plandefinitionactioninput')),
                ('output', models.ManyToManyField(blank=True, related_name='plan_definition_action_output', to='plandefinitions.plandefinitionactionoutput')),
                ('participant', models.ManyToManyField(blank=True, related_name='plan_definition_action_participant', to='plandefinitions.plandefinitionactionparticipant')),
                ('related_action', models.ManyToManyField(blank=True, related_name='plan_definition_action_related_action', to='plandefinitions.plandefinitionactionrelatedaction')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinition',
            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)),
                ('url', models.URLField(null=True)),
                ('version', models.CharField(max_length=255, null=True)),
                ('version_algorithm_string', models.CharField(max_length=255, null=True)),
                ('name', models.CharField(max_length=255, null=True)),
                ('title', models.CharField(max_length=255, null=True)),
                ('subtitle', models.CharField(max_length=255, null=True)),
                ('status', models.CharField(choices=[('active', 'Active'), ('draft', 'Draft'), ('retired', 'Retired'), ('unknown', 'Unknown')], default='active', max_length=255)),
                ('experimental', models.BooleanField(default=False)),
                ('date', models.DateTimeField(null=True)),
                ('publisher', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
                ('purpose', models.TextField(null=True)),
                ('usage', models.TextField(null=True)),
                ('copyright', models.CharField(max_length=255, null=True)),
                ('copyright_label', models.CharField(max_length=255, null=True)),
                ('approval_date', models.DateField(null=True)),
                ('last_review_date', models.DateField(null=True)),
                ('as_needed_boolean', models.BooleanField(null=True)),
                ('as_needed_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_as_needed_codeable_concept', to='base.codeableconcept')),
                ('author', models.ManyToManyField(blank=True, related_name='plan_definition_author', to='base.contactdetail')),
                ('contact', models.ManyToManyField(blank=True, related_name='plan_definition_contact', to='base.contactdetail')),
                ('editor', models.ManyToManyField(blank=True, related_name='plan_definition_editor', to='base.contactdetail')),
                ('effective_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_effective_period', to='base.period')),
                ('endorser', models.ManyToManyField(blank=True, related_name='plan_definition_endorser', to='base.contactdetail')),
                ('identifier', models.ManyToManyField(blank=True, related_name='plan_definition_identifier', to='base.identifier')),
                ('jurisdiction', models.ManyToManyField(blank=True, related_name='plan_definition_jurisdiction', to='base.codeableconcept')),
                ('related_artifact', models.ManyToManyField(blank=True, related_name='plan_definition_related_artifact', to='base.relatedartifact')),
                ('reviewer', models.ManyToManyField(blank=True, related_name='plan_definition_reviewer', to='base.contactdetail')),
                ('subject_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_subject_codeable_concept', to='base.codeableconcept')),
                ('topic', models.ManyToManyField(blank=True, related_name='plan_definition_topic', to='base.codeableconcept')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_type', to='base.codeableconcept')),
                ('use_context', models.ManyToManyField(blank=True, related_name='plan_definition_use_context', to='base.usagecontext')),
                ('version_algorithm_coding', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='plan_definition_version_algorithm_coding', to='base.coding')),
                ('action', models.ManyToManyField(blank=True, related_name='plan_definition_action', to='plandefinitions.plandefinitionaction')),
                ('actor', models.ManyToManyField(blank=True, related_name='plan_definition_actor', to='plandefinitions.plandefinitionactor')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlanDefinitionActorOptionTypeReferenceReference',
            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)),
                ('biologically_derived_product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_biologically_derived_product', to='biologicallyderivedproducts.biologicallyderivedproduct')),
                ('care_team', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_care_team', to='careteams.careteam')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_device', to='devices.device')),
                ('device_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_device_definition', to='devicedefinitions.devicedefinition')),
                ('endpoint', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_endpoint', to='endpoints.endpoint')),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_group', to='groups.group')),
                ('healthcare_service', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_healthcare_service', to='healthcareservices.healthcareservice')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_identifier', to='base.identifier')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_location', to='locations.location')),
                ('medication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_medication', to='medications.medication')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_definition_actor_option_type_reference_reference_patient', to='patients.patient')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
