# Generated by Django 3.1.4 on 2021-01-06 14:44

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CausaExterna',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=3)),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Causa Externa',
                'verbose_name_plural': 'Causas Externas',
            },
        ),
        migrations.CreateModel(
            name='CertezaDiagnostico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='CodigoTriage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Codigo Triage',
                'verbose_name_plural': 'Codigos Triage',
            },
        ),
        migrations.CreateModel(
            name='Consulta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_consulta', models.DateField(blank=True, default=django.utils.timezone.now)),
                ('hora', models.TimeField(blank=True, default=django.utils.timezone.now, verbose_name='Hora de Consulta')),
                ('motivo', models.TextField()),
                ('enfermedad_actual', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Diagnostico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo_int', models.CharField(max_length=4, verbose_name='ICD-10')),
                ('nombre', models.CharField(max_length=255, verbose_name='Enfermedad')),
            ],
            options={
                'verbose_name': 'Diagnostico',
                'verbose_name_plural': 'Diagnosticos',
            },
        ),
        migrations.CreateModel(
            name='Entidades',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Entidad',
                'verbose_name_plural': 'Entidades',
            },
        ),
        migrations.CreateModel(
            name='EstadoCivil',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Estado Civil',
                'verbose_name_plural': 'Estados Civiles',
            },
        ),
        migrations.CreateModel(
            name='Genero',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Medicamento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=80)),
                ('dosis', models.CharField(max_length=60)),
                ('nota', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Medicamento',
                'verbose_name_plural': 'Medicamentos',
            },
        ),
        migrations.CreateModel(
            name='Municipio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
                ('codigo_dian', models.CharField(max_length=5)),
            ],
            options={
                'verbose_name': 'Municipio',
                'verbose_name_plural': 'Municipios',
            },
        ),
        migrations.CreateModel(
            name='Ocupacion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Ocupacion',
                'verbose_name_plural': 'Ocupaciones',
            },
        ),
        migrations.CreateModel(
            name='OrigenAtencion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Origen de Atencion',
                'verbose_name_plural': 'Origenes de atencion',
            },
        ),
        migrations.CreateModel(
            name='Paraclinico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Paraclinico',
                'verbose_name_plural': 'Paraclinicos',
            },
        ),
        migrations.CreateModel(
            name='RiesgoPaciente',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=3)),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Riesgo Paciente',
                'verbose_name_plural': 'Riesgo de Paciente',
            },
        ),
        migrations.CreateModel(
            name='TiempoUso',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Tiempo de Uso Medicamento',
                'verbose_name_plural': 'Tiempos de uso de Medicamento',
            },
        ),
        migrations.CreateModel(
            name='TipoAntecedente',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Tipo de antecedente',
                'verbose_name_plural': 'Tipos de Antecedentes',
            },
        ),
        migrations.CreateModel(
            name='TipoDocumento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Tipo de documento',
                'verbose_name_plural': 'Tipos de documentos',
            },
        ),
        migrations.CreateModel(
            name='TipoExamenFisico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Tipo de examen fisico',
                'verbose_name_plural': 'Tipos de examenes fisicos',
            },
        ),
        migrations.CreateModel(
            name='ViaIngreso',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Via de Ingreso',
                'verbose_name_plural': 'Vias de Ingreso',
            },
        ),
        migrations.CreateModel(
            name='ViasSuministroMedicamento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Via de suministro',
                'verbose_name_plural': 'Vias de suministro',
            },
        ),
        migrations.CreateModel(
            name='Paciente',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('numero_documento', models.CharField(max_length=15)),
                ('primer_nombre', models.CharField(max_length=40)),
                ('segundo_nombre', models.CharField(max_length=40)),
                ('primer_apellido', models.CharField(max_length=40)),
                ('segundo_apellido', models.CharField(max_length=40)),
                ('fecha_nacimiento', models.DateField(verbose_name='Fecha de Nacimiento')),
                ('telefono_casa', models.CharField(max_length=12)),
                ('direccion_casa', models.CharField(max_length=40)),
                ('telefono_oficina', models.CharField(max_length=12)),
                ('direccion_oficina', models.CharField(max_length=40)),
                ('codigo_contrato', models.CharField(max_length=15)),
                ('persona_responsable', models.CharField(max_length=60)),
                ('tel_responsable', models.CharField(max_length=12)),
                ('fecha_alta', models.DateField(verbose_name='Fecha de creacion')),
                ('ciudad_casa', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ciudad_residencia', to='historias.municipio')),
                ('ciudad_oficina', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ciudad_trabajo', to='historias.municipio')),
                ('entidad', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_paciente_entidad', to='historias.entidades')),
                ('estado_civil', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_paciente_estado_civil', to='historias.estadocivil')),
                ('lugar_nacimiento', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='lugar_nacimiento', to='historias.municipio')),
                ('ocupacion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_paciente_ocupacion', to='historias.ocupacion')),
                ('sexo', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_paciente_genero', to='historias.genero')),
                ('tipo_documento', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_paciente_tipo_documento', to='historias.tipodocumento')),
            ],
        ),
        migrations.CreateModel(
            name='Medico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('primer_nombre', models.CharField(max_length=40)),
                ('segundo_nombre', models.CharField(max_length=40)),
                ('primer_apellido', models.CharField(max_length=40)),
                ('segundo_apellido', models.CharField(max_length=40)),
                ('especialidad', models.CharField(max_length=20)),
                ('direccion', models.CharField(max_length=60)),
                ('telefono', models.CharField(max_length=15)),
                ('numero_documento', models.CharField(max_length=15)),
                ('registro_medico', models.CharField(max_length=15)),
                ('ciudad', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_medico_medico', to='historias.municipio')),
                ('tipo_documento', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_medico_tipo_documento', to='historias.tipodocumento')),
            ],
        ),
        migrations.CreateModel(
            name='Entidades_Planes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tipo_plan', models.CharField(max_length=2)),
                ('subplan', models.CharField(max_length=4)),
                ('descripcion', models.CharField(max_length=255)),
                ('entidad', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_entidades_planes_entidad', to='historias.entidades')),
            ],
        ),
        migrations.CreateModel(
            name='ConsultaTratamiento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tratamiento', models.TextField()),
                ('consulta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultatratamiento_consulta', to='historias.consulta')),
            ],
            options={
                'verbose_name': 'Tratamiento',
                'verbose_name_plural': 'Tratamientos',
            },
        ),
        migrations.CreateModel(
            name='ConsultaParaclinicos',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('texto_encontrado', models.TextField(verbose_name='Examen Solicitado')),
                ('consulta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaparaclinicos_consulta', to='historias.consulta')),
                ('paraclinico', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaparaclinicos_paraclinico', to='historias.paraclinico')),
            ],
            options={
                'verbose_name': 'Paraclinico',
                'verbose_name_plural': 'Paraclinicos',
            },
        ),
        migrations.CreateModel(
            name='ConsultaFormulacion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre_del_medicamento', models.CharField(max_length=60)),
                ('cantidad', models.IntegerField()),
                ('dosificacion', models.CharField(max_length=250)),
                ('consulta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaformulacion_consulta', to='historias.consulta')),
                ('tiempoUso', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaformulacion_tiempo_uso', to='historias.tiempouso')),
                ('vias_suministro_medicamento', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaformulacion_vias_suministro_medicamento', to='historias.viassuministromedicamento')),
            ],
            options={
                'verbose_name': 'Formulacion',
                'verbose_name_plural': 'Formulaciones',
            },
        ),
        migrations.CreateModel(
            name='ConsultaExamenFisico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('texto_encontrado', models.TextField(verbose_name='Revision efectuada')),
                ('consulta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaexamenfisico_consulta', to='historias.consulta')),
                ('tipo_examen', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaexamenfisico_tipo_examen', to='historias.tipoexamenfisico')),
            ],
            options={
                'verbose_name': 'Examen Fisico',
                'verbose_name_plural': 'Examenes Fisicos',
            },
        ),
        migrations.CreateModel(
            name='ConsultaDiagnostico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('explicacion', models.TextField()),
                ('causa_externa', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_causa_externa', to='historias.causaexterna')),
                ('certeza', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_certeza_diagnostico', to='historias.certezadiagnostico')),
                ('codigo_triage', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_codigo_triage', to='historias.codigotriage')),
                ('consulta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_consulta', to='historias.consulta')),
                ('diagnostico_principal', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='Principal', to='historias.diagnostico')),
                ('diagnostico_secundario1', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='Secundario1', to='historias.diagnostico')),
                ('diagnostico_secundario2', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='Secundario2', to='historias.diagnostico')),
                ('origen_atencion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_origen_atencion', to='historias.origenatencion')),
                ('riesgo_paciente', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_riesgo_paciente', to='historias.riesgopaciente')),
                ('via_ingreso', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultadiagnostico_via_ingreso', to='historias.viaingreso')),
            ],
            options={
                'verbose_name': 'Diagnostico',
                'verbose_name_plural': 'Diagnosticos',
            },
        ),
        migrations.CreateModel(
            name='ConsultaAntecedentes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('texto_encontrado', models.TextField(verbose_name='Antecedente Encontrado')),
                ('consulta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaantecedentes_consulta', to='historias.consulta')),
                ('tipo_antecedentes', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consultaantecedentes_tipo_antecedente', to='historias.tipoantecedente')),
            ],
            options={
                'verbose_name': 'Antecedente',
                'verbose_name_plural': 'Antecedentes',
            },
        ),
        migrations.AddField(
            model_name='consulta',
            name='paciente',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='historias_consulta_paciente', to='historias.paciente'),
        ),
    ]
