# 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', '0005_initial'),
        ('careplans', '0004_initial'),
        ('encounters', '0003_initial'),
        ('nutritionorders', '0002_initial'),
        ('patients', '0002_initial'),
        ('practitioners', '0001_initial'),
        ('servicerequests', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='VisionPrescriptionLensSpecificationPrism',
            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)),
                ('base', models.CharField(choices=[('up', 'Up'), ('down', 'Down'), ('in', 'In'), ('out', 'Out')], default='up', max_length=255)),
                ('amount', models.FloatField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VisionPrescriptionBasedOnReference',
            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)),
                ('care_plan', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_based_on_reference_care_plan', to='careplans.careplan')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_based_on_reference_identifier', to='base.identifier')),
                ('nutrition_order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_based_on_reference_nutrition_order', to='nutritionorders.nutritionorder')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_based_on_reference_service_request', to='servicerequests.servicerequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VisionPrescriptionLensSpecification',
            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)),
                ('eye', models.CharField(choices=[('right', 'Right'), ('left', 'Left')], default='right', max_length=255)),
                ('sphere', models.FloatField(null=True)),
                ('cylinder', models.FloatField(null=True)),
                ('axis', models.FloatField(null=True)),
                ('add', models.FloatField(null=True)),
                ('power', models.FloatField(null=True)),
                ('back_curve', models.FloatField(null=True)),
                ('diameter', models.FloatField(null=True)),
                ('color', models.CharField(max_length=255, null=True)),
                ('brand', models.CharField(max_length=255, null=True)),
                ('duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_lens_specification_duration', to='base.simplequantity')),
                ('note', models.ManyToManyField(blank=True, related_name='vision_prescription_lens_specification_note', to='base.annotation')),
                ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_lens_specification_product', to='base.codeableconcept')),
                ('prism', models.ManyToManyField(blank=True, related_name='vision_prescription_lens_specification_prism', to='visionprescriptions.visionprescriptionlensspecificationprism')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VisionPrescription',
            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'), ('cancelled', 'Cancelled'), ('draft', 'Draft'), ('entered-in-error', 'Entered in Error')], default='active', max_length=255)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('date_written', models.DateTimeField(null=True)),
                ('encounter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_encounter', to='encounters.encounterreference')),
                ('identifier', models.ManyToManyField(blank=True, related_name='vision_prescription_identifier', to='base.identifier')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_patient', to='patients.patientreference')),
                ('prescriber', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='vision_prescription_prescriber', to='practitioners.practitionerpractitionerrolereference')),
                ('based_on', models.ManyToManyField(blank=True, related_name='vision_prescription_based_on', to='visionprescriptions.visionprescriptionbasedonreference')),
                ('lens_specification', models.ManyToManyField(blank=True, related_name='vision_prescription_lens_specification', to='visionprescriptions.visionprescriptionlensspecification')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
