Compare commits

...

2 Commits

Author SHA1 Message Date
eb5e861441 Icon from Harold Bien 2023-04-25 18:39:25 -04:00
72d14e4b2f Enhanced schedule viewer using SDEC CRSCHED from Harold Bien 2023-04-25 18:21:32 -04:00
6 changed files with 184 additions and 27 deletions

View File

@ -1,7 +1,7 @@
<template>
<nav class="navbar navbar-expand-lg bg-dark">
<div class="container-fluid">
<router-link class="navbar-brand" to="/"><template v-if="user">{{user[2]}}</template><template v-else>nuVistA</template></router-link>
<router-link class="navbar-brand" to="/"><img src="/icon.svg" style="height: 1.875rem;" /></router-link>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
@ -28,7 +28,7 @@
<router-link class="nav-link" to="/recall">Recall</router-link>
</li>
<li class="nav-item" v-if="server">
<a class="nav-link disabled">{{server.domain}}</a>
<a class="nav-link disabled"><template v-if="user">{{user[2]}} @ </template>{{server.domain}}</a>
</li>
</ul>
<form class="d-flex" role="search">

View File

@ -1,23 +1,56 @@
<template>
<div v-if="(age === undefined) || (age > 0)" class="alert alert-warning">⚠ update error<template v-if="age >= 90000">; last updated {{Math.round(age/60000)}} minutes ago</template></div>
<table class="table" style="font-family: monospace;" v-if="appointments && appointments.length > 0">
<thead>
<tr><th>Time</th><th>Clinic</th><th>Patient</th><th>Note</th><th style="width: 16rem;">Assignee</th></tr>
<tr><th style="width: 7rem;">Time</th><th>Clinic</th><th>Patient</th><th>Note</th><th style="width: 16rem;">Assignee</th></tr>
</thead>
<tbody>
<tr v-for="row in appointments" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
<td>{{row.ApptDate}}</td>
<td>{{row.Clinic}}</td>
<td v-if="production"><router-link :to="'/patient/$' + row.HRN">{{row.Name}} <span :title="row.HRN">{{row.HRN.slice(-4)}}</span></router-link></td>
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.HRN.slice(-4) + '?name=' + row.Name">{{row.Name}} ${{row.HRN}}</router-link></td>
<td>{{row.NOTE}} [{{row.APPT_MADE_BY}} on {{row.DATE_APPT_MADE}}]</td>
<td><Autocomplete :modelValue="practitioner[row.Name]" @update:modelValue="x => practitioner[row.Name] = x" :items="practitioner_list" /></td>
<tbody class="striped">
<tr v-for="row in appointments" :class="{ voided: (row.CANCELLED != '0') || (row.NOSHOW != '0') }" :style="{ backgroundColor: strHashHSL(row.RESOURCENAME, '90%') }">
<td v-if="row.CANCELLED != '0'" title="Cancelled"><div><span class="emoji">❌</span> {{row.START_TIME.match(/\d\d:\d\d/)[0]}}</div><div class="date">{{row.START_TIME.match(/\w{3} \d+, \d{4}/)[0]}}</div></td>
<td v-else-if="row.NOSHOW != '0'" title="No show"><div><span class="emoji"></span> {{row.START_TIME.match(/\d\d:\d\d/)[0]}}</div><div class="date">{{row.START_TIME.match(/\w{3} \d+, \d{4}/)[0]}}</div></td>
<td v-else-if="row.CHECKOUT" :title="'Checked out ' + row.CHECKOUT"><div><span class="emoji"></span> {{row.START_TIME.match(/\d\d:\d\d/)[0]}}</div><div class="date">{{row.START_TIME.match(/\w{3} \d+, \d{4}/)[0]}}</div></td>
<td v-else-if="row.CHECKIN" :title="'Checked in ' + row.CHECKIN"><div><span class="emoji"></span> {{row.START_TIME.match(/\d\d:\d\d/)[0]}}</div><div class="date">{{row.START_TIME.match(/\w{3} \d+, \d{4}/)[0]}}</div></td>
<td v-else title="Scheduled"><div><span class="emoji"></span> {{row.START_TIME.match(/\d\d:\d\d/)[0]}}</div><div class="date">{{row.START_TIME.match(/\w{3} \d+, \d{4}/)[0]}}</div></td>
<td>{{row.RESOURCENAME}}</td>
<td><router-link :to="'/patient/' + row.PATIENTID">{{row.PATIENTNAME}} <span :title="row.HRN">{{row.HRN.slice(-4)}}</span></router-link></td>
<td><template v-if="row.WALKIN != '0'">[Walk-in] </template>{{row.NOTE}}</td>
<td><Autocomplete :modelValue="practitioner[row.PATIENTNAME]" @update:modelValue="x => practitioner[row.PATIENTNAME] = x" :items="practitioner_list" /></td>
</tr>
</tbody>
</table>
</template>
<style scoped>
.striped {
background-image: repeating-linear-gradient(
-45deg,
rgba(255, 255, 255, 0.1),
rgba(255, 255, 255, 0.1) 10px,
rgba(0, 0, 0, 0.1) 10px,
rgba(0, 0, 0, 0.1) 20px
);
}
.voided {
opacity: 0.8;
}
.date {
font-size: 80%;
}
.emoji {
font-family:
"Twemoji Mozilla",
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
"Noto Color Emoji",
"EmojiOne Color",
"Android Emoji",
sans-serif;
}
</style>
<script>
import { uniq, strtr_unscramble, strHashHSL, strfdate_vista, debounce } from './util.mjs';
import { uniq, strHashHSL, strfdate_vista, debounce } from './util.mjs';
import Autocomplete from './Autocomplete.vue';
@ -37,13 +70,11 @@
data() {
return {
appointments: [],
production: true
ts: null,
age: 0
};
},
computed: {
params() {
return { selection: this.selection, date_begin: this.date_begin, date_end: this.date_end };
},
practitioner() {
return this.client.remotestate.practitioner || (this.client.remotestate.practitioner = {});
},
@ -51,20 +82,31 @@
return this.practitioner ? uniq(Object.values(this.practitioner).filter(x => x)).sort() : [];
}
},
watch: {
params(value) {
this.debounced_params(value);
}
},
methods: {
strHashHSL,
strtr_unscramble
async update() {
try {
this.appointments = (await this.client.SDEC_CRSCHED(this.selection.join('|') + '|', strfdate_vista(this.date_begin), strfdate_vista(this.date_end) + '@2359')).sort((a, b) => (new Date(a.START_TIME)) - (new Date(b.START_TIME)));
this.ts = new Date();
this.age = 0;
} catch(ex) {
this.age = this.ts ? (new Date()) - this.ts : undefined;
console.warn(ex);
}
}
},
created() {
this.debounced_params = debounce(async function(value) { this.appointments = value.selection.length > 0 ? (await this.client.SDEC_CLINLET(value.selection.join('|') + '|', strfdate_vista(value.date_begin), strfdate_vista(value.date_end))).sort((a, b) => (new Date(a.ApptDate)) - (new Date(b.ApptDate))) : []; }, 500);
mounted() {
this.$watch(
() => (this.client, this.selection, this.date_begin, this.date_end, {}),
debounce(async () => {
window.clearInterval(this.timer);
this.update();
this.timer = window.setInterval(this.update, 60000);
}, 500)
);
},
async mounted() {
this.production = (await this.client.serverinfo()).result.production == '1';
unmounted() {
window.clearInterval(this.timer);
}
};
</script>

113
htdocs/icon.svg Normal file
View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="48mm"
height="48mm"
viewBox="0 0 48 48"
version="1.1"
id="svg5"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2">
<filter
style="color-interpolation-filters:sRGB"
id="filter3763"
x="-0.78863951"
y="-0.88395267"
width="2.577279"
height="2.7679053">
<feFlood
flood-opacity="0.498039"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood3753" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite3755" />
<feGaussianBlur
in="composite1"
stdDeviation="3.3734374"
result="blur"
id="feGaussianBlur3757" />
<feOffset
dx="0"
dy="0"
result="offset"
id="feOffset3759" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="fbSourceGraphic"
id="feComposite3761" />
<feColorMatrix
result="fbSourceGraphicAlpha"
in="fbSourceGraphic"
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
id="feColorMatrix3765" />
<feFlood
id="feFlood3767"
flood-opacity="0.498039"
flood-color="rgb(0,0,0)"
result="flood"
in="fbSourceGraphic" />
<feComposite
in2="fbSourceGraphic"
id="feComposite3769"
in="flood"
operator="in"
result="composite1" />
<feGaussianBlur
id="feGaussianBlur3771"
in="composite1"
stdDeviation="6"
result="blur" />
<feOffset
id="feOffset3773"
dx="0"
dy="0"
result="offset" />
<feComposite
in2="offset"
id="feComposite3775"
in="fbSourceGraphic"
operator="over"
result="composite2" />
</filter>
</defs>
<g
id="layer1"
transform="translate(-33.302987,-22.535447)">
<rect
style="fill:#003f72;fill-opacity:1;stroke-width:0.762"
id="rect325"
width="48"
height="48"
x="33.302986"
y="22.535448"
ry="8" />
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.8px;line-height:1.25;font-family:Georgia;-inkscape-font-specification:'Georgia Bold Italic';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="55.709675"
y="62.096775"
id="text2458"><tspan
id="tspan2456"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.8px;font-family:Georgia;-inkscape-font-specification:'Georgia Bold Italic';stroke-width:0.264583"
x="55.709675"
y="62.096775" /></text>
<text
xml:space="preserve"
style="font-size:50.8px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#f3cf45;fill-opacity:1;stroke-width:0.264583;filter:url(#filter3763)"
x="42.581402"
y="58.962597"
id="text2466"><tspan
id="tspan2464"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.8px;font-family:Georgia;-inkscape-font-specification:'Georgia Bold Italic';fill:#f3cf45;fill-opacity:1;stroke-width:0.264583"
x="42.581402"
y="58.962597">ν</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1/dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/table-sticky.css" />
<link rel="stylesheet" type="text/css" href="/userstyle.css" />
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
</head>
<body><div id='root'></div></body>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue@3.2"></script>

View File

@ -340,6 +340,7 @@ export function Client(cid, secret) {
this.SDEC_RESOURCE = memoized(unwrapped(logged(() => this.callctx(['SDECRPC'], 'SDEC_RESOURCE'), 'SDEC_RESOURCE')));
this.SDEC_CLINLET = memoized(unwrapped(logged((...args) => this.callctx(['SDECRPC'], 'SDEC_CLINLET', ...args), 'SDEC_CLINLET')));
this.SDEC_CRSCHED = unwrapped(logged((...args) => this.callctx(['SDECRPC'], 'SDEC_CRSCHED', ...args), 'SDEC_CRSCHED'));
this.ORWPT_FULLSSN = memoized(caretseparated(unwrapped(logged((...args) => this.callctx(['OR CPRS GUI CHART'], 'ORWPT_FULLSSN', ...args), 'ORWPT_FULLSSN')), ['dfn', 'name', 'date', 'pid']));
this.ORWPT_LAST5 = memoized(caretseparated(unwrapped(logged((...args) => this.callctx(['OR CPRS GUI CHART'], 'ORWPT_LAST5', ...args), 'ORWPT_LAST5')), ['dfn', 'name', 'date', 'pid']));

View File

@ -31,7 +31,7 @@ class CacheProxyRPC(util.CacheProxy):
persistent = util.Store().memo
if volatile is None:
volatile = util.Store().memo
self._cache(('__call__', 'close', 'authenticate', 'keepalive', 'XWB_CREATE_CONTEXT', 'XWB_IM_HERE', 'TIU_TEMPLATE_GETROOTS', 'TIU_TEMPLATE_GETPROOT', 'TIU_TEMPLATE_GETBOIL', 'TIU_TEMPLATE_GET_DESCRIPTION', 'TIU_TEMPLATE_GETITEMS', 'TIU_TEMPLATE_SET ITEMS', 'TIU_TEMPLATE_CREATE/MODIFY', 'TIU_TEMPLATE_DELETE', 'TIU_TEMPLATE_LOCK', 'TIU_TEMPLATE_UNLOCK', 'ORWDXM1_BLDQRSP'), None)
self._cache(('__call__', 'close', 'authenticate', 'keepalive', 'XWB_CREATE_CONTEXT', 'XWB_IM_HERE', 'TIU_TEMPLATE_GETROOTS', 'TIU_TEMPLATE_GETPROOT', 'TIU_TEMPLATE_GETBOIL', 'TIU_TEMPLATE_GET_DESCRIPTION', 'TIU_TEMPLATE_GETITEMS', 'TIU_TEMPLATE_SET ITEMS', 'TIU_TEMPLATE_CREATE/MODIFY', 'TIU_TEMPLATE_DELETE', 'TIU_TEMPLATE_LOCK', 'TIU_TEMPLATE_UNLOCK', 'SDEC_CRSCHED', 'ORWDXM1_BLDQRSP'), None)
self._cache(('SDEC_RESOURCE', 'ORWU1_NEWLOC', 'ORWLRR_ALLTESTS_ALL', 'ORWORDG_ALLTREE', 'ORWORDG_REVSTS', 'ORWDX_DGNM', 'ORWDX_ORDITM'), persistent, prefix=prefix, ttl=float('inf'))
self._cache(('XWB_GET_BROKER_INFO', 'XUS_INTRO_MSG'), volatile, prefix=prefix, ttl=float('inf'))
self._cache(None, volatile, prefix=prefix, ttl=float('-inf'))