diff --git a/app/services/vclaim-control-letter.service.ts b/app/services/vclaim-control-letter.service.ts index 2c638c2e..5ab16811 100644 --- a/app/services/vclaim-control-letter.service.ts +++ b/app/services/vclaim-control-letter.service.ts @@ -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) -} \ No newline at end of file +} + +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) +} diff --git a/app/services/vclaim-diagnose-referral.service.ts b/app/services/vclaim-diagnose-referral.service.ts index 34b94780..105475a3 100644 --- a/app/services/vclaim-diagnose-referral.service.ts +++ b/app/services/vclaim-diagnose-referral.service.ts @@ -1,9 +1,12 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/diagnose-prb' +const path = '/api/v1/reference/diagnose-prb' +const pathOld = '/api/vclaim/v1/reference/diagnose-prb' const name = 'diagnose-referral' export function getList(params: any = null) { - return base.getList(path, params, name) + const isNew = true + const url = !isNew ? pathOld : path + return base.getList(url, params, name) } diff --git a/app/services/vclaim-diagnose.service.ts b/app/services/vclaim-diagnose.service.ts index a676f516..3fbb36e5 100644 --- a/app/services/vclaim-diagnose.service.ts +++ b/app/services/vclaim-diagnose.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/diagnose' +const path = '/api/v1/reference/diagnose' +const pathOld = '/api/vclaim/v1/reference/diagnose' const name = 'diagnose' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params && params?.diagnosa) { url += `/${params.diagnosa}` delete params.diagnosa diff --git a/app/services/vclaim-doctor.service.ts b/app/services/vclaim-doctor.service.ts index 0d5ec9dc..7ebc05ed 100644 --- a/app/services/vclaim-doctor.service.ts +++ b/app/services/vclaim-doctor.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/responsible-doctor' +const path = '/api/v1/reference/responsible-doctor' +const pathOld = '/api/vclaim/v1/reference/responsible-doctor' const name = 'responsible-doctor' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.serviceType) { url += `/${params.serviceType}` delete params.serviceType diff --git a/app/services/vclaim-healthcare.service.ts b/app/services/vclaim-healthcare.service.ts index 09cc0089..36e81f54 100644 --- a/app/services/vclaim-healthcare.service.ts +++ b/app/services/vclaim-healthcare.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/healthcare' +const path = '/api/v1/reference/healthcare' +const pathOld = '/api/vclaim/v1/reference/healthcare' const name = 'healthcare' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.healthcare) { url += `/${params.healthcare}` delete params.healthcare diff --git a/app/services/vclaim-medicine.service.ts b/app/services/vclaim-medicine.service.ts index 15a42050..1c3de858 100644 --- a/app/services/vclaim-medicine.service.ts +++ b/app/services/vclaim-medicine.service.ts @@ -1,11 +1,14 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/medicine' +const path = '/api/v1/reference/medicine' +const pathOld = '/api/vclaim/v1/reference/medicine' const name = 'medicine' export function getList(params: any = null) { - return base.getList(path, params, name) + const isNew = true + const url = !isNew ? pathOld : path + return base.getList(url, params, name) } export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> { diff --git a/app/services/vclaim-member.service.ts b/app/services/vclaim-member.service.ts index bbe054ec..a0d20b68 100644 --- a/app/services/vclaim-member.service.ts +++ b/app/services/vclaim-member.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/member' +const path = '/api/v1/member' +const pathOld = '/api/vclaim/v1/member' const name = 'member' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.number && params.mode === 'by-identity') { url += `/nik/${params.number}/${params.date}` } diff --git a/app/services/vclaim-monitoring-history.service.ts b/app/services/vclaim-monitoring-history.service.ts index ac9f2113..51f842d9 100644 --- a/app/services/vclaim-monitoring-history.service.ts +++ b/app/services/vclaim-monitoring-history.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/monitoring/hist' +const path = '/api/v1/monitoring/hist' +const pathOld = '/api/vclaim/v1/monitoring/hist' const name = 'monitoring-history' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params && params?.cardNumber) { url += `/${params.cardNumber}/${params.startDate}/${params.endDate}` delete params.cardNumber diff --git a/app/services/vclaim-monitoring-visit.service.ts b/app/services/vclaim-monitoring-visit.service.ts index 6004673e..83bd9cc5 100644 --- a/app/services/vclaim-monitoring-visit.service.ts +++ b/app/services/vclaim-monitoring-visit.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/monitoring/visit' +const path = '/api/v1/monitoring/visit' +const pathOld = '/api/vclaim/v1/monitoring/visit' const name = 'monitoring-visit' export async function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.date && params.serviceType) { url += `/${params.date}/${params.serviceType}` } diff --git a/app/services/vclaim-reference-hospital-letter.service.ts b/app/services/vclaim-reference-hospital-letter.service.ts index 115f6558..9f751618 100644 --- a/app/services/vclaim-reference-hospital-letter.service.ts +++ b/app/services/vclaim-reference-hospital-letter.service.ts @@ -1,11 +1,13 @@ // 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 pathOld = '/api/vclaim-swagger/Rujukan/RS' +const name = 'reference-hospital-letter' // 'rujukan-rumah-sakit' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.letterNumber) { url += `/${params.letterNumber}` } @@ -13,4 +15,4 @@ export function getList(params: any = null) { delete params.letterNumber } return base.getList(url, params, name) -} \ No newline at end of file +} diff --git a/app/services/vclaim-reference-letter.service.ts b/app/services/vclaim-reference-letter.service.ts index 0a721d19..55aa8102 100644 --- a/app/services/vclaim-reference-letter.service.ts +++ b/app/services/vclaim-reference-letter.service.ts @@ -13,4 +13,4 @@ export function getList(params: any = null) { delete params.letterNumber } return base.getList(url, params, name) -} \ No newline at end of file +} diff --git a/app/services/vclaim-region-city.service.ts b/app/services/vclaim-region-city.service.ts index 4ebfca20..3e2e7477 100644 --- a/app/services/vclaim-region-city.service.ts +++ b/app/services/vclaim-region-city.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/regency' +const path = '/api/v1/reference/regency' +const pathOld = '/api/vclaim/v1/reference/regency' const name = 'cities' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.province) { url += `/${params.province}` delete params.province diff --git a/app/services/vclaim-region-district.service.ts b/app/services/vclaim-region-district.service.ts index 0b0585a8..1b051eb1 100644 --- a/app/services/vclaim-region-district.service.ts +++ b/app/services/vclaim-region-district.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/district' +const path = '/api/v1/reference/district' +const pathOld = '/api/vclaim/v1/reference/district' const name = 'districts' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.city) { url += `/${params.city}` delete params.city diff --git a/app/services/vclaim-region-province.service.ts b/app/services/vclaim-region-province.service.ts index 5d58bb26..012983ef 100644 --- a/app/services/vclaim-region-province.service.ts +++ b/app/services/vclaim-region-province.service.ts @@ -1,11 +1,14 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/province' +const path = '/api/v1/reference/province' +const pathOld = '/api/vclaim/v1/reference/province' const name = 'provinces' export function getList(params: any = null) { - return base.getList(path, params, name) + const isNew = true + let url = !isNew ? pathOld : path + return base.getList(url, params, name) } export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> { diff --git a/app/services/vclaim-sep.service.ts b/app/services/vclaim-sep.service.ts index 93224a4a..5a728888 100644 --- a/app/services/vclaim-sep.service.ts +++ b/app/services/vclaim-sep.service.ts @@ -4,7 +4,8 @@ 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 @@ -15,7 +16,8 @@ export function create(data: any) { } 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,11 +26,14 @@ 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}` + const isNew = true + const url = !isNew ? pathOld : path return base.removeCustom(url, payload, name) } diff --git a/app/services/vclaim-unit.service.ts b/app/services/vclaim-unit.service.ts index 970a3f00..363de37d 100644 --- a/app/services/vclaim-unit.service.ts +++ b/app/services/vclaim-unit.service.ts @@ -1,11 +1,13 @@ // Base import * as base from './_crud-base' -const path = '/api/vclaim/v1/reference/unit' +const path = '/api/v1/reference/unit' +const pathOld = '/api/vclaim/v1/reference/unit' const name = 'unit' export function getList(params: any = null) { - let url = path + const isNew = true + let url = !isNew ? pathOld : path if (params?.unitCode) { url += `/${params.unitCode}` delete params.unitCode