feat(sep): implement dpjp

This commit is contained in:
riefive
2025-10-20 13:56:45 +07:00
parent c3a7352fb8
commit 499548c770
3 changed files with 53 additions and 25 deletions

No files matched your search

+15 -7
View File
@@ -9,6 +9,7 @@ import { Input } from '~/components/pub/ui/input'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group' import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { Textarea } from '~/components/pub/ui/textarea' import { Textarea } from '~/components/pub/ui/textarea'
import Select from '~/components/pub/ui/select/Select.vue' import Select from '~/components/pub/ui/select/Select.vue'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-single.vue' import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-single.vue'
// Types // Types
@@ -22,17 +23,23 @@ import { useForm } from 'vee-validate'
const props = defineProps<{ const props = defineProps<{
isLoading?: boolean isLoading?: boolean
isReadonly?: boolean isReadonly?: boolean
doctors: any[]
patient?: PatientEntity | null | undefined patient?: PatientEntity | null | undefined
values?: any values?: any
}>() }>()
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'event', value: any): void (e: 'event', menu: string, value?: any): void
}>() }>()
const isLoading = props.isLoading !== undefined ? props.isLoading : false const isLoading = props.isLoading !== undefined ? props.isLoading : false
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
const admissionTypes = [
{ value: '1', label: 'Kontrol' },
{ value: '2', label: 'Rujukan' },
]
const items = [ const items = [
{ value: 'item-1', label: 'Item 1' }, { value: 'item-1', label: 'Item 1' },
{ value: 'item-2', label: 'Item 2' }, { value: 'item-2', label: 'Item 2' },
@@ -68,7 +75,6 @@ const onSubmit = handleSubmit((values) => {
}) })
watch(props, (value) => { watch(props, (value) => {
console.log('patient changed:', value)
const patient = value.patient || ({} as PatientEntity) const patient = value.patient || ({} as PatientEntity)
if (Object.keys(patient).length > 0) { if (Object.keys(patient).length > 0) {
bpjsNumber.value = '-' bpjsNumber.value = '-'
@@ -116,9 +122,10 @@ watch(props, (value) => {
icon-name="i-lucide-chevron-down" icon-name="i-lucide-chevron-down"
v-model="admissionType" v-model="admissionType"
v-bind="admissionTypeAttrs" v-bind="admissionTypeAttrs"
:items="items" :items="admissionTypes"
:disabled="isLoading || isReadonly" :disabled="isLoading || isReadonly"
placeholder="Pilih jalur" placeholder="Pilih jalur"
@change="emit('event', 'admission-type', $event)"
/> />
</Field> </Field>
</Cell> </Cell>
@@ -327,14 +334,15 @@ watch(props, (value) => {
<span class="text-red-500">*</span> <span class="text-red-500">*</span>
</Label> </Label>
<Field :errMessage="errors.attendingDoctor"> <Field :errMessage="errors.attendingDoctor">
<Select <Combobox
id="attendingDoctor" id="attendingDoctor"
icon-name="i-lucide-chevron-down"
v-model="attendingDoctor" v-model="attendingDoctor"
v-bind="attendingDoctorAttrs" v-bind="attendingDoctorAttrs"
:items="items" :items="doctors"
:disabled="isLoading || isReadonly" :is-disabled="isLoading || isReadonly"
placeholder="Pilih DPJP" placeholder="Pilih DPJP"
search-placeholder="Cari DPJP"
empty-message="Item tidak ditemukan"
/> />
</Field> </Field>
</Cell> </Cell>
+22 -16
View File
@@ -14,11 +14,10 @@ import { getPatientDetail, getPatients } from '~/services/patient.service'
import { getList as getProvinceList } from '~/services/vclaim-region-province.service' import { getList as getProvinceList } from '~/services/vclaim-region-province.service'
import { getList as getCityList } from '~/services/vclaim-region-city.service' import { getList as getCityList } from '~/services/vclaim-region-city.service'
import { getList as getDistrictList } from '~/services/vclaim-region-district.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 getDiagnoseReferralList } from '~/services/vclaim-diagnose-referral.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 { get } from '@vueuse/core'
const openPatient = ref(false) const openPatient = ref(false)
const openLetter = ref(false) const openLetter = ref(false)
@@ -30,6 +29,7 @@ const histories = ref<Array<SepHistoryData>>([])
// patients used by AppSepTableSearchPatient (will be filled from API) // patients used by AppSepTableSearchPatient (will be filled from API)
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 isPatientsLoading = ref(false) const isPatientsLoading = ref(false)
const paginationMeta = ref<PaginationMeta>({ const paginationMeta = ref<PaginationMeta>({
recordCount: 0, recordCount: 0,
@@ -110,7 +110,10 @@ async function getMonitoringHistoryMappers() {
sepNumber: result.noSep, sepNumber: result.noSep,
sepDate: result.tglSep, sepDate: result.tglSep,
referralNumber: result.noRujukan, 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', serviceType: !result.jnsPelayanan ? '-' : result.jnsPelayanan === '1' ? 'Rawat Jalan' : 'Rawat Inap',
careClass: result.kelasRawat, careClass: result.kelasRawat,
}) })
@@ -150,19 +153,23 @@ function handleSaveLetter() {
console.log('Letter dipilih:', selectedLetter.value) console.log('Letter dipilih:', selectedLetter.value)
} }
function handleEvent(value: string) { function handleEvent(menu: string, value: string) {
if (value === 'search-patient') { if (menu === 'admission-type') {
console.log('service-type:', value)
return
}
if (menu === 'search-patient') {
// fetch patients from API then open the dialog // fetch patients from API then open the dialog
getPatientsList({ 'page-size': 10, includes: 'person' }).then(() => { getPatientsList({ 'page-size': 10, includes: 'person' }).then(() => {
openPatient.value = true openPatient.value = true
}) })
return return
} }
if (value === 'search-letter') { if (menu === 'search-letter') {
openLetter.value = true openLetter.value = true
return return
} }
if (value === 'history-sep') { if (menu === 'history-sep') {
// fetch history sep from API then open the dialog // fetch history sep from API then open the dialog
getMonitoringHistoryMappers().then((value) => { getMonitoringHistoryMappers().then((value) => {
console.log('value:', value) console.log('value:', value)
@@ -170,12 +177,17 @@ function handleEvent(value: string) {
openHistory.value = true openHistory.value = true
return return
} }
if (value === 'back') { if (menu === 'back') {
navigateTo('/bpjs/sep') 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) => { getProvinceList().then((value) => {
console.log('value:', value) console.log('value:', value)
}) })
@@ -185,13 +197,6 @@ onMounted(() => {
getDistrictList({ city: '0187' }).then((value) => { getDistrictList({ city: '0187' }).then((value) => {
console.log('value:', 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) => { getDiagnoseReferralList().then((value) => {
console.log('value:', value) console.log('value:', value)
}) })
@@ -214,6 +219,7 @@ onMounted(() => {
SEP SEP
</div> </div>
<AppSepEntryForm <AppSepEntryForm
:doctors="doctors"
:patient="selectedPatientObject" :patient="selectedPatientObject"
@event="handleEvent" @event="handleEvent"
/> />
+16 -2
View File
@@ -1,9 +1,23 @@
// Base // Base
import * as base from './_crud-base' import * as base from './_crud-base'
const path = '/api/vclaim/dokter-dpjp' const path = '/api/vclaim/referensi/dokter-dpjp'
const name = 'doctor-attending' const name = 'doctor-dpjp'
export function getList(params: any = null) { export function getList(params: any = null) {
return base.getList(path, params, name) return base.getList(path, params, name)
} }
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
let data: { value: string; label: string }[] = []
const result = await getList(params)
if (result.success) {
const resultData = result.body?.response?.list || []
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
data = resultUnique.map((item: any) => ({
value: item.kode ? String(item.kode) : '',
label: item.nama,
}))
}
return data
}