Files
vistassh-py/frontend/src/routes/chart/[mrn]/+layout.svelte
2024-03-02 00:45:21 -05:00

20 lines
707 B
Svelte

<script>
import { onDestroy } from 'svelte';
import { navlinks } from '$lib/stores.js';
export let data;
const links = navlinks.push({
name: data.facesheet_data.name ? data.facesheet_data.name.split(',')[0].toLowerCase().replace(/(?:^|\s|["'([{])+\S/g, m => m.toUpperCase()) + ' ' + data.facesheet_data.ssn.split('-')[2] : 'Chart',
href: '/chart/' + data.mrn,
children: [
{ name: 'Orders', href: '/chart/' + data.mrn + '/orders' },
{ name: 'Labs', href: '/chart/' + data.mrn + '/labs' },
{ name: 'Notes', href: '/chart/' + data.mrn + '/notes' },
{ name: 'Flowsheet', href: '/chart/' + data.mrn + '/flowsheet' },
]
});
onDestroy(() => navlinks.pop(links));
</script>
<slot />