@robbeverhelst/do 1.271.0 → 1.273.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/do.js +56 -2
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -21707,7 +21707,9 @@ var healthLabPointSchema = object({
|
|
|
21707
21707
|
refLow: number2().nullable(),
|
|
21708
21708
|
refHigh: number2().nullable(),
|
|
21709
21709
|
flag: healthLabFlagSchema.nullable(),
|
|
21710
|
-
fileId: string2().nullable()
|
|
21710
|
+
fileId: string2().nullable(),
|
|
21711
|
+
fileMime: string2().nullable().default(null),
|
|
21712
|
+
source: healthEntrySourceSchema.default("manual")
|
|
21711
21713
|
});
|
|
21712
21714
|
var healthLabAnalyteViewSchema = object({
|
|
21713
21715
|
analyte: string2(),
|
|
@@ -21769,6 +21771,12 @@ var createHealthLabPanelInputSchema = object({
|
|
|
21769
21771
|
subjectNodeId: ulidSchema.nullish()
|
|
21770
21772
|
}).strict();
|
|
21771
21773
|
var updateHealthLabPanelInputSchema = createHealthLabPanelInputSchema.omit({ id: true, subjectNodeId: true }).partial().strict();
|
|
21774
|
+
var healthLabImportFieldsSchema = object({ text: string2().max(200000).optional() }).strict();
|
|
21775
|
+
var healthLabImportResultSchema = object({
|
|
21776
|
+
format: _enum2(["kmehr", "pdf"]),
|
|
21777
|
+
found: number2().int(),
|
|
21778
|
+
panel: healthLabPanelViewSchema
|
|
21779
|
+
});
|
|
21772
21780
|
var setHealthLabAnalyteInputSchema = object({
|
|
21773
21781
|
targetLow: amount.nullish(),
|
|
21774
21782
|
targetHigh: amount.nullish(),
|
|
@@ -24470,6 +24478,7 @@ var moneyBudgetMonthSchema = object({
|
|
|
24470
24478
|
month: moneyMonthSchema,
|
|
24471
24479
|
scope: moneyBudgetScopeSchema,
|
|
24472
24480
|
rows: array(moneyBudgetRowSchema),
|
|
24481
|
+
madeOn: keyDateDaySchema.nullable().default(null),
|
|
24473
24482
|
summary: object({
|
|
24474
24483
|
incomeIn: amount3,
|
|
24475
24484
|
plannedOut: amount3,
|
|
@@ -28163,7 +28172,7 @@ function parseCapture2(input, now) {
|
|
|
28163
28172
|
|
|
28164
28173
|
// src/meta.ts
|
|
28165
28174
|
var CLI_NAME = "do";
|
|
28166
|
-
var VERSION = "1.
|
|
28175
|
+
var VERSION = "1.273.0";
|
|
28167
28176
|
var API_PREFIX = "/api/v1";
|
|
28168
28177
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
28169
28178
|
|
|
@@ -29535,6 +29544,28 @@ var HEALTH_COMMAND_SPECS = [
|
|
|
29535
29544
|
returns: "Deleted"
|
|
29536
29545
|
},
|
|
29537
29546
|
...recordSpecs("labs", "lab", "lab draw", "HealthLabPanelView", "CreateHealthLabPanelInput", "UpdateHealthLabPanelInput"),
|
|
29547
|
+
{
|
|
29548
|
+
path: ["health", "lab", "import"],
|
|
29549
|
+
summary: "Read a lab report (a KMEHR message, or a lab PDF with its text) into a draft draw.",
|
|
29550
|
+
args: [
|
|
29551
|
+
{ name: "path", required: true, description: "The report: a .xml KMEHR message or a .pdf." }
|
|
29552
|
+
],
|
|
29553
|
+
flags: [
|
|
29554
|
+
{
|
|
29555
|
+
name: "text-file",
|
|
29556
|
+
type: "string",
|
|
29557
|
+
description: "For a PDF: a file with its text, one line per printed line."
|
|
29558
|
+
},
|
|
29559
|
+
{
|
|
29560
|
+
name: "type",
|
|
29561
|
+
type: "string",
|
|
29562
|
+
description: "The file's media type, when its name doesn't say."
|
|
29563
|
+
}
|
|
29564
|
+
],
|
|
29565
|
+
scopes: WRITE2,
|
|
29566
|
+
returns: "HealthLabImportResult",
|
|
29567
|
+
notes: "The draw stays a draft (status draft, source import) until the member checks it; the report is kept as its original. A report with no lab value in it is a 422."
|
|
29568
|
+
},
|
|
29538
29569
|
{
|
|
29539
29570
|
path: ["health", "labs", "analytes"],
|
|
29540
29571
|
summary: "The canonical analytes: key, printed name, group, unit, LOINC and aliases.",
|
|
@@ -37548,6 +37579,29 @@ var HANDLERS = {
|
|
|
37548
37579
|
await requireClient().delete(`/health/episodes/${episode}/entries/${entry}`);
|
|
37549
37580
|
return { data: { ok: true, deleted: entry }, render: renderRecord };
|
|
37550
37581
|
},
|
|
37582
|
+
"health lab import": async ({ args, flags, requireClient }) => {
|
|
37583
|
+
const path = requireArg(args, 0, "path");
|
|
37584
|
+
let bytes;
|
|
37585
|
+
try {
|
|
37586
|
+
bytes = readFileSync3(path);
|
|
37587
|
+
} catch (cause) {
|
|
37588
|
+
throw usageError(`can't read ${path}: ${cause instanceof Error ? cause.message : cause}`);
|
|
37589
|
+
}
|
|
37590
|
+
const name = basename(path);
|
|
37591
|
+
const form = new FormData;
|
|
37592
|
+
const textFile = flagString(flags, "text-file");
|
|
37593
|
+
if (textFile)
|
|
37594
|
+
form.append("text", readFileSync3(textFile, "utf8"));
|
|
37595
|
+
const type = flagString(flags, "type") ?? (/\.xml$/i.test(name) ? "application/xml" : Bun.file(name).type);
|
|
37596
|
+
form.append("file", new File([Uint8Array.from(bytes)], name, { type }), name);
|
|
37597
|
+
return {
|
|
37598
|
+
data: await requireClient().upload("/health/labs/import", form),
|
|
37599
|
+
render: (d, m) => {
|
|
37600
|
+
const r = d;
|
|
37601
|
+
return `${String(r.panel?.id)} ${paint(m, "dim", `draft \xB7 ${String(r.found)} values from the ${String(r.format).toUpperCase()}`)}`;
|
|
37602
|
+
}
|
|
37603
|
+
};
|
|
37604
|
+
},
|
|
37551
37605
|
"health labs analytes": async ({ requireClient }) => ({
|
|
37552
37606
|
data: await requireClient().get("/health/labs/analytes"),
|
|
37553
37607
|
render: renderList
|
package/package.json
CHANGED