Ejemplo n.º 1
0
def profile_view(request):
    # Authentication check.
    authentication_result = views.authentication_check(request)
    if authentication_result is not None: return authentication_result
    # Get the template data from the session
    template_data = views.parse_session(request)
    # Proceed with the rest of the view
    if request.user.account.role != Account.ACCOUNT_ADMIN:
        appointment.parse_appointment_cancel(
            request, template_data)  # Parse appointment cancelling
        template_data['events'] = appointment.parse_appointments(
            request)  # Build list of appointments
    else:
        template_data['total_logins'] = Action.objects.filter(
            description__icontains="Account login").count()
        template_data['total_logouts'] = Action.objects.filter(
            description__icontains="Account logout").count()
        template_data['total_admitted'] = Action.objects.filter(
            description__icontains="Admitted Patient").count()
        template_data['total_discharged'] = Action.objects.filter(
            description__icontains="Discharged Patient").count()
        template_data['total_appointments'] = Action.objects.filter(
            description__icontains="Appointment created").count()
        template_data['total_med_tests'] = Action.objects.filter(
            description__icontains="Medical Test created").count()
        template_data['total_registered'] = Action.objects.filter(
            description__icontains="registered").count()
    message.parse_message_archive(request, template_data)
    #template_data['messages'] = Message.objects.filter(target=request.user.account, target_deleted=False)
    template_data['messages'] = Score.objects.filter(
        owner=request.user.account)

    return render(request, 'healthnet/profile.html', template_data)
Ejemplo n.º 2
0
def list_view(request):
    # Authentication check.
    authentication_result = views.authentication_check(request)
    if authentication_result is not None: return authentication_result
    # Get the template data from the session
    template_data = views.parse_session(request)
    # Proceed with the rest of the view
    # Parse search sorting
    message.parse_message_archive(request, template_data)
    template_data['messages'] = Message.objects.filter(Q(target=request.user.account) | Q(sender=request.user.account))
    template_data['account'] = sanitize_js(request.user.account.profile.__str__())
    return render(request, 'healthnet/message/list.html', template_data)
Ejemplo n.º 3
0
def list_view(request):
    # Authentication check.
    authentication_result = views.authentication_check(request)
    if authentication_result is not None: return authentication_result
    # Get the template data from the session
    template_data = views.parse_session(request)
    # Proceed with the rest of the view
    # Parse search sorting
    message.parse_message_archive(request, template_data)
    template_data['messages'] = Message.objects.filter(
        Q(target=request.user.account) | Q(sender=request.user.account))
    template_data['account'] = sanitize_js(
        request.user.account.profile.__str__())
    return render(request, 'healthnet/message/list.html', template_data)
Ejemplo n.º 4
0
def profile_view(request):
    # Authentication check.
    authentication_result = views.authentication_check(request)
    if authentication_result is not None: return authentication_result
    # Get the template data from the session
    template_data = views.parse_session(request)
    # Proceed with the rest of the view
    if request.user.account.role != Account.ACCOUNT_ADMIN:
        appointment.parse_appointment_cancel(request, template_data)  # Parse appointment cancelling
        template_data['events'] = appointment.parse_appointments(request)  # Build list of appointments
    else:
        template_data['total_logins'] = Action.objects.filter(description__icontains="Account login").count()
        template_data['total_logouts'] = Action.objects.filter(description__icontains="Account logout").count()
        template_data['total_admitted'] = Action.objects.filter(description__icontains="Admitted Patient").count()
        template_data['total_discharged'] = Action.objects.filter(description__icontains="Discharged Patient").count()
        template_data['total_appointments'] = Action.objects.filter(description__icontains="Appointment created").count()
        template_data['total_med_tests'] = Action.objects.filter(description__icontains="Medical Test created").count()
        template_data['total_registered'] = Action.objects.filter(description__icontains="registered").count()
    message.parse_message_archive(request, template_data)
    template_data['messages'] = Message.objects.filter(target=request.user.account, target_deleted=False)
    return render(request, 'healthnet/profile.html', template_data)