export async function get_api_appointments({ fetch, clinics = [], date = 'T' } = {}) { if(clinics.constructor === Array) clinics = clinics.map(x => x.replace(/^\s+|\s+$/g, '').replace(/\s+/, ' ')).filter(x => x).join('^').replace(/\//g, '|'); else clinics = clinics.replace(/^\s+|\s+$/g, '').replace(/\s+/, ' ').replace(/\//g, '|'); return await (await (fetch || window.fetch)('/api/appointments/' + clinics + '/' + date)).json(); } export async function get_api_lookup({ fetch, query, ordinal, force = false } = {}) { if(query) { if(ordinal === undefined) return await (await (fetch || window.fetch)('/api/lookup/' + encodeURIComponent(query))).json(); else return (await (fetch || window.fetch)('/api/lookup/' + encodeURIComponent(query) + '/' + (ordinal || '0') + (force ? '/force' : ''))).text() } } export async function get_api_rcrs_patients({ fetch, alpha = 'T-30', omega = 'N' } = {}) { return await (await (fetch || window.fetch)('/api/rcrs/patients/' + alpha + '/' + omega)).json(); } export async function get_api_rcrs_tumors({ fetch, alpha = 'T-30', omega = 'N' } = {}) { return await (await (fetch || window.fetch)('/api/rcrs/tumors/' + alpha + '/' + omega)).json(); } export async function get_api_measurements({ fetch, mrn, alpha = 'T-30', omega = 'N' } = {}) { return await (await (fetch || window.fetch)('/api/measurements/' + mrn + '/' + alpha + '/' + omega)).json(); } export async function get_api_labs({ fetch, mrn, alpha = 'T-30', omega = 'N' } = {}) { return await (await (fetch || window.fetch)('/api/labs/' + mrn + '/' + alpha + '/' + omega)).json(); } export async function get_api_notes({ fetch, mrn, alpha = 'T-30', omega = 'N' } = {}) { return await (await (fetch || window.fetch)('/api/notes/' + mrn + '/' + alpha + '/' + omega)).json(); } export async function get_api_orders({ fetch, mrn, alpha = 'T-30', omega = 'N' } = {}) { return await (await (fetch || window.fetch)('/api/orders/' + mrn + '/' + alpha + '/' + omega)).json(); }