@fnndsc/brasa 0.57.4 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/models.d.ts +2 -3
- package/dist/api/models.js.map +1 -1
- package/dist/buildinfo.json +1 -1
- package/dist/builtins/argumentTokens.js +25 -6
- package/dist/builtins/argumentTokens.js.map +1 -1
- package/dist/builtins/berth/berth.d.ts +0 -14
- package/dist/builtins/berth/berth.js +255 -88
- package/dist/builtins/berth/berth.js.map +1 -1
- package/dist/builtins/berth/berthClose.d.ts +66 -1
- package/dist/builtins/berth/berthClose.js +312 -26
- package/dist/builtins/berth/berthClose.js.map +1 -1
- package/dist/builtins/berth/berthClosed.d.ts +212 -0
- package/dist/builtins/berth/berthClosed.js +231 -0
- package/dist/builtins/berth/berthClosed.js.map +1 -0
- package/dist/builtins/berth/berthCube.js +27 -6
- package/dist/builtins/berth/berthCube.js.map +1 -1
- package/dist/builtins/berth/berthDisk.js +1 -1
- package/dist/builtins/berth/berthDisk.js.map +1 -1
- package/dist/builtins/berth/berthProcesses.js +15 -3
- package/dist/builtins/berth/berthProcesses.js.map +1 -1
- package/dist/builtins/berth/berthRecord.d.ts +14 -2
- package/dist/builtins/berth/berthRecord.js +20 -5
- package/dist/builtins/berth/berthRecord.js.map +1 -1
- package/dist/builtins/berth/berthState.d.ts +26 -6
- package/dist/builtins/berth/berthState.js +47 -13
- package/dist/builtins/berth/berthState.js.map +1 -1
- package/dist/builtins/debug.d.ts +0 -8
- package/dist/builtins/debug.js +1 -12
- package/dist/builtins/debug.js.map +1 -1
- package/dist/builtins/executable.js +102 -75
- package/dist/builtins/executable.js.map +1 -1
- package/dist/builtins/feedTotals.js +30 -25
- package/dist/builtins/feedTotals.js.map +1 -1
- package/dist/builtins/fs/acl.args.d.ts +3 -10
- package/dist/builtins/fs/acl.args.js +16 -24
- package/dist/builtins/fs/acl.args.js.map +1 -1
- package/dist/builtins/fs/acl.d.ts +0 -37
- package/dist/builtins/fs/acl.js +36 -58
- package/dist/builtins/fs/acl.js.map +1 -1
- package/dist/builtins/fs/archive.js +4 -7
- package/dist/builtins/fs/archive.js.map +1 -1
- package/dist/builtins/fs/cat.d.ts +0 -16
- package/dist/builtins/fs/cat.js +163 -96
- package/dist/builtins/fs/cat.js.map +1 -1
- package/dist/builtins/fs/cd.js +23 -5
- package/dist/builtins/fs/cd.js.map +1 -1
- package/dist/builtins/fs/configWrite.d.ts +0 -8
- package/dist/builtins/fs/configWrite.js +33 -46
- package/dist/builtins/fs/configWrite.js.map +1 -1
- package/dist/builtins/fs/cp.d.ts +6 -10
- package/dist/builtins/fs/cp.js +83 -86
- package/dist/builtins/fs/cp.js.map +1 -1
- package/dist/builtins/fs/deliveryIntent.d.ts +24 -0
- package/dist/builtins/fs/deliveryIntent.js +182 -0
- package/dist/builtins/fs/deliveryIntent.js.map +1 -0
- package/dist/builtins/fs/deliveryMatch.d.ts +138 -0
- package/dist/builtins/fs/deliveryMatch.js +135 -0
- package/dist/builtins/fs/deliveryMatch.js.map +1 -0
- package/dist/builtins/fs/destination.d.ts +37 -1
- package/dist/builtins/fs/destination.js +80 -0
- package/dist/builtins/fs/destination.js.map +1 -1
- package/dist/builtins/fs/download.d.ts +19 -8
- package/dist/builtins/fs/download.js +142 -72
- package/dist/builtins/fs/download.js.map +1 -1
- package/dist/builtins/fs/du.d.ts +0 -8
- package/dist/builtins/fs/du.js +23 -20
- package/dist/builtins/fs/du.js.map +1 -1
- package/dist/builtins/fs/edit.js +117 -50
- package/dist/builtins/fs/edit.js.map +1 -1
- package/dist/builtins/fs/entries.d.ts +38 -0
- package/dist/builtins/fs/entries.js +48 -1
- package/dist/builtins/fs/entries.js.map +1 -1
- package/dist/builtins/fs/find.d.ts +1 -1
- package/dist/builtins/fs/find.js +462 -271
- package/dist/builtins/fs/find.js.map +1 -1
- package/dist/builtins/fs/ls.d.ts +2 -8
- package/dist/builtins/fs/ls.js +144 -93
- package/dist/builtins/fs/ls.js.map +1 -1
- package/dist/builtins/fs/mkdir.d.ts +2 -7
- package/dist/builtins/fs/mkdir.js +110 -58
- package/dist/builtins/fs/mkdir.js.map +1 -1
- package/dist/builtins/fs/mv.d.ts +7 -10
- package/dist/builtins/fs/mv.js +155 -100
- package/dist/builtins/fs/mv.js.map +1 -1
- package/dist/builtins/fs/pull.js +155 -92
- package/dist/builtins/fs/pull.js.map +1 -1
- package/dist/builtins/fs/pwd.d.ts +0 -7
- package/dist/builtins/fs/pwd.js +0 -12
- package/dist/builtins/fs/pwd.js.map +1 -1
- package/dist/builtins/fs/rm.d.ts +6 -7
- package/dist/builtins/fs/rm.js +364 -174
- package/dist/builtins/fs/rm.js.map +1 -1
- package/dist/builtins/fs/rmdir.d.ts +0 -7
- package/dist/builtins/fs/rmdir.js +40 -21
- package/dist/builtins/fs/rmdir.js.map +1 -1
- package/dist/builtins/fs/touch.d.ts +0 -7
- package/dist/builtins/fs/touch.js +14 -27
- package/dist/builtins/fs/touch.js.map +1 -1
- package/dist/builtins/fs/transferJobs.d.ts +12 -0
- package/dist/builtins/fs/transferJobs.js +19 -0
- package/dist/builtins/fs/transferJobs.js.map +1 -1
- package/dist/builtins/fs/tree.d.ts +0 -8
- package/dist/builtins/fs/tree.js +1 -12
- package/dist/builtins/fs/tree.js.map +1 -1
- package/dist/builtins/fs/upload.d.ts +0 -8
- package/dist/builtins/fs/upload.js +23 -20
- package/dist/builtins/fs/upload.js.map +1 -1
- package/dist/builtins/fs/url.d.ts +14 -2
- package/dist/builtins/fs/url.js +6 -8
- package/dist/builtins/fs/url.js.map +1 -1
- package/dist/builtins/fs/writeReport.d.ts +40 -0
- package/dist/builtins/fs/writeReport.js +71 -0
- package/dist/builtins/fs/writeReport.js.map +1 -0
- package/dist/builtins/fs/xattr.args.d.ts +14 -13
- package/dist/builtins/fs/xattr.args.js +3 -24
- package/dist/builtins/fs/xattr.args.js.map +1 -1
- package/dist/builtins/fs/xattr.d.ts +0 -25
- package/dist/builtins/fs/xattr.js +82 -65
- package/dist/builtins/fs/xattr.js.map +1 -1
- package/dist/builtins/games/bytes.d.ts +0 -55
- package/dist/builtins/games/bytes.js +95 -120
- package/dist/builtins/games/bytes.js.map +1 -1
- package/dist/builtins/games/chimes.d.ts +0 -36
- package/dist/builtins/games/chimes.js +58 -64
- package/dist/builtins/games/chimes.js.map +1 -1
- package/dist/builtins/games/chrislab.d.ts +0 -12
- package/dist/builtins/games/chrislab.js +0 -14
- package/dist/builtins/games/chrislab.js.map +1 -1
- package/dist/builtins/games/cowsay.d.ts +0 -24
- package/dist/builtins/games/cowsay.js +0 -29
- package/dist/builtins/games/cowsay.js.map +1 -1
- package/dist/builtins/games/figlet.d.ts +0 -24
- package/dist/builtins/games/figlet.js +0 -29
- package/dist/builtins/games/figlet.js.map +1 -1
- package/dist/builtins/games/lab.d.ts +0 -36
- package/dist/builtins/games/lab.js +0 -43
- package/dist/builtins/games/lab.js.map +1 -1
- package/dist/builtins/games/lolcat.d.ts +0 -12
- package/dist/builtins/games/lolcat.js +2 -17
- package/dist/builtins/games/lolcat.js.map +1 -1
- package/dist/builtins/games/numbers.d.ts +0 -60
- package/dist/builtins/games/numbers.js +0 -71
- package/dist/builtins/games/numbers.js.map +1 -1
- package/dist/builtins/games/play.d.ts +0 -36
- package/dist/builtins/games/play.js +47 -58
- package/dist/builtins/games/play.js.map +1 -1
- package/dist/builtins/games/qr.d.ts +0 -12
- package/dist/builtins/games/qr.js +189 -68
- package/dist/builtins/games/qr.js.map +1 -1
- package/dist/builtins/games/show.d.ts +0 -73
- package/dist/builtins/games/show.js +0 -85
- package/dist/builtins/games/show.js.map +1 -1
- package/dist/builtins/games/sky.d.ts +0 -36
- package/dist/builtins/games/sky.js +25 -45
- package/dist/builtins/games/sky.js.map +1 -1
- package/dist/builtins/games/text.d.ts +0 -72
- package/dist/builtins/games/text.js +0 -85
- package/dist/builtins/games/text.js.map +1 -1
- package/dist/builtins/games/trek.d.ts +0 -12
- package/dist/builtins/games/trek.js +0 -15
- package/dist/builtins/games/trek.js.map +1 -1
- package/dist/builtins/games/wtf.d.ts +0 -12
- package/dist/builtins/games/wtf.js +0 -15
- package/dist/builtins/games/wtf.js.map +1 -1
- package/dist/builtins/help.d.ts +0 -19
- package/dist/builtins/help.js +56 -39
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/helpSections.js +13 -1
- package/dist/builtins/helpSections.js.map +1 -1
- package/dist/builtins/index.d.ts +1 -1
- package/dist/builtins/index.js +1 -1
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/net/connect.d.ts +1 -8
- package/dist/builtins/net/connect.js +2 -13
- package/dist/builtins/net/connect.js.map +1 -1
- package/dist/builtins/net/cubepath.js +30 -20
- package/dist/builtins/net/cubepath.js.map +1 -1
- package/dist/builtins/net/logout.d.ts +0 -8
- package/dist/builtins/net/logout.js +1 -12
- package/dist/builtins/net/logout.js.map +1 -1
- package/dist/builtins/net/netstat.d.ts +0 -8
- package/dist/builtins/net/netstat.js +1 -12
- package/dist/builtins/net/netstat.js.map +1 -1
- package/dist/builtins/net/pacs.d.ts +3 -17
- package/dist/builtins/net/pacs.js +50 -42
- package/dist/builtins/net/pacs.js.map +1 -1
- package/dist/builtins/net/pacsUtils.d.ts +0 -2
- package/dist/builtins/net/pacsUtils.js +67 -30
- package/dist/builtins/net/pacsUtils.js.map +1 -1
- package/dist/builtins/net/query.anon.d.ts +61 -0
- package/dist/builtins/net/query.anon.js +362 -0
- package/dist/builtins/net/query.anon.js.map +1 -0
- package/dist/builtins/net/query.args.d.ts +2 -1
- package/dist/builtins/net/query.args.js +1 -1
- package/dist/builtins/net/query.args.js.map +1 -1
- package/dist/builtins/net/query.cohort.d.ts +125 -0
- package/dist/builtins/net/query.cohort.js +267 -0
- package/dist/builtins/net/query.cohort.js.map +1 -0
- package/dist/builtins/net/query.csv.d.ts +26 -5
- package/dist/builtins/net/query.csv.js +61 -115
- package/dist/builtins/net/query.csv.js.map +1 -1
- package/dist/builtins/net/query.d.ts +27 -34
- package/dist/builtins/net/query.deliver.d.ts +96 -0
- package/dist/builtins/net/query.deliver.js +188 -0
- package/dist/builtins/net/query.deliver.js.map +1 -0
- package/dist/builtins/net/query.fanout.d.ts +32 -0
- package/dist/builtins/net/query.fanout.js +91 -0
- package/dist/builtins/net/query.fanout.js.map +1 -1
- package/dist/builtins/net/query.held.d.ts +60 -0
- package/dist/builtins/net/query.held.js +125 -0
- package/dist/builtins/net/query.held.js.map +1 -0
- package/dist/builtins/net/query.ignored.d.ts +3 -1
- package/dist/builtins/net/query.ignored.js +9 -3
- package/dist/builtins/net/query.ignored.js.map +1 -1
- package/dist/builtins/net/query.js +360 -634
- package/dist/builtins/net/query.js.map +1 -1
- package/dist/builtins/net/query.model.d.ts +15 -0
- package/dist/builtins/net/query.model.js +109 -46
- package/dist/builtins/net/query.model.js.map +1 -1
- package/dist/builtins/net/query.view.js +29 -8
- package/dist/builtins/net/query.view.js.map +1 -1
- package/dist/builtins/operandRuns.js +4 -3
- package/dist/builtins/operandRuns.js.map +1 -1
- package/dist/builtins/operands.js +97 -39
- package/dist/builtins/operands.js.map +1 -1
- package/dist/builtins/pluginExecute.js +311 -205
- package/dist/builtins/pluginExecute.js.map +1 -1
- package/dist/builtins/proc.d.ts +1 -13
- package/dist/builtins/proc.helpers.d.ts +0 -7
- package/dist/builtins/proc.helpers.js +0 -10
- package/dist/builtins/proc.helpers.js.map +1 -1
- package/dist/builtins/proc.js +159 -116
- package/dist/builtins/proc.js.map +1 -1
- package/dist/builtins/procWatch.d.ts +2 -2
- package/dist/builtins/procWatch.js +54 -13
- package/dist/builtins/procWatch.js.map +1 -1
- package/dist/builtins/res/compute.d.ts +0 -13
- package/dist/builtins/res/compute.js +0 -16
- package/dist/builtins/res/compute.js.map +1 -1
- package/dist/builtins/res/diagram.tree.js +36 -12
- package/dist/builtins/res/diagram.tree.js.map +1 -1
- package/dist/builtins/res/dicom.d.ts +24 -17
- package/dist/builtins/res/dicom.js +78 -79
- package/dist/builtins/res/dicom.js.map +1 -1
- package/dist/builtins/res/expect.d.ts +8 -17
- package/dist/builtins/res/expect.js +173 -101
- package/dist/builtins/res/expect.js.map +1 -1
- package/dist/builtins/res/feed.d.ts +0 -13
- package/dist/builtins/res/feed.diagram.js +89 -57
- package/dist/builtins/res/feed.diagram.js.map +1 -1
- package/dist/builtins/res/feed.js +61 -42
- package/dist/builtins/res/feed.js.map +1 -1
- package/dist/builtins/res/feed.tree.collapse.d.ts +0 -10
- package/dist/builtins/res/feed.tree.collapse.js +12 -5
- package/dist/builtins/res/feed.tree.collapse.js.map +1 -1
- package/dist/builtins/res/files.d.ts +0 -37
- package/dist/builtins/res/files.js +0 -44
- package/dist/builtins/res/files.js.map +1 -1
- package/dist/builtins/res/gather.d.ts +0 -13
- package/dist/builtins/res/gather.facts.js +24 -16
- package/dist/builtins/res/gather.facts.js.map +1 -1
- package/dist/builtins/res/gather.js +47 -36
- package/dist/builtins/res/gather.js.map +1 -1
- package/dist/builtins/res/gather.process.js +49 -15
- package/dist/builtins/res/gather.process.js.map +1 -1
- package/dist/builtins/res/gather.store.d.ts +4 -2
- package/dist/builtins/res/gather.store.js +43 -31
- package/dist/builtins/res/gather.store.js.map +1 -1
- package/dist/builtins/res/group.d.ts +0 -13
- package/dist/builtins/res/group.js +78 -40
- package/dist/builtins/res/group.js.map +1 -1
- package/dist/builtins/res/image.d.ts +0 -13
- package/dist/builtins/res/image.js +0 -15
- package/dist/builtins/res/image.js.map +1 -1
- package/dist/builtins/res/manifestRead.d.ts +65 -0
- package/dist/builtins/res/manifestRead.js +161 -0
- package/dist/builtins/res/manifestRead.js.map +1 -0
- package/dist/builtins/res/pipeline.d.ts +1 -1
- package/dist/builtins/res/pipeline.js +152 -103
- package/dist/builtins/res/pipeline.js.map +1 -1
- package/dist/builtins/res/pipeline.manifest.js +17 -7
- package/dist/builtins/res/pipeline.manifest.js.map +1 -1
- package/dist/builtins/res/play.d.ts +0 -13
- package/dist/builtins/res/play.js +367 -226
- package/dist/builtins/res/play.js.map +1 -1
- package/dist/builtins/res/plugin.d.ts +1 -13
- package/dist/builtins/res/plugin.info.js +36 -14
- package/dist/builtins/res/plugin.info.js.map +1 -1
- package/dist/builtins/res/plugin.js +1 -17
- package/dist/builtins/res/plugin.js.map +1 -1
- package/dist/builtins/res/plugin.sync.d.ts +3 -5
- package/dist/builtins/res/plugin.sync.js +175 -40
- package/dist/builtins/res/plugin.sync.js.map +1 -1
- package/dist/builtins/res/plugininstance.d.ts +0 -13
- package/dist/builtins/res/plugininstance.js +0 -16
- package/dist/builtins/res/plugininstance.js.map +1 -1
- package/dist/builtins/res/pluginmeta.d.ts +0 -13
- package/dist/builtins/res/pluginmeta.js +0 -16
- package/dist/builtins/res/pluginmeta.js.map +1 -1
- package/dist/builtins/res/record.d.ts +0 -13
- package/dist/builtins/res/record.js +2 -18
- package/dist/builtins/res/record.js.map +1 -1
- package/dist/builtins/res/runWait.js +32 -8
- package/dist/builtins/res/runWait.js.map +1 -1
- package/dist/builtins/res/tag.d.ts +0 -13
- package/dist/builtins/res/tag.js +0 -16
- package/dist/builtins/res/tag.js.map +1 -1
- package/dist/builtins/res/thumbnail.js +23 -8
- package/dist/builtins/res/thumbnail.js.map +1 -1
- package/dist/builtins/res/user.d.ts +0 -12
- package/dist/builtins/res/user.js +0 -17
- package/dist/builtins/res/user.js.map +1 -1
- package/dist/builtins/res/workflow.d.ts +0 -13
- package/dist/builtins/res/workflow.js +0 -16
- package/dist/builtins/res/workflow.js.map +1 -1
- package/dist/builtins/runEcho.js +2 -1
- package/dist/builtins/runEcho.js.map +1 -1
- package/dist/builtins/store.d.ts +0 -13
- package/dist/builtins/store.js +32 -32
- package/dist/builtins/store.js.map +1 -1
- package/dist/builtins/sys/apropos.d.ts +2 -27
- package/dist/builtins/sys/apropos.js +2 -32
- package/dist/builtins/sys/apropos.js.map +1 -1
- package/dist/builtins/sys/cal.d.ts +0 -12
- package/dist/builtins/sys/cal.js +0 -15
- package/dist/builtins/sys/cal.js.map +1 -1
- package/dist/builtins/sys/command.js +3 -7
- package/dist/builtins/sys/command.js.map +1 -1
- package/dist/builtins/sys/context.d.ts +0 -8
- package/dist/builtins/sys/context.js +1 -12
- package/dist/builtins/sys/context.js.map +1 -1
- package/dist/builtins/sys/date.d.ts +0 -12
- package/dist/builtins/sys/date.js +0 -15
- package/dist/builtins/sys/date.js.map +1 -1
- package/dist/builtins/sys/echo.d.ts +0 -12
- package/dist/builtins/sys/echo.js +54 -49
- package/dist/builtins/sys/echo.js.map +1 -1
- package/dist/builtins/sys/fortune.d.ts +0 -12
- package/dist/builtins/sys/fortune.js +0 -15
- package/dist/builtins/sys/fortune.js.map +1 -1
- package/dist/builtins/sys/grep.d.ts +14 -18
- package/dist/builtins/sys/grep.js +239 -114
- package/dist/builtins/sys/grep.js.map +1 -1
- package/dist/builtins/sys/hostGrants.d.ts +85 -0
- package/dist/builtins/sys/hostGrants.js +207 -0
- package/dist/builtins/sys/hostGrants.js.map +1 -0
- package/dist/builtins/sys/joblets.d.ts +0 -24
- package/dist/builtins/sys/joblets.js +0 -29
- package/dist/builtins/sys/joblets.js.map +1 -1
- package/dist/builtins/sys/motd.d.ts +0 -12
- package/dist/builtins/sys/motd.js +14 -21
- package/dist/builtins/sys/motd.js.map +1 -1
- package/dist/builtins/sys/notes.js +26 -16
- package/dist/builtins/sys/notes.js.map +1 -1
- package/dist/builtins/sys/physicalmode.d.ts +0 -8
- package/dist/builtins/sys/physicalmode.js +1 -12
- package/dist/builtins/sys/physicalmode.js.map +1 -1
- package/dist/builtins/sys/tasks.d.ts +0 -24
- package/dist/builtins/sys/tasks.js +30 -36
- package/dist/builtins/sys/tasks.js.map +1 -1
- package/dist/builtins/sys/textFilters.d.ts +0 -84
- package/dist/builtins/sys/textFilters.js +33 -110
- package/dist/builtins/sys/textFilters.js.map +1 -1
- package/dist/builtins/sys/timing.d.ts +0 -8
- package/dist/builtins/sys/timing.js +1 -12
- package/dist/builtins/sys/timing.js.map +1 -1
- package/dist/builtins/sys/variables.d.ts +0 -24
- package/dist/builtins/sys/variables.js +0 -29
- package/dist/builtins/sys/variables.js.map +1 -1
- package/dist/builtins/sys/version.d.ts +0 -12
- package/dist/builtins/sys/version.js +0 -15
- package/dist/builtins/sys/version.js.map +1 -1
- package/dist/builtins/sys/weather.js +46 -27
- package/dist/builtins/sys/weather.js.map +1 -1
- package/dist/builtins/sys/whoami.d.ts +0 -22
- package/dist/builtins/sys/whoami.js +16 -43
- package/dist/builtins/sys/whoami.js.map +1 -1
- package/dist/builtins/utils.d.ts +4 -39
- package/dist/builtins/utils.js +24 -55
- package/dist/builtins/utils.js.map +1 -1
- package/dist/chris/backend.js +7 -12
- package/dist/chris/backend.js.map +1 -1
- package/dist/chris/binDeclarations.d.ts +0 -44
- package/dist/chris/binDeclarations.js +111 -29
- package/dist/chris/binDeclarations.js.map +1 -1
- package/dist/chris/binExecutables.js +26 -18
- package/dist/chris/binExecutables.js.map +1 -1
- package/dist/chris/chiliDelegate.d.ts +104 -0
- package/dist/chris/chiliDelegate.js +240 -0
- package/dist/chris/chiliDelegate.js.map +1 -1
- package/dist/chris/commandFallback.d.ts +2 -2
- package/dist/chris/commandFallback.js +107 -50
- package/dist/chris/commandFallback.js.map +1 -1
- package/dist/chris/completion.d.ts +3 -1
- package/dist/chris/completion.js +5 -17
- package/dist/chris/completion.js.map +1 -1
- package/dist/chris/connect.d.ts +37 -0
- package/dist/chris/connect.js +46 -0
- package/dist/chris/connect.js.map +1 -1
- package/dist/chris/files.js +32 -2
- package/dist/chris/files.js.map +1 -1
- package/dist/chris/navigation.js +87 -53
- package/dist/chris/navigation.js.map +1 -1
- package/dist/chris/pacsResources.js +28 -11
- package/dist/chris/pacsResources.js.map +1 -1
- package/dist/chris/promptContext.js +68 -35
- package/dist/chris/promptContext.js.map +1 -1
- package/dist/chris/universeLayout.d.ts +8 -2
- package/dist/chris/universeLayout.js +40 -11
- package/dist/chris/universeLayout.js.map +1 -1
- package/dist/chris/warmup.d.ts +140 -0
- package/dist/chris/warmup.js +622 -0
- package/dist/chris/warmup.js.map +1 -0
- package/dist/core/argumentKinds.js +4 -4
- package/dist/core/argumentKinds.js.map +1 -1
- package/dist/core/assignment.js +8 -6
- package/dist/core/assignment.js.map +1 -1
- package/dist/core/backend.d.ts +44 -8
- package/dist/core/backend.js.map +1 -1
- package/dist/core/commandDeclaration.d.ts +8 -0
- package/dist/core/commandDeclaration.js.map +1 -1
- package/dist/core/commandParse.d.ts +34 -1
- package/dist/core/commandParse.js +156 -28
- package/dist/core/commandParse.js.map +1 -1
- package/dist/core/commandRegistry.d.ts +24 -5
- package/dist/core/commandRegistry.js +28 -5
- package/dist/core/commandRegistry.js.map +1 -1
- package/dist/core/dispatch.d.ts +1 -12
- package/dist/core/dispatch.js +12 -16
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/elevation.js +30 -5
- package/dist/core/elevation.js.map +1 -1
- package/dist/core/engine.d.ts +5 -11
- package/dist/core/engine.js +126 -50
- package/dist/core/engine.js.map +1 -1
- package/dist/core/expansion.d.ts +0 -6
- package/dist/core/expansion.js +0 -8
- package/dist/core/expansion.js.map +1 -1
- package/dist/core/filesystem.js +1 -1
- package/dist/core/filesystem.js.map +1 -1
- package/dist/core/handlerRun.d.ts +13 -0
- package/dist/core/handlerRun.js +21 -0
- package/dist/core/handlerRun.js.map +1 -1
- package/dist/core/holds.js +3 -3
- package/dist/core/holds.js.map +1 -1
- package/dist/core/hostGate.d.ts +62 -0
- package/dist/core/hostGate.js +72 -0
- package/dist/core/hostGate.js.map +1 -0
- package/dist/core/joblets.js +53 -27
- package/dist/core/joblets.js.map +1 -1
- package/dist/core/paths.d.ts +3 -5
- package/dist/core/paths.js +107 -36
- package/dist/core/paths.js.map +1 -1
- package/dist/core/preprocess.d.ts +12 -0
- package/dist/core/preprocess.js +42 -15
- package/dist/core/preprocess.js.map +1 -1
- package/dist/core/question.d.ts +27 -3
- package/dist/core/question.js +14 -6
- package/dist/core/question.js.map +1 -1
- package/dist/core/runner.d.ts +31 -7
- package/dist/core/runner.js +189 -37
- package/dist/core/runner.js.map +1 -1
- package/dist/core/sink.d.ts +7 -19
- package/dist/core/sink.js +56 -28
- package/dist/core/sink.js.map +1 -1
- package/dist/core/surface.js +1 -0
- package/dist/core/surface.js.map +1 -1
- package/dist/core/variables.js +37 -11
- package/dist/core/variables.js.map +1 -1
- package/dist/core/version.d.ts +0 -20
- package/dist/core/version.js +2 -26
- package/dist/core/version.js.map +1 -1
- package/dist/core/warmupFailures.d.ts +3 -6
- package/dist/core/warmupFailures.js.map +1 -1
- package/dist/core.d.ts +2 -0
- package/dist/core.js +2 -0
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/completer/cfsPaths.js +66 -26
- package/dist/lib/completer/cfsPaths.js.map +1 -1
- package/dist/lib/completer/declared.js +81 -20
- package/dist/lib/completer/declared.js.map +1 -1
- package/dist/lib/completer/index.d.ts +3 -0
- package/dist/lib/completer/index.js +44 -7
- package/dist/lib/completer/index.js.map +1 -1
- package/dist/lib/parser.d.ts +0 -16
- package/dist/lib/parser.js +223 -135
- package/dist/lib/parser.js.map +1 -1
- package/dist/lib/vfs/folderListing.d.ts +85 -0
- package/dist/lib/vfs/folderListing.js +86 -0
- package/dist/lib/vfs/folderListing.js.map +1 -0
- package/dist/lib/vfs/vfs.d.ts +37 -9
- package/dist/lib/vfs/vfs.js +195 -110
- package/dist/lib/vfs/vfs.js.map +1 -1
- package/dist/lib/wildcard.d.ts +7 -34
- package/dist/lib/wildcard.js +123 -95
- package/dist/lib/wildcard.js.map +1 -1
- package/dist/notes.json +1 -1
- package/dist/session/answerAdapters.js +249 -131
- package/dist/session/answerAdapters.js.map +1 -1
- package/package.json +12 -10
- package/dist/builtins/wildcard.d.ts +0 -8
- package/dist/builtins/wildcard.js +0 -9
- package/dist/builtins/wildcard.js.map +0 -1
- package/dist/lib/quoting.d.ts +0 -40
- package/dist/lib/quoting.js +0 -70
- package/dist/lib/quoting.js.map +0 -1
- package/dist/lib/semicolonParser.d.ts +0 -41
- package/dist/lib/semicolonParser.js +0 -93
- package/dist/lib/semicolonParser.js.map +0 -1
|
@@ -6,22 +6,34 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Also exports `pacsQuery_createAndWait` for reuse by `builtin_pull`.
|
|
8
8
|
*
|
|
9
|
+
* Key components:
|
|
10
|
+
* - queryCommand, queryLine_run: the verb, and the handler `pacs query` shares.
|
|
11
|
+
* - pacsQuery_createAndWait: one question asked of a PACS, waited on.
|
|
12
|
+
*
|
|
13
|
+
* Typical usage:
|
|
14
|
+
* ```ts
|
|
15
|
+
* await declaredCommand_run(queryCommand, ['PatientID:1234', '--table']);
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Dependencies: query.cohort.ts and query.fanout.ts (the questions),
|
|
19
|
+
* query.model.ts and query.held.ts (the answer), query.anon.ts (`--anon`),
|
|
20
|
+
* query.view.ts, query.csv.ts and query.deliver.ts (how it reads).
|
|
21
|
+
*
|
|
9
22
|
* @module
|
|
10
23
|
*/
|
|
11
|
-
import { PACSQueryDecodedResult
|
|
12
|
-
import { type
|
|
13
|
-
import { pacsQueryModel_build } from './query.model.js';
|
|
24
|
+
import { PACSQueryDecodedResult } from '@fnndsc/cumin';
|
|
25
|
+
import { type CommandEnvelope } from '@fnndsc/menu';
|
|
14
26
|
import { type QueryLine } from './query.args.js';
|
|
27
|
+
import { pacsQueryModel_build } from './query.model.js';
|
|
15
28
|
/**
|
|
16
29
|
* Result of a successful query-create-and-wait operation.
|
|
17
|
-
*
|
|
18
|
-
* @property queryId - ID of the created PACSQuery.
|
|
19
|
-
* @property vfsPath - Full `/net/pacs/queries/<id>_<desc>` path.
|
|
20
|
-
* @property decoded - Decoded query result payload.
|
|
21
30
|
*/
|
|
22
31
|
export interface QueryCreateResult {
|
|
32
|
+
/** ID of the created PACSQuery. */
|
|
23
33
|
queryId: number;
|
|
34
|
+
/** Full `/net/pacs/queries/<id>_<desc>` path. */
|
|
24
35
|
vfsPath: string;
|
|
36
|
+
/** Decoded query result payload. */
|
|
25
37
|
decoded: PACSQueryDecodedResult;
|
|
26
38
|
}
|
|
27
39
|
/**
|
|
@@ -54,24 +66,15 @@ export declare function queryVfsPath_build(queryId: number, queryObj: Record<str
|
|
|
54
66
|
*/
|
|
55
67
|
export declare function pacsQuery_createAndWait(queryExpr: string, title: string, pacsserver: string, onStatus?: (msg: string) => void): Promise<QueryCreateResult | null>;
|
|
56
68
|
export { pacsQueryModel_build };
|
|
57
|
-
|
|
58
|
-
* What to ask CUBE, for an answer's held state.
|
|
59
|
-
*
|
|
60
|
-
* One filter per STUDY, which is the shape that matters: asking per series
|
|
61
|
-
* costs two round trips each and a patient's history runs to hundreds,
|
|
62
|
-
* while studies are counted in tens. A study the answer does not name is
|
|
63
|
-
* left out, and its series are asked about one at a time instead.
|
|
64
|
-
*
|
|
65
|
-
* @param model - The answer.
|
|
66
|
-
* @returns One filter per named study, in the answer's order.
|
|
67
|
-
*/
|
|
68
|
-
export declare function pulledFilters_build(model: PacsQueryModel): SeriesStorageFilter[];
|
|
69
|
+
export { pulledFilters_build } from './query.held.js';
|
|
69
70
|
/**
|
|
70
71
|
* Resolves whatever names a PACS server into its canonical identifier.
|
|
71
72
|
*
|
|
72
73
|
* The context may hold a numeric id, a `--pacsserver` may be either, and
|
|
73
74
|
* CUBE files a query under the identifier. The index is keyed on what CUBE
|
|
74
|
-
* stores, so both the write and the lookup have to speak that.
|
|
75
|
+
* stores, so both the write and the lookup have to speak that. Asked
|
|
76
|
+
* afresh each time, of the server list cumin keeps for the client asking:
|
|
77
|
+
* what a name resolves to is that CUBE's answer to that identity.
|
|
75
78
|
*
|
|
76
79
|
* @param pacsserver - An id or an identifier.
|
|
77
80
|
* @returns The identifier, or the input unchanged when it cannot be resolved.
|
|
@@ -157,7 +160,8 @@ export declare const queryCommand: import("../../core/commandDeclaration.js").Co
|
|
|
157
160
|
};
|
|
158
161
|
readonly anon: {
|
|
159
162
|
readonly long: "anon";
|
|
160
|
-
readonly
|
|
163
|
+
readonly withholds: true;
|
|
164
|
+
readonly summary: "Make the answer screen-safe: stand-ins for patients, descriptions and reasons withheld (help query says what it covers)";
|
|
161
165
|
};
|
|
162
166
|
readonly fresh: {
|
|
163
167
|
readonly long: "fresh";
|
|
@@ -165,21 +169,10 @@ export declare const queryCommand: import("../../core/commandDeclaration.js").Co
|
|
|
165
169
|
};
|
|
166
170
|
};
|
|
167
171
|
}>;
|
|
168
|
-
/**
|
|
169
|
-
* `query` over words already split: the declaration's parse and handler.
|
|
170
|
-
*
|
|
171
|
-
* @param args - The words after `query`.
|
|
172
|
-
* @returns The answer, or the refusal of a bad line.
|
|
173
|
-
*
|
|
174
|
-
* @example
|
|
175
|
-
* ```ts
|
|
176
|
-
* await builtin_query(['PatientID:1234', '--table']);
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
export declare function builtin_query(args: string[]): Promise<CommandEnvelope>;
|
|
180
172
|
/**
|
|
181
173
|
* Creates a PACS query, waits for results, displays findings, and prints the
|
|
182
|
-
* VFS path: the handler of `query` and of `pacs query`.
|
|
174
|
+
* VFS path: the handler of `query` and of `pacs query`. Under --anon the
|
|
175
|
+
* answer is screen-safe, and so is every reason it leaves behind.
|
|
183
176
|
*
|
|
184
177
|
* @param args - The line, parsed.
|
|
185
178
|
* @returns The answer, its model beside it.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Where a PACS answer's table goes: shown, written into ChRIS storage,
|
|
3
|
+
* or asked where.
|
|
4
|
+
*
|
|
5
|
+
* Two flags rather than one with an optional value: `--csv` renders the
|
|
6
|
+
* table on the screen, `--csv-to` writes it into CFS (or, given no path,
|
|
7
|
+
* asks where). The rendering itself is query.csv.ts's; this module owns the
|
|
8
|
+
* delivery, the question, and the envelope that says where the table went.
|
|
9
|
+
*
|
|
10
|
+
* Key components:
|
|
11
|
+
* - csv_deliver: the table shown, written, or asked where.
|
|
12
|
+
* - csvAnswer_envelope: the answer's envelope, saying where the table went.
|
|
13
|
+
*
|
|
14
|
+
* Typical usage:
|
|
15
|
+
* ```ts
|
|
16
|
+
* return csvAnswer_envelope(await csv_deliver(model, '~/audits/ddh.csv'), model);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Dependencies: query.csv.ts (rendering, writing), the session's question
|
|
20
|
+
* (the destination asked), writeReport (what a write left behind).
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
import { type CommandEnvelope, type PacsQueryModel } from '@fnndsc/menu';
|
|
25
|
+
import { type PacsAnswerLevel } from './query.csv.js';
|
|
26
|
+
/**
|
|
27
|
+
* What became of an answer's table: shown or written, or why it was not.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const delivered: CsvDelivery = { ok: true, rendered: '"MRN"\n' };
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export type CsvDelivery = {
|
|
35
|
+
/** The table was shown or written. */
|
|
36
|
+
ok: true;
|
|
37
|
+
/** What to print. */
|
|
38
|
+
rendered: string;
|
|
39
|
+
/** Where it was written, when it was. */
|
|
40
|
+
written?: string;
|
|
41
|
+
} | {
|
|
42
|
+
/** It was not. */
|
|
43
|
+
ok: false;
|
|
44
|
+
/** Why. */
|
|
45
|
+
message: string;
|
|
46
|
+
/** Where the table was sent, when it landed and was not seen to reach the name. */
|
|
47
|
+
unconfirmed?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Renders an answer as CSV, and writes it into ChRIS storage when asked.
|
|
51
|
+
*
|
|
52
|
+
* Two flags rather than one with an optional value: `--csv PatientID:1234`
|
|
53
|
+
* could not tell a destination from a query expression, and guessing wrong
|
|
54
|
+
* writes a file named after a patient.
|
|
55
|
+
*
|
|
56
|
+
* A local terminal needs no destination — `--csv > audit.csv` writes the
|
|
57
|
+
* operator's own disk, because engine and operator share a filesystem. A
|
|
58
|
+
* detached surface does not: the engine runs on the daemon's host, so a
|
|
59
|
+
* redirect lands on somebody else's machine. `--csv-to` puts the table in
|
|
60
|
+
* CFS instead, where a cohort's MRNs and study descriptions stay inside
|
|
61
|
+
* ChRIS rather than on whatever laptop the operator is sitting at.
|
|
62
|
+
*
|
|
63
|
+
* @param model - The answer.
|
|
64
|
+
* @param destination - A CFS path to write to, or null to render only.
|
|
65
|
+
* @param ask - True to ask where the table goes when no destination was named.
|
|
66
|
+
* @param force - True to replace a table already there.
|
|
67
|
+
* @param level - One row per study, or per series.
|
|
68
|
+
* @param table - True to show the rows on screen beside the word that they were written.
|
|
69
|
+
* @param anon - True when the answer is screen-safe: what the write says of
|
|
70
|
+
* itself (a reason, a recovery name) is withheld, and where it went is not.
|
|
71
|
+
* @returns The CSV text and where it went, or a failure already explained.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const delivered: CsvDelivery = await csv_deliver(model, '~/audits/ddh.csv');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function csv_deliver(model: PacsQueryModel, destination: string | null, ask?: boolean, force?: boolean, level?: PacsAnswerLevel, table?: boolean, anon?: boolean): Promise<CsvDelivery>;
|
|
79
|
+
/**
|
|
80
|
+
* The envelope of an answer whose table was delivered, or was not: where the
|
|
81
|
+
* table went is part of the answer, and a surface reads it from the model.
|
|
82
|
+
* The ANSWER stands either way: only the writing of it may not have
|
|
83
|
+
* happened. An abandoned question, or a refused destination, is no reason to
|
|
84
|
+
* throw away a PACS answer the operator waited for: the model crosses either
|
|
85
|
+
* way, and a surface still shows what was found.
|
|
86
|
+
*
|
|
87
|
+
* @param delivered - What became of the table.
|
|
88
|
+
* @param model - The answer.
|
|
89
|
+
* @returns The envelope: ok with the table, or an error carrying the model.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* return csvAnswer_envelope(await csv_deliver(model, null), model);
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function csvAnswer_envelope(delivered: CsvDelivery, model: PacsQueryModel): CommandEnvelope;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Where a PACS answer's table goes: shown, written into ChRIS storage,
|
|
3
|
+
* or asked where.
|
|
4
|
+
*
|
|
5
|
+
* Two flags rather than one with an optional value: `--csv` renders the
|
|
6
|
+
* table on the screen, `--csv-to` writes it into CFS (or, given no path,
|
|
7
|
+
* asks where). The rendering itself is query.csv.ts's; this module owns the
|
|
8
|
+
* delivery, the question, and the envelope that says where the table went.
|
|
9
|
+
*
|
|
10
|
+
* Key components:
|
|
11
|
+
* - csv_deliver: the table shown, written, or asked where.
|
|
12
|
+
* - csvAnswer_envelope: the answer's envelope, saying where the table went.
|
|
13
|
+
*
|
|
14
|
+
* Typical usage:
|
|
15
|
+
* ```ts
|
|
16
|
+
* return csvAnswer_envelope(await csv_deliver(model, '~/audits/ddh.csv'), model);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Dependencies: query.csv.ts (rendering, writing), the session's question
|
|
20
|
+
* (the destination asked), writeReport (what a write left behind).
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
import { PACS_QUERY_MODEL_KIND, envelope_error, envelope_ok } from '@fnndsc/menu';
|
|
25
|
+
import chalk from 'chalk';
|
|
26
|
+
import { csvFile_write, pacsAnswer_renderCsv, pacsAnswer_renderTable } from './query.csv.js';
|
|
27
|
+
import { exitCode_set } from '../../core/handlerRun.js';
|
|
28
|
+
import { writeWarnings_render } from '../fs/writeReport.js';
|
|
29
|
+
/** What the write said of itself, under `--anon`: a recovery name may spell what was asked. */
|
|
30
|
+
const CSV_ANON_WARNED = 'query: the write left a note; it is withheld under --anon';
|
|
31
|
+
/**
|
|
32
|
+
* What the write left behind, said: in its own words, or under `--anon` in
|
|
33
|
+
* fixed ones.
|
|
34
|
+
*
|
|
35
|
+
* @param warnings - What the write said of itself.
|
|
36
|
+
* @param anon - True when the answer is screen-safe.
|
|
37
|
+
* @returns The lines, or nothing.
|
|
38
|
+
*/
|
|
39
|
+
function writeWarnings_say(warnings, anon) {
|
|
40
|
+
if (!anon)
|
|
41
|
+
return writeWarnings_render('query', warnings);
|
|
42
|
+
return warnings.length > 0 ? `${chalk.yellow(CSV_ANON_WARNED)}\n` : '';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Why the table was not written: in the write's own words, or under
|
|
46
|
+
* `--anon` in fixed ones beside the destination it was sent to.
|
|
47
|
+
*
|
|
48
|
+
* @param message - The write's reason.
|
|
49
|
+
* @param target - Where it was sent.
|
|
50
|
+
* @param anon - True when the answer is screen-safe.
|
|
51
|
+
* @returns The sentence.
|
|
52
|
+
*/
|
|
53
|
+
function writeFailure_say(message, target, anon) {
|
|
54
|
+
return anon ? `query: the table was not written to ${target}; the reason is withheld under --anon` : `query: ${message}`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Renders an answer as CSV, and writes it into ChRIS storage when asked.
|
|
58
|
+
*
|
|
59
|
+
* Two flags rather than one with an optional value: `--csv PatientID:1234`
|
|
60
|
+
* could not tell a destination from a query expression, and guessing wrong
|
|
61
|
+
* writes a file named after a patient.
|
|
62
|
+
*
|
|
63
|
+
* A local terminal needs no destination — `--csv > audit.csv` writes the
|
|
64
|
+
* operator's own disk, because engine and operator share a filesystem. A
|
|
65
|
+
* detached surface does not: the engine runs on the daemon's host, so a
|
|
66
|
+
* redirect lands on somebody else's machine. `--csv-to` puts the table in
|
|
67
|
+
* CFS instead, where a cohort's MRNs and study descriptions stay inside
|
|
68
|
+
* ChRIS rather than on whatever laptop the operator is sitting at.
|
|
69
|
+
*
|
|
70
|
+
* @param model - The answer.
|
|
71
|
+
* @param destination - A CFS path to write to, or null to render only.
|
|
72
|
+
* @param ask - True to ask where the table goes when no destination was named.
|
|
73
|
+
* @param force - True to replace a table already there.
|
|
74
|
+
* @param level - One row per study, or per series.
|
|
75
|
+
* @param table - True to show the rows on screen beside the word that they were written.
|
|
76
|
+
* @param anon - True when the answer is screen-safe: what the write says of
|
|
77
|
+
* itself (a reason, a recovery name) is withheld, and where it went is not.
|
|
78
|
+
* @returns The CSV text and where it went, or a failure already explained.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const delivered: CsvDelivery = await csv_deliver(model, '~/audits/ddh.csv');
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export async function csv_deliver(model, destination, ask = false, force = false, level = 'study', table = false, anon = false) {
|
|
86
|
+
const csv = pacsAnswer_renderCsv(model, level);
|
|
87
|
+
let target = destination;
|
|
88
|
+
if (target === null && ask) {
|
|
89
|
+
// Asked only once there is something to write: a question raised before
|
|
90
|
+
// the PACS answered would be a question about a file that may never
|
|
91
|
+
// exist.
|
|
92
|
+
const chosen = await csvDestination_ask();
|
|
93
|
+
if (chosen === '')
|
|
94
|
+
return { ok: false, message: 'query: no destination given; nothing written.' };
|
|
95
|
+
target = chosen;
|
|
96
|
+
}
|
|
97
|
+
if (target === null)
|
|
98
|
+
return { ok: true, rendered: csv };
|
|
99
|
+
const written = await csvFile_write(csv, target, force);
|
|
100
|
+
// What the write left behind (a table kept at a recovery name) is said, done or not.
|
|
101
|
+
const warned = writeWarnings_say(written.warnings, anon);
|
|
102
|
+
if (!written.ok)
|
|
103
|
+
return { ok: false, message: `${writeFailure_say(written.message, target, anon)}\n${warned}`.trimEnd(), ...(written.unconfirmed === true ? { unconfirmed: target } : {}) };
|
|
104
|
+
// A folder that had to be made is said, not discovered later.
|
|
105
|
+
const made = written.created === undefined
|
|
106
|
+
? ''
|
|
107
|
+
: `${chalk.gray(` made ${written.created}`)}\n`;
|
|
108
|
+
// A file that was there and is not any more is said, for the same reason
|
|
109
|
+
// the folder is: an act nobody reported is an act nobody can check.
|
|
110
|
+
const gone = written.replaced === true
|
|
111
|
+
? `${chalk.gray(` replaced the table that was there`)}\n`
|
|
112
|
+
: '';
|
|
113
|
+
// The file went where it was sent; the screen, asked for the table,
|
|
114
|
+
// shows the same rows beside the word that they were written.
|
|
115
|
+
const shown = table ? `\n${pacsAnswer_renderTable(model, level)}` : '';
|
|
116
|
+
return { ok: true, rendered: `${made}${gone}${chalk.green(`✓ wrote ${written.path}`)}\n${warned}${shown}`, written: written.path };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Asks where the table should go.
|
|
120
|
+
*
|
|
121
|
+
* The anchor is the session's own cwd — a fact, not a guess. Inventing a
|
|
122
|
+
* directory here would mean creating one behind the operator's back, which
|
|
123
|
+
* is what the surface used to do.
|
|
124
|
+
*
|
|
125
|
+
* @returns The location given, absolute, or '' when the operator abandoned the ask.
|
|
126
|
+
*/
|
|
127
|
+
async function csvDestination_ask() {
|
|
128
|
+
const { session } = await import('../../session/index.js');
|
|
129
|
+
const { repl_questionPath } = await import('../../core/question.js');
|
|
130
|
+
const stamp = new Date().toISOString().slice(0, 19).replace(/[:T]/g, '-');
|
|
131
|
+
// Where the operator is, unless they are somewhere nothing can be
|
|
132
|
+
// written: a session sitting in `/bin` or `/proc` is browsing a provider,
|
|
133
|
+
// not a place a file lands, and an errand that opens there offers a
|
|
134
|
+
// destination that is refused the moment it is committed.
|
|
135
|
+
const cwd = await session.getCWD();
|
|
136
|
+
const virtual = ['/bin', '/usr', '/etc', '/proc', '/net']
|
|
137
|
+
.some((prefix) => cwd === prefix || cwd.startsWith(`${prefix}/`));
|
|
138
|
+
try {
|
|
139
|
+
const answer = await repl_questionPath('Where should the table go? ', {
|
|
140
|
+
anchor: virtual ? '~' : cwd,
|
|
141
|
+
wantsDirectory: false,
|
|
142
|
+
suggest: `pacs-${stamp}.csv`,
|
|
143
|
+
}, 'EXPORT HERE');
|
|
144
|
+
// Absolute, against the place the question showed: other commands run
|
|
145
|
+
// while it is open, and a `cd` among them must not move the file.
|
|
146
|
+
const given = answer.trim();
|
|
147
|
+
if (given === '')
|
|
148
|
+
return '';
|
|
149
|
+
const { path_resolve } = await import('../utils.js');
|
|
150
|
+
if (given.startsWith('/') || given.startsWith('~'))
|
|
151
|
+
return await path_resolve(given);
|
|
152
|
+
const base = virtual ? '~' : cwd;
|
|
153
|
+
return await path_resolve(`${base === '/' ? '' : base}/${given}`);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// A refused or abandoned ask is not a failure of the query: the answer
|
|
157
|
+
// stands, and only the writing of it does not happen.
|
|
158
|
+
return '';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The envelope of an answer whose table was delivered, or was not: where the
|
|
163
|
+
* table went is part of the answer, and a surface reads it from the model.
|
|
164
|
+
* The ANSWER stands either way: only the writing of it may not have
|
|
165
|
+
* happened. An abandoned question, or a refused destination, is no reason to
|
|
166
|
+
* throw away a PACS answer the operator waited for: the model crosses either
|
|
167
|
+
* way, and a surface still shows what was found.
|
|
168
|
+
*
|
|
169
|
+
* @param delivered - What became of the table.
|
|
170
|
+
* @param model - The answer.
|
|
171
|
+
* @returns The envelope: ok with the table, or an error carrying the model.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* return csvAnswer_envelope(await csv_deliver(model, null), model);
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
export function csvAnswer_envelope(delivered, model) {
|
|
179
|
+
if (!delivered.ok) {
|
|
180
|
+
exitCode_set(1);
|
|
181
|
+
return {
|
|
182
|
+
...envelope_error('', undefined, `${chalk.red(delivered.message)}\n`),
|
|
183
|
+
model: { kind: PACS_QUERY_MODEL_KIND, data: delivered.unconfirmed === undefined ? model : { ...model, writeUnconfirmed: delivered.unconfirmed } },
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return envelope_ok(delivered.rendered, { kind: PACS_QUERY_MODEL_KIND, data: delivered.written === undefined ? model : { ...model, written: delivered.written } });
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=query.deliver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.deliver.js","sourceRoot":"","sources":["../../../src/builtins/net/query.deliver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,WAAW,EAA6C,MAAM,cAAc,CAAC;AAC7H,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,sBAAsB,EAAuC,MAAM,gBAAgB,CAAC;AAClI,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,+FAA+F;AAC/F,MAAM,eAAe,GAAW,2DAA2D,CAAC;AAE5F;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,QAA2B,EAAE,IAAa;IACnE,IAAI,CAAC,IAAI;QAAE,OAAO,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC1D,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CAAC,OAAe,EAAE,MAAc,EAAE,IAAa;IACtE,OAAO,IAAI,CAAC,CAAC,CAAC,uCAAuC,MAAM,uCAAuC,CAAC,CAAC,CAAC,UAAU,OAAO,EAAE,CAAC;AAC3H,CAAC;AA4BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAqB,EACrB,WAA0B,EAC1B,MAAe,KAAK,EACpB,QAAiB,KAAK,EACtB,QAAyB,OAAO,EAChC,QAAiB,KAAK,EACtB,OAA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E,KAAK,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,gBAAgB,EAAE,SAAS,CAAC,WAAW,EAAE,EAAE;SAClJ,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACpK,CAAC"}
|
|
@@ -13,6 +13,18 @@ import { type Result } from '@fnndsc/fond';
|
|
|
13
13
|
* the individual questions they stand for, and refusing by name when the
|
|
14
14
|
* cross-product would launch hundreds.
|
|
15
15
|
*
|
|
16
|
+
* Key components:
|
|
17
|
+
* - queryTerms_parse, jsonTerms_parse: the question as typed, read into terms.
|
|
18
|
+
* - queryTerms_expand: terms into the questions they stand for.
|
|
19
|
+
* - patients_read, fanout_permit: a cohort read, and its size refused by name.
|
|
20
|
+
*
|
|
21
|
+
* Typical usage:
|
|
22
|
+
* ```ts
|
|
23
|
+
* const questions: Array<Record<string, string>> = queryTerms_expand(queryTerms_parse('PatientID:1,2') ?? {});
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Dependencies: fond's error stack; salsa's CFS read, for a cohort file.
|
|
27
|
+
*
|
|
16
28
|
* @module
|
|
17
29
|
*/
|
|
18
30
|
/** The DICOM key a cohort is expressed in. */
|
|
@@ -53,6 +65,26 @@ export declare const QUERY_COHORT_MAX: number;
|
|
|
53
65
|
* malformed.
|
|
54
66
|
*/
|
|
55
67
|
export declare function queryTerms_parse(expr: string): Record<string, string[]> | null;
|
|
68
|
+
/**
|
|
69
|
+
* Reads a JSON question as single-valued terms.
|
|
70
|
+
*
|
|
71
|
+
* The JSON form predates multi-value and stays what it was: one question,
|
|
72
|
+
* spelled as an object. An identifier (a record number, a name, an
|
|
73
|
+
* accession) must be a string: written as a JSON number it has already lost
|
|
74
|
+
* its leading zeros, or its precision, before anything could ask about it.
|
|
75
|
+
*
|
|
76
|
+
* @param expr - The expression, starting with `{`.
|
|
77
|
+
* @returns Terms with one value each; null when the JSON is not an object;
|
|
78
|
+
* 'unquoted' when a value is neither a string nor a number a key may take.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* jsonTerms_parse('{"PatientID": "MRN-TEST-0001"}'); // { PatientID: ['MRN-TEST-0001'] }
|
|
83
|
+
* jsonTerms_parse('{"SeriesNumber": 7}'); // { SeriesNumber: ['7'] }
|
|
84
|
+
* jsonTerms_parse('{"PatientID": 1234}'); // 'unquoted'
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function jsonTerms_parse(expr: string): Record<string, string[]> | 'unquoted' | null;
|
|
56
88
|
/**
|
|
57
89
|
* Expands multi-valued terms into the individual questions they stand for.
|
|
58
90
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Err, Ok, errorStack } from '@fnndsc/fond';
|
|
2
|
+
import { dicomKey_describe } from '@fnndsc/salsa';
|
|
2
3
|
/**
|
|
3
4
|
* @file A PACS question that names several patients is several questions.
|
|
4
5
|
*
|
|
@@ -13,6 +14,18 @@ import { Err, Ok, errorStack } from '@fnndsc/fond';
|
|
|
13
14
|
* the individual questions they stand for, and refusing by name when the
|
|
14
15
|
* cross-product would launch hundreds.
|
|
15
16
|
*
|
|
17
|
+
* Key components:
|
|
18
|
+
* - queryTerms_parse, jsonTerms_parse: the question as typed, read into terms.
|
|
19
|
+
* - queryTerms_expand: terms into the questions they stand for.
|
|
20
|
+
* - patients_read, fanout_permit: a cohort read, and its size refused by name.
|
|
21
|
+
*
|
|
22
|
+
* Typical usage:
|
|
23
|
+
* ```ts
|
|
24
|
+
* const questions: Array<Record<string, string>> = queryTerms_expand(queryTerms_parse('PatientID:1,2') ?? {});
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Dependencies: fond's error stack; salsa's CFS read, for a cohort file.
|
|
28
|
+
*
|
|
16
29
|
* @module
|
|
17
30
|
*/
|
|
18
31
|
/** The DICOM key a cohort is expressed in. */
|
|
@@ -78,6 +91,84 @@ export function queryTerms_parse(expr) {
|
|
|
78
91
|
}
|
|
79
92
|
return Object.keys(terms).length > 0 ? terms : null;
|
|
80
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* The identifiers whose JSON value must be a string, by keyword: a record
|
|
96
|
+
* number, a name, an accession. Written as a JSON number one has lost its
|
|
97
|
+
* leading zeros, or its precision, before anything could ask about it. A
|
|
98
|
+
* tag is read as the keyword the DICOM dictionary names it.
|
|
99
|
+
*/
|
|
100
|
+
const IDENTIFIER_KEYS = new Set([
|
|
101
|
+
'patientid', 'patientname', 'otherpatientids', 'otherpatientnames', 'patientmotherbirthname', 'accessionnumber',
|
|
102
|
+
]);
|
|
103
|
+
/**
|
|
104
|
+
* Whether a key's JSON value must be a string: an identifier, or any key
|
|
105
|
+
* the DICOM dictionary gives the VR `UI` (a UID), by keyword or by tag. A
|
|
106
|
+
* keyword ending in `UID` counts too, in whatever case it is written.
|
|
107
|
+
*
|
|
108
|
+
* @param key - The key, as typed.
|
|
109
|
+
* @returns True when only a string may stand for it.
|
|
110
|
+
*/
|
|
111
|
+
function key_takesString(key) {
|
|
112
|
+
const entry = dicomKey_describe(key);
|
|
113
|
+
if (entry?.vr === 'UI')
|
|
114
|
+
return true;
|
|
115
|
+
const name = (entry?.name ?? key).replace(/_/g, '').toLowerCase();
|
|
116
|
+
return IDENTIFIER_KEYS.has(name) || name.endsWith('uid');
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* One JSON value as a term's value: a string as it is; a finite number,
|
|
120
|
+
* for any key but an identifier or a UID, as its decimal
|
|
121
|
+
* (`{"SeriesNumber": 7}` and `{"StudyDate": 20260101}` ask as before);
|
|
122
|
+
* anything else refused. This is the check on what is asked, and stands
|
|
123
|
+
* apart from what a screen-safe answer shows.
|
|
124
|
+
*
|
|
125
|
+
* @param key - The key.
|
|
126
|
+
* @param value - The value the JSON held.
|
|
127
|
+
* @returns The value as asked, or null to refuse the question.
|
|
128
|
+
*/
|
|
129
|
+
function jsonValue_read(key, value) {
|
|
130
|
+
if (typeof value === 'string')
|
|
131
|
+
return value;
|
|
132
|
+
return typeof value === 'number' && Number.isFinite(value) && !key_takesString(key) ? String(value) : null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Reads a JSON question as single-valued terms.
|
|
136
|
+
*
|
|
137
|
+
* The JSON form predates multi-value and stays what it was: one question,
|
|
138
|
+
* spelled as an object. An identifier (a record number, a name, an
|
|
139
|
+
* accession) must be a string: written as a JSON number it has already lost
|
|
140
|
+
* its leading zeros, or its precision, before anything could ask about it.
|
|
141
|
+
*
|
|
142
|
+
* @param expr - The expression, starting with `{`.
|
|
143
|
+
* @returns Terms with one value each; null when the JSON is not an object;
|
|
144
|
+
* 'unquoted' when a value is neither a string nor a number a key may take.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* jsonTerms_parse('{"PatientID": "MRN-TEST-0001"}'); // { PatientID: ['MRN-TEST-0001'] }
|
|
149
|
+
* jsonTerms_parse('{"SeriesNumber": 7}'); // { SeriesNumber: ['7'] }
|
|
150
|
+
* jsonTerms_parse('{"PatientID": 1234}'); // 'unquoted'
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export function jsonTerms_parse(expr) {
|
|
154
|
+
let parsed;
|
|
155
|
+
try {
|
|
156
|
+
parsed = JSON.parse(expr);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
162
|
+
return null;
|
|
163
|
+
const terms = {};
|
|
164
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
165
|
+
const asked = jsonValue_read(key, value);
|
|
166
|
+
if (asked === null)
|
|
167
|
+
return 'unquoted';
|
|
168
|
+
terms[key] = [asked];
|
|
169
|
+
}
|
|
170
|
+
return terms;
|
|
171
|
+
}
|
|
81
172
|
/**
|
|
82
173
|
* Expands multi-valued terms into the individual questions they stand for.
|
|
83
174
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.fanout.js","sourceRoot":"","sources":["../../../src/builtins/net/query.fanout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;AAChE
|
|
1
|
+
{"version":3,"file":"query.fanout.js","sourceRoot":"","sources":["../../../src/builtins/net/query.fanout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAsB,MAAM,eAAe,CAAC;AACtE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAW,WAAW,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAW,EAAE,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAW,GAAG,CAAC;AAE5C,4EAA4E;AAC5E,MAAM,UAAU,GAAW,GAAG,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAA6B,EAAE,CAAC;IAC3C,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,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AC;IACD,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,KAAa;IACxD,IAAI,KAAK,IAAI,KAAK;QAAE,OAAO,IAAI,CAAC;IAChC,UAAU,CAAC,UAAU,CACnB,OAAO,EACP,oBAAoB,KAAK,4DAA4D,CACtF,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What CUBE already holds of a PACS answer: each series marked pulled,
|
|
3
|
+
* with where it landed, so a surface offers gather instead of pull for a
|
|
4
|
+
* series already home.
|
|
5
|
+
*
|
|
6
|
+
* Kept apart from the query verb: the reconciliation is its own round trips
|
|
7
|
+
* and its own fallback, and reads nothing of how the answer is shown.
|
|
8
|
+
*
|
|
9
|
+
* Key components:
|
|
10
|
+
* - modelPulledState_fill: marks an answer's series with what CUBE holds.
|
|
11
|
+
* - pulledFilters_build: what to ask CUBE, one filter per study.
|
|
12
|
+
*
|
|
13
|
+
* Typical usage:
|
|
14
|
+
* ```ts
|
|
15
|
+
* await modelPulledState_fill(model);
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Dependencies: cumin's series storage lookup; pacsUtils.ts for the per-series fallback.
|
|
19
|
+
*/
|
|
20
|
+
import { type SeriesStorageFilter } from '@fnndsc/cumin';
|
|
21
|
+
import type { PacsQueryModel } from '@fnndsc/menu';
|
|
22
|
+
/**
|
|
23
|
+
* What to ask CUBE, for an answer's held state.
|
|
24
|
+
*
|
|
25
|
+
* One filter per STUDY, which is the shape that matters: asking per series
|
|
26
|
+
* costs two round trips each and a patient's history runs to hundreds,
|
|
27
|
+
* while studies are counted in tens. A study the answer does not name is
|
|
28
|
+
* left out, and its series are asked about one at a time instead.
|
|
29
|
+
*
|
|
30
|
+
* @param model - The answer.
|
|
31
|
+
* @returns One filter per named study, in the answer's order.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const filters: SeriesStorageFilter[] = pulledFilters_build(model); // [{ StudyInstanceUID: '1.2.3' }]
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function pulledFilters_build(model: PacsQueryModel): SeriesStorageFilter[];
|
|
39
|
+
/**
|
|
40
|
+
* Fills each series' `pulled` state by asking CUBE what it already holds.
|
|
41
|
+
*
|
|
42
|
+
* Asked by STUDY, not by series. The obvious shape — ask about each series
|
|
43
|
+
* in turn — costs two round trips per series, and a patient's history runs
|
|
44
|
+
* to hundreds: reconciling one stored answer of 299 series took twenty
|
|
45
|
+
* seconds against a live CUBE, which is why a replayed query felt exactly
|
|
46
|
+
* like a fresh one. CUBE indexes a stored series by its study, so the same
|
|
47
|
+
* reconciliation is one page per study, and a study count is small.
|
|
48
|
+
*
|
|
49
|
+
* A study whose UID the answer does not carry falls back to asking about
|
|
50
|
+
* its series one at a time, since a study that cannot be named in bulk is
|
|
51
|
+
* still owed an answer.
|
|
52
|
+
*
|
|
53
|
+
* @param model - The query model to annotate in place.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* await modelPulledState_fill(model);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function modelPulledState_fill(model: PacsQueryModel): Promise<void>;
|