feat(sep): add query from encounter
This commit is contained in:
No files matched your search
@@ -37,9 +37,9 @@ const props = defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
submit: [values: DivisionFormData, resetForm: () => void]
|
(e: 'submit', values: DivisionFormData, resetForm: () => void): void
|
||||||
cancel: [resetForm: () => void]
|
(e: 'cancel', resetForm: () => void): void
|
||||||
click: (e: Event) => void
|
(e: 'click', action: 'search' | 'add' | 'add-sep', values?: any): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const relationshipOpts = mapToComboboxOptList(relationshipCodes)
|
const relationshipOpts = mapToComboboxOptList(relationshipCodes)
|
||||||
@@ -93,15 +93,26 @@ function onSippFileChange(e: Event) {
|
|||||||
console.log('sipp file', f)
|
console.log('sipp file', f)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAddSep() {
|
function onAddSep(formContext: any) {
|
||||||
// contoh handler tombol "+" di sebelah No. SEP
|
const formValues = {
|
||||||
console.log('open modal tambah SEP')
|
patient_name: formContext?.patient_name,
|
||||||
|
national_identity: formContext?.nik,
|
||||||
|
medical_record_number: formContext?.rm,
|
||||||
|
doctor_id: formContext?.doctor_id,
|
||||||
|
register_date: formContext?.register_date,
|
||||||
|
payment_type: formContext?.payment_type,
|
||||||
|
bpjs_number: formContext?.bpjs_number,
|
||||||
|
sep_type: formContext?.sep_type,
|
||||||
|
sep_number: formContext?.sep_number
|
||||||
|
}
|
||||||
|
|
||||||
|
emit('click', 'add-sep', formValues)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Form
|
<Form
|
||||||
v-slot="{ handleSubmit, resetForm }"
|
v-slot="{ handleSubmit, resetForm, values }"
|
||||||
as=""
|
as=""
|
||||||
keep-values
|
keep-values
|
||||||
:validation-schema="formSchema"
|
:validation-schema="formSchema"
|
||||||
@@ -188,7 +199,7 @@ function onAddSep() {
|
|||||||
<FormField v-slot="{ componentField }" name="doctor_id">
|
<FormField v-slot="{ componentField }" name="doctor_id">
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Combobox id="doctor_id" v-bind="componentField" :items="doctorOpts" />
|
<Combobox id="doctor_id" v-bind="componentField" :items="doctorOpts as any" />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -297,7 +308,7 @@ function onAddSep() {
|
|||||||
placeholder="Tambah SEP terlebih dahulu"
|
placeholder="Tambah SEP terlebih dahulu"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
/>
|
/>
|
||||||
<Button class="bg-primary" size="sm" variant="outline" @click.prevent="onAddSep">+</Button>
|
<Button class="bg-primary" size="sm" variant="outline" @click.prevent="() => onAddSep(values)">+</Button>
|
||||||
</div>
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -111,6 +111,14 @@ if (mode === 'add') {
|
|||||||
|
|
||||||
watch(props, (value) => {
|
watch(props, (value) => {
|
||||||
const patient = value.patient || ({} as PatientEntity)
|
const patient = value.patient || ({} as PatientEntity)
|
||||||
|
const objects = value.objects || ({} as any)
|
||||||
|
if (Object.keys(objects).length > 0) {
|
||||||
|
sepDate.value = objects?.registerDate || '-'
|
||||||
|
bpjsNumber.value = objects?.bpjsNumber || '-'
|
||||||
|
nationalId.value = objects?.nationalIdentity || '-'
|
||||||
|
medicalRecordNumber.value = objects?.medicalRecordNumber || '-'
|
||||||
|
patientName.value = objects?.patientName || '-'
|
||||||
|
}
|
||||||
if (Object.keys(patient).length > 0) {
|
if (Object.keys(patient).length > 0) {
|
||||||
bpjsNumber.value = '-'
|
bpjsNumber.value = '-'
|
||||||
nationalId.value = patient?.person?.residentIdentityNumber || '-'
|
nationalId.value = patient?.person?.residentIdentityNumber || '-'
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
// Components
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
DialogFooter,
|
|
||||||
} from '~/components/pub/ui/dialog'
|
|
||||||
import ListHistory from './list-history.vue'
|
|
||||||
|
|
||||||
// Types
|
|
||||||
import type { SepHistoryData } from './list-cfg.history'
|
|
||||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
open: boolean
|
|
||||||
histories: Array<SepHistoryData>
|
|
||||||
paginationMeta?: PaginationMeta
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(e: 'update:open', value: boolean): void
|
|
||||||
}>()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Dialog
|
|
||||||
:open="props.open"
|
|
||||||
@update:open="emit('update:open', $event)"
|
|
||||||
>
|
|
||||||
<DialogTrigger as-child></DialogTrigger>
|
|
||||||
<DialogContent class="max-w-[50%]">
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>History SEP</DialogTitle>
|
|
||||||
</DialogHeader>
|
|
||||||
|
|
||||||
<div class="overflow-x-auto rounded-lg border">
|
|
||||||
<ListHistory :data="histories" :pagination-meta="paginationMeta" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<DialogFooter></DialogFooter>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
</template>
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { DataTableLoader } from '~/components/pub/my-ui/data-table'
|
||||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -12,6 +13,18 @@ const isLoading = reactive<DataTableLoader>({
|
|||||||
isTableLoading: false,
|
isTableLoading: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const division = {
|
||||||
|
msg: {
|
||||||
|
placeholder: 'Pilih Divisi',
|
||||||
|
search: 'Cari Divisi',
|
||||||
|
empty: 'Divisi tidak ditemukan',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = ref([{ value: '1', label: 'Division 1', code: 'DIV1' }])
|
||||||
|
|
||||||
|
const schema = {}
|
||||||
|
|
||||||
async function getPatientList() {
|
async function getPatientList() {
|
||||||
isLoading.isTableLoading = true
|
isLoading.isTableLoading = true
|
||||||
const resp = await xfetch('/api/v1/patient')
|
const resp = await xfetch('/api/v1/patient')
|
||||||
@@ -25,12 +38,38 @@ onMounted(() => {
|
|||||||
getPatientList()
|
getPatientList()
|
||||||
})
|
})
|
||||||
|
|
||||||
function onClick(e: 'search' | 'add') {
|
function toKebabCase(str: string): string {
|
||||||
|
return str.replace(/_/g, '-').toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
function toNavigateSep(values: any) {
|
||||||
|
const queryParams = new URLSearchParams()
|
||||||
|
Object.keys(values).forEach(field => {
|
||||||
|
if (values[field]) {
|
||||||
|
queryParams.append(toKebabCase(field), values[field])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
navigateTo('/integration/bpjs/sep/add' + `?${queryParams.toString()}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSubmit(values: any, resetForm: () => void) {
|
||||||
|
console.log('submit', values)
|
||||||
|
resetForm()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCancel(resetForm: () => void) {
|
||||||
|
console.log('cancel')
|
||||||
|
resetForm()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClick(e: 'search' | 'add' | 'add-sep', formValues?: any) {
|
||||||
console.log('click', e)
|
console.log('click', e)
|
||||||
if (e === 'search') {
|
if (e === 'search') {
|
||||||
isOpen.value = true
|
console.log('search')
|
||||||
} else if (e === 'add') {
|
} else if (e === 'add') {
|
||||||
navigateTo('/client/patient/add')
|
navigateTo('/client/patient/add')
|
||||||
|
} else if (e === 'add-sep') {
|
||||||
|
toNavigateSep({ resource: 'encounter', is_service: 'false', ...formValues })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,13 +78,29 @@ provide('table_data_loader', isLoading)
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg xl:text-xl">
|
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg xl:text-xl">
|
||||||
<Icon name="i-lucide-user" class="me-2" />
|
<Icon
|
||||||
<span class="font-semibold">{{ props.formType }}</span> Kunjungan
|
name="i-lucide-user"
|
||||||
|
class="me-2"
|
||||||
|
/>
|
||||||
|
<span class="font-semibold">{{ props.formType }}</span>
|
||||||
|
Kunjungan
|
||||||
</div>
|
</div>
|
||||||
<AppEncounterEntryForm @click="onClick" />
|
<AppEncounterEntryForm
|
||||||
|
:division="division"
|
||||||
|
:items="items"
|
||||||
|
:schema="schema"
|
||||||
|
@click="onClick"
|
||||||
|
@submit="onSubmit"
|
||||||
|
@cancel="onCancel"
|
||||||
|
/>
|
||||||
<AppSepSmallEntry v-if="props.id" />
|
<AppSepSmallEntry v-if="props.id" />
|
||||||
|
|
||||||
<Dialog v-model:open="isOpen" title="Cari Pasien" size="xl" prevent-outside>
|
<Dialog
|
||||||
|
v-model:open="isOpen"
|
||||||
|
title="Cari Pasien"
|
||||||
|
size="xl"
|
||||||
|
prevent-outside
|
||||||
|
>
|
||||||
<AppPatientPicker :data="data" />
|
<AppPatientPicker :data="data" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -37,6 +37,7 @@ import { getValueLabelList as getDiagnoseLabelList } from '~/services/vclaim-dia
|
|||||||
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 { create as createSep, makeSepData } from '~/services/vclaim-sep.service'
|
import { create as createSep, makeSepData } from '~/services/vclaim-sep.service'
|
||||||
|
import { se } from 'date-fns/locale'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const openPatient = ref(false)
|
const openPatient = ref(false)
|
||||||
@@ -379,9 +380,20 @@ async function handleInit() {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await handleInit()
|
await handleInit()
|
||||||
if (route.query) {
|
if (route.query) {
|
||||||
|
// resource=encounter®ister-date=2025-10-23&payment-type=bpjs&bpjs-number=121212121222&sep-type=ri
|
||||||
const queries = route.query as any
|
const queries = route.query as any
|
||||||
selectedObjects.value = { ...queries }
|
|
||||||
isServiceHidden.value = queries['is-service'] === 'true'
|
isServiceHidden.value = queries['is-service'] === 'true'
|
||||||
|
selectedObjects.value = {}
|
||||||
|
if (queries['bpjs-number']) selectedObjects.value['bpjsNumber'] = queries['bpjs-number']
|
||||||
|
if (queries['sep-type']) selectedObjects.value['sepType'] = queries['sep-type']
|
||||||
|
if (queries['sep-number']) selectedObjects.value['sepNumber'] = queries['sep-number']
|
||||||
|
if (queries['register-date']) selectedObjects.value['registerDate'] = queries['register-date']
|
||||||
|
if (queries['doctor-id']) selectedObjects.value['doctorId'] = queries['doctor-id']
|
||||||
|
if (queries['patient_name']) selectedObjects.value['patientName'] = queries['patient_name']
|
||||||
|
if (queries['national_identity']) selectedObjects.value['nationalIdentity'] = queries['national_identity']
|
||||||
|
if (queries['payment-type']) selectedObjects.value['paymentType'] = queries['payment-type']
|
||||||
|
if (queries['medical_record_number'])
|
||||||
|
selectedObjects.value['medicalRecordNumber'] = queries['medical_record_number']
|
||||||
delete selectedObjects.value['is-service']
|
delete selectedObjects.value['is-service']
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user