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

    operations = [
        migrations.CreateModel(
            name='GroupMember',
            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)),
                ('inactive', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GroupMemberEntityReference',
            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='GroupReference',
            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='GroupCharacteristic',
            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_boolean', models.BooleanField(null=True)),
                ('value_uri', models.URLField(null=True)),
                ('exclude', models.BooleanField(null=True)),
                ('description', models.TextField(null=True)),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_code', to='base.codeableconcept')),
                ('determined_by_expression', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_determined_by_expression', to='base.expression')),
                ('duration_duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_duration_duration', to='base.quantity')),
                ('duration_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_duration_range', to='base.range')),
                ('instances_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_instances_quantity', to='base.quantity')),
                ('instances_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_instances_range', to='base.range')),
                ('method', models.ManyToManyField(blank=True, related_name='group_characteristic_method', to='base.codeableconcept')),
                ('offset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_offset', to='base.codeableconcept')),
                ('period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_period', to='base.period')),
                ('timing', models.ManyToManyField(blank=True, related_name='group_characteristic_timing', to='base.relativetime')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_value_code', to='base.codeableconcept')),
                ('value_expression', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_value_expression', to='base.expression')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_value_quantity', to='base.quantity')),
                ('value_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_value_range', to='base.range')),
                ('value_reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_value_reference', to='base.reference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Group',
            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)),
                ('uri', models.URLField(null=True)),
                ('version', models.CharField(max_length=255, null=True)),
                ('version_algorithm_string', models.CharField(max_length=255, null=True)),
                ('name', models.CharField(max_length=255, null=True)),
                ('title', models.CharField(max_length=255, null=True)),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('active', 'Active'), ('retired', 'Retired'), ('unknown', 'Unknown')], max_length=255, null=True)),
                ('experimental', models.BooleanField(default=False)),
                ('date', models.DateTimeField(null=True)),
                ('publisher', models.TextField(null=True)),
                ('description', models.TextField(null=True)),
                ('purpose', models.TextField(null=True)),
                ('copyright', models.TextField(null=True)),
                ('copyright_label', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(choices=[('person', 'Person'), ('animal', 'Animal'), ('practitioner', 'Practitioner'), ('device', 'Device'), ('care-team', 'Care Team'), ('healthcare-service', 'Healthcare Service'), ('location', 'Location'), ('organization', 'Organization')], max_length=255, null=True)),
                ('membership', models.CharField(choices=[('definitional', 'Definitional'), ('conceptual', 'Conceptual'), ('enumerated', 'Enumerated')], max_length=255, null=True)),
                ('quantity', models.IntegerField(null=True)),
                ('combination_method', models.CharField(choices=[('all-of', 'All Of'), ('any-of', 'Any Of'), ('at-least', 'At Least'), ('at-most', 'At Most'), ('except-subset', 'Except Subset')], max_length=255, null=True)),
                ('combination_threshold', models.IntegerField(null=True)),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_code', to='base.codeableconcept')),
                ('contact', models.ManyToManyField(blank=True, related_name='group_contact', to='base.contactdetail')),
                ('identifier', models.ManyToManyField(blank=True, related_name='groups_identifier', to='base.identifier')),
                ('use_context', models.ManyToManyField(blank=True, related_name='group_use_context', to='base.usagecontext')),
                ('version_algorithm_coding', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_version_algorithm_coding', to='base.coding')),
                ('characteristic', models.ManyToManyField(blank=True, related_name='group_characteristic', to='groups.groupcharacteristic')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GroupCharacteristicDeterminedByReference',
            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, related_name='group_characteristic_determined_by_reference_device', to='devices.device')),
                ('device_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='devicedefinitions.devicedefinition')),
                ('device_metric', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_determined_by_reference_device_metric', to='devicemetrics.devicemetric')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_determined_by_reference_identifier', to='base.identifier')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='groupcharacteristic',
            name='determined_by_reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_characteristic_determined_by_reference', to='groups.groupcharacteristicdeterminedbyreference'),
        ),
        migrations.CreateModel(
            name='GroupManagingEntityReference',
            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.CASCADE, related_name='group_managing_entity_reference_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_managing_entity_reference_organization', to='organizations.organization')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
