b1cb24cae3
Add new SatuSehat integration feature including: - Page components for list, add, edit, and detail views - Service status component and type definitions - Summary card component updates for string metrics - RBAC permissions configuration for SatuSehat routes
41 lines
931 B
Vue
41 lines
931 B
Vue
<script setup lang="ts">
|
|
import type { PagePermission } from '~/models/role'
|
|
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
|
|
|
definePageMeta({
|
|
middleware: ['rbac'],
|
|
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
|
title: 'Tambah Pasien',
|
|
contentFrame: 'cf-full-width',
|
|
})
|
|
|
|
const route = useRoute()
|
|
|
|
useHead({
|
|
title: () => route.meta.title as string,
|
|
})
|
|
|
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/satusehat']
|
|
|
|
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 = hasCreateAccess(roleAccess)
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="canCreate">
|
|
<FlowPatientAdd />
|
|
</div>
|
|
<PubBaseError v-else :status-code="403" />
|
|
</template>
|