refactor: change props to encounter data
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, defineAsyncComponent } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
// Components
|
||||
@@ -10,6 +10,9 @@ import SubMenu from '~/components/pub/my-ui/menus/submenu.vue'
|
||||
// Libraries
|
||||
import { getPositionAs } from '~/lib/roles'
|
||||
|
||||
// Models
|
||||
import { genEncounter } from '~/models/encounter'
|
||||
|
||||
// Types
|
||||
import type { EncounterProps } from '~/handlers/encounter-init.handler'
|
||||
|
||||
@@ -37,15 +40,13 @@ const activeMenu = computed({
|
||||
})
|
||||
|
||||
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const data = ref<any>(null)
|
||||
const data = ref<any>(genEncounter())
|
||||
const isShowPatient = computed(() => data.value && data.value?.patient?.person)
|
||||
|
||||
if (activePosition.value === 'none') { // if user position is none, redirect to home page
|
||||
router.push('/')
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(user, null, 4))
|
||||
|
||||
// Dummy rows for ProtocolList (matches keys expected by list-cfg.protocol)
|
||||
const protocolRows = [
|
||||
{
|
||||
@@ -83,16 +84,8 @@ function handleClick(type: string) {
|
||||
|
||||
function initMenus() {
|
||||
menus.value = getMenuItems(id, props, user, {
|
||||
status: data.value,
|
||||
medicalAssessment: data.value,
|
||||
medicalAssessmentRehab: data.value,
|
||||
functionAssessment: data.value,
|
||||
protocolTheraphy: data.value,
|
||||
protocolChemotherapy: data.value,
|
||||
medicineProtocolChemotherapy: data.value,
|
||||
consultation: data.value,
|
||||
letterOfControl: data.value,
|
||||
}, {
|
||||
encounter: data.value
|
||||
} as any, {
|
||||
protocolTheraphy: paginationMeta,
|
||||
protocolChemotherapy: paginationMeta,
|
||||
medicineProtocolChemotherapy: paginationMeta,
|
||||
|
||||
Reference in New Issue
Block a user