feat(sep): integrate sep create
This commit is contained in:
@@ -27,7 +27,8 @@ const props = defineProps<{
|
|||||||
mode?: string
|
mode?: string
|
||||||
doctors: any[]
|
doctors: any[]
|
||||||
diagnoses: any[]
|
diagnoses: any[]
|
||||||
facilities: any[]
|
facilitiesFrom: any[]
|
||||||
|
facilitiesTo: any[]
|
||||||
serviceTypes: any[]
|
serviceTypes: any[]
|
||||||
registerMethods: any[]
|
registerMethods: any[]
|
||||||
accidents: any[]
|
accidents: any[]
|
||||||
@@ -376,12 +377,12 @@ watch(props, (value) => {
|
|||||||
id="fromClinic"
|
id="fromClinic"
|
||||||
v-model="fromClinic"
|
v-model="fromClinic"
|
||||||
v-bind="fromClinicAttrs"
|
v-bind="fromClinicAttrs"
|
||||||
:items="facilities"
|
:items="facilitiesFrom"
|
||||||
:is-disabled="isLoading || isReadonly"
|
:is-disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih Asal"
|
placeholder="Pilih Asal"
|
||||||
search-placeholder="Cari Asal"
|
search-placeholder="Cari Asal"
|
||||||
empty-message="Item tidak ditemukan"
|
empty-message="Item tidak ditemukan"
|
||||||
@update:searchText="emit('fetch', { menu: 'clinic', value: $event })"
|
@update:searchText="emit('fetch', { menu: 'clinic-from', value: $event })"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
@@ -396,12 +397,12 @@ watch(props, (value) => {
|
|||||||
id="destinationClinic"
|
id="destinationClinic"
|
||||||
v-model="destinationClinic"
|
v-model="destinationClinic"
|
||||||
v-bind="destinationClinicAttrs"
|
v-bind="destinationClinicAttrs"
|
||||||
:items="facilities"
|
:items="facilitiesTo"
|
||||||
:is-disabled="isLoading || isReadonly"
|
:is-disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih Klinik"
|
placeholder="Pilih Klinik"
|
||||||
search-placeholder="Cari Klinik"
|
search-placeholder="Cari Klinik"
|
||||||
empty-message="Item tidak ditemukan"
|
empty-message="Item tidak ditemukan"
|
||||||
@update:searchText="emit('fetch', { menu: 'clinic', value: $event })"
|
@update:searchText="emit('fetch', { menu: 'clinic-to', value: $event })"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import { getValueLabelList as getHealthFacilityLabelList } from '~/services/vcla
|
|||||||
import { getValueLabelList as getDiagnoseLabelList } from '~/services/vclaim-diagnose.service'
|
import { getValueLabelList as getDiagnoseLabelList } from '~/services/vclaim-diagnose.service'
|
||||||
import { getList as geMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
import { getList as geMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
||||||
import { getList as getMonitoringHistoryList } from '~/services/vclaim-monitoring-history.service'
|
import { getList as getMonitoringHistoryList } from '~/services/vclaim-monitoring-history.service'
|
||||||
import { create as createSep, createPayload as createSepPayload } from '~/services/vclaim-sep.service'
|
import { create as createSep, makeSepData } from '~/services/vclaim-sep.service'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const openPatient = ref(false)
|
const openPatient = ref(false)
|
||||||
@@ -48,7 +48,8 @@ const visits = ref<Array<SepVisitData>>([])
|
|||||||
const patients = ref<Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>>([])
|
const patients = ref<Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>>([])
|
||||||
const doctors = ref<Array<{ value: string | number; label: string }>>([])
|
const doctors = ref<Array<{ value: string | number; label: string }>>([])
|
||||||
const diagnoses = ref<Array<{ value: string | number; label: string }>>([])
|
const diagnoses = ref<Array<{ value: string | number; label: string }>>([])
|
||||||
const facilities = ref<Array<{ value: string | number; label: string }>>([])
|
const facilitiesFrom = ref<Array<{ value: string | number; label: string }>>([])
|
||||||
|
const facilitiesTo = ref<Array<{ value: string | number; label: string }>>([])
|
||||||
const supportCodesList = ref<Array<{ value: string; label: string }>>([])
|
const supportCodesList = ref<Array<{ value: string; label: string }>>([])
|
||||||
const serviceTypesList = ref<Array<{ value: string; label: string }>>([])
|
const serviceTypesList = ref<Array<{ value: string; label: string }>>([])
|
||||||
const registerMethodsList = ref<Array<{ value: string; label: string }>>([])
|
const registerMethodsList = ref<Array<{ value: string; label: string }>>([])
|
||||||
@@ -227,11 +228,19 @@ function handleSaveLetter() {
|
|||||||
console.log('Letter dipilih:', selectedLetter.value)
|
console.log('Letter dipilih:', selectedLetter.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEvent(menu: string, value: any) {
|
async function handleEvent(menu: string, value: any) {
|
||||||
if (menu === 'admission-type') {
|
if (menu === 'admission-type') {
|
||||||
console.log('service-type:', value)
|
console.log('service-type:', value)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (menu === 'service-type') {
|
||||||
|
selectedServiceType.value = value
|
||||||
|
doctors.value = await getDoctorLabelList({
|
||||||
|
'jenis-pelayanan': selectedServiceType.value || 1,
|
||||||
|
'tgl-pelayanan': new Date().toISOString().substring(0, 10),
|
||||||
|
'kode-spesialis': 0,
|
||||||
|
})
|
||||||
|
}
|
||||||
if (menu === 'search-patient') {
|
if (menu === 'search-patient') {
|
||||||
getPatientsList({ 'page-size': 10, includes: 'person' }).then(() => {
|
getPatientsList({ 'page-size': 10, includes: 'person' }).then(() => {
|
||||||
openPatient.value = true
|
openPatient.value = true
|
||||||
@@ -254,8 +263,9 @@ function handleEvent(menu: string, value: any) {
|
|||||||
navigateTo('/integration/bpjs/sep')
|
navigateTo('/integration/bpjs/sep')
|
||||||
}
|
}
|
||||||
if (menu === 'save-sep') {
|
if (menu === 'save-sep') {
|
||||||
createSep(createSepPayload(value)).then(() => {
|
createSep(makeSepData(value)).then((value) => {
|
||||||
navigateTo('/integration/bpjs/sep')
|
console.log('value:', value)
|
||||||
|
// navigateTo('/integration/bpjs/sep')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,25 +273,19 @@ function handleEvent(menu: string, value: any) {
|
|||||||
async function handleFetch(params: any) {
|
async function handleFetch(params: any) {
|
||||||
const menu = params.menu || ''
|
const menu = params.menu || ''
|
||||||
const value = params.value || ''
|
const value = params.value || ''
|
||||||
if (menu === 'service-type') {
|
|
||||||
selectedServiceType.value = value
|
|
||||||
}
|
|
||||||
if (menu === 'diagnosis') {
|
if (menu === 'diagnosis') {
|
||||||
diagnoses.value = await getDiagnoseLabelList({ diagnosa: value })
|
diagnoses.value = await getDiagnoseLabelList({ diagnosa: value })
|
||||||
}
|
}
|
||||||
if (menu === 'clinic') {
|
if (menu === 'clinic-from') {
|
||||||
facilities.value = await getHealthFacilityLabelList({
|
facilitiesFrom.value = await getHealthFacilityLabelList({
|
||||||
faskes: value,
|
faskes: value,
|
||||||
'jenis-faskes': selectedServiceType.value || 1,
|
'jenis-faskes': selectedServiceType.value || 1,
|
||||||
})
|
})
|
||||||
facilities.value = await getHealthFacilityLabelList({
|
}
|
||||||
faskes: 'Puskesmas',
|
if (menu === 'clinic-to') {
|
||||||
'jenis-faskes': selectedLetter.value || 1,
|
facilitiesTo.value = await getHealthFacilityLabelList({
|
||||||
})
|
faskes: value,
|
||||||
doctors.value = await getDoctorLabelList({
|
'jenis-faskes': selectedServiceType.value || 1,
|
||||||
'jenis-pelayanan': selectedServiceType.value || 1,
|
|
||||||
'tgl-pelayanan': new Date().toISOString().substring(0, 10),
|
|
||||||
'kode-spesialis': 0,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (menu === 'province') {
|
if (menu === 'province') {
|
||||||
@@ -294,11 +298,13 @@ async function handleFetch(params: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleInit() {
|
async function handleInit() {
|
||||||
diagnoses.value = await getDiagnoseLabelList({ diagnosa: 'paru' })
|
const facilities = await getHealthFacilityLabelList({
|
||||||
facilities.value = await getHealthFacilityLabelList({
|
|
||||||
faskes: 'Puskesmas',
|
faskes: 'Puskesmas',
|
||||||
'jenis-faskes': selectedLetter.value || 1,
|
'jenis-faskes': selectedLetter.value || 1,
|
||||||
})
|
})
|
||||||
|
diagnoses.value = await getDiagnoseLabelList({ diagnosa: 'paru' })
|
||||||
|
facilitiesFrom.value = facilities
|
||||||
|
facilitiesTo.value = facilities
|
||||||
doctors.value = await getDoctorLabelList({
|
doctors.value = await getDoctorLabelList({
|
||||||
'jenis-pelayanan': selectedServiceType.value || 1,
|
'jenis-pelayanan': selectedServiceType.value || 1,
|
||||||
'tgl-pelayanan': new Date().toISOString().substring(0, 10),
|
'tgl-pelayanan': new Date().toISOString().substring(0, 10),
|
||||||
@@ -339,15 +345,6 @@ async function handleInit() {
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await handleInit()
|
await handleInit()
|
||||||
// getProvinceList().then((value) => {
|
|
||||||
// console.log('value:', value)
|
|
||||||
// })
|
|
||||||
// getCityList({ province: '14' }).then((value) => {
|
|
||||||
// console.log('value:', value)
|
|
||||||
// })
|
|
||||||
// getDistrictList({ city: '0187' }).then((value) => {
|
|
||||||
// console.log('value:', value)
|
|
||||||
// })
|
|
||||||
if (route.query) {
|
if (route.query) {
|
||||||
selectedObjects.value = { ...route.query }
|
selectedObjects.value = { ...route.query }
|
||||||
}
|
}
|
||||||
@@ -367,7 +364,8 @@ onMounted(async () => {
|
|||||||
<AppSepEntryForm
|
<AppSepEntryForm
|
||||||
:doctors="doctors"
|
:doctors="doctors"
|
||||||
:diagnoses="diagnoses"
|
:diagnoses="diagnoses"
|
||||||
:facilities="facilities"
|
:facilities-from="facilitiesFrom"
|
||||||
|
:facilities-to="facilitiesTo"
|
||||||
:service-types="serviceTypesList"
|
:service-types="serviceTypesList"
|
||||||
:register-methods="registerMethodsList"
|
:register-methods="registerMethodsList"
|
||||||
:accidents="accidentsList"
|
:accidents="accidentsList"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import { not } from '@vueuse/math'
|
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { serviceAssessments, serviceTypes } from '~/lib/constants.vclaim'
|
|
||||||
|
|
||||||
const ERROR_MESSAGES = {
|
const ERROR_MESSAGES = {
|
||||||
required: {
|
required: {
|
||||||
@@ -88,10 +86,10 @@ const IntegrationBpjsSchema = z.object({
|
|||||||
.min(1, ERROR_MESSAGES.required.clinicExcecutive),
|
.min(1, ERROR_MESSAGES.required.clinicExcecutive),
|
||||||
procedureType: z
|
procedureType: z
|
||||||
.string({ required_error: ERROR_MESSAGES.required.procedureType })
|
.string({ required_error: ERROR_MESSAGES.required.procedureType })
|
||||||
.min(1, ERROR_MESSAGES.required.procedureType),
|
.min(1, ERROR_MESSAGES.required.procedureType).optional(),
|
||||||
supportCode: z
|
supportCode: z
|
||||||
.string({ required_error: ERROR_MESSAGES.required.supportCode })
|
.string({ required_error: ERROR_MESSAGES.required.supportCode })
|
||||||
.min(1, ERROR_MESSAGES.required.supportCode),
|
.min(1, ERROR_MESSAGES.required.supportCode).optional(),
|
||||||
note: z.string({ required_error: ERROR_MESSAGES.required.note }).min(1, ERROR_MESSAGES.required.note).optional(),
|
note: z.string({ required_error: ERROR_MESSAGES.required.note }).min(1, ERROR_MESSAGES.required.note).optional(),
|
||||||
trafficAccident: z
|
trafficAccident: z
|
||||||
.string({ required_error: ERROR_MESSAGES.required.trafficAccident })
|
.string({ required_error: ERROR_MESSAGES.required.trafficAccident })
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import type { IntegrationBpjsFormData } from "~/schemas/integration-bpjs.schema"
|
||||||
|
|
||||||
const path = '/api/vclaim/sep'
|
const path = '/api/vclaim/sep'
|
||||||
const name = 'sep'
|
const name = 'sep'
|
||||||
|
|
||||||
@@ -8,7 +11,7 @@ export function create(data: any) {
|
|||||||
return base.create(path, data, name)
|
return base.create(path, data, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createPayload(data: any) {
|
export function makeSepData(data: IntegrationBpjsFormData) {
|
||||||
// "nationalId": "5617213001231231",
|
// "nationalId": "5617213001231231",
|
||||||
// "referralLetterNumber": "12233",
|
// "referralLetterNumber": "12233",
|
||||||
// "referralLetterDate": "2025-10-21",
|
// "referralLetterDate": "2025-10-21",
|
||||||
@@ -18,7 +21,7 @@ export function createPayload(data: any) {
|
|||||||
const content = {
|
const content = {
|
||||||
noKartu: data.bpjsNumber || '',
|
noKartu: data.bpjsNumber || '',
|
||||||
tglSep: data.sepDate,
|
tglSep: data.sepDate,
|
||||||
ppkPelayanan: '1323R001',
|
ppkPelayanan: data.serviceType || '',
|
||||||
jnsPelayanan: data.admissionType ? String(data.admissionType) : '1',
|
jnsPelayanan: data.admissionType ? String(data.admissionType) : '1',
|
||||||
klsRawat: {
|
klsRawat: {
|
||||||
klsRawatHak: '2',
|
klsRawatHak: '2',
|
||||||
@@ -26,7 +29,7 @@ export function createPayload(data: any) {
|
|||||||
pembiayaan: '',
|
pembiayaan: '',
|
||||||
penanggungJawab: '',
|
penanggungJawab: '',
|
||||||
},
|
},
|
||||||
noMR: data.med,
|
noMR: data.medicalRecordNumber || '',
|
||||||
rujukan: {
|
rujukan: {
|
||||||
asalRujukan: '1',
|
asalRujukan: '1',
|
||||||
tglRujukan: '2025-08-20',
|
tglRujukan: '2025-08-20',
|
||||||
@@ -45,10 +48,10 @@ export function createPayload(data: any) {
|
|||||||
katarak: {
|
katarak: {
|
||||||
katarak: data.cataract === 'yes' ? '1' : '0',
|
katarak: data.cataract === 'yes' ? '1' : '0',
|
||||||
},
|
},
|
||||||
tujuanKunj: data.destinationClinic || '',
|
tujuanKunj: data.purposeOfVisit || '',
|
||||||
flagProcedure: data.procedureType || '',
|
flagProcedure: data.procedureType || '',
|
||||||
kdPenunjang: data.supportCode || '',
|
kdPenunjang: data.supportCode || '',
|
||||||
assesmentPel: '',
|
assesmentPel: data.serviceAssessment || '',
|
||||||
skdp: {
|
skdp: {
|
||||||
noSurat: '0208R0060825K000001',
|
noSurat: '0208R0060825K000001',
|
||||||
kodeDPJP: '6546',
|
kodeDPJP: '6546',
|
||||||
@@ -57,18 +60,18 @@ export function createPayload(data: any) {
|
|||||||
noTelp: data.phoneNumber || '',
|
noTelp: data.phoneNumber || '',
|
||||||
user: data.patientName || '',
|
user: data.patientName || '',
|
||||||
jaminan: {
|
jaminan: {
|
||||||
lakaLantas: '0',
|
lakaLantas: data.trafficAccident || '0',
|
||||||
noLP: '12345',
|
noLP: data.lpNumber || '',
|
||||||
penjamin: {
|
penjamin: {
|
||||||
tglKejadian: '',
|
tglKejadian: data.accidentDate || '',
|
||||||
keterangan: '',
|
keterangan: data.accidentNote || '',
|
||||||
suplesi: {
|
suplesi: {
|
||||||
suplesi: '0',
|
suplesi: data.suplesi === 'yes' ? '1' : '0',
|
||||||
noSepSuplesi: '',
|
noSepSuplesi: data.suplesiNumber || '',
|
||||||
lokasiLaka: {
|
lokasiLaka: {
|
||||||
kdPropinsi: '',
|
kdPropinsi: data.accidentProvince || '',
|
||||||
kdKabupaten: '',
|
kdKabupaten: data.accidentCity || '',
|
||||||
kdKecamatan: '',
|
kdKecamatan: data.accidentDistrict || '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user