# Generated by Django 4.2.14 on 2025-01-15 16:02

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


class Migration(migrations.Migration):

    dependencies = [
        ('base', '0004_ratio'),
    ]

    operations = [
        migrations.CreateModel(
            name='Repeat',
            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)),
                ('count', models.PositiveIntegerField(null=True)),
                ('count_max', models.PositiveIntegerField(null=True)),
                ('duration', models.DecimalField(decimal_places=2, max_digits=1000, null=True)),
                ('duration_max', models.DecimalField(decimal_places=2, max_digits=1000, null=True)),
                ('duration_unit', models.CharField(choices=[('s', 'second'), ('min', 'minute'), ('h', 'hour'), ('d', 'day'), ('wk', 'week'), ('mo', 'month'), ('a', 'year')], max_length=255, null=True)),
                ('frequency', models.PositiveIntegerField(null=True)),
                ('frequency_max', models.PositiveIntegerField(null=True)),
                ('period', models.DecimalField(decimal_places=2, max_digits=1000, null=True)),
                ('period_max', models.DecimalField(decimal_places=2, max_digits=1000, null=True)),
                ('period_unit', models.CharField(choices=[('s', 'second'), ('min', 'minute'), ('h', 'hour'), ('d', 'day'), ('wk', 'week'), ('mo', 'month'), ('a', 'year')], max_length=255, null=True)),
                ('time_of_day', models.TimeField(null=True)),
                ('bounds_duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='repeat_bounds_duration', to='base.quantity')),
                ('bounds_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='repeat_bounds_period', to='base.period')),
                ('bounds_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='repeat_bounds_range', to='base.range')),
                ('day_of_week', models.ManyToManyField(blank=True, related_name='repeat_day_of_week', to='base.coding')),
                ('when', models.ManyToManyField(blank=True, related_name='repeat_when', to='base.coding')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Timing',
            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)),
                ('event', models.DateTimeField(null=True)),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='timing_code', to='base.codeableconcept')),
                ('repeat', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='timing_repeat', to='base.repeat')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
