feat/role-check: wip
This commit is contained in:
@@ -89,10 +89,10 @@ function proceedItem(action: string) {
|
||||
|
||||
function getLinks() {
|
||||
switch (activeServicePosition.value) {
|
||||
case 'medical':
|
||||
case 'med':
|
||||
linkItemsFiltered.value = baseLinkItems.filter((item) => item.groups?.includes('medical'))
|
||||
break
|
||||
case 'registration':
|
||||
case 'reg':
|
||||
linkItemsFiltered.value = baseLinkItems.filter((item) => item.groups?.includes('registration'))
|
||||
break
|
||||
default:
|
||||
|
||||
@@ -28,6 +28,7 @@ import ConfirmationInfo from '~/components/app/device-order/confirmation-info.vu
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
encounter_id: number
|
||||
canUpdate?: boolean
|
||||
}>()
|
||||
|
||||
const encounter_id = props.encounter_id
|
||||
@@ -153,7 +154,7 @@ function pickItem(): DeviceOrder | null {
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
/>
|
||||
<!--
|
||||
<!--
|
||||
@cancel="cancel"
|
||||
@edit="edit"
|
||||
@submit="submit"
|
||||
|
||||
@@ -15,6 +15,8 @@ import CheckOutView from '~/components/app/encounter/check-out-view.vue'
|
||||
import CheckOutEntry from '~/components/app/encounter/check-out-entry.vue'
|
||||
import type { Encounter } from '~/models/encounter'
|
||||
import { checkIn } from '~/services/encounter.service'
|
||||
import { getServicePosition } from '~/lib/roles'
|
||||
import type { Item } from '~/components/pub/my-ui/combobox'
|
||||
|
||||
//
|
||||
const props = defineProps<{
|
||||
@@ -22,11 +24,24 @@ const props = defineProps<{
|
||||
canUpdate?: boolean
|
||||
}>()
|
||||
|
||||
//
|
||||
const { user } = useUserStore()
|
||||
const servicePosition = user.user_contractPosition_code == 'emp' ? getServicePosition('emp|'+user.employee_position_code) : null
|
||||
// const subClassCode = servicePosition == 'chemo' ? 'chemo' : null
|
||||
|
||||
// doctors
|
||||
const localEncounter = ref<Encounter>(props.encounter)
|
||||
const doctors = await getDoctorValueLabelList({'includes': 'employee,employee-person'}, true)
|
||||
const doctors = ref<Item[]>([])
|
||||
const employees = await getEmployeeValueLabelList({'includes': 'person', 'position-code': 'reg'})
|
||||
const units = await getUnitValueLabelList()
|
||||
const canUpdate = ref(true)
|
||||
|
||||
if (props.encounter.status_code == 'done') {
|
||||
canUpdate.value = false
|
||||
}
|
||||
if (canUpdate.value) {
|
||||
doctors.value = await getDoctorValueLabelList({'includes': 'employee,employee-person', 'unit-code': user.unit_code}, true)
|
||||
}
|
||||
|
||||
// check in
|
||||
const checkInValues = ref<any>({
|
||||
@@ -94,6 +109,7 @@ function submitCheckOut(values: CheckOutFormData) {
|
||||
</div>
|
||||
|
||||
<Dialog
|
||||
v-if="canUpdate"
|
||||
v-model:open="checkInDialogOpen"
|
||||
title="Ubah Informasi Masuk"
|
||||
size="md"
|
||||
@@ -103,7 +119,7 @@ function submitCheckOut(values: CheckOutFormData) {
|
||||
:schema="CheckInSchema"
|
||||
:values="checkInValues"
|
||||
:encounter="encounter"
|
||||
:doctors="doctors"
|
||||
:doctors="doctors || []"
|
||||
:employees="employees"
|
||||
:is-loading="checkInIsLoading"
|
||||
:is-readonly="checkInIsReadonly"
|
||||
@@ -113,6 +129,7 @@ function submitCheckOut(values: CheckOutFormData) {
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
v-if="canUpdate"
|
||||
v-model:open="checkOutDialogOpen"
|
||||
title="Ubah Informasi Keluar"
|
||||
size="lg"
|
||||
|
||||
@@ -7,9 +7,17 @@ import SoapiList from './list.vue'
|
||||
import EarlyForm from './form.vue'
|
||||
import RehabForm from './form-rehab.vue'
|
||||
import FunctionForm from './form-function.vue'
|
||||
import type { Encounter } from '~/models/encounter'
|
||||
|
||||
interface Props {
|
||||
encounter: Encounter
|
||||
label: string
|
||||
canUpdate?: boolean
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const route = useRoute()
|
||||
const type = computed(() => (route.query.tab as string) || 'early-medical-assessment')
|
||||
const type = computed(() => (route.query.menu as string) || 'early-medical-assessment')
|
||||
|
||||
const { mode, goToEntry, backToList } = useQueryCRUDMode('mode')
|
||||
|
||||
@@ -23,8 +31,9 @@ const ActiveForm = computed(() => formMap[type.value] || EarlyForm)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- {{ type }} -->
|
||||
<div>
|
||||
<SoapiList v-if="mode === 'list'" />
|
||||
<SoapiList v-if="mode === 'list'" :label="label" :canUpdate="canUpdate" />
|
||||
<component
|
||||
v-else
|
||||
:is="ActiveForm"
|
||||
|
||||
@@ -21,6 +21,7 @@ import type { Encounter } from '~/models/encounter'
|
||||
interface Props {
|
||||
encounter: Encounter
|
||||
label: string
|
||||
canUpdate?: boolean
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
const emits = defineEmits(['add', 'edit'])
|
||||
@@ -58,10 +59,12 @@ const typeCode = ref('')
|
||||
const hreaderPrep: HeaderPrep = {
|
||||
title: props.label,
|
||||
icon: 'i-lucide-users',
|
||||
addNav: {
|
||||
}
|
||||
if(props.canUpdate) {
|
||||
hreaderPrep['addNav'] = {
|
||||
label: 'Tambah',
|
||||
onClick: () => goToEntry(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
const type = computed(() => (route.query.tab as string) || 'early-medical-assessment')
|
||||
@@ -169,6 +172,8 @@ provide('table_data_loader', isLoading)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- {{ canUpdate }}
|
||||
{{ hreaderPrep }} -->
|
||||
<Header
|
||||
:prep="{ ...hreaderPrep }"
|
||||
:ref-search-nav="refSearchNav"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export interface Item {
|
||||
value: string | number
|
||||
value: string
|
||||
label: string
|
||||
code?: string
|
||||
priority?: number
|
||||
|
||||
@@ -1,40 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
height?: number
|
||||
class?: string
|
||||
activeTab?: 1 | 2
|
||||
}>()
|
||||
|
||||
const classVal = computed(() => {
|
||||
return props.class ? props.class : ''
|
||||
})
|
||||
const activeTab = ref(props.activeTab || 1)
|
||||
|
||||
function handleClick(value: 1 | 2) {
|
||||
activeTab.value = value
|
||||
function switchActiveTab() {
|
||||
activeTab.value = activeTab.value === 1 ? 2 : 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="content-switcher" :style="`height: ${height || 200}px`">
|
||||
<div :class="`${activeTab === 1 ? 'active' : 'inactive'}`">
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<slot name="content1" />
|
||||
</div>
|
||||
<div :class="`content-switcher ${classVal}`" :style="height ? `height:${200}px` : ''">
|
||||
<div class="wrapper">
|
||||
<div :class="`item item-1 ${activeTab === 1 ? 'active' : 'inactive'}`">
|
||||
<slot name="content1" />
|
||||
</div>
|
||||
<div class="content-nav">
|
||||
<button @click="handleClick(1)">
|
||||
<Icon name="i-lucide-chevron-right" />
|
||||
<div :class="`nav border-slate-300 ${ activeTab == 1 ? 'border-l' : 'border-r'}`">
|
||||
<button @click="switchActiveTab()" class="!p-0 w-full h-full">
|
||||
<Icon :name="activeTab == 1 ? 'i-lucide-chevron-left' : 'i-lucide-chevron-right'" class="text-3xl" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="`${activeTab === 2 ? 'active' : 'inactive'}`">
|
||||
<div class="content-nav">
|
||||
<button @click="handleClick(2)">
|
||||
<Icon name="i-lucide-chevron-left" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<slot name="content2" />
|
||||
</div>
|
||||
<div :class="`item item-2 ${activeTab === 2 ? 'active' : 'inactive'}`">
|
||||
<slot name="content2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,45 +35,24 @@ function handleClick(value: 1 | 2) {
|
||||
|
||||
<style>
|
||||
.content-switcher {
|
||||
@apply flex overflow-hidden gap-3
|
||||
@apply overflow-hidden
|
||||
}
|
||||
.content-switcher > * {
|
||||
@apply border border-slate-300 rounded-md flex overflow-hidden
|
||||
.wrapper {
|
||||
@apply flex w-[200%] h-full
|
||||
}
|
||||
.item {
|
||||
@apply w-[calc(50%-60px)]
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
@apply p-4 2xl:p-5 overflow-hidden grow
|
||||
.item-1.active {
|
||||
@apply ms-0 transition-all duration-500 ease-in-out
|
||||
}
|
||||
.inactive .content-wrapper {
|
||||
@apply p-0 w-0
|
||||
.item-1.inactive {
|
||||
@apply -ms-[calc(50%-60px)] transition-all duration-500 ease-in-out
|
||||
}
|
||||
|
||||
.content-nav {
|
||||
@apply h-full flex flex-row items-center justify-center content-center !text-2xl overflow-hidden
|
||||
.nav {
|
||||
@apply h-full w-[60px] flex flex-row items-center justify-center content-center !text-2xl overflow-hidden
|
||||
}
|
||||
|
||||
.content-nav button {
|
||||
@apply pt-2 px-2 h-full w-full
|
||||
}
|
||||
|
||||
/* .content-switcher .inactive > .content-wrapper {
|
||||
@apply w-0 p-0 opacity-0 transition-all duration-500 ease-in-out
|
||||
} */
|
||||
.content-switcher .inactive {
|
||||
@apply w-16 transition-all duration-500 ease-in-out
|
||||
}
|
||||
.content-switcher .inactive > .content-nav {
|
||||
@apply w-full transition-all duration-100 ease-in-out
|
||||
}
|
||||
|
||||
.content-switcher .active {
|
||||
@apply grow transition-all duration-500 ease-in-out
|
||||
}
|
||||
.content-switcher .active > .content-nav {
|
||||
@apply w-0 transition-all duration-100 ease-in-out
|
||||
}
|
||||
/* .content-switcher .active > .content-wrapper {
|
||||
@apply w-full delay-1000 transition-all duration-1000 ease-in-out
|
||||
} */
|
||||
|
||||
</style>
|
||||
|
||||
@@ -4,6 +4,9 @@ import { type EncounterItem } from "~/handlers/encounter-init.handler";
|
||||
const props = defineProps<{
|
||||
initialActiveMenu: string
|
||||
data: EncounterItem[]
|
||||
canCreate?: boolean
|
||||
canUpdate?: boolean
|
||||
canDelete?: boolean
|
||||
}>()
|
||||
|
||||
const activeMenu = ref(props.initialActiveMenu)
|
||||
@@ -38,7 +41,11 @@ function changeMenu(value: string) {
|
||||
class="flex-1 rounded-md border bg-white p-4 shadow-sm dark:bg-neutral-950">
|
||||
<component
|
||||
:is="data.find((m) => m.id === activeMenu)?.component"
|
||||
v-bind="data.find((m) => m.id === activeMenu)?.props" />
|
||||
v-bind="data.find((m) => m.id === activeMenu)?.props"
|
||||
:can-create="canCreate"
|
||||
:can-update="canUpdate"
|
||||
:can-delete="canDelete"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,6 +20,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/add': {
|
||||
'emp|reg': ['C', 'R', 'U', 'D'],
|
||||
@@ -34,6 +35,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/edit': {
|
||||
'emp|reg': ['C', 'R', 'U', 'D'],
|
||||
@@ -47,6 +49,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=status': {
|
||||
'emp|doc': ['R'],
|
||||
@@ -57,6 +60,18 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=rehab-medical-assessment': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=early-medical-assessment': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -67,8 +82,20 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=fkr': {
|
||||
'/ambulatory/encounter/[id]/process?menu=early-nurse-assessment': {
|
||||
'emp|doc': ['R'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=kfr': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
@@ -77,6 +104,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=education-assessment': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -87,6 +115,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=general-consent': {
|
||||
'emp|doc': ['R'],
|
||||
@@ -97,6 +126,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=patient-amb-note': {
|
||||
'emp|doc': ['R'],
|
||||
@@ -107,6 +137,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=prescription': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -117,6 +148,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=device-order': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -127,6 +159,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=radiology-order': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -137,6 +170,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=cp-lab-order': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -147,6 +181,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=micro-lab-order': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -157,6 +192,7 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=ap-lab-order': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
@@ -167,6 +203,161 @@ export const permissions: Record<string, Record<string, Permission[]>> = {
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=inpatient-letter': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=reference-back': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=procedure-room-order': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=mcu-result': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=action-report': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=surgery-report': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=vaccine-data': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=consultation': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=control-letter': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R', 'U'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=screening': {
|
||||
'emp|doc': ['R'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R', 'U'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=supporting-document': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=resume': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=amb-resume': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/encounter/[id]/process?menu=price-list': {
|
||||
'emp|doc': ['R', 'U'],
|
||||
'emp|nur': ['R'],
|
||||
'emp|thr': ['R'],
|
||||
'emp|miw': ['R'],
|
||||
'emp|nut': ['R'],
|
||||
'emp|pha': ['R'],
|
||||
'emp|lab': ['R'],
|
||||
'emp|rad': ['R'],
|
||||
'emp|scr': ['R'],
|
||||
},
|
||||
'/ambulatory/consulation': {
|
||||
'emp|doc': ['R'],
|
||||
|
||||
@@ -30,13 +30,12 @@ export interface EncounterListData {
|
||||
}
|
||||
|
||||
const StatusAsync = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
||||
const AssesmentFunctionListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue'))
|
||||
const EarlyMedicalRehabAssessmentListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue'))
|
||||
const EarlyMedicalAssesmentListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue'))
|
||||
const EarlyMedicalRehabListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue'))
|
||||
const initialNursesAssessmentAsync = defineAsyncComponent(() => import('~/components/content/initial-nursing/entry.vue'))
|
||||
const AssesmentFunctionListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue'))
|
||||
const ChemoProtocolListAsync = defineAsyncComponent(() => import('~/components/app/chemotherapy/list.protocol.vue'))
|
||||
const ChemoMedicineProtocolListAsync = defineAsyncComponent(
|
||||
() => import('~/components/app/chemotherapy/list.medicine.vue'),
|
||||
)
|
||||
const ChemoMedicineProtocolListAsync = defineAsyncComponent(() => import('~/components/app/chemotherapy/list.medicine.vue'))
|
||||
const DeviceOrderAsync = defineAsyncComponent(() => import('~/components/content/device-order/main.vue'))
|
||||
const PrescriptionAsync = defineAsyncComponent(() => import('~/components/content/prescription/main.vue'))
|
||||
const CpLabOrderAsync = defineAsyncComponent(() => import('~/components/content/cp-lab-order/main.vue'))
|
||||
@@ -54,7 +53,6 @@ const KfrListAsync = defineAsyncComponent(() => import('~/components/content/kfr
|
||||
const PrbListAsync = defineAsyncComponent(() => import('~/components/content/prb/list.vue'))
|
||||
const SurgeryReportListAsync = defineAsyncComponent(() => import('~/components/content/surgery-report/list.vue'))
|
||||
const VaccineDataListAsync = defineAsyncComponent(() => import('~/components/content/vaccine-data/list.vue'))
|
||||
const InitialNursingStudyAsync = defineAsyncComponent(() => import('~/components/content/initial-nursing/entry.vue'))
|
||||
const AssessmentEducationEntryAsync = defineAsyncComponent(
|
||||
() => import('~/components/content/assessment-education/entry.vue'),
|
||||
)
|
||||
@@ -68,18 +66,6 @@ const defaultKeys: Record<string, any> = {
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
// earlyNurseryAssessment: {
|
||||
// id: 'early-nursery-assessment',
|
||||
// title: 'Pengkajian Awal Keperawatan',
|
||||
// classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
// unit: 'all',
|
||||
// },
|
||||
earlyMedicalAssessment: {
|
||||
id: 'early-medical-assessment',
|
||||
title: 'Pengkajian Awal Medis',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
earlyMedicalRehabAssessment: {
|
||||
id: 'rehab-medical-assessment',
|
||||
title: 'Pengkajian Awal Medis Rehabilitasi Medis',
|
||||
@@ -87,21 +73,14 @@ const defaultKeys: Record<string, any> = {
|
||||
unit: 'rehab',
|
||||
afterId: 'early-medical-assessment',
|
||||
},
|
||||
// functionAssessment: {
|
||||
// id: 'function-assessment',
|
||||
// title: 'Asesmen Fungsi',
|
||||
// classCode: ['ambulatory'],
|
||||
// unit: 'rehab',
|
||||
// afterId: 'rehab-medical-assessment',
|
||||
// },
|
||||
// therapyProtocol: {
|
||||
// id: 'therapy-protocol',
|
||||
// classCode: ['ambulatory'],
|
||||
// title: 'Protokol Terapi',
|
||||
// unit: 'rehab',
|
||||
// afterId: 'function-assessment',
|
||||
initialNursingStudy: {
|
||||
id: 'initial-nursing-study',
|
||||
earlyMedicalAssessment: {
|
||||
id: 'early-medical-assessment',
|
||||
title: 'Pengkajian Awal Medis',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
initialNursesAssessment: {
|
||||
id: 'early-nurse-assessment',
|
||||
title: 'Kajian Awal Keperawatan',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
@@ -270,7 +249,7 @@ const defaultKeys: Record<string, any> = {
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
// initialNursingStudy: {
|
||||
// initialNursesAssessment: {
|
||||
// id: 'initial-nursing-study',
|
||||
// title: 'Kajian Awal Keperawatan',
|
||||
// classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
@@ -329,7 +308,7 @@ export function injectComponents(id: string | number, data: EncounterListData, m
|
||||
}
|
||||
}
|
||||
if (currentKeys?.earlyMedicalRehabAssessment) {
|
||||
currentKeys.earlyMedicalRehabAssessment['component'] = EarlyMedicalRehabListAsync
|
||||
currentKeys.earlyMedicalRehabAssessment['component'] = EarlyMedicalRehabAssessmentListAsync
|
||||
currentKeys.earlyMedicalRehabAssessment['props'] = {
|
||||
encounter: data?.encounter,
|
||||
type: 'early-rehab',
|
||||
@@ -459,21 +438,10 @@ export function injectComponents(id: string | number, data: EncounterListData, m
|
||||
currentKeys.priceList['props'] = { encounter_id: id }
|
||||
}
|
||||
|
||||
if (currentKeys?.initialNursingStudy) {
|
||||
currentKeys.initialNursingStudy['component'] = InitialNursingStudyAsync
|
||||
currentKeys.initialNursingStudy['props'] = { encounter: data?.encounter }
|
||||
if (currentKeys?.initialNursesAssessment) {
|
||||
currentKeys.initialNursesAssessment['component'] = initialNursesAssessmentAsync
|
||||
currentKeys.initialNursesAssessment['props'] = { encounter: data?.encounter }
|
||||
}
|
||||
|
||||
if (currentKeys?.initialNursingStudy) {
|
||||
currentKeys.initialNursingStudy['component'] = InitialNursingStudyAsync
|
||||
currentKeys.initialNursingStudy['props'] = { encounter: data?.encounter }
|
||||
}
|
||||
|
||||
if (currentKeys?.initialNursingStudy) {
|
||||
currentKeys.initialNursingStudy['component'] = InitialNursingStudyAsync
|
||||
currentKeys.initialNursingStudy['props'] = { encounter: data?.encounter }
|
||||
}
|
||||
|
||||
if (currentKeys?.actionReport) {
|
||||
currentKeys.actionReport['component'] = ActionReportEntryAsync
|
||||
currentKeys.actionReport['props'] = {
|
||||
@@ -537,6 +505,9 @@ export function mapResponseToEncounter(result: any): any {
|
||||
? result.visitDate
|
||||
: result.registeredAt || result.patient?.registeredAt || null,
|
||||
adm_employee_id: result.adm_employee_id || 0,
|
||||
adm_employee: result.adm_employee || null,
|
||||
responsible_nurse_id: result.responsible_nurse_id || null,
|
||||
responsible_nurse: result.responsible_nurse || null,
|
||||
appointment_doctor_id: result.appointment_doctor_id || null,
|
||||
responsible_doctor_id: result.responsible_doctor_id || null,
|
||||
appointment_doctor: result.appointment_doctor || null,
|
||||
@@ -599,7 +570,7 @@ export function getMenuItems(id: string | number, props: any, user: any, data: E
|
||||
const currentUnitItems: any = currentListItems[`${unitCode}`]
|
||||
if (!currentUnitItems) return []
|
||||
let menus = []
|
||||
if (currentUnitItems.roles && currentUnitItems.roles?.includes(user.activeRole)) {
|
||||
if (currentUnitItems.roles && currentUnitItems.roles && user.activeRole in currentUnitItems.roles) {
|
||||
menus = [...currentUnitItems.items]
|
||||
} else {
|
||||
menus = unitCode !== 'all' && currentUnitItems?.items ? [...currentUnitItems.items] : [...currentUnitItems]
|
||||
|
||||
@@ -52,7 +52,7 @@ export function genEncounter(): Encounter {
|
||||
patient: genPatient(),
|
||||
registeredAt: '',
|
||||
class_code: '',
|
||||
unit_code: 0,
|
||||
unit_code: '',
|
||||
unit: genUnit(),
|
||||
visitDate: '',
|
||||
adm_employee_id: 0,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { type Base, genBase } from "./_base"
|
||||
import type { Employee } from "./employee"
|
||||
|
||||
export interface Nurse extends Base {
|
||||
employee_id: number
|
||||
employee?: Employee
|
||||
ihs_number?: string
|
||||
unit_id: number
|
||||
infra_id: number
|
||||
|
||||
@@ -31,12 +31,12 @@ useHead({
|
||||
const route = useRoute()
|
||||
const menu = computed(() => route.query.menu as string | undefined)
|
||||
const accessKey = computed(() => `/ambulatory/encounter/[id]/process` + (menu.value ? `?menu=${menu.value}` : ''))
|
||||
const roleAccess: Record<string, Permission[]> = permissions[accessKey.value] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read') || true
|
||||
const canCreate = hasCreateAccess(roleAccess)
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
const canUpdate = hasUpdateAccess(roleAccess)
|
||||
const canDelete = hasDeleteAccess(roleAccess)
|
||||
const roleAccess = computed(() => permissions[accessKey.value] || {})
|
||||
const hasAccess = computed(() => getPageAccess(roleAccess.value, 'read'))
|
||||
const canCreate = computed(() => getPageAccess(roleAccess.value, 'create'))
|
||||
const canRead = computed(() => getPageAccess(roleAccess.value, 'read'))
|
||||
const canUpdate = computed(() => getPageAccess(roleAccess.value, 'update'))
|
||||
const canDelete = computed(() => getPageAccess(roleAccess.value, 'delete'))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user