feat(sep): integrate sep create
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user