VistA alert display

This commit is contained in:
2023-05-08 22:52:55 -04:00
parent 98cd861b5b
commit 38b13f9ad6
3 changed files with 90 additions and 1 deletions

View File

@@ -153,6 +153,23 @@ export const d_parse_orderoptions_meddose = data => {
return res;
};
export const d_parse_notifications_fastuser = data => d_split(data, '^', 'info', 'patient', 'location', 'urgency', 'time', 'message', 'unk_6', 'meta', 'unk_7', 'unk_8').map(row => {
var meta = row.meta.split(';');
var xqaid = row.meta_xqaid = meta[0];
row.meta_duz = meta[1];
row.meta_time = +meta[2];
if(xqaid.startsWith('OR,')) {
xqaid = xqaid.split(',');
row.meta_source = xqaid[0];
row.meta_dfn = xqaid[1];
row.meta_ien = xqaid[2]; // file 100.9 IEN
} else if(xqaid.startsWith('TIU')) {
row.meta_source = 'TIU';
row.meta_ien = xqaid.substring(3); // document IEN (DA)
}
return row;
});
export function memoized(fn) {
var cache = {};
return async function(...args) {
@@ -297,6 +314,8 @@ export function Client(cid, secret) {
this.ORWDPS2_DAY2QTY = memoized(aflow((...args) => this.callctx(['OR CPRS GUI CHART'], 'ORWDPS2_DAY2QTY', ...args), d_log, d_unwrap));
this.ORWDPS2_QTY2DAY = memoized(aflow((...args) => this.callctx(['OR CPRS GUI CHART'], 'ORWDPS2_QTY2DAY', ...args), d_log, d_unwrap));
this.ORWORB_FASTUSER = aflow(() => this.call({ method: 'ORWORB_FASTUSER', context: ['OR CPRS GUI CHART'], ttl: 60, stale: false }), d_log, d_unwrap, d_parse_notifications_fastuser);
return this;
}
Client._registry = {};