Cari atau daftar pasien
q dikenali otomatis: 16 digit → NIK (persis), 13 digit → No. BPJS, 08…/628… → telepon, berisi angka tanpa
spasi → No. RM, selain itu nama (substring lalu kemiripan ejaan). Filter eksplisit boleh digabung. Tanpa q/filter:
pasien terbaru berhalaman cursor; pencarian tidak berhalaman (maks limit). Identitas di daftar selalu tersamar
(*_masked); nilai penuh hanya di detail.
- Scopes
patients:readpatients:write(any one of)- RBAC permissions
- patient.read
- Module
frontoffice
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| q | query | string | NIK, No. BPJS, telepon, No. RM, atau nama |
| nik | query | string | |
| mrn | query | string | |
| name | query | string | |
| phone | query | string | |
| bpjs_no | query | string | |
| birth_date | query | string (date) | |
| include_merged | query | boolean | |
| include_inactive | query | boolean | |
| limit | query | integer | |
| cursor | query | string | Nilai next_cursor dari halaman sebelumnya |
Code examples
curl -X GET "https://api.medivana.cloud/api/v1/patients" \
-H "Authorization: Bearer $MEDIVANA_TOKEN"const res = await fetch("https://api.medivana.cloud/api/v1/patients", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.MEDIVANA_TOKEN}`,
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const data = await res.json();import os
import requests
resp = requests.get(
"https://api.medivana.cloud/api/v1/patients",
headers={"Authorization": f"Bearer {os.environ['MEDIVANA_TOKEN']}"},
timeout=30,
)
resp.raise_for_status()
data = resp.json()Responses
200Daftar pasien (identitas tersamar)application/json
{
"items": [
{
"id": "3f0c2a10-5b7e-4c1d-9a2e-0000000a0001",
"mrn": "RM-000123",
"name": "Pasien Contoh",
"sex": "female",
"birth_date": "1990-05-12",
"age_label": "36 th 5 bl",
"age_years": 36,
"nik_masked": "9999********0001",
"phone_masked": "6281******001",
"bpjs_no_masked": "*********0001",
"allergy_status": "has",
"is_active": true,
"merged_into": null
}
],
"next_cursor": "eyJ0IjoiMjAyNi0xMC0yOVQwODoxNTowMiswNzowMCJ9"
}Schema 200
| Name | Type | Description |
|---|---|---|
| itemsrequired | array<object> | |
| items[].id | string (uuid) | |
| items[].mrn | string | |
| items[].name | string | |
| items[].sex | male | female | |
| items[].birth_date | string (date) | null | |
| items[].age_label | string | |
| items[].age_years | integer | null | |
| items[].nik_masked | string | null | |
| items[].phone_masked | string | null | |
| items[].bpjs_no_masked | string | null | |
| items[].allergy_status | unknown | none | has | |
| items[].is_active | boolean | |
| items[].merged_into | string (uuid) | null | |
| next_cursor | string |
Errors
- 400
bad-requestParameter atau format permintaan tidak valid - 401
unauthorizedToken tidak ada, tidak valid, kedaluwarsa, atau dicabut - 402
module-lockedModul tidak aktif di paket organisasi - 403
forbiddenScope token tidak memberi izin (forbidden), atau langganan klinik baca-saja untuk operasi tulis (read-only) - 429
rate-limitedBatas laju klien (rate_limit_per_min) terlampaui; coba lagi pada menit berikutnya