26 lines
1.0 KiB
Python
26 lines
1.0 KiB
Python
from django.urls import include, path
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from .views import DepartmentViewSet, EmployeeViewSet, HospitalViewSet, PatientViewSet, PhysicianViewSet
|
|
from . import ui_views
|
|
|
|
app_name = 'organizations'
|
|
|
|
router = DefaultRouter()
|
|
router.register(r'api/hospitals', HospitalViewSet, basename='hospital-api')
|
|
router.register(r'api/departments', DepartmentViewSet, basename='department-api')
|
|
router.register(r'api/physicians', PhysicianViewSet, basename='physician-api')
|
|
router.register(r'api/employees', EmployeeViewSet, basename='employee-api')
|
|
router.register(r'api/patients', PatientViewSet, basename='patient-api')
|
|
|
|
urlpatterns = [
|
|
# UI Views
|
|
path('hospitals/', ui_views.hospital_list, name='hospital_list'),
|
|
path('departments/', ui_views.department_list, name='department_list'),
|
|
path('physicians/', ui_views.physician_list, name='physician_list'),
|
|
path('patients/', ui_views.patient_list, name='patient_list'),
|
|
|
|
# API Routes
|
|
path('', include(router.urls)),
|
|
]
|