# 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'),
        ('careteams', '0004_initial'),
        ('devices', '0001_initial'),
        ('encounters', '0004_initial'),
        ('groups', '0003_initial'),
        ('healthcareservices', '0001_initial'),
        ('locations', '0001_initial'),
        ('medicationrequests', '0003_initial'),
        ('organizations', '0001_initial'),
        ('patients', '0002_initial'),
        ('practitionerroles', '0002_initial'),
        ('practitioners', '0001_initial'),
        ('provenances', '0001_initial'),
        ('relatedpersons', '0001_initial'),
        ('servicerequests', '0001_initial'),
        ('visionprescriptions', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='TransportBasedOnReference',
            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)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_based_on_identifier', to='base.identifier')),
                ('medication_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_based_on_medication_request', to='medicationrequests.medicationrequest')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_based_on_service_request', to='servicerequests.servicerequest')),
                ('vision_prescription', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_based_on_vision_prescription', to='visionprescriptions.visionprescription')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TransportInput',
            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)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_input_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TransportOutput',
            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)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_output_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TransportOwnerReference',
            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_team', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_care_team', to='careteams.careteam')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_device', to='devices.device')),
                ('healthcare_service', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_healthcare_service', to='healthcareservices.healthcareservice')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_practitioner_role', to='practitionerroles.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner_reference_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Transport',
            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=[('preparation', 'Preparation'), ('in-progress', 'In Progress'), ('not-done', 'Not Done'), ('suspended', 'Suspended'), ('stopped', 'Stopped'), ('on-hold', 'On Hold'), ('completed', 'Completed'), ('entered-in-error', 'Entered in Error'), ('unknown', 'Unknown')], max_length=255, null=True)),
                ('description', models.TextField(null=True)),
                ('completion_time', models.DateTimeField(null=True)),
                ('authored_on', models.DateTimeField(null=True)),
                ('last_modified', models.DateTimeField(null=True)),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_code', to='base.codeableconcept')),
                ('current_location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_current_location', to='locations.locationreference')),
                ('encounter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_encounter', to='encounters.encounterreference')),
                ('focus', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_focus', to='base.reference')),
                ('for_value', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_for_value', to='base.reference')),
                ('group_identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_group_identifier', to='base.identifier')),
                ('identifier', models.ManyToManyField(blank=True, related_name='transport_identifier', to='base.identifier')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_location', to='locations.locationreference')),
                ('note', models.ManyToManyField(blank=True, related_name='transport_note', to='base.annotation')),
                ('performer_type', models.ManyToManyField(blank=True, related_name='transport_performer_type', to='base.codeableconcept')),
                ('reason', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_reason', to='base.codeablereference')),
                ('relevant_history', models.ManyToManyField(blank=True, related_name='transport_relevant_history', to='provenances.provenancereference')),
                ('requested_location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requested_location', to='locations.locationreference')),
                ('status_reason', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_status_reason', to='base.codeableconcept')),
                ('based_on', models.ManyToManyField(blank=True, related_name='transport_based_on', to='transports.transportbasedonreference')),
                ('input', models.ManyToManyField(blank=True, related_name='transport_input', to='transports.transportinput')),
                ('output', models.ManyToManyField(blank=True, related_name='transport_output', to='transports.transportoutput')),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_owner', to='transports.transportownerreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TransportReference',
            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.DO_NOTHING, related_name='transport_reference_identifier', to='base.identifier')),
                ('transport', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_reference_transport', to='transports.transport')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='transport',
            name='history',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_history', to='transports.transportreference'),
        ),
        migrations.AddField(
            model_name='transport',
            name='part_of',
            field=models.ManyToManyField(blank=True, related_name='transport_part_of', to='transports.transportreference'),
        ),
        migrations.CreateModel(
            name='TransportRequesterReference',
            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.DO_NOTHING, related_name='transport_requester_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester_practitioner_role', to='practitionerroles.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='transport',
            name='requester',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_requester', to='transports.transportrequesterreference'),
        ),
        migrations.CreateModel(
            name='TransportRestriction',
            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)),
                ('repetitions', models.PositiveIntegerField(null=True)),
                ('period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_period', to='base.period')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='transport',
            name='restriction',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction', to='transports.transportrestriction'),
        ),
        migrations.CreateModel(
            name='TransportRestrictionRecipientReference',
            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)),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_group', to='groups.group')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_practitioner_role', to='practitionerroles.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transport_restriction_recipient_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='transportrestriction',
            name='recipient',
            field=models.ManyToManyField(blank=True, related_name='transport_restriction_recipient', to='transports.transportrestrictionrecipientreference'),
        ),
    ]
