@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
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A PACS answer made screen-safe: what `query --anon` prints and hands
|
|
3
|
+
* a surface.
|
|
4
|
+
*
|
|
5
|
+
* A demo runs against a live hospital PACS, and everything the query itself
|
|
6
|
+
* says lands on a projector: its rows, its model, its progress line, its
|
|
7
|
+
* reasons. Under `--anon` every one of those says no patient. The answer's
|
|
8
|
+
* model is built from what the PACS really said, so its paths and the
|
|
9
|
+
* held-state reconciliation work on the real answer, and only then is it
|
|
10
|
+
* given its display form. A path a surface acts on stays real: `vfsPath`,
|
|
11
|
+
* the `@STD`/`@SER` handle targets and `folderPath`.
|
|
12
|
+
*
|
|
13
|
+
* What this is not: a mask on the line as typed. The operator's own line,
|
|
14
|
+
* and whatever they carry onward from it, is theirs.
|
|
15
|
+
*
|
|
16
|
+
* Key components:
|
|
17
|
+
* - pacsModel_standIn: the model's display form.
|
|
18
|
+
* - expressionShown_build: the question as shown, from its parsed terms.
|
|
19
|
+
* - anonAnswer_run: runs a query line so no reason it leaves names anyone.
|
|
20
|
+
* - QUERY_ANON_PROGRESS, QUERY_ANON_FAILED, QUERY_ANON_REFUSED: the fixed words.
|
|
21
|
+
*
|
|
22
|
+
* Typical usage:
|
|
23
|
+
* ```ts
|
|
24
|
+
* const shown: PacsQueryModel = pacsModel_standIn(model, expressionShown_build(terms, null));
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Dependencies: salsa's stand-ins.
|
|
28
|
+
*/
|
|
29
|
+
import { errorStack } from '@fnndsc/fond';
|
|
30
|
+
import { modality_isKnown } from '@fnndsc/menu';
|
|
31
|
+
import { date_isReal, field_standIn, token_derive } from '@fnndsc/salsa';
|
|
32
|
+
/** The progress line under `--anon`: it names no question. */
|
|
33
|
+
export const QUERY_ANON_PROGRESS = 'Querying PACS (anonymised)...';
|
|
34
|
+
/** Why a question failed, under `--anon`: a reason from a PACS may name anyone. */
|
|
35
|
+
export const QUERY_ANON_FAILED = 'query: the question could not be answered; the reason is withheld under --anon';
|
|
36
|
+
/** Why a line was refused, under `--anon`: a refusal may quote the line. */
|
|
37
|
+
export const QUERY_ANON_REFUSED = 'query: the line was refused; the reason is withheld under --anon';
|
|
38
|
+
/** What free text (a description) reads as under `--anon`. */
|
|
39
|
+
export const TEXT_WITHHELD = '‹withheld›';
|
|
40
|
+
/** A patient list named by its file, as shown: the file's name may name a patient. */
|
|
41
|
+
const PATIENT_LIST_SHOWN = '@‹patient list›';
|
|
42
|
+
/** A DICOM date, or a range of them, as a query writes one: `D`, `D-D`, `-D`, `D-`. */
|
|
43
|
+
const DATE_RANGE = /^(?:\d{8}|\d{8}-|-\d{8}|\d{8}-\d{8})$/;
|
|
44
|
+
/**
|
|
45
|
+
* A date or a date range, each date coarsened to its month; null for
|
|
46
|
+
* anything else.
|
|
47
|
+
*
|
|
48
|
+
* @param value - The value asked.
|
|
49
|
+
* @returns The range as shown, or null to withhold it.
|
|
50
|
+
*/
|
|
51
|
+
function dateRange_show(value) {
|
|
52
|
+
if (!DATE_RANGE.test(value))
|
|
53
|
+
return null;
|
|
54
|
+
const ends = value.split('-');
|
|
55
|
+
// Every end a real calendar date, or the range says nothing at all.
|
|
56
|
+
if (!ends.every((date) => date === '' || date_isReal(date)))
|
|
57
|
+
return null;
|
|
58
|
+
return ends.map((date) => (date === '' ? '' : field_standIn('StudyDate', date))).join('-');
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A modality list as shown: only when every code in it is a DICOM one.
|
|
62
|
+
*
|
|
63
|
+
* @param value - The value.
|
|
64
|
+
* @returns It, or null to withhold it.
|
|
65
|
+
*/
|
|
66
|
+
function modality_show(value) {
|
|
67
|
+
return modality_isKnown(value) ? value : null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A record number as shown: its stand-in.
|
|
71
|
+
*
|
|
72
|
+
* @param value - The record number.
|
|
73
|
+
* @returns The stand-in.
|
|
74
|
+
*/
|
|
75
|
+
function patientId_show(value) {
|
|
76
|
+
return field_standIn('PatientID', value);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A name as shown: its stand-in.
|
|
80
|
+
*
|
|
81
|
+
* @param value - The name.
|
|
82
|
+
* @returns The stand-in.
|
|
83
|
+
*/
|
|
84
|
+
function patientName_show(value) {
|
|
85
|
+
return field_standIn('PatientName', value);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The keys a question may show under `--anon`, each with how its value is
|
|
89
|
+
* shown: a stand-in, or the value once it is validated (null withholds it).
|
|
90
|
+
* A key not here is withheld whole, whatever it is: an allowlist, because
|
|
91
|
+
* a key nobody thought of is exactly the one that leaks.
|
|
92
|
+
*/
|
|
93
|
+
const TERM_SHOWN = new Map([
|
|
94
|
+
['PatientID', patientId_show],
|
|
95
|
+
['PatientName', patientName_show],
|
|
96
|
+
['AccessionNumber', token_derive],
|
|
97
|
+
['StudyInstanceUID', token_derive],
|
|
98
|
+
['SeriesInstanceUID', token_derive],
|
|
99
|
+
['Modality', modality_show],
|
|
100
|
+
['ModalitiesInStudy', modality_show],
|
|
101
|
+
['StudyDate', dateRange_show],
|
|
102
|
+
['SeriesDate', dateRange_show],
|
|
103
|
+
]);
|
|
104
|
+
/**
|
|
105
|
+
* One term of a question, as shown: its key in DICOM's spelling and each
|
|
106
|
+
* value as that key shows it, or the term withheld whole.
|
|
107
|
+
*
|
|
108
|
+
* @param key - The key, as typed.
|
|
109
|
+
* @param values - Its values.
|
|
110
|
+
* @returns The term as shown.
|
|
111
|
+
*/
|
|
112
|
+
function term_show(key, values) {
|
|
113
|
+
const plain = key.replace(/_/g, '').toLowerCase();
|
|
114
|
+
const field = [...TERM_SHOWN.keys()].find((one) => one.toLowerCase() === plain);
|
|
115
|
+
const value_show = field === undefined ? undefined : TERM_SHOWN.get(field);
|
|
116
|
+
if (field === undefined || value_show === undefined)
|
|
117
|
+
return TEXT_WITHHELD;
|
|
118
|
+
return `${field}:${values.map((value) => value_show(value) ?? TEXT_WITHHELD).join(',')}`;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The `--patients` value, as shown: each listed patient's stand-in, or the
|
|
122
|
+
* placeholder for a file.
|
|
123
|
+
*
|
|
124
|
+
* @param patientsArg - The flag's value.
|
|
125
|
+
* @returns The value as shown.
|
|
126
|
+
*/
|
|
127
|
+
function patientsArg_show(patientsArg) {
|
|
128
|
+
if (patientsArg.startsWith('@'))
|
|
129
|
+
return PATIENT_LIST_SHOWN;
|
|
130
|
+
return patientsArg.split(',')
|
|
131
|
+
.map((entry) => entry.trim())
|
|
132
|
+
.filter((entry) => entry !== '')
|
|
133
|
+
.map((entry) => field_standIn('PatientID', entry))
|
|
134
|
+
.join(',');
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The question as shown under `--anon`, built from its parsed terms and its
|
|
138
|
+
* patient list, never from the typed text: a value spelled with escapes, or
|
|
139
|
+
* a term a `--patients` list replaced, is stood in all the same. Only keys
|
|
140
|
+
* it recognises are shown, each value validated or stood in; any other term
|
|
141
|
+
* is withheld whole. What is asked of the PACS is unchanged.
|
|
142
|
+
*
|
|
143
|
+
* @param terms - The parsed terms, each with its values.
|
|
144
|
+
* @param patientsArg - The `--patients` value, or null.
|
|
145
|
+
* @returns The `Key:Value[,…] [--patients …]` form, every value as shown.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* expressionShown_build({ PatientID: ['MRN-TEST-0001'], Modality: ['MR'] }, null); // 'PatientID:<token>,Modality:MR'
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
export function expressionShown_build(terms, patientsArg) {
|
|
153
|
+
const said = Object.entries(terms)
|
|
154
|
+
.map(([key, values]) => term_show(key, values))
|
|
155
|
+
.join(',');
|
|
156
|
+
const patients = patientsArg === null ? '' : ` --patients ${patientsArg_show(patientsArg)}`;
|
|
157
|
+
return `${said}${patients}`.trim();
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Free text as shown: withheld whole when there is any.
|
|
161
|
+
*
|
|
162
|
+
* @param text - The text.
|
|
163
|
+
* @returns The placeholder, or the empty text.
|
|
164
|
+
*/
|
|
165
|
+
function text_withhold(text) {
|
|
166
|
+
return text === '' ? '' : TEXT_WITHHELD;
|
|
167
|
+
}
|
|
168
|
+
/** How many hex characters a withheld server's stand-in carries: enough to keep two apart. */
|
|
169
|
+
const SERVER_TOKEN_CHARS = 6;
|
|
170
|
+
/** A timestamp as mise writes one: ISO 8601, to the second, with its zone. */
|
|
171
|
+
const TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
172
|
+
/**
|
|
173
|
+
* A UID as a row shows it: always its stand-in, whatever its shape. A UID
|
|
174
|
+
* can be anything a PACS wrote; the real one lives on only inside the paths
|
|
175
|
+
* a surface acts on. Two UIDs are two stand-ins, so rows stay apart.
|
|
176
|
+
*
|
|
177
|
+
* @param uid - The UID the PACS sent.
|
|
178
|
+
* @returns Its stand-in, or nothing for nothing.
|
|
179
|
+
*/
|
|
180
|
+
function uid_show(uid) {
|
|
181
|
+
return uid === '' ? '' : `‹uid ${token_derive(uid)}›`;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A server as an answer shows it: one CUBE lists by its name; any other by
|
|
185
|
+
* a stand-in of its own, so two such servers stay two and a patient's row
|
|
186
|
+
* still joins its own studies.
|
|
187
|
+
*
|
|
188
|
+
* @param server - The server the answer names.
|
|
189
|
+
* @param servers - The servers CUBE lists.
|
|
190
|
+
* @returns It, or its stand-in.
|
|
191
|
+
*/
|
|
192
|
+
function server_show(server, servers) {
|
|
193
|
+
return servers.has(server) ? server : `‹server ${token_derive(server, SERVER_TOKEN_CHARS)}›`;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* A count of files as a row shows it: only a whole, nonnegative number.
|
|
197
|
+
*
|
|
198
|
+
* @param count - The count, when there is one.
|
|
199
|
+
* @returns It, or undefined to withhold it.
|
|
200
|
+
*/
|
|
201
|
+
function count_show(count) {
|
|
202
|
+
return count !== undefined && Number.isInteger(count) && count >= 0 ? count : undefined;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* When an answer was answered, as shown: only a timestamp that reads as one.
|
|
206
|
+
*
|
|
207
|
+
* @param provenance - The provenance, when there is one.
|
|
208
|
+
* @returns It, its time withheld when it is not a timestamp.
|
|
209
|
+
*/
|
|
210
|
+
function provenance_show(provenance) {
|
|
211
|
+
if (provenance === undefined)
|
|
212
|
+
return undefined;
|
|
213
|
+
const at = provenance.answeredAt;
|
|
214
|
+
// A timestamp whose date is not a calendar date (2025-02-30) is no timestamp.
|
|
215
|
+
const readable = TIMESTAMP.test(at) && date_isReal(at.slice(0, 10).replace(/-/g, '')) && !Number.isNaN(Date.parse(at));
|
|
216
|
+
return readable ? provenance : { ...provenance, answeredAt: '' };
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* One series as shown: its UID and counts validated, its description and
|
|
220
|
+
* a modality that is no DICOM code withheld. Its paths stay as they are.
|
|
221
|
+
*
|
|
222
|
+
* @param series - The series, as the PACS answered.
|
|
223
|
+
* @returns The series, saying nothing it does not recognise.
|
|
224
|
+
*/
|
|
225
|
+
function series_standIn(series) {
|
|
226
|
+
const { fileCount, pulledFiles, ...rest } = series;
|
|
227
|
+
const files = count_show(fileCount);
|
|
228
|
+
const held = count_show(pulledFiles);
|
|
229
|
+
return {
|
|
230
|
+
...rest,
|
|
231
|
+
seriesUID: uid_show(series.seriesUID),
|
|
232
|
+
modality: modalityRow_show(series.modality),
|
|
233
|
+
description: text_withhold(series.description),
|
|
234
|
+
...(files === undefined ? {} : { fileCount: files }),
|
|
235
|
+
...(held === undefined ? {} : { pulledFiles: held }),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* A modality as a row shows it: withheld unless every code is a DICOM one.
|
|
240
|
+
*
|
|
241
|
+
* @param value - The value the PACS sent.
|
|
242
|
+
* @returns It, nothing for nothing, or the placeholder.
|
|
243
|
+
*/
|
|
244
|
+
function modalityRow_show(value) {
|
|
245
|
+
return value === '' ? '' : (modality_show(value) ?? TEXT_WITHHELD);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* One study as shown. Its paths and held state stay as they are; a date
|
|
249
|
+
* that is not a real date, a UID that is not one, and a server CUBE does
|
|
250
|
+
* not list are withheld.
|
|
251
|
+
*
|
|
252
|
+
* @param study - The study, as the PACS answered.
|
|
253
|
+
* @param servers - The servers CUBE lists.
|
|
254
|
+
* @returns The study, saying no patient.
|
|
255
|
+
*/
|
|
256
|
+
function study_standIn(study, servers) {
|
|
257
|
+
return {
|
|
258
|
+
...study,
|
|
259
|
+
...(study.server === undefined ? {} : { server: server_show(study.server, servers) }),
|
|
260
|
+
...(study.studyUID === undefined ? {} : { studyUID: uid_show(study.studyUID) }),
|
|
261
|
+
patientId: field_standIn('PatientID', study.patientId),
|
|
262
|
+
patientName: field_standIn('PatientName', study.patientName),
|
|
263
|
+
accession: field_standIn('AccessionNumber', study.accession),
|
|
264
|
+
date: field_standIn('StudyDate', study.date),
|
|
265
|
+
modalities: modalityRow_show(study.modalities),
|
|
266
|
+
description: text_withhold(study.description),
|
|
267
|
+
series: study.series.map(series_standIn),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* One patient asked, as shown: the stand-ins its studies carry, and a fixed
|
|
272
|
+
* reason for a question that could not be asked.
|
|
273
|
+
*
|
|
274
|
+
* @param patient - The patient row.
|
|
275
|
+
* @param servers - The servers CUBE lists.
|
|
276
|
+
* @returns The row, saying no patient.
|
|
277
|
+
*/
|
|
278
|
+
function patient_standIn(patient, servers) {
|
|
279
|
+
return {
|
|
280
|
+
...patient,
|
|
281
|
+
...(patient.server === undefined ? {} : { server: server_show(patient.server, servers) }),
|
|
282
|
+
patientId: field_standIn('PatientID', patient.patientId),
|
|
283
|
+
...(patient.patientName === undefined ? {} : { patientName: field_standIn('PatientName', patient.patientName) }),
|
|
284
|
+
...(patient.error === undefined ? {} : { error: QUERY_ANON_FAILED }),
|
|
285
|
+
...(patient.provenance === undefined ? {} : { provenance: provenance_show(patient.provenance) }),
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* An answer's display form: what the table, the CSV, the terminal view and
|
|
290
|
+
* a surface's pane all read under `--anon`.
|
|
291
|
+
*
|
|
292
|
+
* Made on the typed model, after it is built and reconciled, so the value
|
|
293
|
+
* a PACS sent in whatever shape (a number, a list, a wrapped value, a key
|
|
294
|
+
* spelled `patient_id`) is already a string here, and the paths the model
|
|
295
|
+
* carries were built from the real answer.
|
|
296
|
+
*
|
|
297
|
+
* @param model - The answer, as the PACS gave it.
|
|
298
|
+
* @param expression - The question, as shown.
|
|
299
|
+
* @param servers - The servers CUBE lists: a server the answer names that is
|
|
300
|
+
* not one of them is whatever the operator typed, and is not shown.
|
|
301
|
+
* @returns A copy saying no patient.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* const shown: PacsQueryModel = pacsModel_standIn(model, 'PatientID:<token>', new Set(['PACSDCM']));
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
export function pacsModel_standIn(model, expression, servers) {
|
|
309
|
+
return {
|
|
310
|
+
...model,
|
|
311
|
+
expression,
|
|
312
|
+
pacsName: server_show(model.pacsName, servers),
|
|
313
|
+
...(model.provenance === undefined ? {} : { provenance: provenance_show(model.provenance) }),
|
|
314
|
+
studies: model.studies.map((study) => study_standIn(study, servers)),
|
|
315
|
+
...(model.patients === undefined ? {} : { patients: model.patients.map((patient) => patient_standIn(patient, servers)) }),
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Replaces what a line left on the error stack with one fixed reason of
|
|
320
|
+
* each kind, so the structured errors a surface reads say no patient.
|
|
321
|
+
*
|
|
322
|
+
* @param checkpoint - Where the line's own messages begin.
|
|
323
|
+
*/
|
|
324
|
+
function stack_withhold(checkpoint) {
|
|
325
|
+
const left = errorStack.checkpoint_drain(checkpoint);
|
|
326
|
+
const withheld = [];
|
|
327
|
+
if (left.some((message) => message.type === 'error'))
|
|
328
|
+
withheld.push({ type: 'error', message: QUERY_ANON_FAILED });
|
|
329
|
+
if (left.some((message) => message.type === 'warning'))
|
|
330
|
+
withheld.push({ type: 'warning', message: QUERY_ANON_FAILED });
|
|
331
|
+
if (withheld.length > 0)
|
|
332
|
+
errorStack.stack_restore(withheld);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Runs a query line under `--anon`: whatever it leaves on the error stack,
|
|
336
|
+
* or throws, reaches nobody in its own words.
|
|
337
|
+
*
|
|
338
|
+
* @param run - The line's work.
|
|
339
|
+
* @returns What the work answered.
|
|
340
|
+
* @throws {Error} The work's failure, in fixed words.
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```ts
|
|
344
|
+
* return anonAnswer_run((): Promise<CommandEnvelope> => queryLine_answer(args));
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
export async function anonAnswer_run(run) {
|
|
348
|
+
const checkpoint = errorStack.checkpoint_mark();
|
|
349
|
+
try {
|
|
350
|
+
return await run();
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
const withheld = new Error(QUERY_ANON_FAILED);
|
|
354
|
+
if (error instanceof Error)
|
|
355
|
+
withheld.name = error.name;
|
|
356
|
+
throw withheld;
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
stack_withhold(checkpoint);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=query.anon.js.map
|
|
@@ -0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Q,GAAmB,EAAE,CAAC;IACpC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAqB,EAAW,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC1I,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAqB,EAAW,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC9I,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAmC;IACtE,MAAM,UAAU,GAAW,UAAU,CAAC,eAAe,EAAE,CAAC;IACxD,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAU,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrD,IAAI,KAAK,YAAY,KAAK;YAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvD,MAAM,QAAQ,CAAC;IACjB,CAAC;YAAS,CAAC;QACT,cAAc,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -83,7 +83,8 @@ export declare const QUERY_GRAMMAR: {
|
|
|
83
83
|
};
|
|
84
84
|
readonly anon: {
|
|
85
85
|
readonly long: "anon";
|
|
86
|
-
readonly
|
|
86
|
+
readonly withholds: true;
|
|
87
|
+
readonly summary: "Make the answer screen-safe: stand-ins for patients, descriptions and reasons withheld (help query says what it covers)";
|
|
87
88
|
};
|
|
88
89
|
readonly fresh: {
|
|
89
90
|
readonly long: "fresh";
|
|
@@ -19,7 +19,7 @@ export const QUERY_GRAMMAR = {
|
|
|
19
19
|
force: { long: 'force', summary: 'Overwrite the table at that path; without it, an existing file is kept' },
|
|
20
20
|
table: { long: 'table', summary: 'Show the answer\'s rows as an aligned table: the CSV\'s columns, for a screen' },
|
|
21
21
|
series: { long: 'series', summary: 'One row per series instead of per study; alone, it shows the series table' },
|
|
22
|
-
anon: { long: 'anon', summary: '
|
|
22
|
+
anon: { long: 'anon', withholds: true, summary: 'Make the answer screen-safe: stand-ins for patients, descriptions and reasons withheld (help query says what it covers)' },
|
|
23
23
|
fresh: { long: 'fresh', summary: 'Ask the PACS even if this question was answered before' },
|
|
24
24
|
},
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.args.js","sourceRoot":"","sources":["../../../src/builtins/net/query.args.ts"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE;QACR,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,kFAAkF,EAAE;KAChK;IACD,OAAO,EAAE;QACP,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,yDAAyD,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACpI,UAAU,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,sFAAsF,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACxK,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iFAAiF,EAAE,KAAK,EAAE,EAAE,I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AE,UAAU,EAAE,OAAO,EAAE,iFAAiF,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACjK,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,2EAA2E,EAAE;QAC1G,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gFAAgF,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC9K,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,wEAAwE,EAAE;QAC3G,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,+EAA+E,EAAE;QAClH,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,2EAA2E,EAAE;QAChH,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,yHAAyH,EAAE;QAC3K,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,wDAAwD,EAAE;KAC5F;CACgC,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type CommandEnvelope, type PacsPatient, type PacsQueryModel } from '@fnndsc/menu';
|
|
2
|
+
import type { QueryCreateResult } from './query.js';
|
|
3
|
+
/**
|
|
4
|
+
* One question in a fan-out: the criteria to ask, and the patient it is
|
|
5
|
+
* about when it is about one.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const ask: QueryAsk = { criteria: { PatientID: '1234' }, patientId: '1234', server: '1', identifier: 'PACSDCM' };
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export interface QueryAsk {
|
|
13
|
+
/** The criteria for this single C-FIND. */
|
|
14
|
+
criteria: Record<string, string>;
|
|
15
|
+
/** The MRN this question asks after, when it names one. */
|
|
16
|
+
patientId?: string;
|
|
17
|
+
/** The server to ask, as CUBE names it in a create. */
|
|
18
|
+
server: string;
|
|
19
|
+
/**
|
|
20
|
+
* That server's canonical identifier — what CUBE files the query under,
|
|
21
|
+
* and therefore what the replay index is keyed by and what a row says it
|
|
22
|
+
* came from.
|
|
23
|
+
*/
|
|
24
|
+
identifier: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* What one question came back with.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const answer: QueryAnswer = { ask, result: null, answeredAt: null, error: 'unreachable' };
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export interface QueryAnswer {
|
|
35
|
+
/** The question. */
|
|
36
|
+
ask: QueryAsk;
|
|
37
|
+
/** What the PACS answered, or null when it could not be asked. */
|
|
38
|
+
result: QueryCreateResult | null;
|
|
39
|
+
/** When the PACS answered, for a replayed row. */
|
|
40
|
+
answeredAt: string | null;
|
|
41
|
+
/** Why the question could not be asked, when it could not. */
|
|
42
|
+
error?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renders criteria back into the expression syntax they were parsed from,
|
|
46
|
+
* so a single question inside a fan-out is asked exactly as one typed by
|
|
47
|
+
* hand — the create path takes an expression, not a record.
|
|
48
|
+
*
|
|
49
|
+
* @param criteria - One question's criteria.
|
|
50
|
+
* @returns The `Key:Value,Key:Value` form.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* criteria_format({ PatientID: '1234', Modality: 'MR' }); // 'PatientID:1234,Modality:MR'
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function criteria_format(criteria: Record<string, string>): string;
|
|
58
|
+
/**
|
|
59
|
+
* Unions a fan-out's answers into one model.
|
|
60
|
+
*
|
|
61
|
+
* The studies keep their own identities and paths, each already built
|
|
62
|
+
* against the query that found it. The patient level records what was
|
|
63
|
+
* ASKED — including the questions that found nothing and the ones that
|
|
64
|
+
* could not be asked at all, which is the half of a cohort answer that
|
|
65
|
+
* cannot be derived from studies nobody has.
|
|
66
|
+
*
|
|
67
|
+
* @param answers - What every question came back with.
|
|
68
|
+
* @param facts - The command's identity facts.
|
|
69
|
+
* @param facts.pacsName - The server the model names.
|
|
70
|
+
* @param facts.expression - The question as shown.
|
|
71
|
+
* @returns The union model.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const model: PacsQueryModel = fanoutModel_build(answers, { pacsName: 'PACSDCM', expression: 'PatientID:1,2' });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function fanoutModel_build(answers: QueryAnswer[], facts: {
|
|
79
|
+
pacsName: string;
|
|
80
|
+
expression: string;
|
|
81
|
+
}): PacsQueryModel;
|
|
82
|
+
/**
|
|
83
|
+
* The cohort's closing tally: found, none, unasked.
|
|
84
|
+
*
|
|
85
|
+
* @param patients - Every patient asked.
|
|
86
|
+
* @returns The tally line with a blank line either side, or '' when no patient was asked.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const tally: string = cohortTally_render(model.patients ?? []);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function cohortTally_render(patients: ReadonlyArray<PacsPatient>): string;
|
|
94
|
+
/**
|
|
95
|
+
* The questions a cohort (`--patients`) stands for: one per MRN per server,
|
|
96
|
+
* each narrowed by the terms given alongside it. A PACS will not match a
|
|
97
|
+
* list, so several patients is several C-FINDs.
|
|
98
|
+
*
|
|
99
|
+
* @param patientsArg - The cohort as given: a list, or `@file`.
|
|
100
|
+
* @param terms - The terms narrowing every question.
|
|
101
|
+
* @param servers - The servers asked, as named.
|
|
102
|
+
* @param identifiers - Each server's identifier, in the same order.
|
|
103
|
+
* @returns The questions, or the refusal of a cohort that cannot be read or is too large.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const asks: QueryAsk[] | CommandEnvelope = await cohortAsks_build('1234,4532', {}, ['1'], ['PACSDCM']);
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare function cohortAsks_build(patientsArg: string, terms: Record<string, string[]>, servers: readonly string[], identifiers: readonly string[]): Promise<QueryAsk[] | CommandEnvelope>;
|
|
111
|
+
/**
|
|
112
|
+
* The questions an inline expression stands for: every combination of its
|
|
113
|
+
* multi-valued terms, put to every server named.
|
|
114
|
+
*
|
|
115
|
+
* @param terms - The terms, each with its values.
|
|
116
|
+
* @param servers - The servers asked, as named.
|
|
117
|
+
* @param identifiers - Each server's identifier, in the same order.
|
|
118
|
+
* @returns The questions, or the refusal of a cross-product too large.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* const asks: QueryAsk[] | CommandEnvelope = inlineAsks_build({ PatientID: ['1', '2'] }, ['1'], ['PACSDCM']);
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare function inlineAsks_build(terms: Record<string, string[]>, servers: readonly string[], identifiers: readonly string[]): QueryAsk[] | CommandEnvelope;
|