from django.db import models

class Datos_personales(models.Model):
	fecha_encuesta = models.DateField()
	cuenta = models.CharField(max_length = 50)
	apellido_paterno = models.CharField(max_length = 50)
	apellido_materno = models.CharField(max_length = 50)
	nombre = models.CharField(max_length = 50)
	fecha_nacimiento = models.DateField()
	estado = models.CharField(max_length = 30)
	codigo_postal = models.CharField(max_length = 5)
	sexo = models.CharField(max_length = 1)
	estado_civil = models.CharField(max_length = 1)
	correo_electronico = models.EmailField(max_length = 254) 

	def __str__(self):
		return self.cuenta

class Estudios(models.Model):
	grado_estudios = models.CharField(max_length = 1)
	grado_estudios_madre = models.CharField(max_length = 1)
	grado_estudios_padre = models.CharField(max_length = 1)
	promedio_academico = models.DecimalField(max_digits = 4, decimal_places = 2)
	horas_lectivas_diarias = models.CharField(max_length = 1)
	horas_recreativas_diarias = models.CharField(max_length = 1)
	horas_diarias_transporte = models.CharField(max_length = 1)
	tipo_transporte_facmed = models.CharField(max_length = 1, default = 'a')
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)

class Antecedentes(models.Model):
	tienes_sobrepeso = models.CharField(max_length = 1)
	edad_dx_sobrepeso = models.IntegerField()
	tienes_obesidad = models.CharField(max_length = 1)
	edad_dx_obesidad = models.IntegerField()
	padeces_enfermedades_cronicas = models.CharField(max_length = 1)
	edad_dx_enfermedades_cronicas = models.IntegerField()
	padre_padece_enfermedades_cronicas = models.CharField(max_length = 1)
	edad_dx_padre_enfermedades_cronicas = models.IntegerField()
	madre_padece_enfermedades_cronicas = models.CharField(max_length = 1)
	edad_dx_madre_enfermedades_cronicas = models.IntegerField()
	padres_vivos = models.CharField(max_length = 1)
	padre_vivo_edad = models.IntegerField()
	padre_muerto_edad = models.IntegerField()
	madre_viva_edad = models.IntegerField()
	madre_muerta_edad = models.IntegerField()
	padre_vivo_sp_obesidad_dm_cardio = models.CharField(max_length = 1)
	madre_viva_sp_obesidad_dm_crdio = models.CharField(max_length = 1)
	hermanos_tienes = models.IntegerField()
	primer_hermano_vivo_muerto = models.CharField(max_length = 1)
	primer_hermano_edad = models.IntegerField()
	primer_hermano_sp_obesidad_dm_cardio = models.CharField(max_length = 1)
	segundo_hermano_vivo_muerto = models.CharField(max_length = 1)
	segundo_hermano_edad = models.IntegerField()
	segundo_hermano_sp_obesidad_dm_cardio = models.CharField(max_length = 1)
	tercer_hermano_vivo_muerto = models.CharField(max_length = 1)
	tercer_hermano_edad = models.IntegerField()
	tercer_hermano_sp_obesidad_dm_cardio = models.CharField(max_length = 1)
	cuarto_hermano_vivo_muerto = models.CharField(max_length = 1)
	cuarto_hermano_edad = models.IntegerField()
	cuarto_hermano_sp_obesidad_dm_cardio = models.CharField(max_length = 1)
	hijos_tienes = models.IntegerField()
	primer_hijo_edad = models.IntegerField()
	primer_hijo_sp_obesidad_dm = models.CharField(max_length = 10)
	primer_hijo_peso_nacer = models.DecimalField(max_digits = 4, decimal_places = 2)
	segundo_hijo_edad = models.IntegerField()
	segundo_hijo_sp_obesidad_dm = models.CharField(max_length = 10)
	segundo_hijo_peso_nacer = models.DecimalField(max_digits = 4, decimal_places = 2)
	tercer_hijo_edad = models.IntegerField()
	tercer_hijo_sp_obesidad_dm = models.CharField(max_length = 10)
	tercer_hijo_peso_nacer = models.DecimalField(max_digits = 4, decimal_places = 2)
	cuarto_hijo_edad = models.IntegerField()
	cuarto_hijo_sp_obesidad_dm = models.CharField(max_length = 10)
	cuarto_hijo_peso_nacer = models.DecimalField(max_digits = 4, decimal_places = 2)
	pareja_tienes = models.CharField(max_length = 1)
	edad_pareja = models.IntegerField()
	pareja_sp_obesidad_dm = models.CharField(max_length = 1)
	amigos_proporcion_sp_obesidad = models.CharField(max_length = 1)
	amigos_cercanos_tienes= models.IntegerField()
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)


class Autoevaluacion_salud(models.Model):
	peso_actual = models.DecimalField(max_digits = 4, decimal_places = 2)
	pesaste_ultima_vez = models.CharField(max_length = 1)
	estatura = models.DecimalField(max_digits = 4, decimal_places = 2)
	consideras_peso_actual = models.CharField(max_length = 1)
	consideras_peso_1 = models.CharField(max_length = 1)
	consideras_peso_5 = models.CharField(max_length = 1)
	acciones_respecto_peso = models.CharField(max_length = 1)
	intento_bajar_subir_peso = models.CharField(max_length = 1)
	estres_actual = models.CharField(max_length = 1)
	estres_1 = models.CharField(max_length = 1)
	estres_5 = models.CharField(max_length = 1)
	condicion_fisica_actual = models.CharField(max_length = 1)
	condicion_fisica_1 = models.CharField(max_length = 1)
	condicion_fisica_5 = models.CharField(max_length = 1)
	suenno_diario = models.DecimalField(max_digits = 4, decimal_places = 2)
	suenno_calidad = models.DecimalField(max_digits = 4, decimal_places = 2)
	suenno_diario_1ano = models.DecimalField(max_digits = 4, decimal_places = 2)
	suenno_diario_5anos = models.DecimalField(max_digits = 4, decimal_places = 2)
	salud_actual = models.CharField(max_length = 1)
	salud_actual_1ano = models.CharField(max_length = 1)
	salud_actual_5anos = models.CharField(max_length = 1)
	trastorno_sueno = models.CharField(max_length = 100)
	alcohol_semana = models.CharField(max_length = 1)
	tipo_bebida_alcoholica = models.CharField(max_length = 1)
	edad_tomando = models.CharField(max_length = 10)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)


class Percepcion(models.Model):
	stuntkard_peso_actual = models.IntegerField()
	stuntkard_figura_ideal = models.IntegerField()
	stuntkard_peso_1ano = models.IntegerField()
	stuntkard_peso_5anos = models.IntegerField()
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)


class Personalidad(models.Model):
	soy_organizado= models.CharField(max_length = 1)
	soy_responsable = models.CharField(max_length = 1)
	soy_dedicado = models.CharField(max_length = 1)
	soy_descuidado = models.CharField(max_length = 1)
	soy_minucioso = models.CharField(max_length = 1)
	soy_disciplinado = models.CharField(max_length = 1)
	planear_futuro = models.CharField(max_length = 1)
	buena_suerte = models.CharField(max_length = 1)
	propios_exitos = models.CharField(max_length = 1)
	cualquier_cosa_propuesta = models.CharField(max_length = 1)
	problemas_mala_suerte = models.CharField(max_length = 1)
	control_malos_sucesos = models.CharField(max_length = 1)
	desgracias_errores = models.CharField(max_length = 1)
	responsable_fallas = models.CharField(max_length = 1)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)


class Estatus_economico(models.Model):
	actividad_remunerada = models.CharField(max_length = 1)
	horas_semana_actividad = models.CharField(max_length = 1)
	ingreso_mensual = models.CharField(max_length = 1)
	gastos_personales_mensuales = models.CharField(max_length = 1)
	vives_padres_familia = models.CharField(max_length = 1)
	focos_vivienda = models.CharField(max_length = 2)
	focos_vivienda_rentada = models.CharField(max_length = 2)
	personas_compartes_dormitorio_familia = models.CharField(max_length = 2)
	personas_compartes_dormitorio_rentas = models.CharField(max_length = 2)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)



class Nutricion(models.Model):

	comidas_fuertes = models.CharField(max_length = 1)
	calorias_crees_recomendadas = models.CharField(max_length = 30)
	comes_relativo_recomendado = models.CharField(max_length = 1)
	numero_refrescos_normales_consumes = models.CharField(max_length = 4)
	numero_cereales_tuberculos_consumes = models.CharField(max_length = 4)
	numero_frutas_consumes = models.CharField(max_length = 4)
	numero_maiz_consumes = models.CharField(max_length = 4)
	numero_tortillas_consumes = models.CharField(max_length = 4)
	numero_carne_etc_consumes = models.CharField(max_length = 4)
	numero_verduras_leguminosas_consumes = models.CharField(max_length = 4)
	numero_botanas_etc_consumes  = models.CharField(max_length = 4)
	numero_comes_fuera_casa = models.CharField(max_length = 1)
	numero_cfca = models.CharField(max_length = 1) 
	numero_cfcc = models.CharField(max_length = 1)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE) 

	def __str__(self):
		return str(self.cuenta)


class Actividad_fisica(models.Model):
	horas_ejercicio_actual = models.DecimalField(max_digits = 4, decimal_places = 2)
	horas_ejercicio_1ano = models.DecimalField(max_digits = 4, decimal_places = 2)
	horas_ejercicio_5ano = models.DecimalField(max_digits = 4, decimal_places = 2)
	tipo_ejercicio_actual = models.CharField(max_length = 1)
	tipo_ejercicio_1ano = models.CharField(max_length = 1)
	tipo_ejercicio_5anos = models.CharField(max_length = 1)
	donde_haces_ejercicio = models.CharField(max_length = 1)
	gusta_ejercicio_intenso = models.CharField(max_length = 1)
	r_medicas = models.CharField(max_length = 1)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)
	

class Informacion_salud(models.Model):
	imc_normal = models.CharField(max_length = 1)
	stuntkard_bajo_peso = models.IntegerField() 
	stuntkard_normal_peso = models.IntegerField()
	stuntkard_sobrepeso = models.IntegerField()
	stuntkard_obeso = models.IntegerField()
	porc_mexicanos_obesidad = models.CharField(max_length = 1)
	calorias_refresco = models.CharField(max_length = 1)
	calorias_agua = models.CharField(max_length = 1)
	calorias_manzana = models.CharField(max_length = 1)
	distancia_calorias_coca = models.CharField(max_length = 1)
	cambio_habitos_probabilidad_dm = models.CharField(max_length = 1)
	factores_obesidad_dm = models.CharField(max_length = 1)
	eres_religioso = models.CharField(max_length = 1)
	partidario_politico = models.CharField(max_length = 1)
	cual_partido_politico = models.CharField(max_length = 30)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)

class Observaciones(models.Model):
	observaciones = models.CharField(max_length = 100)
	etiquetas = models.CharField(max_length = 100)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)
	
	def __str__(self):
		return str(self.cuenta)


class Antropometria(models.Model):
	peso_real = models.CharField(max_length = 100) 
	talla_real  = models.CharField(max_length = 100)
	presion_sistolica = models.CharField(max_length = 100) 
	presion_diastolica  = models.CharField(max_length = 100)
	circunferencia_brazo = models.CharField(max_length = 100) 
	circunferencia_cintura = models.CharField(max_length = 100) 
	circunferencia_cadera = models.CharField(max_length = 100) 
	temperatura_axilar = models.CharField(max_length = 100) 
	temperatura_oido = models.CharField(max_length = 100) 
	temperatura_muneca  = models.CharField(max_length = 100)
	bioimpedancia_peso = models.CharField(max_length = 100) 
	bioimpedancia_porcentaje_grasa = models.CharField(max_length = 100) 
	bioimpedancia_porcentaje_agua = models.CharField(max_length = 100) 
	plicometria_triceps  = models.CharField(max_length = 100)
	plicometria_biceps = models.CharField(max_length = 100) 
	plicometria_suprailiaco = models.CharField(max_length = 100) 
	plicometria_subescapular = models.CharField(max_length = 100) 
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)


class Laboratorio(models.Model):
	paciente = models.CharField(max_length = 100)  
	glucosa = models.CharField(max_length = 100) 
	urea = models.CharField(max_length = 100) 
	creatinina = models.CharField(max_length = 100) 
	acido_urico = models.CharField(max_length = 100) 
	colesterol_total = models.CharField(max_length = 100) 
	trigliceridos = models.CharField(max_length = 100) 
	bilirrubina_total = models.CharField(max_length = 100) 
	bilirrubina_directa = models.CharField(max_length = 100) 
	bilirrubina_indirecta = models.CharField(max_length = 100) 
	aspartato_amino_transferasa = models.CharField(max_length = 100) 
	calcio = models.CharField(max_length = 100) 
	fosforo = models.CharField(max_length = 100) 
	hemoglobina_glucosilada = models.CharField(max_length = 100) 
	glucosa_promedio_estimada = models.CharField(max_length = 100) 
	insulina_basal = models.CharField(max_length = 100) 
	hemoglobina = models.CharField(max_length = 100) 
	hematocrito = models.CharField(max_length = 100) 
	eritrocitos  = models.CharField(max_length = 100)
	vgm = models.CharField(max_length = 100) 
	hgm = models.CharField(max_length = 100) 
	chcm = models.CharField(max_length = 100) 
	rdw = models.CharField(max_length = 100) 
	leucocitos = models.CharField(max_length = 100) 
	porcentaje_neutrofilos_totales = models.CharField(max_length = 100) 
	porcentaje_neutrofilos_segmentados = models.CharField(max_length = 100) 
	porcentaje_neutrofilos_en_banda = models.CharField(max_length = 100) 
	numero_eosinofilos = models.CharField(max_length = 100) 
	porcentaje_eosinofilos = models.CharField(max_length = 100) 
	numero_basofilos = models.CharField(max_length = 100) 
	porcentaje_basofilos = models.CharField(max_length = 100)
	numero_linfocitos = models.CharField(max_length = 100)
	porcentaje_linfocitos = models.CharField(max_length = 100)
	numero_monocitos = models.CharField(max_length = 100)
	porcentaje_monocitos = models.CharField(max_length = 100)
	plaquetas = models.CharField(max_length = 100)
	vpm = models.CharField(max_length = 100)
	paciente = models.CharField(max_length = 100)
	glucosa = models.CharField(max_length = 100)
	urea = models.CharField(max_length = 100)
	creatinina = models.CharField(max_length = 100)
	acido_urico = models.CharField(max_length = 100) 
	colesterol_total = models.CharField(max_length = 100)
	trigliceridos = models.CharField(max_length = 100)
	hemoglobina_glucosilada = models.CharField(max_length = 100)
	insulina_basal = models.CharField(max_length = 100)
	hemoglobina = models.CharField(max_length = 100)
	hematocrito = models.CharField(max_length = 100)
	eritrocitos = models.CharField(max_length = 100)
	vgm = models.CharField(max_length = 100)
	chcm = models.CharField(max_length = 100)
	leucocitos = models.CharField(max_length = 100)
	porcentaje_neutrofilos_totales = models.CharField(max_length = 100)
	porcentaje_eosinofilos = models.CharField(max_length = 100)
	porcentaje_basofilos = models.CharField(max_length = 100)
	porcentaje_linfocitos = models.CharField(max_length = 100)
	porcentaje_monocitos = models.CharField(max_length = 100)
	plaquetas = models.CharField(max_length = 100)
	hdl = models.CharField(max_length = 100)
	ldl = models.CharField(max_length = 100)
	bun = models.CharField(max_length = 100)
	albumina = models.CharField(max_length = 100)
	pcr = models.CharField(max_length = 100)
	cloro = models.CharField(max_length = 100)
	potasio = models.CharField(max_length = 100)
	sodio = models.CharField(max_length = 100)
	glucosa = models.CharField(max_length = 100)
	colesterol_total = models.CharField(max_length = 100)
	hemoglobina_glucosilada = models.CharField(max_length = 100)
	insulina_basal = models.CharField(max_length = 100)
	hdl = models.CharField(max_length = 100)
	ldl = models.CharField(max_length = 100)
	bun = models.CharField(max_length = 100)
	pcr = models.CharField(max_length = 100)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)

class Bioimpedancia(models.Model):
	edad_real = models.CharField(max_length = 100)
	munneca = models.CharField(max_length = 100)
	porc_musculos = models.CharField(max_length = 100)
	rmkcal = models.CharField(max_length = 100)
	edad_corporal = models.CharField(max_length = 100)
	imc = models.CharField(max_length = 100)
	grasa_visceral = models.CharField(max_length = 100)
	cuenta = models.ForeignKey(Datos_personales,on_delete=models.CASCADE)

	def __str__(self):
		return str(self.cuenta)






