Settings page for clinic selection
This commit is contained in:
@@ -1,46 +1,39 @@
|
||||
<template>
|
||||
<Subtitle value="Recall" />
|
||||
<div>
|
||||
<div class="card mb-3 shadow">
|
||||
<div class="card-header">Clinics</div>
|
||||
<div class="card-body">
|
||||
<ViewResourceLookup :client="client" v-model:selection="selection" />
|
||||
</div>
|
||||
<div class="card mb-3 shadow">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<span>Recall list ({{patients_lost.length + patients_outstanding.length}})</span>
|
||||
<router-link to="/settings">Select clinics<template v-if="selection.length > 0"> ({{selection.length}})</template></router-link>
|
||||
</div>
|
||||
<div class="card mb-3 shadow">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<span>Recall list ({{patients_lost.length + patients_outstanding.length}})</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table" style="font-family: monospace;" v-if="patients_lost && patients_lost.length > 0">
|
||||
<thead>
|
||||
<tr><th>Lost ({{patients_lost.length}})</th><th>Last appt</th><th>Clinic</th><th>Days</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in patients_lost" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
|
||||
<td v-if="production"><router-link :to="'/patient/$' + row.key">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td>{{datefmt(row.TimeLast)}} {{dow[row.TimeLast.getDay()]}}</td>
|
||||
<td>{{row.Clinic}}</td>
|
||||
<td>{{Math.round(row.TimeLastDiff/86400000)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table" style="font-family: monospace;" v-if="patients_outstanding && patients_outstanding.length > 0">
|
||||
<thead>
|
||||
<tr><th>Outstanding ({{patients_outstanding.length}})</th><th>Next appt</th><th>Clinic</th><th>Days</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in patients_outstanding" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
|
||||
<td v-if="production"><router-link :to="'/patient/$' + row.key">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td>{{datefmt(row.TimeNext)}} {{dow[row.TimeNext.getDay()]}}</td>
|
||||
<td>{{row.Clinic}}</td>
|
||||
<td>{{Math.round(row.TimeNextDiff/86400000)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table" style="font-family: monospace;" v-if="patients_lost && patients_lost.length > 0">
|
||||
<thead>
|
||||
<tr><th>Lost ({{patients_lost.length}})</th><th>Last appt</th><th>Clinic</th><th>Days</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in patients_lost" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
|
||||
<td v-if="production"><router-link :to="'/patient/$' + row.key">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td>{{datefmt(row.TimeLast)}} {{dow[row.TimeLast.getDay()]}}</td>
|
||||
<td>{{row.Clinic}}</td>
|
||||
<td>{{Math.round(row.TimeLastDiff/86400000)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table" style="font-family: monospace;" v-if="patients_outstanding && patients_outstanding.length > 0">
|
||||
<thead>
|
||||
<tr><th>Outstanding ({{patients_outstanding.length}})</th><th>Next appt</th><th>Clinic</th><th>Days</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in patients_outstanding" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
|
||||
<td v-if="production"><router-link :to="'/patient/$' + row.key">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.key.slice(-4) + '?name=' + row.Name">{{row.Name}} <span :title="row.key">{{row.key.slice(-4)}}</span></router-link></td>
|
||||
<td>{{datefmt(row.TimeNext)}} {{dow[row.TimeNext.getDay()]}}</td>
|
||||
<td>{{row.Clinic}}</td>
|
||||
<td>{{Math.round(row.TimeNextDiff/86400000)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -49,7 +42,6 @@
|
||||
import { groupByArray, strtr_unscramble, strHashHSL, strftime_vista, debounce } from './util.mjs';
|
||||
|
||||
import Subtitle from './Subtitle.vue';
|
||||
import ViewResourceLookup from './ViewResourceLookup.vue';
|
||||
|
||||
function dateonly(date) {
|
||||
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
@@ -57,7 +49,7 @@
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Subtitle, ViewResourceLookup
|
||||
Subtitle
|
||||
},
|
||||
props: {
|
||||
client: Object
|
||||
@@ -73,10 +65,7 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
selection: {
|
||||
get() { return this.client.remotestate.resources ? (this.client.remotestate.resources.split(',').filter(x => x) || []) : [] },
|
||||
set(value) { this.client.remotestate.resources = value.join(','); }
|
||||
},
|
||||
selection() { return (this.client) && (this.client.remotestate.resources) ? (this.client.remotestate.resources.split(',').filter(x => x) || []) : [] },
|
||||
patients_lost() {
|
||||
return this.patients.filter(x => x.TimeLastDiff >= 0).sort((a, b) => b.TimeLastDiff - a.TimeLastDiff);
|
||||
},
|
||||
|
Reference in New Issue
Block a user