Merge branch 'dev' into feat/move-kai-ui-to-sidebar-195
This commit is contained in:
No files matched your search
+16
-17
@@ -1,9 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/detail.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
||||
@@ -11,28 +21,17 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
@@ -1,15 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Models & Consts
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/entry.vue'
|
||||
|
||||
// Page meta
|
||||
const { getParamsId, getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg'],
|
||||
@@ -17,42 +21,25 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]/edit'] || {}
|
||||
const { checkRole, hasUpdateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page, need to use try - catch for proper handling
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canUpdate = hasUpdateAccess(roleAccess)
|
||||
|
||||
// Get encounter ID from route params
|
||||
const encounter_id = computed(() => {
|
||||
const id = route.params.id
|
||||
return typeof id === 'string' ? parseInt(id) : 0
|
||||
})
|
||||
|
||||
// User info
|
||||
const hasAccess = getPageAccess(roleAccess, 'update')
|
||||
const encounterId = getParamsId()
|
||||
const { user } = useUserStore()
|
||||
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canUpdate">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
:id="encounter_id"
|
||||
:id="encounterId"
|
||||
class-code="ambulatory"
|
||||
:sub-class-code="subClassCode"
|
||||
form-type="Edit"
|
||||
form-type="edit"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
@@ -60,4 +47,3 @@ const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
||||
:status-code="403"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Models & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
import { medicalRoles } from '~/const/common/role'
|
||||
|
||||
// Page meta
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: medicalRoles,
|
||||
title: 'Detail Kunjungan',
|
||||
contentFrame: 'cf-container-md',
|
||||
})
|
||||
|
||||
// Define common things
|
||||
const route = useRoute()
|
||||
|
||||
// Prep role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<ContentOutpatientEncounterDetail :patient-id="Number(route.params.id)" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,45 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from '~/lib/page-checker'
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// AppS
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/process.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
||||
title: 'Proses Kunjungan',
|
||||
contentFrame: 'cf-full-width',
|
||||
contentPadding: 'p-0',
|
||||
contentUseCard: false
|
||||
contentUseCard: false,
|
||||
})
|
||||
|
||||
useHead({
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]/process'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`,
|
||||
})
|
||||
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content class-code="ambulatory" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
<Error
|
||||
v-else
|
||||
:status-code="403"
|
||||
/>
|
||||
</template>
|
||||
@@ -1,10 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/entry.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg'],
|
||||
@@ -12,36 +21,22 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/add'] || {}
|
||||
const { checkRole, hasReadAccess, hasCreateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canCreate = hasCreateAccess(roleAccess)
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/add'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'create')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canCreate">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
:id="0"
|
||||
class-code="ambulatory"
|
||||
sub-class-code="reg"
|
||||
form-type="Tambah"
|
||||
form-type="add"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
|
||||
@@ -1,41 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Models & Consts
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/list.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
// Page meta
|
||||
definePageMeta({
|
||||
// middleware: ['rbac'],
|
||||
// roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||
title: 'Daftar Kunjungan',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
useHead({
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Define common things
|
||||
const route = useRoute()
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||
const { checkRole, hasCreateAccess, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
if (!hasAccess || !canRead) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
const canCreate = hasCreateAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
})
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
const canCreate = getPageAccess(roleAccess, 'create')
|
||||
const canRemove = getPageAccess(roleAccess, 'delete')
|
||||
|
||||
// User info
|
||||
const { user } = useUserStore()
|
||||
@@ -44,11 +42,12 @@ const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
class-code="ambulatory"
|
||||
:sub-class-code="subClassCode"
|
||||
:can-create="canCreate"
|
||||
:can-delete="canRemove"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/emergency'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/detail.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
||||
@@ -11,28 +21,17 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/[id]'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
|
||||
@@ -1,51 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import type { PagePermission } from '~/models/role'
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/emergency'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/entry.vue'
|
||||
|
||||
const { getParamsId, getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
roles: ['emp|reg'],
|
||||
title: 'Edit Kunjungan',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/emergency/encounter']
|
||||
|
||||
const { checkRole, hasUpdateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: 'Access denied',
|
||||
})
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canUpdate = hasUpdateAccess(roleAccess)
|
||||
|
||||
// Get encounter ID from route params
|
||||
const encounterId = computed(() => {
|
||||
const id = route.params.id
|
||||
return typeof id === 'string' ? parseInt(id) : 0
|
||||
})
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/[id]/edit'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'update')
|
||||
const encounterId = getParamsId()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canUpdate">
|
||||
<ContentEncounterEntry
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
:id="encounterId"
|
||||
class-code="emergency"
|
||||
sub-class-code="emg"
|
||||
form-type="Edit"
|
||||
form-type="edit"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
@@ -53,4 +45,3 @@ const encounterId = computed(() => {
|
||||
:status-code="403"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -1,39 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/emergency'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from '~/lib/page-checker'
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/process.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
title: 'Kunjungan',
|
||||
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
||||
title: 'Proses Kunjungan',
|
||||
contentFrame: 'cf-full-width',
|
||||
contentPadding: 'p-0',
|
||||
contentUseCard: false,
|
||||
})
|
||||
|
||||
useHead({
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`,
|
||||
})
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/[id]/process'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canRead">
|
||||
<Content class-code="emergency" sub-class-code="emg" />
|
||||
<div v-if="hasAccess">
|
||||
<Content class-code="emergency" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
<Error
|
||||
v-else
|
||||
:status-code="403"
|
||||
/>
|
||||
</template>
|
||||
@@ -1,10 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
import { permissions } from '~/const/page-permission/emergency'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/entry.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg'],
|
||||
@@ -12,36 +21,22 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
|
||||
const { checkRole, hasReadAccess, hasCreateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canCreate = hasCreateAccess(roleAccess)
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/add'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'create')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canCreate">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
:id="0"
|
||||
class-code="emergency"
|
||||
sub-class-code="reg"
|
||||
form-type="Tambah"
|
||||
sub-class-code="emg"
|
||||
form-type="add"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/emergency'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/list.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
// Page meta
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||
@@ -12,36 +22,28 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const route = useRoute()
|
||||
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
const { user } = useUserStore()
|
||||
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
||||
// Define common things
|
||||
const route = useRoute()
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
const canCreate = getPageAccess(roleAccess, 'create')
|
||||
const canRemove = getPageAccess(roleAccess, 'delete')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
class-code="emergency"
|
||||
:sub-class-code="subClassCode"
|
||||
type="encounter"
|
||||
sub-class-code="emg"
|
||||
:can-create="canCreate"
|
||||
:can-delete="canRemove"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/inpatient'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/detail.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
||||
@@ -11,28 +21,17 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/[id]'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
|
||||
@@ -1,51 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import type { PagePermission } from '~/models/role'
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/inpatient'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/entry.vue'
|
||||
|
||||
const { getParamsId, getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
roles: ['emp|reg'],
|
||||
title: 'Edit Kunjungan',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/inpatient/encounter']
|
||||
|
||||
const { checkRole, hasUpdateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: 'Access denied',
|
||||
})
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canUpdate = hasUpdateAccess(roleAccess)
|
||||
|
||||
// Get encounter ID from route params
|
||||
const encounterId = computed(() => {
|
||||
const id = route.params.id
|
||||
return typeof id === 'string' ? parseInt(id) : 0
|
||||
})
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/[id]/edit'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'update')
|
||||
const encounterId = getParamsId()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canUpdate">
|
||||
<ContentEncounterEntry
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
:id="encounterId"
|
||||
class-code="inpatient"
|
||||
sub-class-code="icu"
|
||||
form-type="Edit"
|
||||
sub-class-code="vk"
|
||||
form-type="edit"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
@@ -53,4 +45,3 @@ const encounterId = computed(() => {
|
||||
:status-code="403"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -1,39 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/inpatient'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from '~/lib/page-checker'
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/process.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
title: 'Kunjungan',
|
||||
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
||||
title: 'Proses Kunjungan',
|
||||
contentFrame: 'cf-full-width',
|
||||
contentPadding: 'p-0',
|
||||
contentUseCard: false,
|
||||
})
|
||||
|
||||
useHead({
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => `${route.meta.title}`,
|
||||
})
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/[id]/process'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canRead">
|
||||
<Content class-code="inpatient" sub-class-code="vk" />
|
||||
<div v-if="hasAccess">
|
||||
<Content class-code="inpatient" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
<Error
|
||||
v-else
|
||||
:status-code="403"
|
||||
/>
|
||||
</template>
|
||||
@@ -1,10 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/ambulatory'
|
||||
import { permissions } from '~/const/page-permission/inpatient'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/entry.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg'],
|
||||
@@ -12,36 +21,22 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
|
||||
const { checkRole, hasReadAccess, hasCreateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canCreate = hasCreateAccess(roleAccess)
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/add'] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'create')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canCreate">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
:id="0"
|
||||
class-code="ambulatory"
|
||||
sub-class-code="reg"
|
||||
form-type="Tambah"
|
||||
class-code="inpatient"
|
||||
sub-class-code="vk"
|
||||
form-type="add"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
// Types & Consts
|
||||
import type { Permission } from '~/models/role'
|
||||
import { permissions } from '~/const/page-permission/inpatient'
|
||||
|
||||
// Helpers
|
||||
import { usePageChecker } from "~/lib/page-checker"
|
||||
|
||||
// Pubs
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
|
||||
// Apps
|
||||
import Content from '~/components/content/encounter/list.vue'
|
||||
|
||||
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||
|
||||
// Page meta
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||
@@ -12,37 +22,28 @@ definePageMeta({
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter'] || {}
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
if (!hasAccess) {
|
||||
navigateTo('/403')
|
||||
}
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = hasReadAccess(roleAccess)
|
||||
|
||||
// Page needs
|
||||
const route = useRoute()
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
title: () => `${getRouteTitle()}`,
|
||||
})
|
||||
|
||||
const { user } = useUserStore()
|
||||
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
||||
// Define common things
|
||||
const route = useRoute()
|
||||
|
||||
// Preps role checking
|
||||
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||
const canCreate = getPageAccess(roleAccess, 'create')
|
||||
const canRemove = getPageAccess(roleAccess, 'delete')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<div v-if="hasAccess">
|
||||
<Content
|
||||
class-code="inpatient"
|
||||
:sub-class-code="subClassCode"
|
||||
type="encounter"
|
||||
sub-class-code="vk"
|
||||
:can-create="canCreate"
|
||||
:can-delete="canRemove"
|
||||
/>
|
||||
</div>
|
||||
<Error
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
import Content from '~/components/content/sep/entry.vue'
|
||||
|
||||
definePageMeta({
|
||||
middleware: [],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
title: 'Detail SEP',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
})
|
||||
|
||||
const canCreate = true
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canCreate">
|
||||
<Content mode="detail" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</template>
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
import Content from '~/components/content/sep/entry.vue'
|
||||
|
||||
definePageMeta({
|
||||
middleware: [],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
title: 'Detail SEP',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
useHead({
|
||||
title: () => route.meta.title as string,
|
||||
})
|
||||
|
||||
const canCreate = true
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canCreate">
|
||||
<Content mode="link" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</template>
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { PagePermission } from '~/models/role'
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
||||
import Content from '~/components/content/sep/entry.vue'
|
||||
|
||||
definePageMeta({
|
||||
middleware: [],
|
||||
@@ -16,26 +15,12 @@ useHead({
|
||||
title: () => route.meta.title as string,
|
||||
})
|
||||
|
||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
|
||||
|
||||
const { checkRole, hasCreateAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
// if (!hasAccess) {
|
||||
// throw createError({
|
||||
// statusCode: 403,
|
||||
// statusMessage: 'Access denied',
|
||||
// })
|
||||
// }
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canCreate = true // hasCreateAccess(roleAccess)
|
||||
const canCreate = true
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="canCreate">
|
||||
<ContentSepEntry />
|
||||
<Content mode="add" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</template>
|
||||
@@ -1,12 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { PagePermission } from '~/models/role'
|
||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
||||
import Content from '~/components/content/sep/list.vue'
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
title: 'Daftar User',
|
||||
title: 'Daftar SEP',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
@@ -16,24 +15,13 @@ useHead({
|
||||
title: () => route.meta.title as string,
|
||||
})
|
||||
|
||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
|
||||
|
||||
const { checkRole, hasReadAccess } = useRBAC()
|
||||
|
||||
// Check if user has access to this page
|
||||
const hasAccess = checkRole(roleAccess)
|
||||
// if (!hasAccess) {
|
||||
// navigateTo('/403')
|
||||
// }
|
||||
|
||||
// Define permission-based computed properties
|
||||
const canRead = true // hasReadAccess(roleAccess)
|
||||
const canRead = true
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<ContentSepList />
|
||||
<Content />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user