# 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', '0002_initial'),
        ('devicedefinitions', '0001_initial'),
        ('devicemetrics', '0001_initial'),
        ('endpoints', '0001_initial'),
        ('locations', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='DeviceUdiCarrier',
            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)),
                ('device_identifier', models.CharField(max_length=255, null=True)),
                ('device_identifier_system', models.CharField(max_length=255, null=True)),
                ('carrier_hrft', models.CharField(max_length=255, null=True)),
                ('carrier_aidc', models.CharField(max_length=255, null=True)),
                ('issuer', models.CharField(max_length=255, null=True)),
                ('jurisdiction', models.CharField(max_length=255, null=True)),
                ('carrier', models.CharField(max_length=255, null=True)),
                ('entry_type', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Device',
            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=[('active', 'Active'), ('inactive', 'Inactive'), ('entered-in-error', 'Entered in Error')], max_length=255, null=True)),
                ('manufacturer', models.CharField(max_length=255, null=True)),
                ('manufacture_date', models.DateTimeField(null=True)),
                ('expiration_date', models.DateTimeField(null=True)),
                ('lot_number', models.CharField(max_length=255, null=True)),
                ('serial_number', models.CharField(max_length=255, null=True)),
                ('model_number', models.CharField(max_length=255, null=True)),
                ('part_number', models.CharField(max_length=255, null=True)),
                ('cycle', models.IntegerField(null=True)),
                ('url', models.URLField(null=True)),
                ('availability_status', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_availability_status', to='base.codeableconcept')),
                ('biological_source_event', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_biological_source_event', to='base.identifier')),
                ('category', models.ManyToManyField(blank=True, related_name='devices_category', to='base.codeableconcept')),
                ('contact', models.ManyToManyField(blank=True, related_name='devices_contact', to='base.contactpoint')),
                ('definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='devicedefinitions.devicedefinitionreference')),
                ('duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_duration', to='base.quantity')),
                ('endpoint', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_endpoint', to='endpoints.endpointreference')),
                ('identifier', models.ManyToManyField(blank=True, related_name='devices_identifier', to='base.identifier')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_location', to='locations.locationreference')),
                ('mode', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_mode', to='base.codeableconcept')),
                ('note', models.ManyToManyField(blank=True, related_name='devices_note', to='base.annotation')),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_owner', to='base.organizationreference')),
                ('safety', models.ManyToManyField(blank=True, related_name='devices_safety', to='base.codeableconcept')),
                ('type', models.ManyToManyField(blank=True, related_name='devices_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DeviceCodeableReference',
            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.CASCADE, related_name='device_codeable_reference_concept', to='base.codeableconcept')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_reference_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='device',
            name='gateway',
            field=models.ManyToManyField(blank=True, related_name='devices_gateway', to='devices.devicecodeablereference'),
        ),
        migrations.CreateModel(
            name='DeviceConformsTo',
            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)),
                ('version', models.CharField(max_length=255, null=True)),
                ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_conforms_to_category', to='base.codeableconcept')),
                ('specification', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_conforms_to_specification', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='device',
            name='conforms_to',
            field=models.ManyToManyField(blank=True, related_name='devices_conforms_to', to='devices.deviceconformsto'),
        ),
        migrations.CreateModel(
            name='DeviceDeviceDefinitionReference',
            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)),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='device_device_definition_reference_device', to='devices.device')),
                ('device_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='device_device_definition_reference_device_definition', to='devicedefinitions.devicedefinition')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='device_device_definition_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DeviceDeviceDefinitionCodeableReference',
            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.CASCADE, related_name='device_device_definition_codeable_reference_concept', to='base.codeableconcept')),
                ('reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_device_definition_codeable_reference_reference', to='devices.devicedevicedefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DeviceDeviceMetricReference',
            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)),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='device_device_metric_reference_device', to='devices.device')),
                ('device_metric', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='device_device_metric_reference_device_metric', to='devicemetrics.devicemetric')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='device_device_metric_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DeviceName',
            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', models.CharField(max_length=255, null=True)),
                ('display', models.BooleanField(default=False, null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_name_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='device',
            name='name',
            field=models.ManyToManyField(blank=True, related_name='devices_name', to='devices.devicename'),
        ),
        migrations.CreateModel(
            name='DeviceProperty',
            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)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_property_type', to='base.codeableconcept')),
                ('value_attachment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_property_value_attachment', to='base.attachment')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_property_value_code', to='base.codeableconcept')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_property_value_quantity', to='base.quantity')),
                ('value_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_property_value_range', to='base.range')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='device',
            name='property',
            field=models.ManyToManyField(blank=True, related_name='devices_property', to='devices.deviceproperty'),
        ),
        migrations.CreateModel(
            name='DeviceReference',
            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)),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='devicecodeablereference',
            name='reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_codeable_reference_reference', to='devices.devicereference'),
        ),
        migrations.AddField(
            model_name='device',
            name='parent',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='devices_parent', to='devices.devicereference'),
        ),
        migrations.AddField(
            model_name='device',
            name='udi_carrier',
            field=models.ManyToManyField(blank=True, to='devices.deviceudicarrier'),
        ),
        migrations.CreateModel(
            name='DeviceVersion',
            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', models.CharField(max_length=255, null=True)),
                ('install_date', models.DateTimeField(null=True)),
                ('component', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_version_component', to='base.identifier')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='device_version_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='device',
            name='device_version',
            field=models.ManyToManyField(blank=True, related_name='devices_device_version', to='devices.deviceversion'),
        ),
    ]
