# Generated by Django 4.2.14 on 2025-01-27 10:35

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('devices', '0002_alter_devicereference_device_and_more'),
        ('base', '0007_merge_20250121_1502'),
    ]

    operations = [
        migrations.CreateModel(
            name='DeviceMetric',
            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)),
                ('operational_status', models.CharField(choices=[('ON', 'On'), ('OFF', 'Off'), ('STANDBY', 'Standby'), ('ENTERED-IN-ERROR', 'Entered in Error')], max_length=255, null=True)),
                ('color', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DeviceMetricReference',
            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_metric', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_reference', to='devicemetrics.devicemetric')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DeviceMetricCalibration',
            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)),
                ('state', models.CharField(choices=[('NOT-CALIBRATED', 'Not Calibrated'), ('CALIBRATION-REQUIRED', 'Calibration Required'), ('CALIBRATED', 'Calibrated'), ('UNSPECIFIED', 'Unspecified')], max_length=255, null=True)),
                ('time', models.DateTimeField(null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_calibration_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='calibration',
            field=models.ManyToManyField(blank=True, related_name='device_metric_calibration', to='devicemetrics.devicemetriccalibration'),
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_category', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='device',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_device', to='devices.devicereference'),
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='identifier',
            field=models.ManyToManyField(blank=True, related_name='device_metrics_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='measurement_frequency',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_measurement_frequency', to='base.quantity'),
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='type',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_type', to='base.codeableconcept'),
        ),
        migrations.AddField(
            model_name='devicemetric',
            name='unit',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='device_metric_unit', to='base.codeableconcept'),
        ),
    ]
