feat(sep): integrate sep create

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