# 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'),
        ('documentreferences', '0001_initial'),
        ('medications', '0001_initial'),
        ('substances', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='MedicationKnowledgeCost',
            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)),
                ('source', models.CharField(max_length=255, null=True)),
                ('cost_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_cost_cost_codeable_concept', to='base.codeableconcept')),
                ('cost_money', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_cost_cost_money', to='base.money')),
                ('effective_date', models.ManyToManyField(blank=True, related_name='medication_knowledge_cost_effective_date', to='base.period')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_cost_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeDefinitionalDrugCharacteristic',
            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_string', models.CharField(max_length=255, null=True)),
                ('value_base_64_binary', models.TextField(null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_drug_characteristic_type', to='base.codeableconcept')),
                ('value_attachment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_drug_characteristic_value_attachment', to='base.attachment')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_drug_characteristic_value_codeable_concept', to='base.codeableconcept')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_drug_characteristic_value_quantity', to='base.quantity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeDefinitionalIngredient',
            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)),
                ('item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_ingredient_item', to='substances.substancecodeablereference')),
                ('strength_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_ingredient_strength_codeable_concept', to='base.codeableconcept')),
                ('strength_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_ingredient_strength_quantity', to='base.quantity')),
                ('strength_ratio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_ingredient_strength_ratio', to='base.ratio')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_ingredient_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeDefinitional',
            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)),
                ('dose_form', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional_dose_form', to='base.codeableconcept')),
                ('intended_route', models.ManyToManyField(blank=True, related_name='medication_knowledge_definitional_intended_route', to='base.codeableconcept')),
                ('drug_characteristic', models.ManyToManyField(blank=True, related_name='medication_knowledge_definitional_drug_chracteristic', to='medicationknowledges.medicationknowledgedefinitionaldrugcharacteristic')),
                ('ingredient', models.ManyToManyField(blank=True, related_name='medication_knowledge_definitional_ingredient', to='medicationknowledges.medicationknowledgedefinitionalingredient')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeIndicationGuidelineDosingGuideline',
            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)),
                ('administration_treatment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_dosing_guideline_administration_treatment', to='base.codeableconcept')),
                ('treatment_intent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_dosing_guideline_treatment_intent', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeIndicationGuideline',
            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)),
                ('dosing_guideline', models.ManyToManyField(blank=True, related_name='medication_knowledge_indication_guidline_dosing_guideline', to='medicationknowledges.medicationknowledgeindicationguidelinedosingguideline')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage',
            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)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_dosing_guideline_dosage_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledgeindicationguidelinedosingguideline',
            name='dosage',
            field=models.ManyToManyField(blank=True, related_name='medication_knowledge_dosing_guideline_dose', to='medicationknowledges.medicationknowledgeindicationguidelinedosingguidelinedosage'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeMedicineClassification',
            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)),
                ('source_string', models.CharField(max_length=255, null=True)),
                ('source_uri', models.URLField(null=True)),
                ('classification', models.ManyToManyField(blank=True, related_name='medication_knowledge_medicine_classification_classification', to='base.codeableconcept')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_medicine_classification_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeMonitoringProgram',
            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)),
                ('name', models.CharField(max_length=255, null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_monitoring_program_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeMonograph',
            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)),
                ('source', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_monograph_source', to='documentreferences.documentreferencereference')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_monograph_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgePackaging',
            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)),
                ('cost', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_packaging_cost', to='medicationknowledges.medicationknowledgecost')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledge',
            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=[('draft', 'Draft'), ('active', 'Active'), ('retired', 'Retired'), ('unknown', 'Unknown')], max_length=255, null=True)),
                ('name', models.CharField(max_length=255, null=True)),
                ('preparation_instruction', models.TextField(null=True)),
                ('associate_medication', models.ManyToManyField(blank=True, related_name='medication_knowledge_associate_medication', to='medications.medicationreference')),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_author', to='base.contactdetail')),
                ('code', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_code', to='base.codeableconcept')),
                ('identifier', models.ManyToManyField(blank=True, related_name='medication_knowledge_identifier', to='base.identifier')),
                ('jurisdiction', models.ManyToManyField(blank=True, related_name='medication_knowledge_jurisdiction', to='base.codeableconcept')),
                ('product_type', models.ManyToManyField(blank=True, related_name='medication_knowledge_product_type', to='base.codeableconcept')),
                ('cost', models.ManyToManyField(blank=True, related_name='medication_knowledge_cost', to='medicationknowledges.medicationknowledgecost')),
                ('definitional', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_definitional', to='medicationknowledges.medicationknowledgedefinitional')),
                ('indication_guideline', models.ManyToManyField(blank=True, related_name='medication_knowledge_indication_guideline', to='medicationknowledges.medicationknowledgeindicationguideline')),
                ('medicine_classification', models.ManyToManyField(blank=True, related_name='medication_knowledge_medicine_classification', to='medicationknowledges.medicationknowledgemedicineclassification')),
                ('monitoring_program', models.ManyToManyField(blank=True, related_name='medication_knowledge_monitoring_program', to='medicationknowledges.medicationknowledgemonitoringprogram')),
                ('monograph', models.ManyToManyField(blank=True, related_name='medication_knowledge_monograph', to='medicationknowledges.medicationknowledgemonograph')),
                ('packaging', models.ManyToManyField(blank=True, related_name='medication_knowledge_packaging', to='medicationknowledges.medicationknowledgepackaging')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgePatientCharacteristics',
            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)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='med_knowledge_dosing_guideline_treatment_intent_dosage_patient_characteristics_type', to='base.codeableconcept')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='med_knowledge_dosing_guideline_treatment_intent_dosage_patient_characteristics_value_codeable_concept', to='base.codeableconcept')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='med_knowledge_dosing_guideline_treatment_intent_dosage_patient_characteristics_value_quantity', to='base.quantity')),
                ('value_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='med_knowledge_dosing_guideline_treatment_intent_dosage_patient_characteristics_value_range', to='base.range')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledgeindicationguidelinedosingguideline',
            name='patient_characteristics',
            field=models.ManyToManyField(blank=True, related_name='medication_knowledge_dosing_guideline_patient_characteristics', to='medicationknowledges.medicationknowledgepatientcharacteristics'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeReference',
            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='medication_knowledge_reference_identifier', to='base.identifier')),
                ('medication_knowledge', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_reference_medication_knowledge', to='medicationknowledges.medicationknowledge')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeRegulatory',
            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)),
                ('regulatory_authority', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='regulatory_authority', to='base.organizationreference')),
                ('schedule', models.ManyToManyField(blank=True, related_name='medication_knowledge_schedule', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledge',
            name='regulatory',
            field=models.ManyToManyField(blank=True, related_name='medication_knowledge_regulatory', to='medicationknowledges.medicationknowledgeregulatory'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeRegulatoryMaxDispense',
            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)),
                ('period', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='regulatory_max_dispense_period', to='base.period')),
                ('quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='regulatory_max_dispense_quantity', to='base.simplequantity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledgeregulatory',
            name='max_dispense',
            field=models.ManyToManyField(blank=True, related_name='regulatory_max_dispense', to='medicationknowledges.medicationknowledgeregulatorymaxdispense'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeRegulatorySubstitution',
            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)),
                ('allowed', models.BooleanField(null=True)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='regulatory_substitution_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledgeregulatory',
            name='substitution',
            field=models.ManyToManyField(blank=True, related_name='regulatory_substitution', to='medicationknowledges.medicationknowledgeregulatorysubstitution'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeRelatedMedicationKnowledge',
            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.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_related_medication_knowledge_reference', to='medicationknowledges.medicationknowledgereference')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='medication_knowledge_related_medication_knowledge_type', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledge',
            name='related_medication_knowledge',
            field=models.ManyToManyField(blank=True, related_name='medication_knowledge_related_medication_knowledge', to='medicationknowledges.medicationknowledgerelatedmedicationknowledge'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeStorageGuideline',
            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.URLField(null=True)),
                ('note', models.ManyToManyField(blank=True, related_name='storage_guideline_note', to='base.annotation')),
                ('stability_duration', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='storage_guideline_stability_duration', to='base.duration')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledge',
            name='storage_guideline',
            field=models.ManyToManyField(blank=True, related_name='medication_knowledge_storage_guideline', to='medicationknowledges.medicationknowledgestorageguideline'),
        ),
        migrations.CreateModel(
            name='MedicationKnowledgeStorageGuidelineEnvironmentalSetting',
            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)),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='base.codeableconcept')),
                ('value_codeable_concept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='storage_guideline_environmental_setting_value_codeable_concept', to='base.codeableconcept')),
                ('value_quantity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='storage_guideline_environmental_setting_value_quantity', to='base.quantity')),
                ('value_range', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='storage_guideline_environmental_setting_value_range', to='base.range')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='medicationknowledgestorageguideline',
            name='environmental_setting',
            field=models.ManyToManyField(blank=True, related_name='storage_guideline_environmental_setting', to='medicationknowledges.medicationknowledgestorageguidelineenvironmentalsetting'),
        ),
    ]
