feat: require hospital code and add company APIs
This commit is contained in:
34
README.md
34
README.md
@@ -7,6 +7,16 @@ GET /api/cpone/paket
|
||||
GET /api/cpone/paket/{id}
|
||||
Authorization: Bearer <your-secure-token>
|
||||
|
||||
GET /api/cpone/layanan?page=1
|
||||
Authorization: Bearer <your-secure-token>
|
||||
X-RS-Code: <kode-rs>
|
||||
|
||||
GET /api/cpone/perusahaan?search=&page=1
|
||||
GET /api/cpone/perusahaan/{id}
|
||||
GET /api/cpone/perusahaan/{id}/group-tarif?group_tarif_id=
|
||||
Authorization: Bearer <your-secure-token>
|
||||
X-RS-Code: <kode-rs>
|
||||
|
||||
GET /api/cpone/tarif-kerjasama?search=&perusahaan_id=&tarif_id=&page=1&per_page=15
|
||||
Authorization: Bearer <your-secure-token>
|
||||
|
||||
@@ -134,14 +144,6 @@ Copy `.env.example` menjadi `.env`, lalu isi koneksi MySQL:
|
||||
```text
|
||||
APP_HOST=0.0.0.0
|
||||
APP_PORT=8080
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=primaya
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
DB_DEFAULT_RS_CODE=AWALBROS_DEV
|
||||
DB_DEFAULT_RS_NAME=RS Dev Awalbros
|
||||
|
||||
CPONE_DB_HOST=127.0.0.1
|
||||
CPONE_DB_PORT=3306
|
||||
CPONE_DB_DATABASE=cpone_middleware
|
||||
@@ -152,9 +154,6 @@ CPONE_DATABASE_SETTINGS_TOKEN=replace-with-a-different-admin-token
|
||||
CPONE_DATABASE_CREDENTIAL_KEY=replace-with-a-long-random-encryption-key
|
||||
```
|
||||
|
||||
`DB_*` tetap menjadi koneksi default (saat ini database dev Awalbros). Request
|
||||
lama yang tidak mengirim kode RS akan tetap menggunakan koneksi ini.
|
||||
|
||||
## Multi-database per kode RS
|
||||
|
||||
Tambahkan atau perbarui koneksi RS melalui API berikut. Koneksi akan dites
|
||||
@@ -185,10 +184,10 @@ GET /api/cpone/database-settings/{kodeRs}
|
||||
```
|
||||
|
||||
Saat startup, service otomatis membuat database `CPONE_DB_DATABASE` beserta
|
||||
tabel `hospitals` dan `hospital_databases`. Koneksi HIS lama dari `DB_*` otomatis
|
||||
menjadi RS default. Akun `CPONE_DB_USERNAME` harus memiliki izin `CREATE
|
||||
DATABASE` pada bootstrap pertama; alternatifnya jalankan migration
|
||||
`database/migrations/001_create_cpone_management.sql` secara manual.
|
||||
tabel `hospitals` dan `hospital_databases`. Tidak ada database RS default; semua
|
||||
koneksi HIS harus ditambahkan lewat API. Akun `CPONE_DB_USERNAME` harus memiliki
|
||||
izin `CREATE DATABASE` pada bootstrap pertama; alternatifnya jalankan migration
|
||||
di direktori `database/migrations` secara manual.
|
||||
|
||||
Response list/detail tidak pernah menampilkan password, hanya field
|
||||
`has_password`. Password koneksi RS disimpan terenkripsi AES-GCM menggunakan
|
||||
@@ -210,8 +209,9 @@ X-RS-Code: PRIMAYA_BEKASI_BARAT
|
||||
|
||||
Sebagai alternatif dapat memakai query `?kode_rs=PRIMAYA_BEKASI_BARAT`.
|
||||
Header memiliki prioritas lebih tinggi daripada query. Response juga memuat
|
||||
header `X-RS-Code` agar koneksi yang terpilih mudah diaudit. Jika keduanya tidak
|
||||
ada, service memakai `DB_DEFAULT_RS_CODE`.
|
||||
header `X-RS-Code` agar koneksi yang terpilih mudah diaudit. Salah satu dari
|
||||
header atau query tersebut wajib dikirim; jika tidak ada, API mengembalikan
|
||||
status `422` dan tidak mengakses database HIS.
|
||||
|
||||
## Run
|
||||
|
||||
|
||||
Reference in New Issue
Block a user