@f1studio/form-spec 5.0.0-alpha.110 → 5.0.0-alpha.112
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/FormSpec.FS/BitmaskHelpers.d.ts +23 -0
- package/FormSpec.FS/BitmaskHelpers.d.ts.map +1 -0
- package/FormSpec.FS/BlueprintValidation.d.ts +16 -0
- package/FormSpec.FS/BlueprintValidation.d.ts.map +1 -0
- package/FormSpec.FS/FormSpec.d.ts +19 -5
- package/FormSpec.FS/FormSpec.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecHelpers.d.ts +4 -0
- package/FormSpec.FS/FormSpecHelpers.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecValues.d.ts +5 -0
- package/FormSpec.FS/FormSpecValues.d.ts.map +1 -1
- package/FormSpec.FS/Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts +13 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts +22 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts +22 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts +130 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts +37 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts +231 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts +10 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts +55 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts +69 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts +21 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +133 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.d.ts +52 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.d.ts +46 -0
- package/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.d.ts +4 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.d.ts +36 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts +95 -0
- package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts +449 -0
- package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts.map +1 -0
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +3 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Provenance.d.ts +10 -0
- package/FormSpec.FS/Provenance.d.ts.map +1 -0
- package/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js +56 -0
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +116 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Designer.js +2 -2
- package/FormSpec.TS/FormSpec.FS/Designer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Designer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.js +72 -3
- package/FormSpec.TS/FormSpec.FS/FormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +201 -3
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js +38 -3
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.js +44 -27
- package/FormSpec.TS/FormSpec.FS/Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js +45 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +145 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +139 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js +801 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js +121 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js +1380 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js +29 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +172 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js +406 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +317 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +622 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +448 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.js +198 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.js +57 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.js +144 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js +258 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js +1768 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +68 -41
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +18 -6
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Provenance.js +41 -0
- package/FormSpec.TS/FormSpec.FS/Provenance.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Provenance.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js +36 -13
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Renderers/PathwayRenderers.js +1 -1
- package/FormSpec.TS/PathwayExecutor.withPlugins.js +0 -5
- package/FormSpec.TS/PathwayExecutor.withPlugins.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.js +2 -0
- package/FormSpec.TS/PluginRegistration.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.ts.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.js +918 -0
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.js.map +1 -0
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.ts.map +1 -0
- package/FormSpec.TS/plugins/likert/src/LikertField.js +1 -1
- package/PathwayExecutor.withPlugins.d.ts +0 -5
- package/PathwayExecutor.withPlugins.d.ts.map +1 -1
- package/README.md +7 -7
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts +3 -0
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts.map +1 -0
- package/package.json +4 -4
- package/plugins/demographics/src/DemographicsField.d.ts +104 -0
- package/plugins/demographics/src/DemographicsField.d.ts.map +1 -0
- package/src/FormSpec.FS/BitmaskHelpers.ts +52 -0
- package/src/FormSpec.FS/BlueprintValidation.ts +108 -0
- package/src/FormSpec.FS/Designer.ts +2 -2
- package/src/FormSpec.FS/FormSpec.ts +39 -8
- package/src/FormSpec.FS/FormSpecHelpers.ts +190 -12
- package/src/FormSpec.FS/FormSpecValues.ts +42 -3
- package/src/FormSpec.FS/Helpers.ts +44 -27
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts +37 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +103 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +129 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts +490 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts +87 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts +1046 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts +26 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +161 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts +386 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +320 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +371 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +372 -0
- package/src/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts +92 -0
- package/src/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts +51 -0
- package/src/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts +71 -0
- package/src/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts +15 -0
- package/src/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts +825 -0
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +66 -41
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +13 -7
- package/src/FormSpec.FS/PathwayExecutor.ts +1 -1
- package/src/FormSpec.FS/Provenance.ts +19 -0
- package/src/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts +32 -12
- package/src/FormSpec.FS/Renderers/PathwayRenderers.ts +1 -1
- package/src/PathwayExecutor.withPlugins.ts +0 -5
- package/src/PluginRegistration.ts +2 -0
- package/src/plugins/demographics/src/DemographicsField.ts +502 -0
- package/src/plugins/likert/src/LikertField.ts +1 -1
|
@@ -7,17 +7,17 @@ import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../fable_modu
|
|
|
7
7
|
import { equals, createObj, stringHash, compare, IDisposable, disposeSafe, IEnumerator, getEnumerator, IMap, isArrayLike, uncurry2 } from "@fable-org/fable-library-js/Util.js";
|
|
8
8
|
import { ClinicalPathway_StateType_$union, ClinicalPathway_TaskPriority_$union, ClinicalPathway_AlertSeverity_$union, ClinicalPathway_ReferralUrgency_$union, ClinicalPathway_ActionInfo_$union, ClinicalPathway_NavigateToFormAction, ClinicalPathway_ProblemAction, ClinicalPathway_AlertAction, ClinicalPathway_EducationAction, ClinicalPathway_ProcedureAction, ClinicalPathway_TestAction, ClinicalPathway_DocumentationAction, ClinicalPathway_FieldValueSource_$union, ClinicalPathway_SetFieldValueAction, ClinicalPathway_PrescriptionAction, ClinicalPathway_MedicationAction, ClinicalPathway_ReferralAction, Shared_FieldValue, Shared_FieldValue_$union, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_PathRequirement, ClinicalPathway_ConstraintDefinition, ClinicalPathway_PathwayExecutionMode_SinglePathway, ClinicalPathway_SinglePathwayConfig, ClinicalPathway_SelectionStrategy_HighestPriority, ClinicalPathway_TransitionDefinition, ClinicalPathway_TransitionCondition_FieldCondition, Shared_ConditionValue_Single, ClinicalPathway_FieldEvaluator_Equals, Shared_TransitionKey, ClinicalPathway_StateType_Terminal, ClinicalPathway_TerminalInfo, ClinicalPathway_StateDefinition, ClinicalPathway_StateType_Action, ClinicalPathway_ActionInfo_Task, ClinicalPathway_TaskAction, ClinicalPathway_DueDate_Today, ClinicalPathway_TaskPriority_Medium, ClinicalPathway_TaskPriority_Low, ClinicalPathway_TaskPriority_High, Shared_StateKey, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Matrix, Spec_MatrixInfo, Spec_FormLifecycle_Blueprint, Spec_FieldType_Text, Spec_TextInfo, Spec_FieldType_CheckboxList, Spec_MultiChoiceInfo, Shared_FieldOptionKey, Spec_FieldType_Checkbox, Spec_BooleanInfo, Shared_FieldKey, Shared_FieldOption, Shared_FieldValue_Single, Shared_FieldValue_PluginData, Shared_PluginDataProperty, Shared_PluginPropertyKey, Shared_FieldValue_Matrix, Shared_MatrixAnswer, Shared_MatrixItemKey, Shared_FieldValue_Multiple, Shared_FieldAnswer, Spec_FormStep$1, Spec_FormField$1, Spec_FieldType_$union, Spec_FormSpec$1, Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection } from "../FormSpec.js";
|
|
9
9
|
import { FSharpResult$2_Ok, FSharpResult$2_Error, FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
|
|
10
|
-
import {
|
|
10
|
+
import { newGuid, parse, tryParse } from "@fable-org/fable-library-js/Guid.js";
|
|
11
|
+
import { Union, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
11
12
|
import { IOptionalGetter, array as array_4, IGetters, dict as dict_1, string, IRequiredGetter, object, fromString as fromString_1 } from "../../fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
|
|
12
13
|
import { ErrorReason_$union } from "../../fable_modules/Thoth.Json.10.4.1/Types.fs.js";
|
|
13
|
-
import { ofSeq as ofSeq_1, toList, FSharpMap } from "@fable-org/fable-library-js/Map.js";
|
|
14
|
+
import { count, ofSeq as ofSeq_1, toList, FSharpMap } from "@fable-org/fable-library-js/Map.js";
|
|
14
15
|
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
15
|
-
import { getFieldDetails as getFieldDetails_1, FieldDetails$1, findStepIndexForField, updateField } from "../FormSpecValues.js";
|
|
16
16
|
import { int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
17
|
+
import { getFieldDetails as getFieldDetails_1, FieldDetails$1, findStepIndexForField, updateField } from "../FormSpecValues.js";
|
|
17
18
|
import { singleton as singleton_1, empty as empty_1, collect as collect_1, delay, toList as toList_1, mapIndexed, map as map_2, choose } from "@fable-org/fable-library-js/Seq.js";
|
|
18
19
|
import { toArray, ofArray } from "@fable-org/fable-library-js/Set.js";
|
|
19
20
|
import { map as map_1 } from "@fable-org/fable-library-js/Array.js";
|
|
20
|
-
import { newGuid, parse } from "@fable-org/fable-library-js/Guid.js";
|
|
21
21
|
import { now } from "@fable-org/fable-library-js/DateOffset.js";
|
|
22
22
|
import { initializeExecution } from "../PathwayExecutor.js";
|
|
23
23
|
import { List_distinct, distinct } from "@fable-org/fable-library-js/Seq2.js";
|
|
@@ -83,7 +83,17 @@ export function deserializeFormSpec(json: string): Option<Spec_FormSpec$1<Spec_F
|
|
|
83
83
|
* Find FormField by its FieldKey string representation
|
|
84
84
|
*/
|
|
85
85
|
export function findFieldByKey(spec: Spec_FormSpec$1<Spec_FieldType_$union>, fieldKeyString: string): Option<Spec_FormField$1<Spec_FieldType_$union>> {
|
|
86
|
-
|
|
86
|
+
let matchValue: [boolean, string];
|
|
87
|
+
let outArg = "00000000-0000-0000-0000-000000000000";
|
|
88
|
+
matchValue = ([tryParse(fieldKeyString, new FSharpRef<string>((): string => outArg, (v: string): void => {
|
|
89
|
+
outArg = v;
|
|
90
|
+
})), outArg] as [boolean, string]);
|
|
91
|
+
if (matchValue[0]) {
|
|
92
|
+
return tryFind<Spec_FormField$1<Spec_FieldType_$union>>((field: Spec_FormField$1<Spec_FieldType_$union>): boolean => (field.FieldKey.fields[0] === matchValue[1]), collect<Spec_FormStep$1<Spec_FieldType_$union>, Spec_FormField$1<Spec_FieldType_$union>>((step: Spec_FormStep$1<Spec_FieldType_$union>): FSharpList<Spec_FormField$1<Spec_FieldType_$union>> => step.Fields, spec.Steps));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
export type ExpectedFieldValueType_$union =
|
|
@@ -130,6 +140,8 @@ export function ExpectedFieldValueType_$reflection(): TypeInfo {
|
|
|
130
140
|
|
|
131
141
|
export function getExpectedFieldValueType(fieldType: Spec_FieldType_$union): ExpectedFieldValueType_$union {
|
|
132
142
|
switch (fieldType.tag) {
|
|
143
|
+
case /* Text */ 0:
|
|
144
|
+
return ExpectedFieldValueType_SingleValue();
|
|
133
145
|
case /* TextArea */ 1:
|
|
134
146
|
return ExpectedFieldValueType_SingleValue();
|
|
135
147
|
case /* Email */ 2:
|
|
@@ -172,10 +184,10 @@ export function getExpectedFieldValueType(fieldType: Spec_FieldType_$union): Exp
|
|
|
172
184
|
return ExpectedFieldValueType_MultipleValues();
|
|
173
185
|
case /* Matrix */ 19:
|
|
174
186
|
return ExpectedFieldValueType_MatrixValue();
|
|
175
|
-
case /* PluginField */
|
|
187
|
+
case /* PluginField */ 23:
|
|
176
188
|
return ExpectedFieldValueType_PluginDataValue();
|
|
177
189
|
default:
|
|
178
|
-
|
|
190
|
+
throw new Error("Match failure: F1.Studio.Spec.FieldType");
|
|
179
191
|
}
|
|
180
192
|
}
|
|
181
193
|
|
|
@@ -228,6 +240,9 @@ export function decodeAsStringArray(fieldKey: string, obj: any): string[] {
|
|
|
228
240
|
|
|
229
241
|
export function decodeAsMatrixValue(fieldKey: string, obj: any): { description: string, values: IMap<string, string> } {
|
|
230
242
|
let str: string;
|
|
243
|
+
const valuesDict: IMap<string, string> = new Map<string, string>([]);
|
|
244
|
+
const arg_3: string = (obj == null) ? "null" : "Object";
|
|
245
|
+
toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] decodeAsMatrixValue fieldKey=%s path=JSON objType=%s"))(fieldKey)(arg_3);
|
|
231
246
|
const objAsString: string = (typeof obj === "string") ? ((str = (obj as string), str)) : toString(0, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(obj));
|
|
232
247
|
try {
|
|
233
248
|
const matchValue_1: FSharpResult$2_$union<{ description: string, values: IMap<string, string> }, string> = fromString_1<{ description: string, values: IMap<string, string> }>((path_2: string, v_1: any): FSharpResult$2_$union<{ description: string, values: IMap<string, string> }, [string, ErrorReason_$union]> => object<{ description: string, values: IMap<string, string> }>((get$: IGetters): { description: string, values: IMap<string, string> } => {
|
|
@@ -235,23 +250,23 @@ export function decodeAsMatrixValue(fieldKey: string, obj: any): { description:
|
|
|
235
250
|
const objectArg: IRequiredGetter = get$.Required;
|
|
236
251
|
description = objectArg.Field<string>("description", string);
|
|
237
252
|
let valuesMap: FSharpMap<string, string>;
|
|
238
|
-
const
|
|
253
|
+
const arg_7: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<FSharpMap<string, string>, [string, ErrorReason_$union]>)) = dict_1<string>(string);
|
|
239
254
|
const objectArg_1: IRequiredGetter = get$.Required;
|
|
240
|
-
valuesMap = objectArg_1.Field<FSharpMap<string, string>>("values", uncurry2(
|
|
241
|
-
const
|
|
242
|
-
const
|
|
255
|
+
valuesMap = objectArg_1.Field<FSharpMap<string, string>>("values", uncurry2(arg_7));
|
|
256
|
+
const valuesDict_1: IMap<string, string> = new Map<string, string>([]);
|
|
257
|
+
const enumerator_1: IEnumerator<[string, string]> = getEnumerator(toList<string, string>(valuesMap));
|
|
243
258
|
try {
|
|
244
|
-
while (
|
|
245
|
-
const forLoopVar: [string, string] =
|
|
246
|
-
addToDict(
|
|
259
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
260
|
+
const forLoopVar: [string, string] = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
261
|
+
addToDict(valuesDict_1, forLoopVar[0], forLoopVar[1]);
|
|
247
262
|
}
|
|
248
263
|
}
|
|
249
264
|
finally {
|
|
250
|
-
disposeSafe(
|
|
265
|
+
disposeSafe(enumerator_1 as IDisposable);
|
|
251
266
|
}
|
|
252
267
|
return {
|
|
253
268
|
description: description,
|
|
254
|
-
values:
|
|
269
|
+
values: valuesDict_1,
|
|
255
270
|
};
|
|
256
271
|
}, path_2, v_1), objAsString);
|
|
257
272
|
if (matchValue_1.tag === /* Error */ 1) {
|
|
@@ -262,34 +277,42 @@ export function decodeAsMatrixValue(fieldKey: string, obj: any): { description:
|
|
|
262
277
|
}
|
|
263
278
|
else {
|
|
264
279
|
const valuesMap_1: FSharpMap<string, string> = matchValue.fields[0];
|
|
265
|
-
const
|
|
266
|
-
const
|
|
280
|
+
const valuesDict_2: IMap<string, string> = new Map<string, string>([]);
|
|
281
|
+
const enumerator_2: IEnumerator<[string, string]> = getEnumerator(toList<string, string>(valuesMap_1));
|
|
267
282
|
try {
|
|
268
|
-
while (
|
|
269
|
-
const forLoopVar_1: [string, string] =
|
|
270
|
-
addToDict(
|
|
283
|
+
while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
284
|
+
const forLoopVar_1: [string, string] = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
285
|
+
addToDict(valuesDict_2, forLoopVar_1[0], forLoopVar_1[1]);
|
|
271
286
|
}
|
|
272
287
|
}
|
|
273
288
|
finally {
|
|
274
|
-
disposeSafe(
|
|
289
|
+
disposeSafe(enumerator_2 as IDisposable);
|
|
275
290
|
}
|
|
276
291
|
matchValue_2 = FSharpResult$2_Ok<{ description: string, values: IMap<string, string> }, string>({
|
|
277
292
|
description: "",
|
|
278
|
-
values:
|
|
293
|
+
values: valuesDict_2,
|
|
279
294
|
});
|
|
280
295
|
}
|
|
281
296
|
if (matchValue_2.tag === /* Error */ 1) {
|
|
282
297
|
throw new Error(`Field ${fieldKey}: Invalid matrix data format - ${matchValue_2.fields[0]}`);
|
|
283
298
|
}
|
|
284
299
|
else {
|
|
285
|
-
|
|
300
|
+
const matrixData_1: { description: string, values: IMap<string, string> } = matchValue_2.fields[0];
|
|
301
|
+
const arg_11: int32 = matrixData_1.values.size | 0;
|
|
302
|
+
toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] decodeAsMatrixValue fieldKey=%s path=PlainFormat count=%d"))(fieldKey)(arg_11);
|
|
303
|
+
return matrixData_1;
|
|
286
304
|
}
|
|
287
305
|
}
|
|
288
306
|
else {
|
|
289
|
-
|
|
307
|
+
const matrixData: { description: string, values: IMap<string, string> } = matchValue_1.fields[0];
|
|
308
|
+
const arg_9: int32 = matrixData.values.size | 0;
|
|
309
|
+
toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] decodeAsMatrixValue fieldKey=%s path=StandardFormat count=%d"))(fieldKey)(arg_9);
|
|
310
|
+
return matrixData;
|
|
290
311
|
}
|
|
291
312
|
}
|
|
292
313
|
catch (ex: any) {
|
|
314
|
+
const arg_13: string = ex.message;
|
|
315
|
+
toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] decodeAsMatrixValue fieldKey=%s path=FAILED ex=%s"))(fieldKey)(arg_13);
|
|
293
316
|
throw new Error(`Field ${fieldKey}: Failed to decode matrix value - ${ex.message}`);
|
|
294
317
|
}
|
|
295
318
|
}
|
|
@@ -356,7 +379,7 @@ export function buildFormSpecWithValues(formSpec: Spec_FormSpec$1<Spec_FieldType
|
|
|
356
379
|
const field_1: Spec_FormField$1<Spec_FieldType_$union> = tupledArg[0];
|
|
357
380
|
return defaultArg_1(map<int32, Spec_FormSpec$1<Spec_FieldType_$union>>((stepIdx: int32): Spec_FormSpec$1<Spec_FieldType_$union> => updateField<Spec_FieldType_$union>(spec, field_1.FieldKey, tupledArg[1].FieldValue, stepIdx), findStepIndexForField<Spec_FieldType_$union>(spec, field_1.FieldKey)), spec);
|
|
358
381
|
}, formSpec, ofSeq<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]>(choose<{ fieldKey: string, objectValue: any }, [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]>((input: { fieldKey: string, objectValue: any }): Option<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]> => {
|
|
359
|
-
let matchValue_1: ExpectedFieldValueType_$union, matrixData: { description: string, values: IMap<string, string> }, matchValue_2: Spec_FieldType_$union;
|
|
382
|
+
let matchValue_1: ExpectedFieldValueType_$union, matrixData: { description: string, values: IMap<string, string> }, matrixValues: FSharpMap<Shared_MatrixItemKey, string>, matrixAnswer: Shared_MatrixAnswer, arg_1: int32, matchValue_2: Spec_FieldType_$union;
|
|
360
383
|
const matchValue: Option<Spec_FormField$1<Spec_FieldType_$union>> = findFieldByKey(formSpec, input.fieldKey);
|
|
361
384
|
if (matchValue == null) {
|
|
362
385
|
toConsole(`Warning: Field ${input.fieldKey} not found in FormSpec`);
|
|
@@ -367,9 +390,9 @@ export function buildFormSpecWithValues(formSpec: Spec_FormSpec$1<Spec_FieldType
|
|
|
367
390
|
try {
|
|
368
391
|
return [field, new FieldDetails$1(field.FieldOrder, field.FieldKey, field.Label, (matchValue_1 = getExpectedFieldValueType(field.FieldType), (matchValue_1.tag === /* MultipleValues */ 1) ? Shared_FieldValue_Multiple(ofArray<Shared_FieldAnswer>(map_1<string, Shared_FieldAnswer>((value: string): Shared_FieldAnswer => (new Shared_FieldAnswer(field.FieldKey, field.Label, value)), decodeAsStringArray(input.fieldKey, input.objectValue)), {
|
|
369
392
|
Compare: compare,
|
|
370
|
-
})) : ((matchValue_1.tag === /* MatrixValue */ 2) ? ((matrixData = decodeAsMatrixValue(input.fieldKey, input.objectValue),
|
|
393
|
+
})) : ((matchValue_1.tag === /* MatrixValue */ 2) ? ((matrixData = decodeAsMatrixValue(input.fieldKey, input.objectValue), (matrixValues = ofSeq_1<Shared_MatrixItemKey, string>(map_2<[string, string], [Shared_MatrixItemKey, string]>((kvp: [string, string]): [Shared_MatrixItemKey, string] => ([new Shared_MatrixItemKey(parse(kvp[0])), kvp[1]] as [Shared_MatrixItemKey, string]), matrixData.values), {
|
|
371
394
|
Compare: compare,
|
|
372
|
-
}))))) : ((matchValue_1.tag === /* PluginDataValue */ 3) ? Shared_FieldValue_PluginData(ofArray_1<Shared_PluginDataProperty>(map_1<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }, Shared_PluginDataProperty>((prop: { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }): Shared_PluginDataProperty => (new Shared_PluginDataProperty(new Shared_PluginPropertyKey(parse(prop.propertyKey)), prop.name, prop.dataType, prop.value, prop.displayName, prop.unit, prop.description)), decodeAsPluginDataArray(input.fieldKey, input.objectValue)))) : Shared_FieldValue_Single(new Shared_FieldAnswer(field.FieldKey, field.Label, decodeAsString(input.fieldKey, input.objectValue)))))), field.FieldType, (matchValue_2 = field.FieldType, (matchValue_2.tag === /* Radio */ 12) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* SingleChoice */ 13) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Dropdown */ 14) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* MultiChoice */ 15) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* CheckboxList */ 16) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TagList */ 17) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TextAutoComplete */ 18) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Matrix */ 19) ? matchValue_2.fields[0].Options : empty<Shared_FieldOption>())))))))))] as [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>];
|
|
395
|
+
}), (matrixAnswer = (new Shared_MatrixAnswer(field.FieldKey, matrixData.description, matrixValues)), ((arg_1 = (count<Shared_MatrixItemKey, string>(matrixValues) | 0), toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] buildFormSpecWithValues Matrix fieldKey=%s valuesCount=%d"))(input.fieldKey)(arg_1)), Shared_FieldValue_Matrix(matrixAnswer)))))) : ((matchValue_1.tag === /* PluginDataValue */ 3) ? Shared_FieldValue_PluginData(ofArray_1<Shared_PluginDataProperty>(map_1<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }, Shared_PluginDataProperty>((prop: { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }): Shared_PluginDataProperty => (new Shared_PluginDataProperty(new Shared_PluginPropertyKey(parse(prop.propertyKey)), prop.name, prop.dataType, prop.value, prop.displayName, prop.unit, prop.description)), decodeAsPluginDataArray(input.fieldKey, input.objectValue)))) : Shared_FieldValue_Single(new Shared_FieldAnswer(field.FieldKey, field.Label, decodeAsString(input.fieldKey, input.objectValue)))))), field.FieldType, (matchValue_2 = field.FieldType, (matchValue_2.tag === /* Radio */ 12) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* SingleChoice */ 13) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Dropdown */ 14) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* MultiChoice */ 15) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* CheckboxList */ 16) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TagList */ 17) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TextAutoComplete */ 18) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Matrix */ 19) ? matchValue_2.fields[0].Options : empty<Shared_FieldOption>())))))))))] as [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>];
|
|
373
396
|
}
|
|
374
397
|
catch (ex: any) {
|
|
375
398
|
toConsole(`Error processing field ${input.fieldKey}: ${ex.message}`);
|
|
@@ -384,7 +407,7 @@ export function buildFormSpecWithValues(formSpec: Spec_FormSpec$1<Spec_FieldType
|
|
|
384
407
|
* TypeScript: createCheckboxField(fieldKey: string, label: string, isOptional: boolean)
|
|
385
408
|
*/
|
|
386
409
|
export function createCheckboxField(fieldKeyString: string, label: string, isOptional: boolean): Spec_FormField$1<Spec_FieldType_$union> {
|
|
387
|
-
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, isOptional, false, Spec_FieldType_Checkbox(new Spec_BooleanInfo(undefined, undefined)), undefined);
|
|
410
|
+
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, isOptional, false, false, undefined, Spec_FieldType_Checkbox(new Spec_BooleanInfo(undefined, undefined)), undefined);
|
|
388
411
|
}
|
|
389
412
|
|
|
390
413
|
/**
|
|
@@ -393,7 +416,7 @@ export function createCheckboxField(fieldKeyString: string, label: string, isOpt
|
|
|
393
416
|
*/
|
|
394
417
|
export function createCheckboxListField(fieldKeyString: string, label: string, options: { description: string, optionKey: string, value: string }[]): Spec_FormField$1<Spec_FieldType_$union> {
|
|
395
418
|
const fieldOptions: FSharpList<Shared_FieldOption> = ofSeq<Shared_FieldOption>(mapIndexed<{ description: string, optionKey: string, value: string }, Shared_FieldOption>((_arg: int32, opt: { description: string, optionKey: string, value: string }): Shared_FieldOption => (new Shared_FieldOption(opt.description, opt.value, new Shared_FieldOptionKey(parse(opt.optionKey)), undefined)), options));
|
|
396
|
-
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, false, false, Spec_FieldType_CheckboxList(new Spec_MultiChoiceInfo(fieldOptions)), undefined);
|
|
419
|
+
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, false, false, false, undefined, Spec_FieldType_CheckboxList(new Spec_MultiChoiceInfo(fieldOptions)), undefined);
|
|
397
420
|
}
|
|
398
421
|
|
|
399
422
|
/**
|
|
@@ -401,7 +424,7 @@ export function createCheckboxListField(fieldKeyString: string, label: string, o
|
|
|
401
424
|
* TypeScript: createTextField(fieldKey: string, label: string, isOptional: boolean)
|
|
402
425
|
*/
|
|
403
426
|
export function createTextField(fieldKeyString: string, label: string, isOptional: boolean): Spec_FormField$1<Spec_FieldType_$union> {
|
|
404
|
-
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, isOptional, false, Spec_FieldType_Text(new Spec_TextInfo(undefined)), undefined);
|
|
427
|
+
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, isOptional, false, false, undefined, Spec_FieldType_Text(new Spec_TextInfo(undefined)), undefined);
|
|
405
428
|
}
|
|
406
429
|
|
|
407
430
|
/**
|
|
@@ -409,7 +432,7 @@ export function createTextField(fieldKeyString: string, label: string, isOptiona
|
|
|
409
432
|
* TypeScript: createFormStep(stepOrder: number, stepLabel: string, fields: FormField[])
|
|
410
433
|
*/
|
|
411
434
|
export function createFormStep(stepOrder: int32, stepLabel: string, fields: Spec_FormField$1<Spec_FieldType_$union>[]): Spec_FormStep$1<Spec_FieldType_$union> {
|
|
412
|
-
return new Spec_FormStep$1(stepOrder, stepLabel, ofSeq<Spec_FormField$1<Spec_FieldType_$union>>(mapIndexed<Spec_FormField$1<Spec_FieldType_$union>, Spec_FormField$1<Spec_FieldType_$union>>((index: int32, field: Spec_FormField$1<Spec_FieldType_$union>): Spec_FormField$1<Spec_FieldType_$union> => (new Spec_FormField$1(index + 1, field.FieldKey, field.Label, field.Notes, field.DependsOn, field.IsOptional, field.IsDeprecated, field.FieldType, field.Value)), fields)));
|
|
435
|
+
return new Spec_FormStep$1(stepOrder, stepLabel, ofSeq<Spec_FormField$1<Spec_FieldType_$union>>(mapIndexed<Spec_FormField$1<Spec_FieldType_$union>, Spec_FormField$1<Spec_FieldType_$union>>((index: int32, field: Spec_FormField$1<Spec_FieldType_$union>): Spec_FormField$1<Spec_FieldType_$union> => (new Spec_FormField$1(index + 1, field.FieldKey, field.Label, field.Notes, field.DependsOn, field.IsOptional, field.IsDeprecated, field.NeedsDocumentation, field.Documentation, field.FieldType, field.Value)), fields)));
|
|
413
436
|
}
|
|
414
437
|
|
|
415
438
|
/**
|
|
@@ -417,7 +440,7 @@ export function createFormStep(stepOrder: int32, stepLabel: string, fields: Spec
|
|
|
417
440
|
* TypeScript: createFormSpec(id: string, title: string, steps: FormStep[])
|
|
418
441
|
*/
|
|
419
442
|
export function createFormSpec(idString: string, title: string, steps: Spec_FormStep$1<Spec_FieldType_$union>[]): Spec_FormSpec$1<Spec_FieldType_$union> {
|
|
420
|
-
return new Spec_FormSpec$1(parse(idString), "DYN", title, "Dynamically created FormSpec", "1.0.0", "2.0.5", ofSeq<Spec_FormStep$1<Spec_FieldType_$union>>(steps), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined);
|
|
443
|
+
return new Spec_FormSpec$1(parse(idString), "DYN", title, "Dynamically created FormSpec", "1.0.0", "2.0.5", ofSeq<Spec_FormStep$1<Spec_FieldType_$union>>(steps), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined);
|
|
421
444
|
}
|
|
422
445
|
|
|
423
446
|
/**
|
|
@@ -433,7 +456,7 @@ export function createFieldOption(description: string, value: string, optionKeyS
|
|
|
433
456
|
* TypeScript: createMatrixField(fieldKey: string, label: string, items: FieldOption[], options: FieldOption[])
|
|
434
457
|
*/
|
|
435
458
|
export function createMatrixField(fieldKeyString: string, label: string, items: Shared_FieldOption[], options: Shared_FieldOption[]): Spec_FormField$1<Spec_FieldType_$union> {
|
|
436
|
-
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, false, false, Spec_FieldType_Matrix(new Spec_MatrixInfo(ofSeq<Shared_FieldOption>(items), ofSeq<Shared_FieldOption>(options))), undefined);
|
|
459
|
+
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, false, false, false, undefined, Spec_FieldType_Matrix(new Spec_MatrixInfo(ofSeq<Shared_FieldOption>(items), ofSeq<Shared_FieldOption>(options))), undefined);
|
|
437
460
|
}
|
|
438
461
|
|
|
439
462
|
/**
|
|
@@ -441,7 +464,7 @@ export function createMatrixField(fieldKeyString: string, label: string, items:
|
|
|
441
464
|
* TypeScript: createPluginField(fieldKey: string, label: string, config: {pluginId: string})
|
|
442
465
|
*/
|
|
443
466
|
export function createPluginField(fieldKeyString: string, label: string, config: { pluginId: string }): Spec_FormField$1<Spec_FieldType_$union> {
|
|
444
|
-
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, false, false, Spec_FieldType_PluginField(new Spec_PluginFieldConfig(config.pluginId, undefined, undefined)), undefined);
|
|
467
|
+
return new Spec_FormField$1(1, new Shared_FieldKey(parse(fieldKeyString)), label, undefined, undefined, false, false, false, undefined, Spec_FieldType_PluginField(new Spec_PluginFieldConfig(config.pluginId, undefined, undefined)), undefined);
|
|
445
468
|
}
|
|
446
469
|
|
|
447
470
|
/**
|
|
@@ -483,7 +506,7 @@ export function createClinicalPathway(name: string, states: ClinicalPathway_Stat
|
|
|
483
506
|
* TypeScript: addPathwayToFormSpec(formSpec: FormSpec, pathway: ClinicalPathwaySpec)
|
|
484
507
|
*/
|
|
485
508
|
export function addPathwayToFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, pathway: ClinicalPathway_ClinicalPathwaySpec): Spec_FormSpec$1<Spec_FieldType_$union> {
|
|
486
|
-
return new Spec_FormSpec$1(formSpec.Id, formSpec.Code, formSpec.Title, formSpec.Abstract, formSpec.Version, formSpec.FormSpecVersion, formSpec.Steps, formSpec.CategoryTags, formSpec.Score, formSpec.AssociatedCodes, formSpec.RequiresReview, formSpec.RequiresReviewAndApproval, pathway, formSpec.Lifecycle, formSpec.FilledMeta);
|
|
509
|
+
return new Spec_FormSpec$1(formSpec.Id, formSpec.Code, formSpec.Title, formSpec.Abstract, formSpec.Version, formSpec.FormSpecVersion, formSpec.Steps, formSpec.CategoryTags, formSpec.Score, formSpec.AssociatedCodes, formSpec.RequiresReview, formSpec.RequiresReviewAndApproval, pathway, formSpec.Lifecycle, formSpec.FilledMeta, formSpec.CustomData, formSpec.Provenance);
|
|
487
510
|
}
|
|
488
511
|
|
|
489
512
|
/**
|
|
@@ -551,8 +574,8 @@ export function getFieldDetails(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>
|
|
|
551
574
|
export function createTestFormSpec(): Spec_FormSpec$1<Spec_FieldType_$union> {
|
|
552
575
|
const option1: Shared_FieldOption = new Shared_FieldOption("Option 1", "opt1", new Shared_FieldOptionKey(newGuid()), undefined);
|
|
553
576
|
const option2: Shared_FieldOption = new Shared_FieldOption("Option 2", "opt2", new Shared_FieldOptionKey(newGuid()), undefined);
|
|
554
|
-
const testStep: Spec_FormStep$1<Spec_FieldType_$union> = new Spec_FormStep$1(1, "Test Step", ofArray_1([new Spec_FormField$1(1, new Shared_FieldKey("11111111-1111-1111-1111-111111111111"), "Test Text Field", undefined, undefined, false, false, Spec_FieldType_Text(new Spec_TextInfo(undefined)), undefined), new Spec_FormField$1(2, new Shared_FieldKey("22222222-2222-2222-2222-222222222222"), "Test Checkbox List", undefined, undefined, false, false, Spec_FieldType_CheckboxList(new Spec_MultiChoiceInfo(ofArray_1([option1, option2]))), undefined), new Spec_FormField$1(3, new Shared_FieldKey("33333333-3333-3333-3333-333333333333"), "Test Matrix", undefined, undefined, false, false, Spec_FieldType_Matrix(new Spec_MatrixInfo(ofArray_1([option1, option2]), ofArray_1([new Shared_FieldOption("Scale 1", "1", new Shared_FieldOptionKey(newGuid()), 1), new Shared_FieldOption("Scale 2", "2", new Shared_FieldOptionKey(newGuid()), 2)]))), undefined), new Spec_FormField$1(4, new Shared_FieldKey("44444444-4444-4444-4444-444444444444"), "Test Plugin Field", undefined, undefined, false, false, Spec_FieldType_PluginField(new Spec_PluginFieldConfig("test.plugin", undefined, undefined)), undefined)]));
|
|
555
|
-
return new Spec_FormSpec$1(newGuid(), "TEST-001", "Test Form", "Test form for buildDynamicFormResultData", "1.0.0", "5.0.0", singleton(testStep), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined);
|
|
577
|
+
const testStep: Spec_FormStep$1<Spec_FieldType_$union> = new Spec_FormStep$1(1, "Test Step", ofArray_1([new Spec_FormField$1(1, new Shared_FieldKey("11111111-1111-1111-1111-111111111111"), "Test Text Field", undefined, undefined, false, false, false, undefined, Spec_FieldType_Text(new Spec_TextInfo(undefined)), undefined), new Spec_FormField$1(2, new Shared_FieldKey("22222222-2222-2222-2222-222222222222"), "Test Checkbox List", undefined, undefined, false, false, false, undefined, Spec_FieldType_CheckboxList(new Spec_MultiChoiceInfo(ofArray_1([option1, option2]))), undefined), new Spec_FormField$1(3, new Shared_FieldKey("33333333-3333-3333-3333-333333333333"), "Test Matrix", undefined, undefined, false, false, false, undefined, Spec_FieldType_Matrix(new Spec_MatrixInfo(ofArray_1([option1, option2]), ofArray_1([new Shared_FieldOption("Scale 1", "1", new Shared_FieldOptionKey(newGuid()), 1), new Shared_FieldOption("Scale 2", "2", new Shared_FieldOptionKey(newGuid()), 2)]))), undefined), new Spec_FormField$1(4, new Shared_FieldKey("44444444-4444-4444-4444-444444444444"), "Test Plugin Field", undefined, undefined, false, false, false, undefined, Spec_FieldType_PluginField(new Spec_PluginFieldConfig("test.plugin", undefined, undefined)), undefined)]));
|
|
578
|
+
return new Spec_FormSpec$1(newGuid(), "TEST-001", "Test Form", "Test form for buildDynamicFormResultData", "1.0.0", "5.0.0", singleton(testStep), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined);
|
|
556
579
|
}
|
|
557
580
|
|
|
558
581
|
/**
|
|
@@ -580,7 +603,9 @@ export function getFieldTypeInfo(field: Spec_FormField$1<Spec_FieldType_$union>)
|
|
|
580
603
|
let matchValue: Spec_FieldType_$union;
|
|
581
604
|
return {
|
|
582
605
|
isRequired: !field.IsOptional,
|
|
583
|
-
typeName: (matchValue = field.FieldType, (matchValue.tag === /* TextArea */ 1) ? "TextArea" : ((matchValue.tag === /* Email */ 2) ? "Email" : ((matchValue.tag === /* Password */ 3) ? "Password" : ((matchValue.tag === /* Search */ 4) ? "Search" : ((matchValue.tag === /* Color */ 5) ? "Color" : ((matchValue.tag === /* Number */ 6) ? "Number" : ((matchValue.tag === /* Tel */ 7) ? "Tel" : ((matchValue.tag === /* Date */ 8) ? "Date" : ((matchValue.tag === /* DateTimeLocal */ 9) ? "DateTimeLocal" : ((matchValue.tag === /* Time */ 10) ? "Time" : ((matchValue.tag === /* Checkbox */ 11) ? "Checkbox" : ((matchValue.tag === /* Radio */ 12) ? "Radio" : ((matchValue.tag === /* SingleChoice */ 13) ? "SingleChoice" : ((matchValue.tag === /* Dropdown */ 14) ? "Dropdown" : ((matchValue.tag === /* TextAutoComplete */ 18) ? "TextAutoComplete" : ((matchValue.tag === /* MultiChoice */ 15) ? "MultiChoice" : ((matchValue.tag === /* CheckboxList */ 16) ? "CheckboxList" : ((matchValue.tag === /* TagList */ 17) ? "TagList" : ((matchValue.tag === /* Matrix */ 19) ? "Matrix" : ((matchValue.tag === /* Signature */ 20) ? "Signature" : ((matchValue.tag === /* Message */ 21) ? "Message" : ((matchValue.tag === /* PluginField */
|
|
606
|
+
typeName: (matchValue = field.FieldType, (matchValue.tag === /* Text */ 0) ? "Text" : ((matchValue.tag === /* TextArea */ 1) ? "TextArea" : ((matchValue.tag === /* Email */ 2) ? "Email" : ((matchValue.tag === /* Password */ 3) ? "Password" : ((matchValue.tag === /* Search */ 4) ? "Search" : ((matchValue.tag === /* Color */ 5) ? "Color" : ((matchValue.tag === /* Number */ 6) ? "Number" : ((matchValue.tag === /* Tel */ 7) ? "Tel" : ((matchValue.tag === /* Date */ 8) ? "Date" : ((matchValue.tag === /* DateTimeLocal */ 9) ? "DateTimeLocal" : ((matchValue.tag === /* Time */ 10) ? "Time" : ((matchValue.tag === /* Checkbox */ 11) ? "Checkbox" : ((matchValue.tag === /* Radio */ 12) ? "Radio" : ((matchValue.tag === /* SingleChoice */ 13) ? "SingleChoice" : ((matchValue.tag === /* Dropdown */ 14) ? "Dropdown" : ((matchValue.tag === /* TextAutoComplete */ 18) ? "TextAutoComplete" : ((matchValue.tag === /* MultiChoice */ 15) ? "MultiChoice" : ((matchValue.tag === /* CheckboxList */ 16) ? "CheckboxList" : ((matchValue.tag === /* TagList */ 17) ? "TagList" : ((matchValue.tag === /* Matrix */ 19) ? "Matrix" : ((matchValue.tag === /* Signature */ 20) ? "Signature" : ((matchValue.tag === /* Message */ 21) ? "Message" : ((matchValue.tag === /* PluginField */ 23) ? "PluginField" : (() => {
|
|
607
|
+
throw new Error("Match failure: F1.Studio.Spec.FieldType");
|
|
608
|
+
})()))))))))))))))))))))))),
|
|
584
609
|
};
|
|
585
610
|
}
|
|
586
611
|
|
|
@@ -591,7 +616,7 @@ export function getFieldTypeInfo(field: Spec_FormField$1<Spec_FieldType_$union>)
|
|
|
591
616
|
*/
|
|
592
617
|
export function getPluginFieldConfig(field: Spec_FormField$1<Spec_FieldType_$union>): Option<{ items?: { key: string, label: string }[], options?: { description: string, key: string, value: string }[], pluginId: string }> {
|
|
593
618
|
const matchValue: Spec_FieldType_$union = field.FieldType;
|
|
594
|
-
if (matchValue.tag === /* PluginField */
|
|
619
|
+
if (matchValue.tag === /* PluginField */ 23) {
|
|
595
620
|
const config: Spec_PluginFieldConfig = matchValue.fields[0];
|
|
596
621
|
return {
|
|
597
622
|
items: unwrap(map<FSharpList<Shared_FieldOption>, { key: string, label: string }[]>((items: FSharpList<Shared_FieldOption>): { key: string, label: string }[] => {
|
|
@@ -687,7 +712,7 @@ export function getFieldMatrixInfo(field: Spec_FormField$1<Spec_FieldType_$union
|
|
|
687
712
|
matrixInfo = matchValue.fields[0];
|
|
688
713
|
break;
|
|
689
714
|
}
|
|
690
|
-
case /* PluginField */
|
|
715
|
+
case /* PluginField */ 23: {
|
|
691
716
|
if ((config = matchValue.fields[0], (config.Items != null) && (config.Options != null))) {
|
|
692
717
|
matchResult = 1;
|
|
693
718
|
config_1 = matchValue.fields[0];
|
|
@@ -276,9 +276,11 @@ export class Types_FormFieldTS extends Record implements IEquatable<Types_FormFi
|
|
|
276
276
|
readonly DependsOn: Option<Types_DependsOnTS>;
|
|
277
277
|
readonly IsOptional: boolean;
|
|
278
278
|
readonly IsDeprecated: boolean;
|
|
279
|
+
readonly NeedsDocumentation: boolean;
|
|
280
|
+
readonly Documentation: Option<string>;
|
|
279
281
|
readonly FieldType: Types_FieldTypeTS;
|
|
280
282
|
readonly Value: Option<any>;
|
|
281
|
-
constructor(FieldOrder: int32, FieldKey: Types_FieldKeyTS, Label: string, Notes: Option<string>, DependsOn: Option<Types_DependsOnTS>, IsOptional: boolean, IsDeprecated: boolean, FieldType: Types_FieldTypeTS, Value: Option<any>) {
|
|
283
|
+
constructor(FieldOrder: int32, FieldKey: Types_FieldKeyTS, Label: string, Notes: Option<string>, DependsOn: Option<Types_DependsOnTS>, IsOptional: boolean, IsDeprecated: boolean, NeedsDocumentation: boolean, Documentation: Option<string>, FieldType: Types_FieldTypeTS, Value: Option<any>) {
|
|
282
284
|
super();
|
|
283
285
|
this.FieldOrder = (FieldOrder | 0);
|
|
284
286
|
this.FieldKey = FieldKey;
|
|
@@ -287,13 +289,15 @@ export class Types_FormFieldTS extends Record implements IEquatable<Types_FormFi
|
|
|
287
289
|
this.DependsOn = DependsOn;
|
|
288
290
|
this.IsOptional = IsOptional;
|
|
289
291
|
this.IsDeprecated = IsDeprecated;
|
|
292
|
+
this.NeedsDocumentation = NeedsDocumentation;
|
|
293
|
+
this.Documentation = Documentation;
|
|
290
294
|
this.FieldType = FieldType;
|
|
291
295
|
this.Value = Value;
|
|
292
296
|
}
|
|
293
297
|
}
|
|
294
298
|
|
|
295
299
|
export function Types_FormFieldTS_$reflection(): TypeInfo {
|
|
296
|
-
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.FormFieldTS", [], Types_FormFieldTS, () => [["FieldOrder", int32_type], ["FieldKey", Types_FieldKeyTS_$reflection()], ["Label", string_type], ["Notes", option_type(string_type)], ["DependsOn", option_type(Types_DependsOnTS_$reflection())], ["IsOptional", bool_type], ["IsDeprecated", bool_type], ["FieldType", Types_FieldTypeTS_$reflection()], ["Value", option_type(obj_type)]]);
|
|
300
|
+
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.FormFieldTS", [], Types_FormFieldTS, () => [["FieldOrder", int32_type], ["FieldKey", Types_FieldKeyTS_$reflection()], ["Label", string_type], ["Notes", option_type(string_type)], ["DependsOn", option_type(Types_DependsOnTS_$reflection())], ["IsOptional", bool_type], ["IsDeprecated", bool_type], ["NeedsDocumentation", bool_type], ["Documentation", option_type(string_type)], ["FieldType", Types_FieldTypeTS_$reflection()], ["Value", option_type(obj_type)]]);
|
|
297
301
|
}
|
|
298
302
|
|
|
299
303
|
export class Types_FormStepTS extends Record implements IEquatable<Types_FormStepTS> {
|
|
@@ -642,6 +646,8 @@ export function Converters_messageTypeFromTS(msgType: int32): Option<Spec_Messag
|
|
|
642
646
|
*/
|
|
643
647
|
export function Converters_fieldTypeToTS(fieldType: Spec_FieldType_$union): Types_FieldTypeTS {
|
|
644
648
|
switch (fieldType.tag) {
|
|
649
|
+
case /* Text */ 0:
|
|
650
|
+
return new Types_FieldTypeTS("Text", new Types_TextInfoTS(fieldType.fields[0].Value), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
645
651
|
case /* TextArea */ 1:
|
|
646
652
|
return new Types_FieldTypeTS("TextArea", new Types_TextInfoTS(fieldType.fields[0].Value), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
647
653
|
case /* Email */ 2:
|
|
@@ -690,10 +696,10 @@ export function Converters_fieldTypeToTS(fieldType: Spec_FieldType_$union): Type
|
|
|
690
696
|
const info_21: Spec_MessageInfo = fieldType.fields[0];
|
|
691
697
|
return new Types_FieldTypeTS("Message", undefined, undefined, undefined, undefined, undefined, new Types_MessageInfoTS(info_21.Heading, Converters_messageTypeToTS(info_21.MessageType), info_21.Message, info_21.Footer), undefined, undefined, undefined);
|
|
692
698
|
}
|
|
693
|
-
case /* PluginField */
|
|
699
|
+
case /* PluginField */ 23:
|
|
694
700
|
return new Types_FieldTypeTS("PluginField", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, new Types_PluginFieldConfigTS(fieldType.fields[0].PluginId));
|
|
695
701
|
default:
|
|
696
|
-
|
|
702
|
+
throw new Error("Match failure: F1.Studio.Spec.FieldType");
|
|
697
703
|
}
|
|
698
704
|
}
|
|
699
705
|
|
|
@@ -1180,7 +1186,7 @@ export function Converters_fieldTypeFromTS(fieldType: Types_FieldTypeTS): Option
|
|
|
1180
1186
|
* Convert F# FormField to TypeScript representation
|
|
1181
1187
|
*/
|
|
1182
1188
|
export function Converters_formFieldToTS(field: Spec_FormField$1<Spec_FieldType_$union>): Types_FormFieldTS {
|
|
1183
|
-
return new Types_FormFieldTS(field.FieldOrder, Converters_fieldKeyToTS(field.FieldKey), field.Label, field.Notes, map_2<Spec_DependsOn, Types_DependsOnTS>(Converters_dependsOnToTS, field.DependsOn), field.IsOptional, field.IsDeprecated, Converters_fieldTypeToTS(field.FieldType), map_2<Shared_FieldValue_$union, any>((value: Shared_FieldValue_$union): any => value, field.Value));
|
|
1189
|
+
return new Types_FormFieldTS(field.FieldOrder, Converters_fieldKeyToTS(field.FieldKey), field.Label, field.Notes, map_2<Spec_DependsOn, Types_DependsOnTS>(Converters_dependsOnToTS, field.DependsOn), field.IsOptional, field.IsDeprecated, field.NeedsDocumentation, field.Documentation, Converters_fieldTypeToTS(field.FieldType), map_2<Shared_FieldValue_$union, any>((value: Shared_FieldValue_$union): any => value, field.Value));
|
|
1184
1190
|
}
|
|
1185
1191
|
|
|
1186
1192
|
/**
|
|
@@ -1206,7 +1212,7 @@ export function Converters_formFieldFromTS(field: Types_FormFieldTS): Option<Spe
|
|
|
1206
1212
|
}
|
|
1207
1213
|
switch (matchResult) {
|
|
1208
1214
|
case 0:
|
|
1209
|
-
return new Spec_FormField$1(field.FieldOrder, key!, field.Label, field.Notes, (matchValue_3 = field.DependsOn, (matchValue_3 == null) ? undefined : Converters_dependsOnFromTS(value_2(matchValue_3))), field.IsOptional, field.IsDeprecated, fieldType!, undefined);
|
|
1215
|
+
return new Spec_FormField$1(field.FieldOrder, key!, field.Label, field.Notes, (matchValue_3 = field.DependsOn, (matchValue_3 == null) ? undefined : Converters_dependsOnFromTS(value_2(matchValue_3))), field.IsOptional, field.IsDeprecated, field.NeedsDocumentation, field.Documentation, fieldType!, undefined);
|
|
1210
1216
|
default:
|
|
1211
1217
|
return undefined;
|
|
1212
1218
|
}
|
|
@@ -1451,7 +1457,7 @@ export function Converters_formSpecFromTS(spec: Types_FormSpecTS): Option<Spec_F
|
|
|
1451
1457
|
return undefined;
|
|
1452
1458
|
}
|
|
1453
1459
|
else {
|
|
1454
|
-
return new Spec_FormSpec$1(matchValue[1], spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, reverse<Spec_FormStep$1<Spec_FieldType_$union>>(value_2(convertedSteps)), ofArray<string>(spec.CategoryTags), scoreResult, ofArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, undefined, Spec_FormLifecycle_Blueprint(), undefined);
|
|
1460
|
+
return new Spec_FormSpec$1(matchValue[1], spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, reverse<Spec_FormStep$1<Spec_FieldType_$union>>(value_2(convertedSteps)), ofArray<string>(spec.CategoryTags), scoreResult, ofArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined);
|
|
1455
1461
|
}
|
|
1456
1462
|
}
|
|
1457
1463
|
else {
|
|
@@ -882,7 +882,7 @@ export function evaluateTransitionWithPartialData(resolver: ((arg0: string) => S
|
|
|
882
882
|
const pluginIdOpt: Option<string> = filter<string>((id: string): boolean => !isNullOrEmpty(id), bind<Spec_FormSpec$1<Spec_FieldType_$union>, string>((spec_5: Spec_FormSpec$1<Spec_FieldType_$union>): Option<string> => map<Spec_FormField$1<Spec_FieldType_$union>, string>((f_1: Spec_FormField$1<Spec_FieldType_$union>): string => {
|
|
883
883
|
const ft = f_1.FieldType as Spec_FieldType_$union;
|
|
884
884
|
switch (ft.tag) {
|
|
885
|
-
case /* PluginField */
|
|
885
|
+
case /* PluginField */ 23:
|
|
886
886
|
return ft.fields[0].PluginId;
|
|
887
887
|
case /* Matrix */ 19:
|
|
888
888
|
return "Fable.Form.Simple.Bulma.Fields.LikertField";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
|
+
import { IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
3
|
+
import { record_type, string_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
4
|
+
|
|
5
|
+
export class IntegrationProvenance extends Record implements IEquatable<IntegrationProvenance>, IComparable<IntegrationProvenance> {
|
|
6
|
+
readonly IntegrationKey: string;
|
|
7
|
+
readonly Payload: string;
|
|
8
|
+
constructor(IntegrationKey: string, Payload: string) {
|
|
9
|
+
super();
|
|
10
|
+
this.IntegrationKey = IntegrationKey;
|
|
11
|
+
this.Payload = Payload;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function IntegrationProvenance_$reflection(): TypeInfo {
|
|
16
|
+
return record_type("F1.Studio.Provenance.IntegrationProvenance", [], IntegrationProvenance, () => [["IntegrationKey", string_type], ["Payload", string_type]]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=Provenance.ts.map
|
|
@@ -18,6 +18,28 @@ function generateHeadingLevel(level: int32): string {
|
|
|
18
18
|
function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_FieldValue_$union, field: Spec_FormField$1<Spec_FieldType_$union>): string {
|
|
19
19
|
let matchResult: int32, answer: Shared_FieldAnswer, answer_1: Shared_FieldAnswer, answer_2: Shared_FieldAnswer, answer_3: Shared_FieldAnswer, answer_4: Shared_FieldAnswer, answer_5: Shared_FieldAnswer, answer_6: Shared_FieldAnswer, answer_7: Shared_FieldAnswer, answer_8: Shared_FieldAnswer, answer_9: Shared_FieldAnswer, answer_10: Shared_FieldAnswer, answer_11: Shared_FieldAnswer, answer_12: Shared_FieldAnswer, info: Spec_SingleChoiceInfo, answer_13: Shared_FieldAnswer, info_1: Spec_SingleChoiceInfo, answer_14: Shared_FieldAnswer, info_2: Spec_SingleChoiceInfo, answer_15: Shared_FieldAnswer, info_3: Spec_SingleChoiceInfo, answers: FSharpSet<Shared_FieldAnswer>, info_4: Spec_MultiChoiceInfo, answers_1: FSharpSet<Shared_FieldAnswer>, info_5: Spec_MultiChoiceInfo, answers_2: FSharpSet<Shared_FieldAnswer>, info_6: Spec_MultiChoiceInfo, answer_19: Shared_FieldAnswer, answer_20: Shared_FieldAnswer, answer_21: Shared_FieldAnswer, pluginData: FSharpList<Shared_PluginDataProperty>;
|
|
20
20
|
switch (fieldType.tag) {
|
|
21
|
+
case /* Text */ 0: {
|
|
22
|
+
switch (fieldValue.tag) {
|
|
23
|
+
case /* Multiple */ 1: {
|
|
24
|
+
matchResult = 23;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case /* Matrix */ 2: {
|
|
28
|
+
matchResult = 25;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case /* PluginData */ 3: {
|
|
32
|
+
matchResult = 26;
|
|
33
|
+
pluginData = fieldValue.fields[0];
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
default: {
|
|
37
|
+
matchResult = 0;
|
|
38
|
+
answer = fieldValue.fields[0];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
21
43
|
case /* TextArea */ 1: {
|
|
22
44
|
switch (fieldValue.tag) {
|
|
23
45
|
case /* Multiple */ 1: {
|
|
@@ -450,7 +472,7 @@ function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_F
|
|
|
450
472
|
matchResult = 20;
|
|
451
473
|
break;
|
|
452
474
|
}
|
|
453
|
-
case /* PluginField */
|
|
475
|
+
case /* PluginField */ 23: {
|
|
454
476
|
switch (fieldValue.tag) {
|
|
455
477
|
case /* Multiple */ 1: {
|
|
456
478
|
matchResult = 23;
|
|
@@ -478,10 +500,6 @@ function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_F
|
|
|
478
500
|
}
|
|
479
501
|
default:
|
|
480
502
|
switch (fieldValue.tag) {
|
|
481
|
-
case /* Multiple */ 1: {
|
|
482
|
-
matchResult = 23;
|
|
483
|
-
break;
|
|
484
|
-
}
|
|
485
503
|
case /* Matrix */ 2: {
|
|
486
504
|
matchResult = 25;
|
|
487
505
|
break;
|
|
@@ -491,10 +509,8 @@ function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_F
|
|
|
491
509
|
pluginData = fieldValue.fields[0];
|
|
492
510
|
break;
|
|
493
511
|
}
|
|
494
|
-
default:
|
|
495
|
-
matchResult =
|
|
496
|
-
answer = fieldValue.fields[0];
|
|
497
|
-
}
|
|
512
|
+
default:
|
|
513
|
+
matchResult = 27;
|
|
498
514
|
}
|
|
499
515
|
}
|
|
500
516
|
switch (matchResult) {
|
|
@@ -564,7 +580,7 @@ function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_F
|
|
|
564
580
|
return answer_21!.Value;
|
|
565
581
|
case 25:
|
|
566
582
|
return "";
|
|
567
|
-
|
|
583
|
+
case 26:
|
|
568
584
|
return join(", ", map_1<Shared_PluginDataProperty, string>((prop: Shared_PluginDataProperty): string => {
|
|
569
585
|
const matchValue_2: Option<string> = prop.DisplayName;
|
|
570
586
|
if (matchValue_2 == null) {
|
|
@@ -575,6 +591,8 @@ function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_F
|
|
|
575
591
|
return toText(printf("%s: %s"))(displayName)(prop.Value);
|
|
576
592
|
}
|
|
577
593
|
}, pluginData!));
|
|
594
|
+
default:
|
|
595
|
+
throw new Error("Match failure: F1.Studio.Spec.FieldType");
|
|
578
596
|
}
|
|
579
597
|
}
|
|
580
598
|
|
|
@@ -644,6 +662,8 @@ function formatMatrixFieldAsTable(fieldLabel: string, matrixInfo: Spec_MatrixInf
|
|
|
644
662
|
|
|
645
663
|
function getFieldTypeName(fieldType: Spec_FieldType_$union): string {
|
|
646
664
|
switch (fieldType.tag) {
|
|
665
|
+
case /* Text */ 0:
|
|
666
|
+
return "Text";
|
|
647
667
|
case /* TextArea */ 1:
|
|
648
668
|
return "TextArea";
|
|
649
669
|
case /* Email */ 2:
|
|
@@ -686,10 +706,10 @@ function getFieldTypeName(fieldType: Spec_FieldType_$union): string {
|
|
|
686
706
|
return "Message";
|
|
687
707
|
case /* Matrix */ 19:
|
|
688
708
|
return "Matrix";
|
|
689
|
-
case /* PluginField */
|
|
709
|
+
case /* PluginField */ 23:
|
|
690
710
|
return "PluginField";
|
|
691
711
|
default:
|
|
692
|
-
|
|
712
|
+
throw new Error("Match failure: F1.Studio.Spec.FieldType");
|
|
693
713
|
}
|
|
694
714
|
}
|
|
695
715
|
|
|
@@ -97,7 +97,7 @@ export function getTransitionLabel(condition: ClinicalPathway_TransitionConditio
|
|
|
97
97
|
const fieldName_3: string = (fieldItemKey == null) ? baseFieldLabel : (`${baseFieldLabel} [${substring(value_2(fieldItemKey).fields[0], 0, 8)}]`);
|
|
98
98
|
const optionLabel: string = defaultArgWith<string>(bind<Spec_FormSpec$1<Spec_FieldType_$union>, string>((spec_4: Spec_FormSpec$1<Spec_FieldType_$union>): Option<string> => bind<Spec_FormField$1<Spec_FieldType_$union>, string>((field_9: Spec_FormField$1<Spec_FieldType_$union>): Option<string> => {
|
|
99
99
|
let matchValue: Spec_FieldType_$union;
|
|
100
|
-
return map<Shared_FieldOption, string>((opt_1: Shared_FieldOption): string => opt_1.Description, tryFind<Shared_FieldOption>((opt: Shared_FieldOption): boolean => equals(opt.OptionKey, optionKey), (matchValue = field_9.FieldType, (matchValue.tag === /* SingleChoice */ 13) ? matchValue.fields[0].Options : ((matchValue.tag === /* MultiChoice */ 15) ? matchValue.fields[0].Options : ((matchValue.tag === /* CheckboxList */ 16) ? matchValue.fields[0].Options : ((matchValue.tag === /* Dropdown */ 14) ? matchValue.fields[0].Options : ((matchValue.tag === /* Radio */ 12) ? matchValue.fields[0].Options : ((matchValue.tag === /* PluginField */
|
|
100
|
+
return map<Shared_FieldOption, string>((opt_1: Shared_FieldOption): string => opt_1.Description, tryFind<Shared_FieldOption>((opt: Shared_FieldOption): boolean => equals(opt.OptionKey, optionKey), (matchValue = field_9.FieldType, (matchValue.tag === /* SingleChoice */ 13) ? matchValue.fields[0].Options : ((matchValue.tag === /* MultiChoice */ 15) ? matchValue.fields[0].Options : ((matchValue.tag === /* CheckboxList */ 16) ? matchValue.fields[0].Options : ((matchValue.tag === /* Dropdown */ 14) ? matchValue.fields[0].Options : ((matchValue.tag === /* Radio */ 12) ? matchValue.fields[0].Options : ((matchValue.tag === /* PluginField */ 23) ? defaultArg(bind<IPluginValueConverter, FSharpList<Shared_FieldOption>>((c: IPluginValueConverter): Option<FSharpList<Shared_FieldOption>> => c.GetOptions(), PluginValueRegistry_tryGet(matchValue.fields[0].PluginId)), empty<Shared_FieldOption>()) : empty<Shared_FieldOption>()))))))));
|
|
101
101
|
}, tryFind<Spec_FormField$1<Spec_FieldType_$union>>((field_8: Spec_FormField$1<Spec_FieldType_$union>): boolean => equals(field_8.FieldKey, fieldKey_2), collect<Spec_FormStep$1<Spec_FieldType_$union>, Spec_FormField$1<Spec_FieldType_$union>>((step_4: Spec_FormStep$1<Spec_FieldType_$union>): FSharpList<Spec_FormField$1<Spec_FieldType_$union>> => step_4.Fields, spec_4.Steps))), formSpec), (): string => (`Option-${substring(optionKey.fields[0], 0, 8)}`));
|
|
102
102
|
switch (op_2.tag) {
|
|
103
103
|
case /* Equals */ 0:
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PathwayExecutor entry point - loads plugin registration before re-exporting.
|
|
3
|
-
* Ensures PluginPropertyCondition works (Vitals, BMI, etc.) when using pathway execution.
|
|
4
|
-
*
|
|
5
|
-
* PROOF-OF-CONCEPT: This bundles Vitals + BMI plugins for immediate use.
|
|
6
|
-
* FUTURE: Plugins will be separate npm packages; developers install and register them.
|
|
7
|
-
* See docs/PLUGINS-FUTURE-PROOFING.md for migration path.
|
|
8
3
|
*/
|
|
9
4
|
import "./PluginRegistration.js";
|
|
10
5
|
export * from "./FormSpec.FS/PathwayExecutor.js";
|
|
@@ -3,12 +3,14 @@ import { Form_enhancedVitalsConverter, Form_pluginConfig } from "./plugins/vital
|
|
|
3
3
|
import { Form_enhancedBMIConverter, Form_pluginConfig as Form_pluginConfig_1 } from "./plugins/bmi/src/BMIField.js";
|
|
4
4
|
import { Form_likertConverter, Form_pluginConfig as Form_pluginConfig_2 } from "./plugins/likert/src/LikertField.js";
|
|
5
5
|
import { Form_signatureConverter, Form_pluginConfig as Form_pluginConfig_3 } from "./plugins/signature/src/SignatureField.js";
|
|
6
|
+
import { Form_enhancedDemographicsConverter, Form_pluginConfig as Form_pluginConfig_4 } from "./plugins/demographics/src/DemographicsField.js";
|
|
6
7
|
|
|
7
8
|
function registerAllPlugins(): void {
|
|
8
9
|
PluginValueRegistry_register(Form_pluginConfig.PluginId, Form_enhancedVitalsConverter);
|
|
9
10
|
PluginValueRegistry_register(Form_pluginConfig_1.PluginId, Form_enhancedBMIConverter);
|
|
10
11
|
PluginValueRegistry_register(Form_pluginConfig_2.PluginId, Form_likertConverter);
|
|
11
12
|
PluginValueRegistry_register(Form_pluginConfig_3.PluginId, Form_signatureConverter);
|
|
13
|
+
PluginValueRegistry_register(Form_pluginConfig_4.PluginId, Form_enhancedDemographicsConverter);
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
registerAllPlugins();
|