# 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', '0005_initial'),
        ('careteams', '0004_initial'),
        ('devices', '0001_initial'),
        ('groups', '0003_initial'),
        ('locations', '0001_initial'),
        ('medications', '0001_initial'),
        ('molecularsequences', '0001_initial'),
        ('observations', '0002_initial'),
        ('organizations', '0001_initial'),
        ('patients', '0002_initial'),
        ('practitionerroles', '0002_initial'),
        ('practitioners', '0001_initial'),
        ('relatedpersons', '0001_initial'),
        ('servicerequests', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='observationbasedonreference',
            name='service_request',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_based_on_reference_service_request', to='servicerequests.servicerequest'),
        ),
        migrations.AddField(
            model_name='observation',
            name='based_on',
            field=models.ManyToManyField(blank=True, related_name='observation_based_on', to='observations.observationbasedonreference'),
        ),
        migrations.AddField(
            model_name='observationbodystructurereference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_body_structure_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observationcodeablereference',
            name='concept',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='observation_codeable_reference_concept', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='code',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='observation_component_code', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='data_absent_reason',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_data_absent_reason', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='interpretation',
            field=models.ManyToManyField(blank=True, related_name='observation_component_interpretation', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_attachment',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_value_attachment', to='base.attachment'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_codeable_concept',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_value_codeable_concept', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_period',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_value_period', to='base.period'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_quantity',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='observation_component_value', to='base.quantity'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_range',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_value_range', to='base.range'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_ratio',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_value_ratio', to='base.ratio'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='molecularsequences.molecularsequencereference'),
        ),
        migrations.AddField(
            model_name='observation',
            name='component',
            field=models.ManyToManyField(blank=True, related_name='observation_component', to='observations.observationcomponent'),
        ),
        migrations.AddField(
            model_name='observationderivedfromreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_derived_from_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observationderivedfromreference',
            name='observation',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_derived_from_reference_observation', to='observations.observation'),
        ),
        migrations.AddField(
            model_name='observation',
            name='derived_from',
            field=models.ManyToManyField(blank=True, related_name='observation_derived_from', to='observations.observationderivedfromreference'),
        ),
        migrations.AddField(
            model_name='observationhasmemberreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_has_member_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observationhasmemberreference',
            name='observation',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_has_member_reference_observation', to='observations.observation'),
        ),
        migrations.AddField(
            model_name='observation',
            name='has_member',
            field=models.ManyToManyField(blank=True, related_name='observation_has_member', to='observations.observationhasmemberreference'),
        ),
        migrations.AddField(
            model_name='observationpartofreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_part_of_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observation',
            name='part_of',
            field=models.ManyToManyField(blank=True, to='observations.observationpartofreference'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='care_team',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_performer_reference_care_team', to='careteams.careteam'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='organization',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='organizations.organization'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='patients.patient'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_performer_reference_practitioner', to='practitioners.practitioner'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='practitioner_role',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_performer_reference_practitioner_role', to='practitionerroles.practitionerrole'),
        ),
        migrations.AddField(
            model_name='observationperformerreference',
            name='related_person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='relatedpersons.relatedperson'),
        ),
        migrations.AddField(
            model_name='observation',
            name='performer',
            field=models.ManyToManyField(blank=True, related_name='observation_performer', to='observations.observationperformerreference'),
        ),
        migrations.AddField(
            model_name='observationreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observationreference',
            name='observation',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_reference_observation', to='observations.observation'),
        ),
        migrations.AddField(
            model_name='observationcodeablereference',
            name='reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='observation_codeable_reference_reference', to='observations.observationreference'),
        ),
        migrations.AddField(
            model_name='observationreferencerange',
            name='age',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reference_range_age', to='base.range'),
        ),
        migrations.AddField(
            model_name='observationreferencerange',
            name='applies_to',
            field=models.ManyToManyField(blank=True, related_name='reference_range_applies_to', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationreferencerange',
            name='high',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reference_range_high', to='base.quantity'),
        ),
        migrations.AddField(
            model_name='observationreferencerange',
            name='low',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reference_range_low', to='base.quantity'),
        ),
        migrations.AddField(
            model_name='observationreferencerange',
            name='normal_value',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reference_range_normal_value', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationreferencerange',
            name='type',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reference_range_type', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='reference_range',
            field=models.ManyToManyField(blank=True, to='observations.observationreferencerange'),
        ),
        migrations.AddField(
            model_name='observation',
            name='reference_range',
            field=models.ManyToManyField(blank=True, related_name='observation_reference_range', to='observations.observationreferencerange'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='device',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_subject_reference_device', to='devices.device'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='group',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_subject_reference_group', to='groups.group'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.identifier'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='location',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='locations.location'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='medication',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='medications.medication'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='organization',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='organizations.organization'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='patients.patient'),
        ),
        migrations.AddField(
            model_name='observationsubjectreference',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='practitioners.practitioner'),
        ),
        migrations.AddField(
            model_name='observation',
            name='subject',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='observation_subject', to='observations.observationsubjectreference'),
        ),
        migrations.AddField(
            model_name='observationtriggeredby',
            name='observation',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='triggered_by_observation', to='observations.observationreference'),
        ),
        migrations.AddField(
            model_name='observation',
            name='triggered_by',
            field=models.ManyToManyField(blank=True, related_name='observation_triggered_by', to='observations.observationtriggeredby'),
        ),
        migrations.AddField(
            model_name='sampleddata',
            name='origin',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sampled_data_origin', to='base.quantity'),
        ),
        migrations.AddField(
            model_name='observationcomponent',
            name='value_sampled_data',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_component_value_sampled_data', to='observations.sampleddata'),
        ),
        migrations.AddField(
            model_name='observation',
            name='value_sampled_data',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_value_sampled_data', to='observations.sampleddata'),
        ),
        migrations.AddField(
            model_name='sampleddata',
            name='interval_unit',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sampled_data_interval_unit', to='observations.sampleddataintervalunitcodes'),
        ),
    ]
