Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/khaki-months-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ssecd/jkn': patch
---

Encode string params
6 changes: 3 additions & 3 deletions src/antrean-fktp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class AntreanFKTP extends BaseApi<'pcare'> {
* Melihat referensi poli berdasarkan tanggal pelayanan
*/
async refPoli(params: {
/** tanggal pelayanan */
/** tanggal pelayanan format YYYY-MM-DD */
tanggal: string;
}) {
return this.send<{
Expand All @@ -28,7 +28,7 @@ export class AntreanFKTP extends BaseApi<'pcare'> {
* Melihat data dokter berdasarkan tanggal pelayanan dan poli
*/
async refDokter(params: {
/** tanggal pelayanan */
/** tanggal pelayanan format YYYY-MM-DD */
tanggal: string;

/** kode poli dari referensi poli */
Expand All @@ -43,7 +43,7 @@ export class AntreanFKTP extends BaseApi<'pcare'> {
}[];
}>({
name: this.name + 'Referensi Dokter',
path: `/ref/dokter/kodepoli/${params.kodePoli}/tanggal/${params.tanggal}`,
path: `/ref/dokter/kodepoli/${encodeURIComponent(params.kodePoli)}/tanggal/${params.tanggal}`,
method: 'GET'
});
}
Expand Down
9 changes: 4 additions & 5 deletions src/antrean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Antrean extends BaseApi<'antrean'> {
}[]
>({
name: 'Referensi Jadwal Dokter',
path: `/jadwaldokter/kodepoli/${params.poli}/tanggal/${params.tanggal}`,
path: `/jadwaldokter/kodepoli/${encodeURIComponent(params.poli)}/tanggal/${params.tanggal}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -103,7 +103,7 @@ export class Antrean extends BaseApi<'antrean'> {
daftarfp: number;
}>({
name: 'Referensi Pasien Fingerprint',
path: `/ref/pasien/fp/identitas/${params.jenis}/noidentitas/${params.nomor}`,
path: `/ref/pasien/fp/identitas/${encodeURIComponent(params.jenis)}/noidentitas/${params.nomor}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -451,10 +451,9 @@ export class Antrean extends BaseApi<'antrean'> {
* @param kodeBooking kode booking yang didapat dari servis tambah antrean
*/
async perKodeBooking(kodeBooking: string) {
// TODO: encode kodeBooking param
return this.send<AntreanDetail[]>({
name: 'Antrean Per-KodeBooking',
path: `/antrean/pendaftaran/kodebooking/${kodeBooking}`,
path: `/antrean/pendaftaran/kodebooking/${encodeURIComponent(kodeBooking)}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -488,7 +487,7 @@ export class Antrean extends BaseApi<'antrean'> {
}) {
return this.send<AntreanDetail[]>({
name: 'Antrean Belum Dilayani Per-(Poli, Dokter, Hari, dan Jam Praktik)',
path: `/antrean/pendaftaran/kodepoli/${params.poli}/kodedokter/${params.dokter}/hari/${params.hari}/jampraktek/${params.jam}`,
path: `/antrean/pendaftaran/kodepoli/${encodeURIComponent(params.poli)}/kodedokter/${encodeURIComponent(params.dokter)}/hari/${params.hari}/jampraktek/${params.jam}`,
method: 'GET'
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/aplicares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class Aplicares extends BaseApi<'aplicares'> {
const { ppkCode } = await this.requiredConfig('ppkCode');
return this.send({
name: 'Update Ketersediaan Tempat Tidur',
path: `/rest/bed/update/${ppkCode}`,
path: `/rest/bed/update/${encodeURIComponent(ppkCode)}`,
method: 'POST',
skipContentTypeHack: true,
headers: { 'Content-Type': 'application/json' },
Expand All @@ -55,7 +55,7 @@ export class Aplicares extends BaseApi<'aplicares'> {
const { ppkCode } = await this.requiredConfig('ppkCode');
return this.send<undefined>({
name: 'Ruangan Baru',
path: `/rest/bed/create/${ppkCode}`,
path: `/rest/bed/create/${encodeURIComponent(ppkCode)}`,
method: 'POST',
skipContentTypeHack: true,
headers: { 'Content-Type': 'application/json' },
Expand Down Expand Up @@ -89,7 +89,7 @@ export class Aplicares extends BaseApi<'aplicares'> {
{ totalitems: number }
>({
name: 'Ketersediaan Kamar Faskes',
path: `/rest/bed/read/${ppkCode}/${params.start}/${params.limit}`,
path: `/rest/bed/read/${encodeURIComponent(ppkCode)}/${params.start}/${params.limit}`,
method: 'GET',
skipDecrypt: true
});
Expand All @@ -108,7 +108,7 @@ export class Aplicares extends BaseApi<'aplicares'> {
const { ppkCode } = await this.requiredConfig('ppkCode');
return this.send<undefined>({
name: 'Hapus Ruangan',
path: `/rest/bed/delete/${ppkCode}`,
path: `/rest/bed/delete/${encodeURIComponent(ppkCode)}`,
method: 'POST',
skipContentTypeHack: true,
headers: { 'Content-Type': 'application/json' },
Expand Down
4 changes: 2 additions & 2 deletions src/apotek/pelayanan-obat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class PelayananObat extends ApotekBaseApi {
};
}>({
name: this.name + 'List/Daftar',
path: `/pelayanan/obat/daftar/${params.nomorSep}`,
path: `/pelayanan/obat/daftar/${encodeURIComponent(params.nomorSep)}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -88,7 +88,7 @@ export class PelayananObat extends ApotekBaseApi {
};
}>({
name: this.name + 'Riwayat',
path: `/riwayatobat/${params.awal}/${params.akhir}/${params.nomorKartu}`,
path: `/riwayatobat/${params.awal}/${params.akhir}/${encodeURIComponent(params.nomorKartu)}`,
method: 'GET'
});
}
Expand Down
10 changes: 5 additions & 5 deletions src/apotek/referensi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Referensi extends ApotekBaseApi {
}[];
}>({
name: this.name + 'Poli',
path: `/referensi/poli/${params.keyword}`,
path: `/referensi/poli/${encodeURIComponent(params.keyword)}`,
method: 'GET'
});
}
Expand All @@ -64,7 +64,7 @@ export class Referensi extends ApotekBaseApi {
}[];
}>({
name: this.name + 'Fasilitas Kesehatan',
path: `/referensi/ppk/${params.jenis}/${params.nama}`,
path: `/referensi/ppk/${params.jenis}/${encodeURIComponent(params.nama)}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -92,7 +92,7 @@ export class Referensi extends ApotekBaseApi {
checkstock: 'True' | 'False';
}>({
name: this.name + 'Setting',
path: `/referensi/settingppk/read/${params.kodeApotek}`,
path: `/referensi/settingppk/read/${encodeURIComponent(params.kodeApotek)}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -126,7 +126,7 @@ export class Referensi extends ApotekBaseApi {
/** filter nama obat */
filter?: string;
}) {
const filter = param.filter ?? '';
const filter = encodeURIComponent(param.filter ?? '');
return this.send<{
list: {
kode: string;
Expand All @@ -135,7 +135,7 @@ export class Referensi extends ApotekBaseApi {
}[];
}>({
name: this.name + 'Cari Obat',
path: `/referensi/obat/${param.jenis}/${param.tanggal}/${filter}`,
path: `/referensi/obat/${encodeURIComponent(param.jenis)}/${param.tanggal}/${filter}`,
method: 'GET'
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/apotek/sep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class SEP extends ApotekBaseApi {
namadokter: string | null;
}>({
name: this.name + 'Cari No. Kunjungan/SEP',
path: `/sep/${params.nomorSep}`,
path: `/sep/${encodeURIComponent(params.nomorSep)}`,
method: 'GET'
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/vclaim/monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class Monitoring extends VClaimBaseApi {
}[];
}>({
name: this.name + 'Data Histori Pelayanan Peserta',
path: `/monitoring/HistoriPelayanan/NoKartu/${params.nomorKartu}/tglMulai/${params.awal}/tglAkhir/${params.akhir}`,
path: `/monitoring/HistoriPelayanan/NoKartu/${encodeURIComponent(params.nomorKartu)}/tglMulai/${params.awal}/tglAkhir/${params.akhir}`,
method: 'GET'
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/vclaim/peserta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Peserta extends VClaimBaseApi {
}) {
return this.send<{ peserta: DataPeserta }>({
name: this.name + 'No. Kartu BPJS',
path: `/Peserta/nokartu/${params.nomor}/tglSEP/${params.tanggal}`,
path: `/Peserta/nokartu/${encodeURIComponent(params.nomor)}/tglSEP/${params.tanggal}`,
method: 'GET'
});
}
Expand All @@ -30,7 +30,7 @@ export class Peserta extends VClaimBaseApi {
}) {
return this.send<{ peserta: DataPeserta }>({
name: this.name + 'NIK',
path: `/Peserta/nik/${params.nomor}/tglSEP/${params.tanggal}`,
path: `/Peserta/nik/${encodeURIComponent(params.nomor)}/tglSEP/${params.tanggal}`,
method: 'GET'
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/vclaim/prb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class PRB extends VClaimBaseApi {
};
}>({
name: this.name + 'Cari by Nomor SRB',
path: `/prb/${params.nomorSrb}/nosep/${params.nomorSep}`,
path: `/prb/${encodeURIComponent(params.nomorSrb)}/nosep/${encodeURIComponent(params.nomorSep)}`,
method: 'GET'
});
}
Expand Down
18 changes: 9 additions & 9 deletions src/vclaim/referensi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ diagnosa: ReferensiResult[] }>({
name: this.name + 'Diagnosa',
path: `/referensi/diagnosa/${params.keyword}`,
path: `/referensi/diagnosa/${encodeURIComponent(params.keyword)}`,
method: 'GET'
});
}
Expand All @@ -24,7 +24,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ poli: ReferensiResult[] }>({
name: this.name + 'Poli',
path: `/referensi/poli/${params.keyword}`,
path: `/referensi/poli/${encodeURIComponent(params.keyword)}`,
method: 'GET'
});
}
Expand All @@ -41,7 +41,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ faskes: ReferensiResult[] }>({
name: this.name + 'Fasilitas Kesehatan',
path: `/referensi/faskes/${params.keyword}/${params.jenis}`,
path: `/referensi/faskes/${encodeURIComponent(params.keyword)}/${params.jenis}`,
method: 'GET'
});
}
Expand All @@ -61,7 +61,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ list: ReferensiResult[] }>({
name: this.name + 'DPJP',
path: `/referensi/dokter/pelayanan/${params.jenis}/tglPelayanan/${params.tanggal}/Spesialis/${params.kode}`,
path: `/referensi/dokter/pelayanan/${params.jenis}/tglPelayanan/${params.tanggal}/Spesialis/${encodeURIComponent(params.kode)}`,
method: 'GET'
});
}
Expand All @@ -86,7 +86,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ list: ReferensiResult[] }>({
name: this.name + 'Kabupaten',
path: `/referensi/kabupaten/propinsi/${params.provinsi}`,
path: `/referensi/kabupaten/propinsi/${encodeURIComponent(params.provinsi)}`,
method: 'GET'
});
}
Expand All @@ -100,7 +100,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ list: ReferensiResult[] }>({
name: this.name + 'Kecamatan',
path: `/referensi/kecamatan/kabupaten/${params.kabupaten}`,
path: `/referensi/kecamatan/kabupaten/${encodeURIComponent(params.kabupaten)}`,
method: 'GET'
});
}
Expand All @@ -125,7 +125,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ list: ReferensiResult[] }>({
name: this.name + 'Obat Generik PRB',
path: `/referensi/obatprb/${params.nama}`,
path: `/referensi/obatprb/${encodeURIComponent(params.nama)}`,
method: 'GET'
});
}
Expand All @@ -139,7 +139,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ procedure: ReferensiResult[] }>({
name: this.name + 'Prosedur (Pengajuan Klaim)',
path: `/referensi/procedure/${params.keyword}`,
path: `/referensi/procedure/${encodeURIComponent(params.keyword)}`,
method: 'GET'
});
}
Expand All @@ -164,7 +164,7 @@ export class Referensi extends VClaimBaseApi {
}) {
return this.send<{ list: ReferensiResult[] }>({
name: this.name + 'Dokter (Pengajuan Klaim)',
path: `/referensi/dokter/${params.nama}`,
path: `/referensi/dokter/${encodeURIComponent(params.nama)}`,
method: 'GET'
});
}
Expand Down
10 changes: 5 additions & 5 deletions src/vclaim/rencana-kontrol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class RencanaKontrol extends VClaimBaseApi {
};
}>({
name: this.name + 'Cari SEP',
path: `/RencanaKontrol/nosep/${params.nomor}`,
path: `/RencanaKontrol/nosep/${encodeURIComponent(params.nomor)}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -266,7 +266,7 @@ export class RencanaKontrol extends VClaimBaseApi {
};
}>({
name: this.name + 'Cari Surat Kontrol',
path: `/RencanaKontrol/noSuratKontrol/${params.nomor}`,
path: `/RencanaKontrol/noSuratKontrol/${encodeURIComponent(params.nomor)}`,
method: 'GET'
});
}
Expand All @@ -290,7 +290,7 @@ export class RencanaKontrol extends VClaimBaseApi {
const bulan = String(params.bulan || 0).padStart(2, '0');
return this.send<{ list: RencanaKontrolListItem[] }>({
name: this.name + 'Data Berdasarkan No. Kartu',
path: `/RencanaKontrol/ListRencanaKontrol/Bulan/${bulan}/Tahun/${params.tahun}/Nokartu/${params.nomorKartu}/filter/${params.filter}`,
path: `/RencanaKontrol/ListRencanaKontrol/Bulan/${bulan}/Tahun/${params.tahun}/Nokartu/${encodeURIComponent(params.nomorKartu)}/filter/${params.filter}`,
method: 'GET'
});
}
Expand Down Expand Up @@ -338,7 +338,7 @@ export class RencanaKontrol extends VClaimBaseApi {
}[];
}>({
name: this.name + 'Data Poli/Spesialistik',
path: `/RencanaKontrol/ListSpesialistik/JnsKontrol/${params.jenis}/nomor/${params.nomor}/TglRencanaKontrol/${params.tanggal}`,
path: `/RencanaKontrol/ListSpesialistik/JnsKontrol/${params.jenis}/nomor/${encodeURIComponent(params.nomor)}/TglRencanaKontrol/${params.tanggal}`,
method: 'GET'
});
}
Expand All @@ -365,7 +365,7 @@ export class RencanaKontrol extends VClaimBaseApi {
}[];
}>({
name: this.name + 'Data Dokter',
path: `/RencanaKontrol/JadwalPraktekDokter/JnsKontrol/${params.jenis}/KdPoli/${params.kodePoli}/TglRencanaKontrol/${params.tanggal}`,
path: `/RencanaKontrol/JadwalPraktekDokter/JnsKontrol/${params.jenis}/KdPoli/${encodeURIComponent(params.kodePoli)}/TglRencanaKontrol/${params.tanggal}`,
method: 'GET'
});
}
Expand Down
Loading