# Generated by Django 4.2.14 on 2025-01-29 13:05

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


class Migration(migrations.Migration):

    dependencies = [
        ('devicedefinitions', '0002_devicedefinitiondeviceversion_and_more'),
        ('base', '0009_remove_endpointreference_endpoint_and_more'),
        ('observationdefinitions', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='observationdefinition',
            name='approval_date',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='body_site',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_body_site', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='category',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_category', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='code',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_code', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='contact',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_contact', to='base.contactdetail'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='copyright',
            field=models.TextField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='copyright_label',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='date',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='derived_from_uri',
            field=models.URLField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='description',
            field=models.TextField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='device',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_device', to='devicedefinitions.devicedefinition'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='effective_period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_effective_period', to='base.period'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='experimental',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='jurisdiction',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_jurisdiction', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='last_review_date',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='method',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_method', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='multiple_results_allowed',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='name',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='performer_type',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_performer_type', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='permitted_data_type',
            field=models.CharField(choices=[('Quantity', 'Quantity'), ('codeableconcept', 'Codeable Concept'), ('string', 'String'), ('boolean', 'Boolean'), ('integer', 'Integer'), ('range', 'Range'), ('ratio', 'Ratio'), ('sampled_data', 'Sampled Data'), ('time', 'Time'), ('date', 'Date'), ('datetime', 'Datetime'), ('period', 'Period')], max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='permitted_unit',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_permitted_unit', to='base.coding'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='preferred_report_name',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='publisher',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='purpose',
            field=models.TextField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='status',
            field=models.CharField(choices=[('draft', 'Draft'), ('active', 'Active'), ('retired', 'Retired'), ('unknown', 'Unknown')], max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='subject',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_subject', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='title',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='url',
            field=models.URLField(null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='use_context',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_use_context', to='base.usagecontext'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='version',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='version_algorithm_coding',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_version_algorithm_coding', to='base.coding'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='version_algorithm_string',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.CreateModel(
            name='ObservationDefinitionQuestionnaireReference',
            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.SET_NULL, related_name='observation_definition_questionnaire_reference_identifier', to='base.identifier')),
                ('observatoin_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='observationdefinitions.observationdefinition')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ObservationDefinitionQualifiedValue',
            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)),
                ('gender', models.CharField(choices=[('male', 'Male'), ('female', 'Female'), ('other', 'Other'), ('unknown', 'Unknown')], max_length=255, null=True)),
                ('condition', models.CharField(max_length=255, null=True)),
                ('range_category', models.CharField(choices=[('reference', 'Reference'), ('critical', 'Critical'), ('absolute', 'Absolute')], max_length=255, null=True)),
                ('age', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_qualified_value_age', to='base.range')),
                ('applies_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_qualified_value_applies_to', to='base.codeableconcept')),
                ('context', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_qualified_value_context', to='base.codeableconcept')),
                ('gestational_age', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_qualified_value_gestational_age', to='base.range')),
                ('interpretation', models.ManyToManyField(blank=True, related_name='observation_definition_qualified_value_interpretation', to='base.codeableconcept')),
                ('range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_definition_qualified_value_range', to='base.range')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ObservationDefinitionComponent',
            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)),
                ('permitted_data_type', models.CharField(choices=[('Quantity', 'Quantity'), ('codeableconcept', 'Codeable Concept'), ('string', 'String'), ('boolean', 'Boolean'), ('integer', 'Integer'), ('range', 'Range'), ('ratio', 'Ratio'), ('sampled_data', 'Sampled Data'), ('time', 'Time'), ('date', 'Date'), ('datetime', 'Datetime'), ('period', 'Period')], max_length=255, null=True)),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.codeableconcept')),
                ('permitted_unit', models.ManyToManyField(blank=True, related_name='observation_definition_component_permitted_unit', to='base.coding')),
                ('qulaified_value', models.ManyToManyField(blank=True, related_name='observation_definition_component_qualified_value', to='observationdefinitions.observationdefinitionqualifiedvalue')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='component',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_component', to='observationdefinitions.observationdefinitioncomponent'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='has_member',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_has_member', to='observationdefinitions.observationdefinitionquestionnairereference'),
        ),
        migrations.AddField(
            model_name='observationdefinition',
            name='qualified_value',
            field=models.ManyToManyField(blank=True, related_name='observation_definition_qualified_value', to='observationdefinitions.observationdefinitionqualifiedvalue'),
        ),
    ]
