【发布时间】:2014-06-14 12:34:45
【问题描述】:
我想知道是否有可能在 Python 中执行此选择的功能,我想知道更知名的诊断,但它可以在 3 个不同的领域,我知道此选择有效,但是我不知道如何将它放入 Python 中,或者是否还有其他方法可以在 Python 中做同样的事情。
SELECT Count(*)
FROM (
SELECT DISTINCT
imp_diagnostica_99
, imp_diagnostica_100
, imp_diagnostica_101
FROM expmedico_expedienteconsultainicial
) As distinctified
我想获得医生发送的更多程序。
模型.py
class AutorizacionImagenologia(models.Model):
imagenologia_fecha_solicitud_1 = models.DateField(auto_now=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateField(auto_now=True)
imagenologia_fecha_emision = models.DateField(auto_now=True, null=True, blank=True)
tipo_plan = models.CharField(max_length=60, null=True, blank=True)
empresa_empleadora = models.CharField(max_length=100, null=True, blank=True)
imagenologia_hora_de_solicitud_2 = models.TimeField(auto_now=True, null=True, blank=True)
imagenologia_medico_solicita_3 = models.ForeignKey(Medico, related_name='MedicoImagenologia', null=True)
imagenologia_nombre_pac_4 = models.CharField(max_length=60, null=False, blank=True)
imagenologia_apellido = models.CharField(max_length=60, null=False, blank=True)
imagenologia_fecha_nacimiento_5 = models.DateField(max_length=10, null=True, blank=True)
imagenologia_edad_miembro6 = models.CharField(max_length=10, null=True, blank=True)
imagenologia_sexo_7 = models.CharField(max_length=10, null=True, blank=True)
imagenologia_diagnostico_9 = models.CharField(max_length=100, null=True, blank=True)
imagenologia_credencial = models.CharField(max_length=20, null=False)
imagenologia_procedimiento = models.ForeignKey(
Estudios_Imagenologia,
related_name='ProcedimientosImg', blank=True, null=True)
imagenologia_procedimiento2 = models.ForeignKey(Estudios_Imagenologia, related_name='ProcedimientosImg2', blank=True, null=True)
imagenologia_procedimiento3 = models.ForeignKey(
Estudios_Imagenologia, related_name='ProcedimientosImg3',
blank=True, null=True)
【问题讨论】: