@robbeverhelst/do 1.272.0 → 1.274.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 +93 -8
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -5698,6 +5698,7 @@ var healthProfiles = pgTable("health_profiles", {
|
|
|
5698
5698
|
bloodGroup: text("blood_group"),
|
|
5699
5699
|
allergies: text("allergies").array().notNull().default(sql`'{}'::text[]`),
|
|
5700
5700
|
heightCm: numeric("height_cm", { mode: "number" }),
|
|
5701
|
+
sex: text("sex"),
|
|
5701
5702
|
alcohol: text("alcohol"),
|
|
5702
5703
|
smoking: text("smoking"),
|
|
5703
5704
|
exercise: text("exercise"),
|
|
@@ -21440,7 +21441,8 @@ var healthProfileSchema = createSelectSchema(healthProfiles, {
|
|
|
21440
21441
|
allergies: array(string2()),
|
|
21441
21442
|
updatedAt: exports_coerce.date()
|
|
21442
21443
|
}).extend({
|
|
21443
|
-
notes: string2().nullable().default(null)
|
|
21444
|
+
notes: string2().nullable().default(null),
|
|
21445
|
+
sex: string2().nullable().default(null)
|
|
21444
21446
|
});
|
|
21445
21447
|
var healthConsentStateSchema = object({
|
|
21446
21448
|
granted: boolean3(),
|
|
@@ -21554,6 +21556,7 @@ var updateHealthProfileInputSchema = object({
|
|
|
21554
21556
|
bloodGroup: string2().regex(/^(A|B|AB|O)[+-]$/, "must be like A+ or O-").nullish(),
|
|
21555
21557
|
allergies: array(text2(100)).max(30).optional(),
|
|
21556
21558
|
heightCm: number2().min(30).max(260).nullish(),
|
|
21559
|
+
sex: text2(40).nullish(),
|
|
21557
21560
|
alcohol: text2(200).nullish(),
|
|
21558
21561
|
smoking: text2(200).nullish(),
|
|
21559
21562
|
exercise: text2(200).nullish(),
|
|
@@ -21618,7 +21621,8 @@ var healthTriedSchema = object({
|
|
|
21618
21621
|
title: string2(),
|
|
21619
21622
|
doses: number2().int(),
|
|
21620
21623
|
effects: array(healthDoseEffectSchema),
|
|
21621
|
-
lastTakenAt: exports_coerce.date()
|
|
21624
|
+
lastTakenAt: exports_coerce.date(),
|
|
21625
|
+
amount: string2().nullable().default(null)
|
|
21622
21626
|
});
|
|
21623
21627
|
var healthSummaryLabSchema = object({
|
|
21624
21628
|
id: string2(),
|
|
@@ -21643,6 +21647,7 @@ var healthTrendSchema = object({
|
|
|
21643
21647
|
});
|
|
21644
21648
|
var healthSummarySchema = object({
|
|
21645
21649
|
generatedAt: exports_coerce.date(),
|
|
21650
|
+
patient: object({ name: string2().nullable() }).default({ name: null }),
|
|
21646
21651
|
episode: healthEpisodeViewSchema.nullable(),
|
|
21647
21652
|
course: array(healthCourseDaySchema),
|
|
21648
21653
|
entries: array(healthSymptomEntrySchema),
|
|
@@ -21707,7 +21712,9 @@ var healthLabPointSchema = object({
|
|
|
21707
21712
|
refLow: number2().nullable(),
|
|
21708
21713
|
refHigh: number2().nullable(),
|
|
21709
21714
|
flag: healthLabFlagSchema.nullable(),
|
|
21710
|
-
fileId: string2().nullable()
|
|
21715
|
+
fileId: string2().nullable(),
|
|
21716
|
+
fileMime: string2().nullable().default(null),
|
|
21717
|
+
source: healthEntrySourceSchema.default("manual")
|
|
21711
21718
|
});
|
|
21712
21719
|
var healthLabAnalyteViewSchema = object({
|
|
21713
21720
|
analyte: string2(),
|
|
@@ -21769,6 +21776,12 @@ var createHealthLabPanelInputSchema = object({
|
|
|
21769
21776
|
subjectNodeId: ulidSchema.nullish()
|
|
21770
21777
|
}).strict();
|
|
21771
21778
|
var updateHealthLabPanelInputSchema = createHealthLabPanelInputSchema.omit({ id: true, subjectNodeId: true }).partial().strict();
|
|
21779
|
+
var healthLabImportFieldsSchema = object({ text: string2().max(200000).optional() }).strict();
|
|
21780
|
+
var healthLabImportResultSchema = object({
|
|
21781
|
+
format: _enum2(["kmehr", "pdf"]),
|
|
21782
|
+
found: number2().int(),
|
|
21783
|
+
panel: healthLabPanelViewSchema
|
|
21784
|
+
});
|
|
21772
21785
|
var setHealthLabAnalyteInputSchema = object({
|
|
21773
21786
|
targetLow: amount.nullish(),
|
|
21774
21787
|
targetHigh: amount.nullish(),
|
|
@@ -24470,6 +24483,7 @@ var moneyBudgetMonthSchema = object({
|
|
|
24470
24483
|
month: moneyMonthSchema,
|
|
24471
24484
|
scope: moneyBudgetScopeSchema,
|
|
24472
24485
|
rows: array(moneyBudgetRowSchema),
|
|
24486
|
+
madeOn: keyDateDaySchema.nullable().default(null),
|
|
24473
24487
|
summary: object({
|
|
24474
24488
|
incomeIn: amount3,
|
|
24475
24489
|
plannedOut: amount3,
|
|
@@ -25246,7 +25260,9 @@ var runChecklistSchema = object({
|
|
|
25246
25260
|
total: number2().int().min(0).max(5000).nullish(),
|
|
25247
25261
|
items: array(object({ id: ref, label: shortText.nullish() }).strict()).max(5000).optional(),
|
|
25248
25262
|
done: array(ref).max(5000),
|
|
25249
|
-
notes: record(ref, shortText).optional()
|
|
25263
|
+
notes: record(ref, shortText).optional(),
|
|
25264
|
+
carrying: array(ref).max(5000).optional(),
|
|
25265
|
+
legend: shortText.nullish()
|
|
25250
25266
|
}).strict();
|
|
25251
25267
|
var runTeamMemberSchema = object({
|
|
25252
25268
|
species: name,
|
|
@@ -25262,7 +25278,13 @@ var runAchievementsSchema = object({
|
|
|
25262
25278
|
source: _enum2(["steam", "xbox", "psn", "manual"]).default("manual"),
|
|
25263
25279
|
total: number2().int().min(0).max(5000).nullish(),
|
|
25264
25280
|
enabled: boolean3().default(true),
|
|
25265
|
-
unlocked: array(object({ name, on: isoDate.nullish(), hint: shortText.nullish() }).strict()).max(5000)
|
|
25281
|
+
unlocked: array(object({ name, on: isoDate.nullish(), hint: shortText.nullish() }).strict()).max(5000),
|
|
25282
|
+
locked: array(object({ name, hint: shortText.nullish() }).strict()).max(5000).optional()
|
|
25283
|
+
}).strict();
|
|
25284
|
+
var runRareFindsSchema = object({
|
|
25285
|
+
place: shortText.nullish(),
|
|
25286
|
+
items: array(shortText).max(200),
|
|
25287
|
+
note: text5.nullish()
|
|
25266
25288
|
}).strict();
|
|
25267
25289
|
var runInstallSchema = object({
|
|
25268
25290
|
edition: shortText.nullish(),
|
|
@@ -25289,6 +25311,7 @@ var runFacetSchema = object({
|
|
|
25289
25311
|
checklists: array(runChecklistSchema).max(30).optional(),
|
|
25290
25312
|
uniques: array(runUniqueSchema).max(1000).optional(),
|
|
25291
25313
|
achievements: runAchievementsSchema.nullish(),
|
|
25314
|
+
rareFinds: runRareFindsSchema.nullish(),
|
|
25292
25315
|
install: runInstallSchema.nullish(),
|
|
25293
25316
|
money: object({ goal: shortText.nullish(), purpose: shortText.nullish() }).strict().nullish(),
|
|
25294
25317
|
links: array(object({ label: name, url: string2().url().max(2000) }).strict()).max(50).optional()
|
|
@@ -25315,6 +25338,7 @@ var runValueSectionValues = [
|
|
|
25315
25338
|
"arc",
|
|
25316
25339
|
"nextSteps",
|
|
25317
25340
|
"achievements",
|
|
25341
|
+
"rareFinds",
|
|
25318
25342
|
"install",
|
|
25319
25343
|
"money"
|
|
25320
25344
|
];
|
|
@@ -25329,7 +25353,15 @@ var runChangeSchema = discriminatedUnion("op", [
|
|
|
25329
25353
|
}).strict(),
|
|
25330
25354
|
object({
|
|
25331
25355
|
op: literal("merge"),
|
|
25332
|
-
section: _enum2([
|
|
25356
|
+
section: _enum2([
|
|
25357
|
+
"character",
|
|
25358
|
+
"arc",
|
|
25359
|
+
"nextSteps",
|
|
25360
|
+
"achievements",
|
|
25361
|
+
"rareFinds",
|
|
25362
|
+
"install",
|
|
25363
|
+
"money"
|
|
25364
|
+
]),
|
|
25333
25365
|
value: record(string2(), unknown()),
|
|
25334
25366
|
label: label.optional()
|
|
25335
25367
|
}).strict(),
|
|
@@ -28163,7 +28195,7 @@ function parseCapture2(input, now) {
|
|
|
28163
28195
|
|
|
28164
28196
|
// src/meta.ts
|
|
28165
28197
|
var CLI_NAME = "do";
|
|
28166
|
-
var VERSION = "1.
|
|
28198
|
+
var VERSION = "1.274.0";
|
|
28167
28199
|
var API_PREFIX = "/api/v1";
|
|
28168
28200
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
28169
28201
|
|
|
@@ -29310,11 +29342,16 @@ var HEALTH_COMMAND_SPECS = [
|
|
|
29310
29342
|
name: "notes",
|
|
29311
29343
|
type: "string",
|
|
29312
29344
|
description: 'Anything else a doctor should know, in your words ("Kell negative"); "" clears it.'
|
|
29345
|
+
},
|
|
29346
|
+
{
|
|
29347
|
+
name: "sex",
|
|
29348
|
+
type: "string",
|
|
29349
|
+
description: `Sex, in your words, for the doctor's page ("female"); "" clears it.`
|
|
29313
29350
|
}
|
|
29314
29351
|
],
|
|
29315
29352
|
scopes: WRITE2,
|
|
29316
29353
|
returns: "HealthProfile",
|
|
29317
|
-
notes: "Body: UpdateHealthProfileInput. An absent key keeps a field; null clears it. Lifestyle is `alcohol`, `smoking`, `exercise`, and `notes` anything else: the member's own words. Notes go on For the doctor's background."
|
|
29354
|
+
notes: "Body: UpdateHealthProfileInput. An absent key keeps a field; null clears it. Lifestyle is `alcohol`, `smoking`, `exercise`, and `notes` anything else: the member's own words. Notes go on For the doctor's background; `sex` on its patient line."
|
|
29318
29355
|
},
|
|
29319
29356
|
{
|
|
29320
29357
|
path: ["health", "record"],
|
|
@@ -29535,6 +29572,28 @@ var HEALTH_COMMAND_SPECS = [
|
|
|
29535
29572
|
returns: "Deleted"
|
|
29536
29573
|
},
|
|
29537
29574
|
...recordSpecs("labs", "lab", "lab draw", "HealthLabPanelView", "CreateHealthLabPanelInput", "UpdateHealthLabPanelInput"),
|
|
29575
|
+
{
|
|
29576
|
+
path: ["health", "lab", "import"],
|
|
29577
|
+
summary: "Read a lab report (a KMEHR message, or a lab PDF with its text) into a draft draw.",
|
|
29578
|
+
args: [
|
|
29579
|
+
{ name: "path", required: true, description: "The report: a .xml KMEHR message or a .pdf." }
|
|
29580
|
+
],
|
|
29581
|
+
flags: [
|
|
29582
|
+
{
|
|
29583
|
+
name: "text-file",
|
|
29584
|
+
type: "string",
|
|
29585
|
+
description: "For a PDF: a file with its text, one line per printed line."
|
|
29586
|
+
},
|
|
29587
|
+
{
|
|
29588
|
+
name: "type",
|
|
29589
|
+
type: "string",
|
|
29590
|
+
description: "The file's media type, when its name doesn't say."
|
|
29591
|
+
}
|
|
29592
|
+
],
|
|
29593
|
+
scopes: WRITE2,
|
|
29594
|
+
returns: "HealthLabImportResult",
|
|
29595
|
+
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."
|
|
29596
|
+
},
|
|
29538
29597
|
{
|
|
29539
29598
|
path: ["health", "labs", "analytes"],
|
|
29540
29599
|
summary: "The canonical analytes: key, printed name, group, unit, LOINC and aliases.",
|
|
@@ -37506,6 +37565,9 @@ var HANDLERS = {
|
|
|
37506
37565
|
const notes = flagString(flags, "notes");
|
|
37507
37566
|
if (notes !== undefined)
|
|
37508
37567
|
fields.notes = notes.trim() ? notes : null;
|
|
37568
|
+
const sex = flagString(flags, "sex");
|
|
37569
|
+
if (sex !== undefined)
|
|
37570
|
+
fields.sex = sex.trim() ? sex.trim() : null;
|
|
37509
37571
|
const body = parseInput(updateHealthProfileInputSchema, fields);
|
|
37510
37572
|
return { data: await requireClient().patch("/health/profile", body), render: renderRecord };
|
|
37511
37573
|
},
|
|
@@ -37548,6 +37610,29 @@ var HANDLERS = {
|
|
|
37548
37610
|
await requireClient().delete(`/health/episodes/${episode}/entries/${entry}`);
|
|
37549
37611
|
return { data: { ok: true, deleted: entry }, render: renderRecord };
|
|
37550
37612
|
},
|
|
37613
|
+
"health lab import": async ({ args, flags, requireClient }) => {
|
|
37614
|
+
const path = requireArg(args, 0, "path");
|
|
37615
|
+
let bytes;
|
|
37616
|
+
try {
|
|
37617
|
+
bytes = readFileSync3(path);
|
|
37618
|
+
} catch (cause) {
|
|
37619
|
+
throw usageError(`can't read ${path}: ${cause instanceof Error ? cause.message : cause}`);
|
|
37620
|
+
}
|
|
37621
|
+
const name = basename(path);
|
|
37622
|
+
const form = new FormData;
|
|
37623
|
+
const textFile = flagString(flags, "text-file");
|
|
37624
|
+
if (textFile)
|
|
37625
|
+
form.append("text", readFileSync3(textFile, "utf8"));
|
|
37626
|
+
const type = flagString(flags, "type") ?? (/\.xml$/i.test(name) ? "application/xml" : Bun.file(name).type);
|
|
37627
|
+
form.append("file", new File([Uint8Array.from(bytes)], name, { type }), name);
|
|
37628
|
+
return {
|
|
37629
|
+
data: await requireClient().upload("/health/labs/import", form),
|
|
37630
|
+
render: (d, m) => {
|
|
37631
|
+
const r = d;
|
|
37632
|
+
return `${String(r.panel?.id)} ${paint(m, "dim", `draft \xB7 ${String(r.found)} values from the ${String(r.format).toUpperCase()}`)}`;
|
|
37633
|
+
}
|
|
37634
|
+
};
|
|
37635
|
+
},
|
|
37551
37636
|
"health labs analytes": async ({ requireClient }) => ({
|
|
37552
37637
|
data: await requireClient().get("/health/labs/analytes"),
|
|
37553
37638
|
render: renderList
|
package/package.json
CHANGED