diff --git a/.changeset/light-cameras-learn.md b/.changeset/light-cameras-learn.md new file mode 100644 index 0000000..20aca5e --- /dev/null +++ b/.changeset/light-cameras-learn.md @@ -0,0 +1,5 @@ +--- +'@ssecd/jkn': patch +--- + +Update Medical Record API diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b77998..505d40c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ on: - closed permissions: + id-token: write contents: write pull-requests: write @@ -18,8 +19,9 @@ jobs: release: # prevents from running on forks if: > - github.event_name == 'workflow_dispatch' || - (github.event_name == 'pull_request' && github.event.pull_request.merged == true) + (github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request' && github.event.pull_request.merged == true)) + && github.repository == 'ssecd/jkn' runs-on: ubuntu-latest steps: - name: Checkout repo @@ -34,7 +36,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 22.x + node-version: 24.x cache: pnpm - name: Install dependencies @@ -54,4 +56,3 @@ jobs: publish: pnpm release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index f56d26b..608fb73 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ JKN (BPJS) Bridging API untuk NodeJS - ✅ Antrean - ✅ Apotek - ✅ i-Care -- ✅ Rekam Medis _(Experimental types)_ +- ✅ Rekam Medis - 🧩 PCare _([partial](https://github.com/ssecd/jkn/pull/26))_ ## Demo diff --git a/src/fetcher.ts b/src/fetcher.ts index b685f83..1f6d416 100644 --- a/src/fetcher.ts +++ b/src/fetcher.ts @@ -196,7 +196,7 @@ const defaultBaseUrls: Record> = { }, rekamMedis: { development: 'https://apijkn-dev.bpjs-kesehatan.go.id/erekammedis_dev', - production: 'https://apijkn.bpjs-kesehatan.go.id/erekammedis' + production: 'https://apijkn.bpjs-kesehatan.go.id/medicalrecord' } }; diff --git a/src/rekam-medis/types.ts b/src/rekam-medis/types.ts index c7b6f22..cd5a99b 100644 --- a/src/rekam-medis/types.ts +++ b/src/rekam-medis/types.ts @@ -5,7 +5,7 @@ export interface Composition extends Omit { section: { - [key: string]: fhir4.CompositionSection; + [key: string]: Omit & { entry: string }; }; } @@ -54,7 +54,10 @@ export interface Condition extends Omit { +interface Observation extends Omit< + fhir4.Observation, + 'performer' | 'code' | 'interpretation' | 'referenceRange' | 'valueQuantity' +> { performer?: fhir4.Reference; code?: { coding: fhir4.Coding; text: string }; image: { @@ -65,6 +68,9 @@ interface Observation extends Omit { }; }[]; conclusion?: string; + interpretation: Omit & { coding: fhir4.Coding }; + referenceRange: fhir4.ObservationReferenceRange; + valueQuantity: Omit & { value: string }; } export interface DiagnosticReport extends Omit<