# Path: pttrack/urls.py
# def wrap_url(url, no_wrap=[], login_only=[], provider_only=[],
#              updated_provider_only=[]):
#     '''
#     Wrap URL in decorators as appropriate.
#     '''
#     if url.name in no_wrap:
#         # do not wrap at all, fully public
#         pass
# 
#     elif url.name in login_only:
#         url.callback = login_required(url.callback)
# 
#     elif url.name in provider_only:
#         url.callback = provider_required(url.callback)
#         url.callback = login_required(url.callback)
# 
#     elif url.name in updated_provider_only:
#         url.callback = provider_update_required(url.callback)
#         url.callback = provider_required(url.callback)
#         url.callback = login_required(url.callback)
# 
#     else:  # wrap in everything
#         url.callback = clintype_required(url.callback)
#         url.callback = provider_update_required(url.callback)
#         url.callback = provider_required(url.callback)
#         url.callback = login_required(url.callback)
# 
#     return url


from django.conf.urls import url
from pttrack.urls import wrap_url
from django.views.generic import DetailView
from . import models
from . import views
    url(r'^(?P<pk>[0-9]+)/error/$',
        views.error_workup,
        name="workup-error"),
    url(r'^(?P<pk>[0-9]+)/pdf/$',
        views.pdf_workup,
        name="workup-pdf"),

    # PROGRESS NOTES
    url(r'^(?P<pt_id>[0-9]+)/psychnote/$',
        views.ProgressNoteCreate.as_view(),
        name="new-progress-note"),
    url(r'^psychnote/update/(?P<pk>[0-9]+)$',
        views.ProgressNoteUpdate.as_view(),
        name="progress-note-update"),
    url(r'^psychnote/sign/(?P<pk>[0-9]+)$',
        views.sign_progress_note,
        name='progress-note-sign'),
    url(r'^psychnote/(?P<pk>[0-9]+)$',
        DetailView.as_view(model=models.ProgressNote),
        name="progress-note-detail"),

    url(r'^(?P<pt_id>[0-9]+)/clindate/$',
        views.ClinicDateCreate.as_view(),
        name="new-clindate"),
    url(r'^clindates/$',
        views.clinic_date_list,
        name="clindate-list")
]

wrap_config = {}

# Path: pttrack/urls.py
# def wrap_url(url, no_wrap=[], login_only=[], provider_only=[],
#              updated_provider_only=[]):
#     '''
#     Wrap URL in decorators as appropriate.
#     '''
#     if url.name in no_wrap:
#         # do not wrap at all, fully public
#         pass
# 
#     elif url.name in login_only:
#         url.callback = login_required(url.callback)
# 
#     elif url.name in provider_only:
#         url.callback = provider_required(url.callback)
#         url.callback = login_required(url.callback)
# 
#     elif url.name in updated_provider_only:
#         url.callback = provider_update_required(url.callback)
#         url.callback = provider_required(url.callback)
#         url.callback = login_required(url.callback)
# 
#     else:  # wrap in everything
#         url.callback = clintype_required(url.callback)
#         url.callback = provider_update_required(url.callback)
#         url.callback = provider_required(url.callback)
#         url.callback = login_required(url.callback)
# 
#     return url


# Path: workup/urls.py
from django.conf.urls import url
from pttrack.urls import wrap_url
from django.views.generic import DetailView
from . import models
from . import views

    url(r'^(?P<pk>[0-9]+)/error/$',
        views.error_workup,
        name="workup-error"),
    url(r'^(?P<pk>[0-9]+)/pdf/$',
        views.pdf_workup,
        name="workup-pdf"),

    # PROGRESS NOTES
    url(r'^(?P<pt_id>[0-9]+)/psychnote/$',
        views.ProgressNoteCreate.as_view(),
        name="new-progress-note"),
    url(r'^psychnote/update/(?P<pk>[0-9]+)$',
        views.ProgressNoteUpdate.as_view(),
        name="progress-note-update"),
    url(r'^psychnote/sign/(?P<pk>[0-9]+)$',
        views.sign_progress_note,
        name='progress-note-sign'),
    url(r'^psychnote/(?P<pk>[0-9]+)$',
        DetailView.as_view(model=models.ProgressNote),
        name="progress-note-detail"),

    url(r'^(?P<pt_id>[0-9]+)/clindate/$',
        views.ClinicDateCreate.as_view(),
        name="new-clindate"),
    url(r'^clindates/$',
        views.clinic_date_list,
        name="clindate-list")
]

wrap_config = {}

urlpatterns = [wrap_url(url, **wrap_config) for url in unwrapped_urlconf]