feat(sep): adjust entry form of sep
This commit is contained in:
No files matched your search
@@ -11,10 +11,12 @@ 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 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'
|
||||||
|
import TreeSelect from '~/components/pub/my-ui/select-tree/tree-select.vue'
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { IntegrationBpjsSchema, type IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
import { IntegrationBpjsSchema, type IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
||||||
import type { PatientEntity } from '~/models/patient'
|
import type { PatientEntity } from '~/models/patient'
|
||||||
|
import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { watch } from 'vue'
|
import { watch } from 'vue'
|
||||||
@@ -45,6 +47,7 @@ const props = defineProps<{
|
|||||||
provinces: any[]
|
provinces: any[]
|
||||||
cities: any[]
|
cities: any[]
|
||||||
districts: any[]
|
districts: any[]
|
||||||
|
specialists?: TreeItem[]
|
||||||
patient?: PatientEntity | null | undefined
|
patient?: PatientEntity | null | undefined
|
||||||
objects?: any
|
objects?: any
|
||||||
values?: any
|
values?: any
|
||||||
@@ -96,6 +99,7 @@ const [accidentCity, accidentCityAttrs] = defineField('accidentCity')
|
|||||||
const [accidentDistrict, accidentDistrictAttrs] = defineField('accidentDistrict')
|
const [accidentDistrict, accidentDistrictAttrs] = defineField('accidentDistrict')
|
||||||
const [suplesi, suplesiAttrs] = defineField('suplesi')
|
const [suplesi, suplesiAttrs] = defineField('suplesi')
|
||||||
const [suplesiNumber, suplesiNumberAttrs] = defineField('suplesiNumber')
|
const [suplesiNumber, suplesiNumberAttrs] = defineField('suplesiNumber')
|
||||||
|
const [subSpecialistId, subSpecialistIdAttrs] = defineField('subSpecialistId')
|
||||||
const titleLetterNumber = computed(() => (admissionType.value === '3' ? 'Surat Kontrol' : 'Surat Rujukan'))
|
const titleLetterNumber = computed(() => (admissionType.value === '3' ? 'Surat Kontrol' : 'Surat Rujukan'))
|
||||||
const titleLetterDate = computed(() =>
|
const titleLetterDate = computed(() =>
|
||||||
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
|
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
|
||||||
@@ -123,6 +127,10 @@ if (mode === 'add') {
|
|||||||
sepDate.value = `${year}-${month}-${day}`
|
sepDate.value = `${year}-${month}-${day}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onFetchChildren(parentId: string): Promise<void> {
|
||||||
|
console.log('onFetchChildren', parentId)
|
||||||
|
}
|
||||||
|
|
||||||
// Submit handler
|
// Submit handler
|
||||||
const onSubmit = handleSubmit((values) => {
|
const onSubmit = handleSubmit((values) => {
|
||||||
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
|
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
|
||||||
@@ -456,7 +464,7 @@ onMounted(() => {
|
|||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|
||||||
<Cell>
|
<Cell v-if="isShowPatient">
|
||||||
<Label height="compact">
|
<Label height="compact">
|
||||||
Klinik Tujuan
|
Klinik Tujuan
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
@@ -476,6 +484,22 @@ onMounted(() => {
|
|||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|
||||||
|
<Cell>
|
||||||
|
<Label height="compact">
|
||||||
|
Spesialis / Subspesialis
|
||||||
|
<span class="text-red-500">*</span>
|
||||||
|
</Label>
|
||||||
|
<Field :errMessage="errors.subSpecialistId">
|
||||||
|
<TreeSelect
|
||||||
|
id="subSpecialistId"
|
||||||
|
v-model="subSpecialistId"
|
||||||
|
v-bind="subSpecialistIdAttrs"
|
||||||
|
:data="specialists || []"
|
||||||
|
:on-fetch-children="onFetchChildren"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
</Cell>
|
||||||
|
|
||||||
<Cell>
|
<Cell>
|
||||||
<Label height="compact">
|
<Label height="compact">
|
||||||
DPJP
|
DPJP
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { toast } from '~/components/pub/ui/toast'
|
|||||||
|
|
||||||
// Types
|
// Types
|
||||||
import type { SepHistoryData } from '~/components/app/sep/list-cfg.history'
|
import type { SepHistoryData } from '~/components/app/sep/list-cfg.history'
|
||||||
|
import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import {
|
import {
|
||||||
@@ -27,6 +28,10 @@ import {
|
|||||||
} from '~/lib/constants.vclaim'
|
} from '~/lib/constants.vclaim'
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
|
import {
|
||||||
|
getList as getSpecialistList,
|
||||||
|
getValueTreeItems as getSpecialistTreeItems,
|
||||||
|
} from '~/services/specialist.service'
|
||||||
import { getValueLabelList as getProvinceList } from '~/services/vclaim-region-province.service'
|
import { getValueLabelList as getProvinceList } from '~/services/vclaim-region-province.service'
|
||||||
import { getValueLabelList as getCityList } from '~/services/vclaim-region-city.service'
|
import { getValueLabelList as getCityList } from '~/services/vclaim-region-city.service'
|
||||||
import { getValueLabelList as getDistrictList } from '~/services/vclaim-region-district.service'
|
import { getValueLabelList as getDistrictList } from '~/services/vclaim-region-district.service'
|
||||||
@@ -79,6 +84,7 @@ const classPaySourcesList = ref<Array<{ value: string; label: string }>>([])
|
|||||||
const isServiceHidden = ref(false)
|
const isServiceHidden = ref(false)
|
||||||
const isSaveLoading = ref(false)
|
const isSaveLoading = ref(false)
|
||||||
const isLetterReadonly = ref(false)
|
const isLetterReadonly = ref(false)
|
||||||
|
const specialistsTree = ref<TreeItem[]>([])
|
||||||
const resourceType = ref('')
|
const resourceType = ref('')
|
||||||
const resourcePath = ref('')
|
const resourcePath = ref('')
|
||||||
|
|
||||||
@@ -247,7 +253,8 @@ async function handleEvent(menu: string, value: any) {
|
|||||||
if (menu === 'search-patient-by-identifier') {
|
if (menu === 'search-patient-by-identifier') {
|
||||||
const text = value.text
|
const text = value.text
|
||||||
const type = value.type
|
const type = value.type
|
||||||
if (type === 'nationalId') {
|
const prevCardNumber = selectedPatientObject.value?.person?.residentIdentityNumber || ''
|
||||||
|
if (type === 'nationalId' && text !== prevCardNumber) {
|
||||||
getPatientByIdentifierSearch(text)
|
getPatientByIdentifierSearch(text)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -336,6 +343,18 @@ async function handleFetch(params: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleFetchSpecialists() {
|
||||||
|
try {
|
||||||
|
const specialistsResult = await getSpecialistList({ 'page-size': 100, includes: 'subspecialists' })
|
||||||
|
if (specialistsResult.success) {
|
||||||
|
const specialists = specialistsResult.body?.data || []
|
||||||
|
specialistsTree.value = getSpecialistTreeItems(specialists)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching specialist-subspecialist tree:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleInit() {
|
async function handleInit() {
|
||||||
const facilities = await getHealthFacilityLabelList({
|
const facilities = await getHealthFacilityLabelList({
|
||||||
healthcare: 'Puskesmas',
|
healthcare: 'Puskesmas',
|
||||||
@@ -392,6 +411,7 @@ async function handleInit() {
|
|||||||
value: item.toString(),
|
value: item.toString(),
|
||||||
label: classPaySources[item],
|
label: classPaySources[item],
|
||||||
})) as any
|
})) as any
|
||||||
|
await handleFetchSpecialists()
|
||||||
if (route.query) {
|
if (route.query) {
|
||||||
const queries = route.query as any
|
const queries = route.query as any
|
||||||
isServiceHidden.value = queries['is-service'] === 'true'
|
isServiceHidden.value = queries['is-service'] === 'true'
|
||||||
@@ -448,6 +468,8 @@ onMounted(async () => {
|
|||||||
SEP
|
SEP
|
||||||
</div>
|
</div>
|
||||||
<AppSepEntryForm
|
<AppSepEntryForm
|
||||||
|
:is-save-loading="isSaveLoading"
|
||||||
|
:is-service="isServiceHidden"
|
||||||
:doctors="doctors"
|
:doctors="doctors"
|
||||||
:diagnoses="diagnoses"
|
:diagnoses="diagnoses"
|
||||||
:facilities-from="facilitiesFrom"
|
:facilities-from="facilitiesFrom"
|
||||||
@@ -465,8 +487,7 @@ onMounted(async () => {
|
|||||||
:class-levels="classLevelsList"
|
:class-levels="classLevelsList"
|
||||||
:class-level-upgrades="classLevelUpgradesList"
|
:class-level-upgrades="classLevelUpgradesList"
|
||||||
:class-pay-sources="classPaySourcesList"
|
:class-pay-sources="classPaySourcesList"
|
||||||
:is-save-loading="isSaveLoading"
|
:specialists="specialistsTree"
|
||||||
:is-service="isServiceHidden"
|
|
||||||
:patient="selectedPatientObject"
|
:patient="selectedPatientObject"
|
||||||
:objects="selectedObjects"
|
:objects="selectedObjects"
|
||||||
@fetch="handleFetch"
|
@fetch="handleFetch"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const ERROR_MESSAGES = {
|
|||||||
cob: 'COB wajib diisi',
|
cob: 'COB wajib diisi',
|
||||||
cataract: 'Katarak wajib diisi',
|
cataract: 'Katarak wajib diisi',
|
||||||
clinicExcecutive: 'Klinkik eksekutif wajib diisi',
|
clinicExcecutive: 'Klinkik eksekutif wajib diisi',
|
||||||
|
subSpecialistId: 'Subspesialis wajib diisi',
|
||||||
procedureType: 'Jenis Prosedur wajib diisi',
|
procedureType: 'Jenis Prosedur wajib diisi',
|
||||||
supportCode: 'Kode Penunjang wajib diisi',
|
supportCode: 'Kode Penunjang wajib diisi',
|
||||||
note: 'Catatan wajib diisi',
|
note: 'Catatan wajib diisi',
|
||||||
@@ -89,6 +90,10 @@ const IntegrationBpjsSchema = z
|
|||||||
clinicExcecutive: z
|
clinicExcecutive: z
|
||||||
.string({ required_error: ERROR_MESSAGES.required.clinicExcecutive })
|
.string({ required_error: ERROR_MESSAGES.required.clinicExcecutive })
|
||||||
.min(1, ERROR_MESSAGES.required.clinicExcecutive),
|
.min(1, ERROR_MESSAGES.required.clinicExcecutive),
|
||||||
|
subSpecialistId: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.subSpecialistId })
|
||||||
|
.min(1, ERROR_MESSAGES.required.subSpecialistId)
|
||||||
|
.optional(),
|
||||||
procedureType: z
|
procedureType: z
|
||||||
.string({ required_error: ERROR_MESSAGES.required.procedureType })
|
.string({ required_error: ERROR_MESSAGES.required.procedureType })
|
||||||
.min(1, ERROR_MESSAGES.required.procedureType)
|
.min(1, ERROR_MESSAGES.required.procedureType)
|
||||||
|
|||||||
Reference in New Issue
Block a user