formanitor 0.0.44 → 0.0.45
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/index.cjs +2056 -213
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.mjs +2056 -213
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -53,23 +53,23 @@ function validateField(value, field) {
|
|
|
53
53
|
const rules = field.validation;
|
|
54
54
|
if (!rules) return null;
|
|
55
55
|
if (field.type === "number") {
|
|
56
|
-
const
|
|
57
|
-
if (isNaN(
|
|
58
|
-
if (rules.min !== void 0 &&
|
|
56
|
+
const num2 = Number(value);
|
|
57
|
+
if (isNaN(num2)) return "Must be a valid number";
|
|
58
|
+
if (rules.min !== void 0 && num2 < rules.min) {
|
|
59
59
|
return `Must be at least ${rules.min}`;
|
|
60
60
|
}
|
|
61
|
-
if (rules.max !== void 0 &&
|
|
61
|
+
if (rules.max !== void 0 && num2 > rules.max) {
|
|
62
62
|
return `Must be at most ${rules.max}`;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
if (field.type === "slider") {
|
|
66
|
-
const
|
|
67
|
-
if (isNaN(
|
|
66
|
+
const num2 = Number(value);
|
|
67
|
+
if (isNaN(num2)) return "Must be a valid number";
|
|
68
68
|
const s = field;
|
|
69
69
|
const min = s.min ?? 0;
|
|
70
70
|
const max = s.max ?? 10;
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
71
|
+
if (num2 < min) return `Must be at least ${min}`;
|
|
72
|
+
if (num2 > max) return `Must be at most ${max}`;
|
|
73
73
|
}
|
|
74
74
|
if (typeof value === "string") {
|
|
75
75
|
if (rules.minLength !== void 0 && value.length < rules.minLength) {
|
|
@@ -388,7 +388,7 @@ function normalizeGeneralSurgerySmartHistory(raw) {
|
|
|
388
388
|
...painIn,
|
|
389
389
|
severity: Number.isFinite(sev) ? Math.min(10, Math.max(0, Math.round(sev))) : d.pain.severity
|
|
390
390
|
};
|
|
391
|
-
const
|
|
391
|
+
const str5 = (x) => typeof x === "string" ? x : "";
|
|
392
392
|
const strArr = (x) => Array.isArray(x) ? x.filter((i) => typeof i === "string") : [];
|
|
393
393
|
const swell = v.swelling && typeof v.swelling === "object" ? v.swelling : {};
|
|
394
394
|
const gi = v.gi && typeof v.gi === "object" ? v.gi : {};
|
|
@@ -398,44 +398,44 @@ function normalizeGeneralSurgerySmartHistory(raw) {
|
|
|
398
398
|
return {
|
|
399
399
|
pain,
|
|
400
400
|
swelling: {
|
|
401
|
-
duration:
|
|
402
|
-
sizeProgression:
|
|
403
|
-
painfulPainless:
|
|
401
|
+
duration: str5(swell.duration),
|
|
402
|
+
sizeProgression: str5(swell.sizeProgression),
|
|
403
|
+
painfulPainless: str5(swell.painfulPainless),
|
|
404
404
|
checks: strArr(swell.checks)
|
|
405
405
|
},
|
|
406
406
|
gi: {
|
|
407
|
-
appetite:
|
|
408
|
-
weightLoss:
|
|
409
|
-
bowelHabits:
|
|
407
|
+
appetite: str5(gi.appetite),
|
|
408
|
+
weightLoss: str5(gi.weightLoss),
|
|
409
|
+
bowelHabits: str5(gi.bowelHabits),
|
|
410
410
|
checks: strArr(gi.checks)
|
|
411
411
|
},
|
|
412
412
|
breast: {
|
|
413
|
-
lumpDuration:
|
|
414
|
-
nippleDischarge:
|
|
413
|
+
lumpDuration: str5(breast.lumpDuration),
|
|
414
|
+
nippleDischarge: str5(breast.nippleDischarge),
|
|
415
415
|
checks: strArr(breast.checks)
|
|
416
416
|
},
|
|
417
417
|
ano: { checks: strArr(ano.checks) },
|
|
418
418
|
thyroid: {
|
|
419
|
-
swellingDuration:
|
|
419
|
+
swellingDuration: str5(thy.swellingDuration),
|
|
420
420
|
checks: strArr(thy.checks)
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
424
|
function normalizeBreastExamSide(partial) {
|
|
425
425
|
const e = defaultBreastExamSide();
|
|
426
|
-
const
|
|
427
|
-
const
|
|
426
|
+
const str5 = (x) => typeof x === "string" ? x : "";
|
|
427
|
+
const bool3 = (x) => x === true;
|
|
428
428
|
if (!partial || typeof partial !== "object") return e;
|
|
429
429
|
const p = partial;
|
|
430
430
|
return {
|
|
431
|
-
size:
|
|
432
|
-
quadrant:
|
|
433
|
-
tenderness:
|
|
434
|
-
fixity:
|
|
435
|
-
skinInvolvement:
|
|
436
|
-
consistency:
|
|
437
|
-
axillaryNodes:
|
|
438
|
-
nippleAreolarComplex:
|
|
431
|
+
size: str5(p.size),
|
|
432
|
+
quadrant: str5(p.quadrant),
|
|
433
|
+
tenderness: str5(p.tenderness),
|
|
434
|
+
fixity: str5(p.fixity),
|
|
435
|
+
skinInvolvement: str5(p.skinInvolvement),
|
|
436
|
+
consistency: str5(p.consistency),
|
|
437
|
+
axillaryNodes: bool3(p.axillaryNodes),
|
|
438
|
+
nippleAreolarComplex: bool3(p.nippleAreolarComplex)
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
441
|
function normalizeBreastExaminationBlock(raw) {
|
|
@@ -459,7 +459,7 @@ function normalizeGeneralSurgeryExamination(raw) {
|
|
|
459
459
|
const th = v.thyroid && typeof v.thyroid === "object" ? v.thyroid : {};
|
|
460
460
|
const ar = v.anorectal && typeof v.anorectal === "object" ? v.anorectal : {};
|
|
461
461
|
const lm = v.limb && typeof v.limb === "object" ? v.limb : {};
|
|
462
|
-
const
|
|
462
|
+
const bool3 = (x) => x === true;
|
|
463
463
|
return {
|
|
464
464
|
general: strArr(v.general),
|
|
465
465
|
regions: strArr(v.regions),
|
|
@@ -472,27 +472,27 @@ function normalizeGeneralSurgeryExamination(raw) {
|
|
|
472
472
|
},
|
|
473
473
|
hernia: {
|
|
474
474
|
site: typeof hb.site === "string" ? hb.site : "",
|
|
475
|
-
reducible:
|
|
476
|
-
coughImpulse:
|
|
477
|
-
tenderness:
|
|
475
|
+
reducible: bool3(hb.reducible),
|
|
476
|
+
coughImpulse: bool3(hb.coughImpulse),
|
|
477
|
+
tenderness: bool3(hb.tenderness)
|
|
478
478
|
},
|
|
479
479
|
breast: normalizeBreastExaminationBlock(br),
|
|
480
480
|
thyroid: {
|
|
481
481
|
size: typeof th.size === "string" ? th.size : "",
|
|
482
|
-
mobileDeglutition:
|
|
483
|
-
nodules:
|
|
484
|
-
cervicalNodes:
|
|
482
|
+
mobileDeglutition: bool3(th.mobileDeglutition),
|
|
483
|
+
nodules: bool3(th.nodules),
|
|
484
|
+
cervicalNodes: bool3(th.cervicalNodes)
|
|
485
485
|
},
|
|
486
486
|
anorectal: {
|
|
487
487
|
inspection: typeof ar.inspection === "string" ? ar.inspection : "",
|
|
488
|
-
dreDone:
|
|
489
|
-
proctoscopyDone:
|
|
488
|
+
dreDone: bool3(ar.dreDone),
|
|
489
|
+
proctoscopyDone: bool3(ar.proctoscopyDone),
|
|
490
490
|
notes: typeof ar.notes === "string" ? ar.notes : ""
|
|
491
491
|
},
|
|
492
492
|
limb: {
|
|
493
|
-
dilatedVeins:
|
|
494
|
-
ulcer:
|
|
495
|
-
oedema:
|
|
493
|
+
dilatedVeins: bool3(lm.dilatedVeins),
|
|
494
|
+
ulcer: bool3(lm.ulcer),
|
|
495
|
+
oedema: bool3(lm.oedema)
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
498
|
}
|
|
@@ -1138,11 +1138,17 @@ function normalizeUrologyPathway(raw) {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
|
|
1140
1140
|
// src/core/painScaleFlags.ts
|
|
1141
|
+
var UPT_VALUES = ["", "Positive", "Negative", "Not done"];
|
|
1142
|
+
function isUpt(x) {
|
|
1143
|
+
return typeof x === "string" && UPT_VALUES.includes(x);
|
|
1144
|
+
}
|
|
1141
1145
|
function normalizePainScaleFlags(raw, bounds) {
|
|
1142
1146
|
const min = bounds?.min ?? 0;
|
|
1143
1147
|
const max = bounds?.max ?? 10;
|
|
1144
1148
|
let pain = min;
|
|
1145
1149
|
let flags = [];
|
|
1150
|
+
let bp = "";
|
|
1151
|
+
let upt = "";
|
|
1146
1152
|
if (raw && typeof raw === "object" && !Array.isArray(raw)) {
|
|
1147
1153
|
const o = raw;
|
|
1148
1154
|
const p = Number(o.pain);
|
|
@@ -1150,8 +1156,10 @@ function normalizePainScaleFlags(raw, bounds) {
|
|
|
1150
1156
|
if (Array.isArray(o.flags)) {
|
|
1151
1157
|
flags = o.flags.filter((x) => typeof x === "string");
|
|
1152
1158
|
}
|
|
1159
|
+
if (typeof o.bp === "string") bp = o.bp;
|
|
1160
|
+
if (isUpt(o.upt)) upt = o.upt;
|
|
1153
1161
|
}
|
|
1154
|
-
return { pain, flags };
|
|
1162
|
+
return { pain, flags, bp, upt };
|
|
1155
1163
|
}
|
|
1156
1164
|
|
|
1157
1165
|
// src/core/store.ts
|
|
@@ -4264,24 +4272,24 @@ function Spinner({
|
|
|
4264
4272
|
value,
|
|
4265
4273
|
onChange
|
|
4266
4274
|
}) {
|
|
4267
|
-
const
|
|
4275
|
+
const num2 = parseInt(value, 10) || 0;
|
|
4268
4276
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4269
4277
|
/* @__PURE__ */ jsx(
|
|
4270
4278
|
"button",
|
|
4271
4279
|
{
|
|
4272
4280
|
type: "button",
|
|
4273
4281
|
className: "text-muted-foreground hover:text-foreground cursor-pointer",
|
|
4274
|
-
onClick: () => onChange(String(
|
|
4282
|
+
onClick: () => onChange(String(num2 + 1)),
|
|
4275
4283
|
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3" })
|
|
4276
4284
|
}
|
|
4277
4285
|
),
|
|
4278
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm w-4 text-center leading-none", children:
|
|
4286
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm w-4 text-center leading-none", children: num2 }),
|
|
4279
4287
|
/* @__PURE__ */ jsx(
|
|
4280
4288
|
"button",
|
|
4281
4289
|
{
|
|
4282
4290
|
type: "button",
|
|
4283
4291
|
className: "text-muted-foreground hover:text-foreground cursor-pointer",
|
|
4284
|
-
onClick: () => onChange(String(Math.max(0,
|
|
4292
|
+
onClick: () => onChange(String(Math.max(0, num2 - 1))),
|
|
4285
4293
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
4286
4294
|
}
|
|
4287
4295
|
)
|
|
@@ -5862,14 +5870,14 @@ var FollowupWidget = ({ fieldId }) => {
|
|
|
5862
5870
|
const handleValueChange = useCallback(
|
|
5863
5871
|
(newValue) => {
|
|
5864
5872
|
setTouched();
|
|
5865
|
-
const
|
|
5873
|
+
const num2 = parseInt(newValue, 10);
|
|
5866
5874
|
const min = displayUnit === "days" ? 0 : 1;
|
|
5867
|
-
const valid = (Number.isNaN(
|
|
5875
|
+
const valid = (Number.isNaN(num2) ? min : num2) >= min || newValue === "";
|
|
5868
5876
|
if (!valid && newValue !== "") {
|
|
5869
5877
|
setValue({ followupType: "one time", value: String(displayUnit === "days" ? 0 : durationToDays(1, displayUnit)), unit: "days" });
|
|
5870
5878
|
return;
|
|
5871
5879
|
}
|
|
5872
|
-
const days = durationToDays(Number.isNaN(
|
|
5880
|
+
const days = durationToDays(Number.isNaN(num2) ? displayUnit === "days" ? 0 : 1 : num2, displayUnit);
|
|
5873
5881
|
setValue({ followupType: "one time", value: String(days), unit: "days" });
|
|
5874
5882
|
},
|
|
5875
5883
|
[displayUnit, setValue, setTouched]
|
|
@@ -6406,14 +6414,22 @@ var Switch = React15.forwardRef(
|
|
|
6406
6414
|
}
|
|
6407
6415
|
);
|
|
6408
6416
|
Switch.displayName = "Switch";
|
|
6417
|
+
var DEFAULT_MENSTRUAL = {
|
|
6418
|
+
menarche_age: 13,
|
|
6419
|
+
cycle_length: 28,
|
|
6420
|
+
flow_days: 4,
|
|
6421
|
+
cycle_regular: true,
|
|
6422
|
+
dysmenorrhea: 0
|
|
6423
|
+
};
|
|
6409
6424
|
var DEFAULT_DRAFT = {
|
|
6410
6425
|
gpal: { G: 0, P: 0, A: 0, L: 0 },
|
|
6411
6426
|
lmp: "",
|
|
6412
|
-
|
|
6427
|
+
pregnancy_status: "not_pregnant",
|
|
6413
6428
|
eddUSG: "",
|
|
6414
6429
|
primaryEDD: "lmp",
|
|
6415
6430
|
complications: "",
|
|
6416
|
-
outcome: null
|
|
6431
|
+
outcome: null,
|
|
6432
|
+
menstrual: { ...DEFAULT_MENSTRUAL }
|
|
6417
6433
|
};
|
|
6418
6434
|
function pad2(n) {
|
|
6419
6435
|
return String(n).padStart(2, "0");
|
|
@@ -6446,6 +6462,33 @@ function clampInt(val, min, max) {
|
|
|
6446
6462
|
if (!Number.isFinite(val)) return min;
|
|
6447
6463
|
return Math.max(min, Math.min(max, Math.trunc(val)));
|
|
6448
6464
|
}
|
|
6465
|
+
function clampDysmenorrhea(val) {
|
|
6466
|
+
const n = Math.round(Number(val));
|
|
6467
|
+
if (!Number.isFinite(n)) return 0;
|
|
6468
|
+
if (n <= 0) return 0;
|
|
6469
|
+
if (n >= 3) return 3;
|
|
6470
|
+
return n;
|
|
6471
|
+
}
|
|
6472
|
+
function isPregnancyStatus(x) {
|
|
6473
|
+
return x === "not_pregnant" || x === "pregnant" || x === "unknown";
|
|
6474
|
+
}
|
|
6475
|
+
function normalizeMenstrual(raw) {
|
|
6476
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
6477
|
+
return { ...DEFAULT_MENSTRUAL };
|
|
6478
|
+
}
|
|
6479
|
+
const o = raw;
|
|
6480
|
+
const num2 = (v, fb) => {
|
|
6481
|
+
const n = Number(v);
|
|
6482
|
+
return Number.isFinite(n) ? n : fb;
|
|
6483
|
+
};
|
|
6484
|
+
return {
|
|
6485
|
+
menarche_age: num2(o.menarche_age, DEFAULT_MENSTRUAL.menarche_age),
|
|
6486
|
+
cycle_length: num2(o.cycle_length, DEFAULT_MENSTRUAL.cycle_length),
|
|
6487
|
+
flow_days: num2(o.flow_days, DEFAULT_MENSTRUAL.flow_days),
|
|
6488
|
+
cycle_regular: typeof o.cycle_regular === "boolean" ? o.cycle_regular : DEFAULT_MENSTRUAL.cycle_regular,
|
|
6489
|
+
dysmenorrhea: clampDysmenorrhea(o.dysmenorrhea)
|
|
6490
|
+
};
|
|
6491
|
+
}
|
|
6449
6492
|
function parseLegacyString(input) {
|
|
6450
6493
|
const result = {};
|
|
6451
6494
|
const gpalMatch = input.match(/G(\d+)\s*P(\d+)\s*A(\d+)\s*L(\d+)/i);
|
|
@@ -6475,6 +6518,11 @@ function normalizeToDraft(value) {
|
|
|
6475
6518
|
const json = safeJsonParse(value);
|
|
6476
6519
|
parsed = json ?? value;
|
|
6477
6520
|
}
|
|
6521
|
+
const resolvePregnancyStatus = (o) => {
|
|
6522
|
+
if (isPregnancyStatus(o?.pregnancy_status)) return o.pregnancy_status;
|
|
6523
|
+
if (typeof o?.is_pregnant === "boolean") return o.is_pregnant ? "pregnant" : "not_pregnant";
|
|
6524
|
+
return "not_pregnant";
|
|
6525
|
+
};
|
|
6478
6526
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed) && "gpal" in parsed && parsed.gpal && typeof parsed.gpal === "object") {
|
|
6479
6527
|
const gpal = parsed.gpal ?? {};
|
|
6480
6528
|
const edd = parsed.edd ?? null;
|
|
@@ -6483,7 +6531,6 @@ function normalizeToDraft(value) {
|
|
|
6483
6531
|
const lmp = parsed.lmp ?? "";
|
|
6484
6532
|
const complications = parsed.complications ?? "";
|
|
6485
6533
|
const outcome = parsed.outcome ?? null;
|
|
6486
|
-
const is_pregnant = !!parsed.is_pregnant;
|
|
6487
6534
|
return {
|
|
6488
6535
|
isNewEntry: false,
|
|
6489
6536
|
draft: {
|
|
@@ -6494,7 +6541,7 @@ function normalizeToDraft(value) {
|
|
|
6494
6541
|
L: clampInt(Number(gpal.L ?? 0), 0, 20)
|
|
6495
6542
|
},
|
|
6496
6543
|
lmp: typeof lmp === "string" ? lmp : "",
|
|
6497
|
-
|
|
6544
|
+
pregnancy_status: resolvePregnancyStatus(parsed),
|
|
6498
6545
|
eddUSG: typeof eddUSG === "string" ? eddUSG : "",
|
|
6499
6546
|
primaryEDD: primaryEDD === "usg" ? "usg" : "lmp",
|
|
6500
6547
|
complications: typeof complications === "string" ? complications : "",
|
|
@@ -6503,7 +6550,8 @@ function normalizeToDraft(value) {
|
|
|
6503
6550
|
date: typeof outcome.date === "string" ? outcome.date : "",
|
|
6504
6551
|
notes: typeof outcome.notes === "string" ? outcome.notes : "",
|
|
6505
6552
|
is_final: !!outcome.is_final
|
|
6506
|
-
} : null
|
|
6553
|
+
} : null,
|
|
6554
|
+
menstrual: normalizeMenstrual(parsed.menstrual)
|
|
6507
6555
|
}
|
|
6508
6556
|
};
|
|
6509
6557
|
}
|
|
@@ -6529,7 +6577,8 @@ function normalizeToDraft(value) {
|
|
|
6529
6577
|
notes: typeof parsed.outcome.notes === "string" ? parsed.outcome.notes : "",
|
|
6530
6578
|
is_final: !!parsed.outcome.is_final
|
|
6531
6579
|
} : null,
|
|
6532
|
-
|
|
6580
|
+
pregnancy_status: resolvePregnancyStatus(parsed),
|
|
6581
|
+
menstrual: normalizeMenstrual(parsed.menstrual)
|
|
6533
6582
|
}
|
|
6534
6583
|
};
|
|
6535
6584
|
}
|
|
@@ -6580,16 +6629,18 @@ function computeTrimester(ga) {
|
|
|
6580
6629
|
function buildStored(draft, today) {
|
|
6581
6630
|
const lmpIso = isValidIsoDate(draft.lmp) ? draft.lmp : null;
|
|
6582
6631
|
const eddUsgIso = isValidIsoDate(draft.eddUSG) ? draft.eddUSG : null;
|
|
6583
|
-
if (
|
|
6632
|
+
if (draft.pregnancy_status !== "pregnant") {
|
|
6584
6633
|
return {
|
|
6585
6634
|
gpal: draft.gpal,
|
|
6586
6635
|
lmp: lmpIso,
|
|
6587
6636
|
is_pregnant: false,
|
|
6637
|
+
pregnancy_status: draft.pregnancy_status,
|
|
6588
6638
|
edd: null,
|
|
6589
6639
|
gestationalAge: null,
|
|
6590
6640
|
trimester: null,
|
|
6591
6641
|
complications: draft.complications.trim() ? draft.complications : null,
|
|
6592
|
-
outcome: draft.outcome
|
|
6642
|
+
outcome: draft.outcome,
|
|
6643
|
+
menstrual: { ...draft.menstrual }
|
|
6593
6644
|
};
|
|
6594
6645
|
}
|
|
6595
6646
|
const eddFromLmp = lmpIso ? computeEddFromLmp(lmpIso) : null;
|
|
@@ -6601,11 +6652,13 @@ function buildStored(draft, today) {
|
|
|
6601
6652
|
gpal: draft.gpal,
|
|
6602
6653
|
lmp: lmpIso,
|
|
6603
6654
|
is_pregnant: true,
|
|
6655
|
+
pregnancy_status: "pregnant",
|
|
6604
6656
|
edd: { lmp: eddFromLmp, usg: eddUsgIso, primary },
|
|
6605
6657
|
gestationalAge: gaPrimary,
|
|
6606
6658
|
trimester: computeTrimester(gaPrimary),
|
|
6607
6659
|
complications: draft.complications.trim() ? draft.complications : null,
|
|
6608
|
-
outcome: draft.outcome
|
|
6660
|
+
outcome: draft.outcome,
|
|
6661
|
+
menstrual: { ...draft.menstrual }
|
|
6609
6662
|
};
|
|
6610
6663
|
}
|
|
6611
6664
|
function stripGpalSuffix(label) {
|
|
@@ -6650,7 +6703,8 @@ var ObstetricHistoryWidget = ({ fieldId }) => {
|
|
|
6650
6703
|
};
|
|
6651
6704
|
const commitDebounced = useDebouncedCommit(commitImmediate, 500);
|
|
6652
6705
|
const storedComputed = useMemo(() => buildStored(draft, today), [draft, today]);
|
|
6653
|
-
const
|
|
6706
|
+
const isPregnant = draft.pregnancy_status === "pregnant";
|
|
6707
|
+
const rightPanelEnabled = isPregnant && (!!storedComputed.lmp || !!storedComputed.edd?.usg);
|
|
6654
6708
|
const headerLabel = fieldDef?.label ? stripGpalSuffix(fieldDef.label) : "Obstetric History";
|
|
6655
6709
|
const setDraft = (updater, persist) => {
|
|
6656
6710
|
setDraftState((prev) => {
|
|
@@ -6688,10 +6742,13 @@ var ObstetricHistoryWidget = ({ fieldId }) => {
|
|
|
6688
6742
|
setLmpError(null);
|
|
6689
6743
|
setDraft((prev) => ({ ...prev, lmp: nextIso }), "debounce");
|
|
6690
6744
|
};
|
|
6691
|
-
const handlePregStatus = (
|
|
6745
|
+
const handlePregStatus = (status) => {
|
|
6692
6746
|
setLmpError(null);
|
|
6693
6747
|
setPrimaryEddError(null);
|
|
6694
|
-
setDraft((prev) => ({ ...prev,
|
|
6748
|
+
setDraft((prev) => ({ ...prev, pregnancy_status: status }), "immediate");
|
|
6749
|
+
};
|
|
6750
|
+
const setMenstrualPatch = (patch) => {
|
|
6751
|
+
setDraft((prev) => ({ ...prev, menstrual: { ...prev.menstrual, ...patch } }), "debounce");
|
|
6695
6752
|
};
|
|
6696
6753
|
const handleEddUsgChange = (nextIso) => {
|
|
6697
6754
|
setPrimaryEddError(null);
|
|
@@ -6788,17 +6845,17 @@ var ObstetricHistoryWidget = ({ fieldId }) => {
|
|
|
6788
6845
|
),
|
|
6789
6846
|
lmpError && /* @__PURE__ */ jsx("p", { className: "text-xs text-red-600", children: lmpError })
|
|
6790
6847
|
] }),
|
|
6791
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2 rounded-lg border bg-white p-4", children: [
|
|
6848
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 rounded-lg border bg-white p-4 min-w-0", children: [
|
|
6792
6849
|
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: "Pregnancy Status" }),
|
|
6793
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
6850
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap gap-2", children: [
|
|
6794
6851
|
/* @__PURE__ */ jsx(
|
|
6795
6852
|
"button",
|
|
6796
6853
|
{
|
|
6797
6854
|
type: "button",
|
|
6798
|
-
onClick: () => handlePregStatus(
|
|
6855
|
+
onClick: () => handlePregStatus("not_pregnant"),
|
|
6799
6856
|
className: cn(
|
|
6800
|
-
"
|
|
6801
|
-
|
|
6857
|
+
"shrink-0 rounded-full border px-3 py-1.5 text-[11px] font-medium transition-colors",
|
|
6858
|
+
draft.pregnancy_status === "not_pregnant" ? "border-green-600 bg-green-600 text-white" : "border-slate-300 bg-white text-slate-700 hover:bg-slate-50"
|
|
6802
6859
|
),
|
|
6803
6860
|
children: "Not Pregnant"
|
|
6804
6861
|
}
|
|
@@ -6807,15 +6864,104 @@ var ObstetricHistoryWidget = ({ fieldId }) => {
|
|
|
6807
6864
|
"button",
|
|
6808
6865
|
{
|
|
6809
6866
|
type: "button",
|
|
6810
|
-
onClick: () => handlePregStatus(
|
|
6867
|
+
onClick: () => handlePregStatus("pregnant"),
|
|
6811
6868
|
className: cn(
|
|
6812
|
-
"
|
|
6813
|
-
draft.
|
|
6869
|
+
"shrink-0 rounded-full border px-3 py-1.5 text-[11px] font-medium transition-colors",
|
|
6870
|
+
draft.pregnancy_status === "pregnant" ? "border-green-600 bg-green-600 text-white" : "border-slate-300 bg-white text-slate-700 hover:bg-slate-50"
|
|
6814
6871
|
),
|
|
6815
6872
|
children: "Pregnant"
|
|
6816
6873
|
}
|
|
6874
|
+
),
|
|
6875
|
+
/* @__PURE__ */ jsx(
|
|
6876
|
+
"button",
|
|
6877
|
+
{
|
|
6878
|
+
type: "button",
|
|
6879
|
+
onClick: () => handlePregStatus("unknown"),
|
|
6880
|
+
className: cn(
|
|
6881
|
+
"shrink-0 rounded-full border px-3 py-1.5 text-[11px] font-medium transition-colors",
|
|
6882
|
+
draft.pregnancy_status === "unknown" ? "border-amber-500 bg-amber-500 text-white" : "border-slate-300 bg-white text-slate-700 hover:bg-slate-50"
|
|
6883
|
+
),
|
|
6884
|
+
children: "Unknown"
|
|
6885
|
+
}
|
|
6886
|
+
)
|
|
6887
|
+
] })
|
|
6888
|
+
] })
|
|
6889
|
+
] }),
|
|
6890
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-white p-4", children: [
|
|
6891
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-muted-foreground mb-3", children: "Menstrual" }),
|
|
6892
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-4", children: [
|
|
6893
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
6894
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `${fieldId}-menarche`, className: "text-[11px] text-muted-foreground", children: "Menarche (age)" }),
|
|
6895
|
+
/* @__PURE__ */ jsx(
|
|
6896
|
+
Input,
|
|
6897
|
+
{
|
|
6898
|
+
id: `${fieldId}-menarche`,
|
|
6899
|
+
type: "number",
|
|
6900
|
+
min: 5,
|
|
6901
|
+
max: 25,
|
|
6902
|
+
value: draft.menstrual.menarche_age,
|
|
6903
|
+
onChange: (e) => setMenstrualPatch({ menarche_age: Number(e.target.value) || 0 })
|
|
6904
|
+
}
|
|
6905
|
+
)
|
|
6906
|
+
] }),
|
|
6907
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
6908
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `${fieldId}-cycle-length`, className: "text-[11px] text-muted-foreground", children: "Cycle (days)" }),
|
|
6909
|
+
/* @__PURE__ */ jsx(
|
|
6910
|
+
Input,
|
|
6911
|
+
{
|
|
6912
|
+
id: `${fieldId}-cycle-length`,
|
|
6913
|
+
type: "number",
|
|
6914
|
+
min: 0,
|
|
6915
|
+
max: 120,
|
|
6916
|
+
value: draft.menstrual.cycle_length,
|
|
6917
|
+
onChange: (e) => setMenstrualPatch({ cycle_length: Number(e.target.value) || 0 })
|
|
6918
|
+
}
|
|
6919
|
+
)
|
|
6920
|
+
] }),
|
|
6921
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
6922
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `${fieldId}-flow-days`, className: "text-[11px] text-muted-foreground", children: "Flow (days)" }),
|
|
6923
|
+
/* @__PURE__ */ jsx(
|
|
6924
|
+
Input,
|
|
6925
|
+
{
|
|
6926
|
+
id: `${fieldId}-flow-days`,
|
|
6927
|
+
type: "number",
|
|
6928
|
+
min: 0,
|
|
6929
|
+
max: 30,
|
|
6930
|
+
value: draft.menstrual.flow_days,
|
|
6931
|
+
onChange: (e) => setMenstrualPatch({ flow_days: Number(e.target.value) || 0 })
|
|
6932
|
+
}
|
|
6933
|
+
)
|
|
6934
|
+
] }),
|
|
6935
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
6936
|
+
/* @__PURE__ */ jsx(Label, { className: "text-[11px] text-muted-foreground", children: "Dysmenorrhea" }),
|
|
6937
|
+
/* @__PURE__ */ jsxs(
|
|
6938
|
+
"select",
|
|
6939
|
+
{
|
|
6940
|
+
className: "h-9 w-full rounded-md border border-input bg-background px-2 text-sm",
|
|
6941
|
+
value: String(draft.menstrual.dysmenorrhea),
|
|
6942
|
+
onChange: (e) => setMenstrualPatch({
|
|
6943
|
+
dysmenorrhea: clampDysmenorrhea(Number(e.target.value))
|
|
6944
|
+
}),
|
|
6945
|
+
children: [
|
|
6946
|
+
/* @__PURE__ */ jsx("option", { value: "0", children: "0 \u2014 none" }),
|
|
6947
|
+
/* @__PURE__ */ jsx("option", { value: "1", children: "1 \u2014 mild" }),
|
|
6948
|
+
/* @__PURE__ */ jsx("option", { value: "2", children: "2 \u2014 moderate" }),
|
|
6949
|
+
/* @__PURE__ */ jsx("option", { value: "3", children: "3 \u2014 severe" })
|
|
6950
|
+
]
|
|
6951
|
+
}
|
|
6817
6952
|
)
|
|
6818
6953
|
] })
|
|
6954
|
+
] }),
|
|
6955
|
+
/* @__PURE__ */ jsxs("label", { className: "mt-3 flex items-center gap-2 text-sm", children: [
|
|
6956
|
+
/* @__PURE__ */ jsx(
|
|
6957
|
+
"input",
|
|
6958
|
+
{
|
|
6959
|
+
type: "checkbox",
|
|
6960
|
+
checked: draft.menstrual.cycle_regular,
|
|
6961
|
+
onChange: (e) => setMenstrualPatch({ cycle_regular: e.target.checked })
|
|
6962
|
+
}
|
|
6963
|
+
),
|
|
6964
|
+
"Regular cycle"
|
|
6819
6965
|
] })
|
|
6820
6966
|
] }),
|
|
6821
6967
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2 rounded-lg border bg-white p-4", children: [
|
|
@@ -6833,9 +6979,9 @@ var ObstetricHistoryWidget = ({ fieldId }) => {
|
|
|
6833
6979
|
] })
|
|
6834
6980
|
] }),
|
|
6835
6981
|
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-white p-4 min-h-[260px]", children: [
|
|
6836
|
-
!
|
|
6837
|
-
|
|
6838
|
-
|
|
6982
|
+
!isPregnant && /* @__PURE__ */ jsx("div", { className: "h-full flex items-center justify-center text-center text-sm text-muted-foreground px-6 py-10", children: draft.pregnancy_status === "unknown" ? "Pregnancy status unknown \u2014 confirm with UPT/USG to enable gestational age and EDD." : 'Only for "Pregnant Women" and enter LMP to calculate gestational age and EDD' }),
|
|
6983
|
+
isPregnant && !rightPanelEnabled && /* @__PURE__ */ jsx("div", { className: "h-full flex items-center justify-center text-center text-sm text-muted-foreground px-6 py-10", children: "Enter LMP and/or EDD (USG) to enable gestational age and EDD calculations." }),
|
|
6984
|
+
isPregnant && rightPanelEnabled && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
6839
6985
|
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4", children: [
|
|
6840
6986
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
6841
6987
|
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-blue-700", children: "Expected Delivery Date (EDD)" }),
|
|
@@ -9917,7 +10063,7 @@ var SliderWidget = ({ fieldId }) => {
|
|
|
9917
10063
|
const max = def.max ?? 10;
|
|
9918
10064
|
const step = def.step ?? 1;
|
|
9919
10065
|
const raw = value == null || value === "" ? min : Number(value);
|
|
9920
|
-
const
|
|
10066
|
+
const num2 = Number.isFinite(raw) ? Math.min(max, Math.max(min, raw)) : min;
|
|
9921
10067
|
const theme = getThemeConfig("textarea", def.theme);
|
|
9922
10068
|
const wrapperClass = theme?.wrapperClassName ?? "space-y-2";
|
|
9923
10069
|
const labelClass = theme?.labelClassName;
|
|
@@ -9926,7 +10072,7 @@ var SliderWidget = ({ fieldId }) => {
|
|
|
9926
10072
|
" ",
|
|
9927
10073
|
def.required && /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" }),
|
|
9928
10074
|
/* @__PURE__ */ jsxs("span", { className: "ml-2 text-muted-foreground font-normal tabular-nums", children: [
|
|
9929
|
-
|
|
10075
|
+
num2,
|
|
9930
10076
|
"/",
|
|
9931
10077
|
max
|
|
9932
10078
|
] })
|
|
@@ -9942,7 +10088,7 @@ var SliderWidget = ({ fieldId }) => {
|
|
|
9942
10088
|
min,
|
|
9943
10089
|
max,
|
|
9944
10090
|
step,
|
|
9945
|
-
value: [
|
|
10091
|
+
value: [num2],
|
|
9946
10092
|
onValueChange: (v) => {
|
|
9947
10093
|
const n = v[0] ?? min;
|
|
9948
10094
|
setValue(n);
|
|
@@ -10944,8 +11090,10 @@ var PainScaleFlagsWidget = ({ fieldId }) => {
|
|
|
10944
11090
|
const sel = safe.flags;
|
|
10945
11091
|
const isSelected = isFlagSelected(sel, optValue);
|
|
10946
11092
|
const nextFlags = isSelected ? sel.filter((v) => v !== optValue && String(v) !== String(optValue)) : [...sel, String(optValue)];
|
|
10947
|
-
update({ pain: safe.pain, flags: nextFlags });
|
|
11093
|
+
update({ pain: safe.pain, flags: nextFlags, bp: safe.bp, upt: safe.upt });
|
|
10948
11094
|
};
|
|
11095
|
+
const setBp = (bp) => update({ pain: safe.pain, flags: safe.flags, bp, upt: safe.upt });
|
|
11096
|
+
const setUpt = (upt) => update({ pain: safe.pain, flags: safe.flags, bp: safe.bp, upt });
|
|
10949
11097
|
const labelContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10950
11098
|
def.label,
|
|
10951
11099
|
" ",
|
|
@@ -10980,7 +11128,7 @@ var PainScaleFlagsWidget = ({ fieldId }) => {
|
|
|
10980
11128
|
value: [safe.pain],
|
|
10981
11129
|
onValueChange: (v) => {
|
|
10982
11130
|
const n = v[0] ?? min;
|
|
10983
|
-
update({ pain: n, flags: safe.flags });
|
|
11131
|
+
update({ pain: n, flags: safe.flags, bp: safe.bp, upt: safe.upt });
|
|
10984
11132
|
}
|
|
10985
11133
|
}
|
|
10986
11134
|
)
|
|
@@ -11006,6 +11154,42 @@ var PainScaleFlagsWidget = ({ fieldId }) => {
|
|
|
11006
11154
|
}
|
|
11007
11155
|
)
|
|
11008
11156
|
] }, String(opt.value))) })
|
|
11157
|
+
] }) : null,
|
|
11158
|
+
def.showBp || def.showUpt ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 pt-1 sm:grid-cols-2", children: [
|
|
11159
|
+
def.showBp ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
11160
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `${fieldId}-bp`, className: "text-sm font-medium text-slate-700", children: "BP recorded" }),
|
|
11161
|
+
/* @__PURE__ */ jsx(
|
|
11162
|
+
Input,
|
|
11163
|
+
{
|
|
11164
|
+
id: `${fieldId}-bp`,
|
|
11165
|
+
value: safe.bp ?? "",
|
|
11166
|
+
onChange: (e) => setBp(e.target.value),
|
|
11167
|
+
placeholder: "e.g. 130/86",
|
|
11168
|
+
disabled,
|
|
11169
|
+
className: "h-8 text-xs"
|
|
11170
|
+
}
|
|
11171
|
+
)
|
|
11172
|
+
] }) : null,
|
|
11173
|
+
def.showUpt ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
11174
|
+
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-slate-700", children: "UPT (if reproductive age)" }),
|
|
11175
|
+
/* @__PURE__ */ jsxs(
|
|
11176
|
+
Select,
|
|
11177
|
+
{
|
|
11178
|
+
value: safe.upt ? safe.upt : "none",
|
|
11179
|
+
onValueChange: (val) => setUpt(val === "none" ? "" : val),
|
|
11180
|
+
disabled,
|
|
11181
|
+
children: [
|
|
11182
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
11183
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
11184
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
11185
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Positive", children: "Positive" }),
|
|
11186
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Negative", children: "Negative" }),
|
|
11187
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Not done", children: "Not done" })
|
|
11188
|
+
] })
|
|
11189
|
+
]
|
|
11190
|
+
}
|
|
11191
|
+
)
|
|
11192
|
+
] }) : null
|
|
11009
11193
|
] }) : null
|
|
11010
11194
|
] }) }),
|
|
11011
11195
|
showError && /* @__PURE__ */ jsx("p", { className: "text-xs text-red-500", children: error })
|
|
@@ -11853,142 +12037,1775 @@ var UrologyPathwayWidget = ({ fieldId }) => {
|
|
|
11853
12037
|
] })
|
|
11854
12038
|
] });
|
|
11855
12039
|
};
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
12040
|
+
|
|
12041
|
+
// src/core/obgPathway.ts
|
|
12042
|
+
var UTERUS_SIZES = ["", "Normal", "Bulky", "Enlarged"];
|
|
12043
|
+
function bool2(x) {
|
|
12044
|
+
return x === true;
|
|
12045
|
+
}
|
|
12046
|
+
function str4(x) {
|
|
12047
|
+
return typeof x === "string" ? x : "";
|
|
12048
|
+
}
|
|
12049
|
+
function defaultObgExamination() {
|
|
12050
|
+
return {
|
|
12051
|
+
general: {
|
|
12052
|
+
pallor: false,
|
|
12053
|
+
oedema: false,
|
|
12054
|
+
thyroid: false,
|
|
12055
|
+
hirsutism: false,
|
|
12056
|
+
acanthosis: false
|
|
12057
|
+
},
|
|
12058
|
+
abdomen: { surgicalScars: false, massTenderness: false },
|
|
12059
|
+
breast: { lump: false, nippleDischarge: false, skinChanges: false, axillaryNodes: false },
|
|
12060
|
+
pelvic: {
|
|
12061
|
+
speculumDone: false,
|
|
12062
|
+
discharge: false,
|
|
12063
|
+
cervicalErosion: false,
|
|
12064
|
+
cervicalGrowth: false,
|
|
12065
|
+
activeBleeding: false,
|
|
12066
|
+
bimanualDone: false,
|
|
12067
|
+
adnexalMass: false,
|
|
12068
|
+
cmt: false
|
|
12069
|
+
},
|
|
12070
|
+
uterusSize: "",
|
|
12071
|
+
examinationNotes: ""
|
|
12072
|
+
};
|
|
12073
|
+
}
|
|
12074
|
+
function normalizeObgExamination(raw) {
|
|
12075
|
+
const base = defaultObgExamination();
|
|
12076
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return base;
|
|
12077
|
+
const o = raw;
|
|
12078
|
+
const g = o.general && typeof o.general === "object" ? o.general : {};
|
|
12079
|
+
const a = o.abdomen && typeof o.abdomen === "object" ? o.abdomen : {};
|
|
12080
|
+
const b = o.breast && typeof o.breast === "object" ? o.breast : {};
|
|
12081
|
+
const p = o.pelvic && typeof o.pelvic === "object" ? o.pelvic : {};
|
|
12082
|
+
const us = str4(o.uterusSize);
|
|
12083
|
+
return {
|
|
12084
|
+
general: {
|
|
12085
|
+
pallor: bool2(g.pallor),
|
|
12086
|
+
oedema: bool2(g.oedema),
|
|
12087
|
+
thyroid: bool2(g.thyroid),
|
|
12088
|
+
hirsutism: bool2(g.hirsutism),
|
|
12089
|
+
acanthosis: bool2(g.acanthosis)
|
|
12090
|
+
},
|
|
12091
|
+
abdomen: {
|
|
12092
|
+
surgicalScars: bool2(a.surgicalScars),
|
|
12093
|
+
massTenderness: bool2(a.massTenderness)
|
|
12094
|
+
},
|
|
12095
|
+
breast: {
|
|
12096
|
+
lump: bool2(b.lump),
|
|
12097
|
+
nippleDischarge: bool2(b.nippleDischarge),
|
|
12098
|
+
skinChanges: bool2(b.skinChanges),
|
|
12099
|
+
axillaryNodes: bool2(b.axillaryNodes)
|
|
12100
|
+
},
|
|
12101
|
+
pelvic: {
|
|
12102
|
+
speculumDone: bool2(p.speculumDone),
|
|
12103
|
+
discharge: bool2(p.discharge),
|
|
12104
|
+
cervicalErosion: bool2(p.cervicalErosion),
|
|
12105
|
+
cervicalGrowth: bool2(p.cervicalGrowth),
|
|
12106
|
+
activeBleeding: bool2(p.activeBleeding),
|
|
12107
|
+
bimanualDone: bool2(p.bimanualDone),
|
|
12108
|
+
adnexalMass: bool2(p.adnexalMass),
|
|
12109
|
+
cmt: bool2(p.cmt)
|
|
12110
|
+
},
|
|
12111
|
+
uterusSize: UTERUS_SIZES.includes(us) ? us : "",
|
|
12112
|
+
examinationNotes: str4(o.examinationNotes)
|
|
12113
|
+
};
|
|
12114
|
+
}
|
|
12115
|
+
var GENERAL_LABELS = {
|
|
12116
|
+
pallor: "Pallor",
|
|
12117
|
+
oedema: "Oedema",
|
|
12118
|
+
thyroid: "Thyroid",
|
|
12119
|
+
hirsutism: "Hirsutism",
|
|
12120
|
+
acanthosis: "Acanthosis"
|
|
11862
12121
|
};
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
return /* @__PURE__ */ jsx(FollowupWidget, { fieldId });
|
|
11917
|
-
case "smart_textarea":
|
|
11918
|
-
return /* @__PURE__ */ jsx(SmartTextareaWidget, { fieldId });
|
|
11919
|
-
case "diagnosis_textarea":
|
|
11920
|
-
return /* @__PURE__ */ jsx(DiagnosisTextareaWidget, { fieldId });
|
|
11921
|
-
case "obstetric_history":
|
|
11922
|
-
return /* @__PURE__ */ jsx(ObstetricHistoryWidget, { fieldId });
|
|
11923
|
-
case "eye_prescription":
|
|
11924
|
-
return /* @__PURE__ */ jsx(OphthalmologyWidget, { fieldId });
|
|
11925
|
-
case "ophthal_diagnosis":
|
|
11926
|
-
return /* @__PURE__ */ jsx(OphthalDiagnosisWidget, { fieldId });
|
|
11927
|
-
case "orthopedic_exam":
|
|
11928
|
-
return /* @__PURE__ */ jsx(OrthopedicExamWidget, { fieldId });
|
|
11929
|
-
case "general_surgery_smart_history":
|
|
11930
|
-
return /* @__PURE__ */ jsx(GsSmartHistoryWidget, { fieldId });
|
|
11931
|
-
case "general_surgery_examination":
|
|
11932
|
-
return /* @__PURE__ */ jsx(GsExaminationWidget, { fieldId });
|
|
11933
|
-
case "general_surgery_grading":
|
|
11934
|
-
return /* @__PURE__ */ jsx(GsGradingWidget, { fieldId });
|
|
11935
|
-
case "pain_scale_flags":
|
|
11936
|
-
return /* @__PURE__ */ jsx(PainScaleFlagsWidget, { fieldId });
|
|
11937
|
-
case "urology_smart_history":
|
|
11938
|
-
return /* @__PURE__ */ jsx(UrologySmartHistoryWidget, { fieldId });
|
|
11939
|
-
case "urology_examination":
|
|
11940
|
-
return /* @__PURE__ */ jsx(UrologyExaminationWidget, { fieldId });
|
|
11941
|
-
case "urology_pathway":
|
|
11942
|
-
return /* @__PURE__ */ jsx(UrologyPathwayWidget, { fieldId });
|
|
11943
|
-
case "toggle": {
|
|
11944
|
-
const { value, setValue, setTouched, disabled } = useField(fieldId);
|
|
11945
|
-
const store = useFormStore();
|
|
11946
|
-
const excludes = fieldDef.excludes ?? [];
|
|
11947
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
11948
|
-
/* @__PURE__ */ jsx(
|
|
11949
|
-
Switch,
|
|
11950
|
-
{
|
|
11951
|
-
checked: value === true,
|
|
11952
|
-
disabled,
|
|
11953
|
-
onCheckedChange: (checked) => {
|
|
11954
|
-
setValue(checked);
|
|
11955
|
-
setTouched();
|
|
11956
|
-
if (checked) excludes.forEach((id) => store.setValue(id, false));
|
|
11957
|
-
}
|
|
11958
|
-
}
|
|
11959
|
-
),
|
|
11960
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium leading-none cursor-pointer select-none", children: fieldDef.label })
|
|
11961
|
-
] });
|
|
12122
|
+
var ABDOMEN_LABELS = {
|
|
12123
|
+
surgicalScars: "Surgical scars",
|
|
12124
|
+
massTenderness: "Mass / tenderness"
|
|
12125
|
+
};
|
|
12126
|
+
var BREAST_LABELS = {
|
|
12127
|
+
lump: "Lump",
|
|
12128
|
+
nippleDischarge: "Nipple discharge",
|
|
12129
|
+
skinChanges: "Skin changes",
|
|
12130
|
+
axillaryNodes: "Axillary nodes"
|
|
12131
|
+
};
|
|
12132
|
+
var PELVIC_LABELS = {
|
|
12133
|
+
speculumDone: "Speculum done",
|
|
12134
|
+
discharge: "Discharge",
|
|
12135
|
+
cervicalErosion: "Cervical erosion",
|
|
12136
|
+
cervicalGrowth: "Cervical growth",
|
|
12137
|
+
activeBleeding: "Active bleeding",
|
|
12138
|
+
bimanualDone: "Bimanual done",
|
|
12139
|
+
adnexalMass: "Adnexal mass",
|
|
12140
|
+
cmt: "Cervical motion tenderness"
|
|
12141
|
+
};
|
|
12142
|
+
function pickLabels(group, labels) {
|
|
12143
|
+
return Object.keys(labels).filter((k) => group[k]).map((k) => labels[k]);
|
|
12144
|
+
}
|
|
12145
|
+
function formatObgExaminationToClinicalExamination(v) {
|
|
12146
|
+
const lines = [];
|
|
12147
|
+
const general = pickLabels(v.general, GENERAL_LABELS);
|
|
12148
|
+
if (general.length) lines.push(`General: ${general.join(", ")}`);
|
|
12149
|
+
const abd = pickLabels(v.abdomen, ABDOMEN_LABELS);
|
|
12150
|
+
if (abd.length) lines.push(`Abdomen: ${abd.join(", ")}`);
|
|
12151
|
+
const breast = pickLabels(v.breast, BREAST_LABELS);
|
|
12152
|
+
if (breast.length) lines.push(`Breast: ${breast.join(", ")}`);
|
|
12153
|
+
const pelvic = pickLabels(v.pelvic, PELVIC_LABELS);
|
|
12154
|
+
let pelvicLine = pelvic.length ? `Pelvic: ${pelvic.join(", ")}` : "";
|
|
12155
|
+
if (v.pelvic.bimanualDone && v.uterusSize) {
|
|
12156
|
+
pelvicLine = pelvicLine ? `${pelvicLine} \u2014 uterus ${v.uterusSize.toLowerCase()}` : `Pelvic: uterus ${v.uterusSize.toLowerCase()}`;
|
|
12157
|
+
}
|
|
12158
|
+
if (pelvicLine) lines.push(pelvicLine);
|
|
12159
|
+
return lines.join("\n");
|
|
12160
|
+
}
|
|
12161
|
+
var OBG_ZONE_ORDER = [
|
|
12162
|
+
"menstrual_reproductive",
|
|
12163
|
+
"antenatal",
|
|
12164
|
+
"gynaecological",
|
|
12165
|
+
"obstetric",
|
|
12166
|
+
"infertility",
|
|
12167
|
+
"postoperative"
|
|
12168
|
+
];
|
|
12169
|
+
var OBG_ZONE_SET = new Set(OBG_ZONE_ORDER);
|
|
12170
|
+
function coerceZones(raw) {
|
|
12171
|
+
const list = [];
|
|
12172
|
+
const push = (x) => {
|
|
12173
|
+
if (typeof x === "string" && OBG_ZONE_SET.has(x) && !list.includes(x)) {
|
|
12174
|
+
list.push(x);
|
|
11962
12175
|
}
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
12176
|
+
};
|
|
12177
|
+
if (Array.isArray(raw)) raw.forEach(push);
|
|
12178
|
+
else push(raw);
|
|
12179
|
+
return list.sort((a, b) => OBG_ZONE_ORDER.indexOf(a) - OBG_ZONE_ORDER.indexOf(b));
|
|
12180
|
+
}
|
|
12181
|
+
function num(x, fallback = 0) {
|
|
12182
|
+
const n = Number(x);
|
|
12183
|
+
return Number.isFinite(n) ? n : fallback;
|
|
12184
|
+
}
|
|
12185
|
+
function clampDysmenorrhea2(x) {
|
|
12186
|
+
const n = Math.round(num(x, 0));
|
|
12187
|
+
if (n <= 0) return 0;
|
|
12188
|
+
if (n >= 3) return 3;
|
|
12189
|
+
return n;
|
|
12190
|
+
}
|
|
12191
|
+
function defaultObgPathway() {
|
|
12192
|
+
return {
|
|
12193
|
+
zones: [],
|
|
12194
|
+
menstrual: {
|
|
12195
|
+
menarcheAge: 13,
|
|
12196
|
+
cycleLength: 28,
|
|
12197
|
+
flowDays: 4,
|
|
12198
|
+
cycleRegular: true,
|
|
12199
|
+
dysmenorrhea: 0,
|
|
12200
|
+
amount: "",
|
|
12201
|
+
lmp: "",
|
|
12202
|
+
menopauseStatus: ""
|
|
12203
|
+
},
|
|
12204
|
+
antenatal: {
|
|
12205
|
+
gravida: 0,
|
|
12206
|
+
gaWeeksLmp: 0,
|
|
12207
|
+
gaDaysLmp: 0,
|
|
12208
|
+
gaWeeksUsg: 0,
|
|
12209
|
+
gaDaysUsg: 0,
|
|
12210
|
+
edd: "",
|
|
12211
|
+
riskCategory: "",
|
|
12212
|
+
symptoms: {
|
|
12213
|
+
nauseaVomiting: false,
|
|
12214
|
+
bleedingPV: false,
|
|
12215
|
+
painAbdomen: false,
|
|
12216
|
+
decreasedFetalMovements: false
|
|
12217
|
+
},
|
|
12218
|
+
exam: {
|
|
12219
|
+
weightKg: 0,
|
|
12220
|
+
heightCm: 0,
|
|
12221
|
+
bmi: 0,
|
|
12222
|
+
bp: "",
|
|
12223
|
+
pallor: false,
|
|
12224
|
+
oedema: false,
|
|
12225
|
+
fundalHeightCm: 0,
|
|
12226
|
+
fhrBpm: 0,
|
|
12227
|
+
presentation: "",
|
|
12228
|
+
lie: ""
|
|
12229
|
+
},
|
|
12230
|
+
investigations: {
|
|
12231
|
+
bloodGroup: "",
|
|
12232
|
+
cbc: "",
|
|
12233
|
+
tsh: "",
|
|
12234
|
+
rbsOgtt: "",
|
|
12235
|
+
serology: "",
|
|
12236
|
+
urine: "",
|
|
12237
|
+
usg: ""
|
|
12238
|
+
}
|
|
12239
|
+
},
|
|
12240
|
+
gynae: {
|
|
12241
|
+
symptoms: {
|
|
12242
|
+
aub: false,
|
|
12243
|
+
whiteDischarge: false,
|
|
12244
|
+
pelvicPain: false,
|
|
12245
|
+
dyspareunia: false,
|
|
12246
|
+
urinaryComplaints: false,
|
|
12247
|
+
prolapse: false
|
|
12248
|
+
}
|
|
12249
|
+
},
|
|
12250
|
+
obstetric: [],
|
|
12251
|
+
infertility: {
|
|
12252
|
+
type: "",
|
|
12253
|
+
durationMonths: 0,
|
|
12254
|
+
previousTreatments: "",
|
|
12255
|
+
female: { ovulation: "", pcosFeatures: false, endometriosisSuspicion: false },
|
|
12256
|
+
male: { age: 0, semenAnalysis: "" },
|
|
12257
|
+
investigations: { amh: "", fshLh: "", prolactin: "", tsh: "", tvs: "", hsg: "" }
|
|
12258
|
+
},
|
|
12259
|
+
postop: {
|
|
12260
|
+
surgeryDate: "",
|
|
12261
|
+
procedure: "",
|
|
12262
|
+
histopathology: "",
|
|
12263
|
+
woundStatus: "",
|
|
12264
|
+
painScore: 0,
|
|
12265
|
+
complications: ""
|
|
11983
12266
|
}
|
|
11984
|
-
|
|
11985
|
-
return /* @__PURE__ */ jsxs("div", { className: "text-red-500", children: [
|
|
11986
|
-
"Unknown field type: ",
|
|
11987
|
-
fieldDef.type
|
|
11988
|
-
] });
|
|
11989
|
-
}
|
|
12267
|
+
};
|
|
11990
12268
|
}
|
|
11991
|
-
|
|
12269
|
+
function normalizeObgPathway(raw) {
|
|
12270
|
+
const base = defaultObgPathway();
|
|
12271
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return base;
|
|
12272
|
+
const o = raw;
|
|
12273
|
+
const zones = coerceZones(o.zones ?? o.zone);
|
|
12274
|
+
const m = o.menstrual && typeof o.menstrual === "object" ? o.menstrual : {};
|
|
12275
|
+
const a = o.antenatal && typeof o.antenatal === "object" ? o.antenatal : {};
|
|
12276
|
+
const aSym = a.symptoms && typeof a.symptoms === "object" ? a.symptoms : {};
|
|
12277
|
+
const aExam = a.exam && typeof a.exam === "object" ? a.exam : {};
|
|
12278
|
+
const aInv = a.investigations && typeof a.investigations === "object" ? a.investigations : {};
|
|
12279
|
+
const g = o.gynae && typeof o.gynae === "object" ? o.gynae : {};
|
|
12280
|
+
const gSym = g.symptoms && typeof g.symptoms === "object" ? g.symptoms : {};
|
|
12281
|
+
const inf = o.infertility && typeof o.infertility === "object" ? o.infertility : {};
|
|
12282
|
+
const infF = inf.female && typeof inf.female === "object" ? inf.female : {};
|
|
12283
|
+
const infM = inf.male && typeof inf.male === "object" ? inf.male : {};
|
|
12284
|
+
const infInv = inf.investigations && typeof inf.investigations === "object" ? inf.investigations : {};
|
|
12285
|
+
const po = o.postop && typeof o.postop === "object" ? o.postop : {};
|
|
12286
|
+
const obstetricRows = Array.isArray(o.obstetric) ? o.obstetric.map((row) => {
|
|
12287
|
+
const r = row && typeof row === "object" ? row : {};
|
|
12288
|
+
const mode = str4(r.mode);
|
|
12289
|
+
return {
|
|
12290
|
+
year: str4(r.year),
|
|
12291
|
+
ga: str4(r.ga),
|
|
12292
|
+
mode: ["", "NVD", "LSCS", "Instrumental", "Abortion", "Stillbirth"].includes(mode) ? mode : "",
|
|
12293
|
+
indicationLscs: str4(r.indicationLscs),
|
|
12294
|
+
babyOutcome: str4(r.babyOutcome),
|
|
12295
|
+
complications: str4(r.complications)
|
|
12296
|
+
};
|
|
12297
|
+
}) : [];
|
|
12298
|
+
return {
|
|
12299
|
+
zones,
|
|
12300
|
+
menstrual: {
|
|
12301
|
+
menarcheAge: num(m.menarcheAge, base.menstrual.menarcheAge),
|
|
12302
|
+
cycleLength: num(m.cycleLength, base.menstrual.cycleLength),
|
|
12303
|
+
flowDays: num(m.flowDays, base.menstrual.flowDays),
|
|
12304
|
+
cycleRegular: m.cycleRegular === void 0 ? base.menstrual.cycleRegular : bool2(m.cycleRegular),
|
|
12305
|
+
dysmenorrhea: clampDysmenorrhea2(m.dysmenorrhea),
|
|
12306
|
+
amount: ["", "Scanty", "Normal", "Heavy"].includes(str4(m.amount)) ? str4(m.amount) : "",
|
|
12307
|
+
lmp: str4(m.lmp),
|
|
12308
|
+
menopauseStatus: ["", "Pre", "Peri", "Post"].includes(str4(m.menopauseStatus)) ? str4(m.menopauseStatus) : ""
|
|
12309
|
+
},
|
|
12310
|
+
antenatal: {
|
|
12311
|
+
gravida: num(a.gravida),
|
|
12312
|
+
gaWeeksLmp: num(a.gaWeeksLmp),
|
|
12313
|
+
gaDaysLmp: num(a.gaDaysLmp),
|
|
12314
|
+
gaWeeksUsg: num(a.gaWeeksUsg),
|
|
12315
|
+
gaDaysUsg: num(a.gaDaysUsg),
|
|
12316
|
+
edd: str4(a.edd),
|
|
12317
|
+
riskCategory: ["", "Low", "High"].includes(str4(a.riskCategory)) ? str4(a.riskCategory) : "",
|
|
12318
|
+
symptoms: {
|
|
12319
|
+
nauseaVomiting: bool2(aSym.nauseaVomiting),
|
|
12320
|
+
bleedingPV: bool2(aSym.bleedingPV),
|
|
12321
|
+
painAbdomen: bool2(aSym.painAbdomen),
|
|
12322
|
+
decreasedFetalMovements: bool2(aSym.decreasedFetalMovements)
|
|
12323
|
+
},
|
|
12324
|
+
exam: {
|
|
12325
|
+
weightKg: num(aExam.weightKg),
|
|
12326
|
+
heightCm: num(aExam.heightCm),
|
|
12327
|
+
bmi: num(aExam.bmi),
|
|
12328
|
+
bp: str4(aExam.bp),
|
|
12329
|
+
pallor: bool2(aExam.pallor),
|
|
12330
|
+
oedema: bool2(aExam.oedema),
|
|
12331
|
+
fundalHeightCm: num(aExam.fundalHeightCm),
|
|
12332
|
+
fhrBpm: num(aExam.fhrBpm),
|
|
12333
|
+
presentation: ["", "Cephalic", "Breech", "Other"].includes(str4(aExam.presentation)) ? str4(aExam.presentation) : "",
|
|
12334
|
+
lie: ["", "Longitudinal", "Transverse", "Oblique"].includes(str4(aExam.lie)) ? str4(aExam.lie) : ""
|
|
12335
|
+
},
|
|
12336
|
+
investigations: {
|
|
12337
|
+
bloodGroup: str4(aInv.bloodGroup),
|
|
12338
|
+
cbc: ["", "Done", "Pending", "Abnormal"].includes(str4(aInv.cbc)) ? str4(aInv.cbc) : "",
|
|
12339
|
+
tsh: ["", "Done", "Pending", "Abnormal"].includes(str4(aInv.tsh)) ? str4(aInv.tsh) : "",
|
|
12340
|
+
rbsOgtt: ["", "Done", "Pending", "Abnormal"].includes(str4(aInv.rbsOgtt)) ? str4(aInv.rbsOgtt) : "",
|
|
12341
|
+
serology: ["", "Done", "Pending", "Abnormal"].includes(str4(aInv.serology)) ? str4(aInv.serology) : "",
|
|
12342
|
+
urine: ["", "Done", "Pending", "Abnormal"].includes(str4(aInv.urine)) ? str4(aInv.urine) : "",
|
|
12343
|
+
usg: ["", "Dating", "NT", "Anomaly", "Growth", "Pending"].includes(str4(aInv.usg)) ? str4(aInv.usg) : ""
|
|
12344
|
+
}
|
|
12345
|
+
},
|
|
12346
|
+
gynae: {
|
|
12347
|
+
symptoms: {
|
|
12348
|
+
aub: bool2(gSym.aub),
|
|
12349
|
+
whiteDischarge: bool2(gSym.whiteDischarge),
|
|
12350
|
+
pelvicPain: bool2(gSym.pelvicPain),
|
|
12351
|
+
dyspareunia: bool2(gSym.dyspareunia),
|
|
12352
|
+
urinaryComplaints: bool2(gSym.urinaryComplaints),
|
|
12353
|
+
prolapse: bool2(gSym.prolapse)
|
|
12354
|
+
}
|
|
12355
|
+
},
|
|
12356
|
+
obstetric: obstetricRows,
|
|
12357
|
+
infertility: {
|
|
12358
|
+
type: ["", "Primary", "Secondary"].includes(str4(inf.type)) ? str4(inf.type) : "",
|
|
12359
|
+
durationMonths: num(inf.durationMonths),
|
|
12360
|
+
previousTreatments: str4(inf.previousTreatments),
|
|
12361
|
+
female: {
|
|
12362
|
+
ovulation: ["", "Ovulatory", "Anovulatory", "Unknown"].includes(str4(infF.ovulation)) ? str4(infF.ovulation) : "",
|
|
12363
|
+
pcosFeatures: bool2(infF.pcosFeatures),
|
|
12364
|
+
endometriosisSuspicion: bool2(infF.endometriosisSuspicion)
|
|
12365
|
+
},
|
|
12366
|
+
male: {
|
|
12367
|
+
age: num(infM.age),
|
|
12368
|
+
semenAnalysis: ["", "Normal", "Abnormal", "Pending"].includes(str4(infM.semenAnalysis)) ? str4(infM.semenAnalysis) : ""
|
|
12369
|
+
},
|
|
12370
|
+
investigations: {
|
|
12371
|
+
amh: str4(infInv.amh),
|
|
12372
|
+
fshLh: str4(infInv.fshLh),
|
|
12373
|
+
prolactin: str4(infInv.prolactin),
|
|
12374
|
+
tsh: str4(infInv.tsh),
|
|
12375
|
+
tvs: str4(infInv.tvs),
|
|
12376
|
+
hsg: str4(infInv.hsg)
|
|
12377
|
+
}
|
|
12378
|
+
},
|
|
12379
|
+
postop: {
|
|
12380
|
+
surgeryDate: str4(po.surgeryDate),
|
|
12381
|
+
procedure: str4(po.procedure),
|
|
12382
|
+
histopathology: str4(po.histopathology),
|
|
12383
|
+
woundStatus: ["", "Healthy", "Erythema", "Discharge", "Dehisced"].includes(str4(po.woundStatus)) ? str4(po.woundStatus) : "",
|
|
12384
|
+
painScore: Math.max(0, Math.min(10, num(po.painScore))),
|
|
12385
|
+
complications: str4(po.complications)
|
|
12386
|
+
}
|
|
12387
|
+
};
|
|
12388
|
+
}
|
|
12389
|
+
var ZONE_LABELS = {
|
|
12390
|
+
menstrual_reproductive: "Menstrual & reproductive",
|
|
12391
|
+
antenatal: "Antenatal",
|
|
12392
|
+
gynaecological: "Gynaecological",
|
|
12393
|
+
obstetric: "Obstetric",
|
|
12394
|
+
infertility: "Infertility",
|
|
12395
|
+
postoperative: "Post-operative"
|
|
12396
|
+
};
|
|
12397
|
+
function obgZoneLabel(zone) {
|
|
12398
|
+
return ZONE_LABELS[zone];
|
|
12399
|
+
}
|
|
12400
|
+
function nonEmpty(parts) {
|
|
12401
|
+
return parts.map((s) => (s ?? "").trim()).filter(Boolean);
|
|
12402
|
+
}
|
|
12403
|
+
function formatMenstrualBlock(m) {
|
|
12404
|
+
const bits = nonEmpty([
|
|
12405
|
+
m.menarcheAge ? `menarche ${m.menarcheAge}y` : "",
|
|
12406
|
+
m.cycleLength ? `cycle ${m.cycleLength}d` : "",
|
|
12407
|
+
m.flowDays ? `flow ${m.flowDays}d` : "",
|
|
12408
|
+
m.cycleRegular ? "regular" : "irregular",
|
|
12409
|
+
m.amount ? `flow ${m.amount.toLowerCase()}` : "",
|
|
12410
|
+
m.dysmenorrhea ? `dysmenorrhea grade ${m.dysmenorrhea}` : "",
|
|
12411
|
+
m.lmp ? `LMP ${m.lmp}` : "",
|
|
12412
|
+
m.menopauseStatus ? `${m.menopauseStatus.toLowerCase()}menopausal` : ""
|
|
12413
|
+
]);
|
|
12414
|
+
return bits.length ? `Menstrual: ${bits.join(", ")}` : "";
|
|
12415
|
+
}
|
|
12416
|
+
function formatAntenatalBlock(a) {
|
|
12417
|
+
const lines = [];
|
|
12418
|
+
const head = nonEmpty([
|
|
12419
|
+
a.gravida ? `G${a.gravida}` : "",
|
|
12420
|
+
a.gaWeeksLmp || a.gaDaysLmp ? `GA(LMP) ${a.gaWeeksLmp}w ${a.gaDaysLmp}d` : "",
|
|
12421
|
+
a.gaWeeksUsg || a.gaDaysUsg ? `GA(USG) ${a.gaWeeksUsg}w ${a.gaDaysUsg}d` : "",
|
|
12422
|
+
a.edd ? `EDD ${a.edd}` : "",
|
|
12423
|
+
a.riskCategory ? `${a.riskCategory} risk` : ""
|
|
12424
|
+
]);
|
|
12425
|
+
if (head.length) lines.push(`Antenatal: ${head.join(", ")}`);
|
|
12426
|
+
const sym = nonEmpty([
|
|
12427
|
+
a.symptoms.nauseaVomiting ? "nausea/vomiting" : "",
|
|
12428
|
+
a.symptoms.bleedingPV ? "bleeding PV" : "",
|
|
12429
|
+
a.symptoms.painAbdomen ? "pain abdomen" : "",
|
|
12430
|
+
a.symptoms.decreasedFetalMovements ? "decreased fetal movements" : ""
|
|
12431
|
+
]);
|
|
12432
|
+
if (sym.length) lines.push(`Antenatal symptoms: ${sym.join(", ")}`);
|
|
12433
|
+
return lines.join("\n");
|
|
12434
|
+
}
|
|
12435
|
+
function formatGynaeBlock(g) {
|
|
12436
|
+
const sym = nonEmpty([
|
|
12437
|
+
g.symptoms.aub ? "AUB" : "",
|
|
12438
|
+
g.symptoms.whiteDischarge ? "white discharge" : "",
|
|
12439
|
+
g.symptoms.pelvicPain ? "pelvic pain" : "",
|
|
12440
|
+
g.symptoms.dyspareunia ? "dyspareunia" : "",
|
|
12441
|
+
g.symptoms.urinaryComplaints ? "urinary complaints" : "",
|
|
12442
|
+
g.symptoms.prolapse ? "prolapse" : ""
|
|
12443
|
+
]);
|
|
12444
|
+
return sym.length ? `Gynae symptoms: ${sym.join(", ")}` : "";
|
|
12445
|
+
}
|
|
12446
|
+
function formatObstetricBlock(rows) {
|
|
12447
|
+
if (!rows.length) return "";
|
|
12448
|
+
const summary = rows.map((r) => nonEmpty([r.year, r.ga, r.mode, r.babyOutcome]).join(" / ")).filter(Boolean).join("; ");
|
|
12449
|
+
return summary ? `Obstetric history (${rows.length}): ${summary}` : "";
|
|
12450
|
+
}
|
|
12451
|
+
function formatInfertilityBlock(i) {
|
|
12452
|
+
const bits = nonEmpty([
|
|
12453
|
+
i.type ? `${i.type} infertility` : "",
|
|
12454
|
+
i.durationMonths ? `${i.durationMonths} months` : "",
|
|
12455
|
+
i.female.pcosFeatures ? "PCOS features" : "",
|
|
12456
|
+
i.female.endometriosisSuspicion ? "endometriosis suspicion" : "",
|
|
12457
|
+
i.female.ovulation ? `ovulation: ${i.female.ovulation}` : "",
|
|
12458
|
+
i.male.semenAnalysis ? `semen: ${i.male.semenAnalysis}` : ""
|
|
12459
|
+
]);
|
|
12460
|
+
return bits.length ? `Infertility: ${bits.join(", ")}` : "";
|
|
12461
|
+
}
|
|
12462
|
+
function formatPostOpBlock(p) {
|
|
12463
|
+
const bits = nonEmpty([
|
|
12464
|
+
p.surgeryDate ? `op ${p.surgeryDate}` : "",
|
|
12465
|
+
p.procedure || "",
|
|
12466
|
+
p.woundStatus ? `wound ${p.woundStatus.toLowerCase()}` : "",
|
|
12467
|
+
p.painScore ? `pain ${p.painScore}/10` : "",
|
|
12468
|
+
p.complications ? `complications: ${p.complications}` : ""
|
|
12469
|
+
]);
|
|
12470
|
+
return bits.length ? `Post-op: ${bits.join(", ")}` : "";
|
|
12471
|
+
}
|
|
12472
|
+
var ZONE_FORMATTERS = {
|
|
12473
|
+
menstrual_reproductive: (v) => formatMenstrualBlock(v.menstrual),
|
|
12474
|
+
antenatal: (v) => formatAntenatalBlock(v.antenatal),
|
|
12475
|
+
gynaecological: (v) => formatGynaeBlock(v.gynae),
|
|
12476
|
+
obstetric: (v) => formatObstetricBlock(v.obstetric),
|
|
12477
|
+
infertility: (v) => formatInfertilityBlock(v.infertility),
|
|
12478
|
+
postoperative: (v) => formatPostOpBlock(v.postop)
|
|
12479
|
+
};
|
|
12480
|
+
function formatObgPathwayToSymptomsNarrative(v) {
|
|
12481
|
+
if (!v.zones.length) return "";
|
|
12482
|
+
const sections = [`Pathway: ${v.zones.map(obgZoneLabel).join(", ")}`];
|
|
12483
|
+
for (const z of v.zones) {
|
|
12484
|
+
const block = ZONE_FORMATTERS[z](v).trim();
|
|
12485
|
+
if (block) sections.push(block);
|
|
12486
|
+
}
|
|
12487
|
+
return sections.join("\n\n");
|
|
12488
|
+
}
|
|
12489
|
+
var CLINICAL_EXAMINATION_FIELD = "clinical_examination";
|
|
12490
|
+
var GENERAL_ROWS2 = [
|
|
12491
|
+
{ key: "pallor", label: "Pallor" },
|
|
12492
|
+
{ key: "oedema", label: "Oedema" },
|
|
12493
|
+
{ key: "thyroid", label: "Thyroid" },
|
|
12494
|
+
{ key: "hirsutism", label: "Hirsutism" },
|
|
12495
|
+
{ key: "acanthosis", label: "Acanthosis" }
|
|
12496
|
+
];
|
|
12497
|
+
var ABDOMEN_ROWS = [
|
|
12498
|
+
{ key: "surgicalScars", label: "Surgical scars" },
|
|
12499
|
+
{ key: "massTenderness", label: "Mass / tenderness" }
|
|
12500
|
+
];
|
|
12501
|
+
var BREAST_ROWS = [
|
|
12502
|
+
{ key: "lump", label: "Lump" },
|
|
12503
|
+
{ key: "nippleDischarge", label: "Nipple discharge" },
|
|
12504
|
+
{ key: "skinChanges", label: "Skin changes" },
|
|
12505
|
+
{ key: "axillaryNodes", label: "Axillary nodes" }
|
|
12506
|
+
];
|
|
12507
|
+
var PELVIC_ROWS = [
|
|
12508
|
+
{ key: "speculumDone", label: "Speculum done" },
|
|
12509
|
+
{ key: "discharge", label: "Discharge" },
|
|
12510
|
+
{ key: "cervicalErosion", label: "Cervical erosion" },
|
|
12511
|
+
{ key: "cervicalGrowth", label: "Cervical growth" },
|
|
12512
|
+
{ key: "activeBleeding", label: "Active bleeding" },
|
|
12513
|
+
{ key: "bimanualDone", label: "Bimanual done" },
|
|
12514
|
+
{ key: "adnexalMass", label: "Adnexal mass" },
|
|
12515
|
+
{ key: "cmt", label: "Cervical motion tenderness" }
|
|
12516
|
+
];
|
|
12517
|
+
var UTERUS_OPTIONS = [
|
|
12518
|
+
{ value: "", label: "\u2014" },
|
|
12519
|
+
{ value: "Normal", label: "Normal" },
|
|
12520
|
+
{ value: "Bulky", label: "Bulky" },
|
|
12521
|
+
{ value: "Enlarged", label: "Enlarged" }
|
|
12522
|
+
];
|
|
12523
|
+
var OBGExaminationWidget = ({ fieldId }) => {
|
|
12524
|
+
const { fieldDef, value, setValue, setTouched, error, touched, disabled } = useField(fieldId);
|
|
12525
|
+
const clinicalField = useField(CLINICAL_EXAMINATION_FIELD);
|
|
12526
|
+
const { state } = useForm();
|
|
12527
|
+
const showError = !!error && (touched || state.submitAttempted);
|
|
12528
|
+
const safe = useMemo(() => normalizeObgExamination(value), [value]);
|
|
12529
|
+
useEffect(() => {
|
|
12530
|
+
if (disabled) return;
|
|
12531
|
+
const norm = normalizeObgExamination(value);
|
|
12532
|
+
const next = formatObgExaminationToClinicalExamination(norm);
|
|
12533
|
+
clinicalField.setValue(next);
|
|
12534
|
+
if (norm.examinationNotes !== next) {
|
|
12535
|
+
setValue({ ...norm, examinationNotes: next });
|
|
12536
|
+
}
|
|
12537
|
+
}, [value, disabled]);
|
|
12538
|
+
const bump = (next) => {
|
|
12539
|
+
setValue(next);
|
|
12540
|
+
setTouched();
|
|
12541
|
+
};
|
|
12542
|
+
const toggleGeneral = (key) => bump({ ...safe, general: { ...safe.general, [key]: !safe.general[key] } });
|
|
12543
|
+
const toggleAbdomen = (key) => bump({ ...safe, abdomen: { ...safe.abdomen, [key]: !safe.abdomen[key] } });
|
|
12544
|
+
const toggleBreast = (key) => bump({ ...safe, breast: { ...safe.breast, [key]: !safe.breast[key] } });
|
|
12545
|
+
const togglePelvic = (key) => {
|
|
12546
|
+
const nextPelvic = { ...safe.pelvic, [key]: !safe.pelvic[key] };
|
|
12547
|
+
const nextUterus = !nextPelvic.bimanualDone ? "" : safe.uterusSize;
|
|
12548
|
+
bump({ ...safe, pelvic: nextPelvic, uterusSize: nextUterus });
|
|
12549
|
+
};
|
|
12550
|
+
const setUterusSize = (val) => bump({ ...safe, uterusSize: val });
|
|
12551
|
+
if (!fieldDef) return null;
|
|
12552
|
+
const theme = getThemeConfig("textarea", fieldDef.theme);
|
|
12553
|
+
const wrapperClass = theme?.wrapperClassName ?? "rounded-md overflow-hidden flex flex-col border border-[#D0D0D0]";
|
|
12554
|
+
const labelClass = theme?.labelClassName;
|
|
12555
|
+
const labelContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12556
|
+
fieldDef.label,
|
|
12557
|
+
fieldDef.required ? /* @__PURE__ */ jsx("span", { className: "ml-1 text-red-500", children: "*" }) : null
|
|
12558
|
+
] });
|
|
12559
|
+
const labelEl = theme ? /* @__PURE__ */ jsx(Label, { className: labelClass, children: labelContent }) : /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: labelContent });
|
|
12560
|
+
const bodyClass = cn(
|
|
12561
|
+
"-mt-1 flex min-w-0 flex-col gap-3 border-t border-[#D0D0D0] bg-white px-3 py-3",
|
|
12562
|
+
disabled && "pointer-events-none opacity-60"
|
|
12563
|
+
);
|
|
12564
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full min-w-0", wrapperClass), children: [
|
|
12565
|
+
labelEl,
|
|
12566
|
+
fieldDef.description ? /* @__PURE__ */ jsx("p", { className: "px-3 pt-2 text-[11px] text-muted-foreground", children: fieldDef.description }) : null,
|
|
12567
|
+
/* @__PURE__ */ jsxs("div", { className: bodyClass, children: [
|
|
12568
|
+
showError ? /* @__PURE__ */ jsx("p", { className: "text-xs text-red-600", children: error }) : null,
|
|
12569
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 text-xs md:grid-cols-2 xl:grid-cols-4", children: [
|
|
12570
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
12571
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-slate-800", children: "General" }),
|
|
12572
|
+
GENERAL_ROWS2.map((r) => /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [
|
|
12573
|
+
/* @__PURE__ */ jsx(
|
|
12574
|
+
Checkbox,
|
|
12575
|
+
{
|
|
12576
|
+
checked: safe.general[r.key],
|
|
12577
|
+
onCheckedChange: () => toggleGeneral(r.key),
|
|
12578
|
+
disabled
|
|
12579
|
+
}
|
|
12580
|
+
),
|
|
12581
|
+
r.label
|
|
12582
|
+
] }, r.key))
|
|
12583
|
+
] }),
|
|
12584
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
12585
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-slate-800", children: "Abdomen" }),
|
|
12586
|
+
ABDOMEN_ROWS.map((r) => /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [
|
|
12587
|
+
/* @__PURE__ */ jsx(
|
|
12588
|
+
Checkbox,
|
|
12589
|
+
{
|
|
12590
|
+
checked: safe.abdomen[r.key],
|
|
12591
|
+
onCheckedChange: () => toggleAbdomen(r.key),
|
|
12592
|
+
disabled
|
|
12593
|
+
}
|
|
12594
|
+
),
|
|
12595
|
+
r.label
|
|
12596
|
+
] }, r.key)),
|
|
12597
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground", children: "Pregnancy \u2192 fundal ht / FHR / lie captured in Antenatal pathway." })
|
|
12598
|
+
] }),
|
|
12599
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
12600
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-slate-800", children: "Breast" }),
|
|
12601
|
+
BREAST_ROWS.map((r) => /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [
|
|
12602
|
+
/* @__PURE__ */ jsx(
|
|
12603
|
+
Checkbox,
|
|
12604
|
+
{
|
|
12605
|
+
checked: safe.breast[r.key],
|
|
12606
|
+
onCheckedChange: () => toggleBreast(r.key),
|
|
12607
|
+
disabled
|
|
12608
|
+
}
|
|
12609
|
+
),
|
|
12610
|
+
r.label
|
|
12611
|
+
] }, r.key))
|
|
12612
|
+
] }),
|
|
12613
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
12614
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-slate-800", children: "Pelvic (consent applied)" }),
|
|
12615
|
+
PELVIC_ROWS.map((r) => /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [
|
|
12616
|
+
/* @__PURE__ */ jsx(
|
|
12617
|
+
Checkbox,
|
|
12618
|
+
{
|
|
12619
|
+
checked: safe.pelvic[r.key],
|
|
12620
|
+
onCheckedChange: () => togglePelvic(r.key),
|
|
12621
|
+
disabled
|
|
12622
|
+
}
|
|
12623
|
+
),
|
|
12624
|
+
r.label
|
|
12625
|
+
] }, r.key)),
|
|
12626
|
+
safe.pelvic.bimanualDone ? /* @__PURE__ */ jsxs("label", { className: "block pt-1", children: [
|
|
12627
|
+
/* @__PURE__ */ jsx("span", { className: "mb-1 block font-medium", children: "Uterus size (on bimanual)" }),
|
|
12628
|
+
/* @__PURE__ */ jsxs(
|
|
12629
|
+
Select,
|
|
12630
|
+
{
|
|
12631
|
+
value: safe.uterusSize === "" ? "none" : safe.uterusSize,
|
|
12632
|
+
onValueChange: (v) => setUterusSize(v === "none" ? "" : v),
|
|
12633
|
+
disabled,
|
|
12634
|
+
children: [
|
|
12635
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
12636
|
+
/* @__PURE__ */ jsx(SelectContent, { children: UTERUS_OPTIONS.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: opt.value === "" ? "none" : opt.value, children: opt.label }, opt.value || "none")) })
|
|
12637
|
+
]
|
|
12638
|
+
}
|
|
12639
|
+
)
|
|
12640
|
+
] }) : null
|
|
12641
|
+
] })
|
|
12642
|
+
] }),
|
|
12643
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 border-t border-[#D0D0D0] pt-3", children: [
|
|
12644
|
+
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: "Clinical examination" }),
|
|
12645
|
+
/* @__PURE__ */ jsx(
|
|
12646
|
+
Textarea,
|
|
12647
|
+
{
|
|
12648
|
+
value: formatObgExaminationToClinicalExamination(safe),
|
|
12649
|
+
readOnly: true,
|
|
12650
|
+
disabled,
|
|
12651
|
+
className: "min-h-[80px] text-xs",
|
|
12652
|
+
placeholder: "Derived from examination selections above."
|
|
12653
|
+
}
|
|
12654
|
+
)
|
|
12655
|
+
] })
|
|
12656
|
+
] })
|
|
12657
|
+
] });
|
|
12658
|
+
};
|
|
12659
|
+
var SYMPTOMS_FIELD2 = "symptoms";
|
|
12660
|
+
function Panel3({
|
|
12661
|
+
title,
|
|
12662
|
+
right,
|
|
12663
|
+
children
|
|
12664
|
+
}) {
|
|
12665
|
+
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-md border border-[#D0D0D0] bg-white", children: [
|
|
12666
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b border-[#D0D0D0] bg-[#FEE8EC]/50 px-3 py-1.5", children: [
|
|
12667
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-slate-700", children: title }),
|
|
12668
|
+
right
|
|
12669
|
+
] }),
|
|
12670
|
+
/* @__PURE__ */ jsx("div", { className: "p-3 text-xs", children })
|
|
12671
|
+
] });
|
|
12672
|
+
}
|
|
12673
|
+
function ChipRow({
|
|
12674
|
+
options,
|
|
12675
|
+
selected,
|
|
12676
|
+
onToggle,
|
|
12677
|
+
disabled
|
|
12678
|
+
}) {
|
|
12679
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: options.map((o) => {
|
|
12680
|
+
const on = !!selected[o.key];
|
|
12681
|
+
return /* @__PURE__ */ jsx(
|
|
12682
|
+
"button",
|
|
12683
|
+
{
|
|
12684
|
+
type: "button",
|
|
12685
|
+
onClick: () => onToggle(o.key),
|
|
12686
|
+
disabled,
|
|
12687
|
+
className: cn(
|
|
12688
|
+
"rounded-full border px-3 py-1 text-[11px] transition-colors",
|
|
12689
|
+
on ? "border-rose-500 bg-rose-50 text-rose-700" : "border-slate-300 bg-white text-slate-600 hover:bg-slate-50"
|
|
12690
|
+
),
|
|
12691
|
+
children: o.label
|
|
12692
|
+
},
|
|
12693
|
+
o.key
|
|
12694
|
+
);
|
|
12695
|
+
}) });
|
|
12696
|
+
}
|
|
12697
|
+
var OBGPathwayWidget = ({ fieldId }) => {
|
|
12698
|
+
const { fieldDef, value, setValue, setTouched, error, touched, disabled } = useField(fieldId);
|
|
12699
|
+
const symptomsField = useField(SYMPTOMS_FIELD2);
|
|
12700
|
+
const { state } = useForm();
|
|
12701
|
+
const showError = !!error && (touched || state.submitAttempted);
|
|
12702
|
+
const safe = useMemo(() => normalizeObgPathway(value), [value]);
|
|
12703
|
+
const prevZoneCountRef = useRef(0);
|
|
12704
|
+
useEffect(() => {
|
|
12705
|
+
if (disabled) return;
|
|
12706
|
+
const zoneCount = safe.zones.length;
|
|
12707
|
+
if (!zoneCount) {
|
|
12708
|
+
if (prevZoneCountRef.current > 0) {
|
|
12709
|
+
symptomsField.setValue("");
|
|
12710
|
+
}
|
|
12711
|
+
prevZoneCountRef.current = 0;
|
|
12712
|
+
return;
|
|
12713
|
+
}
|
|
12714
|
+
prevZoneCountRef.current = zoneCount;
|
|
12715
|
+
const next = formatObgPathwayToSymptomsNarrative(safe);
|
|
12716
|
+
if (typeof symptomsField.value !== "string" || symptomsField.value !== next) {
|
|
12717
|
+
symptomsField.setValue(next);
|
|
12718
|
+
}
|
|
12719
|
+
}, [safe, disabled]);
|
|
12720
|
+
const update = (next) => {
|
|
12721
|
+
setValue(next);
|
|
12722
|
+
setTouched();
|
|
12723
|
+
};
|
|
12724
|
+
if (!fieldDef) return null;
|
|
12725
|
+
const theme = getThemeConfig("textarea", fieldDef.theme);
|
|
12726
|
+
const wrapperClass = theme?.wrapperClassName ?? "rounded-md overflow-hidden flex flex-col border border-[#D0D0D0]";
|
|
12727
|
+
const labelClass = theme?.labelClassName;
|
|
12728
|
+
const labelContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12729
|
+
fieldDef.label,
|
|
12730
|
+
fieldDef.required ? /* @__PURE__ */ jsx("span", { className: "ml-1 text-red-500", children: "*" }) : null
|
|
12731
|
+
] });
|
|
12732
|
+
const labelEl = theme ? /* @__PURE__ */ jsx(Label, { className: labelClass, children: labelContent }) : /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: labelContent });
|
|
12733
|
+
const bodyClass = cn(
|
|
12734
|
+
"-mt-1 flex min-w-0 flex-col gap-3 border-t border-[#D0D0D0] bg-white px-3 py-3",
|
|
12735
|
+
disabled && "pointer-events-none opacity-60"
|
|
12736
|
+
);
|
|
12737
|
+
const hasZone = (z) => safe.zones.includes(z);
|
|
12738
|
+
const toggleZone = (z) => update({
|
|
12739
|
+
...safe,
|
|
12740
|
+
zones: hasZone(z) ? safe.zones.filter((x) => x !== z) : OBG_ZONE_ORDER.filter((x) => x === z || hasZone(x))
|
|
12741
|
+
});
|
|
12742
|
+
const m = safe.menstrual;
|
|
12743
|
+
const setMenstrual = (patch) => update({ ...safe, menstrual: { ...m, ...patch } });
|
|
12744
|
+
const a = safe.antenatal;
|
|
12745
|
+
const setAntenatal = (patch) => update({ ...safe, antenatal: { ...a, ...patch } });
|
|
12746
|
+
const setAntenatalSymptom = (key) => update({
|
|
12747
|
+
...safe,
|
|
12748
|
+
antenatal: { ...a, symptoms: { ...a.symptoms, [key]: !a.symptoms[key] } }
|
|
12749
|
+
});
|
|
12750
|
+
const setAntenatalExam = (patch) => update({ ...safe, antenatal: { ...a, exam: { ...a.exam, ...patch } } });
|
|
12751
|
+
const setAntenatalInv = (patch) => update({
|
|
12752
|
+
...safe,
|
|
12753
|
+
antenatal: { ...a, investigations: { ...a.investigations, ...patch } }
|
|
12754
|
+
});
|
|
12755
|
+
const gSym = safe.gynae.symptoms;
|
|
12756
|
+
const toggleGynae = (key) => update({ ...safe, gynae: { symptoms: { ...gSym, [key]: !gSym[key] } } });
|
|
12757
|
+
const setObstetric = (rows) => update({ ...safe, obstetric: rows });
|
|
12758
|
+
const addObstetricRow = () => setObstetric([
|
|
12759
|
+
...safe.obstetric,
|
|
12760
|
+
{ year: "", ga: "", mode: "", indicationLscs: "", babyOutcome: "", complications: "" }
|
|
12761
|
+
]);
|
|
12762
|
+
const updateObstetricRow = (idx, patch) => setObstetric(safe.obstetric.map((row, i) => i === idx ? { ...row, ...patch } : row));
|
|
12763
|
+
const deleteObstetricRow = (idx) => setObstetric(safe.obstetric.filter((_, i) => i !== idx));
|
|
12764
|
+
const inf = safe.infertility;
|
|
12765
|
+
const setInfertility = (patch) => update({ ...safe, infertility: { ...inf, ...patch } });
|
|
12766
|
+
const po = safe.postop;
|
|
12767
|
+
const setPostop = (patch) => update({ ...safe, postop: { ...po, ...patch } });
|
|
12768
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full min-w-0", wrapperClass), children: [
|
|
12769
|
+
labelEl,
|
|
12770
|
+
fieldDef.description ? /* @__PURE__ */ jsx("p", { className: "px-3 pt-2 text-[11px] text-muted-foreground", children: fieldDef.description }) : null,
|
|
12771
|
+
/* @__PURE__ */ jsxs("div", { className: bodyClass, children: [
|
|
12772
|
+
showError ? /* @__PURE__ */ jsx("p", { className: "text-xs text-red-600", children: error }) : null,
|
|
12773
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
12774
|
+
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: "Primary concern (Consultant zone \u2014 multi-select)" }),
|
|
12775
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: OBG_ZONE_ORDER.map((z) => {
|
|
12776
|
+
const on = hasZone(z);
|
|
12777
|
+
return /* @__PURE__ */ jsx(
|
|
12778
|
+
"button",
|
|
12779
|
+
{
|
|
12780
|
+
type: "button",
|
|
12781
|
+
onClick: () => toggleZone(z),
|
|
12782
|
+
disabled,
|
|
12783
|
+
"aria-pressed": on,
|
|
12784
|
+
className: cn(
|
|
12785
|
+
"rounded-full border px-3 py-1 text-[11px] transition-colors",
|
|
12786
|
+
on ? "border-rose-500 bg-rose-50 text-rose-700" : "border-slate-300 bg-white text-slate-600 hover:bg-slate-50"
|
|
12787
|
+
),
|
|
12788
|
+
children: obgZoneLabel(z)
|
|
12789
|
+
},
|
|
12790
|
+
z
|
|
12791
|
+
);
|
|
12792
|
+
}) })
|
|
12793
|
+
] }),
|
|
12794
|
+
hasZone("menstrual_reproductive") ? /* @__PURE__ */ jsx(Panel3, { title: "Menstrual & reproductive history", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-4", children: [
|
|
12795
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12796
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Menarche (age)" }),
|
|
12797
|
+
/* @__PURE__ */ jsx(
|
|
12798
|
+
Input,
|
|
12799
|
+
{
|
|
12800
|
+
type: "number",
|
|
12801
|
+
min: 5,
|
|
12802
|
+
max: 25,
|
|
12803
|
+
className: "h-8 text-xs",
|
|
12804
|
+
value: m.menarcheAge,
|
|
12805
|
+
onChange: (e) => setMenstrual({ menarcheAge: Number(e.target.value) || 0 }),
|
|
12806
|
+
disabled
|
|
12807
|
+
}
|
|
12808
|
+
)
|
|
12809
|
+
] }),
|
|
12810
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12811
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Cycle (days)" }),
|
|
12812
|
+
/* @__PURE__ */ jsx(
|
|
12813
|
+
Input,
|
|
12814
|
+
{
|
|
12815
|
+
type: "number",
|
|
12816
|
+
min: 0,
|
|
12817
|
+
max: 120,
|
|
12818
|
+
className: "h-8 text-xs",
|
|
12819
|
+
value: m.cycleLength,
|
|
12820
|
+
onChange: (e) => setMenstrual({ cycleLength: Number(e.target.value) || 0 }),
|
|
12821
|
+
disabled
|
|
12822
|
+
}
|
|
12823
|
+
)
|
|
12824
|
+
] }),
|
|
12825
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12826
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Flow (days)" }),
|
|
12827
|
+
/* @__PURE__ */ jsx(
|
|
12828
|
+
Input,
|
|
12829
|
+
{
|
|
12830
|
+
type: "number",
|
|
12831
|
+
min: 0,
|
|
12832
|
+
max: 30,
|
|
12833
|
+
className: "h-8 text-xs",
|
|
12834
|
+
value: m.flowDays,
|
|
12835
|
+
onChange: (e) => setMenstrual({ flowDays: Number(e.target.value) || 0 }),
|
|
12836
|
+
disabled
|
|
12837
|
+
}
|
|
12838
|
+
)
|
|
12839
|
+
] }),
|
|
12840
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-end gap-2 pb-1", children: [
|
|
12841
|
+
/* @__PURE__ */ jsx(
|
|
12842
|
+
Checkbox,
|
|
12843
|
+
{
|
|
12844
|
+
checked: m.cycleRegular,
|
|
12845
|
+
onCheckedChange: (c) => setMenstrual({ cycleRegular: c === true }),
|
|
12846
|
+
disabled
|
|
12847
|
+
}
|
|
12848
|
+
),
|
|
12849
|
+
/* @__PURE__ */ jsx("span", { children: "Regular cycle" })
|
|
12850
|
+
] }),
|
|
12851
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12852
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Amount of flow" }),
|
|
12853
|
+
/* @__PURE__ */ jsxs(
|
|
12854
|
+
Select,
|
|
12855
|
+
{
|
|
12856
|
+
value: m.amount === "" ? "none" : m.amount,
|
|
12857
|
+
onValueChange: (v) => setMenstrual({ amount: v === "none" ? "" : v }),
|
|
12858
|
+
disabled,
|
|
12859
|
+
children: [
|
|
12860
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
12861
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
12862
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
12863
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Scanty", children: "Scanty" }),
|
|
12864
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Normal", children: "Normal" }),
|
|
12865
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Heavy", children: "Heavy" })
|
|
12866
|
+
] })
|
|
12867
|
+
]
|
|
12868
|
+
}
|
|
12869
|
+
)
|
|
12870
|
+
] }),
|
|
12871
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12872
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Dysmenorrhea" }),
|
|
12873
|
+
/* @__PURE__ */ jsxs(
|
|
12874
|
+
Select,
|
|
12875
|
+
{
|
|
12876
|
+
value: String(m.dysmenorrhea),
|
|
12877
|
+
onValueChange: (v) => setMenstrual({ dysmenorrhea: Number(v) ?? 0 }),
|
|
12878
|
+
disabled,
|
|
12879
|
+
children: [
|
|
12880
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "0" }) }),
|
|
12881
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
12882
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "0", children: "0 \u2014 none" }),
|
|
12883
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "1", children: "1 \u2014 mild" }),
|
|
12884
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "2", children: "2 \u2014 moderate" }),
|
|
12885
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "3", children: "3 \u2014 severe" })
|
|
12886
|
+
] })
|
|
12887
|
+
]
|
|
12888
|
+
}
|
|
12889
|
+
)
|
|
12890
|
+
] }),
|
|
12891
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12892
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "LMP" }),
|
|
12893
|
+
/* @__PURE__ */ jsx(
|
|
12894
|
+
Input,
|
|
12895
|
+
{
|
|
12896
|
+
type: "date",
|
|
12897
|
+
className: "h-8 text-xs",
|
|
12898
|
+
value: m.lmp,
|
|
12899
|
+
onChange: (e) => setMenstrual({ lmp: e.target.value }),
|
|
12900
|
+
disabled
|
|
12901
|
+
}
|
|
12902
|
+
)
|
|
12903
|
+
] }),
|
|
12904
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12905
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Menopause status" }),
|
|
12906
|
+
/* @__PURE__ */ jsxs(
|
|
12907
|
+
Select,
|
|
12908
|
+
{
|
|
12909
|
+
value: m.menopauseStatus === "" ? "none" : m.menopauseStatus,
|
|
12910
|
+
onValueChange: (v) => setMenstrual({
|
|
12911
|
+
menopauseStatus: v === "none" ? "" : v
|
|
12912
|
+
}),
|
|
12913
|
+
disabled,
|
|
12914
|
+
children: [
|
|
12915
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
12916
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
12917
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
12918
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Pre", children: "Pre" }),
|
|
12919
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Peri", children: "Peri" }),
|
|
12920
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Post", children: "Post" })
|
|
12921
|
+
] })
|
|
12922
|
+
]
|
|
12923
|
+
}
|
|
12924
|
+
)
|
|
12925
|
+
] })
|
|
12926
|
+
] }) }) : null,
|
|
12927
|
+
hasZone("antenatal") ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
12928
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Current pregnancy details", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-4", children: [
|
|
12929
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
12930
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Gravida" }),
|
|
12931
|
+
/* @__PURE__ */ jsx(
|
|
12932
|
+
Input,
|
|
12933
|
+
{
|
|
12934
|
+
type: "number",
|
|
12935
|
+
min: 0,
|
|
12936
|
+
className: "h-8 text-xs",
|
|
12937
|
+
value: a.gravida,
|
|
12938
|
+
onChange: (e) => setAntenatal({ gravida: Number(e.target.value) || 0 }),
|
|
12939
|
+
disabled
|
|
12940
|
+
}
|
|
12941
|
+
)
|
|
12942
|
+
] }),
|
|
12943
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
12944
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "GA (LMP) \u2014 w / d" }),
|
|
12945
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
12946
|
+
/* @__PURE__ */ jsx(
|
|
12947
|
+
Input,
|
|
12948
|
+
{
|
|
12949
|
+
type: "number",
|
|
12950
|
+
min: 0,
|
|
12951
|
+
max: 45,
|
|
12952
|
+
className: "h-8 text-xs",
|
|
12953
|
+
value: a.gaWeeksLmp,
|
|
12954
|
+
onChange: (e) => setAntenatal({ gaWeeksLmp: Number(e.target.value) || 0 }),
|
|
12955
|
+
disabled
|
|
12956
|
+
}
|
|
12957
|
+
),
|
|
12958
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: "w" }),
|
|
12959
|
+
/* @__PURE__ */ jsx(
|
|
12960
|
+
Input,
|
|
12961
|
+
{
|
|
12962
|
+
type: "number",
|
|
12963
|
+
min: 0,
|
|
12964
|
+
max: 6,
|
|
12965
|
+
className: "h-8 text-xs",
|
|
12966
|
+
value: a.gaDaysLmp,
|
|
12967
|
+
onChange: (e) => setAntenatal({ gaDaysLmp: Number(e.target.value) || 0 }),
|
|
12968
|
+
disabled
|
|
12969
|
+
}
|
|
12970
|
+
),
|
|
12971
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: "d" })
|
|
12972
|
+
] })
|
|
12973
|
+
] }),
|
|
12974
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
12975
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "GA (USG) \u2014 w / d" }),
|
|
12976
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
12977
|
+
/* @__PURE__ */ jsx(
|
|
12978
|
+
Input,
|
|
12979
|
+
{
|
|
12980
|
+
type: "number",
|
|
12981
|
+
min: 0,
|
|
12982
|
+
max: 45,
|
|
12983
|
+
className: "h-8 text-xs",
|
|
12984
|
+
value: a.gaWeeksUsg,
|
|
12985
|
+
onChange: (e) => setAntenatal({ gaWeeksUsg: Number(e.target.value) || 0 }),
|
|
12986
|
+
disabled
|
|
12987
|
+
}
|
|
12988
|
+
),
|
|
12989
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: "w" }),
|
|
12990
|
+
/* @__PURE__ */ jsx(
|
|
12991
|
+
Input,
|
|
12992
|
+
{
|
|
12993
|
+
type: "number",
|
|
12994
|
+
min: 0,
|
|
12995
|
+
max: 6,
|
|
12996
|
+
className: "h-8 text-xs",
|
|
12997
|
+
value: a.gaDaysUsg,
|
|
12998
|
+
onChange: (e) => setAntenatal({ gaDaysUsg: Number(e.target.value) || 0 }),
|
|
12999
|
+
disabled
|
|
13000
|
+
}
|
|
13001
|
+
),
|
|
13002
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: "d" })
|
|
13003
|
+
] })
|
|
13004
|
+
] }),
|
|
13005
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13006
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "EDD" }),
|
|
13007
|
+
/* @__PURE__ */ jsx(
|
|
13008
|
+
Input,
|
|
13009
|
+
{
|
|
13010
|
+
type: "date",
|
|
13011
|
+
className: "h-8 text-xs",
|
|
13012
|
+
value: a.edd,
|
|
13013
|
+
onChange: (e) => setAntenatal({ edd: e.target.value }),
|
|
13014
|
+
disabled
|
|
13015
|
+
}
|
|
13016
|
+
)
|
|
13017
|
+
] }),
|
|
13018
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1 md:col-span-2", children: [
|
|
13019
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Risk category" }),
|
|
13020
|
+
/* @__PURE__ */ jsxs(
|
|
13021
|
+
Select,
|
|
13022
|
+
{
|
|
13023
|
+
value: a.riskCategory === "" ? "none" : a.riskCategory,
|
|
13024
|
+
onValueChange: (v) => setAntenatal({
|
|
13025
|
+
riskCategory: v === "none" ? "" : v
|
|
13026
|
+
}),
|
|
13027
|
+
disabled,
|
|
13028
|
+
children: [
|
|
13029
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13030
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13031
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13032
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Low", children: "Low" }),
|
|
13033
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "High", children: "High" })
|
|
13034
|
+
] })
|
|
13035
|
+
]
|
|
13036
|
+
}
|
|
13037
|
+
)
|
|
13038
|
+
] })
|
|
13039
|
+
] }) }),
|
|
13040
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Antenatal symptoms", children: /* @__PURE__ */ jsx(
|
|
13041
|
+
ChipRow,
|
|
13042
|
+
{
|
|
13043
|
+
options: [
|
|
13044
|
+
{ key: "nauseaVomiting", label: "Nausea / vomiting" },
|
|
13045
|
+
{ key: "bleedingPV", label: "Bleeding PV" },
|
|
13046
|
+
{ key: "painAbdomen", label: "Pain abdomen" },
|
|
13047
|
+
{ key: "decreasedFetalMovements", label: "Decreased fetal movements" }
|
|
13048
|
+
],
|
|
13049
|
+
selected: a.symptoms,
|
|
13050
|
+
onToggle: (k) => setAntenatalSymptom(k),
|
|
13051
|
+
disabled
|
|
13052
|
+
}
|
|
13053
|
+
) }),
|
|
13054
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Antenatal examination", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-4", children: [
|
|
13055
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13056
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Weight (kg)" }),
|
|
13057
|
+
/* @__PURE__ */ jsx(
|
|
13058
|
+
Input,
|
|
13059
|
+
{
|
|
13060
|
+
type: "number",
|
|
13061
|
+
className: "h-8 text-xs",
|
|
13062
|
+
value: a.exam.weightKg,
|
|
13063
|
+
onChange: (e) => setAntenatalExam({ weightKg: Number(e.target.value) || 0 }),
|
|
13064
|
+
disabled
|
|
13065
|
+
}
|
|
13066
|
+
)
|
|
13067
|
+
] }),
|
|
13068
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13069
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Height (cm)" }),
|
|
13070
|
+
/* @__PURE__ */ jsx(
|
|
13071
|
+
Input,
|
|
13072
|
+
{
|
|
13073
|
+
type: "number",
|
|
13074
|
+
className: "h-8 text-xs",
|
|
13075
|
+
value: a.exam.heightCm,
|
|
13076
|
+
onChange: (e) => setAntenatalExam({ heightCm: Number(e.target.value) || 0 }),
|
|
13077
|
+
disabled
|
|
13078
|
+
}
|
|
13079
|
+
)
|
|
13080
|
+
] }),
|
|
13081
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13082
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "BMI" }),
|
|
13083
|
+
/* @__PURE__ */ jsx(
|
|
13084
|
+
Input,
|
|
13085
|
+
{
|
|
13086
|
+
type: "number",
|
|
13087
|
+
step: 0.1,
|
|
13088
|
+
className: "h-8 text-xs",
|
|
13089
|
+
value: a.exam.bmi,
|
|
13090
|
+
onChange: (e) => setAntenatalExam({ bmi: Number(e.target.value) || 0 }),
|
|
13091
|
+
disabled
|
|
13092
|
+
}
|
|
13093
|
+
)
|
|
13094
|
+
] }),
|
|
13095
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13096
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "BP" }),
|
|
13097
|
+
/* @__PURE__ */ jsx(
|
|
13098
|
+
Input,
|
|
13099
|
+
{
|
|
13100
|
+
placeholder: "e.g. 120/80",
|
|
13101
|
+
className: "h-8 text-xs",
|
|
13102
|
+
value: a.exam.bp,
|
|
13103
|
+
onChange: (e) => setAntenatalExam({ bp: e.target.value }),
|
|
13104
|
+
disabled
|
|
13105
|
+
}
|
|
13106
|
+
)
|
|
13107
|
+
] }),
|
|
13108
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-end gap-2 pb-1", children: [
|
|
13109
|
+
/* @__PURE__ */ jsx(
|
|
13110
|
+
Checkbox,
|
|
13111
|
+
{
|
|
13112
|
+
checked: a.exam.pallor,
|
|
13113
|
+
onCheckedChange: (c) => setAntenatalExam({ pallor: c === true }),
|
|
13114
|
+
disabled
|
|
13115
|
+
}
|
|
13116
|
+
),
|
|
13117
|
+
/* @__PURE__ */ jsx("span", { children: "Pallor" })
|
|
13118
|
+
] }),
|
|
13119
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-end gap-2 pb-1", children: [
|
|
13120
|
+
/* @__PURE__ */ jsx(
|
|
13121
|
+
Checkbox,
|
|
13122
|
+
{
|
|
13123
|
+
checked: a.exam.oedema,
|
|
13124
|
+
onCheckedChange: (c) => setAntenatalExam({ oedema: c === true }),
|
|
13125
|
+
disabled
|
|
13126
|
+
}
|
|
13127
|
+
),
|
|
13128
|
+
/* @__PURE__ */ jsx("span", { children: "Oedema" })
|
|
13129
|
+
] }),
|
|
13130
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13131
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Fundal height (cm)" }),
|
|
13132
|
+
/* @__PURE__ */ jsx(
|
|
13133
|
+
Input,
|
|
13134
|
+
{
|
|
13135
|
+
type: "number",
|
|
13136
|
+
className: "h-8 text-xs",
|
|
13137
|
+
value: a.exam.fundalHeightCm,
|
|
13138
|
+
onChange: (e) => setAntenatalExam({ fundalHeightCm: Number(e.target.value) || 0 }),
|
|
13139
|
+
disabled
|
|
13140
|
+
}
|
|
13141
|
+
)
|
|
13142
|
+
] }),
|
|
13143
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13144
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "FHR (bpm)" }),
|
|
13145
|
+
/* @__PURE__ */ jsx(
|
|
13146
|
+
Input,
|
|
13147
|
+
{
|
|
13148
|
+
type: "number",
|
|
13149
|
+
className: "h-8 text-xs",
|
|
13150
|
+
value: a.exam.fhrBpm,
|
|
13151
|
+
onChange: (e) => setAntenatalExam({ fhrBpm: Number(e.target.value) || 0 }),
|
|
13152
|
+
disabled
|
|
13153
|
+
}
|
|
13154
|
+
)
|
|
13155
|
+
] }),
|
|
13156
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13157
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Presentation" }),
|
|
13158
|
+
/* @__PURE__ */ jsxs(
|
|
13159
|
+
Select,
|
|
13160
|
+
{
|
|
13161
|
+
value: a.exam.presentation === "" ? "none" : a.exam.presentation,
|
|
13162
|
+
onValueChange: (v) => setAntenatalExam({
|
|
13163
|
+
presentation: v === "none" ? "" : v
|
|
13164
|
+
}),
|
|
13165
|
+
disabled,
|
|
13166
|
+
children: [
|
|
13167
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13168
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13169
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13170
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Cephalic", children: "Cephalic" }),
|
|
13171
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Breech", children: "Breech" }),
|
|
13172
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Other", children: "Other" })
|
|
13173
|
+
] })
|
|
13174
|
+
]
|
|
13175
|
+
}
|
|
13176
|
+
)
|
|
13177
|
+
] }),
|
|
13178
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13179
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Lie" }),
|
|
13180
|
+
/* @__PURE__ */ jsxs(
|
|
13181
|
+
Select,
|
|
13182
|
+
{
|
|
13183
|
+
value: a.exam.lie === "" ? "none" : a.exam.lie,
|
|
13184
|
+
onValueChange: (v) => setAntenatalExam({ lie: v === "none" ? "" : v }),
|
|
13185
|
+
disabled,
|
|
13186
|
+
children: [
|
|
13187
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13188
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13189
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13190
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Longitudinal", children: "Longitudinal" }),
|
|
13191
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Transverse", children: "Transverse" }),
|
|
13192
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Oblique", children: "Oblique" })
|
|
13193
|
+
] })
|
|
13194
|
+
]
|
|
13195
|
+
}
|
|
13196
|
+
)
|
|
13197
|
+
] })
|
|
13198
|
+
] }) }),
|
|
13199
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Investigations tracker", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", children: [
|
|
13200
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13201
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Blood Group / Rh" }),
|
|
13202
|
+
/* @__PURE__ */ jsx(
|
|
13203
|
+
Input,
|
|
13204
|
+
{
|
|
13205
|
+
className: "h-8 text-xs",
|
|
13206
|
+
placeholder: "e.g. O+ve",
|
|
13207
|
+
value: a.investigations.bloodGroup,
|
|
13208
|
+
onChange: (e) => setAntenatalInv({ bloodGroup: e.target.value }),
|
|
13209
|
+
disabled
|
|
13210
|
+
}
|
|
13211
|
+
)
|
|
13212
|
+
] }),
|
|
13213
|
+
[
|
|
13214
|
+
{ key: "cbc", label: "CBC" },
|
|
13215
|
+
{ key: "tsh", label: "TSH" },
|
|
13216
|
+
{ key: "rbsOgtt", label: "RBS / OGTT" },
|
|
13217
|
+
{ key: "serology", label: "HIV / HBsAg / VDRL" },
|
|
13218
|
+
{ key: "urine", label: "Urine routine" }
|
|
13219
|
+
].map((row) => /* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13220
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: row.label }),
|
|
13221
|
+
/* @__PURE__ */ jsxs(
|
|
13222
|
+
Select,
|
|
13223
|
+
{
|
|
13224
|
+
value: a.investigations[row.key] === "" ? "none" : a.investigations[row.key],
|
|
13225
|
+
onValueChange: (v) => setAntenatalInv({
|
|
13226
|
+
[row.key]: v === "none" ? "" : v
|
|
13227
|
+
}),
|
|
13228
|
+
disabled,
|
|
13229
|
+
children: [
|
|
13230
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13231
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13232
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13233
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Done", children: "Done" }),
|
|
13234
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Pending", children: "Pending" }),
|
|
13235
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Abnormal", children: "Abnormal" })
|
|
13236
|
+
] })
|
|
13237
|
+
]
|
|
13238
|
+
}
|
|
13239
|
+
)
|
|
13240
|
+
] }, row.key)),
|
|
13241
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13242
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "USG" }),
|
|
13243
|
+
/* @__PURE__ */ jsxs(
|
|
13244
|
+
Select,
|
|
13245
|
+
{
|
|
13246
|
+
value: a.investigations.usg === "" ? "none" : a.investigations.usg,
|
|
13247
|
+
onValueChange: (v) => setAntenatalInv({
|
|
13248
|
+
usg: v === "none" ? "" : v
|
|
13249
|
+
}),
|
|
13250
|
+
disabled,
|
|
13251
|
+
children: [
|
|
13252
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13253
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13254
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13255
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Dating", children: "Dating" }),
|
|
13256
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "NT", children: "NT" }),
|
|
13257
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Anomaly", children: "Anomaly" }),
|
|
13258
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Growth", children: "Growth" }),
|
|
13259
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Pending", children: "Pending" })
|
|
13260
|
+
] })
|
|
13261
|
+
]
|
|
13262
|
+
}
|
|
13263
|
+
)
|
|
13264
|
+
] })
|
|
13265
|
+
] }) })
|
|
13266
|
+
] }) : null,
|
|
13267
|
+
hasZone("gynaecological") ? /* @__PURE__ */ jsx(Panel3, { title: "Gynaecological symptoms", children: /* @__PURE__ */ jsx(
|
|
13268
|
+
ChipRow,
|
|
13269
|
+
{
|
|
13270
|
+
options: [
|
|
13271
|
+
{ key: "aub", label: "Abnormal uterine bleeding" },
|
|
13272
|
+
{ key: "whiteDischarge", label: "White discharge" },
|
|
13273
|
+
{ key: "pelvicPain", label: "Pelvic pain" },
|
|
13274
|
+
{ key: "dyspareunia", label: "Dyspareunia" },
|
|
13275
|
+
{ key: "urinaryComplaints", label: "Urinary complaints" },
|
|
13276
|
+
{ key: "prolapse", label: "Prolapse" }
|
|
13277
|
+
],
|
|
13278
|
+
selected: gSym,
|
|
13279
|
+
onToggle: (k) => toggleGynae(k),
|
|
13280
|
+
disabled
|
|
13281
|
+
}
|
|
13282
|
+
) }) : null,
|
|
13283
|
+
hasZone("obstetric") ? /* @__PURE__ */ jsx(
|
|
13284
|
+
Panel3,
|
|
13285
|
+
{
|
|
13286
|
+
title: "Obstetric history (G-P-A-L)",
|
|
13287
|
+
right: /* @__PURE__ */ jsx(
|
|
13288
|
+
Button,
|
|
13289
|
+
{
|
|
13290
|
+
type: "button",
|
|
13291
|
+
size: "sm",
|
|
13292
|
+
variant: "outline",
|
|
13293
|
+
className: "h-7 text-xs",
|
|
13294
|
+
onClick: addObstetricRow,
|
|
13295
|
+
disabled,
|
|
13296
|
+
children: "+ Add row"
|
|
13297
|
+
}
|
|
13298
|
+
),
|
|
13299
|
+
children: safe.obstetric.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: "No prior pregnancies recorded." }) : /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-[11px]", children: [
|
|
13300
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "bg-slate-50 text-left text-slate-600", children: [
|
|
13301
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5 font-medium", children: "Year" }),
|
|
13302
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5 font-medium", children: "GA" }),
|
|
13303
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5 font-medium", children: "Mode" }),
|
|
13304
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5 font-medium", children: "LSCS indication" }),
|
|
13305
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5 font-medium", children: "Baby outcome" }),
|
|
13306
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5 font-medium", children: "Complications" }),
|
|
13307
|
+
/* @__PURE__ */ jsx("th", { className: "p-1.5" })
|
|
13308
|
+
] }) }),
|
|
13309
|
+
/* @__PURE__ */ jsx("tbody", { children: safe.obstetric.map((row, idx) => /* @__PURE__ */ jsxs("tr", { className: "border-t", children: [
|
|
13310
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsx(
|
|
13311
|
+
Input,
|
|
13312
|
+
{
|
|
13313
|
+
className: "h-7 text-[11px]",
|
|
13314
|
+
value: row.year,
|
|
13315
|
+
onChange: (e) => updateObstetricRow(idx, { year: e.target.value }),
|
|
13316
|
+
disabled
|
|
13317
|
+
}
|
|
13318
|
+
) }),
|
|
13319
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsx(
|
|
13320
|
+
Input,
|
|
13321
|
+
{
|
|
13322
|
+
className: "h-7 text-[11px]",
|
|
13323
|
+
value: row.ga,
|
|
13324
|
+
onChange: (e) => updateObstetricRow(idx, { ga: e.target.value }),
|
|
13325
|
+
disabled
|
|
13326
|
+
}
|
|
13327
|
+
) }),
|
|
13328
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsxs(
|
|
13329
|
+
Select,
|
|
13330
|
+
{
|
|
13331
|
+
value: row.mode === "" ? "none" : row.mode,
|
|
13332
|
+
onValueChange: (v) => updateObstetricRow(idx, {
|
|
13333
|
+
mode: v === "none" ? "" : v
|
|
13334
|
+
}),
|
|
13335
|
+
disabled,
|
|
13336
|
+
children: [
|
|
13337
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-7 text-[11px]", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13338
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13339
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13340
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "NVD", children: "NVD" }),
|
|
13341
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "LSCS", children: "LSCS" }),
|
|
13342
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Instrumental", children: "Instrumental" }),
|
|
13343
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Abortion", children: "Abortion" }),
|
|
13344
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Stillbirth", children: "Stillbirth" })
|
|
13345
|
+
] })
|
|
13346
|
+
]
|
|
13347
|
+
}
|
|
13348
|
+
) }),
|
|
13349
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsx(
|
|
13350
|
+
Input,
|
|
13351
|
+
{
|
|
13352
|
+
className: "h-7 text-[11px]",
|
|
13353
|
+
value: row.indicationLscs,
|
|
13354
|
+
onChange: (e) => updateObstetricRow(idx, { indicationLscs: e.target.value }),
|
|
13355
|
+
disabled
|
|
13356
|
+
}
|
|
13357
|
+
) }),
|
|
13358
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsx(
|
|
13359
|
+
Input,
|
|
13360
|
+
{
|
|
13361
|
+
className: "h-7 text-[11px]",
|
|
13362
|
+
value: row.babyOutcome,
|
|
13363
|
+
onChange: (e) => updateObstetricRow(idx, { babyOutcome: e.target.value }),
|
|
13364
|
+
disabled
|
|
13365
|
+
}
|
|
13366
|
+
) }),
|
|
13367
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsx(
|
|
13368
|
+
Input,
|
|
13369
|
+
{
|
|
13370
|
+
className: "h-7 text-[11px]",
|
|
13371
|
+
placeholder: "PIH, GDM, PPH, NICU\u2026",
|
|
13372
|
+
value: row.complications,
|
|
13373
|
+
onChange: (e) => updateObstetricRow(idx, { complications: e.target.value }),
|
|
13374
|
+
disabled
|
|
13375
|
+
}
|
|
13376
|
+
) }),
|
|
13377
|
+
/* @__PURE__ */ jsx("td", { className: "p-1", children: /* @__PURE__ */ jsx(
|
|
13378
|
+
Button,
|
|
13379
|
+
{
|
|
13380
|
+
type: "button",
|
|
13381
|
+
size: "sm",
|
|
13382
|
+
variant: "ghost",
|
|
13383
|
+
className: "h-7 text-[11px] text-rose-600 hover:bg-rose-50",
|
|
13384
|
+
onClick: () => deleteObstetricRow(idx),
|
|
13385
|
+
disabled,
|
|
13386
|
+
children: "\xD7"
|
|
13387
|
+
}
|
|
13388
|
+
) })
|
|
13389
|
+
] }, idx)) })
|
|
13390
|
+
] }) })
|
|
13391
|
+
}
|
|
13392
|
+
) : null,
|
|
13393
|
+
hasZone("infertility") ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
13394
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Infertility profile", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", children: [
|
|
13395
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13396
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Type" }),
|
|
13397
|
+
/* @__PURE__ */ jsxs(
|
|
13398
|
+
Select,
|
|
13399
|
+
{
|
|
13400
|
+
value: inf.type === "" ? "none" : inf.type,
|
|
13401
|
+
onValueChange: (v) => setInfertility({ type: v === "none" ? "" : v }),
|
|
13402
|
+
disabled,
|
|
13403
|
+
children: [
|
|
13404
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13405
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13406
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13407
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Primary", children: "Primary" }),
|
|
13408
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Secondary", children: "Secondary" })
|
|
13409
|
+
] })
|
|
13410
|
+
]
|
|
13411
|
+
}
|
|
13412
|
+
)
|
|
13413
|
+
] }),
|
|
13414
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13415
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Duration (months)" }),
|
|
13416
|
+
/* @__PURE__ */ jsx(
|
|
13417
|
+
Input,
|
|
13418
|
+
{
|
|
13419
|
+
type: "number",
|
|
13420
|
+
min: 0,
|
|
13421
|
+
className: "h-8 text-xs",
|
|
13422
|
+
value: inf.durationMonths,
|
|
13423
|
+
onChange: (e) => setInfertility({ durationMonths: Number(e.target.value) || 0 }),
|
|
13424
|
+
disabled
|
|
13425
|
+
}
|
|
13426
|
+
)
|
|
13427
|
+
] }),
|
|
13428
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1 md:col-span-1", children: [
|
|
13429
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Previous treatments" }),
|
|
13430
|
+
/* @__PURE__ */ jsx(
|
|
13431
|
+
Input,
|
|
13432
|
+
{
|
|
13433
|
+
className: "h-8 text-xs",
|
|
13434
|
+
placeholder: "IUI \xD72, OI cycles\u2026",
|
|
13435
|
+
value: inf.previousTreatments,
|
|
13436
|
+
onChange: (e) => setInfertility({ previousTreatments: e.target.value }),
|
|
13437
|
+
disabled
|
|
13438
|
+
}
|
|
13439
|
+
)
|
|
13440
|
+
] })
|
|
13441
|
+
] }) }),
|
|
13442
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Female partner evaluation", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", children: [
|
|
13443
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13444
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Ovulation status" }),
|
|
13445
|
+
/* @__PURE__ */ jsxs(
|
|
13446
|
+
Select,
|
|
13447
|
+
{
|
|
13448
|
+
value: inf.female.ovulation === "" ? "none" : inf.female.ovulation,
|
|
13449
|
+
onValueChange: (v) => setInfertility({
|
|
13450
|
+
female: {
|
|
13451
|
+
...inf.female,
|
|
13452
|
+
ovulation: v === "none" ? "" : v
|
|
13453
|
+
}
|
|
13454
|
+
}),
|
|
13455
|
+
disabled,
|
|
13456
|
+
children: [
|
|
13457
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13458
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13459
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13460
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Ovulatory", children: "Ovulatory" }),
|
|
13461
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Anovulatory", children: "Anovulatory" }),
|
|
13462
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Unknown", children: "Unknown" })
|
|
13463
|
+
] })
|
|
13464
|
+
]
|
|
13465
|
+
}
|
|
13466
|
+
)
|
|
13467
|
+
] }),
|
|
13468
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-end gap-2 pb-1", children: [
|
|
13469
|
+
/* @__PURE__ */ jsx(
|
|
13470
|
+
Checkbox,
|
|
13471
|
+
{
|
|
13472
|
+
checked: inf.female.pcosFeatures,
|
|
13473
|
+
onCheckedChange: (c) => setInfertility({
|
|
13474
|
+
female: { ...inf.female, pcosFeatures: c === true }
|
|
13475
|
+
}),
|
|
13476
|
+
disabled
|
|
13477
|
+
}
|
|
13478
|
+
),
|
|
13479
|
+
/* @__PURE__ */ jsx("span", { children: "PCOS features" })
|
|
13480
|
+
] }),
|
|
13481
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-end gap-2 pb-1", children: [
|
|
13482
|
+
/* @__PURE__ */ jsx(
|
|
13483
|
+
Checkbox,
|
|
13484
|
+
{
|
|
13485
|
+
checked: inf.female.endometriosisSuspicion,
|
|
13486
|
+
onCheckedChange: (c) => setInfertility({
|
|
13487
|
+
female: { ...inf.female, endometriosisSuspicion: c === true }
|
|
13488
|
+
}),
|
|
13489
|
+
disabled
|
|
13490
|
+
}
|
|
13491
|
+
),
|
|
13492
|
+
/* @__PURE__ */ jsx("span", { children: "Endometriosis suspicion" })
|
|
13493
|
+
] })
|
|
13494
|
+
] }) }),
|
|
13495
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Male partner details", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", children: [
|
|
13496
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13497
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Age" }),
|
|
13498
|
+
/* @__PURE__ */ jsx(
|
|
13499
|
+
Input,
|
|
13500
|
+
{
|
|
13501
|
+
type: "number",
|
|
13502
|
+
min: 0,
|
|
13503
|
+
className: "h-8 text-xs",
|
|
13504
|
+
value: inf.male.age,
|
|
13505
|
+
onChange: (e) => setInfertility({ male: { ...inf.male, age: Number(e.target.value) || 0 } }),
|
|
13506
|
+
disabled
|
|
13507
|
+
}
|
|
13508
|
+
)
|
|
13509
|
+
] }),
|
|
13510
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13511
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Semen analysis" }),
|
|
13512
|
+
/* @__PURE__ */ jsxs(
|
|
13513
|
+
Select,
|
|
13514
|
+
{
|
|
13515
|
+
value: inf.male.semenAnalysis === "" ? "none" : inf.male.semenAnalysis,
|
|
13516
|
+
onValueChange: (v) => setInfertility({
|
|
13517
|
+
male: {
|
|
13518
|
+
...inf.male,
|
|
13519
|
+
semenAnalysis: v === "none" ? "" : v
|
|
13520
|
+
}
|
|
13521
|
+
}),
|
|
13522
|
+
disabled,
|
|
13523
|
+
children: [
|
|
13524
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13525
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13526
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13527
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Normal", children: "Normal" }),
|
|
13528
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Abnormal", children: "Abnormal" }),
|
|
13529
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Pending", children: "Pending" })
|
|
13530
|
+
] })
|
|
13531
|
+
]
|
|
13532
|
+
}
|
|
13533
|
+
)
|
|
13534
|
+
] })
|
|
13535
|
+
] }) }),
|
|
13536
|
+
/* @__PURE__ */ jsx(Panel3, { title: "Investigations", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", children: [
|
|
13537
|
+
{ key: "amh", label: "AMH" },
|
|
13538
|
+
{ key: "fshLh", label: "FSH / LH" },
|
|
13539
|
+
{ key: "prolactin", label: "Prolactin" },
|
|
13540
|
+
{ key: "tsh", label: "TSH" },
|
|
13541
|
+
{ key: "tvs", label: "TVS findings" },
|
|
13542
|
+
{ key: "hsg", label: "HSG findings" }
|
|
13543
|
+
].map((row) => /* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13544
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: row.label }),
|
|
13545
|
+
/* @__PURE__ */ jsx(
|
|
13546
|
+
Input,
|
|
13547
|
+
{
|
|
13548
|
+
className: "h-8 text-xs",
|
|
13549
|
+
value: inf.investigations[row.key],
|
|
13550
|
+
onChange: (e) => setInfertility({
|
|
13551
|
+
investigations: { ...inf.investigations, [row.key]: e.target.value }
|
|
13552
|
+
}),
|
|
13553
|
+
disabled
|
|
13554
|
+
}
|
|
13555
|
+
)
|
|
13556
|
+
] }, row.key)) }) })
|
|
13557
|
+
] }) : null,
|
|
13558
|
+
hasZone("postoperative") ? /* @__PURE__ */ jsx(Panel3, { title: "Post-operative follow-up", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", children: [
|
|
13559
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13560
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Date of surgery" }),
|
|
13561
|
+
/* @__PURE__ */ jsx(
|
|
13562
|
+
Input,
|
|
13563
|
+
{
|
|
13564
|
+
type: "date",
|
|
13565
|
+
className: "h-8 text-xs",
|
|
13566
|
+
value: po.surgeryDate,
|
|
13567
|
+
onChange: (e) => setPostop({ surgeryDate: e.target.value }),
|
|
13568
|
+
disabled
|
|
13569
|
+
}
|
|
13570
|
+
)
|
|
13571
|
+
] }),
|
|
13572
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1 md:col-span-2", children: [
|
|
13573
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Procedure performed" }),
|
|
13574
|
+
/* @__PURE__ */ jsx(
|
|
13575
|
+
Input,
|
|
13576
|
+
{
|
|
13577
|
+
className: "h-8 text-xs",
|
|
13578
|
+
value: po.procedure,
|
|
13579
|
+
onChange: (e) => setPostop({ procedure: e.target.value }),
|
|
13580
|
+
disabled
|
|
13581
|
+
}
|
|
13582
|
+
)
|
|
13583
|
+
] }),
|
|
13584
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1 md:col-span-2", children: [
|
|
13585
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Histopathology result" }),
|
|
13586
|
+
/* @__PURE__ */ jsx(
|
|
13587
|
+
Input,
|
|
13588
|
+
{
|
|
13589
|
+
className: "h-8 text-xs",
|
|
13590
|
+
value: po.histopathology,
|
|
13591
|
+
onChange: (e) => setPostop({ histopathology: e.target.value }),
|
|
13592
|
+
disabled
|
|
13593
|
+
}
|
|
13594
|
+
)
|
|
13595
|
+
] }),
|
|
13596
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13597
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Wound status" }),
|
|
13598
|
+
/* @__PURE__ */ jsxs(
|
|
13599
|
+
Select,
|
|
13600
|
+
{
|
|
13601
|
+
value: po.woundStatus === "" ? "none" : po.woundStatus,
|
|
13602
|
+
onValueChange: (v) => setPostop({
|
|
13603
|
+
woundStatus: v === "none" ? "" : v
|
|
13604
|
+
}),
|
|
13605
|
+
disabled,
|
|
13606
|
+
children: [
|
|
13607
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "\u2014" }) }),
|
|
13608
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
13609
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: "\u2014" }),
|
|
13610
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Healthy", children: "Healthy" }),
|
|
13611
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Erythema", children: "Erythema" }),
|
|
13612
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Discharge", children: "Discharge" }),
|
|
13613
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "Dehisced", children: "Dehisced" })
|
|
13614
|
+
] })
|
|
13615
|
+
]
|
|
13616
|
+
}
|
|
13617
|
+
)
|
|
13618
|
+
] }),
|
|
13619
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
|
|
13620
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Pain score (0-10)" }),
|
|
13621
|
+
/* @__PURE__ */ jsx(
|
|
13622
|
+
Input,
|
|
13623
|
+
{
|
|
13624
|
+
type: "number",
|
|
13625
|
+
min: 0,
|
|
13626
|
+
max: 10,
|
|
13627
|
+
className: "h-8 text-xs",
|
|
13628
|
+
value: po.painScore,
|
|
13629
|
+
onChange: (e) => setPostop({
|
|
13630
|
+
painScore: Math.max(0, Math.min(10, Number(e.target.value) || 0))
|
|
13631
|
+
}),
|
|
13632
|
+
disabled
|
|
13633
|
+
}
|
|
13634
|
+
)
|
|
13635
|
+
] }),
|
|
13636
|
+
/* @__PURE__ */ jsxs("label", { className: "space-y-1 md:col-span-3", children: [
|
|
13637
|
+
/* @__PURE__ */ jsx("span", { className: "block font-medium", children: "Complications" }),
|
|
13638
|
+
/* @__PURE__ */ jsx(
|
|
13639
|
+
Textarea,
|
|
13640
|
+
{
|
|
13641
|
+
className: "min-h-[60px] text-xs",
|
|
13642
|
+
value: po.complications,
|
|
13643
|
+
onChange: (e) => setPostop({ complications: e.target.value }),
|
|
13644
|
+
disabled
|
|
13645
|
+
}
|
|
13646
|
+
)
|
|
13647
|
+
] })
|
|
13648
|
+
] }) }) : null,
|
|
13649
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 border-t border-[#D0D0D0] pt-3", children: [
|
|
13650
|
+
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: "History of Presenting Complaint" }),
|
|
13651
|
+
/* @__PURE__ */ jsx(
|
|
13652
|
+
Textarea,
|
|
13653
|
+
{
|
|
13654
|
+
value: safe.zones.length > 0 ? formatObgPathwayToSymptomsNarrative(safe) : typeof symptomsField.value === "string" ? symptomsField.value : "",
|
|
13655
|
+
onChange: (e) => {
|
|
13656
|
+
if (safe.zones.length > 0) return;
|
|
13657
|
+
symptomsField.setValue(e.target.value);
|
|
13658
|
+
},
|
|
13659
|
+
readOnly: safe.zones.length > 0,
|
|
13660
|
+
disabled,
|
|
13661
|
+
className: "min-h-[70px] text-xs",
|
|
13662
|
+
placeholder: safe.zones.length > 0 ? "Generated from pathway panels above." : "Free-text history, or select pathway zones above for a structured narrative."
|
|
13663
|
+
}
|
|
13664
|
+
)
|
|
13665
|
+
] })
|
|
13666
|
+
] })
|
|
13667
|
+
] });
|
|
13668
|
+
};
|
|
13669
|
+
var FieldRenderer = ({ fieldId }) => {
|
|
13670
|
+
const { fieldDef, visible } = useField(fieldId);
|
|
13671
|
+
if (!visible || !fieldDef) {
|
|
13672
|
+
return null;
|
|
13673
|
+
}
|
|
13674
|
+
return renderWidget(fieldId, fieldDef);
|
|
13675
|
+
};
|
|
13676
|
+
function renderWidget(fieldId, fieldDef) {
|
|
13677
|
+
switch (fieldDef.type) {
|
|
13678
|
+
case "text":
|
|
13679
|
+
case "number":
|
|
13680
|
+
return /* @__PURE__ */ jsx(TextWidget, { fieldId });
|
|
13681
|
+
case "slider":
|
|
13682
|
+
return /* @__PURE__ */ jsx(SliderWidget, { fieldId });
|
|
13683
|
+
case "textarea":
|
|
13684
|
+
if (fieldMetaRequestsMarMedicationOrdersButton(fieldDef.meta)) {
|
|
13685
|
+
return /* @__PURE__ */ jsx(MarMedicationOrdersWidget, { fieldId });
|
|
13686
|
+
}
|
|
13687
|
+
return /* @__PURE__ */ jsx(TextWidget, { fieldId });
|
|
13688
|
+
case "richtext":
|
|
13689
|
+
return /* @__PURE__ */ jsx(RichTextWidget, { fieldId });
|
|
13690
|
+
case "date":
|
|
13691
|
+
return /* @__PURE__ */ jsx(DateWidget, { fieldId });
|
|
13692
|
+
case "datetime":
|
|
13693
|
+
return /* @__PURE__ */ jsx(DateTimeWidget, { fieldId });
|
|
13694
|
+
case "select":
|
|
13695
|
+
return /* @__PURE__ */ jsx(SelectWidget, { fieldId });
|
|
13696
|
+
case "radio":
|
|
13697
|
+
return /* @__PURE__ */ jsx(RadioWidget, { fieldId });
|
|
13698
|
+
case "checkbox":
|
|
13699
|
+
return /* @__PURE__ */ jsx(CheckboxWidget, { fieldId });
|
|
13700
|
+
case "multiselect":
|
|
13701
|
+
return /* @__PURE__ */ jsx(MultiSelectWidget, { fieldId });
|
|
13702
|
+
case "repeatable":
|
|
13703
|
+
return /* @__PURE__ */ jsx(RepeatableWidget, { fieldId });
|
|
13704
|
+
case "image_upload":
|
|
13705
|
+
return /* @__PURE__ */ jsx(ImageUploadWidget, { fieldId });
|
|
13706
|
+
case "media_upload":
|
|
13707
|
+
return /* @__PURE__ */ jsx(MediaUploadWidget, { fieldId });
|
|
13708
|
+
case "signature":
|
|
13709
|
+
return /* @__PURE__ */ jsx(SignatureUploadWidget, { fieldId });
|
|
13710
|
+
case "editable_table":
|
|
13711
|
+
return /* @__PURE__ */ jsx(EditableTableWidget, { fieldId });
|
|
13712
|
+
case "medications":
|
|
13713
|
+
return /* @__PURE__ */ jsx(AddMedicationWidget, { fieldId });
|
|
13714
|
+
case "discharge_medication_orders":
|
|
13715
|
+
return /* @__PURE__ */ jsx(DischargeMedicationOrdersWidget, { fieldId });
|
|
13716
|
+
case "investigations":
|
|
13717
|
+
return /* @__PURE__ */ jsx(AddInvestigationWidget, { fieldId });
|
|
13718
|
+
case "procedures":
|
|
13719
|
+
return /* @__PURE__ */ jsx(AddProcedureWidget, { fieldId });
|
|
13720
|
+
case "differential_diagnosis":
|
|
13721
|
+
return /* @__PURE__ */ jsx(DifferentialDiagnosisWidget, { fieldId });
|
|
13722
|
+
case "vitals":
|
|
13723
|
+
return /* @__PURE__ */ jsx(VitalsWidget, { fieldId });
|
|
13724
|
+
case "hidden_vitals":
|
|
13725
|
+
return /* @__PURE__ */ jsx(HiddenVitalsWidget, { fieldId });
|
|
13726
|
+
case "referral":
|
|
13727
|
+
return /* @__PURE__ */ jsx(ReferralWidget, { fieldId });
|
|
13728
|
+
case "followup":
|
|
13729
|
+
return /* @__PURE__ */ jsx(FollowupWidget, { fieldId });
|
|
13730
|
+
case "smart_textarea":
|
|
13731
|
+
return /* @__PURE__ */ jsx(SmartTextareaWidget, { fieldId });
|
|
13732
|
+
case "diagnosis_textarea":
|
|
13733
|
+
return /* @__PURE__ */ jsx(DiagnosisTextareaWidget, { fieldId });
|
|
13734
|
+
case "obstetric_history":
|
|
13735
|
+
return /* @__PURE__ */ jsx(ObstetricHistoryWidget, { fieldId });
|
|
13736
|
+
case "eye_prescription":
|
|
13737
|
+
return /* @__PURE__ */ jsx(OphthalmologyWidget, { fieldId });
|
|
13738
|
+
case "ophthal_diagnosis":
|
|
13739
|
+
return /* @__PURE__ */ jsx(OphthalDiagnosisWidget, { fieldId });
|
|
13740
|
+
case "orthopedic_exam":
|
|
13741
|
+
return /* @__PURE__ */ jsx(OrthopedicExamWidget, { fieldId });
|
|
13742
|
+
case "general_surgery_smart_history":
|
|
13743
|
+
return /* @__PURE__ */ jsx(GsSmartHistoryWidget, { fieldId });
|
|
13744
|
+
case "general_surgery_examination":
|
|
13745
|
+
return /* @__PURE__ */ jsx(GsExaminationWidget, { fieldId });
|
|
13746
|
+
case "general_surgery_grading":
|
|
13747
|
+
return /* @__PURE__ */ jsx(GsGradingWidget, { fieldId });
|
|
13748
|
+
case "pain_scale_flags":
|
|
13749
|
+
return /* @__PURE__ */ jsx(PainScaleFlagsWidget, { fieldId });
|
|
13750
|
+
case "urology_smart_history":
|
|
13751
|
+
return /* @__PURE__ */ jsx(UrologySmartHistoryWidget, { fieldId });
|
|
13752
|
+
case "urology_examination":
|
|
13753
|
+
return /* @__PURE__ */ jsx(UrologyExaminationWidget, { fieldId });
|
|
13754
|
+
case "urology_pathway":
|
|
13755
|
+
return /* @__PURE__ */ jsx(UrologyPathwayWidget, { fieldId });
|
|
13756
|
+
case "obg_examination":
|
|
13757
|
+
return /* @__PURE__ */ jsx(OBGExaminationWidget, { fieldId });
|
|
13758
|
+
case "obg_pathway":
|
|
13759
|
+
return /* @__PURE__ */ jsx(OBGPathwayWidget, { fieldId });
|
|
13760
|
+
case "toggle": {
|
|
13761
|
+
const { value, setValue, setTouched, disabled } = useField(fieldId);
|
|
13762
|
+
const store = useFormStore();
|
|
13763
|
+
const excludes = fieldDef.excludes ?? [];
|
|
13764
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
13765
|
+
/* @__PURE__ */ jsx(
|
|
13766
|
+
Switch,
|
|
13767
|
+
{
|
|
13768
|
+
checked: value === true,
|
|
13769
|
+
disabled,
|
|
13770
|
+
onCheckedChange: (checked) => {
|
|
13771
|
+
setValue(checked);
|
|
13772
|
+
setTouched();
|
|
13773
|
+
if (checked) excludes.forEach((id) => store.setValue(id, false));
|
|
13774
|
+
}
|
|
13775
|
+
}
|
|
13776
|
+
),
|
|
13777
|
+
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium leading-none cursor-pointer select-none", children: fieldDef.label })
|
|
13778
|
+
] });
|
|
13779
|
+
}
|
|
13780
|
+
case "suggestion_textarea":
|
|
13781
|
+
case "complaint_chips":
|
|
13782
|
+
return /* @__PURE__ */ jsx(SuggestionTextareaWidget, { fieldId });
|
|
13783
|
+
case "lens_assessment":
|
|
13784
|
+
return /* @__PURE__ */ jsx(LensAssessmentWidget, { fieldId });
|
|
13785
|
+
case "functional_impairment_score":
|
|
13786
|
+
return /* @__PURE__ */ jsx(FunctionalImpairmentScoreWidget, { fieldId });
|
|
13787
|
+
case "biometry_iol_workup":
|
|
13788
|
+
return /* @__PURE__ */ jsx(BiometryIolWorkupWidget, { fieldId });
|
|
13789
|
+
case "surgical_risk_flags":
|
|
13790
|
+
return /* @__PURE__ */ jsx(SurgicalRiskFlagsWidget, { fieldId });
|
|
13791
|
+
case "static_text": {
|
|
13792
|
+
const def = fieldDef;
|
|
13793
|
+
const size = def.size ?? "regular";
|
|
13794
|
+
const labelClass = size === "large" ? "text-base" : "text-sm";
|
|
13795
|
+
const descClass = size === "large" ? "text-sm" : "text-xs";
|
|
13796
|
+
return /* @__PURE__ */ jsxs("div", { className: `${labelClass} text-muted-foreground`, children: [
|
|
13797
|
+
def.label,
|
|
13798
|
+
def.description && /* @__PURE__ */ jsx("p", { className: `mt-1 ${descClass} opacity-90`, children: def.description })
|
|
13799
|
+
] });
|
|
13800
|
+
}
|
|
13801
|
+
default:
|
|
13802
|
+
return /* @__PURE__ */ jsxs("div", { className: "text-red-500", children: [
|
|
13803
|
+
"Unknown field type: ",
|
|
13804
|
+
fieldDef.type
|
|
13805
|
+
] });
|
|
13806
|
+
}
|
|
13807
|
+
}
|
|
13808
|
+
var Section = ({ title, children }) => {
|
|
11992
13809
|
const [expanded, setExpanded] = useState(true);
|
|
11993
13810
|
const handleToggle = () => setExpanded((prev) => !prev);
|
|
11994
13811
|
const contentClassName = cn(
|
|
@@ -12789,18 +14606,18 @@ var ReadOnlyFieldRenderer = ({
|
|
|
12789
14606
|
const locsRecord = locs != null && typeof locs === "object" && !Array.isArray(locs) ? locs : null;
|
|
12790
14607
|
const eyeLine = (label, g) => {
|
|
12791
14608
|
if (!g || typeof g !== "object") return null;
|
|
12792
|
-
const
|
|
14609
|
+
const num2 = (k) => typeof g[k] === "number" ? g[k] : "\u2014";
|
|
12793
14610
|
return /* @__PURE__ */ jsxs("p", { className: "text-xs text-foreground", children: [
|
|
12794
14611
|
label,
|
|
12795
14612
|
": NO ",
|
|
12796
|
-
String(
|
|
14613
|
+
String(num2("NO")),
|
|
12797
14614
|
", NC ",
|
|
12798
|
-
String(
|
|
14615
|
+
String(num2("NC")),
|
|
12799
14616
|
", C ",
|
|
12800
|
-
String(
|
|
14617
|
+
String(num2("C")),
|
|
12801
14618
|
", PSC",
|
|
12802
14619
|
" ",
|
|
12803
|
-
String(
|
|
14620
|
+
String(num2("PSC"))
|
|
12804
14621
|
] });
|
|
12805
14622
|
};
|
|
12806
14623
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-2 rounded-md border p-3 text-sm", children: [
|
|
@@ -12940,6 +14757,32 @@ var ReadOnlyFieldRenderer = ({
|
|
|
12940
14757
|
] }) : null
|
|
12941
14758
|
] });
|
|
12942
14759
|
}
|
|
14760
|
+
case "obg_pathway": {
|
|
14761
|
+
const structuredDisplay = value && typeof value === "object" ? JSON.stringify(normalizeObgPathway(value), null, 2) : value == null || value === "" ? "\u2014" : String(value);
|
|
14762
|
+
const hopcDef = resolveFieldDef?.("symptoms");
|
|
14763
|
+
const hopcRaw = allValues?.["symptoms"];
|
|
14764
|
+
const hopcStr = typeof hopcRaw === "string" ? hopcRaw : hopcRaw != null && hopcRaw !== "" ? String(hopcRaw) : "";
|
|
14765
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
14766
|
+
/* @__PURE__ */ jsx(ReadOnlyText, { fieldDef, value: structuredDisplay }),
|
|
14767
|
+
hopcDef ? /* @__PURE__ */ jsx(ReadOnlyText, { fieldDef: hopcDef, value: hopcStr }) : hopcStr ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
14768
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-700", children: "History of presenting complaint" }),
|
|
14769
|
+
/* @__PURE__ */ jsx("div", { className: "text-gray-900 border border-gray-200 rounded-md p-3 bg-gray-50 min-h-[2.5rem] whitespace-pre-wrap", children: hopcStr })
|
|
14770
|
+
] }) : null
|
|
14771
|
+
] });
|
|
14772
|
+
}
|
|
14773
|
+
case "obg_examination": {
|
|
14774
|
+
const structuredDisplay = value && typeof value === "object" ? JSON.stringify(value, null, 2) : value == null || value === "" ? "\u2014" : String(value);
|
|
14775
|
+
const clinicalDef = resolveFieldDef?.("clinical_examination");
|
|
14776
|
+
const clinicalRaw = allValues?.["clinical_examination"];
|
|
14777
|
+
const clinicalStr = typeof clinicalRaw === "string" ? clinicalRaw : clinicalRaw != null && clinicalRaw !== "" ? String(clinicalRaw) : "";
|
|
14778
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
14779
|
+
/* @__PURE__ */ jsx(ReadOnlyText, { fieldDef, value: structuredDisplay }),
|
|
14780
|
+
clinicalDef ? /* @__PURE__ */ jsx(ReadOnlyText, { fieldDef: clinicalDef, value: clinicalStr }) : clinicalStr ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
14781
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-700", children: "Clinical examination" }),
|
|
14782
|
+
/* @__PURE__ */ jsx("div", { className: "text-gray-900 border border-gray-200 rounded-md p-3 bg-gray-50 min-h-[2.5rem] whitespace-pre-wrap", children: clinicalStr })
|
|
14783
|
+
] }) : null
|
|
14784
|
+
] });
|
|
14785
|
+
}
|
|
12943
14786
|
case "static_text": {
|
|
12944
14787
|
const def = fieldDef;
|
|
12945
14788
|
const size = def.size ?? "regular";
|