-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init * update doc * define individual icare user key * add note about icare user key * explicitly set content-type * fix i care response type * clarify test * fix type * clarify icare user key doc * add changeset
- Loading branch information
1 parent
66f9f9a
commit 5e48a47
Showing
8 changed files
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@ssecd/jkn': minor | ||
--- | ||
|
||
implement i-care service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { BaseApi } from './base.js'; | ||
|
||
export class ICare extends BaseApi<'icare'> { | ||
protected type = 'icare' as const; | ||
|
||
async fkrtl(data: { | ||
/** Nomor kartu peserta */ | ||
param: string; | ||
|
||
/** Kode dokter */ | ||
kodedokter: number; | ||
}) { | ||
return this.send<{ url: string }>({ | ||
path: `/api/rs/validate`, | ||
method: 'POST', | ||
skipContentTypeHack: true, | ||
headers: { 'Content-Type': 'Application/json' }, | ||
data | ||
}); | ||
} | ||
|
||
async fktp(data: { | ||
/** Nomor kartu peserta */ | ||
param: string; | ||
}) { | ||
return this.send<{ url: string }>({ | ||
path: `/api/pcare/validate`, | ||
method: 'POST', | ||
skipContentTypeHack: true, | ||
headers: { 'Content-Type': 'Application/json' }, | ||
data | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
import jkn from './jkn'; | ||
|
||
describe( | ||
'ICare', | ||
() => { | ||
it.concurrent('fkrtl()', async () => { | ||
const result = await jkn.icare.fkrtl({ | ||
param: '0002084717968', | ||
kodedokter: 292667 | ||
}); | ||
expect(result.metaData.code).toBe(200); | ||
expect(result.response?.url).not.toBeFalsy(); | ||
expect(result.response?.url).contains('?token='); | ||
}); | ||
|
||
it.concurrent('fktp()', async () => { | ||
const result = await jkn.icare.fktp({ | ||
param: '0002084717968' | ||
}); | ||
expect(result.metaData.code).toBe(200); | ||
expect(result.response?.url).not.toBeFalsy(); | ||
}); | ||
}, | ||
{ timeout: 25_000 } | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ hapusresep | |
HEMODIALISA | ||
HFIS | ||
Histori | ||
icare | ||
ICCU | ||
IDUSERSJP | ||
Inacbg | ||
|