Reactive title

This commit is contained in:
Jiang Yio 2023-05-06 12:05:13 -04:00
parent 535302ce9d
commit b57634f730
8 changed files with 65 additions and 22 deletions

View File

@ -1,10 +1,12 @@
<template> <template>
<Subtitle value="Detail" />
<div v-if="(sensitive) && (!info)" class="alert alert-danger text-center mb-3 shadow" role="alert"> <div v-if="(sensitive) && (!info)" class="alert alert-danger text-center mb-3 shadow" role="alert">
<h1>Warning: Restricted Record</h1> <h1>Warning: Restricted Record</h1>
<p>This record is protected by the Privacy Act of 1974 and the Health Insurance Portability and Accountability Act of 1996. If you elect to proceed, you will be required to prove you have a need to know. Accessing this patient is tracked, and your station Security Officer will contact you for your justification.</p> <p>This record is protected by the Privacy Act of 1974 and the Health Insurance Portability and Accountability Act of 1996. If you elect to proceed, you will be required to prove you have a need to know. Accessing this patient is tracked, and your station Security Officer will contact you for your justification.</p>
<router-link class="btn btn-danger" :to="'/patient/' + dfn + '?viewsensitive'">Proceed</router-link> <router-link class="btn btn-danger" :to="'/patient/' + dfn + '?viewsensitive'">Proceed</router-link>
</div> </div>
<div v-if="info"> <div v-if="info">
<Subtitle :value="info.name" />
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div> <div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div>
<div class="card-body row" style="font-family: monospace;"> <div class="card-body row" style="font-family: monospace;">
@ -32,6 +34,7 @@
<script> <script>
import { strptime_vista } from './util.mjs'; import { strptime_vista } from './util.mjs';
import Subtitle from './Subtitle.vue';
import DateRangePicker from './DateRangePicker.vue'; import DateRangePicker from './DateRangePicker.vue';
import ViewVitalsLabs from './ViewVitalsLabs.vue'; import ViewVitalsLabs from './ViewVitalsLabs.vue';
@ -39,7 +42,7 @@
export default { export default {
components: { components: {
DateRangePicker, ViewVitalsLabs Subtitle, DateRangePicker, ViewVitalsLabs
}, },
props: { props: {
client: Object client: Object
@ -56,11 +59,6 @@
orders_date_begin: now orders_date_begin: now
}; };
}, },
watch: {
info(value) {
if((value) && (value.name)) document.title = value.name;
}
},
methods: { methods: {
strptime_vista, strptime_vista,
async loadinfo(dfn, viewsensitive) { async loadinfo(dfn, viewsensitive) {

View File

@ -1,4 +1,5 @@
<template> <template>
<Subtitle value="Lookup" />
<div> <div>
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header">Patients</div> <div class="card-header">Patients</div>
@ -10,11 +11,12 @@
</template> </template>
<script> <script>
import Subtitle from './Subtitle.vue';
import ViewPatientLookup from './ViewPatientLookup.vue'; import ViewPatientLookup from './ViewPatientLookup.vue';
export default { export default {
components: { components: {
ViewPatientLookup Subtitle, ViewPatientLookup
}, },
props: { props: {
client: Object client: Object

View File

@ -1,10 +1,12 @@
<template> <template>
<Subtitle value="Orders" />
<div v-if="(sensitive) && (!info)" class="alert alert-danger text-center mb-3 shadow" role="alert"> <div v-if="(sensitive) && (!info)" class="alert alert-danger text-center mb-3 shadow" role="alert">
<h1>Warning: Restricted Record</h1> <h1>Warning: Restricted Record</h1>
<p>This record is protected by the Privacy Act of 1974 and the Health Insurance Portability and Accountability Act of 1996. If you elect to proceed, you will be required to prove you have a need to know. Accessing this patient is tracked, and your station Security Officer will contact you for your justification.</p> <p>This record is protected by the Privacy Act of 1974 and the Health Insurance Portability and Accountability Act of 1996. If you elect to proceed, you will be required to prove you have a need to know. Accessing this patient is tracked, and your station Security Officer will contact you for your justification.</p>
<router-link class="btn btn-danger" :to="'/patient/' + dfn + '/orders?viewsensitive'">Proceed</router-link> <router-link class="btn btn-danger" :to="'/patient/' + dfn + '/orders?viewsensitive'">Proceed</router-link>
</div> </div>
<div v-if="info"> <div v-if="info">
<Subtitle :value="info.name" />
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div> <div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div>
<div class="card-body row" style="font-family: monospace;"> <div class="card-body row" style="font-family: monospace;">
@ -35,6 +37,7 @@
<script> <script>
import { strptime_vista } from './util.mjs'; import { strptime_vista } from './util.mjs';
import Subtitle from './Subtitle.vue';
import DateRangePicker from './DateRangePicker.vue'; import DateRangePicker from './DateRangePicker.vue';
import OrderFilterPicker from './OrderFilterPicker.vue'; import OrderFilterPicker from './OrderFilterPicker.vue';
import ViewOrderMenu from './ViewOrderMenu.vue'; import ViewOrderMenu from './ViewOrderMenu.vue';
@ -44,7 +47,7 @@
export default { export default {
components: { components: {
DateRangePicker, OrderFilterPicker, ViewOrderMenu, ViewOrders Subtitle, DateRangePicker, OrderFilterPicker, ViewOrderMenu, ViewOrders
}, },
props: { props: {
client: Object client: Object
@ -59,11 +62,6 @@
orders_date_begin: now orders_date_begin: now
}; };
}, },
watch: {
info(value) {
if((value) && (value.name)) document.title = value.name;
}
},
methods: { methods: {
strptime_vista, strptime_vista,
async loadinfo(dfn, viewsensitive) { async loadinfo(dfn, viewsensitive) {

View File

@ -1,10 +1,12 @@
<template> <template>
<Subtitle value="Visits" />
<div v-if="(sensitive) && (!info)" class="alert alert-danger text-center mb-3 shadow" role="alert"> <div v-if="(sensitive) && (!info)" class="alert alert-danger text-center mb-3 shadow" role="alert">
<h1>Warning: Restricted Record</h1> <h1>Warning: Restricted Record</h1>
<p>This record is protected by the Privacy Act of 1974 and the Health Insurance Portability and Accountability Act of 1996. If you elect to proceed, you will be required to prove you have a need to know. Accessing this patient is tracked, and your station Security Officer will contact you for your justification.</p> <p>This record is protected by the Privacy Act of 1974 and the Health Insurance Portability and Accountability Act of 1996. If you elect to proceed, you will be required to prove you have a need to know. Accessing this patient is tracked, and your station Security Officer will contact you for your justification.</p>
<router-link class="btn btn-danger" :to="'/patient/' + dfn + '/orders?viewsensitive'">Proceed</router-link> <router-link class="btn btn-danger" :to="'/patient/' + dfn + '/orders?viewsensitive'">Proceed</router-link>
</div> </div>
<div v-if="info"> <div v-if="info">
<Subtitle :value="info.name" />
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div> <div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div>
<div class="card-body row" style="font-family: monospace;"> <div class="card-body row" style="font-family: monospace;">
@ -30,6 +32,7 @@
<script> <script>
import { strptime_vista } from './util.mjs'; import { strptime_vista } from './util.mjs';
import Subtitle from './Subtitle.vue';
import DateRangePicker from './DateRangePicker.vue'; import DateRangePicker from './DateRangePicker.vue';
import OrderFilterPicker from './OrderFilterPicker.vue'; import OrderFilterPicker from './OrderFilterPicker.vue';
import ViewVisits from './ViewVisits.vue'; import ViewVisits from './ViewVisits.vue';
@ -38,7 +41,7 @@
export default { export default {
components: { components: {
DateRangePicker, OrderFilterPicker, ViewVisits Subtitle, DateRangePicker, OrderFilterPicker, ViewVisits
}, },
props: { props: {
client: Object client: Object
@ -53,11 +56,6 @@
visits_date_begin: now visits_date_begin: now
}; };
}, },
watch: {
info(value) {
if((value) && (value.name)) document.title = value.name;
}
},
methods: { methods: {
strptime_vista, strptime_vista,
async loadinfo(dfn, viewsensitive) { async loadinfo(dfn, viewsensitive) {

View File

@ -1,4 +1,5 @@
<template> <template>
<Subtitle value="Planner" />
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<span>Planner</span> <span>Planner</span>
@ -10,12 +11,13 @@
</template> </template>
<script> <script>
import Subtitle from './Subtitle.vue';
import DateRangePicker from './DateRangePicker.vue'; import DateRangePicker from './DateRangePicker.vue';
import ViewPlanner from './ViewPlanner.vue'; import ViewPlanner from './ViewPlanner.vue';
export default { export default {
components: { components: {
DateRangePicker, ViewPlanner Subtitle, DateRangePicker, ViewPlanner
}, },
props: { props: {
client: Object client: Object

View File

@ -1,4 +1,5 @@
<template> <template>
<Subtitle value="Recall" />
<div> <div>
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header">Clinics</div> <div class="card-header">Clinics</div>
@ -47,6 +48,7 @@
<script> <script>
import { groupByArray, strtr_unscramble, strHashHSL, strftime_vista, debounce } from './util.mjs'; import { groupByArray, strtr_unscramble, strHashHSL, strftime_vista, debounce } from './util.mjs';
import Subtitle from './Subtitle.vue';
import ViewResourceLookup from './ViewResourceLookup.vue'; import ViewResourceLookup from './ViewResourceLookup.vue';
function dateonly(date) { function dateonly(date) {
@ -55,7 +57,7 @@
export default { export default {
components: { components: {
ViewResourceLookup Subtitle, ViewResourceLookup
}, },
props: { props: {
client: Object client: Object

View File

@ -1,4 +1,5 @@
<template> <template>
<Subtitle value="Schedule" />
<div> <div>
<div class="card mb-3 shadow"> <div class="card mb-3 shadow">
<div class="card-header">Clinics</div> <div class="card-header">Clinics</div>
@ -19,6 +20,7 @@
</template> </template>
<script> <script>
import Subtitle from './Subtitle.vue';
import ViewResourceLookup from './ViewResourceLookup.vue'; import ViewResourceLookup from './ViewResourceLookup.vue';
import DateRangePicker from './DateRangePicker.vue'; import DateRangePicker from './DateRangePicker.vue';
import ViewSchedule from './ViewSchedule.vue'; import ViewSchedule from './ViewSchedule.vue';
@ -29,7 +31,7 @@
export default { export default {
components: { components: {
ViewResourceLookup, DateRangePicker, ViewSchedule Subtitle, ViewResourceLookup, DateRangePicker, ViewSchedule
}, },
props: { props: {
client: Object client: Object

41
htdocs/Subtitle.vue Normal file
View File

@ -0,0 +1,41 @@
<script>
import { debounce } from './util.mjs';
const base = 'nuVistA';
const state = [{ value: base }];
const settitle = debounce(s => document.title = s || base, 0);
export default {
props: ['value'],
data() {
return { ptr: null };
},
watch: {
value: {
handler(value) {
this.update(value);
}, immediate: true
}
},
methods: {
update(value) {
if(value) {
if(this.ptr) this.ptr.value = value;
else {
this.ptr = { value };
state.unshift(this.ptr);
}
} else if(this.ptr) {
var idx = state.indexOf(this.ptr);
if(idx >= 0) state.splice(idx, 1);
this.ptr = null;
}
settitle(state.map(x => x.value).join(' - '));
}
},
unmounted() {
this.update();
},
render() {}
};
</script>