formanitor 0.0.17 → 0.0.19

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 CHANGED
@@ -419,6 +419,26 @@ var FormStore = class {
419
419
  result[field.id] = raw?.text ?? null;
420
420
  return;
421
421
  }
422
+ if (field.type === "ophthal_diagnosis") {
423
+ const raw = values[field.id];
424
+ const formatEye = (eyeData, eyeLabel) => {
425
+ if (!eyeData || typeof eyeData !== "object") return "";
426
+ const entries = Object.entries(eyeData).filter(([, value]) => typeof value === "string" && value.trim()).map(([key, value]) => `${key}: ${value.trim()}`);
427
+ if (entries.length === 0) return "";
428
+ return [eyeLabel, ...entries].join("\n");
429
+ };
430
+ const rightEyeText = formatEye(
431
+ raw?.right_eye ?? raw?.rightEye,
432
+ "Right Eye"
433
+ );
434
+ const leftEyeText = formatEye(
435
+ raw?.left_eye ?? raw?.leftEye,
436
+ "Left Eye"
437
+ );
438
+ const parts = [rightEyeText, leftEyeText].filter(Boolean);
439
+ result[field.id] = parts.length > 0 ? parts.join("\n\n") : null;
440
+ return;
441
+ }
422
442
  if (field.type === "image_upload" || field.type === "signature") {
423
443
  const raw = values[field.id];
424
444
  if (raw !== void 0 && raw !== null && raw !== "") {
@@ -3773,6 +3793,38 @@ var VitalsWidget = ({ fieldId }) => {
3773
3793
  }
3774
3794
  );
3775
3795
  };
3796
+ var HiddenVitalsWidget = ({ fieldId }) => {
3797
+ const { fieldDef, value, setValue, setTouched, error, disabled, touched } = useField(fieldId);
3798
+ const { state } = useForm();
3799
+ const showError = !!error && (touched || state.submitAttempted);
3800
+ if (!fieldDef) return null;
3801
+ const height = "height" in fieldDef ? fieldDef.height : void 0;
3802
+ const theme = getThemeConfig("textarea", fieldDef.theme);
3803
+ const wrapperClass = cn(theme?.wrapperClassName ?? "space-y-2", "sr-only");
3804
+ const labelClass = theme?.labelClassName;
3805
+ const inputClass = cn(theme?.inputClassName, showError && "border-red-500");
3806
+ const labelContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3807
+ fieldDef.label,
3808
+ " ",
3809
+ fieldDef.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
3810
+ ] });
3811
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClass, "aria-hidden": "true", children: [
3812
+ theme ? /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: fieldId, className: labelClass, children: labelContent }) : /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: fieldId, children: labelContent }),
3813
+ /* @__PURE__ */ jsxRuntime.jsx(
3814
+ Textarea,
3815
+ {
3816
+ id: fieldId,
3817
+ value: value ?? "",
3818
+ onChange: (e) => setValue(e.target.value),
3819
+ onBlur: setTouched,
3820
+ disabled,
3821
+ className: inputClass,
3822
+ ...height != null && { height }
3823
+ }
3824
+ ),
3825
+ showError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-red-500", children: error })
3826
+ ] });
3827
+ };
3776
3828
  function normalizeOptions(response) {
3777
3829
  if (Array.isArray(response)) {
3778
3830
  return response.map((o) => ({ label: String(o.label), value: String(o.value) }));
@@ -5010,6 +5062,1343 @@ var ObstetricHistoryWidget = ({ fieldId }) => {
5010
5062
  ] })
5011
5063
  ] });
5012
5064
  };
5065
+ var UCVA_OPTIONS = ["", "6/6", "6/9", "6/12", "6/18", "6/24", "6/36", "6/60", "CF", "PL"];
5066
+ var NEAR_VA_OPTIONS = ["", "N4", "N5", "N6", "N8", "N10", "N12", "N14", "N18", "N24", "N36", "<N36"];
5067
+ var PINHOLE_OPTIONS = [
5068
+ "",
5069
+ "PL\u2212",
5070
+ "PL+",
5071
+ "FL",
5072
+ "HM",
5073
+ "CCFCF",
5074
+ "FC",
5075
+ "1/60",
5076
+ "2/60",
5077
+ "3/60",
5078
+ "4/60",
5079
+ "5/60",
5080
+ "6/60",
5081
+ "6/36",
5082
+ "6/24",
5083
+ "6/18",
5084
+ "6/12",
5085
+ "6/9",
5086
+ "6/7.5",
5087
+ "6/6"
5088
+ ];
5089
+ var VA_OPTIONS = UCVA_OPTIONS;
5090
+ var IOP_METHOD_OPTIONS = ["", "NCT", "Goldmann", "Tonopen", "iCare"];
5091
+ function parseFloatOrNull(value) {
5092
+ const trimmed = value.trim();
5093
+ if (!trimmed) return null;
5094
+ const parsed = Number.parseFloat(trimmed);
5095
+ return Number.isFinite(parsed) ? parsed : null;
5096
+ }
5097
+ function parseIntOrNull(value) {
5098
+ const trimmed = value.trim();
5099
+ if (!trimmed) return null;
5100
+ const parsed = Number.parseInt(trimmed, 10);
5101
+ return Number.isFinite(parsed) ? parsed : null;
5102
+ }
5103
+ function ensureRefractionEye(raw) {
5104
+ return {
5105
+ sph: raw?.sph ?? null,
5106
+ cyl: raw?.cyl ?? null,
5107
+ axis: raw?.axis ?? null,
5108
+ va: raw?.va ?? "",
5109
+ pd: raw?.pd ?? null,
5110
+ prism: raw?.prism ?? null
5111
+ };
5112
+ }
5113
+ function ensureAddPowers(raw) {
5114
+ return {
5115
+ right: raw?.right ?? null,
5116
+ left: raw?.left ?? null
5117
+ };
5118
+ }
5119
+ function ensureRefraction(raw) {
5120
+ return {
5121
+ right_eye: ensureRefractionEye(raw?.right_eye),
5122
+ left_eye: ensureRefractionEye(raw?.left_eye),
5123
+ add: ensureAddPowers(raw?.add)
5124
+ };
5125
+ }
5126
+ function ensureUnaidedEyeVa(raw) {
5127
+ return {
5128
+ ucva: raw?.ucva ?? "",
5129
+ pinhole_va: raw?.pinhole_va ?? "",
5130
+ nv: raw?.nv ?? ""
5131
+ };
5132
+ }
5133
+ function ensureIopEye(raw) {
5134
+ return {
5135
+ iop: raw?.iop ?? null,
5136
+ cct: raw?.cct ?? null
5137
+ };
5138
+ }
5139
+ function ensureValue(raw) {
5140
+ const v = raw || {};
5141
+ return {
5142
+ patient_information: {
5143
+ systemic_history: v.patient_information?.systemic_history ?? "",
5144
+ ocular_history: v.patient_information?.ocular_history ?? "",
5145
+ chief_complaints: v.patient_information?.chief_complaints ?? ""
5146
+ },
5147
+ unaided_visual_acuity: {
5148
+ right_eye: ensureUnaidedEyeVa(v.unaided_visual_acuity?.right_eye),
5149
+ left_eye: ensureUnaidedEyeVa(v.unaided_visual_acuity?.left_eye)
5150
+ },
5151
+ current_glass_prescription: ensureRefraction(v.current_glass_prescription),
5152
+ iop_pachy_cct: {
5153
+ method: v.iop_pachy_cct?.method ?? "",
5154
+ time: v.iop_pachy_cct?.time ?? "",
5155
+ right_eye: ensureIopEye(v.iop_pachy_cct?.right_eye),
5156
+ left_eye: ensureIopEye(v.iop_pachy_cct?.left_eye)
5157
+ },
5158
+ refraction: ensureRefraction(v.refraction),
5159
+ dilated_refraction: ensureRefraction(v.dilated_refraction),
5160
+ glass_power_prescription: ensureRefraction(v.glass_power_prescription),
5161
+ notes: v.notes ?? ""
5162
+ };
5163
+ }
5164
+ var sectionWrapperClass = "rounded-md overflow-hidden flex flex-col border border-[#D0D0D0] bg-white";
5165
+ var sectionHeaderClass = "rounded-t-md bg-[#FEE8EC] px-3 py-1 text-sm shrink-0 z-[1] text-slate-600 font-medium";
5166
+ var sectionBodyClass = "rounded-b-md border-t border-[#D0D0D0] bg-white p-3 space-y-3";
5167
+ var tableBaseClass = "w-full border-collapse text-xs";
5168
+ var tableHeaderCellClass = "border border-[#E0E0E0] bg-[#F7F7F7] px-2 py-1 text-center font-semibold";
5169
+ var tableCellClass = "border border-[#E0E0E0] px-1.5 py-1 text-center align-middle";
5170
+ var selectClass = "w-full border border-[#D0D0D0] rounded-md bg-white px-2 py-1 text-xs focus-visible:outline-none focus-visible:ring-0";
5171
+ var numberInputClass = "w-full border border-[#D0D0D0] rounded-md bg-white px-2 py-1 text-xs text-right focus-visible:outline-none focus-visible:ring-0";
5172
+ var textInputClass = "w-full border border-[#D0D0D0] rounded-md bg-white px-2 py-1 text-xs focus-visible:outline-none focus-visible:ring-0";
5173
+ var OphthalmologyWidget = ({ fieldId }) => {
5174
+ const { fieldDef, value, setValue, disabled } = useField(fieldId);
5175
+ const safe = React11.useMemo(() => ensureValue(value), [value]);
5176
+ const label = fieldDef?.label || "";
5177
+ const update = (updater) => {
5178
+ if (disabled) return;
5179
+ setValue(updater(ensureValue(value)));
5180
+ };
5181
+ const setPatientInfo = (key, next) => {
5182
+ update((current) => ({
5183
+ ...current,
5184
+ patient_information: { ...current.patient_information, [key]: next }
5185
+ }));
5186
+ };
5187
+ const setUnaided = (side, key, next) => {
5188
+ update((current) => ({
5189
+ ...current,
5190
+ unaided_visual_acuity: {
5191
+ ...current.unaided_visual_acuity,
5192
+ [side]: { ...current.unaided_visual_acuity[side], [key]: next }
5193
+ }
5194
+ }));
5195
+ };
5196
+ const setRefractionField = (section, side, key, next, mode) => {
5197
+ update((current) => {
5198
+ const base = current[section];
5199
+ const eye = base[side];
5200
+ let val;
5201
+ if (mode === "select") {
5202
+ val = next;
5203
+ } else if (mode === "float") {
5204
+ val = parseFloatOrNull(next);
5205
+ } else {
5206
+ val = parseIntOrNull(next);
5207
+ }
5208
+ return {
5209
+ ...current,
5210
+ [section]: {
5211
+ ...base,
5212
+ [side]: {
5213
+ ...eye,
5214
+ [key]: val
5215
+ }
5216
+ }
5217
+ };
5218
+ });
5219
+ };
5220
+ const setRefractionAdd = (section, side, next) => {
5221
+ update((current) => {
5222
+ const base = current[section];
5223
+ const add = base.add;
5224
+ const val = parseFloatOrNull(next);
5225
+ return {
5226
+ ...current,
5227
+ [section]: {
5228
+ ...base,
5229
+ add: {
5230
+ ...add,
5231
+ [side]: val
5232
+ }
5233
+ }
5234
+ };
5235
+ });
5236
+ };
5237
+ const setIopField = (side, key, next) => {
5238
+ update((current) => {
5239
+ const base = current.iop_pachy_cct;
5240
+ const eye = base[side];
5241
+ const val = parseIntOrNull(next);
5242
+ return {
5243
+ ...current,
5244
+ iop_pachy_cct: {
5245
+ ...base,
5246
+ [side]: {
5247
+ ...eye,
5248
+ [key]: val
5249
+ }
5250
+ }
5251
+ };
5252
+ });
5253
+ };
5254
+ const setIopMeta = (key, next) => {
5255
+ update((current) => ({
5256
+ ...current,
5257
+ iop_pachy_cct: {
5258
+ ...current.iop_pachy_cct,
5259
+ [key]: next
5260
+ }
5261
+ }));
5262
+ };
5263
+ const setNotes = (next) => {
5264
+ update((current) => ({
5265
+ ...current,
5266
+ notes: next
5267
+ }));
5268
+ };
5269
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-4", disabled && "opacity-70 pointer-events-none"), children: [
5270
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-slate-800", children: label }),
5271
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
5272
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Patient Information" }) }),
5273
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(sectionBodyClass, "grid gap-3 md:grid-cols-3"), children: [
5274
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
5275
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-slate-700", children: "Systemic History" }),
5276
+ /* @__PURE__ */ jsxRuntime.jsx(
5277
+ Textarea,
5278
+ {
5279
+ disabled,
5280
+ rows: 4,
5281
+ className: "min-h-[100px] text-xs",
5282
+ value: safe.patient_information.systemic_history,
5283
+ onChange: (e) => setPatientInfo("systemic_history", e.target.value),
5284
+ placeholder: "Enter systemic history..."
5285
+ }
5286
+ )
5287
+ ] }),
5288
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
5289
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-slate-700", children: "Ocular History" }),
5290
+ /* @__PURE__ */ jsxRuntime.jsx(
5291
+ Textarea,
5292
+ {
5293
+ disabled,
5294
+ rows: 4,
5295
+ className: "min-h-[100px] text-xs",
5296
+ value: safe.patient_information.ocular_history,
5297
+ onChange: (e) => setPatientInfo("ocular_history", e.target.value),
5298
+ placeholder: "Enter ocular history..."
5299
+ }
5300
+ )
5301
+ ] }),
5302
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
5303
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-slate-700", children: "Chief Complaints" }),
5304
+ /* @__PURE__ */ jsxRuntime.jsx(
5305
+ Textarea,
5306
+ {
5307
+ disabled,
5308
+ rows: 4,
5309
+ className: "min-h-[100px] text-xs",
5310
+ value: safe.patient_information.chief_complaints,
5311
+ onChange: (e) => setPatientInfo("chief_complaints", e.target.value),
5312
+ placeholder: "Enter chief complaints..."
5313
+ }
5314
+ )
5315
+ ] })
5316
+ ] })
5317
+ ] }),
5318
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
5319
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Unaided Visual Acuity" }) }),
5320
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionBodyClass, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableBaseClass, children: [
5321
+ /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
5322
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5323
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5324
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 3, children: "Right Eye" }),
5325
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 3, children: "Left Eye" })
5326
+ ] }),
5327
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5328
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5329
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "UCVA" }),
5330
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Pinhole V/A" }),
5331
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "N/V" }),
5332
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "UCVA" }),
5333
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Pinhole V/A" }),
5334
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "N/V" })
5335
+ ] })
5336
+ ] }),
5337
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5338
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Unaided" }),
5339
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5340
+ "select",
5341
+ {
5342
+ disabled,
5343
+ className: selectClass,
5344
+ value: safe.unaided_visual_acuity.right_eye.ucva,
5345
+ onChange: (e) => setUnaided("right_eye", "ucva", e.target.value),
5346
+ children: UCVA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5347
+ }
5348
+ ) }),
5349
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5350
+ "select",
5351
+ {
5352
+ disabled,
5353
+ className: selectClass,
5354
+ value: safe.unaided_visual_acuity.right_eye.pinhole_va,
5355
+ onChange: (e) => setUnaided("right_eye", "pinhole_va", e.target.value),
5356
+ children: PINHOLE_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5357
+ }
5358
+ ) }),
5359
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5360
+ "select",
5361
+ {
5362
+ disabled,
5363
+ className: selectClass,
5364
+ value: safe.unaided_visual_acuity.right_eye.nv,
5365
+ onChange: (e) => setUnaided("right_eye", "nv", e.target.value),
5366
+ children: NEAR_VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5367
+ }
5368
+ ) }),
5369
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5370
+ "select",
5371
+ {
5372
+ disabled,
5373
+ className: selectClass,
5374
+ value: safe.unaided_visual_acuity.left_eye.ucva,
5375
+ onChange: (e) => setUnaided("left_eye", "ucva", e.target.value),
5376
+ children: UCVA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5377
+ }
5378
+ ) }),
5379
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5380
+ "select",
5381
+ {
5382
+ disabled,
5383
+ className: selectClass,
5384
+ value: safe.unaided_visual_acuity.left_eye.pinhole_va,
5385
+ onChange: (e) => setUnaided("left_eye", "pinhole_va", e.target.value),
5386
+ children: PINHOLE_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5387
+ }
5388
+ ) }),
5389
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5390
+ "select",
5391
+ {
5392
+ disabled,
5393
+ className: selectClass,
5394
+ value: safe.unaided_visual_acuity.left_eye.nv,
5395
+ onChange: (e) => setUnaided("left_eye", "nv", e.target.value),
5396
+ children: NEAR_VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5397
+ }
5398
+ ) })
5399
+ ] }) })
5400
+ ] }) })
5401
+ ] }),
5402
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
5403
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Current Glass Prescription" }) }),
5404
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionBodyClass, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableBaseClass, children: [
5405
+ /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
5406
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5407
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5408
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 4, children: "Right Eye" }),
5409
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 4, children: "Left Eye" })
5410
+ ] }),
5411
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5412
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5413
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
5414
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
5415
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
5416
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" }),
5417
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
5418
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
5419
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
5420
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" })
5421
+ ] })
5422
+ ] }),
5423
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5424
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Current Glass" }),
5425
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5426
+ Input,
5427
+ {
5428
+ disabled,
5429
+ type: "number",
5430
+ step: "0.25",
5431
+ className: numberInputClass,
5432
+ value: safe.current_glass_prescription.right_eye.sph ?? "",
5433
+ onChange: (e) => setRefractionField(
5434
+ "current_glass_prescription",
5435
+ "right_eye",
5436
+ "sph",
5437
+ e.target.value,
5438
+ "float"
5439
+ )
5440
+ }
5441
+ ) }),
5442
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5443
+ Input,
5444
+ {
5445
+ disabled,
5446
+ type: "number",
5447
+ step: "0.25",
5448
+ className: numberInputClass,
5449
+ value: safe.current_glass_prescription.right_eye.cyl ?? "",
5450
+ onChange: (e) => setRefractionField(
5451
+ "current_glass_prescription",
5452
+ "right_eye",
5453
+ "cyl",
5454
+ e.target.value,
5455
+ "float"
5456
+ )
5457
+ }
5458
+ ) }),
5459
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5460
+ Input,
5461
+ {
5462
+ disabled,
5463
+ type: "number",
5464
+ className: numberInputClass,
5465
+ value: safe.current_glass_prescription.right_eye.axis ?? "",
5466
+ onChange: (e) => setRefractionField(
5467
+ "current_glass_prescription",
5468
+ "right_eye",
5469
+ "axis",
5470
+ e.target.value,
5471
+ "int"
5472
+ )
5473
+ }
5474
+ ) }),
5475
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5476
+ "select",
5477
+ {
5478
+ disabled,
5479
+ className: selectClass,
5480
+ value: safe.current_glass_prescription.right_eye.va,
5481
+ onChange: (e) => setRefractionField(
5482
+ "current_glass_prescription",
5483
+ "right_eye",
5484
+ "va",
5485
+ e.target.value,
5486
+ "select"
5487
+ ),
5488
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5489
+ }
5490
+ ) }),
5491
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5492
+ Input,
5493
+ {
5494
+ disabled,
5495
+ type: "number",
5496
+ step: "0.25",
5497
+ className: numberInputClass,
5498
+ value: safe.current_glass_prescription.left_eye.sph ?? "",
5499
+ onChange: (e) => setRefractionField(
5500
+ "current_glass_prescription",
5501
+ "left_eye",
5502
+ "sph",
5503
+ e.target.value,
5504
+ "float"
5505
+ )
5506
+ }
5507
+ ) }),
5508
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5509
+ Input,
5510
+ {
5511
+ disabled,
5512
+ type: "number",
5513
+ step: "0.25",
5514
+ className: numberInputClass,
5515
+ value: safe.current_glass_prescription.left_eye.cyl ?? "",
5516
+ onChange: (e) => setRefractionField(
5517
+ "current_glass_prescription",
5518
+ "left_eye",
5519
+ "cyl",
5520
+ e.target.value,
5521
+ "float"
5522
+ )
5523
+ }
5524
+ ) }),
5525
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5526
+ Input,
5527
+ {
5528
+ disabled,
5529
+ type: "number",
5530
+ className: numberInputClass,
5531
+ value: safe.current_glass_prescription.left_eye.axis ?? "",
5532
+ onChange: (e) => setRefractionField(
5533
+ "current_glass_prescription",
5534
+ "left_eye",
5535
+ "axis",
5536
+ e.target.value,
5537
+ "int"
5538
+ )
5539
+ }
5540
+ ) }),
5541
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5542
+ "select",
5543
+ {
5544
+ disabled,
5545
+ className: selectClass,
5546
+ value: safe.current_glass_prescription.left_eye.va,
5547
+ onChange: (e) => setRefractionField(
5548
+ "current_glass_prescription",
5549
+ "left_eye",
5550
+ "va",
5551
+ e.target.value,
5552
+ "select"
5553
+ ),
5554
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5555
+ }
5556
+ ) })
5557
+ ] }) })
5558
+ ] }) })
5559
+ ] }),
5560
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
5561
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "IOP / Pachy / CCT Detail" }) }),
5562
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: sectionBodyClass, children: [
5563
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3 md:grid-cols-[2fr,1fr] mb-3", children: [
5564
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
5565
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-slate-700", children: "Method" }),
5566
+ /* @__PURE__ */ jsxRuntime.jsx(
5567
+ "select",
5568
+ {
5569
+ disabled,
5570
+ className: selectClass,
5571
+ value: safe.iop_pachy_cct.method,
5572
+ onChange: (e) => setIopMeta("method", e.target.value),
5573
+ children: IOP_METHOD_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt || "Select Method" }, opt || "blank"))
5574
+ }
5575
+ )
5576
+ ] }),
5577
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
5578
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-slate-700", children: "Time" }),
5579
+ /* @__PURE__ */ jsxRuntime.jsx(
5580
+ Input,
5581
+ {
5582
+ disabled,
5583
+ placeholder: "HH:MM",
5584
+ className: textInputClass,
5585
+ value: safe.iop_pachy_cct.time,
5586
+ onChange: (e) => setIopMeta("time", e.target.value)
5587
+ }
5588
+ )
5589
+ ] })
5590
+ ] }),
5591
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableBaseClass, children: [
5592
+ /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
5593
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5594
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5595
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 2, children: "Right Eye" }),
5596
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 2, children: "Left Eye" })
5597
+ ] }),
5598
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5599
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5600
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "IOP" }),
5601
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "CCT" }),
5602
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "IOP" }),
5603
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "CCT" })
5604
+ ] })
5605
+ ] }),
5606
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5607
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Values" }),
5608
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5609
+ Input,
5610
+ {
5611
+ disabled,
5612
+ type: "number",
5613
+ className: numberInputClass,
5614
+ value: safe.iop_pachy_cct.right_eye.iop ?? "",
5615
+ onChange: (e) => setIopField("right_eye", "iop", e.target.value)
5616
+ }
5617
+ ) }),
5618
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5619
+ Input,
5620
+ {
5621
+ disabled,
5622
+ type: "number",
5623
+ className: numberInputClass,
5624
+ value: safe.iop_pachy_cct.right_eye.cct ?? "",
5625
+ onChange: (e) => setIopField("right_eye", "cct", e.target.value)
5626
+ }
5627
+ ) }),
5628
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5629
+ Input,
5630
+ {
5631
+ disabled,
5632
+ type: "number",
5633
+ className: numberInputClass,
5634
+ value: safe.iop_pachy_cct.left_eye.iop ?? "",
5635
+ onChange: (e) => setIopField("left_eye", "iop", e.target.value)
5636
+ }
5637
+ ) }),
5638
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5639
+ Input,
5640
+ {
5641
+ disabled,
5642
+ type: "number",
5643
+ className: numberInputClass,
5644
+ value: safe.iop_pachy_cct.left_eye.cct ?? "",
5645
+ onChange: (e) => setIopField("left_eye", "cct", e.target.value)
5646
+ }
5647
+ ) })
5648
+ ] }) })
5649
+ ] })
5650
+ ] })
5651
+ ] }),
5652
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
5653
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Refraction (Distance)" }) }),
5654
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionBodyClass, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableBaseClass, children: [
5655
+ /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
5656
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5657
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5658
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 5, children: "Right Eye" }),
5659
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 5, children: "Left Eye" })
5660
+ ] }),
5661
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5662
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5663
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
5664
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
5665
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
5666
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" }),
5667
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "P/D" }),
5668
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
5669
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
5670
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
5671
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" }),
5672
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "P/D" })
5673
+ ] })
5674
+ ] }),
5675
+ /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
5676
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5677
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Distance" }),
5678
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5679
+ Input,
5680
+ {
5681
+ disabled,
5682
+ type: "number",
5683
+ step: "0.25",
5684
+ className: numberInputClass,
5685
+ value: safe.refraction.right_eye.sph ?? "",
5686
+ onChange: (e) => setRefractionField(
5687
+ "refraction",
5688
+ "right_eye",
5689
+ "sph",
5690
+ e.target.value,
5691
+ "float"
5692
+ )
5693
+ }
5694
+ ) }),
5695
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5696
+ Input,
5697
+ {
5698
+ disabled,
5699
+ type: "number",
5700
+ step: "0.25",
5701
+ className: numberInputClass,
5702
+ value: safe.refraction.right_eye.cyl ?? "",
5703
+ onChange: (e) => setRefractionField(
5704
+ "refraction",
5705
+ "right_eye",
5706
+ "cyl",
5707
+ e.target.value,
5708
+ "float"
5709
+ )
5710
+ }
5711
+ ) }),
5712
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5713
+ Input,
5714
+ {
5715
+ disabled,
5716
+ type: "number",
5717
+ className: numberInputClass,
5718
+ value: safe.refraction.right_eye.axis ?? "",
5719
+ onChange: (e) => setRefractionField(
5720
+ "refraction",
5721
+ "right_eye",
5722
+ "axis",
5723
+ e.target.value,
5724
+ "int"
5725
+ )
5726
+ }
5727
+ ) }),
5728
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5729
+ "select",
5730
+ {
5731
+ disabled,
5732
+ className: selectClass,
5733
+ value: safe.refraction.right_eye.va,
5734
+ onChange: (e) => setRefractionField(
5735
+ "refraction",
5736
+ "right_eye",
5737
+ "va",
5738
+ e.target.value,
5739
+ "select"
5740
+ ),
5741
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5742
+ }
5743
+ ) }),
5744
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5745
+ Input,
5746
+ {
5747
+ disabled,
5748
+ type: "number",
5749
+ min: 10,
5750
+ max: 45,
5751
+ step: "1",
5752
+ className: numberInputClass,
5753
+ value: safe.refraction.right_eye.pd ?? "",
5754
+ onChange: (e) => setRefractionField("refraction", "right_eye", "pd", e.target.value, "int")
5755
+ }
5756
+ ) }),
5757
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5758
+ Input,
5759
+ {
5760
+ disabled,
5761
+ type: "number",
5762
+ step: "0.25",
5763
+ className: numberInputClass,
5764
+ value: safe.refraction.left_eye.sph ?? "",
5765
+ onChange: (e) => setRefractionField(
5766
+ "refraction",
5767
+ "left_eye",
5768
+ "sph",
5769
+ e.target.value,
5770
+ "float"
5771
+ )
5772
+ }
5773
+ ) }),
5774
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5775
+ Input,
5776
+ {
5777
+ disabled,
5778
+ type: "number",
5779
+ step: "0.25",
5780
+ className: numberInputClass,
5781
+ value: safe.refraction.left_eye.cyl ?? "",
5782
+ onChange: (e) => setRefractionField(
5783
+ "refraction",
5784
+ "left_eye",
5785
+ "cyl",
5786
+ e.target.value,
5787
+ "float"
5788
+ )
5789
+ }
5790
+ ) }),
5791
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5792
+ Input,
5793
+ {
5794
+ disabled,
5795
+ type: "number",
5796
+ className: numberInputClass,
5797
+ value: safe.refraction.left_eye.axis ?? "",
5798
+ onChange: (e) => setRefractionField(
5799
+ "refraction",
5800
+ "left_eye",
5801
+ "axis",
5802
+ e.target.value,
5803
+ "int"
5804
+ )
5805
+ }
5806
+ ) }),
5807
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5808
+ "select",
5809
+ {
5810
+ disabled,
5811
+ className: selectClass,
5812
+ value: safe.refraction.left_eye.va,
5813
+ onChange: (e) => setRefractionField(
5814
+ "refraction",
5815
+ "left_eye",
5816
+ "va",
5817
+ e.target.value,
5818
+ "select"
5819
+ ),
5820
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5821
+ }
5822
+ ) }),
5823
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5824
+ Input,
5825
+ {
5826
+ disabled,
5827
+ type: "number",
5828
+ min: 10,
5829
+ max: 45,
5830
+ step: "1",
5831
+ className: numberInputClass,
5832
+ value: safe.refraction.left_eye.pd ?? "",
5833
+ onChange: (e) => setRefractionField("refraction", "left_eye", "pd", e.target.value, "int")
5834
+ }
5835
+ ) })
5836
+ ] }),
5837
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5838
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Add" }),
5839
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
5840
+ Input,
5841
+ {
5842
+ disabled,
5843
+ type: "number",
5844
+ step: "0.25",
5845
+ className: numberInputClass,
5846
+ value: safe.refraction.add.right ?? "",
5847
+ onChange: (e) => setRefractionAdd("refraction", "right", e.target.value)
5848
+ }
5849
+ ) }),
5850
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
5851
+ Input,
5852
+ {
5853
+ disabled,
5854
+ type: "number",
5855
+ step: "0.25",
5856
+ className: numberInputClass,
5857
+ value: safe.refraction.add.left ?? "",
5858
+ onChange: (e) => setRefractionAdd("refraction", "left", e.target.value)
5859
+ }
5860
+ ) })
5861
+ ] })
5862
+ ] })
5863
+ ] }) })
5864
+ ] }),
5865
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
5866
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Dilated Refraction" }) }),
5867
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionBodyClass, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableBaseClass, children: [
5868
+ /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
5869
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5870
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5871
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 5, children: "Right Eye" }),
5872
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 5, children: "Left Eye" })
5873
+ ] }),
5874
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5875
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
5876
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
5877
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
5878
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
5879
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Prism" }),
5880
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" }),
5881
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
5882
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
5883
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
5884
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Prism" }),
5885
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" })
5886
+ ] })
5887
+ ] }),
5888
+ /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
5889
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5890
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Dilated" }),
5891
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5892
+ Input,
5893
+ {
5894
+ disabled,
5895
+ type: "number",
5896
+ step: "0.25",
5897
+ className: numberInputClass,
5898
+ value: safe.dilated_refraction.right_eye.sph ?? "",
5899
+ onChange: (e) => setRefractionField(
5900
+ "dilated_refraction",
5901
+ "right_eye",
5902
+ "sph",
5903
+ e.target.value,
5904
+ "float"
5905
+ )
5906
+ }
5907
+ ) }),
5908
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5909
+ Input,
5910
+ {
5911
+ disabled,
5912
+ type: "number",
5913
+ step: "0.25",
5914
+ className: numberInputClass,
5915
+ value: safe.dilated_refraction.right_eye.cyl ?? "",
5916
+ onChange: (e) => setRefractionField(
5917
+ "dilated_refraction",
5918
+ "right_eye",
5919
+ "cyl",
5920
+ e.target.value,
5921
+ "float"
5922
+ )
5923
+ }
5924
+ ) }),
5925
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5926
+ Input,
5927
+ {
5928
+ disabled,
5929
+ type: "number",
5930
+ className: numberInputClass,
5931
+ value: safe.dilated_refraction.right_eye.axis ?? "",
5932
+ onChange: (e) => setRefractionField(
5933
+ "dilated_refraction",
5934
+ "right_eye",
5935
+ "axis",
5936
+ e.target.value,
5937
+ "int"
5938
+ )
5939
+ }
5940
+ ) }),
5941
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5942
+ Input,
5943
+ {
5944
+ disabled,
5945
+ type: "number",
5946
+ step: "0.25",
5947
+ className: numberInputClass,
5948
+ value: safe.dilated_refraction.right_eye.prism ?? "",
5949
+ onChange: (e) => setRefractionField(
5950
+ "dilated_refraction",
5951
+ "right_eye",
5952
+ "prism",
5953
+ e.target.value,
5954
+ "float"
5955
+ )
5956
+ }
5957
+ ) }),
5958
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5959
+ "select",
5960
+ {
5961
+ disabled,
5962
+ className: selectClass,
5963
+ value: safe.dilated_refraction.right_eye.va,
5964
+ onChange: (e) => setRefractionField(
5965
+ "dilated_refraction",
5966
+ "right_eye",
5967
+ "va",
5968
+ e.target.value,
5969
+ "select"
5970
+ ),
5971
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
5972
+ }
5973
+ ) }),
5974
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5975
+ Input,
5976
+ {
5977
+ disabled,
5978
+ type: "number",
5979
+ step: "0.25",
5980
+ className: numberInputClass,
5981
+ value: safe.dilated_refraction.left_eye.sph ?? "",
5982
+ onChange: (e) => setRefractionField(
5983
+ "dilated_refraction",
5984
+ "left_eye",
5985
+ "sph",
5986
+ e.target.value,
5987
+ "float"
5988
+ )
5989
+ }
5990
+ ) }),
5991
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
5992
+ Input,
5993
+ {
5994
+ disabled,
5995
+ type: "number",
5996
+ step: "0.25",
5997
+ className: numberInputClass,
5998
+ value: safe.dilated_refraction.left_eye.cyl ?? "",
5999
+ onChange: (e) => setRefractionField(
6000
+ "dilated_refraction",
6001
+ "left_eye",
6002
+ "cyl",
6003
+ e.target.value,
6004
+ "float"
6005
+ )
6006
+ }
6007
+ ) }),
6008
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6009
+ Input,
6010
+ {
6011
+ disabled,
6012
+ type: "number",
6013
+ className: numberInputClass,
6014
+ value: safe.dilated_refraction.left_eye.axis ?? "",
6015
+ onChange: (e) => setRefractionField(
6016
+ "dilated_refraction",
6017
+ "left_eye",
6018
+ "axis",
6019
+ e.target.value,
6020
+ "int"
6021
+ )
6022
+ }
6023
+ ) }),
6024
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6025
+ Input,
6026
+ {
6027
+ disabled,
6028
+ type: "number",
6029
+ step: "0.25",
6030
+ className: numberInputClass,
6031
+ value: safe.dilated_refraction.left_eye.prism ?? "",
6032
+ onChange: (e) => setRefractionField(
6033
+ "dilated_refraction",
6034
+ "left_eye",
6035
+ "prism",
6036
+ e.target.value,
6037
+ "float"
6038
+ )
6039
+ }
6040
+ ) }),
6041
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6042
+ "select",
6043
+ {
6044
+ disabled,
6045
+ className: selectClass,
6046
+ value: safe.dilated_refraction.left_eye.va,
6047
+ onChange: (e) => setRefractionField(
6048
+ "dilated_refraction",
6049
+ "left_eye",
6050
+ "va",
6051
+ e.target.value,
6052
+ "select"
6053
+ ),
6054
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
6055
+ }
6056
+ ) })
6057
+ ] }),
6058
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6059
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Add" }),
6060
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
6061
+ Input,
6062
+ {
6063
+ disabled,
6064
+ type: "number",
6065
+ step: "0.25",
6066
+ className: numberInputClass,
6067
+ value: safe.dilated_refraction.add.right ?? "",
6068
+ onChange: (e) => setRefractionAdd("dilated_refraction", "right", e.target.value)
6069
+ }
6070
+ ) }),
6071
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
6072
+ Input,
6073
+ {
6074
+ disabled,
6075
+ type: "number",
6076
+ step: "0.25",
6077
+ className: numberInputClass,
6078
+ value: safe.dilated_refraction.add.left ?? "",
6079
+ onChange: (e) => setRefractionAdd("dilated_refraction", "left", e.target.value)
6080
+ }
6081
+ ) })
6082
+ ] })
6083
+ ] })
6084
+ ] }) })
6085
+ ] }),
6086
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
6087
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Glass Power Prescription" }) }),
6088
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionBodyClass, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableBaseClass, children: [
6089
+ /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
6090
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6091
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
6092
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 5, children: "Right Eye" }),
6093
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, colSpan: 5, children: "Left Eye" })
6094
+ ] }),
6095
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6096
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass }),
6097
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
6098
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
6099
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
6100
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Prism" }),
6101
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" }),
6102
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Sph" }),
6103
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Cyl" }),
6104
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Axis" }),
6105
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "Prism" }),
6106
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: tableHeaderCellClass, children: "V/A" })
6107
+ ] })
6108
+ ] }),
6109
+ /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
6110
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6111
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Glass Power" }),
6112
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6113
+ Input,
6114
+ {
6115
+ disabled,
6116
+ type: "number",
6117
+ step: "0.25",
6118
+ className: numberInputClass,
6119
+ value: safe.glass_power_prescription.right_eye.sph ?? "",
6120
+ onChange: (e) => setRefractionField(
6121
+ "glass_power_prescription",
6122
+ "right_eye",
6123
+ "sph",
6124
+ e.target.value,
6125
+ "float"
6126
+ )
6127
+ }
6128
+ ) }),
6129
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6130
+ Input,
6131
+ {
6132
+ disabled,
6133
+ type: "number",
6134
+ step: "0.25",
6135
+ className: numberInputClass,
6136
+ value: safe.glass_power_prescription.right_eye.cyl ?? "",
6137
+ onChange: (e) => setRefractionField(
6138
+ "glass_power_prescription",
6139
+ "right_eye",
6140
+ "cyl",
6141
+ e.target.value,
6142
+ "float"
6143
+ )
6144
+ }
6145
+ ) }),
6146
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6147
+ Input,
6148
+ {
6149
+ disabled,
6150
+ type: "number",
6151
+ className: numberInputClass,
6152
+ value: safe.glass_power_prescription.right_eye.axis ?? "",
6153
+ onChange: (e) => setRefractionField(
6154
+ "glass_power_prescription",
6155
+ "right_eye",
6156
+ "axis",
6157
+ e.target.value,
6158
+ "int"
6159
+ )
6160
+ }
6161
+ ) }),
6162
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6163
+ Input,
6164
+ {
6165
+ disabled,
6166
+ type: "number",
6167
+ step: "0.25",
6168
+ className: numberInputClass,
6169
+ value: safe.glass_power_prescription.right_eye.prism ?? "",
6170
+ onChange: (e) => setRefractionField(
6171
+ "glass_power_prescription",
6172
+ "right_eye",
6173
+ "prism",
6174
+ e.target.value,
6175
+ "float"
6176
+ )
6177
+ }
6178
+ ) }),
6179
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6180
+ "select",
6181
+ {
6182
+ disabled,
6183
+ className: selectClass,
6184
+ value: safe.glass_power_prescription.right_eye.va,
6185
+ onChange: (e) => setRefractionField(
6186
+ "glass_power_prescription",
6187
+ "right_eye",
6188
+ "va",
6189
+ e.target.value,
6190
+ "select"
6191
+ ),
6192
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
6193
+ }
6194
+ ) }),
6195
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6196
+ Input,
6197
+ {
6198
+ disabled,
6199
+ type: "number",
6200
+ step: "0.25",
6201
+ className: numberInputClass,
6202
+ value: safe.glass_power_prescription.left_eye.sph ?? "",
6203
+ onChange: (e) => setRefractionField(
6204
+ "glass_power_prescription",
6205
+ "left_eye",
6206
+ "sph",
6207
+ e.target.value,
6208
+ "float"
6209
+ )
6210
+ }
6211
+ ) }),
6212
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6213
+ Input,
6214
+ {
6215
+ disabled,
6216
+ type: "number",
6217
+ step: "0.25",
6218
+ className: numberInputClass,
6219
+ value: safe.glass_power_prescription.left_eye.cyl ?? "",
6220
+ onChange: (e) => setRefractionField(
6221
+ "glass_power_prescription",
6222
+ "left_eye",
6223
+ "cyl",
6224
+ e.target.value,
6225
+ "float"
6226
+ )
6227
+ }
6228
+ ) }),
6229
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6230
+ Input,
6231
+ {
6232
+ disabled,
6233
+ type: "number",
6234
+ className: numberInputClass,
6235
+ value: safe.glass_power_prescription.left_eye.axis ?? "",
6236
+ onChange: (e) => setRefractionField(
6237
+ "glass_power_prescription",
6238
+ "left_eye",
6239
+ "axis",
6240
+ e.target.value,
6241
+ "int"
6242
+ )
6243
+ }
6244
+ ) }),
6245
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6246
+ Input,
6247
+ {
6248
+ disabled,
6249
+ type: "number",
6250
+ step: "0.25",
6251
+ className: numberInputClass,
6252
+ value: safe.glass_power_prescription.left_eye.prism ?? "",
6253
+ onChange: (e) => setRefractionField(
6254
+ "glass_power_prescription",
6255
+ "left_eye",
6256
+ "prism",
6257
+ e.target.value,
6258
+ "float"
6259
+ )
6260
+ }
6261
+ ) }),
6262
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6263
+ "select",
6264
+ {
6265
+ disabled,
6266
+ className: selectClass,
6267
+ value: safe.glass_power_prescription.left_eye.va,
6268
+ onChange: (e) => setRefractionField(
6269
+ "glass_power_prescription",
6270
+ "left_eye",
6271
+ "va",
6272
+ e.target.value,
6273
+ "select"
6274
+ ),
6275
+ children: VA_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt || "blank"))
6276
+ }
6277
+ ) })
6278
+ ] }),
6279
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6280
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(tableCellClass, "font-semibold text-left px-2"), children: "Add" }),
6281
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
6282
+ Input,
6283
+ {
6284
+ disabled,
6285
+ type: "number",
6286
+ step: "0.25",
6287
+ className: numberInputClass,
6288
+ value: safe.glass_power_prescription.add.right ?? "",
6289
+ onChange: (e) => setRefractionAdd("glass_power_prescription", "right", e.target.value)
6290
+ }
6291
+ ) }),
6292
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: tableCellClass, colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
6293
+ Input,
6294
+ {
6295
+ disabled,
6296
+ type: "number",
6297
+ step: "0.25",
6298
+ className: numberInputClass,
6299
+ value: safe.glass_power_prescription.add.left ?? "",
6300
+ onChange: (e) => setRefractionAdd("glass_power_prescription", "left", e.target.value)
6301
+ }
6302
+ ) })
6303
+ ] })
6304
+ ] })
6305
+ ] }) })
6306
+ ] }),
6307
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: sectionWrapperClass, children: [
6308
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionHeaderClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Notes" }) }),
6309
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sectionBodyClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6310
+ Textarea,
6311
+ {
6312
+ disabled,
6313
+ rows: 4,
6314
+ className: "w-full text-xs min-h-[100px]",
6315
+ placeholder: "Enter additional notes...",
6316
+ value: safe.notes,
6317
+ onChange: (e) => setNotes(e.target.value)
6318
+ }
6319
+ ) })
6320
+ ] })
6321
+ ] });
6322
+ };
6323
+ var DIAGNOSIS_FIELDS = [
6324
+ "INJURY",
6325
+ "APPENDAGES",
6326
+ "CONJUNCTIVA",
6327
+ "SCLERA",
6328
+ "CORNEA",
6329
+ "ANTERIOR CHAMBER (AC)",
6330
+ "PUPIL",
6331
+ "IRIS",
6332
+ "LENS",
6333
+ "EXTRAOCULAR MOVEMENTS & SQUINT",
6334
+ "INTRAOCULAR PRESSURE (IOP)",
6335
+ "GONIOSCOPY",
6336
+ "FUNDUS"
6337
+ ];
6338
+ function ensureValue2(raw) {
6339
+ const v = raw || {};
6340
+ return {
6341
+ right_eye: v.right_eye ?? {},
6342
+ left_eye: v.left_eye ?? {}
6343
+ };
6344
+ }
6345
+ var containerClass = "rounded-md bg-white overflow-hidden flex flex-col";
6346
+ var headerClass = "px-3 py-2 text-sm font-medium text-slate-800 border-b border-slate-200";
6347
+ var tableClass = "w-full text-xs";
6348
+ var headerCellClass = "border border-slate-200 px-2 py-1 text-center font-semibold align-middle";
6349
+ var cellClass = "border border-slate-200 px-2 py-1 align-top";
6350
+ var OphthalDiagnosisWidget = ({ fieldId }) => {
6351
+ const { fieldDef, value, setValue, disabled } = useField(fieldId);
6352
+ const safe = React11.useMemo(() => ensureValue2(value), [value]);
6353
+ const label = fieldDef?.label || "";
6354
+ const updateEyeField = (eye, fieldLabel, next) => {
6355
+ if (disabled) return;
6356
+ const prev = ensureValue2(value);
6357
+ setValue({
6358
+ ...prev,
6359
+ [eye]: {
6360
+ ...prev[eye],
6361
+ [fieldLabel]: next
6362
+ }
6363
+ });
6364
+ };
6365
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2", disabled && "opacity-70 pointer-events-none"), children: [
6366
+ label && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-slate-800", children: label }),
6367
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: containerClass, children: [
6368
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: headerClass, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: "Diagnosis" }) }),
6369
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: tableClass, children: [
6370
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6371
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: cn(headerCellClass, "text-left px-3"), children: "Field" }),
6372
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: headerCellClass, children: "Right Eye" }),
6373
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: headerCellClass, children: "Left Eye" })
6374
+ ] }) }),
6375
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: DIAGNOSIS_FIELDS.map((fieldLabel) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6376
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(cellClass, "text-left font-semibold px-3"), children: fieldLabel }),
6377
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6378
+ Textarea,
6379
+ {
6380
+ disabled,
6381
+ rows: 2,
6382
+ className: "w-full text-xs min-h-[60px] resize-none",
6383
+ value: safe.right_eye[fieldLabel] ?? "",
6384
+ onChange: (e) => updateEyeField("right_eye", fieldLabel, e.target.value)
6385
+ }
6386
+ ) }),
6387
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: cellClass, children: /* @__PURE__ */ jsxRuntime.jsx(
6388
+ Textarea,
6389
+ {
6390
+ disabled,
6391
+ rows: 2,
6392
+ className: "w-full text-xs min-h-[60px] resize-none",
6393
+ value: safe.left_eye[fieldLabel] ?? "",
6394
+ onChange: (e) => updateEyeField("left_eye", fieldLabel, e.target.value)
6395
+ }
6396
+ ) })
6397
+ ] }, fieldLabel)) })
6398
+ ] }) })
6399
+ ] })
6400
+ ] });
6401
+ };
5013
6402
  var FieldRenderer = ({ fieldId }) => {
5014
6403
  const { fieldDef, visible } = useField(fieldId);
5015
6404
  if (!visible || !fieldDef) {
@@ -5052,6 +6441,8 @@ var FieldRenderer = ({ fieldId }) => {
5052
6441
  return /* @__PURE__ */ jsxRuntime.jsx(DifferentialDiagnosisWidget, { fieldId });
5053
6442
  case "vitals":
5054
6443
  return /* @__PURE__ */ jsxRuntime.jsx(VitalsWidget, { fieldId });
6444
+ case "hidden_vitals":
6445
+ return /* @__PURE__ */ jsxRuntime.jsx(HiddenVitalsWidget, { fieldId });
5055
6446
  case "referral":
5056
6447
  return /* @__PURE__ */ jsxRuntime.jsx(ReferralWidget, { fieldId });
5057
6448
  case "followup":
@@ -5060,6 +6451,10 @@ var FieldRenderer = ({ fieldId }) => {
5060
6451
  return /* @__PURE__ */ jsxRuntime.jsx(SmartTextareaWidget, { fieldId });
5061
6452
  case "obstetric_history":
5062
6453
  return /* @__PURE__ */ jsxRuntime.jsx(ObstetricHistoryWidget, { fieldId });
6454
+ case "eye_prescription":
6455
+ return /* @__PURE__ */ jsxRuntime.jsx(OphthalmologyWidget, { fieldId });
6456
+ case "ophthal_diagnosis":
6457
+ return /* @__PURE__ */ jsxRuntime.jsx(OphthalDiagnosisWidget, { fieldId });
5063
6458
  case "static_text": {
5064
6459
  const def = fieldDef;
5065
6460
  const size = def.size ?? "regular";