Compare commits
1 Commits
mvp
...
050a0cd12b
Author | SHA1 | Date | |
---|---|---|---|
050a0cd12b |
17
README.md
17
README.md
@ -1,20 +1,3 @@
|
|||||||
# vistassh-py
|
# vistassh-py
|
||||||
|
|
||||||
Python-based web interface for VistA roll-and-scroll terminal
|
Python-based web interface for VistA roll-and-scroll terminal
|
||||||
|
|
||||||
## Getting started
|
|
||||||
|
|
||||||
You will need:
|
|
||||||
- Python 3.10+ & pip
|
|
||||||
- Node.js & npm
|
|
||||||
|
|
||||||
To install the dependencies and build the frontend, perform the following steps:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pip install -r requirements.txt
|
|
||||||
cd frontend
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
To run, invoke `main.py`.
|
|
13
ext_note.py
13
ext_note.py
@ -31,24 +31,15 @@ async def cmd_reports(proc, mrn, alpha, omega):
|
|||||||
proc.sendline(util.vista_strftime(omega))
|
proc.sendline(util.vista_strftime(omega))
|
||||||
assert await expect.endswith('\r\n Thru: ')
|
assert await expect.endswith('\r\n Thru: ')
|
||||||
proc.sendline(util.vista_strftime(alpha))
|
proc.sendline(util.vista_strftime(alpha))
|
||||||
found = True
|
assert await expect.endswith('\r\nDo you want WORK copies or CHART copies? CHART// ')
|
||||||
match await expect.endswith('\r\nDo you want WORK copies or CHART copies? CHART// ', '\r\nPrint Notes Beginning: '):
|
|
||||||
case autoproc.ExpectMatch(index=0):
|
|
||||||
proc.sendline() # default CHART
|
proc.sendline() # default CHART
|
||||||
if await expect.endswith('\r\nDo you want to start each note on a new page? NO// '):
|
if await expect.endswith('\r\nDo you want to start each note on a new page? NO// '):
|
||||||
proc.sendline() # default NO
|
proc.sendline() # default NO
|
||||||
assert await expect.endswith('\r\nDEVICE: HOME// ')
|
assert await expect.endswith('\r\nDEVICE: HOME// ')
|
||||||
proc.sendline('HOME;;1023')
|
proc.sendline('HOME;;1023')
|
||||||
assert await expect.earliest(' HOME(CRT)\r\n')
|
assert await expect.earliest(' HOME(CRT)\r\n')
|
||||||
case autoproc.ExpectMatch(index=1):
|
|
||||||
proc.sendline('^')
|
|
||||||
assert await expect.endswith('\r\nSelect PATIENT NAME: ')
|
|
||||||
proc.sendline('^')
|
|
||||||
assert await expect.endswith('\r\nSelect Progress Notes Print Options Option: ')
|
|
||||||
found = False
|
|
||||||
case _: assert False
|
|
||||||
pages = []
|
pages = []
|
||||||
while found:
|
while True:
|
||||||
match m_delimiter := await expect.endswith('\r\nType <Enter> to continue or \'^\' to exit: ', '\r\nSelect PATIENT NAME: '):
|
match m_delimiter := await expect.endswith('\r\nType <Enter> to continue or \'^\' to exit: ', '\r\nSelect PATIENT NAME: '):
|
||||||
case autoproc.ExpectMatch(index=0, before=before):
|
case autoproc.ExpectMatch(index=0, before=before):
|
||||||
if isnew(before) and len(pages) > 0:
|
if isnew(before) and len(pages) > 0:
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
export async function get_api_appointments({ fetch, clinics = [], date = 'T' } = {}) {
|
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, '|');
|
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, '|');
|
else clinics = clinics.replace(/^\s+|\s+$/g, '').replace(/\s+/, ' ').replace(/\//g, '|');
|
||||||
if(clinics) return await (await (fetch || window.fetch)('/api/appointments/' + clinics + '/' + date)).json();
|
return await (await (fetch || window.fetch)('/api/appointments/' + clinics + '/' + date)).json();
|
||||||
else return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function get_api_lookup({ fetch, query, ordinal, force = false } = {}) {
|
export async function get_api_lookup({ fetch, query, ordinal, force = false } = {}) {
|
||||||
|
@ -2,12 +2,7 @@ import { get_api_appointments } from '$lib/backend.js';
|
|||||||
|
|
||||||
/** @type {import('./$types').PageLoad} */
|
/** @type {import('./$types').PageLoad} */
|
||||||
export async function load({ params, fetch }) {
|
export async function load({ params, fetch }) {
|
||||||
let clinics = [];
|
let clinics = await (await fetch('/api/config/user/clinics')).json();
|
||||||
try {
|
|
||||||
clinics = await (await fetch('/api/config/user/clinics')).json();
|
|
||||||
} catch(ex) {
|
|
||||||
console.error(ex, ex.stack);
|
|
||||||
}
|
|
||||||
let appointments = await get_api_appointments({ fetch, clinics, date: 'T' });
|
let appointments = await get_api_appointments({ fetch, clinics, date: 'T' });
|
||||||
appointments.sort((a, b) => a.time_scheduled < b.time_scheduled ? -1 : a.time_scheduled > b.time_scheduled ? 1 : 0);
|
appointments.sort((a, b) => a.time_scheduled < b.time_scheduled ? -1 : a.time_scheduled > b.time_scheduled ? 1 : 0);
|
||||||
return {
|
return {
|
||||||
|
@ -2,12 +2,8 @@
|
|||||||
export async function load({ params, fetch }) {
|
export async function load({ params, fetch }) {
|
||||||
let clinics = await (await fetch('/api/clinic/list')).json();
|
let clinics = await (await fetch('/api/clinic/list')).json();
|
||||||
clinics.reduce((acc, item) => (acc[item.name] = item, acc), clinics);
|
clinics.reduce((acc, item) => (acc[item.name] = item, acc), clinics);
|
||||||
try {
|
|
||||||
let selection = await (await fetch('/api/config/user/clinics')).json();
|
let selection = await (await fetch('/api/config/user/clinics')).json();
|
||||||
selection.forEach(x => clinics[x] ? clinics[x].active = true : false);
|
selection.forEach(x => clinics[x] ? clinics[x].active = true : false);
|
||||||
} catch(ex) {
|
|
||||||
console.error(ex, ex.stack);
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
clinics
|
clinics
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user