feat(sep): implement dpjp
This commit is contained in:
@@ -14,11 +14,10 @@ import { getPatientDetail, getPatients } from '~/services/patient.service'
|
||||
import { getList as getProvinceList } from '~/services/vclaim-region-province.service'
|
||||
import { getList as getCityList } from '~/services/vclaim-region-city.service'
|
||||
import { getList as getDistrictList } from '~/services/vclaim-region-district.service'
|
||||
import { getList as getDoctorList } from '~/services/vclaim-doctor.service'
|
||||
import { getValueLabelList as getDoctorLabelList } from '~/services/vclaim-doctor.service'
|
||||
import { getList as getDiagnoseReferralList } from '~/services/vclaim-diagnose-referral.service'
|
||||
import { getList as geMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
||||
import { getList as getMonitoringHistoryList } from '~/services/vclaim-monitoring-history.service'
|
||||
import { get } from '@vueuse/core'
|
||||
|
||||
const openPatient = ref(false)
|
||||
const openLetter = ref(false)
|
||||
@@ -30,6 +29,7 @@ const histories = ref<Array<SepHistoryData>>([])
|
||||
|
||||
// patients used by AppSepTableSearchPatient (will be filled from API)
|
||||
const patients = ref<Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>>([])
|
||||
const doctors = ref<Array<{ value: string | number; label: string }>>([])
|
||||
const isPatientsLoading = ref(false)
|
||||
const paginationMeta = ref<PaginationMeta>({
|
||||
recordCount: 0,
|
||||
@@ -110,7 +110,10 @@ async function getMonitoringHistoryMappers() {
|
||||
sepNumber: result.noSep,
|
||||
sepDate: result.tglSep,
|
||||
referralNumber: result.noRujukan,
|
||||
diagnosis: result.diagnosa,
|
||||
diagnosis:
|
||||
result.diagnosa && typeof result.diagnosa === 'string' && result.diagnosa.length > 20
|
||||
? result.diagnosa.toString().substring(0, 17) + '...'
|
||||
: '-',
|
||||
serviceType: !result.jnsPelayanan ? '-' : result.jnsPelayanan === '1' ? 'Rawat Jalan' : 'Rawat Inap',
|
||||
careClass: result.kelasRawat,
|
||||
})
|
||||
@@ -150,19 +153,23 @@ function handleSaveLetter() {
|
||||
console.log('Letter dipilih:', selectedLetter.value)
|
||||
}
|
||||
|
||||
function handleEvent(value: string) {
|
||||
if (value === 'search-patient') {
|
||||
function handleEvent(menu: string, value: string) {
|
||||
if (menu === 'admission-type') {
|
||||
console.log('service-type:', value)
|
||||
return
|
||||
}
|
||||
if (menu === 'search-patient') {
|
||||
// fetch patients from API then open the dialog
|
||||
getPatientsList({ 'page-size': 10, includes: 'person' }).then(() => {
|
||||
openPatient.value = true
|
||||
})
|
||||
return
|
||||
}
|
||||
if (value === 'search-letter') {
|
||||
if (menu === 'search-letter') {
|
||||
openLetter.value = true
|
||||
return
|
||||
}
|
||||
if (value === 'history-sep') {
|
||||
if (menu === 'history-sep') {
|
||||
// fetch history sep from API then open the dialog
|
||||
getMonitoringHistoryMappers().then((value) => {
|
||||
console.log('value:', value)
|
||||
@@ -170,12 +177,17 @@ function handleEvent(value: string) {
|
||||
openHistory.value = true
|
||||
return
|
||||
}
|
||||
if (value === 'back') {
|
||||
if (menu === 'back') {
|
||||
navigateTo('/bpjs/sep')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
doctors.value = await getDoctorLabelList({
|
||||
'jenis-pelayanan': 1,
|
||||
'tgl-pelayanan': new Date().toISOString().substring(0, 10),
|
||||
'kode-spesialis': 0,
|
||||
})
|
||||
getProvinceList().then((value) => {
|
||||
console.log('value:', value)
|
||||
})
|
||||
@@ -185,13 +197,6 @@ onMounted(() => {
|
||||
getDistrictList({ city: '0187' }).then((value) => {
|
||||
console.log('value:', value)
|
||||
})
|
||||
getDoctorList({
|
||||
'jenis-pelayanan': 1,
|
||||
'tgl-pelayanan': new Date().toISOString().substring(0, 19),
|
||||
'kode-spesialis': 0,
|
||||
}).then((value) => {
|
||||
console.log('value:', value)
|
||||
})
|
||||
getDiagnoseReferralList().then((value) => {
|
||||
console.log('value:', value)
|
||||
})
|
||||
@@ -214,6 +219,7 @@ onMounted(() => {
|
||||
SEP
|
||||
</div>
|
||||
<AppSepEntryForm
|
||||
:doctors="doctors"
|
||||
:patient="selectedPatientObject"
|
||||
@event="handleEvent"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user