# 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', '0003_initial'),
        ('bodystructures', '0001_initial'),
        ('devices', '0001_initial'),
        ('encounters', '0002_initial'),
        ('observationdefinitions', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ObservationBasedOnReference',
            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='ObservationBodyStructureReference',
            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='ObservationCodeableReference',
            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='ObservationComponent',
            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)),
                ('value_string', models.CharField(max_length=255, null=True)),
                ('value_boolean', models.BooleanField(null=True)),
                ('value_integer', models.IntegerField(null=True)),
                ('value_time', models.TimeField(null=True)),
                ('value_date_time', models.DateTimeField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ObservationDerivedFromReference',
            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='ObservationHasMemberReference',
            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='ObservationPartOfReference',
            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='ObservationPerformerReference',
            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='ObservationReference',
            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='ObservationReferenceRange',
            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)),
                ('text', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ObservationSubjectReference',
            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='ObservationTriggeredBy',
            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=[('reflex', 'Reflex'), ('repeat', 'Repeat'), ('re_run', 'Re-run')], max_length=255, null=True)),
                ('reason', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SampledData',
            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)),
                ('interval', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
                ('factor', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
                ('lower_limit', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
                ('upper_limit', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
                ('dimensions', models.IntegerField()),
                ('offsets', models.CharField(max_length=255, null=True)),
                ('data', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SampledDataIntervalUnitCodes',
            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)),
                ('name', models.CharField(max_length=255, null=True)),
                ('definition', models.TextField(null=True)),
                ('source', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DocumentReferenceObservationReference',
            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='document_reference_observation_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Observation',
            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=[('registered', 'Registered'), ('preliminary', 'Preliminary'), ('final', 'Final'), ('amended', 'Amended'), ('corrected', 'Corrected'), ('cancelled', 'Cancelled'), ('entered-in-error', 'Entered in Error'), ('unknown', 'Unknown')], max_length=255, null=True)),
                ('effective_date_time', models.DateTimeField(null=True)),
                ('effective_instant', models.DateTimeField(null=True)),
                ('issued', models.DateTimeField(null=True)),
                ('value_string', models.CharField(max_length=255, null=True)),
                ('value_boolean', models.BooleanField(null=True)),
                ('value_integer', models.IntegerField(null=True)),
                ('value_time', models.TimeField(null=True)),
                ('value_date_time', models.DateTimeField(null=True)),
                ('body_site', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_body_site', to='base.codeableconcept')),
                ('body_structure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_body_structure', to='bodystructures.bodystructurereference')),
                ('category', models.ManyToManyField(blank=True, related_name='observation_category', to='base.codeableconcept')),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='base.codeableconcept')),
                ('data_absent_reason', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_data_absent_reason', to='base.codeableconcept')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_device', to='devices.devicedevicemetricreference')),
                ('effective_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_effective_period', to='base.period')),
                ('effective_timing', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_effective_timing', to='base.timing')),
                ('encounter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='encounters.encounterreference')),
                ('focus', models.ManyToManyField(related_name='observation_focus', to='base.reference')),
                ('identifier', models.ManyToManyField(blank=True, related_name='observation_identifier', to='base.identifier')),
                ('instantiates_reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_instantiates_reference', to='observationdefinitions.observationdefinitionreference')),
                ('interpretation', models.ManyToManyField(blank=True, related_name='observation_interpretation', to='base.codeableconcept')),
                ('method', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='observation_method', to='base.codeableconcept')),
                ('note', models.ManyToManyField(blank=True, related_name='observation_note', to='base.annotation')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
