Compare commits

...

2 Commits

2 changed files with 23 additions and 10 deletions

View File

@ -31,15 +31,24 @@ 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))
assert await expect.endswith('\r\nDo you want WORK copies or CHART copies? CHART// ') found = True
proc.sendline() # default CHART match await expect.endswith('\r\nDo you want WORK copies or CHART copies? CHART// ', '\r\nPrint Notes Beginning: '):
if await expect.endswith('\r\nDo you want to start each note on a new page? NO// '): case autoproc.ExpectMatch(index=0):
proc.sendline() # default NO proc.sendline() # default CHART
assert await expect.endswith('\r\nDEVICE: HOME// ') if await expect.endswith('\r\nDo you want to start each note on a new page? NO// '):
proc.sendline('HOME;;1023') proc.sendline() # default NO
assert await expect.earliest(' HOME(CRT)\r\n') assert await expect.endswith('\r\nDEVICE: HOME// ')
proc.sendline('HOME;;1023')
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 True: while found:
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:

View File

@ -2,8 +2,12 @@
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);
let selection = await (await fetch('/api/config/user/clinics')).json(); try {
selection.forEach(x => clinics[x] ? clinics[x].active = true : false); let selection = await (await fetch('/api/config/user/clinics')).json();
selection.forEach(x => clinics[x] ? clinics[x].active = true : false);
} catch(ex) {
console.error(ex, ex.stack);
}
return { return {
clinics clinics
}; };