Merge branch 'dev' into feat/org-position-134
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
import type { Doctor } from "~/models/doctor";
|
||||
|
||||
// Types
|
||||
import type { Doctor } from '~/models/doctor'
|
||||
|
||||
const path = '/api/v1/doctor'
|
||||
const name = 'device'
|
||||
const name = 'doctor'
|
||||
|
||||
export function create(data: any) {
|
||||
return base.create(path, data, name)
|
||||
@@ -31,8 +33,8 @@ export async function getValueLabelList(params: any = null): Promise<{ value: st
|
||||
if (result.success) {
|
||||
const resultData = result.body?.data || []
|
||||
data = resultData.map((item: Doctor) => ({
|
||||
value: item.id,
|
||||
label: item.employee.person.name,
|
||||
value: item.id ? String(item.id) : '',
|
||||
label: item.employee?.person?.name || '',
|
||||
}))
|
||||
}
|
||||
return data
|
||||
|
||||
@@ -40,6 +40,22 @@ export async function getPatientDetail(id: number) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getPatientByIdentifier(search: string) {
|
||||
try {
|
||||
const urlPath = search.length === 16 ? `by-resident-identity/search=${encodeURIComponent(search)}` : `/search/${search}`
|
||||
const url = `${mainUrl}/${urlPath}`
|
||||
const resp = await xfetch(url, 'GET')
|
||||
const result: any = {}
|
||||
result.success = resp.success
|
||||
result.body = (resp.body as Record<string, any>) || {}
|
||||
result.type = urlPath.includes('by-resident-identity') ? 'resident-identity' : 'identity'
|
||||
return result
|
||||
} catch (error) {
|
||||
console.error('Error fetching patient by identifier:', error)
|
||||
throw new Error('Failed to get patient by identifier')
|
||||
}
|
||||
}
|
||||
|
||||
export async function postPatient(record: any) {
|
||||
try {
|
||||
const resp = await xfetch(mainUrl, 'POST', record)
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as base from './_crud-base'
|
||||
|
||||
// Types
|
||||
import type { Specialist } from '~/models/specialist'
|
||||
import type { TreeItem } from '~/models/_base'
|
||||
|
||||
const path = '/api/v1/specialist'
|
||||
const name = 'specialist'
|
||||
@@ -40,3 +41,20 @@ export async function getValueLabelList(params: any = null): Promise<{ value: st
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert specialist response to TreeItem[] with subspecialist children
|
||||
* @param specialists Array of specialist objects from API
|
||||
* @returns TreeItem[]
|
||||
*/
|
||||
export function getValueTreeItems(specialists: any[], byCode = true): TreeItem[] {
|
||||
return specialists.map((specialist: Specialist) => ({
|
||||
value: byCode ? String(specialist.code) : String(specialist.id),
|
||||
label: specialist.name,
|
||||
hasChildren: Array.isArray(specialist.subspecialists) && specialist.subspecialists.length > 0,
|
||||
children:
|
||||
Array.isArray(specialist.subspecialists) && specialist.subspecialists.length > 0
|
||||
? getValueTreeItems(specialist.subspecialists)
|
||||
: undefined,
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim-swagger/RencanaKontrol'
|
||||
const name = 'rencana-kontrol'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.letterNumber && params.mode === 'by-control') {
|
||||
url += `/noSuratKontrol/${params.letterNumber}`
|
||||
}
|
||||
if (params?.letterNumber && params.mode === 'by-card') {
|
||||
url += `/noka/${params.letterNumber}`
|
||||
}
|
||||
if (params?.letterNumber && params.mode === 'by-sep') {
|
||||
url += `/${params.letterNumber}`
|
||||
}
|
||||
if (params?.letterNumber && params.mode === 'by-schedule') {
|
||||
url += `/jadwalDokter?jeniskontrol=${params.controlType}&kodepoli=${params.poliCode}&tanggalkontrol=${params.controlDate}`
|
||||
delete params.controlType
|
||||
delete params.poliCode
|
||||
delete params.controlDate
|
||||
}
|
||||
if (params) {
|
||||
delete params.letterNumber
|
||||
delete params.mode
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/diagnose-prb'
|
||||
const name = 'diagnose-referral'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/diagnose'
|
||||
const name = 'diagnose'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params && params?.diagnosa) {
|
||||
url += `/${params.diagnosa}`
|
||||
delete params.diagnosa
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.diagnosa || []
|
||||
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
|
||||
data = resultUnique.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: `${item.kode} - ${item.nama}`,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/responsible-doctor'
|
||||
const name = 'responsible-doctor'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.serviceType) {
|
||||
url += `/${params.serviceType}`
|
||||
delete params.serviceType
|
||||
}
|
||||
if (params?.serviceDate) {
|
||||
url += `/${params.serviceDate}`
|
||||
delete params.serviceDate
|
||||
}
|
||||
if (params?.specialistCode || (Number(params.specialistCode) === 0)) {
|
||||
url += `/${params.specialistCode}`
|
||||
delete params.specialistCode
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.list || []
|
||||
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
|
||||
data = resultUnique.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: `${item.kode} - ${item.nama}`,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/healthcare'
|
||||
const name = 'healthcare'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.healthcare) {
|
||||
url += `/${params.healthcare}`
|
||||
delete params.healthcare
|
||||
}
|
||||
if (params?.healthcareType) {
|
||||
url += `/${params.healthcareType}`
|
||||
delete params.healthcareType
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.faskes || []
|
||||
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
|
||||
data = resultUnique.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: `${item.kode} - ${item.nama}`,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/medicine'
|
||||
const name = 'medicine'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.list || []
|
||||
data = resultData.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: item.nama,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/member'
|
||||
const name = 'member'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.number && params.mode === 'by-identity') {
|
||||
url += `/nik/${params.number}/${params.date}`
|
||||
}
|
||||
if (params?.number && params.mode === 'by-card') {
|
||||
url += `/bpjs/${params.number}/${params.date}`
|
||||
}
|
||||
if (params) {
|
||||
delete params.number
|
||||
delete params.mode
|
||||
delete params.date
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/monitoring/hist'
|
||||
const name = 'monitoring-history'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params && params?.cardNumber) {
|
||||
url += `/${params.cardNumber}/${params.startDate}/${params.endDate}`
|
||||
delete params.cardNumber
|
||||
delete params.startDate
|
||||
delete params.endDate
|
||||
}
|
||||
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/monitoring/visit'
|
||||
const name = 'monitoring-visit'
|
||||
|
||||
const dummyResponse = {
|
||||
metaData: {
|
||||
code: '200',
|
||||
message: 'Sukses',
|
||||
},
|
||||
response: {
|
||||
sep: [
|
||||
{
|
||||
diagnosa: 'K65.0',
|
||||
jnsPelayanan: 'R.Inap',
|
||||
kelasRawat: '2',
|
||||
nama: 'HANIF ABDURRAHMAN',
|
||||
noKartu: '0001819122189',
|
||||
noSep: '0301R00110170000004',
|
||||
noRujukan: '0301U01108180200084',
|
||||
poli: null,
|
||||
tglPlgSep: '2017-10-03',
|
||||
tglSep: '2017-10-01',
|
||||
},
|
||||
{
|
||||
diagnosa: 'I50.0',
|
||||
jnsPelayanan: 'R.Inap',
|
||||
kelasRawat: '3',
|
||||
nama: 'ASRIZAL',
|
||||
noKartu: '0002283324674',
|
||||
noSep: '0301R00110170000005',
|
||||
noRujukan: '0301U01108180200184',
|
||||
poli: null,
|
||||
tglPlgSep: '2017-10-10',
|
||||
tglSep: '2017-10-01',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
export async function getList(params: any = null) {
|
||||
try {
|
||||
let url = path
|
||||
if (params?.date && params.serviceType) {
|
||||
url += `/${params.date}/${params.serviceType}`
|
||||
}
|
||||
if (params) {
|
||||
delete params.date
|
||||
delete params.serviceType
|
||||
}
|
||||
const resp = await base.getList(url, params, name)
|
||||
|
||||
// Jika success false, return dummy response
|
||||
if (!resp.success || !resp.body?.response) {
|
||||
return {
|
||||
success: true,
|
||||
body: dummyResponse,
|
||||
}
|
||||
}
|
||||
|
||||
return resp
|
||||
} catch (error) {
|
||||
// Jika terjadi error, return dummy response
|
||||
console.error(`Error fetching ${name}s:`, error)
|
||||
return {
|
||||
success: true,
|
||||
body: dummyResponse,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim-swagger/Rujukan/RS'
|
||||
const name = 'rujukan-rumah-sakit'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.letterNumber) {
|
||||
url += `/${params.letterNumber}`
|
||||
}
|
||||
if (params) {
|
||||
delete params.letterNumber
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim-swagger/RujukanKhusus'
|
||||
const name = 'rujukan-khusus'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.letterNumber) {
|
||||
url += `?noRujukan=${params.letterNumber}`
|
||||
}
|
||||
if (params) {
|
||||
delete params.letterNumber
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/regency'
|
||||
const name = 'cities'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.province) {
|
||||
url += `/${params.province}`
|
||||
delete params.province
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.list || []
|
||||
data = resultData.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: item.nama,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/district'
|
||||
const name = 'districts'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.city) {
|
||||
url += `/${params.city}`
|
||||
delete params.city
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.list || []
|
||||
data = resultData.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: item.nama,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/province'
|
||||
const name = 'provinces'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.list || []
|
||||
data = resultData.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: item.nama,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
// Types
|
||||
import type { IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
||||
|
||||
const path = '/api/vclaim-swagger/sep'
|
||||
const name = 'sep'
|
||||
|
||||
export function create(data: any) {
|
||||
return base.create(path, data, name)
|
||||
}
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.number) {
|
||||
url += `/${params.number}`
|
||||
delete params.number
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export function makeSepData(
|
||||
data: IntegrationBpjsFormData & {
|
||||
referralFrom?: string
|
||||
referralTo?: string
|
||||
referralLetterDate?: string
|
||||
referralLetterNumber?: string
|
||||
},
|
||||
) {
|
||||
const content = {
|
||||
noKartu: data.cardNumber || '',
|
||||
tglSep: data.sepDate,
|
||||
ppkPelayanan: data.fromClinic || '',
|
||||
jnsPelayanan: data.admissionType ? String(data.admissionType) : '1',
|
||||
noMR: data.medicalRecordNumber || '',
|
||||
catatan: data.note || '',
|
||||
diagAwal: data.initialDiagnosis || '',
|
||||
poli: {
|
||||
tujuan: data.destinationClinic || '',
|
||||
eksekutif: data.clinicExcecutive === 'yes' ? '1' : '0',
|
||||
},
|
||||
cob: {
|
||||
cob: data.cob === 'yes' ? '1' : '0',
|
||||
},
|
||||
katarak: {
|
||||
katarak: data.cataract === 'yes' ? '1' : '0',
|
||||
},
|
||||
tujuanKunj: data.purposeOfVisit || '',
|
||||
flagProcedure: data.procedureType || '',
|
||||
kdPenunjang: data.supportCode || '',
|
||||
assesmentPel: data.serviceAssessment || '',
|
||||
skdp: {
|
||||
noSurat: ['3'].includes(data.admissionType) ? data.referralLetterNumber : '',
|
||||
kodeDPJP: ['3'].includes(data.admissionType)? data.attendingDoctor : '',
|
||||
},
|
||||
rujukan: {
|
||||
asalRujukan: ['2'].includes(data.admissionType) ? data?.referralFrom || '' : '',
|
||||
tglRujukan: ['2'].includes(data.admissionType) ? data?.referralLetterDate || '' : '',
|
||||
noRujukan: ['2'].includes(data.admissionType) ? data?.referralLetterNumber || '' : '',
|
||||
ppkRujukan: ['2'].includes(data.admissionType) ? data?.referralTo || '' : '',
|
||||
},
|
||||
klsRawat: {
|
||||
klsRawatHak: data.classLevel || '',
|
||||
klsRawatNaik: data.classLevelUpgrade || '',
|
||||
pembiayaan: data.classPaySource || '',
|
||||
penanggungJawab: data.responsiblePerson || '',
|
||||
},
|
||||
dpjpLayan: data.attendingDoctor || '',
|
||||
noTelp: data.phoneNumber || '',
|
||||
user: data.patientName || '',
|
||||
jaminan: {
|
||||
lakaLantas: data.trafficAccident || '0',
|
||||
noLP: data.lpNumber || '',
|
||||
penjamin: {
|
||||
tglKejadian: data.accidentDate || '',
|
||||
keterangan: data.accidentNote || '',
|
||||
suplesi: {
|
||||
suplesi: data.suplesi === 'yes' ? '1' : '0',
|
||||
noSepSuplesi: data.suplesiNumber || '',
|
||||
lokasiLaka: {
|
||||
kdPropinsi: data.accidentProvince || '',
|
||||
kdKabupaten: data.accidentCity || '',
|
||||
kdKecamatan: data.accidentDistrict || '',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
return {
|
||||
request: {
|
||||
t_sep: content,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/v1/reference/unit'
|
||||
const name = 'unit'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params?.unitCode) {
|
||||
url += `/${params.unitCode}`
|
||||
delete params.unitCode
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||
let data: { value: string; label: string }[] = []
|
||||
const result = await getList(params)
|
||||
if (result.success) {
|
||||
const resultData = result.body?.response?.faskes || []
|
||||
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
|
||||
data = resultUnique.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: `${item.kode} - ${item.nama}`,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user