nuVistA/htdocs/App.vue

88 lines
3.1 KiB
Vue
Raw Normal View History

2022-09-22 07:10:08 -04:00
<template>
2023-05-08 20:19:10 -04:00
<Submenu :value="menu" />
2023-05-01 18:58:48 -04:00
<div class="container-fluid" style="padding-top: 5rem;">
2022-09-26 17:38:27 -04:00
<Navbar v-model:server="server" :user="user" />
2023-05-01 19:32:23 -04:00
<Throbber :client="client" />
2022-09-22 07:10:08 -04:00
<div class="container">
2022-09-26 17:38:27 -04:00
<Login :secret="secret" v-model:client="client" v-model:server="server" v-model:user="user" />
2022-09-27 19:22:57 -04:00
<router-view v-if="user" :client="client"></router-view>
2022-09-22 07:10:08 -04:00
</div>
</div>
</template>
<script>
2023-05-08 20:19:10 -04:00
import Submenu from './Submenu.vue';
2022-09-22 07:10:08 -04:00
import Navbar from './Navbar.vue';
2023-05-01 19:32:23 -04:00
import Throbber from './Throbber.vue';
2022-09-22 07:10:08 -04:00
import Login from './Login.vue';
import RouteSchedule from './RouteSchedule.vue';
import RouteLookup from './RouteLookup.vue';
2023-05-08 18:48:29 -04:00
import RoutePatient from './RoutePatient.vue';
2022-09-22 07:10:08 -04:00
import RoutePatientDetail from './RoutePatientDetail.vue';
2023-04-24 21:23:35 -04:00
import RoutePatientVisits from './RoutePatientVisits.vue';
2023-04-24 23:10:19 -04:00
import RoutePatientOrders from './RoutePatientOrders.vue';
2023-05-08 22:55:20 -04:00
import RoutePatientReports from './RoutePatientReports.vue';
2023-05-10 21:55:15 -04:00
import RoutePatientDocuments from './RoutePatientDocuments.vue';
import RoutePlanner from './RoutePlanner.vue';
2022-09-23 23:59:55 -04:00
import RouteRecall from './RouteRecall.vue';
2023-05-08 22:52:55 -04:00
import RouteInbox from './RouteInbox.vue';
2022-09-22 07:10:08 -04:00
export default {
components: {
2023-05-08 20:19:10 -04:00
Submenu, Navbar, Throbber, Login
2022-09-22 07:10:08 -04:00
},
props: {
secret: String
},
data() {
return {
client: null,
2022-09-26 17:38:27 -04:00
server: null,
2022-09-22 07:10:08 -04:00
user: null,
heartbeat: null,
banner: '',
2023-05-08 20:19:10 -04:00
authenticated: false,
menu: {
name: 'Main',
items: [
{ name: 'Schedule', href: '/' },
{ name: 'Lookup', href: '/lookup' },
{ name: 'Planner', href: '/planner' },
2023-05-08 22:52:55 -04:00
{ name: 'Recall', href: '/recall' },
{ name: 'Inbox', href: '/inbox' },
2023-05-08 20:19:10 -04:00
]
}
2022-09-22 07:10:08 -04:00
};
},
watch: {
2022-09-26 17:38:27 -04:00
async client(value, oldvalue) {
2022-09-22 07:10:08 -04:00
if(this.heartbeat) window.clearInterval(this.heartbeat);
else {
[
2022-09-27 19:22:57 -04:00
{ path: '/', component: RouteSchedule },
{ path: '/lookup', component: RouteLookup },
2023-05-08 18:48:29 -04:00
{ path: '/patient/:id', component: RoutePatient, children: [
{ path: '', component: RoutePatientDetail },
{ path: 'visits', component: RoutePatientVisits },
{ path: 'orders', component: RoutePatientOrders },
2023-05-08 22:55:20 -04:00
{ path: 'reports', component: RoutePatientReports },
{ path: 'reports/bloodbank', component: RoutePatientReports, props: { report_name: 'Blood Bank' } },
{ path: 'reports/microbiology', component: RoutePatientReports, props: { report_name: 'Microbiology' } },
{ path: 'reports/pathology', component: RoutePatientReports, props: { report_name: 'Pathology' } },
{ path: 'reports/radiology', component: RoutePatientReports, props: { report_name: 'Radiology' } },
{ path: 'reports/notes', component: RoutePatientReports, props: { report_name: 'Notes' } },
2023-05-10 21:55:15 -04:00
{ path: 'document', component: RoutePatientDocuments },
{ path: 'document/:tiu_da', component: RoutePatientDocuments },
2023-05-08 18:48:29 -04:00
] },
{ path: '/planner', component: RoutePlanner },
2022-09-27 19:22:57 -04:00
{ path: '/recall', component: RouteRecall },
2023-05-08 22:52:55 -04:00
{ path: '/inbox', component: RouteInbox },
2022-09-22 07:10:08 -04:00
].forEach(route => this.$root.$router.addRoute(route));
await this.$root.$router.replace(this.$route);
}
2022-09-27 21:39:27 -04:00
if(value) this.heartbeat = await value.heartbeat();
2022-09-22 07:10:08 -04:00
}
}
};
</script>