feat(sep): testing create sep
This commit is contained in:
@@ -893,6 +893,8 @@ onMounted(() => {
|
||||
</Cell>
|
||||
</Block>
|
||||
|
||||
<!-- {{ JSON.stringify(errors, null, 2) }} -->
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="mt-6 flex justify-end gap-2">
|
||||
<Button
|
||||
|
||||
@@ -274,8 +274,9 @@ async function handleEvent(menu: string, value: any) {
|
||||
isSaveLoading.value = true
|
||||
createSep(makeSepData(value))
|
||||
.then((res) => {
|
||||
const code = res?.metaData?.code
|
||||
const message = res?.metaData?.message
|
||||
const body = res?.body
|
||||
const code = body?.metaData?.code
|
||||
const message = body?.metaData?.message
|
||||
if (code && code !== '200') {
|
||||
toast({ title: 'Gagal', description: message || 'Gagal membuat SEP', variant: 'destructive' })
|
||||
return
|
||||
|
||||
@@ -123,111 +123,111 @@ const IntegrationBpjsSchema = z
|
||||
classPaySource: z.string({ required_error: ERROR_MESSAGES.required.classPaySource }).optional(),
|
||||
responsiblePerson: z.string({ required_error: ERROR_MESSAGES.required.responsiblePerson }).optional(),
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.trafficAccident !== '' && data.accidentDate && data.accidentDate.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.accidentDate,
|
||||
path: ['accidentDate'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.trafficAccident !== '' && data.accidentProvince && data.accidentProvince.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.accidentProvince,
|
||||
path: ['accidentProvince'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.trafficAccident !== '' && data.accidentCity && data.accidentCity.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.accidentCity,
|
||||
path: ['accidentCity'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.trafficAccident !== '' && data.accidentDistrict && data.accidentDistrict.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.accidentDistrict,
|
||||
path: ['accidentDistrict'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.trafficAccident !== '' && data.suplesi && data.suplesi.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.suplesi,
|
||||
path: ['suplesi'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return (
|
||||
data.trafficAccident !== '' &&
|
||||
data.suplesi?.trim() === 'yes' &&
|
||||
data.suplesiNumber &&
|
||||
data.suplesiNumber.trim() !== ''
|
||||
)
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.suplesiNumber,
|
||||
path: ['suplesiNumber'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.serviceType === '1' && data.classLevel && data.classLevel.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.classLevel,
|
||||
path: ['classLevel'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return data.serviceType === '1' && data.classLevelUpgrade && data.classLevelUpgrade.trim() !== ''
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.classLevelUpgrade,
|
||||
path: ['classLevelUpgrade'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return (
|
||||
data.serviceType === '1' &&
|
||||
data.classLevelUpgrade?.trim() !== '' &&
|
||||
data.classPaySource &&
|
||||
data.classPaySource.trim() !== ''
|
||||
)
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.classLevelUpgrade,
|
||||
path: ['classPaySource'],
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(data) => {
|
||||
return (
|
||||
data.serviceType === '1' &&
|
||||
data.classPaySource?.trim() !== '' &&
|
||||
data.responsiblePerson &&
|
||||
data.responsiblePerson.trim() !== ''
|
||||
)
|
||||
},
|
||||
{
|
||||
message: ERROR_MESSAGES.required.responsiblePerson,
|
||||
path: ['responsiblePerson'],
|
||||
},
|
||||
)
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.trafficAccident !== '' && data.accidentDate && data.accidentDate.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.accidentDate,
|
||||
// path: ['accidentDate'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.trafficAccident !== '' && data.accidentProvince && data.accidentProvince.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.accidentProvince,
|
||||
// path: ['accidentProvince'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.trafficAccident !== '' && data.accidentCity && data.accidentCity.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.accidentCity,
|
||||
// path: ['accidentCity'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.trafficAccident !== '' && data.accidentDistrict && data.accidentDistrict.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.accidentDistrict,
|
||||
// path: ['accidentDistrict'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.trafficAccident !== '' && data.suplesi && data.suplesi.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.suplesi,
|
||||
// path: ['suplesi'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return (
|
||||
// data.trafficAccident !== '' &&
|
||||
// data.suplesi?.trim() === 'yes' &&
|
||||
// data.suplesiNumber &&
|
||||
// data.suplesiNumber.trim() !== ''
|
||||
// )
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.suplesiNumber,
|
||||
// path: ['suplesiNumber'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.serviceType === '1' && data.classLevel && data.classLevel.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.classLevel,
|
||||
// path: ['classLevel'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return data.serviceType === '1' && data.classLevelUpgrade && data.classLevelUpgrade.trim() !== ''
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.classLevelUpgrade,
|
||||
// path: ['classLevelUpgrade'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return (
|
||||
// data.serviceType === '1' &&
|
||||
// data.classLevelUpgrade?.trim() !== '' &&
|
||||
// data.classPaySource &&
|
||||
// data.classPaySource.trim() !== ''
|
||||
// )
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.classLevelUpgrade,
|
||||
// path: ['classPaySource'],
|
||||
// },
|
||||
// )
|
||||
// .refine(
|
||||
// (data) => {
|
||||
// return (
|
||||
// data.serviceType === '1' &&
|
||||
// data.classPaySource?.trim() !== '' &&
|
||||
// data.responsiblePerson &&
|
||||
// data.responsiblePerson.trim() !== ''
|
||||
// )
|
||||
// },
|
||||
// {
|
||||
// message: ERROR_MESSAGES.required.responsiblePerson,
|
||||
// path: ['responsiblePerson'],
|
||||
// },
|
||||
// )
|
||||
|
||||
type IntegrationBpjsFormData = z.infer<typeof IntegrationBpjsSchema>
|
||||
|
||||
|
||||
@@ -20,16 +20,20 @@ export function makeSepData(
|
||||
},
|
||||
) {
|
||||
const content = {
|
||||
noKartu: data.bpjsNumber || '',
|
||||
noKartu: '0002084879801', // data.bpjsNumber || '',
|
||||
tglSep: data.sepDate,
|
||||
ppkPelayanan: data.serviceType || '',
|
||||
ppkPelayanan: '1323R001', // data.serviceType || '',
|
||||
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',
|
||||
// },
|
||||
poli: {
|
||||
tujuan: data.destinationClinic || '',
|
||||
eksekutif: data.clinicExcecutive === 'yes' ? '1' : '0',
|
||||
tujuan: 'URO',
|
||||
eksekutif: '0',
|
||||
},
|
||||
cob: {
|
||||
cob: data.cob === 'yes' ? '1' : '0',
|
||||
@@ -42,14 +46,20 @@ export function makeSepData(
|
||||
kdPenunjang: data.supportCode || '',
|
||||
assesmentPel: data.serviceAssessment || '',
|
||||
skdp: {
|
||||
noSurat: data.admissionType === '3' ? data.referralLetterNumber : '',
|
||||
kodeDPJP: data.admissionType === '3' ? data.attendingDoctor : '',
|
||||
noSurat: '', // data.admissionType === '3' ? data.referralLetterNumber : '',
|
||||
kodeDPJP: '', // data.admissionType === '3' ? data.attendingDoctor : '',
|
||||
},
|
||||
// rujukan: {
|
||||
// asalRujukan: data?.referralFrom || '',
|
||||
// tglRujukan: '', // data?.referralLetterDate || '',
|
||||
// noRujukan: '', // data?.referralLetterNumber || '',
|
||||
// ppkRujukan: data?.referralTo || '',
|
||||
// },
|
||||
rujukan: {
|
||||
asalRujukan: data?.referralFrom || '',
|
||||
tglRujukan: data?.referralLetterDate || '',
|
||||
noRujukan: data?.referralLetterNumber || '',
|
||||
ppkRujukan: data?.referralTo || '',
|
||||
noRujukan: '0212R0300625B000006',
|
||||
ppkRujukan: '0212R030',
|
||||
tglRujukan: '2025-06-26',
|
||||
asalRujukan: '2',
|
||||
},
|
||||
klsRawat: {
|
||||
klsRawatHak: data.classLevel || '',
|
||||
@@ -57,7 +67,7 @@ export function makeSepData(
|
||||
pembiayaan: data.classPaySource || '',
|
||||
penanggungJawab: data.responsiblePerson || '',
|
||||
},
|
||||
dpjpLayan: data.attendingDoctor || '',
|
||||
dpjpLayan: '28080', // data.attendingDoctor || '',
|
||||
noTelp: data.phoneNumber || '',
|
||||
user: data.patientName || '',
|
||||
jaminan: {
|
||||
|
||||
Reference in New Issue
Block a user