Merge branch 'dev' into feat/procedure-room-order

This commit is contained in:
Munawwirul Jamal
2025-12-04 12:07:18 +07:00
committed by GitHub
99 changed files with 3246 additions and 836 deletions
+21
View File
@@ -5,6 +5,9 @@ export async function create(path: string, data: any, name: string = 'item') {
const resp = await xfetch(path, 'POST', data)
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
@@ -29,6 +32,9 @@ export async function getList(path: string, params: any = null, name: string = '
const resp = await xfetch(url, 'GET')
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
@@ -53,6 +59,9 @@ export async function getDetail(path: string, id: number | string, name: string
const resp = await xfetch(`${path}/${id}${paramStr}`, 'GET')
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
@@ -66,6 +75,9 @@ export async function update(path: string, id: number | string, data: any, name:
const resp = await xfetch(`${path}/${id}`, 'PATCH', data)
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
@@ -79,6 +91,9 @@ export async function updateCustom(path: string, data: any, name: string = 'item
const resp = await xfetch(`${path}`, 'PATCH', data)
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
@@ -92,6 +107,9 @@ export async function remove(path: string, id: number | string, name: string = '
const resp = await xfetch(`${path}/${id}`, 'DELETE')
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
@@ -105,6 +123,9 @@ export async function removeCustom(path: string, data: any, name: string = 'item
const resp = await xfetch(`${path}`, 'DELETE', data)
const result: any = {}
result.success = resp.success
if (resp.status_code !== 200) {
result.error = { ...resp.error }
}
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
+25
View File
@@ -0,0 +1,25 @@
// Base
import * as base from './_crud-base'
const name = 'antibiotic-in-use'
const path = '/api/v1/' + name
export function create(data: any) {
return base.create(path, data, name)
}
export function getList(params: any = null) {
return base.getList(path, params, name)
}
export function getDetail(id: number | string) {
return base.getDetail(path, id, name)
}
export function update(id: number | string, data: any) {
return base.update(path, id, data, name)
}
export function remove(id: number | string) {
return base.remove(path, id, name)
}
+25
View File
@@ -0,0 +1,25 @@
// Base
import * as base from './_crud-base'
const name = 'antibiotic-src-category'
const path = '/api/v1/' + name
export function create(data: any) {
return base.create(path, data, name)
}
export function getList(params: any = null) {
return base.getList(path, params, name)
}
export function getDetail(id: number | string) {
return base.getDetail(path, id, name)
}
export function update(id: number | string, data: any) {
return base.update(path, id, data, name)
}
export function remove(id: number | string) {
return base.remove(path, id, name)
}
+25
View File
@@ -0,0 +1,25 @@
// Base
import * as base from './_crud-base'
const name = 'antibiotic-src'
const path = '/api/v1/' + name
export function create(data: any) {
return base.create(path, data, name)
}
export function getList(params: any = null) {
return base.getList(path, params, name)
}
export function getDetail(id: number | string) {
return base.getDetail(path, id, name)
}
export function update(id: number | string, data: any) {
return base.update(path, id, data, name)
}
export function remove(id: number | string) {
return base.remove(path, id, name)
}
+13
View File
@@ -22,3 +22,16 @@ export function update(id: number | string, data: any) {
export function remove(id: number | string) {
return base.remove(path, id)
}
export async function submit(id: number) {
try {
const resp = await xfetch(`${path}/${id}/submit`, 'PATCH')
const result: any = {}
result.success = resp.success
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
console.error(`Error submitting ${name}:`, error)
throw new Error(`Failed to submit ${name}`)
}
}
+21 -5
View File
@@ -1,11 +1,12 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim-swagger/RencanaKontrol'
const name = 'rencana-kontrol'
const path = '/api/v1/control-plan'
const pathOld = '/api/v1/rencana-kontrol'
const name = 'control-plan' // 'rencana-kontrol'
export function getList(params: any = null) {
let url = path
export function getListOld(params: any = null) {
let url = pathOld
if (params?.letterNumber && params.mode === 'by-control') {
url += `/noSuratKontrol/${params.letterNumber}`
}
@@ -26,4 +27,19 @@ export function getList(params: any = null) {
delete params.mode
}
return base.getList(url, params, name)
}
}
export function getList(params: any = null) {
let url = path
if (params?.controlDate && params.mode === 'by-schedule') {
url += `/${params.controlType}/${params.polyCode}/${params.controlDate}`
delete params.controlType
delete params.controlDate
delete params.polyCode
}
if (params) {
delete params.letterNumber
delete params.mode
}
return base.getList(url, params, name)
}
@@ -1,9 +1,10 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/diagnose-prb'
const path = '/api/v1/reference/diagnose-prb'
const name = 'diagnose-referral'
export function getList(params: any = null) {
return base.getList(path, params, name)
const url = path
return base.getList(url, params, name)
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/diagnose'
const path = '/api/v1/reference/diagnose'
const name = 'diagnose'
export function getList(params: any = null) {
+1 -1
View File
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/responsible-doctor'
const path = '/api/v1/reference/responsible-doctor'
const name = 'responsible-doctor'
export function getList(params: any = null) {
+1 -1
View File
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/healthcare'
const path = '/api/v1/reference/healthcare'
const name = 'healthcare'
export function getList(params: any = null) {
+3 -2
View File
@@ -1,11 +1,12 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/medicine'
const path = '/api/v1/reference/medicine'
const name = 'medicine'
export function getList(params: any = null) {
return base.getList(path, params, name)
const url = path
return base.getList(url, params, name)
}
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+1 -1
View File
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/member'
const path = '/api/v1/member'
const name = 'member'
export function getList(params: any = null) {
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/monitoring/hist'
const path = '/api/v1/monitoring/hist'
const name = 'monitoring-history'
export function getList(params: any = null) {
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/monitoring/visit'
const path = '/api/v1/monitoring/visit'
const name = 'monitoring-visit'
export async function getList(params: any = null) {
@@ -1,8 +1,8 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim-swagger/Rujukan/RS'
const name = 'rujukan-rumah-sakit'
const path = '/api/v1/referral'
const name = 'reference-hospital-letter' // 'rujukan-rumah-sakit'
export function getList(params: any = null) {
let url = path
@@ -13,4 +13,4 @@ export function getList(params: any = null) {
delete params.letterNumber
}
return base.getList(url, params, name)
}
}
@@ -13,4 +13,4 @@ export function getList(params: any = null) {
delete params.letterNumber
}
return base.getList(url, params, name)
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/regency'
const path = '/api/v1/reference/regency'
const name = 'cities'
export function getList(params: any = null) {
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/district'
const path = '/api/v1/reference/district'
const name = 'districts'
export function getList(params: any = null) {
@@ -1,11 +1,12 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/province'
const path = '/api/v1/reference/province'
const name = 'provinces'
export function getList(params: any = null) {
return base.getList(path, params, name)
const url = path
return base.getList(url, params, name)
}
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+27 -7
View File
@@ -4,18 +4,32 @@ import * as base from './_crud-base'
// Types
import type { IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
const path = '/api/vclaim-swagger/sep'
const path = '/api/v1/vclaim-sep'
const pathOld = '/api/vclaim-swagger/sep'
const name = 'sep'
// TODO: temporary destinationClinic
const destinationClinic = '1323R001'
export function create(data: any) {
return base.create(path, data, name)
const isNew = true
let url = !isNew ? pathOld : path
let payload: any = data
if (isNew && data?.encounterId) {
payload = {
encounter_id: Number(data.encounterId) || 0,
requestPayload: data?.request ? JSON.stringify({ request: data.request }) : null,
}
} else {
url = pathOld
delete payload.encounterId
}
return base.create(url, payload, name)
}
export function getList(params: any = null) {
let url = path
const isNew = true
let url = !isNew ? pathOld : path
if (params?.number) {
url += `/${params.number}`
delete params.number
@@ -24,12 +38,18 @@ export function getList(params: any = null) {
}
export function getDetail(id: number | string) {
return base.getDetail(path, id, name)
const isNew = true
const url = !isNew ? pathOld : path
return base.getDetail(url, id, name)
}
export function remove(payload: any) {
const url = `${path}`
return base.removeCustom(url, payload, name)
export function remove(id: string) {
const url = `${path}/${id}`
return base.removeCustom(url, {}, name)
}
export function removeOld(payload: any) {
return base.removeCustom(pathOld, payload, name)
}
export function makeSepData(
+1 -1
View File
@@ -1,7 +1,7 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/unit'
const path = '/api/v1/reference/unit'
const name = 'unit'
export function getList(params: any = null) {