diff --git a/htdocs/vistax.mjs b/htdocs/vistax.mjs index 6f45d73..ccfe89a 100644 --- a/htdocs/vistax.mjs +++ b/htdocs/vistax.mjs @@ -157,18 +157,20 @@ export const d_parse_orderoptions_meddose = data => { }; 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) + if(row.meta) { + 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; });