Merge branch 'dev' of https://github.com/dikstub-rssa/simrs-fe into feat/rm-rajal-183
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
// Components
|
||||
import EncounterPatientInfo from '~/components/app/encounter/patient-info.vue'
|
||||
|
||||
// Models
|
||||
import { genEncounter } from '~/models/encounter'
|
||||
|
||||
// Handlers
|
||||
import { getEncounterData } from '~/handlers/encounter-process.handler'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const data = ref<any>(genEncounter())
|
||||
const isShowPatient = computed(() => data.value && data.value?.patient?.person)
|
||||
|
||||
async function getData() {
|
||||
data.value = await getEncounterData(id)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getData()
|
||||
})
|
||||
|
||||
function handleClick(type: string) {
|
||||
if (type === 'draft') {
|
||||
router.back()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full">
|
||||
<div class="mb-4">
|
||||
<PubMyUiNavContentBa label="Kembali ke Daftar Kunjungan" @click="handleClick" />
|
||||
</div>
|
||||
<EncounterPatientInfo v-if="isShowPatient" :data="data" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,43 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
// Components
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import { Button } from '~/components/pub/ui/button'
|
||||
import AppEncounterEntryForm from '~/components/app/encounter/entry-form.vue'
|
||||
import AppViewPatient from '~/components/app/patient/view-patient.vue'
|
||||
|
||||
// Types
|
||||
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
||||
import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
|
||||
|
||||
// Constants
|
||||
import { paymentTypes, sepRefTypeCodes, participantGroups } from '~/lib/constants.vclaim'
|
||||
|
||||
// Services
|
||||
import {
|
||||
getList as getSpecialistList,
|
||||
getValueTreeItems as getSpecialistTreeItems,
|
||||
} from '~/services/specialist.service'
|
||||
import { getValueLabelList as getDoctorValueLabelList } from '~/services/doctor.service'
|
||||
import { create as createEncounter, getDetail as getEncounterDetail, update as updateEncounter } from '~/services/encounter.service'
|
||||
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
||||
|
||||
// Helpers
|
||||
import { refDebounced } from '@vueuse/core'
|
||||
|
||||
// Handlers
|
||||
import {
|
||||
patients,
|
||||
selectedPatient,
|
||||
selectedPatientObject,
|
||||
paginationMeta,
|
||||
getPatientsList,
|
||||
getPatientCurrent,
|
||||
getPatientByIdentifierSearch,
|
||||
} from '~/handlers/patient.handler'
|
||||
|
||||
// Stores
|
||||
import { useUserStore } from '~/stores/user'
|
||||
import { getDetail as getDoctorDetail } from '~/services/doctor.service'
|
||||
import { useEncounterEntry } from '~/handlers/encounter-entry.handler'
|
||||
import { genDoctor, type Doctor } from '~/models/doctor'
|
||||
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
id: number
|
||||
classCode?: 'ambulatory' | 'emergency' | 'inpatient' | 'outpatient'
|
||||
@@ -46,54 +21,69 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const route = useRoute()
|
||||
const userStore = useUserStore()
|
||||
const openPatient = ref(false)
|
||||
const isLoading = reactive<DataTableLoader>({
|
||||
isTableLoading: false,
|
||||
})
|
||||
const paymentsList = ref<Array<{ value: string; label: string }>>([])
|
||||
const sepsList = ref<Array<{ value: string; label: string }>>([])
|
||||
const participantGroupsList = ref<Array<{ value: string; label: string }>>([])
|
||||
const specialistsTree = ref<TreeItem[]>([])
|
||||
const specialistsData = ref<any[]>([]) // Store full specialist data with id
|
||||
const doctorsList = ref<Array<{ value: string; label: string }>>([])
|
||||
const recSelectId = ref<number | null>(null)
|
||||
const isSaving = ref(false)
|
||||
const isLoadingDetail = ref(false)
|
||||
const formRef = ref<InstanceType<typeof AppEncounterEntryForm> | null>(null)
|
||||
const encounterData = ref<any>(null)
|
||||
const formObjects = ref<any>({})
|
||||
|
||||
// SEP validation state
|
||||
const isSepValid = ref(false)
|
||||
const isCheckingSep = ref(false)
|
||||
const sepNumber = ref('')
|
||||
const {
|
||||
paymentsList,
|
||||
sepNumber,
|
||||
sepsList,
|
||||
participantGroupsList,
|
||||
specialistsTree,
|
||||
doctorsList,
|
||||
recSelectId,
|
||||
isLoadingDetail,
|
||||
formObjects,
|
||||
openPatient,
|
||||
isSepValid,
|
||||
isCheckingSep,
|
||||
isSaveDisabled,
|
||||
isSaving,
|
||||
isLoading,
|
||||
patients,
|
||||
selectedPatient,
|
||||
selectedPatientObject,
|
||||
paginationMeta,
|
||||
toNavigateSep,
|
||||
getListPath,
|
||||
handleInit,
|
||||
loadEncounterDetail,
|
||||
handleSaveEncounter,
|
||||
getPatientsList,
|
||||
getPatientCurrent,
|
||||
getPatientByIdentifierSearch,
|
||||
getIsSubspecialist,
|
||||
getValidateSepNumber,
|
||||
handleFetchDoctors,
|
||||
} = useEncounterEntry(props)
|
||||
|
||||
const debouncedSepNumber = refDebounced(sepNumber, 500)
|
||||
const selectedDoctor = ref<Doctor>(genDoctor())
|
||||
|
||||
// Computed for edit mode
|
||||
const isEditMode = computed(() => props.id > 0)
|
||||
provide('rec_select_id', recSelectId)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
// Computed for save button disable state
|
||||
const isSaveDisabled = computed(() => {
|
||||
return !selectedPatient.value || !selectedPatientObject.value || isSaving.value || isLoadingDetail.value
|
||||
watch(debouncedSepNumber, async (newValue) => {
|
||||
await getValidateSepNumber(newValue)
|
||||
})
|
||||
|
||||
function getListPath(): string {
|
||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
||||
return '/rehab/encounter'
|
||||
}
|
||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
|
||||
return '/outpatient/encounter'
|
||||
}
|
||||
if (props.classCode === 'emergency') {
|
||||
return '/emergency/encounter'
|
||||
}
|
||||
if (props.classCode === 'inpatient') {
|
||||
return '/inpatient/encounter'
|
||||
}
|
||||
return '/encounter' // fallback
|
||||
}
|
||||
watch(
|
||||
() => formObjects.value?.paymentType,
|
||||
(newValue) => {
|
||||
isSepValid.value = false
|
||||
if (newValue !== 'jkn') {
|
||||
sepNumber.value = ''
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
onMounted(async () => {
|
||||
await handleInit()
|
||||
if (props.id > 0) {
|
||||
await loadEncounterDetail()
|
||||
}
|
||||
})
|
||||
|
||||
///// Functions
|
||||
function handleSavePatient() {
|
||||
selectedPatientObject.value = null
|
||||
setTimeout(() => {
|
||||
@@ -101,140 +91,15 @@ function handleSavePatient() {
|
||||
}, 150)
|
||||
}
|
||||
|
||||
function toKebabCase(str: string): string {
|
||||
return str.replace(/([A-Z])/g, '-$1').toLowerCase()
|
||||
function handleSaveClick() {
|
||||
if (formRef.value && typeof formRef.value.submitForm === 'function') {
|
||||
formRef.value.submitForm()
|
||||
}
|
||||
}
|
||||
|
||||
function toNavigateSep(values: any) {
|
||||
const queryParams = new URLSearchParams()
|
||||
if (values['subSpecialistCode']) {
|
||||
const isSub = isSubspecialist(values['subSpecialistCode'], specialistsTree.value)
|
||||
if (!isSub) {
|
||||
values['specialistCode'] = values['subSpecialistCode']
|
||||
delete values['subSpecialistCode']
|
||||
}
|
||||
}
|
||||
|
||||
Object.keys(values).forEach((field) => {
|
||||
if (values[field]) {
|
||||
queryParams.append(toKebabCase(field), values[field])
|
||||
}
|
||||
})
|
||||
|
||||
navigateTo('/integration/bpjs/sep/add' + `?${queryParams.toString()}`)
|
||||
}
|
||||
|
||||
async function handleSaveEncounter(formValues: any) {
|
||||
// Validate patient is selected
|
||||
if (!selectedPatient.value || !selectedPatientObject.value) {
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: 'Pasien harus dipilih terlebih dahulu',
|
||||
variant: 'destructive',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
isSaving.value = true
|
||||
|
||||
// Get employee_id from user store
|
||||
const employeeId = userStore.user?.employee_id || userStore.user?.employee?.id || 0
|
||||
|
||||
// Format date to ISO format
|
||||
const formatDate = (dateString: string): string => {
|
||||
if (!dateString) return ''
|
||||
const date = new Date(dateString)
|
||||
return date.toISOString()
|
||||
}
|
||||
|
||||
// Get specialist_id and subspecialist_id from TreeSelect value (code)
|
||||
const { specialist_id, subspecialist_id } = getSpecialistIdsFromCode(formValues.subSpecialistId || '')
|
||||
|
||||
// Build payload
|
||||
const payload: any = {
|
||||
patient_id: selectedPatientObject.value?.id || Number(selectedPatient.value),
|
||||
registeredAt: formatDate(formValues.registerDate),
|
||||
visitDate: formatDate(formValues.registerDate),
|
||||
class_code: props.classCode || '',
|
||||
subClass_code: props.subClassCode || '',
|
||||
infra_id: null,
|
||||
unit_id: null,
|
||||
appointment_doctor_id: Number(formValues.doctorId),
|
||||
responsible_doctor_id: Number(formValues.doctorId),
|
||||
paymentType: formValues.paymentType,
|
||||
cardNumber: formValues.cardNumber,
|
||||
refSource_name: '',
|
||||
appointment_id: null,
|
||||
}
|
||||
|
||||
if (employeeId && employeeId > 0) {
|
||||
payload.adm_employee_id = employeeId
|
||||
}
|
||||
|
||||
// Add specialist_id and subspecialist_id if available
|
||||
if (specialist_id) {
|
||||
payload.specialist_id = specialist_id
|
||||
}
|
||||
if (subspecialist_id) {
|
||||
payload.subspecialist_id = subspecialist_id
|
||||
}
|
||||
|
||||
let paymentMethod = 'cash'
|
||||
if (formValues.paymentType === 'jkn' || formValues.paymentType === 'jkmm') {
|
||||
paymentMethod = 'insurance'
|
||||
} else if (formValues.paymentType === 'spm') {
|
||||
paymentMethod = 'cash'
|
||||
} else if (formValues.paymentType === 'pks') {
|
||||
paymentMethod = 'membership'
|
||||
}
|
||||
|
||||
if (paymentMethod === 'insurance') {
|
||||
payload.paymentMethod_code = paymentMethod
|
||||
payload.insuranceCompany_id = null
|
||||
payload.member_number = formValues.cardNumber
|
||||
payload.ref_number = formValues.sepNumber
|
||||
}
|
||||
|
||||
// Add visitMode_code and allocatedVisitCount only if classCode is ambulatory
|
||||
if (props.classCode === 'ambulatory') {
|
||||
payload.visitMode_code = 'adm'
|
||||
payload.allocatedVisitCount = 0
|
||||
}
|
||||
|
||||
// Call encounter service - use update if edit mode, create otherwise
|
||||
let result
|
||||
if (isEditMode.value) {
|
||||
result = await updateEncounter(props.id, payload)
|
||||
} else {
|
||||
result = await createEncounter(payload)
|
||||
}
|
||||
|
||||
if (result.success) {
|
||||
toast({
|
||||
title: 'Berhasil',
|
||||
description: isEditMode.value ? 'Kunjungan berhasil diperbarui' : 'Kunjungan berhasil dibuat',
|
||||
variant: 'default',
|
||||
})
|
||||
// Redirect to list page
|
||||
await navigateTo(getListPath())
|
||||
} else {
|
||||
const errorMessage = result.body?.message || (isEditMode.value ? 'Gagal memperbarui kunjungan' : 'Gagal membuat kunjungan')
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: errorMessage,
|
||||
variant: 'destructive',
|
||||
})
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('Error saving encounter:', error)
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: error?.message || (isEditMode.value ? 'Gagal memperbarui kunjungan' : 'Gagal membuat kunjungan'),
|
||||
variant: 'destructive',
|
||||
})
|
||||
} finally {
|
||||
isSaving.value = false
|
||||
function handleFetch(value?: any) {
|
||||
if (value?.subSpecialistId) {
|
||||
handleFetchDoctors(value.subSpecialistId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,11 +111,9 @@ async function handleEvent(menu: string, value?: any) {
|
||||
} else if (menu === 'add') {
|
||||
navigateTo('/client/patient/add')
|
||||
} else if (menu === 'add-sep') {
|
||||
// If SEP is already valid, don't navigate
|
||||
if (isSepValid.value) {
|
||||
return
|
||||
}
|
||||
recSelectId.value = null
|
||||
toNavigateSep({
|
||||
isService: 'false',
|
||||
sourcePath: route.path,
|
||||
@@ -258,10 +121,7 @@ async function handleEvent(menu: string, value?: any) {
|
||||
...value,
|
||||
})
|
||||
} else if (menu === 'sep-number-changed') {
|
||||
// Update sepNumber when it changes in form (only if different to prevent loop)
|
||||
if (sepNumber.value !== value) {
|
||||
sepNumber.value = value || ''
|
||||
}
|
||||
await getValidateSepNumber(String(value || ''))
|
||||
} else if (menu === 'save') {
|
||||
await handleSaveEncounter(value)
|
||||
} else if (menu === 'cancel') {
|
||||
@@ -269,435 +129,13 @@ async function handleEvent(menu: string, value?: any) {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle save button click
|
||||
function handleSaveClick() {
|
||||
console.log('🔵 handleSaveClick called')
|
||||
console.log('🔵 formRef:', formRef.value)
|
||||
console.log('🔵 isSaveDisabled:', isSaveDisabled.value)
|
||||
console.log('🔵 selectedPatient:', selectedPatient.value)
|
||||
console.log('🔵 selectedPatientObject:', selectedPatientObject.value)
|
||||
console.log('🔵 isSaving:', isSaving.value)
|
||||
console.log('🔵 isLoadingDetail:', isLoadingDetail.value)
|
||||
|
||||
if (formRef.value && typeof formRef.value.submitForm === 'function') {
|
||||
console.log('🔵 Calling formRef.value.submitForm()')
|
||||
formRef.value.submitForm()
|
||||
} else {
|
||||
console.error('❌ formRef.value is null or submitForm is not a function')
|
||||
async function getDoctorInfo(value: string) {
|
||||
const resp = await getDoctorDetail(value, { includes: 'unit,specialist,subspecialist'})
|
||||
if (resp.success) {
|
||||
selectedDoctor.value = resp.body.data
|
||||
// console.log(selectedDoctor.value)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate SEP number
|
||||
*/
|
||||
async function validateSepNumber(sepNumberValue: string) {
|
||||
// Reset validation if SEP number is empty
|
||||
if (!sepNumberValue || sepNumberValue.trim() === '') {
|
||||
isSepValid.value = false
|
||||
isCheckingSep.value = false
|
||||
return
|
||||
}
|
||||
|
||||
// Only check if payment type is JKN
|
||||
// We need to check from formObjects
|
||||
const paymentType = formObjects.value?.paymentType
|
||||
if (paymentType !== 'jkn') {
|
||||
isSepValid.value = false
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
isCheckingSep.value = true
|
||||
const result = await getSepList({ number: sepNumberValue.trim() })
|
||||
|
||||
// Check if SEP is found
|
||||
// If response is not null, SEP is found
|
||||
// If response is null with metaData code "201", SEP is not found
|
||||
if (result.success && result.body?.response !== null) {
|
||||
isSepValid.value = true
|
||||
} else {
|
||||
// SEP not found (response null with metaData code "201")
|
||||
isSepValid.value = false
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error checking SEP:', error)
|
||||
isSepValid.value = false
|
||||
} finally {
|
||||
isCheckingSep.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// Watch debounced SEP number to validate
|
||||
watch(debouncedSepNumber, async (newValue) => {
|
||||
await validateSepNumber(newValue)
|
||||
})
|
||||
|
||||
// Watch payment type to reset SEP validation
|
||||
watch(
|
||||
() => formObjects.value?.paymentType,
|
||||
(newValue) => {
|
||||
isSepValid.value = false
|
||||
// If payment type is not JKN, clear SEP number
|
||||
if (newValue !== 'jkn') {
|
||||
sepNumber.value = ''
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
async function handleFetchSpecialists() {
|
||||
try {
|
||||
const specialistsResult = await getSpecialistList({ 'page-size': 100, includes: 'subspecialists' })
|
||||
if (specialistsResult.success) {
|
||||
const specialists = specialistsResult.body?.data || []
|
||||
specialistsData.value = specialists // Store full data for mapping
|
||||
specialistsTree.value = getSpecialistTreeItems(specialists)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching specialist-subspecialist tree:', error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to check if a value exists in the specialistsTree
|
||||
* Returns true if it's a leaf node (subspecialist), false if parent node (specialist)
|
||||
*/
|
||||
function isSubspecialist(value: string, items: TreeItem[]): boolean {
|
||||
for (const item of items) {
|
||||
if (item.value === value) {
|
||||
// If this item has children, it's not selected, so skip
|
||||
// If this is the selected item, check if it has children in the tree
|
||||
return false // This means it's a specialist, not a subspecialist
|
||||
}
|
||||
if (item.children) {
|
||||
for (const child of item.children) {
|
||||
if (child.value === value) {
|
||||
// This is a subspecialist (leaf node)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get specialist/subspecialist code from ID
|
||||
* Returns code string or null if not found
|
||||
*/
|
||||
function getSpecialistCodeFromId(id: number | null | undefined): string | null {
|
||||
if (!id) return null
|
||||
|
||||
// First check if encounter has specialist object with code
|
||||
if (encounterData.value?.specialist?.id === id) {
|
||||
return encounterData.value.specialist.code || null
|
||||
}
|
||||
|
||||
// Search in specialistsData
|
||||
for (const specialist of specialistsData.value) {
|
||||
if (specialist.id === id) {
|
||||
return specialist.code || null
|
||||
}
|
||||
// Check subspecialists
|
||||
if (specialist.subspecialists && Array.isArray(specialist.subspecialists)) {
|
||||
for (const subspecialist of specialist.subspecialists) {
|
||||
if (subspecialist.id === id) {
|
||||
return subspecialist.code || null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get subspecialist code from ID
|
||||
* Returns code string or null if not found
|
||||
*/
|
||||
function getSubspecialistCodeFromId(id: number | null | undefined): string | null {
|
||||
if (!id) return null
|
||||
|
||||
// First check if encounter has subspecialist object with code
|
||||
if (encounterData.value?.subspecialist?.id === id) {
|
||||
return encounterData.value.subspecialist.code || null
|
||||
}
|
||||
|
||||
// Search in specialistsData
|
||||
for (const specialist of specialistsData.value) {
|
||||
if (specialist.subspecialists && Array.isArray(specialist.subspecialists)) {
|
||||
for (const subspecialist of specialist.subspecialists) {
|
||||
if (subspecialist.id === id) {
|
||||
return subspecialist.code || null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to find specialist_id and subspecialist_id from TreeSelect value (code)
|
||||
* Returns { specialist_id: number | null, subspecialist_id: number | null }
|
||||
*/
|
||||
function getSpecialistIdsFromCode(code: string): { specialist_id: number | null; subspecialist_id: number | null } {
|
||||
if (!code) {
|
||||
return { specialist_id: null, subspecialist_id: null }
|
||||
}
|
||||
|
||||
// Check if it's a subspecialist
|
||||
const isSub = isSubspecialist(code, specialistsTree.value)
|
||||
|
||||
if (isSub) {
|
||||
// Find subspecialist and its parent specialist
|
||||
for (const specialist of specialistsData.value) {
|
||||
if (specialist.subspecialists && Array.isArray(specialist.subspecialists)) {
|
||||
for (const subspecialist of specialist.subspecialists) {
|
||||
if (subspecialist.code === code) {
|
||||
return {
|
||||
specialist_id: specialist.id ? Number(specialist.id) : null,
|
||||
subspecialist_id: subspecialist.id ? Number(subspecialist.id) : null,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// It's a specialist
|
||||
for (const specialist of specialistsData.value) {
|
||||
if (specialist.code === code) {
|
||||
return {
|
||||
specialist_id: specialist.id ? Number(specialist.id) : null,
|
||||
subspecialist_id: null,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { specialist_id: null, subspecialist_id: null }
|
||||
}
|
||||
|
||||
async function handleFetchDoctors(subSpecialistId: string | null = null) {
|
||||
try {
|
||||
// Build filter based on selection type
|
||||
const filterParams: any = { 'page-size': 100, includes: 'employee-Person' }
|
||||
|
||||
if (!subSpecialistId) {
|
||||
const doctors = await getDoctorValueLabelList(filterParams)
|
||||
doctorsList.value = doctors
|
||||
return
|
||||
}
|
||||
|
||||
// Check if the selectd value is a subspecialist or specialist
|
||||
const isSub = isSubspecialist(subSpecialistId, specialistsTree.value)
|
||||
|
||||
if (isSub) {
|
||||
// If selected is subspecialist, filter by subspecialist-id
|
||||
filterParams['subspecialist-id'] = subSpecialistId
|
||||
} else {
|
||||
// If selected is specialist, filter by specialist-id
|
||||
filterParams['specialist-id'] = subSpecialistId
|
||||
}
|
||||
|
||||
const doctors = await getDoctorValueLabelList(filterParams)
|
||||
doctorsList.value = doctors
|
||||
} catch (error) {
|
||||
console.error('Error fetching doctors:', error)
|
||||
doctorsList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function handleFetch(value?: any) {
|
||||
if (value?.subSpecialistId) {
|
||||
// handleFetchDoctors(value.subSpecialistId)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleInit() {
|
||||
selectedPatientObject.value = null
|
||||
paymentsList.value = Object.keys(paymentTypes).map((item) => ({
|
||||
value: item.toString(),
|
||||
label: paymentTypes[item],
|
||||
})) as any
|
||||
sepsList.value = Object.keys(sepRefTypeCodes).map((item) => ({
|
||||
value: item.toString(),
|
||||
label: sepRefTypeCodes[item],
|
||||
})) as any
|
||||
participantGroupsList.value = Object.keys(participantGroups).map((item) => ({
|
||||
value: item.toString(),
|
||||
label: participantGroups[item],
|
||||
})) as any
|
||||
// Fetch tree data
|
||||
await handleFetchDoctors()
|
||||
await handleFetchSpecialists()
|
||||
}
|
||||
|
||||
/**
|
||||
* Load encounter detail data for edit mode
|
||||
*/
|
||||
async function loadEncounterDetail() {
|
||||
if (!isEditMode.value || props.id <= 0) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
isLoadingDetail.value = true
|
||||
// Include patient, person, specialist, and subspecialist in the response
|
||||
const result = await getEncounterDetail(props.id, {
|
||||
includes: 'patient,patient-person,specialist,subspecialist',
|
||||
})
|
||||
if (result.success && result.body?.data) {
|
||||
encounterData.value = result.body.data
|
||||
await mapEncounterToForm(encounterData.value)
|
||||
// Set loading to false after mapping is complete
|
||||
isLoadingDetail.value = false
|
||||
} else {
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: 'Gagal memuat data kunjungan',
|
||||
variant: 'destructive',
|
||||
})
|
||||
// Redirect to list page if encounter not found
|
||||
await navigateTo(getListPath())
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('Error loading encounter detail:', error)
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: error?.message || 'Gagal memuat data kunjungan',
|
||||
variant: 'destructive',
|
||||
})
|
||||
// Redirect to list page on error
|
||||
await navigateTo(getListPath())
|
||||
} finally {
|
||||
isLoadingDetail.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map encounter data to form fields
|
||||
*/
|
||||
async function mapEncounterToForm(encounter: any) {
|
||||
if (!encounter) return
|
||||
|
||||
// Set patient data - use data from response if available
|
||||
if (encounter.patient) {
|
||||
selectedPatient.value = String(encounter.patient.id)
|
||||
selectedPatientObject.value = encounter.patient
|
||||
// Only fetch patient if person data is missing
|
||||
if (!encounter.patient.person) {
|
||||
await getPatientCurrent(selectedPatient.value)
|
||||
}
|
||||
}
|
||||
|
||||
// Map form fields
|
||||
const formData: any = {}
|
||||
|
||||
// Patient data (readonly, populated from selected patient)
|
||||
// Use encounter.patient.person which is already in the response
|
||||
if (encounter.patient?.person) {
|
||||
formData.patientName = encounter.patient.person.name || ''
|
||||
formData.nationalIdentity = encounter.patient.person.residentIdentityNumber || ''
|
||||
formData.medicalRecordNumber = encounter.patient.number || ''
|
||||
} else if (selectedPatientObject.value?.person) {
|
||||
// Fallback to selectedPatientObject if encounter.patient.person is not available
|
||||
formData.patientName = selectedPatientObject.value.person.name || ''
|
||||
formData.nationalIdentity = selectedPatientObject.value.person.residentIdentityNumber || ''
|
||||
formData.medicalRecordNumber = selectedPatientObject.value.number || ''
|
||||
}
|
||||
|
||||
// Doctor ID
|
||||
const doctorId = encounter.appointment_doctor_id || encounter.responsible_doctor_id
|
||||
if (doctorId) {
|
||||
formData.doctorId = String(doctorId)
|
||||
}
|
||||
|
||||
// Specialist/Subspecialist - use helper function to get code from ID
|
||||
// Priority: subspecialist_id > specialist_id
|
||||
if (encounter.subspecialist_id) {
|
||||
const subspecialistCode = getSubspecialistCodeFromId(encounter.subspecialist_id)
|
||||
if (subspecialistCode) {
|
||||
formData.subSpecialistId = subspecialistCode
|
||||
}
|
||||
} else if (encounter.specialist_id) {
|
||||
const specialistCode = getSpecialistCodeFromId(encounter.specialist_id)
|
||||
if (specialistCode) {
|
||||
formData.subSpecialistId = specialistCode
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: if encounter has specialist/subspecialist object with code
|
||||
if (!formData.subSpecialistId) {
|
||||
if (encounter.subspecialist?.code) {
|
||||
formData.subSpecialistId = encounter.subspecialist.code
|
||||
} else if (encounter.specialist?.code) {
|
||||
formData.subSpecialistId = encounter.specialist.code
|
||||
}
|
||||
}
|
||||
|
||||
// Register date
|
||||
if (encounter.registeredAt) {
|
||||
// Convert ISO date to local date string (YYYY-MM-DD)
|
||||
const date = new Date(encounter.registeredAt)
|
||||
formData.registerDate = date.toISOString().split('T')[0]
|
||||
} else if (encounter.visitDate) {
|
||||
const date = new Date(encounter.visitDate)
|
||||
formData.registerDate = date.toISOString().split('T')[0]
|
||||
}
|
||||
|
||||
// Payment data - use fields directly from encounter
|
||||
// Map paymentMethod_code to paymentType
|
||||
if (encounter.paymentMethod_code) {
|
||||
// Map paymentMethod_code to paymentType
|
||||
// 'insurance' typically means JKN/JKMM
|
||||
if (encounter.paymentMethod_code === 'insurance') {
|
||||
formData.paymentType = 'jkn' // Default to JKN for insurance
|
||||
} else {
|
||||
// For other payment methods, use the code directly if it matches
|
||||
// Otherwise default to 'spm'
|
||||
const validPaymentTypes = ['jkn', 'jkmm', 'spm', 'pks']
|
||||
if (validPaymentTypes.includes(encounter.paymentMethod_code)) {
|
||||
formData.paymentType = encounter.paymentMethod_code
|
||||
} else {
|
||||
formData.paymentType = 'spm' // Default to SPM
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If paymentMethod_code is empty or null, default to 'spm'
|
||||
formData.paymentType = 'spm'
|
||||
}
|
||||
|
||||
// Map payment fields directly from encounter
|
||||
formData.cardNumber = encounter.member_number || ''
|
||||
formData.sepNumber = encounter.ref_number || ''
|
||||
|
||||
// Note: patientCategory and sepType might not be available in the response
|
||||
// These fields might need to be set manually or fetched from other sources
|
||||
|
||||
// Set form objects for the form component
|
||||
formObjects.value = formData
|
||||
|
||||
// Update sepNumber for validation
|
||||
if (formData.sepNumber) {
|
||||
sepNumber.value = formData.sepNumber
|
||||
}
|
||||
|
||||
// Fetch doctors based on specialist/subspecialist selection
|
||||
if (formData.subSpecialistId) {
|
||||
await handleFetchDoctors(formData.subSpecialistId)
|
||||
}
|
||||
}
|
||||
|
||||
provide('rec_select_id', recSelectId)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
onMounted(async () => {
|
||||
await handleInit()
|
||||
// Load encounter detail if in edit mode
|
||||
if (isEditMode.value) {
|
||||
await loadEncounterDetail()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -719,9 +157,11 @@ onMounted(async () => {
|
||||
:seps="sepsList"
|
||||
:participant-groups="participantGroupsList"
|
||||
:specialists="specialistsTree"
|
||||
:doctor="doctorsList"
|
||||
:doctorItems="doctorsList"
|
||||
:selectedDoctor="selectedDoctor"
|
||||
:patient="selectedPatientObject"
|
||||
:objects="formObjects"
|
||||
@on-select-doctor="getDoctorInfo"
|
||||
@event="handleEvent"
|
||||
@fetch="handleFetch"
|
||||
/>
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { getDetail } from '~/services/encounter.service'
|
||||
|
||||
import type { TabItem } from '~/components/pub/my-ui/comp-tab/type'
|
||||
import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue'
|
||||
|
||||
// PLASE ORDER BY TAB POSITION
|
||||
import Status from '~/components/content/encounter/status.vue'
|
||||
import AssesmentFunctionList from '~/components/content/assesment-function/list.vue'
|
||||
import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
|
||||
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
|
||||
import PrescriptionList from '~/components/content/prescription/list.vue'
|
||||
import Consultation from '~/components/content/consultation/list.vue'
|
||||
import ProtocolList from '~/components/app/chemotherapy/list.protocol.vue'
|
||||
import MedicineProtocolList from '~/components/app/chemotherapy/list.medicine.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const props = defineProps<{
|
||||
classes?: string
|
||||
}>()
|
||||
|
||||
// activeTab selalu sinkron dengan query param
|
||||
const activeTab = computed({
|
||||
get: () => (route.query?.tab && typeof route.query.tab === 'string' ? route.query.tab : 'status'),
|
||||
set: (val: string) => {
|
||||
router.replace({ path: route.path, query: { tab: val } })
|
||||
},
|
||||
})
|
||||
|
||||
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
// const dataRes = await getDetail(id, {
|
||||
// includes:
|
||||
// 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person',
|
||||
// })
|
||||
// const dataResBody = dataRes.body ?? null
|
||||
// const data = dataResBody?.data ?? null
|
||||
|
||||
// Dummy data so AppEncounterQuickInfo can render in development/storybook
|
||||
// Replace with real API result when available (see commented fetch below)
|
||||
const data = ref<any>({
|
||||
patient: {
|
||||
number: 'RM-2025-0001',
|
||||
person: {
|
||||
name: 'John Doe',
|
||||
birthDate: '1980-01-01T00:00:00Z',
|
||||
gender_code: 'M',
|
||||
addresses: [{ address: 'Jl. Contoh No.1, Jakarta' }],
|
||||
frontTitle: '',
|
||||
endTitle: '',
|
||||
},
|
||||
},
|
||||
visitDate: new Date().toISOString(),
|
||||
unit: { name: 'Onkologi' },
|
||||
responsible_doctor: null,
|
||||
appointment_doctor: { employee: { person: { name: 'Dr. Clara Smith', frontTitle: 'Dr.', endTitle: 'Sp.OG' } } },
|
||||
})
|
||||
|
||||
// Dummy rows for ProtocolList (matches keys expected by list-cfg.protocol)
|
||||
const protocolRows = [
|
||||
{
|
||||
number: '1',
|
||||
tanggal: new Date().toISOString().substring(0, 10),
|
||||
siklus: 'I',
|
||||
periode: 'Siklus I',
|
||||
kehadiran: 'Hadir',
|
||||
action: '',
|
||||
},
|
||||
{
|
||||
number: '2',
|
||||
tanggal: new Date().toISOString().substring(0, 10),
|
||||
siklus: 'II',
|
||||
periode: 'Siklus II',
|
||||
kehadiran: 'Tidak Hadir',
|
||||
action: '',
|
||||
},
|
||||
]
|
||||
|
||||
const paginationMeta = {
|
||||
recordCount: protocolRows.length,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 1,
|
||||
hasNext: false,
|
||||
hasPrev: false,
|
||||
}
|
||||
|
||||
const tabsRaws: TabItem[] = [
|
||||
{
|
||||
value: 'status',
|
||||
label: 'Status Masuk/Keluar',
|
||||
groups: ['ambulatory', 'rehabilitation', 'chemotherapy'],
|
||||
component: Status,
|
||||
props: { encounter: data },
|
||||
},
|
||||
{
|
||||
value: 'early-medical-assessment',
|
||||
label: 'Pengkajian Awal Medis',
|
||||
groups: ['ambulatory', 'rehabilitation', 'chemotherapy'],
|
||||
component: EarlyMedicalAssesmentList,
|
||||
},
|
||||
{
|
||||
value: 'rehab-medical-assessment',
|
||||
label: 'Pengkajian Awal Medis Rehabilitasi Medis',
|
||||
groups: ['ambulatory', 'rehabilitation', 'chemotherapy'],
|
||||
component: EarlyMedicalRehabList,
|
||||
},
|
||||
{
|
||||
value: 'function-assessment',
|
||||
label: 'Asesmen Fungsi',
|
||||
groups: ['ambulatory', 'rehabilitation'],
|
||||
component: AssesmentFunctionList,
|
||||
},
|
||||
{ value: 'therapy-protocol', groups: ['ambulatory', 'rehabilitation'], label: 'Protokol Terapi' },
|
||||
{
|
||||
value: 'chemotherapy-protocol',
|
||||
label: 'Protokol Kemoterapi',
|
||||
groups: ['chemotherapy'],
|
||||
component: ProtocolList,
|
||||
props: { data: protocolRows, paginationMeta },
|
||||
},
|
||||
{
|
||||
value: 'chemotherapy-medicine',
|
||||
label: 'Protokol Obat Kemoterapi',
|
||||
groups: ['chemotherapy'],
|
||||
component: MedicineProtocolList,
|
||||
props: { data: protocolRows, paginationMeta },
|
||||
},
|
||||
{ value: 'report', label: 'Laporan Tindakan', groups: ['chemotherapy'] },
|
||||
{ value: 'patient-note', label: 'CPRJ', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{
|
||||
value: 'education-assessment',
|
||||
label: 'Asesmen Kebutuhan Edukasi',
|
||||
groups: ['ambulatory', 'rehabilitation', 'chemotherapy'],
|
||||
},
|
||||
{ value: 'consent', label: 'General Consent', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'patient-note', label: 'CPRJ', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{
|
||||
value: 'prescription',
|
||||
label: 'Order Obat',
|
||||
groups: ['ambulatory', 'rehabilitation', 'chemotherapy'],
|
||||
component: PrescriptionList,
|
||||
},
|
||||
{ value: 'device', label: 'Order Alkes', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'mcu-radiology', label: 'Order Radiologi', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'mcu-lab-pc', label: 'Order Lab PK', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'mcu-lab-micro', label: 'Order Lab Mikro', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'mcu-lab-pa', label: 'Order Lab PA', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'medical-action', label: 'Order Ruang Tindakan', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'mcu-result', label: 'Hasil Penunjang', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{
|
||||
value: 'consultation',
|
||||
label: 'Konsultasi',
|
||||
groups: ['ambulatory', 'rehabilitation', 'chemotherapy'],
|
||||
component: Consultation,
|
||||
props: { encounter: data },
|
||||
},
|
||||
{ value: 'resume', label: 'Resume', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'control', label: 'Surat Kontrol', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'screening', label: 'Skrinning MPP', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
{ value: 'supporting-document', label: 'Upload Dokumen Pendukung', groups: ['ambulatory', 'rehabilitation'] },
|
||||
{ value: 'price-list', label: 'Tarif Tindakan', groups: ['ambulatory', 'rehabilitation', 'chemotherapy'] },
|
||||
]
|
||||
|
||||
const tabs = computed(() => {
|
||||
return tabsRaws
|
||||
.filter((tab: TabItem) => tab.groups ? tab.groups.some((group: string) => props.classes?.includes(group)) : true)
|
||||
.map((tab: TabItem) => {
|
||||
return { ...tab, props: { ...tab.props, encounter: data } }
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full">
|
||||
<div class="mb-4">
|
||||
<PubMyUiNavContentBa label="Kembali ke Daftar Kunjungan" />
|
||||
</div>
|
||||
<AppEncounterQuickInfo :data="data" />
|
||||
<CompTab
|
||||
:data="tabs"
|
||||
:initial-active-tab="activeTab"
|
||||
@change-tab="activeTab = $event"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,30 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
// Components
|
||||
import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next'
|
||||
import SummaryCard from '~/components/pub/my-ui/summary-card/summary-card.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import Filter from '~/components/pub/my-ui/nav-header/filter.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
|
||||
// Types
|
||||
///// Imports
|
||||
// Pub components
|
||||
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
||||
import type { Summary } from '~/components/pub/my-ui/summary-card/type'
|
||||
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import { ActionEvents } from '~/components/pub/my-ui/data/types'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import * as CH from '~/components/pub/my-ui/content-header'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import { useSidebar } from '~/components/pub/ui/sidebar/utils'
|
||||
|
||||
// App libs
|
||||
import { getServicePosition } from '~/lib/roles' // previously getPositionAs
|
||||
|
||||
// Services
|
||||
import { getList as getEncounterList, remove as removeEncounter } from '~/services/encounter.service'
|
||||
import { getList as getEncounterList, remove as removeEncounter, cancel as cancelEncounter } from '~/services/encounter.service'
|
||||
|
||||
// UI
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
// Apps
|
||||
import Content from '~/components/app/encounter/list.vue'
|
||||
import FilterNav from '~/components/app/encounter/filter-nav.vue'
|
||||
import FilterForm from '~/components/app/encounter/filter-form.vue'
|
||||
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
classCode?: 'ambulatory' | 'emergency' | 'inpatient' | 'outpatient'
|
||||
classCode?: 'ambulatory' | 'emergency' | 'inpatient'
|
||||
subClassCode?: 'reg' | 'rehab' | 'chemo' | 'emg' | 'eon' | 'op' | 'icu' | 'hcu' | 'vk'
|
||||
type: string
|
||||
canCreate?: boolean
|
||||
canUpdate?: boolean
|
||||
canDelete?: boolean
|
||||
}>()
|
||||
|
||||
///// Declarations and Flows
|
||||
// Sidebar automation
|
||||
const { setOpen } = useSidebar()
|
||||
setOpen(true)
|
||||
|
||||
// Main data
|
||||
const data = ref([])
|
||||
const isLoading = reactive<DataTableLoader>({
|
||||
summary: false,
|
||||
@@ -33,66 +43,88 @@ const isLoading = reactive<DataTableLoader>({
|
||||
const recId = ref<number>(0)
|
||||
const recAction = ref<string>('')
|
||||
const recItem = ref<any>(null)
|
||||
const isFormEntryDialogOpen = ref(false)
|
||||
const isFilterFormDialogOpen = ref(false)
|
||||
const isRecordConfirmationOpen = ref(false)
|
||||
const isRecordCancelOpen = ref(false)
|
||||
|
||||
const hreaderPrep: HeaderPrep = {
|
||||
// Headers
|
||||
const hreaderPrep: CH.Config = {
|
||||
title: 'Kunjungan',
|
||||
icon: 'i-lucide-users',
|
||||
addNav: {
|
||||
label: 'Tambah',
|
||||
onClick: () => {
|
||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
||||
navigateTo('/rehab/encounter/add')
|
||||
}
|
||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
|
||||
navigateTo('/outpatient/encounter/add')
|
||||
}
|
||||
if (props.classCode === 'emergency') {
|
||||
navigateTo('/emergency/encounter/add')
|
||||
}
|
||||
if (props.classCode === 'inpatient') {
|
||||
navigateTo('/inpatient/encounter/add')
|
||||
}
|
||||
navigateTo(`/${props.classCode}/encounter/add`)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const refSearchNav: RefSearchNav = {
|
||||
onClick: () => {
|
||||
// open filter modal
|
||||
isFormEntryDialogOpen.value = true
|
||||
console.log(' 1open filter modal')
|
||||
},
|
||||
onInput: (_val: string) => {
|
||||
// filter patient list
|
||||
},
|
||||
onClear: () => {
|
||||
// clear url param
|
||||
},
|
||||
if (!props.canCreate) {
|
||||
delete hreaderPrep.addNav
|
||||
}
|
||||
|
||||
// Loading state management
|
||||
// Filters
|
||||
const filter = ref<{
|
||||
installation: {
|
||||
msg: {
|
||||
placeholder: string
|
||||
}
|
||||
items: {
|
||||
value: string
|
||||
label: string
|
||||
code: string
|
||||
}[]
|
||||
}
|
||||
schema: any
|
||||
initialValues?: Partial<any>
|
||||
errors?: any
|
||||
}>({
|
||||
installation: {
|
||||
msg: {
|
||||
placeholder: 'Pilih',
|
||||
},
|
||||
items: [],
|
||||
},
|
||||
schema: {},
|
||||
})
|
||||
|
||||
/**
|
||||
* Get base path for encounter routes based on classCode and subClassCode
|
||||
*/
|
||||
function getBasePath(): string {
|
||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
||||
return '/rehab/encounter'
|
||||
}
|
||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
|
||||
return '/outpatient/encounter'
|
||||
}
|
||||
if (props.classCode === 'emergency') {
|
||||
return '/emergency/encounter'
|
||||
}
|
||||
if (props.classCode === 'inpatient') {
|
||||
return '/inpatient/encounter'
|
||||
}
|
||||
return '/encounter' // fallback
|
||||
}
|
||||
// Role reactivities
|
||||
const { getActiveRole } = useUserStore()
|
||||
const activeServicePosition = ref(getServicePosition(getActiveRole()))
|
||||
provide('activeServicePosition', activeServicePosition)
|
||||
watch(getActiveRole, (role? : string) => {
|
||||
activeServicePosition.value = getServicePosition(role)
|
||||
})
|
||||
|
||||
// Recrod reactivities
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
watch(() => recAction.value, () => {
|
||||
const basePath = `/${props.classCode}/encounter`
|
||||
// console.log(`${basePath}/${recId.value}`, recAction.value)
|
||||
// return
|
||||
if (recAction.value === ActionEvents.showConfirmDelete) {
|
||||
isRecordConfirmationOpen.value = true
|
||||
} else if (recAction.value === ActionEvents.showCancel) {
|
||||
isRecordCancelOpen.value = true
|
||||
} else if (recAction.value === ActionEvents.showDetail) {
|
||||
navigateTo(`${basePath}/${recId.value}`)
|
||||
} else if (recAction.value === ActionEvents.showEdit) {
|
||||
navigateTo(`${basePath}/${recId.value}/edit`)
|
||||
} else if (recAction.value === ActionEvents.showProcess) {
|
||||
navigateTo(`${basePath}/${recId.value}/process`)
|
||||
} else if (recAction.value === ActionEvents.showConfirmDelete) {
|
||||
isRecordConfirmationOpen.value = true
|
||||
}
|
||||
recAction.value = '' // reset
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getPatientList()
|
||||
})
|
||||
|
||||
/////// Functions
|
||||
async function getPatientList() {
|
||||
isLoading.isTableLoading = true
|
||||
try {
|
||||
@@ -114,6 +146,43 @@ async function getPatientList() {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle confirmation result
|
||||
async function handleConfirmCancel(record: any, action: string) {
|
||||
if (action === 'deactivate' && record?.id) {
|
||||
try {
|
||||
const result = await cancelEncounter(record.id)
|
||||
if (result.success) {
|
||||
toast({
|
||||
title: 'Berhasil',
|
||||
description: 'Kunjungan berhasil dibatalkan',
|
||||
variant: 'default',
|
||||
})
|
||||
await getPatientList() // Refresh list
|
||||
} else {
|
||||
const errorMessage = result.body?.message || 'Gagal membatalkan kunjungan'
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: errorMessage,
|
||||
variant: 'destructive',
|
||||
})
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('Error cancellation encounter:', error)
|
||||
toast({
|
||||
title: 'Gagal',
|
||||
description: error?.message || 'Gagal membatalkan kunjungan',
|
||||
variant: 'destructive',
|
||||
})
|
||||
} finally {
|
||||
// Reset state
|
||||
recId.value = 0
|
||||
recAction.value = ''
|
||||
recItem.value = null
|
||||
isRecordCancelOpen.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle confirmation result
|
||||
async function handleConfirmDelete(record: any, action: string) {
|
||||
if (action === 'delete' && record?.id) {
|
||||
@@ -156,90 +225,72 @@ function handleCancelConfirmation() {
|
||||
recId.value = 0
|
||||
recAction.value = ''
|
||||
recItem.value = null
|
||||
isRecordConfirmationOpen.value = false
|
||||
isRecordCancelOpen.value = false
|
||||
}
|
||||
|
||||
watch(
|
||||
() => recAction.value,
|
||||
() => {
|
||||
if (recAction.value === ActionEvents.showConfirmDelete) {
|
||||
isRecordConfirmationOpen.value = true
|
||||
return
|
||||
}
|
||||
|
||||
const basePath = getBasePath()
|
||||
|
||||
if (props.type === 'encounter') {
|
||||
if (recAction.value === 'showDetail') {
|
||||
navigateTo(`${basePath}/${recId.value}/detail`)
|
||||
} else if (recAction.value === 'showEdit') {
|
||||
navigateTo(`${basePath}/${recId.value}/edit`)
|
||||
} else if (recAction.value === 'showProcess') {
|
||||
navigateTo(`${basePath}/${recId.value}/process`)
|
||||
} else {
|
||||
// handle other actions
|
||||
}
|
||||
} else if (props.type === 'registration') {
|
||||
// Handle registration type if needed
|
||||
if (recAction.value === 'showDetail') {
|
||||
navigateTo(`${basePath.replace('/encounter', '/registration')}/${recId.value}/detail`)
|
||||
} else if (recAction.value === 'showEdit') {
|
||||
navigateTo(`${basePath.replace('/encounter', '/registration')}/${recId.value}/edit`)
|
||||
} else if (recAction.value === 'showProcess') {
|
||||
navigateTo(`${basePath.replace('/encounter', '/registration')}/${recId.value}/process`)
|
||||
} else {
|
||||
// handle other actions
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
onMounted(() => {
|
||||
getPatientList()
|
||||
})
|
||||
function handleRemoveConfirmation() {
|
||||
// Reset record state when cancelled
|
||||
recId.value = 0
|
||||
recAction.value = ''
|
||||
recItem.value = null
|
||||
isRecordConfirmationOpen.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header
|
||||
:prep="{ ...hreaderPrep }"
|
||||
:ref-search-nav="refSearchNav"
|
||||
/>
|
||||
<Separator class="my-4 xl:my-5" />
|
||||
<CH.ContentHeader v-bind="hreaderPrep">
|
||||
<FilterNav
|
||||
@onFilterClick="() => isFilterFormDialogOpen = true"
|
||||
@onExportPdf="() => {}"
|
||||
@onExportExcel="() => {}"
|
||||
@nExportCsv="() => {}"
|
||||
/>
|
||||
</CH.ContentHeader>
|
||||
|
||||
<Filter
|
||||
:prep="hreaderPrep"
|
||||
:ref-search-nav="refSearchNav"
|
||||
/>
|
||||
|
||||
<AppEncounterList :data="data" />
|
||||
<Content :data="data" />
|
||||
|
||||
<!-- Filter -->
|
||||
<Dialog
|
||||
v-model:open="isFormEntryDialogOpen"
|
||||
v-model:open="isFilterFormDialogOpen"
|
||||
title="Filter"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
>
|
||||
<AppEncounterFilter
|
||||
:installation="{
|
||||
msg: { placeholder: 'Pilih' },
|
||||
items: [],
|
||||
}"
|
||||
:schema="{}"
|
||||
/>
|
||||
<FilterForm v-bind="filter" />
|
||||
</Dialog>
|
||||
|
||||
<!-- Record Confirmation Modal -->
|
||||
<!-- Batal -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordCancelOpen"
|
||||
custom-title="Batalkan Kunjungan"
|
||||
custom-message="Apakah anda yakin ingin membatalkan kunjungan pasien berikut?"
|
||||
action="deactivate"
|
||||
:record="recItem"
|
||||
@confirm="handleConfirmCancel"
|
||||
@cancel="handleCancelConfirmation"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p v-if="record?.patient?.person?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record.patient.person.name }}
|
||||
</p>
|
||||
<p v-if="record?.medical_record_number">
|
||||
<strong>No RM:</strong>
|
||||
{{ record.medical_record_number }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
|
||||
<!-- Hapus -->
|
||||
<RecordConfirmation
|
||||
v-if="canDelete"
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="handleConfirmDelete"
|
||||
@cancel="handleCancelConfirmation"
|
||||
@cancel="handleRemoveConfirmation"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
@@ -258,4 +309,11 @@ onMounted(() => {
|
||||
</div>
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
<Dialog
|
||||
title="Hapus data"
|
||||
size="md"
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
>
|
||||
Hak akses tidak memenuhi kriteria untuk proses ini.
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
<script setup lang="ts">
|
||||
//
|
||||
import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { getDetail } from '~/services/encounter.service'
|
||||
|
||||
//
|
||||
import type { TabItem } from '~/components/pub/my-ui/comp-tab/type'
|
||||
import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue'
|
||||
|
||||
import { genEncounter } from '~/models/encounter'
|
||||
|
||||
// PLASE ORDER BY TAB POSITION
|
||||
import Status from '~/components/content/encounter/status.vue'
|
||||
import AssesmentFunctionList from '~/components/content/soapi/entry.vue'
|
||||
import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
|
||||
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
|
||||
import DeviceOrder from '~/components/content/device-order/main.vue'
|
||||
import Prescription from '~/components/content/prescription/main.vue'
|
||||
import CpLabOrder from '~/components/content/cp-lab-order/main.vue'
|
||||
import Radiology from '~/components/content/radiology-order/main.vue'
|
||||
import Consultation from '~/components/content/consultation/list.vue'
|
||||
import Cprj from '~/components/content/cprj/entry.vue'
|
||||
import DocUploadList from '~/components/content/document-upload/list.vue'
|
||||
import GeneralConsentList from '~/components/content/general-consent/entry.vue'
|
||||
import ResumeList from '~/components/content/resume/list.vue'
|
||||
import ControlLetterList from '~/components/content/control-letter/list.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
// activeTab selalu sinkron dengan query param
|
||||
const activeTab = computed({
|
||||
get: () => (route.query?.tab && typeof route.query.tab === 'string' ? route.query.tab : 'status'),
|
||||
set: (val: string) => {
|
||||
router.replace({ path: route.path, query: { tab: val } })
|
||||
},
|
||||
})
|
||||
|
||||
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const data = ref(genEncounter())
|
||||
|
||||
async function fetchDetail() {
|
||||
const res = await getDetail(id, {
|
||||
includes:
|
||||
'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person,EncounterDocuments',
|
||||
})
|
||||
if (res.body?.data) data.value = res.body?.data
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDetail()
|
||||
})
|
||||
|
||||
const tabs: TabItem[] = [
|
||||
{ value: 'status', label: 'Status Masuk/Keluar', component: Status, props: { encounter: data } },
|
||||
{
|
||||
value: 'early-medical-assessment',
|
||||
label: 'Pengkajian Awal Medis',
|
||||
component: EarlyMedicalAssesmentList,
|
||||
props: { encounter: data, type: 'early-medic', label: 'Pengkajian Awal Medis' },
|
||||
},
|
||||
{
|
||||
value: 'rehab-medical-assessment',
|
||||
label: 'Pengkajian Awal Medis Rehabilitasi Medis',
|
||||
component: EarlyMedicalRehabList,
|
||||
props: { encounter: data, type: 'early-rehab', label: 'Pengkajian Awal Medis Rehabilitasi Medis' },
|
||||
},
|
||||
{
|
||||
value: 'function-assessment',
|
||||
label: 'Asesmen Fungsi',
|
||||
component: AssesmentFunctionList,
|
||||
props: { encounter: data, type: 'function', label: 'Asesmen Fungsi' },
|
||||
},
|
||||
{ value: 'therapy-protocol', label: 'Protokol Terapi' },
|
||||
{ value: 'education-assessment', label: 'Asesmen Kebutuhan Edukasi' },
|
||||
{ value: 'patient-note', label: 'CPRJ', component: Cprj, props: { encounter: data } },
|
||||
{ value: 'consent', label: 'General Consent', component: GeneralConsentList, props: { encounter: data } },
|
||||
{ value: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.value.id } },
|
||||
{ value: 'device-order', label: 'Order Alkes', component: DeviceOrder, props: { encounter_id: data.value.id } },
|
||||
{ value: 'device', label: 'Order Alkes' },
|
||||
{ value: 'mcu-radiology', label: 'Order Radiologi', component: Radiology, props: { encounter_id: data.id } },
|
||||
{ value: 'mcu-lab-cp', label: 'Order Lab PK', component: CpLabOrder, props: { encounter_id: data.id } },
|
||||
{ value: 'mcu-lab-micro', label: 'Order Lab Mikro' },
|
||||
{ value: 'mcu-lab-pa', label: 'Order Lab PA' },
|
||||
{ value: 'medical-action', label: 'Order Ruang Tindakan' },
|
||||
{ value: 'mcu-result', label: 'Hasil Penunjang' },
|
||||
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter: data } },
|
||||
{ value: 'resume', label: 'Resume', component: ResumeList, props: { encounter: data } },
|
||||
{ value: 'control', label: 'Surat Kontrol', component: ControlLetterList, props: { encounter: data } },
|
||||
{ value: 'screening', label: 'Skrinning MPP' },
|
||||
{
|
||||
value: 'supporting-document',
|
||||
label: 'Upload Dokumen Pendukung',
|
||||
component: DocUploadList,
|
||||
props: { encounter: data },
|
||||
},
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full">
|
||||
<div class="mb-4">
|
||||
<PubMyUiNavContentBa label="Kembali ke Daftar Kunjungan" />
|
||||
</div>
|
||||
<AppEncounterQuickInfo :data="data" />
|
||||
<CompTab
|
||||
:data="tabs"
|
||||
:initial-active-tab="activeTab"
|
||||
@change-tab="activeTab = $event"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,15 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
//
|
||||
import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
///// Imports
|
||||
// Pubs components
|
||||
import ContentSwitcher from '~/components/pub/my-ui/content-switcher/content-switcher.vue'
|
||||
import { useSidebar } from '~/components/pub/ui/sidebar/utils'
|
||||
import SubMenu from '~/components/pub/my-ui/menus/submenu.vue'
|
||||
import ContentNavBa from '~/components/pub/my-ui/nav-content/ba.vue'
|
||||
|
||||
import { getDetail } from '~/services/encounter.service'
|
||||
// App libs
|
||||
import { getServicePosition } from '~/lib/roles' // previously getPositionAs
|
||||
|
||||
//
|
||||
import type { TabItem } from '~/components/pub/my-ui/comp-tab/type'
|
||||
import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue'
|
||||
// App Models
|
||||
import { genEncounter, type Encounter } from '~/models/encounter'
|
||||
|
||||
import { genEncounter } from '~/models/encounter'
|
||||
// Handlers
|
||||
import type { EncounterProps } from '~/handlers/encounter-init.handler'
|
||||
import { getEncounterData } from '~/handlers/encounter-process.handler'
|
||||
import { getMenuItems } from '~/handlers/encounter-init.handler'
|
||||
|
||||
// PLASE ORDER BY TAB POSITION
|
||||
import Status from '~/components/content/encounter/status.vue'
|
||||
@@ -27,40 +34,53 @@ import GeneralConsentList from '~/components/content/general-consent/entry.vue'
|
||||
import SummaryMedic from '~/components/content/summary-medic/entry.vue'
|
||||
import ResumeList from '~/components/content/resume/list.vue'
|
||||
import ControlLetterList from '~/components/content/control-letter/list.vue'
|
||||
// App Components
|
||||
import EncounterPatientInfo from '~/components/app/encounter/quick-info.vue'
|
||||
import EncounterHistoryButtonMenu from '~/components/app/encounter/quick-shortcut.vue'
|
||||
|
||||
///// Declarations and Flows
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
classCode: EncounterProps['classCode']
|
||||
subClassCode?: EncounterProps['subClassCode']
|
||||
}>()
|
||||
|
||||
// Common preparations
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
// activeTab selalu sinkron dengan query param
|
||||
const activeTab = computed({
|
||||
get: () => (route.query?.tab && typeof route.query.tab === 'string' ? route.query.tab : 'status'),
|
||||
set: (val: string) => {
|
||||
router.replace({ path: route.path, query: { tab: val } })
|
||||
const { user, userActiveRole, getActiveRole } = useUserStore()
|
||||
const activeRole = getActiveRole()
|
||||
const activePosition = ref(getServicePosition(activeRole))
|
||||
const menus = ref([] as any)
|
||||
const activeMenu = computed({
|
||||
get: () => (route.query?.menu && typeof route.query.menu === 'string' ? route.query.menu : 'status'),
|
||||
set: (value: string) => {
|
||||
router.replace({ path: route.path, query: { menu: value } })
|
||||
},
|
||||
})
|
||||
|
||||
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const data = ref(genEncounter())
|
||||
const data = ref<Encounter>(genEncounter())
|
||||
const isShowPatient = computed(() => data.value && data.value?.patient?.person)
|
||||
|
||||
async function fetchDetail() {
|
||||
const res = await getDetail(id, {
|
||||
includes:
|
||||
'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person,EncounterDocuments',
|
||||
})
|
||||
if (res.body?.data) data.value = res.body?.data
|
||||
const { setOpen } = useSidebar()
|
||||
setOpen(false)
|
||||
|
||||
if (activePosition.value === 'none') {
|
||||
// if user position is none, redirect to home page
|
||||
router.push('/')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDetail()
|
||||
})
|
||||
|
||||
const tabs: TabItem[] = [
|
||||
{ value: 'status', label: 'Status Masuk/Keluar', component: Status, props: { encounter: data } },
|
||||
// Dummy rows for ProtocolList (matches keys expected by list-cfg.protocol)
|
||||
const protocolRows = [
|
||||
{
|
||||
value: 'early-medical-assessment',
|
||||
label: 'Pengkajian Awal Medis',
|
||||
component: EarlyMedicalAssesmentList,
|
||||
props: { encounter: data, type: 'early-medic', label: 'Pengkajian Awal Medis' },
|
||||
number: '1',
|
||||
tanggal: new Date().toISOString().substring(0, 10),
|
||||
siklus: 'I',
|
||||
periode: 'Siklus I',
|
||||
kehadiran: 'Hadir',
|
||||
action: '',
|
||||
},
|
||||
{
|
||||
value: 'rehab-medical-assessment',
|
||||
@@ -97,20 +117,96 @@ const tabs: TabItem[] = [
|
||||
label: 'Upload Dokumen Pendukung',
|
||||
component: DocUploadList,
|
||||
props: { encounter: data },
|
||||
number: '2',
|
||||
tanggal: new Date().toISOString().substring(0, 10),
|
||||
siklus: 'II',
|
||||
periode: 'Siklus II',
|
||||
kehadiran: 'Tidak Hadir',
|
||||
action: '',
|
||||
},
|
||||
]
|
||||
|
||||
const paginationMeta = {
|
||||
recordCount: protocolRows.length,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 1,
|
||||
hasNext: false,
|
||||
hasPrev: false,
|
||||
}
|
||||
|
||||
// Reacrtivities
|
||||
watch(getActiveRole, () => {
|
||||
activePosition.value = getServicePosition(userActiveRole)
|
||||
initMenus()
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await getData()
|
||||
initMenus()
|
||||
})
|
||||
|
||||
///// Functions
|
||||
function handleClick(type: string) {
|
||||
if (type === 'draft') {
|
||||
router.back()
|
||||
}
|
||||
}
|
||||
|
||||
function initMenus() {
|
||||
menus.value = getMenuItems(
|
||||
id,
|
||||
props,
|
||||
user,
|
||||
{
|
||||
encounter: data.value,
|
||||
} as any,
|
||||
{
|
||||
protocolTheraphy: paginationMeta,
|
||||
protocolChemotherapy: paginationMeta,
|
||||
medicineProtocolChemotherapy: paginationMeta,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
async function getData() {
|
||||
data.value = await getEncounterData(id)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full">
|
||||
<div class="mb-4">
|
||||
<PubMyUiNavContentBa label="Kembali ke Daftar Kunjungan" />
|
||||
<div class="bg-white p-4 dark:bg-slate-800 2xl:p-5">
|
||||
<div class="mb-4 flex">
|
||||
<div>
|
||||
<ContentNavBa
|
||||
label="Kembali"
|
||||
@click="handleClick"
|
||||
/>
|
||||
</div>
|
||||
<!-- <div class="ms-auto pe-3 pt-1 text-end text-xl 2xl:text-2xl font-semibold">
|
||||
Pasien: {{ data.patient.person.name }} --- No. RM: {{ data.patient.number }}
|
||||
</div> -->
|
||||
</div>
|
||||
<ContentSwitcher
|
||||
:active="1"
|
||||
:height="150"
|
||||
>
|
||||
<template v-slot:content1>
|
||||
<EncounterPatientInfo
|
||||
v-if="isShowPatient"
|
||||
:data="data"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:content2>
|
||||
<EncounterHistoryButtonMenu v-if="isShowPatient" />
|
||||
</template>
|
||||
</ContentSwitcher>
|
||||
</div>
|
||||
<AppEncounterQuickInfo :data="data" />
|
||||
<CompTab
|
||||
:data="tabs"
|
||||
:initial-active-tab="activeTab"
|
||||
@change-tab="activeTab = $event"
|
||||
<SubMenu
|
||||
:data="menus"
|
||||
:initial-active-menu="activeMenu"
|
||||
@change-menu="activeMenu = $event"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user