# Path: pttrack/decorators.py
# def provider_required(func):
#     return user_passes_test(provider_exists, login_url=reverse_lazy('new-provider'))(func)
# 
# def clintype_required(func):
#     return session_passes_test(clintype_set, fail_url=reverse_lazy('choose-clintype'))(func)
# 
# def provider_update_required(func):
#     return user_passes_test(provider_has_updated, login_url=reverse_lazy('provider-update'))(func)


from django.conf.urls import url
from django.views.generic import DetailView
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required
from .decorators import provider_required, clintype_required, \
    provider_update_required
from . import models
from . import views
        name="home"),
    url(r'^all/$',
        views.all_patients,
        name="all-patients"),
    url(r'^preintake-select/$',
        views.PreIntakeSelect.as_view(),
        name="preintake-select"),
    url(r'^preintake/$',
        views.PreIntake.as_view(),
        name="preintake"),
    url(r'^intake/$',
        views.PatientCreate.as_view(),
        name="intake"),
    url(r'^(?P<pk>[0-9]+)/$',
        views.patient_detail,
        name='patient-detail'),
    url(r'^patient/update/(?P<pk>[0-9]+)$',
        views.PatientUpdate.as_view(),
        name='patient-update'),
    url(r'^patient/activate_detail/(?P<pk>[0-9]+)$',
        views.patient_activate_detail,
        name='patient-activate-detail'),
    url(r'^patient/activate_home/(?P<pk>[0-9]+)$',
        views.patient_activate_home,
        name='patient-activate-home'),

    # PROVIDERS
    url(r'^new-provider/$',
        views.ProviderCreate.as_view(),
        name='new-provider'),

# Path: pttrack/decorators.py
# def provider_required(func):
#     return user_passes_test(provider_exists, login_url=reverse_lazy('new-provider'))(func)
# 
# def clintype_required(func):
#     return session_passes_test(clintype_set, fail_url=reverse_lazy('choose-clintype'))(func)
# 
# def provider_update_required(func):
#     return user_passes_test(provider_has_updated, login_url=reverse_lazy('provider-update'))(func)


# Path: pttrack/urls.py
from django.conf.urls import url
from django.views.generic import DetailView
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required
from .decorators import provider_required, clintype_required, \
    provider_update_required
from . import models
from . import views

        name="home"),
    url(r'^all/$',
        views.all_patients,
        name="all-patients"),
    url(r'^preintake-select/$',
        views.PreIntakeSelect.as_view(),
        name="preintake-select"),
    url(r'^preintake/$',
        views.PreIntake.as_view(),
        name="preintake"),
    url(r'^intake/$',
        views.PatientCreate.as_view(),
        name="intake"),
    url(r'^(?P<pk>[0-9]+)/$',
        views.patient_detail,
        name='patient-detail'),
    url(r'^patient/update/(?P<pk>[0-9]+)$',
        views.PatientUpdate.as_view(),
        name='patient-update'),
    url(r'^patient/activate_detail/(?P<pk>[0-9]+)$',
        views.patient_activate_detail,
        name='patient-activate-detail'),
    url(r'^patient/activate_home/(?P<pk>[0-9]+)$',
        views.patient_activate_home,
        name='patient-activate-home'),

    # PROVIDERS
    url(r'^new-provider/$',
        views.ProviderCreate.as_view(),
        name='new-provider'),

    url(r'^choose-role/$',