refactor(encounter): streamline navigation logic and reintroduce patient list fetching on mount
This commit is contained in:
No files matched your search
@@ -34,8 +34,6 @@ import {
|
|||||||
// Stores
|
// Stores
|
||||||
import { useUserStore } from '~/stores/user'
|
import { useUserStore } from '~/stores/user'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
id: number
|
id: number
|
||||||
classCode?: 'ambulatory' | 'emergency' | 'inpatient' | 'outpatient'
|
classCode?: 'ambulatory' | 'emergency' | 'inpatient' | 'outpatient'
|
||||||
@@ -68,12 +66,12 @@ function getListPath(): string {
|
|||||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
||||||
return '/rehab/encounter'
|
return '/rehab/encounter'
|
||||||
}
|
}
|
||||||
|
if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
|
||||||
|
return '/outpatient/encounter'
|
||||||
|
}
|
||||||
if (props.classCode === 'emergency') {
|
if (props.classCode === 'emergency') {
|
||||||
return '/emergency/encounter'
|
return '/emergency/encounter'
|
||||||
}
|
}
|
||||||
if (props.classCode === 'outpatient') {
|
|
||||||
return '/outpatient/encounter'
|
|
||||||
}
|
|
||||||
if (props.classCode === 'inpatient') {
|
if (props.classCode === 'inpatient') {
|
||||||
return '/inpatient/encounter'
|
return '/inpatient/encounter'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ const hreaderPrep: HeaderPrep = {
|
|||||||
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
|
||||||
navigateTo('/rehab/encounter/add')
|
navigateTo('/rehab/encounter/add')
|
||||||
}
|
}
|
||||||
|
if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
|
||||||
|
navigateTo('/outpatient/encounter/add')
|
||||||
|
}
|
||||||
if (props.classCode === 'emergency') {
|
if (props.classCode === 'emergency') {
|
||||||
navigateTo('/emergency/encounter/add')
|
navigateTo('/emergency/encounter/add')
|
||||||
}
|
}
|
||||||
if (props.classCode === 'outpatient') {
|
|
||||||
navigateTo('/outpatient/encounter/add')
|
|
||||||
}
|
|
||||||
if (props.classCode === 'inpatient') {
|
if (props.classCode === 'inpatient') {
|
||||||
navigateTo('/inpatient/encounter/add')
|
navigateTo('/inpatient/encounter/add')
|
||||||
}
|
}
|
||||||
@@ -92,10 +92,6 @@ async function getPatientList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getPatientList()
|
|
||||||
})
|
|
||||||
|
|
||||||
// Handle confirmation result
|
// Handle confirmation result
|
||||||
async function handleConfirmDelete(record: any, action: string) {
|
async function handleConfirmDelete(record: any, action: string) {
|
||||||
if (action === 'delete' && record?.id) {
|
if (action === 'delete' && record?.id) {
|
||||||
@@ -176,6 +172,10 @@ provide('rec_id', recId)
|
|||||||
provide('rec_action', recAction)
|
provide('rec_action', recAction)
|
||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getPatientList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user