formanitor 0.0.31 → 0.0.33

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
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- type FieldType = 'text' | 'number' | 'textarea' | 'diagnosis_textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
3
+ type FieldType = 'text' | 'number' | 'textarea' | 'diagnosis_textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'media_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
4
4
  interface ValidationRule {
5
5
  min?: number;
6
6
  max?: number;
@@ -112,6 +112,12 @@ interface ImageUploadFieldDef extends BaseFieldDef {
112
112
  maxSize?: number;
113
113
  acceptedTypes?: string[];
114
114
  }
115
+ interface MediaUploadFieldDef extends BaseFieldDef {
116
+ type: 'media_upload';
117
+ maxSize?: number;
118
+ /** Default: images (image/*) and application/pdf */
119
+ acceptedTypes?: string[];
120
+ }
115
121
  interface SignatureFieldDef extends BaseFieldDef {
116
122
  type: 'signature';
117
123
  canvasWidth?: number;
@@ -302,7 +308,7 @@ interface DoctorFrequentItems {
302
308
  investigations?: InvestigationFrequentItem[];
303
309
  procedures?: ProcedureFrequentItem[];
304
310
  }
305
- type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | BaseFieldDef;
311
+ type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | BaseFieldDef;
306
312
  interface Condition {
307
313
  field?: string;
308
314
  op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
@@ -429,6 +435,9 @@ interface FormState {
429
435
  pendingUploads: number;
430
436
  }
431
437
 
438
+ declare const MAR_MEDICATION_ORDERS_META_KEY: "mar_medication_orders";
439
+ declare function fieldMetaRequestsMarMedicationOrdersButton(meta: Record<string, unknown> | undefined): boolean;
440
+
432
441
  interface SavedState {
433
442
  values: FormValues;
434
443
  meta: {
@@ -592,6 +601,16 @@ type FieldHandler = {
592
601
  * from diagnosis text input.
593
602
  */
594
603
  onFetchDiagnosisGrades?: (query: string) => Promise<any>;
604
+ /**
605
+ * Host opens MAR / medication-orders UI (e.g. IPD discharge). On success the host
606
+ * should update this field's value in form state.
607
+ */
608
+ onOpenMedicationOrders?: () => void | Promise<void>;
609
+ /**
610
+ * Host opens CMDash discharge medication orders slide-over. On save, return the
611
+ * prescription payload so the widget can normalize and store it in form state.
612
+ */
613
+ onOpenDischargeMedicationOrders?: () => Promise<any | null> | any | null;
595
614
  };
596
615
  type FieldHandlersMap = Record<string, FieldHandler>;
597
616
  declare function useFieldHandlers(fieldId: string): FieldHandler;
@@ -720,6 +739,10 @@ declare const ImageUploadWidget: React.FC<{
720
739
  fieldId: string;
721
740
  }>;
722
741
 
742
+ declare const MediaUploadWidget: React.FC<{
743
+ fieldId: string;
744
+ }>;
745
+
723
746
  declare const SignatureUploadWidget: React.FC<{
724
747
  fieldId: string;
725
748
  }>;
@@ -730,6 +753,12 @@ interface ReadOnlyImageUploadProps {
730
753
  }
731
754
  declare const ReadOnlyImageUpload: React.FC<ReadOnlyImageUploadProps>;
732
755
 
756
+ interface ReadOnlyMediaUploadProps {
757
+ fieldDef: BaseFieldDef;
758
+ value: any;
759
+ }
760
+ declare const ReadOnlyMediaUpload: React.FC<ReadOnlyMediaUploadProps>;
761
+
733
762
  interface ReadOnlySignatureProps {
734
763
  fieldDef: BaseFieldDef;
735
764
  value: any;
@@ -910,4 +939,4 @@ declare const SmartTextareaWidget: React.FC<{
910
939
  fieldId: string;
911
940
  }>;
912
941
 
913
- 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, 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, type MatchedCondition, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, 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 ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
942
+ 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, 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 ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- type FieldType = 'text' | 'number' | 'textarea' | 'diagnosis_textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
3
+ type FieldType = 'text' | 'number' | 'textarea' | 'diagnosis_textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'media_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | string;
4
4
  interface ValidationRule {
5
5
  min?: number;
6
6
  max?: number;
@@ -112,6 +112,12 @@ interface ImageUploadFieldDef extends BaseFieldDef {
112
112
  maxSize?: number;
113
113
  acceptedTypes?: string[];
114
114
  }
115
+ interface MediaUploadFieldDef extends BaseFieldDef {
116
+ type: 'media_upload';
117
+ maxSize?: number;
118
+ /** Default: images (image/*) and application/pdf */
119
+ acceptedTypes?: string[];
120
+ }
115
121
  interface SignatureFieldDef extends BaseFieldDef {
116
122
  type: 'signature';
117
123
  canvasWidth?: number;
@@ -302,7 +308,7 @@ interface DoctorFrequentItems {
302
308
  investigations?: InvestigationFrequentItem[];
303
309
  procedures?: ProcedureFrequentItem[];
304
310
  }
305
- type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | BaseFieldDef;
311
+ type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | BaseFieldDef;
306
312
  interface Condition {
307
313
  field?: string;
308
314
  op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
@@ -429,6 +435,9 @@ interface FormState {
429
435
  pendingUploads: number;
430
436
  }
431
437
 
438
+ declare const MAR_MEDICATION_ORDERS_META_KEY: "mar_medication_orders";
439
+ declare function fieldMetaRequestsMarMedicationOrdersButton(meta: Record<string, unknown> | undefined): boolean;
440
+
432
441
  interface SavedState {
433
442
  values: FormValues;
434
443
  meta: {
@@ -592,6 +601,16 @@ type FieldHandler = {
592
601
  * from diagnosis text input.
593
602
  */
594
603
  onFetchDiagnosisGrades?: (query: string) => Promise<any>;
604
+ /**
605
+ * Host opens MAR / medication-orders UI (e.g. IPD discharge). On success the host
606
+ * should update this field's value in form state.
607
+ */
608
+ onOpenMedicationOrders?: () => void | Promise<void>;
609
+ /**
610
+ * Host opens CMDash discharge medication orders slide-over. On save, return the
611
+ * prescription payload so the widget can normalize and store it in form state.
612
+ */
613
+ onOpenDischargeMedicationOrders?: () => Promise<any | null> | any | null;
595
614
  };
596
615
  type FieldHandlersMap = Record<string, FieldHandler>;
597
616
  declare function useFieldHandlers(fieldId: string): FieldHandler;
@@ -720,6 +739,10 @@ declare const ImageUploadWidget: React.FC<{
720
739
  fieldId: string;
721
740
  }>;
722
741
 
742
+ declare const MediaUploadWidget: React.FC<{
743
+ fieldId: string;
744
+ }>;
745
+
723
746
  declare const SignatureUploadWidget: React.FC<{
724
747
  fieldId: string;
725
748
  }>;
@@ -730,6 +753,12 @@ interface ReadOnlyImageUploadProps {
730
753
  }
731
754
  declare const ReadOnlyImageUpload: React.FC<ReadOnlyImageUploadProps>;
732
755
 
756
+ interface ReadOnlyMediaUploadProps {
757
+ fieldDef: BaseFieldDef;
758
+ value: any;
759
+ }
760
+ declare const ReadOnlyMediaUpload: React.FC<ReadOnlyMediaUploadProps>;
761
+
733
762
  interface ReadOnlySignatureProps {
734
763
  fieldDef: BaseFieldDef;
735
764
  value: any;
@@ -910,4 +939,4 @@ declare const SmartTextareaWidget: React.FC<{
910
939
  fieldId: string;
911
940
  }>;
912
941
 
913
- 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, 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, type MatchedCondition, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, type NumberFieldDef, type Permission, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, 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 ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };
942
+ 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, 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 ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, useSmartKeywords, validateField, validateForm };