Beispiel #1
0
def step_impl(context):
    #Se observan los resultados
    #t=Template('examen/listado_examenes.html')
    client = Client()
    pdf = render_to_pdf('paciente/reporte_pacientes.html')
    response = HttpResponse(pdf, content_type='application/pdf')

    assert response.status_code == 200
Beispiel #2
0
def step_impl(context):
    #Accion que realiza el sistema o el usuario
    #Se genera y renderiza el pdf
    template = get_template('paciente/reporte_pacientes.html')
    data = {
        'Pacientes': Paciente.objects.all(),
        'Citas': Cita.objects.all(),
        'Anotaciones': Anotacion.objects.all(),
        'Recetas': Receta.objects.all(),
        'Examenes': Examen.objects.all(),
    }
    pdf = render_to_pdf('paciente/reporte_pacientes.html', data)
    assert pdf.status_code == 200
Beispiel #3
0
def step_impl(context):
    #Accion que realiza el sistema o el usuario
    #Se genera y renderiza el pdf
    template = get_template('citas/concurrencia.html')
    div = Cita.objects.all().values('fecha_cita').annotate(
        total=Count('fecha_cita')).order_by('-total').count()
    prom = 0
    if div != 0:
        prom = Cita.objects.all().annotate(
            total=Count('estado')).order_by('-total').count() / div

    data = {
        'Citas':
        Cita.objects.all(),
        'Total':
        Cita.objects.count(),
        'Fecha_concurrido':
        Cita.objects.all().values('fecha_cita').annotate(
            total=Count('fecha_cita')).order_by('-total')[:1],
        'Citas_atendidas':
        Cita.objects.filter(estado='ATENDIDA').annotate(
            total=Count('estado')).order_by('-total').count(),
        'Citas_pendientes':
        Cita.objects.filter(estado='PENDIENTE').annotate(
            total=Count('estado')).order_by('-total').count(),
        'Citas_canceladas':
        Cita.objects.filter(estado='CANCELADA').annotate(
            total=Count('estado')).order_by('-total').count(),
        'Promedio_citas':
        prom,
        'Menos_concurrido':
        Cita.objects.all().values('fecha_cita').annotate(
            total=Count('fecha_cita')).order_by('total')[:1],
    }
    pdf = render_to_pdf('citas/concurrencia.html', data)
    assert pdf.status_code == 200