feat: enhance SEP entry form and handling with new readonly mode and improved data fetching
This commit is contained in:
No files matched your search
@@ -102,10 +102,11 @@ const titleLetterNumber = computed(() => (admissionType.value === '3' ? 'Surat K
|
|||||||
const titleLetterDate = computed(() =>
|
const titleLetterDate = computed(() =>
|
||||||
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
|
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
|
||||||
)
|
)
|
||||||
|
const mode = props.mode !== undefined ? props.mode : 'add'
|
||||||
|
const attendingDoctorName = ref('')
|
||||||
const isAccidentally = computed(() => accident.value === '1' || accident.value === '2')
|
const isAccidentally = computed(() => accident.value === '1' || accident.value === '2')
|
||||||
const isProvinceSelected = computed(() => accidentProvince.value !== '')
|
const isProvinceSelected = computed(() => accidentProvince.value !== '')
|
||||||
const isCitySelected = computed(() => accidentCity.value !== '')
|
const isCitySelected = computed(() => accidentCity.value !== '')
|
||||||
const mode = props.mode !== undefined ? props.mode : 'add'
|
|
||||||
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 isService = ref(props.isService || false)
|
const isService = ref(props.isService || false)
|
||||||
@@ -156,8 +157,8 @@ const onInitialized = (objects: any) => {
|
|||||||
if (objects?.sepType === 'external') {
|
if (objects?.sepType === 'external') {
|
||||||
admissionType.value = '1'
|
admissionType.value = '1'
|
||||||
}
|
}
|
||||||
if (objects?.diagnoseLabel) {
|
if (objects?.initialDiagnosis) {
|
||||||
initialDiagnosis.value = objects?.diagnoseLabel
|
initialDiagnosis.value = objects?.initialDiagnosis
|
||||||
}
|
}
|
||||||
// Patient data
|
// Patient data
|
||||||
if (objects?.serviceType) {
|
if (objects?.serviceType) {
|
||||||
@@ -173,6 +174,9 @@ const onInitialized = (objects: any) => {
|
|||||||
if (objects?.attendingDoctor) {
|
if (objects?.attendingDoctor) {
|
||||||
attendingDoctor.value = objects?.attendingDoctor
|
attendingDoctor.value = objects?.attendingDoctor
|
||||||
}
|
}
|
||||||
|
if (objects?.attendingDoctorName) {
|
||||||
|
attendingDoctorName.value = objects?.attendingDoctorName
|
||||||
|
}
|
||||||
if (objects?.cob) {
|
if (objects?.cob) {
|
||||||
cob.value = objects?.cob
|
cob.value = objects?.cob
|
||||||
}
|
}
|
||||||
@@ -314,7 +318,7 @@ onMounted(() => {
|
|||||||
id="sepDate"
|
id="sepDate"
|
||||||
v-model="sepDate"
|
v-model="sepDate"
|
||||||
v-bind="sepDateAttrs"
|
v-bind="sepDateAttrs"
|
||||||
:disabled="true"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal sep"
|
placeholder="Pilih tanggal sep"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -511,7 +515,7 @@ onMounted(() => {
|
|||||||
id="referralLetterDate"
|
id="referralLetterDate"
|
||||||
v-model="referralLetterDate"
|
v-model="referralLetterDate"
|
||||||
v-bind="referralLetterDateAttrs"
|
v-bind="referralLetterDateAttrs"
|
||||||
:disabled="true"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal surat"
|
placeholder="Pilih tanggal surat"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -527,6 +531,7 @@ onMounted(() => {
|
|||||||
v-model="clinicExcecutive"
|
v-model="clinicExcecutive"
|
||||||
v-bind="clinicExcecutiveAttrs"
|
v-bind="clinicExcecutiveAttrs"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -586,7 +591,7 @@ onMounted(() => {
|
|||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|
||||||
<Cell>
|
<Cell v-if="!isReadonly">
|
||||||
<Label height="compact">
|
<Label height="compact">
|
||||||
Spesialis / Subspesialis
|
Spesialis / Subspesialis
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
@@ -609,6 +614,7 @@ onMounted(() => {
|
|||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.attendingDoctor">
|
<Field :errMessage="errors.attendingDoctor">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
v-if="!isReadonly"
|
||||||
id="attendingDoctor"
|
id="attendingDoctor"
|
||||||
v-model="attendingDoctor"
|
v-model="attendingDoctor"
|
||||||
v-bind="attendingDoctorAttrs"
|
v-bind="attendingDoctorAttrs"
|
||||||
@@ -619,6 +625,12 @@ onMounted(() => {
|
|||||||
empty-message="Item tidak ditemukan"
|
empty-message="Item tidak ditemukan"
|
||||||
@update:searchText="emit('fetch', { menu: 'doctor', value: $event })"
|
@update:searchText="emit('fetch', { menu: 'doctor', value: $event })"
|
||||||
/>
|
/>
|
||||||
|
<Input
|
||||||
|
v-else
|
||||||
|
v-model="attendingDoctorName"
|
||||||
|
v-bind="attendingDoctorAttrs"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|
||||||
@@ -629,6 +641,7 @@ onMounted(() => {
|
|||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.initialDiagnosis">
|
<Field :errMessage="errors.initialDiagnosis">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
v-if="!isReadonly"
|
||||||
id="initialDiagnosis"
|
id="initialDiagnosis"
|
||||||
v-model="initialDiagnosis"
|
v-model="initialDiagnosis"
|
||||||
v-bind="initialDiagnosisAttrs"
|
v-bind="initialDiagnosisAttrs"
|
||||||
@@ -639,6 +652,12 @@ onMounted(() => {
|
|||||||
empty-message="Item tidak ditemukan"
|
empty-message="Item tidak ditemukan"
|
||||||
@update:searchText="emit('fetch', { menu: 'diagnosis', value: $event })"
|
@update:searchText="emit('fetch', { menu: 'diagnosis', value: $event })"
|
||||||
/>
|
/>
|
||||||
|
<Input
|
||||||
|
v-else
|
||||||
|
v-model="initialDiagnosis"
|
||||||
|
v-bind="initialDiagnosisAttrs"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Block>
|
</Block>
|
||||||
@@ -763,6 +782,7 @@ onMounted(() => {
|
|||||||
v-model="cob"
|
v-model="cob"
|
||||||
v-bind="cobAttrs"
|
v-bind="cobAttrs"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -792,6 +812,7 @@ onMounted(() => {
|
|||||||
v-model="cataract"
|
v-model="cataract"
|
||||||
v-bind="cataractAttrs"
|
v-bind="cataractAttrs"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -861,7 +882,7 @@ onMounted(() => {
|
|||||||
id="accidentDate"
|
id="accidentDate"
|
||||||
v-model="accidentDate"
|
v-model="accidentDate"
|
||||||
v-bind="accidentDateAttrs"
|
v-bind="accidentDateAttrs"
|
||||||
:disabled="true"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal kejadian"
|
placeholder="Pilih tanggal kejadian"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
type SepDto = any
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue'))
|
||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [
|
cols: [
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ onMounted(async () => {
|
|||||||
:mode="props.mode"
|
:mode="props.mode"
|
||||||
:is-save-loading="isSaveLoading"
|
:is-save-loading="isSaveLoading"
|
||||||
:is-service="isServiceHidden"
|
:is-service="isServiceHidden"
|
||||||
|
:is-readonly="['detail', 'link'].includes(props.mode)"
|
||||||
:doctors="doctors"
|
:doctors="doctors"
|
||||||
:diagnoses="diagnoses"
|
:diagnoses="diagnoses"
|
||||||
:facilities-from="facilitiesFrom"
|
:facilities-from="facilitiesFrom"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import RangeCalendar from '~/components/pub/ui/range-calendar/RangeCalendar.vue'
|
|||||||
import { X, Check } from 'lucide-vue-next'
|
import { X, Check } from 'lucide-vue-next'
|
||||||
|
|
||||||
// Libraries
|
// Libraries
|
||||||
import useIntegrationSepList from '~/handlers/integration-sep-list.handler'
|
import { useIntegrationSepList } from '~/handlers/integration-sep-list.handler'
|
||||||
|
|
||||||
// use handler to provide state and functions
|
// use handler to provide state and functions
|
||||||
const {
|
const {
|
||||||
@@ -54,6 +54,9 @@ watch(
|
|||||||
if (recAction.value === 'showConfirmDel') {
|
if (recAction.value === 'showConfirmDel') {
|
||||||
open.value = true
|
open.value = true
|
||||||
}
|
}
|
||||||
|
if (recAction.value === 'showDetail') {
|
||||||
|
navigateTo(`/integration/bpjs-vclaim/sep/${recItem.value?.letterNumber}/detail`)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -62,6 +65,7 @@ watch(
|
|||||||
(val) => {
|
(val) => {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
setDateRange()
|
setDateRange()
|
||||||
|
getSepList()
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { ref, computed } from 'vue'
|
|||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { toast } from '~/components/pub/ui/toast'
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
||||||
|
import { getList as getMemberList } from '~/services/vclaim-member.service'
|
||||||
|
|
||||||
export function useIntegrationSepDetail() {
|
export function useIntegrationSepDetail() {
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -33,7 +34,8 @@ export function useIntegrationSepDetail() {
|
|||||||
valueObjects.value = {
|
valueObjects.value = {
|
||||||
sepNumber: response.noSep || noSep.value,
|
sepNumber: response.noSep || noSep.value,
|
||||||
eSep: response.eSEP === 'True' ? 'yes' : 'no',
|
eSep: response.eSEP === 'True' ? 'yes' : 'no',
|
||||||
serviceType: response.jnsPelayanan === 'Rawat Jalan' ? '2' : response.jnsPelayanan === 'Rawat Inap' ? '1' : null,
|
serviceType:
|
||||||
|
response.jnsPelayanan === 'Rawat Jalan' ? '2' : response.jnsPelayanan === 'Rawat Inap' ? '1' : null,
|
||||||
sepDate: response.tglSep ? new Date(response.tglSep).toISOString().split('T')[0] : '',
|
sepDate: response.tglSep ? new Date(response.tglSep).toISOString().split('T')[0] : '',
|
||||||
cardNumber: response.peserta?.noKartu || '-',
|
cardNumber: response.peserta?.noKartu || '-',
|
||||||
patientName: response.peserta?.nama || '-',
|
patientName: response.peserta?.nama || '-',
|
||||||
@@ -80,6 +82,20 @@ export function useIntegrationSepDetail() {
|
|||||||
controlLetterDoctor: response.kontrol?.kdDokter || '-',
|
controlLetterDoctor: response.kontrol?.kdDokter || '-',
|
||||||
controlLetterDoctorName: response.kontrol?.nmDokter || '-',
|
controlLetterDoctorName: response.kontrol?.nmDokter || '-',
|
||||||
}
|
}
|
||||||
|
if (valueObjects.value?.cardNumber !== '-') {
|
||||||
|
const resultMember = await getMemberList({
|
||||||
|
mode: 'by-card',
|
||||||
|
number: valueObjects.value.cardNumber,
|
||||||
|
date: new Date().toISOString().substring(0, 10),
|
||||||
|
})
|
||||||
|
if (resultMember && resultMember.success && resultMember.body) {
|
||||||
|
const memberRaws = resultMember.body?.response || null
|
||||||
|
valueObjects.value['nationalIdentity'] = memberRaws?.peserta?.nik || ''
|
||||||
|
valueObjects.value['phoneNumber'] = memberRaws?.peserta?.mr?.noTelepon || ''
|
||||||
|
valueObjects.value['classLevel'] = memberRaws?.peserta?.hakKelas?.kode || ''
|
||||||
|
valueObjects.value['status'] = memberRaws?.statusPeserta?.kode || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast({
|
||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
|
|||||||
@@ -634,7 +634,6 @@ export function useIntegrationSepEntry() {
|
|||||||
number: queries['card-number'],
|
number: queries['card-number'],
|
||||||
date: new Date().toISOString().substring(0, 10),
|
date: new Date().toISOString().substring(0, 10),
|
||||||
})
|
})
|
||||||
console.log(resultMember)
|
|
||||||
}
|
}
|
||||||
delete selectedObjects.value['is-service']
|
delete selectedObjects.value['is-service']
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,5 +280,3 @@ export function useIntegrationSepList() {
|
|||||||
handleRemove,
|
handleRemove,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useIntegrationSepList
|
|
||||||
Reference in New Issue
Block a user