formanitor 0.0.37 → 0.0.39

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.d.cts CHANGED
@@ -84,6 +84,16 @@ interface RichTextFieldDef extends BaseFieldDef {
84
84
  interface NumberFieldDef extends BaseFieldDef {
85
85
  type: 'number';
86
86
  }
87
+ /** Single-thumb numeric slider (e.g. VAS 0–10). Value is a number. */
88
+ interface SliderFieldDef extends BaseFieldDef {
89
+ type: 'slider';
90
+ /** Inclusive minimum. Default 0. */
91
+ min?: number;
92
+ /** Inclusive maximum. Default 10. */
93
+ max?: number;
94
+ /** Default 1. */
95
+ step?: number;
96
+ }
87
97
  /** Option for select/radio/checkbox. When score is set, sum computation uses it for aggregation. */
88
98
  interface SelectOption {
89
99
  label: string;
@@ -262,6 +272,149 @@ interface DiagnosisTextareaFieldDef extends BaseFieldDef {
262
272
  /** Debounce delay in ms before API call triggers. Default: 700. */
263
273
  debounceDelay?: number;
264
274
  }
275
+ /**
276
+ * Reusable **textarea** with optional **suggestion chips** (schema `options` or `dataSource`).
277
+ * - Value is a **single string** (same as `textarea`); chip clicks append or remove that option’s
278
+ * `value` as a comma‑separated token (default `", "`; override with `meta.appendSeparator`).
279
+ * - Schema `rules` with `op: "contains"` on this field match **token equality** after splitting
280
+ * on commas (see `evaluateRules` / `suggestion_textarea` docs).
281
+ * - Optionally set **`meta.parallelChipFieldId`** to the id of a **`multiselect`** field (often
282
+ * `hidden`) with the same `options`; that field’s array value is derived from chip tokens in
283
+ * the textarea string so APIs can read a structured list without parsing commas.
284
+ * - `complaint_chips` is an alias type string for the same widget (e.g. chief complaints).
285
+ */
286
+ interface SuggestionTextareaFieldDef extends BaseFieldDef {
287
+ type: 'suggestion_textarea' | 'complaint_chips';
288
+ options?: SelectOption[];
289
+ /** Height in pixels for the textarea. */
290
+ height?: number;
291
+ meta?: {
292
+ /** Join string when writing tokens (default `", "`). */
293
+ appendSeparator?: string;
294
+ /** `aria-label` for the chip group. */
295
+ suggestionsAriaLabel?: string;
296
+ /**
297
+ * ID of a sibling **`multiselect`** field (usually `hidden: true`). Its value is kept in sync
298
+ * as an array of selected chip values derived from the comma-separated textarea string.
299
+ */
300
+ parallelChipFieldId?: string;
301
+ /**
302
+ * Optional sibling field ids rendered **inside** the suggestion shell (between chips and the
303
+ * free-text area). Typically `text` / `select` fields (e.g. duration, onset). Those fields
304
+ * should use **`hidden: true`** and be **omitted from `layout`** so they are not shown twice.
305
+ */
306
+ embeddedFieldIds?: string[];
307
+ } & Record<string, unknown>;
308
+ }
309
+ /** LOCS III component grades for one eye (integer scales per LOCS III). */
310
+ interface LocsGrades {
311
+ NO: number;
312
+ NC: number;
313
+ C: number;
314
+ PSC: number;
315
+ }
316
+ /** Value stored for `lens_assessment` fields. */
317
+ interface LensAssessmentValue {
318
+ notes: string;
319
+ /**
320
+ * Legacy optional key from older templates; LOCS UI does not surface chips.
321
+ * Kept for backward compatibility with saved submissions.
322
+ */
323
+ assessmentKey?: string;
324
+ /** LOCS III grades; omitted in older payloads — normalized to zeros in the widget. */
325
+ locs?: {
326
+ OD: LocsGrades;
327
+ OS: LocsGrades;
328
+ };
329
+ }
330
+ /**
331
+ * Ophthalmology lens assessment: LOCS III grid (OD/OS), derived cataract-stage badges,
332
+ * optional clinical notes. Shown via schema rules (e.g. chief-complaint `contains`).
333
+ */
334
+ interface LensAssessmentFieldDef extends BaseFieldDef {
335
+ type: 'lens_assessment';
336
+ meta?: {
337
+ cardTitle?: string;
338
+ } & Record<string, unknown>;
339
+ }
340
+ /** Keys for the five-item functional impairment scale (0–3 each). */
341
+ type FunctionalImpairmentDimension = 'reading' | 'nightDriving' | 'glare' | 'occupation' | 'adl';
342
+ /** Stored value for `functional_impairment_score` fields (sum 0–15). */
343
+ interface FunctionalImpairmentScoreValue {
344
+ reading: number;
345
+ nightDriving: number;
346
+ glare: number;
347
+ occupation: number;
348
+ adl: number;
349
+ }
350
+ /**
351
+ * Cataract-related functional impairment: five 0–3 items and total /15.
352
+ */
353
+ interface FunctionalImpairmentScoreFieldDef extends BaseFieldDef {
354
+ type: 'functional_impairment_score';
355
+ meta?: {
356
+ cardTitle?: string;
357
+ } & Record<string, unknown>;
358
+ }
359
+ /** Biometry acquisition method (IOL workup). */
360
+ type BiometryMethod = 'optical_biometry' | 'ascan_immersion' | 'ascan_contact';
361
+ /** Value for `biometry_iol_workup` — bilateral inputs, shared formula/method, optional workup flags. */
362
+ interface BiometryIolWorkupValue {
363
+ axialLengthOD: string;
364
+ axialLengthOS: string;
365
+ k1k2AxisOD: string;
366
+ k1k2AxisOS: string;
367
+ anteriorChamberDepthOD: string;
368
+ anteriorChamberDepthOS: string;
369
+ iolPowerOD: string;
370
+ iolPowerOS: string;
371
+ targetRefractionOD: string;
372
+ targetRefractionOS: string;
373
+ formula: string;
374
+ method: BiometryMethod;
375
+ cornealTopoUploaded: boolean;
376
+ specularMicroscopyDone: boolean;
377
+ endothelialCount: string;
378
+ }
379
+ /** Table + IOL formula workup (Stage 7). */
380
+ interface BiometryIolWorkupFieldDef extends BaseFieldDef {
381
+ type: 'biometry_iol_workup';
382
+ meta?: {
383
+ cardTitle?: string;
384
+ } & Record<string, unknown>;
385
+ }
386
+ /** Per-eye surgical risk checkbox selections; Diabetes is kept in sync for OD and OS. */
387
+ interface SurgicalRiskFlagsValue {
388
+ OD: string[];
389
+ OS: string[];
390
+ }
391
+ /** Bilateral cataract surgical risk flags with derived Low/Moderate/High badge per eye (Stage 11). */
392
+ interface SurgicalRiskFlagsFieldDef extends BaseFieldDef {
393
+ type: 'surgical_risk_flags';
394
+ meta?: {
395
+ cardTitle?: string;
396
+ } & Record<string, unknown>;
397
+ }
398
+ /** General surgery OPD: structured smart history (SOCRATES, swelling, GI, breast, anorectal, thyroid + systemic). */
399
+ interface GeneralSurgerySmartHistoryFieldDef extends BaseFieldDef {
400
+ type: 'general_surgery_smart_history';
401
+ }
402
+ /** General surgery OPD: general signs, regional selection, structured abdomen + regional exam cards + notes. */
403
+ interface GeneralSurgeryExaminationFieldDef extends BaseFieldDef {
404
+ type: 'general_surgery_examination';
405
+ }
406
+ /** General surgery OPD: condition-wise grading (Clearsight triggers; no surgery column). */
407
+ interface GeneralSurgeryGradingFieldDef extends BaseFieldDef {
408
+ type: 'general_surgery_grading';
409
+ }
410
+ /** Pain scale (slider) + checkbox flags in one highlight-label shell; reusable across specialties. */
411
+ interface PainScaleFlagsFieldDef extends BaseFieldDef {
412
+ type: 'pain_scale_flags';
413
+ min?: number;
414
+ max?: number;
415
+ step?: number;
416
+ options?: SelectOption[];
417
+ }
265
418
  interface MedicationFrequentItem {
266
419
  id: string;
267
420
  name: string;
@@ -320,7 +473,11 @@ interface DiagnosticPackage {
320
473
  department?: string;
321
474
  tests: DiagnosticPackageTest[];
322
475
  }
323
- type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | ToggleFieldDef | BaseFieldDef;
476
+ type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SliderFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | SuggestionTextareaFieldDef | LensAssessmentFieldDef | FunctionalImpairmentScoreFieldDef | ToggleFieldDef | BiometryIolWorkupFieldDef | SurgicalRiskFlagsFieldDef | GeneralSurgerySmartHistoryFieldDef | GeneralSurgeryExaminationFieldDef | GeneralSurgeryGradingFieldDef | PainScaleFlagsFieldDef | BaseFieldDef;
477
+ /** Boolean switch; value is `true` | `false`. */
478
+ interface ToggleFieldDef extends BaseFieldDef {
479
+ type: 'toggle';
480
+ }
324
481
  interface ToggleFieldDef extends BaseFieldDef {
325
482
  type: 'toggle';
326
483
  excludes?: string[];
@@ -328,6 +485,12 @@ interface ToggleFieldDef extends BaseFieldDef {
328
485
  interface Condition {
329
486
  field?: string;
330
487
  op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
488
+ /**
489
+ * For `op: "contains"`:
490
+ * - If the field value is an **array**, checks `value.includes(condition.value)` (e.g. multiselect).
491
+ * - If the field value is a **string** (e.g. `suggestion_textarea`), splits on commas, trims
492
+ * tokens, and checks that one token equals `String(condition.value)` (chip values in text).
493
+ */
331
494
  value: any;
332
495
  }
333
496
  interface RuleAction {
@@ -958,4 +1121,4 @@ declare const SmartTextareaWidget: React.FC<{
958
1121
  fieldId: string;
959
1122
  }>;
960
1123
 
961
- export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SumComputation, type TextFieldDef, type ToggleFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };
1124
+ export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type BiometryIolWorkupFieldDef, type BiometryIolWorkupValue, type BiometryMethod, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type FunctionalImpairmentDimension, type FunctionalImpairmentScoreFieldDef, type FunctionalImpairmentScoreValue, type GeneralSurgeryExaminationFieldDef, type GeneralSurgeryGradingFieldDef, type GeneralSurgerySmartHistoryFieldDef, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type LensAssessmentFieldDef, type LensAssessmentValue, type LocsGrades, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type PainScaleFlagsFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, type SliderFieldDef, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SuggestionTextareaFieldDef, type SumComputation, type SurgicalRiskFlagsFieldDef, type SurgicalRiskFlagsValue, type TextFieldDef, type ToggleFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };
package/dist/index.d.ts CHANGED
@@ -84,6 +84,16 @@ interface RichTextFieldDef extends BaseFieldDef {
84
84
  interface NumberFieldDef extends BaseFieldDef {
85
85
  type: 'number';
86
86
  }
87
+ /** Single-thumb numeric slider (e.g. VAS 0–10). Value is a number. */
88
+ interface SliderFieldDef extends BaseFieldDef {
89
+ type: 'slider';
90
+ /** Inclusive minimum. Default 0. */
91
+ min?: number;
92
+ /** Inclusive maximum. Default 10. */
93
+ max?: number;
94
+ /** Default 1. */
95
+ step?: number;
96
+ }
87
97
  /** Option for select/radio/checkbox. When score is set, sum computation uses it for aggregation. */
88
98
  interface SelectOption {
89
99
  label: string;
@@ -262,6 +272,149 @@ interface DiagnosisTextareaFieldDef extends BaseFieldDef {
262
272
  /** Debounce delay in ms before API call triggers. Default: 700. */
263
273
  debounceDelay?: number;
264
274
  }
275
+ /**
276
+ * Reusable **textarea** with optional **suggestion chips** (schema `options` or `dataSource`).
277
+ * - Value is a **single string** (same as `textarea`); chip clicks append or remove that option’s
278
+ * `value` as a comma‑separated token (default `", "`; override with `meta.appendSeparator`).
279
+ * - Schema `rules` with `op: "contains"` on this field match **token equality** after splitting
280
+ * on commas (see `evaluateRules` / `suggestion_textarea` docs).
281
+ * - Optionally set **`meta.parallelChipFieldId`** to the id of a **`multiselect`** field (often
282
+ * `hidden`) with the same `options`; that field’s array value is derived from chip tokens in
283
+ * the textarea string so APIs can read a structured list without parsing commas.
284
+ * - `complaint_chips` is an alias type string for the same widget (e.g. chief complaints).
285
+ */
286
+ interface SuggestionTextareaFieldDef extends BaseFieldDef {
287
+ type: 'suggestion_textarea' | 'complaint_chips';
288
+ options?: SelectOption[];
289
+ /** Height in pixels for the textarea. */
290
+ height?: number;
291
+ meta?: {
292
+ /** Join string when writing tokens (default `", "`). */
293
+ appendSeparator?: string;
294
+ /** `aria-label` for the chip group. */
295
+ suggestionsAriaLabel?: string;
296
+ /**
297
+ * ID of a sibling **`multiselect`** field (usually `hidden: true`). Its value is kept in sync
298
+ * as an array of selected chip values derived from the comma-separated textarea string.
299
+ */
300
+ parallelChipFieldId?: string;
301
+ /**
302
+ * Optional sibling field ids rendered **inside** the suggestion shell (between chips and the
303
+ * free-text area). Typically `text` / `select` fields (e.g. duration, onset). Those fields
304
+ * should use **`hidden: true`** and be **omitted from `layout`** so they are not shown twice.
305
+ */
306
+ embeddedFieldIds?: string[];
307
+ } & Record<string, unknown>;
308
+ }
309
+ /** LOCS III component grades for one eye (integer scales per LOCS III). */
310
+ interface LocsGrades {
311
+ NO: number;
312
+ NC: number;
313
+ C: number;
314
+ PSC: number;
315
+ }
316
+ /** Value stored for `lens_assessment` fields. */
317
+ interface LensAssessmentValue {
318
+ notes: string;
319
+ /**
320
+ * Legacy optional key from older templates; LOCS UI does not surface chips.
321
+ * Kept for backward compatibility with saved submissions.
322
+ */
323
+ assessmentKey?: string;
324
+ /** LOCS III grades; omitted in older payloads — normalized to zeros in the widget. */
325
+ locs?: {
326
+ OD: LocsGrades;
327
+ OS: LocsGrades;
328
+ };
329
+ }
330
+ /**
331
+ * Ophthalmology lens assessment: LOCS III grid (OD/OS), derived cataract-stage badges,
332
+ * optional clinical notes. Shown via schema rules (e.g. chief-complaint `contains`).
333
+ */
334
+ interface LensAssessmentFieldDef extends BaseFieldDef {
335
+ type: 'lens_assessment';
336
+ meta?: {
337
+ cardTitle?: string;
338
+ } & Record<string, unknown>;
339
+ }
340
+ /** Keys for the five-item functional impairment scale (0–3 each). */
341
+ type FunctionalImpairmentDimension = 'reading' | 'nightDriving' | 'glare' | 'occupation' | 'adl';
342
+ /** Stored value for `functional_impairment_score` fields (sum 0–15). */
343
+ interface FunctionalImpairmentScoreValue {
344
+ reading: number;
345
+ nightDriving: number;
346
+ glare: number;
347
+ occupation: number;
348
+ adl: number;
349
+ }
350
+ /**
351
+ * Cataract-related functional impairment: five 0–3 items and total /15.
352
+ */
353
+ interface FunctionalImpairmentScoreFieldDef extends BaseFieldDef {
354
+ type: 'functional_impairment_score';
355
+ meta?: {
356
+ cardTitle?: string;
357
+ } & Record<string, unknown>;
358
+ }
359
+ /** Biometry acquisition method (IOL workup). */
360
+ type BiometryMethod = 'optical_biometry' | 'ascan_immersion' | 'ascan_contact';
361
+ /** Value for `biometry_iol_workup` — bilateral inputs, shared formula/method, optional workup flags. */
362
+ interface BiometryIolWorkupValue {
363
+ axialLengthOD: string;
364
+ axialLengthOS: string;
365
+ k1k2AxisOD: string;
366
+ k1k2AxisOS: string;
367
+ anteriorChamberDepthOD: string;
368
+ anteriorChamberDepthOS: string;
369
+ iolPowerOD: string;
370
+ iolPowerOS: string;
371
+ targetRefractionOD: string;
372
+ targetRefractionOS: string;
373
+ formula: string;
374
+ method: BiometryMethod;
375
+ cornealTopoUploaded: boolean;
376
+ specularMicroscopyDone: boolean;
377
+ endothelialCount: string;
378
+ }
379
+ /** Table + IOL formula workup (Stage 7). */
380
+ interface BiometryIolWorkupFieldDef extends BaseFieldDef {
381
+ type: 'biometry_iol_workup';
382
+ meta?: {
383
+ cardTitle?: string;
384
+ } & Record<string, unknown>;
385
+ }
386
+ /** Per-eye surgical risk checkbox selections; Diabetes is kept in sync for OD and OS. */
387
+ interface SurgicalRiskFlagsValue {
388
+ OD: string[];
389
+ OS: string[];
390
+ }
391
+ /** Bilateral cataract surgical risk flags with derived Low/Moderate/High badge per eye (Stage 11). */
392
+ interface SurgicalRiskFlagsFieldDef extends BaseFieldDef {
393
+ type: 'surgical_risk_flags';
394
+ meta?: {
395
+ cardTitle?: string;
396
+ } & Record<string, unknown>;
397
+ }
398
+ /** General surgery OPD: structured smart history (SOCRATES, swelling, GI, breast, anorectal, thyroid + systemic). */
399
+ interface GeneralSurgerySmartHistoryFieldDef extends BaseFieldDef {
400
+ type: 'general_surgery_smart_history';
401
+ }
402
+ /** General surgery OPD: general signs, regional selection, structured abdomen + regional exam cards + notes. */
403
+ interface GeneralSurgeryExaminationFieldDef extends BaseFieldDef {
404
+ type: 'general_surgery_examination';
405
+ }
406
+ /** General surgery OPD: condition-wise grading (Clearsight triggers; no surgery column). */
407
+ interface GeneralSurgeryGradingFieldDef extends BaseFieldDef {
408
+ type: 'general_surgery_grading';
409
+ }
410
+ /** Pain scale (slider) + checkbox flags in one highlight-label shell; reusable across specialties. */
411
+ interface PainScaleFlagsFieldDef extends BaseFieldDef {
412
+ type: 'pain_scale_flags';
413
+ min?: number;
414
+ max?: number;
415
+ step?: number;
416
+ options?: SelectOption[];
417
+ }
265
418
  interface MedicationFrequentItem {
266
419
  id: string;
267
420
  name: string;
@@ -320,7 +473,11 @@ interface DiagnosticPackage {
320
473
  department?: string;
321
474
  tests: DiagnosticPackageTest[];
322
475
  }
323
- type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | ToggleFieldDef | BaseFieldDef;
476
+ type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SliderFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | SuggestionTextareaFieldDef | LensAssessmentFieldDef | FunctionalImpairmentScoreFieldDef | ToggleFieldDef | BiometryIolWorkupFieldDef | SurgicalRiskFlagsFieldDef | GeneralSurgerySmartHistoryFieldDef | GeneralSurgeryExaminationFieldDef | GeneralSurgeryGradingFieldDef | PainScaleFlagsFieldDef | BaseFieldDef;
477
+ /** Boolean switch; value is `true` | `false`. */
478
+ interface ToggleFieldDef extends BaseFieldDef {
479
+ type: 'toggle';
480
+ }
324
481
  interface ToggleFieldDef extends BaseFieldDef {
325
482
  type: 'toggle';
326
483
  excludes?: string[];
@@ -328,6 +485,12 @@ interface ToggleFieldDef extends BaseFieldDef {
328
485
  interface Condition {
329
486
  field?: string;
330
487
  op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
488
+ /**
489
+ * For `op: "contains"`:
490
+ * - If the field value is an **array**, checks `value.includes(condition.value)` (e.g. multiselect).
491
+ * - If the field value is a **string** (e.g. `suggestion_textarea`), splits on commas, trims
492
+ * tokens, and checks that one token equals `String(condition.value)` (chip values in text).
493
+ */
331
494
  value: any;
332
495
  }
333
496
  interface RuleAction {
@@ -958,4 +1121,4 @@ declare const SmartTextareaWidget: React.FC<{
958
1121
  fieldId: string;
959
1122
  }>;
960
1123
 
961
- export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SumComputation, type TextFieldDef, type ToggleFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };
1124
+ export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type BiometryIolWorkupFieldDef, type BiometryIolWorkupValue, type BiometryMethod, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type FunctionalImpairmentDimension, type FunctionalImpairmentScoreFieldDef, type FunctionalImpairmentScoreValue, type GeneralSurgeryExaminationFieldDef, type GeneralSurgeryGradingFieldDef, type GeneralSurgerySmartHistoryFieldDef, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type LensAssessmentFieldDef, type LensAssessmentValue, type LocsGrades, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type PainScaleFlagsFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, type SliderFieldDef, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreConfig, type SubmissionData, type SuggestionTextareaFieldDef, type SumComputation, type SurgicalRiskFlagsFieldDef, type SurgicalRiskFlagsValue, type TextFieldDef, type ToggleFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };