<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/tanggalnow', function () {
    return [
        'tanggal' => date('Y-m-d'),
        'jam' => date('H:i:s')
    ];
});

$router->get('/', function () {
    return view('welcome.api');
});

// ----------------- REGISTRASI ACCESS SSO MULTI APP BY SCOPE
$router->group(['namespace'  => 'ApiSSO'], function () use ($router) {
    $router->post('/access/register', 'RegistrasiPlatrofmController@Register');
    $router->post('/access/login', 'LoginPlatformController@Login');
});

// ------------------- REGISTRASI POLIKLINIK MULTI PLATFORM
$router->group(['namespace' => 'ApiSIMRS', 'middleware' => 'bpjs'], function () use ($router) {
    $router->post('/antrian/registrasi/via/bpjs', 'AntrianController@Register');
    $router->post('/antrian/getrekap', 'AntrianController@getRekapAntrian');
    $router->post('/operasi/getoperasi', 'OperationController@getOperasi');
    $router->post('/operasi/getjadwal', 'OperationController@getJadwal');
});

// ----------------------- API BPJS FROM INTERNAL
$router->group(['namespace' => 'BridgingBPJS'], function () use ($router) {
    // ----------------- REFERENSI --------------------------//
    $router->get('/referensi/diagnosa/{kode}', 'ReferensiController@diagnosa');
    $router->get('/referensi/poli/{kode}', 'ReferensiController@poli');
    $router->get('/referensi/faskes/{kodeNama}/{jenisFaskes}', 'ReferensiController@faskes');
    $router->get('/referensi/dokter/pelayanan/{jnsPel}/tglpelayanan/{tglPel}/spesialis/{subSpesial}', 'ReferensiController@dpjp');
    // Location
    $router->get('/referensi/propinsi', 'ReferensiController@propinsi');
    $router->get('/referensi/kabupaten/propinsi/{kodePropinsi}', 'ReferensiController@kabupaten');
    $router->get('/referensi/kecamatan/kabupaten/{kodeKabupaten}', 'ReferensiController@kecamatan');

    // prb
    $router->get('/referensi/diagnosaprb', 'ReferensiController@diagnosaPRB');
    $router->get('/referensi/obatprb/{kodeNama}', 'ReferensiController@obatPRB');

    // End location
    $router->get('/referensi/procedure/{kodeNama}', 'ReferensiController@procedure');
    $router->get('/referensi/kelasrawat', 'ReferensiController@kelas');
    $router->get('/referensi/dokter/{namaDokter}', 'ReferensiController@dokter');
    $router->get('/referensi/spesialistik', 'ReferensiController@spesialistik');
    $router->get('/referensi/ruangrawat', 'ReferensiController@ruang');
    $router->get('/referensi/carakeluar', 'ReferensiController@caraKeluar');
    $router->get('/referensi/pascapulang', 'ReferensiController@pascaPulang');

    // -------------------- PESERTA -----------------------------//
    $router->get('/peserta/nokartu/{noKartu}/tglsep/{tglSep}', 'PesertaController@noKartu');
    $router->get('/peserta/nik/{nik}/tglsep/{tglSep}', 'PesertaController@noKtp');


    // ---------------------- RUJUKAN ----------------------------//
    $router->get('/rujukan/{noRujukan}', 'RujukanController@RujukanPcare');
    $router->get('/rujukan/rs/{noRujukan}', 'RujukanController@RujukanRs');
    $router->get('/rujukan/peserta/{noKartu}', 'RujukanController@PesertaPcare');
    $router->get('/rujukan/rs/peserta/{noKartu}', 'RujukanController@PesertaRs');
    $router->get('/rujukan/list/peserta/{noKartu}', 'RujukanController@PesertaListPcare');
    $router->get('/rujukan/rs/list/peserta/{noKartu}', 'RujukanController@PesertaListRs');

    $router->post('/rujukan/insert', 'RujukanController@InsertRujukan');
    $router->put('/rujukan/update', 'RujukanController@UpdateRujukan');
    $router->delete('/rujukan/delete', 'RujukanController@DeleteRujukan');
    $router->post('/rujukan/v2/insert', 'RujukanController@InsertRujukanv2'); // versi 2.0
    $router->put('/rujukan/v2/update', 'RujukanController@UpdateRujukanv2'); // versi 2.0

    $router->post('/rujukan/khusus/insert', 'RujukanController@InsertRujukanKhusus');
    $router->delete('/rujukan/khusus/delete', 'RujukanController@DeleteRujukanKhusus');
    $router->get('/rujukan/khusus/bulan/{bulan}/tahun/{tahun}', 'RujukanController@ListRujukanKhusus');
    $router->get('/rujukan/listspesialistik/ppkrujukan/{kodePPK}/tglrujukan/{tgl}', 'RujukanController@ListSpesialistik');
    $router->get('/rujukan/listsarana/ppkrujukan/{kodePPK}', 'RujukanController@ListSarana');
    $router->get('/rujukan/keluar/list/tglMulai/{tglMulai}/tglAkhir/{tglAkhir}', 'RujukanController@ListRujukanKeluar');
    $router->get('/rujukan/keluar/{noRujukan}', 'RujukanController@DataRujukanKeluarByNoRujukan');
    $router->get('/rujukan/jmlSep/{jnsRujukan}/{noRujukan}', 'RujukanController@DataJmlSepRujukan');

    // --------------------- Monitoring ----------------------------//
    $router->get('/monitoring/kunjungan/tanggal/{tglSep}/jnspelayanan/{jnsPel}', 'MonitoringController@Kunjungan');
    $router->get('/monitoring/klaim/tanggal/{tglPulang}/jnspelayanan/{jnsPel}/status/{status}', 'MonitoringController@Klaim');
    $router->get('/monitoring/historipelayanan/nokartu/{noKartu}/tglawal/{tglAwal}/tglakhir/{tglAkhir}', 'MonitoringController@History');
    $router->get('/monitoring/jasaraharja/jnsLayan/{jnsLayanan}/tglawal/{tglAwal}/tglakhir/{tglAkhir}', 'MonitoringController@JasaRaharja');

    // ---------------------- SEP ---------------------------------------//
    $router->get('/sep/{noSep}', 'SepController@CariSep');
    $router->post('/sep/versi1/insert', 'SepController@InsertSep');
    $router->put('/sep/versi1/update', 'SepController@UpdateSep');
    $router->delete('/sep/versi1/delete', 'SepController@DeleteSep');

    $router->post('/sep/versi2/insert', 'SepController@InsertSepV2');
    $router->put('/sep/versi2/update', 'SepController@UpdateSepV2');
    $router->delete('/sep/versi2/delete', 'SepController@DeleteSepV2');

    $router->get('/sep/jasaraharja/suplesi/{noKartu}/tglpelayanan/{tglPel}', 'SepController@SupJasaRaharja');
    $router->get('/sep/kllinduk/list/{noKartu}', 'SepController@DataIndukKecelakaan');

    $router->post('/sep/pengajuansep', 'SepController@Pengajuan');
    $router->post('/sep/aprovalsep', 'SepController@Approval');
    $router->get('/sep/persetujuan/list/bulan/{bulan}/tahun/{tahun}', 'SepController@ListPersetujuanSEP');

    $router->put('/sep/updatetglpulang', 'SepController@UpdateTglPulang');
    $router->put('/sep/updatetglpulangv2', 'SepController@UpdateTglPulangv2');
    $router->get('/sep/dataupdate/{bulan}/{tahun}', 'SepController@ListDataUpdPersetujuanPulang');

    $router->get('/sep/cbg/{noSep}', 'SepController@IntegrasiInacbg');

    $router->get('/sep/internal/{noSep}', 'SepController@DataSepInternal');
    $router->delete('/sep/internal/delete', 'SepController@DeleteSepInternal');

    $router->get('/sep/fingerprint/{noKartu}/{tglLayanan}', 'SepController@GetFingerPrint');
    $router->get('/sep/fingerprint/list/{tglLayanan}', 'SepController@GetListFingerPrint');


    $router->get('/sep/fingerprint/randomquestion/{noKartu}/{tglSep}', 'SepController@GetRandomQuestion');
    $router->post('/sep/fingerprint/randomanswer', 'SepController@PostRandomQuestion');


    // ---------------------- RENCANA KONTROL SEP ---------------------------------//
    $router->get('/rencanakontrol/nosep/{noSep}', 'RencanaKontrolController@KontrolCariSep');
    $router->get('/rencanakontrol/nosuratkontrol/{noSurat}', 'RencanaKontrolController@KontrolCariSurat');

    $router->post('/rencanakontrol/insert', 'RencanaKontrolController@InsertRencanaKontrol');
    $router->put('/rencanakontrol/update', 'RencanaKontrolController@UpdateRencanaKontrol');
    $router->delete('/rencanakontrol/delete', 'RencanaKontrolController@DeleteRencanaKontrol');

    $router->post('/rencanakontrol/insertspri', 'RencanaKontrolController@InsertRencanaKontrolSpri');
    $router->put('/rencanakontrol/updatespri', 'RencanaKontrolController@UpdateRencanaKontrolSpri');

    $router->get('/rencanakontrol/list/tglawal/{tglAwal}/tglakhir/{tglAkhir}/filter/{formatFilter}', 'RencanaKontrolController@DataNoSuratKontrol');
    $router->get('/rencanakontrol/list/jns/{jenisKontrol}/nomor/{nomor}/tgl/{tgl}', 'RencanaKontrolController@DataPoliSpesialistik');
    $router->get('/rencanakontrol/jadwal/jns/{jenisKontrol}/kdpoli/{kodePoli}/tgl/{tgl}', 'RencanaKontrolController@DataDokter');
    $router->get('/rencanakontrol/list/bulan/{bulan}/tahun/{tahun}/nokartu/{nokartu}/filter/{formatFilter}', 'RencanaKontrolController@DataNoSuratKontrolNoKartu');

    // -------------------------- Pembuatan Rujuk Balik ------------------------//
    $router->get('/prb/nosrb/{noSrb}/nosep/{noSep}', 'PembuatanRujukBalik@CariSrb');
    $router->get('/prb/tglawal/{tglAwal}/tglakhir/{tglAkhir}', 'PembuatanRujukBalik@TanggalSrb');

    $router->post('/prb/insert', 'PembuatanRujukBalik@InsertPrb');
    $router->put('/prb/update', 'PembuatanRujukBalik@UpdatePrb');
    $router->delete('/prb/delete', 'PembuatanRujukBalik@DeletePrb');

    // ------------------------- LEMBAR PENGAJUAN KLAIM -------------------------//
    $router->get('/lpk/tgl/{tgl}/jenispelayanan/{jenisPelayanan}', 'LembarPengajuanKlaim@DataLpk');

    $router->post('/lpk/insert', 'LembarPengajuanKlaim@InsertLpk');
    $router->put('/lpk/update', 'LembarPengajuanKlaim@UpdateLpk');
    $router->delete('/lpk/delete', 'LembarPengajuanKlaim@DeleteLpk');

    $router->get('/dokter', 'SepController@Dokter');

    $router->get('/poli', 'SepController@Poli');
});




// ----------------- API BRIDGING BANK JATENG
$router->group(['namespace'  => 'ApiBankJateng', 'middleware' => 'bankjateng'], function () use ($router) {
    $router->post('/tagihan/pasien', 'TagihanController@getTagihanPasien');
    $router->post('/tagihan/bayartagihan', 'BankJatengController@bayarTagihan');
});
