get('/', function() { return redirect()->to('/v2'); }); $routes->options('(:any)', function () { return ''; }); $routes->group('api', ['filter' => 'auth'], function($routes) { $routes->get('dashboard', 'Dashboard::index'); $routes->get('result', 'Result::index'); $routes->get('sample', 'Sample::index'); }); // Public Routes (no auth required) $routes->get('/v2/login', 'PagesController::login'); // V2 Auth API Routes (public - no auth required) $routes->group('v2/auth', function ($routes) { $routes->post('login', 'AuthV2::login'); $routes->post('register', 'AuthV2::register'); $routes->get('check', 'AuthV2::checkAuth'); $routes->post('logout', 'AuthV2::logout'); }); // Protected Page Routes - V2 (requires auth) $routes->group('v2', ['filter' => 'auth'], function ($routes) { $routes->get('/', 'PagesController::dashboard'); $routes->get('dashboard', 'PagesController::dashboard'); $routes->get('patients', 'PagesController::patients'); $routes->get('requests', 'PagesController::requests'); $routes->get('settings', 'PagesController::settings'); // Master Data - Organization $routes->get('master/organization/accounts', 'PagesController::masterOrgAccounts'); $routes->get('master/organization/sites', 'PagesController::masterOrgSites'); $routes->get('master/organization/disciplines', 'PagesController::masterOrgDisciplines'); $routes->get('master/organization/departments', 'PagesController::masterOrgDepartments'); $routes->get('master/organization/workstations', 'PagesController::masterOrgWorkstations'); // Master Data - Specimen $routes->get('master/specimen/containers', 'PagesController::masterSpecimenContainers'); $routes->get('master/specimen/preparations', 'PagesController::masterSpecimenPreparations'); // Master Data - Tests & ValueSets $routes->get('master/tests', 'PagesController::masterTests'); $routes->get('master/valuesets', 'PagesController::masterValueSets'); }); // Faker $routes->get('faker/faker-patient/(:num)', 'faker\FakerPatient::sendMany/$1'); $routes->group('api', function ($routes) { // Auth $routes->group('auth', function ($routes) { $routes->post('login', 'Auth::login'); $routes->post('change_pass', 'Auth::change_pass'); $routes->post('register', 'Auth::register'); $routes->get('check', 'Auth::checkAuth'); $routes->post('logout', 'Auth::logout'); }); // Patient $routes->group('patient', function ($routes) { $routes->get('/', 'Patient\Patient::index'); $routes->post('/', 'Patient\Patient::create'); $routes->get('(:num)', 'Patient\Patient::show/$1'); $routes->delete('/', 'Patient\Patient::delete'); $routes->patch('/', 'Patient\Patient::update'); $routes->get('check', 'Patient\Patient::patientCheck'); }); // PatVisit $routes->group('patvisit', function ($routes) { $routes->get('/', 'PatVisit::index'); $routes->post('/', 'PatVisit::create'); $routes->get('patient/(:num)', 'PatVisit::showByPatient/$1'); $routes->get('(:any)', 'PatVisit::show/$1'); $routes->delete('/', 'PatVisit::delete'); $routes->patch('/', 'PatVisit::update'); }); $routes->group('patvisitadt', function ($routes) { $routes->post('/', 'PatVisit::createADT'); $routes->patch('/', 'PatVisit::updateADT'); }); // Master Data $routes->group('race', function ($routes) { $routes->get('/', 'Race::index'); $routes->get('(:num)', 'Race::show/$1'); }); $routes->group('country', function ($routes) { $routes->get('/', 'Country::index'); $routes->get('(:num)', 'Country::show/$1'); }); $routes->group('religion', function ($routes) { $routes->get('/', 'Religion::index'); $routes->get('(:num)', 'Religion::show/$1'); }); $routes->group('ethnic', function ($routes) { $routes->get('/', 'Ethnic::index'); $routes->get('(:num)', 'Ethnic::show/$1'); }); // Location $routes->group('location', function ($routes) { $routes->get('/', 'Location::index'); $routes->get('(:num)', 'Location::show/$1'); $routes->post('/', 'Location::create'); $routes->patch('/', 'Location::update'); $routes->delete('/', 'Location::delete'); }); // Contact $routes->group('contact', function ($routes) { $routes->get('/', 'Contact\Contact::index'); $routes->get('(:num)', 'Contact\Contact::show/$1'); $routes->post('/', 'Contact\Contact::create'); $routes->patch('/', 'Contact\Contact::update'); $routes->delete('/', 'Contact\Contact::delete'); }); $routes->group('occupation', function ($routes) { $routes->get('/', 'Contact\Occupation::index'); $routes->get('(:num)', 'Contact\Occupation::show/$1'); $routes->post('/', 'Contact\Occupation::create'); $routes->patch('/', 'Contact\Occupation::update'); //$routes->delete('/', 'Contact\Occupation::delete'); }); $routes->group('medicalspecialty', function ($routes) { $routes->get('/', 'Contact\MedicalSpecialty::index'); $routes->get('(:num)', 'Contact\MedicalSpecialty::show/$1'); $routes->post('/', 'Contact\MedicalSpecialty::create'); $routes->patch('/', 'Contact\MedicalSpecialty::update'); }); // ValueSet $routes->group('valueset', function ($routes) { $routes->get('/', 'ValueSet\ValueSet::index'); $routes->get('(:num)', 'ValueSet\ValueSet::show/$1'); $routes->get('valuesetdef/(:segment)', 'ValueSet\ValueSet::showByValueSetDef/$1'); $routes->post('/', 'ValueSet\ValueSet::create'); $routes->patch('/', 'ValueSet\ValueSet::update'); $routes->delete('/', 'ValueSet\ValueSet::delete'); }); $routes->group('valuesetdef', function ($routes) { $routes->get('/', 'ValueSet\ValueSetDef::index'); $routes->get('(:segment)', 'ValueSet\ValueSetDef::show/$1'); $routes->post('/', 'ValueSet\ValueSetDef::create'); $routes->patch('/', 'ValueSet\ValueSetDef::update'); $routes->delete('/', 'ValueSet\ValueSetDef::delete'); }); // Counter $routes->group('counter', function ($routes) { $routes->get('/', 'Counter::index'); $routes->get('(:num)', 'Counter::show/$1'); $routes->post('/', 'Counter::create'); $routes->patch('/', 'Counter::update'); $routes->delete('/', 'Counter::delete'); }); // AreaGeo $routes->group('areageo', function ($routes) { $routes->get('/', 'AreaGeo::index'); $routes->get('provinces', 'AreaGeo::getProvinces'); $routes->get('cities', 'AreaGeo::getCities'); }); // Organization $routes->group('organization', function ($routes) { // Account $routes->group('account', function ($routes) { $routes->get('/', 'Organization\Account::index'); $routes->get('(:num)', 'Organization\Account::show/$1'); $routes->post('/', 'Organization\Account::create'); $routes->patch('/', 'Organization\Account::update'); $routes->delete('/', 'Organization\Account::delete'); }); // Site $routes->group('site', function ($routes) { $routes->get('/', 'Organization\Site::index'); $routes->get('(:num)', 'Organization\Site::show/$1'); $routes->post('/', 'Organization\Site::create'); $routes->patch('/', 'Organization\Site::update'); $routes->delete('/', 'Organization\Site::delete'); }); // Discipline $routes->group('discipline', function ($routes) { $routes->get('/', 'Organization\Discipline::index'); $routes->get('(:num)', 'Organization\Discipline::show/$1'); $routes->post('/', 'Organization\Discipline::create'); $routes->patch('/', 'Organization\Discipline::update'); $routes->delete('/', 'Organization\Discipline::delete'); }); // Department $routes->group('department', function ($routes) { $routes->get('/', 'Organization\Department::index'); $routes->get('(:num)', 'Organization\Department::show/$1'); $routes->post('/', 'Organization\Department::create'); $routes->patch('/', 'Organization\Department::update'); $routes->delete('/', 'Organization\Department::delete'); }); // Workstation $routes->group('workstation', function ($routes) { $routes->get('/', 'Organization\Workstation::index'); $routes->get('(:num)', 'Organization\Workstation::show/$1'); $routes->post('/', 'Organization\Workstation::create'); $routes->patch('/', 'Organization\Workstation::update'); $routes->delete('/', 'Organization\Workstation::delete'); }); }); // Specimen $routes->group('specimen', function ($routes) { $routes->group('containerdef', function ($routes) { $routes->get('/', 'Specimen\ContainerDef::index'); $routes->get('(:num)', 'Specimen\ContainerDef::show/$1'); $routes->post('/', 'Specimen\ContainerDef::create'); $routes->patch('/', 'Specimen\ContainerDef::update'); }); $routes->group('prep', function ($routes) { $routes->get('/', 'Specimen\Prep::index'); $routes->get('(:num)', 'Specimen\Prep::show/$1'); $routes->post('/', 'Specimen\Prep::create'); $routes->patch('/', 'Specimen\Prep::update'); }); $routes->group('status', function ($routes) { $routes->get('/', 'Specimen\Status::index'); $routes->get('(:num)', 'Specimen\Status::show/$1'); $routes->post('/', 'Specimen\Status::create'); $routes->patch('/', 'Specimen\Status::update'); }); $routes->group('collection', function ($routes) { $routes->get('/', 'Specimen\Collection::index'); $routes->get('(:num)', 'Specimen\Collection::show/$1'); $routes->post('/', 'Specimen\Collection::create'); $routes->patch('/', 'Specimen\Collection::update'); }); $routes->get('/', 'Specimen\Specimen::index'); $routes->get('(:num)', 'Specimen\Specimen::show/$1'); $routes->post('/', 'Specimen\Specimen::create'); $routes->patch('/', 'Specimen\Specimen::update'); }); // Tests $routes->group('tests', function ($routes) { $routes->get('/', 'Tests::index'); $routes->get('(:any)', 'Tests::show/$1'); $routes->post('/', 'Tests::create'); $routes->patch('/', 'Tests::update'); }); // Edge API - Integration with tiny-edge $routes->group('edge', function ($routes) { $routes->post('results', 'Edge::results'); $routes->get('orders', 'Edge::orders'); $routes->post('orders/(:num)/ack', 'Edge::ack/$1'); $routes->post('status', 'Edge::status'); }); }); // Khusus /* $routes->get('/api/zones', 'Zones::index'); $routes->get('/api/zones/synchronize', 'Zones::synchronize'); $routes->get('/api/zones/provinces', 'Zones::getProvinces'); $routes->get('/api/zones/cities', 'Zones::getCities'); */