diff --git a/htdocs/App.vue b/htdocs/App.vue index 5b4f44d..7fc1d04 100644 --- a/htdocs/App.vue +++ b/htdocs/App.vue @@ -22,6 +22,7 @@ import RoutePatientVisits from './RoutePatientVisits.vue'; import RoutePatientOrders from './RoutePatientOrders.vue'; import RoutePatientReports from './RoutePatientReports.vue'; + import RoutePatientDocuments from './RoutePatientDocuments.vue'; import RoutePlanner from './RoutePlanner.vue'; import RouteRecall from './RouteRecall.vue'; import RouteInbox from './RouteInbox.vue'; @@ -70,6 +71,8 @@ { path: 'reports/pathology', component: RoutePatientReports, props: { report_name: 'Pathology' } }, { path: 'reports/radiology', component: RoutePatientReports, props: { report_name: 'Radiology' } }, { path: 'reports/notes', component: RoutePatientReports, props: { report_name: 'Notes' } }, + { path: 'document', component: RoutePatientDocuments }, + { path: 'document/:tiu_da', component: RoutePatientDocuments }, ] }, { path: '/planner', component: RoutePlanner }, { path: '/recall', component: RouteRecall }, diff --git a/htdocs/RoutePatient.vue b/htdocs/RoutePatient.vue index 629852f..22a848b 100644 --- a/htdocs/RoutePatient.vue +++ b/htdocs/RoutePatient.vue @@ -53,6 +53,7 @@ { name: 'Visits', href: '/patient/' + this.patient_dfn + '/visits' + (this.sensitive && '?viewsensitive' || '') }, { name: 'Orders', href: '/patient/' + this.patient_dfn + '/orders' + (this.sensitive && '?viewsensitive' || '') }, { name: 'Reports', href: '/patient/' + this.patient_dfn + '/reports' + (this.sensitive && '?viewsensitive' || '') }, + { name: 'Documents', href: '/patient/' + this.patient_dfn + '/document' + (this.sensitive && '?viewsensitive' || '') }, ] } : null; } diff --git a/htdocs/RoutePatientDocuments.vue b/htdocs/RoutePatientDocuments.vue new file mode 100644 index 0000000..41ff563 --- /dev/null +++ b/htdocs/RoutePatientDocuments.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/htdocs/vistax.mjs b/htdocs/vistax.mjs index 0e1da02..d1e36fa 100644 --- a/htdocs/vistax.mjs +++ b/htdocs/vistax.mjs @@ -186,6 +186,12 @@ export const d_parse_multireport = data => { return res; }; +export const d_parse_tiudocumentlist = data => d_split(data, '^', 'IEN', 'title', 'time', 'patient', 'author', 'location', 'status', 'visit').map(row => { + row.author = row.author ? d_split1(row.author, ';', 'IEN', 'byline', 'name') : null; + row.visit = row.visit ? d_split1(row.visit, ';', 'date', 'time') : null; + return row; +}); + export function memoized(fn) { var cache = {}; return async function(...args) { @@ -300,6 +306,8 @@ export function Client(cid, secret) { this.TIU_TEMPLATE_DELETE = aflow((...args) => this.call({ method: 'TIU_TEMPLATE_DELETE', context: ['OR CPRS GUI CHART'], ttl: 0, stale: false }, ...args), d_log, d_unwrap); this.TIU_TEMPLATE_LOCK = aflow((...args) => this.call({ method: 'TIU_TEMPLATE_LOCK', context: ['OR CPRS GUI CHART'], ttl: 0, stale: false }, ...args), d_log, d_unwrap); this.TIU_TEMPLATE_UNLOCK = aflow((...args) => this.call({ method: 'TIU_TEMPLATE_UNLOCK', context: ['OR CPRS GUI CHART'], ttl: 0, stale: false }, ...args), d_log, d_unwrap); + this.TIU_DOCUMENTS_BY_CONTEXT = aflow((...args) => this.call({ method: 'TIU_DOCUMENTS_BY_CONTEXT', context: ['OR CPRS GUI CHART'], ttl: 60, stale: false }, ...args), d_log, d_unwrap, d_parse_array, d_parse_tiudocumentlist); + this.TIU_GET_RECORD_TEXT = aflow((...args) => this.call({ method: 'TIU_GET_RECORD_TEXT', context: ['OR CPRS GUI CHART'], ttl: 60, stale: false }, ...args), d_log, d_unwrap, d_parse_text); this.ORWCV_VST = memoized(aflow((...args) => this.callctx(['OR CPRS GUI CHART'], 'ORWCV_VST', ...args), d_log, d_unwrap, f_split('^', 'apptinfo', 'datetime', 'location', 'status')));