# 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'),
        ('bodystructures', '0002_initial'),
        ('careplans', '0004_initial'),
        ('careteams', '0004_initial'),
        ('conditions', '0004_initial'),
        ('devicedefinitions', '0001_initial'),
        ('devices', '0001_initial'),
        ('diagnosticreports', '0002_initial'),
        ('encounters', '0003_initial'),
        ('groups', '0002_initial'),
        ('healthcareservices', '0001_initial'),
        ('locations', '0001_initial'),
        ('medicationrequests', '0002_initial'),
        ('medications', '0001_initial'),
        ('observations', '0002_initial'),
        ('organizations', '0001_initial'),
        ('patients', '0002_initial'),
        ('practitionerroles', '0002_initial'),
        ('practitioners', '0001_initial'),
        ('procedures', '0001_initial'),
        ('provenances', '0001_initial'),
        ('relatedpersons', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='AsNeeded',
            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)),
                ('display', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BodySite',
            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)),
                ('display', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Parameter',
            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)),
                ('display', models.CharField(max_length=255)),
                ('description', models.CharField(max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProcedureCodes',
            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)),
                ('display', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProcedureReason',
            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)),
                ('display', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Reference',
            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)),
                ('display', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ServiceRequestCategory',
            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)),
                ('display', models.CharField(max_length=255, null=True)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ServiceRequestPatientInstruction',
            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)),
                ('instruction_markdown', models.TextField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OrderDetailParameter',
            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(default=False)),
                ('value_string', models.CharField(max_length=255, null=True)),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_detail_parameter_code', to='base.codeableconcept')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_detail_parameter_value_codeable_concept', to='base.codeableconcept')),
                ('value_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_detail_parameter_value_period', to='base.period')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_detail_parameter_value_quantity', to='base.quantity')),
                ('value_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_detail_parameter_value_range', to='base.range')),
                ('value_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_detail_parameter_value_ratio', to='base.ratio')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OrderDetailParameterFocusReference',
            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.SET_NULL, related_name='order_detail_parameter_focus_device', to='devices.device')),
                ('device_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_detail_parameter_focus_device_definition', to='devicedefinitions.devicedefinition')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_detail_parameter_focus_identifier', to='base.identifier')),
                ('medication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_detail_parameter_focus_medication', to='medications.medication')),
                ('medication_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_detail_parameter_focus_medication_request', to='medicationrequests.medicationrequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OrderDetailParameterFocusCodeableReference',
            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)),
                ('concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_detail_parameter_focus_codeable_reference_concept', to='base.codeableconcept')),
                ('reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_detail_parameter_focus_codeable_reference_reference', to='servicerequests.orderdetailparameterfocusreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ServiceRequest',
            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)),
                ('instantiates_uri', models.URLField(null=True)),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('active', 'Active'), ('on_hold', 'On Hold'), ('revoked', 'Revoked'), ('completed', 'Completed'), ('entered_in_error', 'Entered in Error'), ('unknown', 'Unknown')], default='active', max_length=255)),
                ('intent', models.CharField(choices=[('proposal', 'Proposal'), ('plan', 'Plan'), ('order', 'Order'), ('original-order', 'Original Order'), ('reflex-order', 'Reflex Order'), ('filler-order', 'Filler Order'), ('instance-order', 'Instance Order'), ('option', 'Option')], default='order', max_length=255)),
                ('priority', models.CharField(choices=[('routine', 'Routine'), ('urgent', 'Urgent'), ('asap', 'ASAP'), ('stat', 'Stat')], default='routine', max_length=255)),
                ('do_not_perform', models.BooleanField(default=False)),
                ('occurrence_date_time', models.DateTimeField(null=True)),
                ('as_needed', models.BooleanField(default=False)),
                ('authored_on', models.DateTimeField(null=True)),
                ('as_needed_for', models.ManyToManyField(blank=True, related_name='service_request_as_needed_for', to='base.codeableconcept')),
                ('body_site', models.ManyToManyField(blank=True, related_name='service_request_body_site', to='base.codeableconcept')),
                ('body_structure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_body_structure', to='bodystructures.bodystructurereference')),
                ('category', models.ManyToManyField(blank=True, related_name='service_request_category', to='base.codeableconcept')),
                ('encounter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_encounter', to='encounters.encounterreference')),
                ('focus', models.ManyToManyField(blank=True, related_name='service_request_focus', to='servicerequests.reference')),
                ('identifier', models.ManyToManyField(blank=True, related_name='service_request_identifier', to='base.identifier')),
                ('location', models.ManyToManyField(blank=True, related_name='service_request_location', to='locations.locationcodeablereference')),
                ('note', models.ManyToManyField(blank=True, related_name='service_request_note', to='base.annotation')),
                ('occurrence_period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_occurrence_period', to='base.period')),
                ('occurrence_timing', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_occurrence_timing', to='base.timing')),
                ('performer_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.codeableconcept')),
                ('quantity_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_quantity_quantity', to='base.quantity')),
                ('quantity_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_quantity_range', to='base.range')),
                ('quantity_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_quantity_ratio', to='base.ratio')),
                ('relevant_history', models.ManyToManyField(blank=True, related_name='service_request_relevant_history', to='provenances.provenancereference')),
                ('requisition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requisition', to='base.identifier')),
                ('supporting_info', models.ManyToManyField(blank=True, related_name='service_request_supporting_info', to='base.codeablereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ServiceRequestBasedOnReference',
            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.SET_NULL, related_name='service_request_based_on_care_paln', to='careplans.careplan')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_based_on_identifier', to='base.identifier')),
                ('medicatoin_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_based_on_medication_request', to='medicationrequests.medicationrequest')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_based_on_service_request', to='servicerequests.servicerequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='based_on',
            field=models.ManyToManyField(blank=True, related_name='service_request_based_on', to='servicerequests.servicerequestbasedonreference'),
        ),
        migrations.CreateModel(
            name='ServiceRequestOrderDetail',
            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)),
                ('parameter', models.ManyToManyField(blank=True, related_name='service_request_order_detail_parameter', to='servicerequests.orderdetailparameter')),
                ('parameter_focus', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_order_detail_parameter_focus', to='servicerequests.orderdetailparameterfocuscodeablereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='order_detail',
            field=models.ManyToManyField(blank=True, to='servicerequests.servicerequestorderdetail'),
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='patient_instruction',
            field=models.ManyToManyField(blank=True, related_name='service_request_patient_instruction', to='servicerequests.servicerequestpatientinstruction'),
        ),
        migrations.CreateModel(
            name='ServiceRequestPerformerReference',
            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.SET_NULL, related_name='service_request_performer_care_team', to='careteams.careteam')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_device', to='devices.device')),
                ('healthcare_service', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_healthcare_service', to='healthcareservices.healthcareservice')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_practitioner_role', to='practitionerroles.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_performer_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='performer',
            field=models.ManyToManyField(blank=True, related_name='service_request_performer', to='servicerequests.servicerequestperformerreference'),
        ),
        migrations.CreateModel(
            name='ServiceRequestPlanDefinitionReference',
            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.SET_NULL, related_name='service_request_plan_definition_identifier', to='base.identifier')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_plan_definition_service_request', to='servicerequests.servicerequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ServiceRequestPlanDefinitionReferenceCodeableReference',
            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)),
                ('concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_plan_definition_reference_codeable_reference_concept', to='base.codeableconcept')),
                ('reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_plan_definition_reference_codeable_reference_reference', to='servicerequests.servicerequestplandefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ServiceRequestReasonCodeableReference',
            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)),
                ('concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_codeable_reference_concept', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='reason',
            field=models.ManyToManyField(blank=True, related_name='service_request_reason', to='servicerequests.servicerequestreasoncodeablereference'),
        ),
        migrations.CreateModel(
            name='ServiceRequestReasonReference',
            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)),
                ('condition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_condition', to='conditions.condition')),
                ('diagnostic_report', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_diagnostic_report', to='diagnosticreports.diagnosticreport')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_identifier', to='base.identifier')),
                ('observation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_observation', to='observations.observation')),
                ('procedure', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_procedure', to='procedures.procedure')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequestreasoncodeablereference',
            name='reference',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reason_codeable_reference_reference', to='servicerequests.servicerequestreasonreference'),
        ),
        migrations.CreateModel(
            name='ServiceRequestReference',
            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.SET_NULL, related_name='service_request_reference_identifier', to='base.identifier')),
                ('service_request', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_reference_service_request', to='servicerequests.servicerequest')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='replaces',
            field=models.ManyToManyField(blank=True, related_name='service_request_replaces', to='servicerequests.servicerequestreference'),
        ),
        migrations.CreateModel(
            name='ServiceRequestRequesterReference',
            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.SET_NULL, related_name='service_request_requester_device', to='devices.device')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester_identifier', to='base.identifier')),
                ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester_organization', to='organizations.organization')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester_practitioner', to='practitioners.practitioner')),
                ('practitioner_role', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester_practitioner_role', to='practitionerroles.practitionerrole')),
                ('related_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester_related_person', to='relatedpersons.relatedperson')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='additional_recipient',
            field=models.ManyToManyField(blank=True, related_name='service_request_additional_recipient', to='servicerequests.servicerequestrequesterreference'),
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='requester',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_requester', to='servicerequests.servicerequestrequesterreference'),
        ),
        migrations.CreateModel(
            name='ServiceRequestSubjectReference',
            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.SET_NULL, related_name='service_request_subject_device', to='devices.device')),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_subject_group', to='groups.group')),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_subject_identifier', to='base.identifier')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_subject_location', to='locations.location')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_subject_patient', to='patients.patient')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='servicerequest',
            name='subject',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_request_subject', to='servicerequests.servicerequestsubjectreference'),
        ),
    ]
