@f1studio/form-spec 5.0.0-alpha.101
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/Designer.d.ts +89 -0
- package/FormSpec.TS/Components/HelloComponent.js +68 -0
- package/FormSpec.TS/Components/HelloComponent.js.map +1 -0
- package/FormSpec.TS/Components/HelloComponent.ts.map +1 -0
- package/FormSpec.TS/Designer.js +526 -0
- package/FormSpec.TS/Designer.js.map +1 -0
- package/FormSpec.TS/Designer.ts.map +1 -0
- package/FormSpec.TS/FormSpec.js +5400 -0
- package/FormSpec.TS/FormSpec.js.map +1 -0
- package/FormSpec.TS/FormSpec.ts.map +1 -0
- package/FormSpec.TS/FormSpecHelpers.js +382 -0
- package/FormSpec.TS/FormSpecHelpers.js.map +1 -0
- package/FormSpec.TS/FormSpecHelpers.ts.map +1 -0
- package/FormSpec.TS/Helpers.js +732 -0
- package/FormSpec.TS/Helpers.js.map +1 -0
- package/FormSpec.TS/Helpers.ts.map +1 -0
- package/FormSpec.TS/Interfaces.js +257 -0
- package/FormSpec.TS/Interfaces.js.map +1 -0
- package/FormSpec.TS/Interfaces.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +854 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js +1961 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +1367 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
- package/FormSpec.TS/Logging/LogTypes.js +347 -0
- package/FormSpec.TS/Logging/LogTypes.js.map +1 -0
- package/FormSpec.TS/Logging/LogTypes.ts.map +1 -0
- package/FormSpec.TS/Migrator.js +230 -0
- package/FormSpec.TS/Migrator.js.map +1 -0
- package/FormSpec.TS/Migrator.ts.map +1 -0
- package/FormSpec.TS/PathwayDataExtractor.js +361 -0
- package/FormSpec.TS/PathwayDataExtractor.js.map +1 -0
- package/FormSpec.TS/PathwayDataExtractor.ts.map +1 -0
- package/FormSpec.TS/PathwayExecutor.js +1321 -0
- package/FormSpec.TS/PathwayExecutor.js.map +1 -0
- package/FormSpec.TS/PathwayExecutor.ts.map +1 -0
- package/FormSpec.TS/PathwayValidator.js +346 -0
- package/FormSpec.TS/PathwayValidator.js.map +1 -0
- package/FormSpec.TS/PathwayValidator.ts.map +1 -0
- package/FormSpec.TS/PluginInterface.js +171 -0
- package/FormSpec.TS/PluginInterface.js.map +1 -0
- package/FormSpec.TS/PluginInterface.ts.map +1 -0
- package/FormSpec.TS/Prelude.js +59 -0
- package/FormSpec.TS/Prelude.js.map +1 -0
- package/FormSpec.TS/Prelude.ts.map +1 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js +958 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js.map +1 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.js +228 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.js.map +1 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.ts.map +1 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.js +190 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +511 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js +437 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +16 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js +73 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +50 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js +72 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +28 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +24 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js +56 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +31 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +178 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js +464 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +17 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +152 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js +25 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +28 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +218 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js +37 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +27 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +82 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +59 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +154 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js +32 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +42 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +240 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +24 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +826 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +83 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js +292 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +65 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js +229 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +91 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +876 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +4080 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js +133 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +656 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js +561 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +25 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js +46 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +63 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +41 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +53 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +5740 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +1455 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js +39 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +13 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +33 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +181 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +17 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +162 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +13 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +1768 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js +2337 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +811 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js +465 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +47 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js +18 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +34 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +68 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js +355 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -0
- package/FormSpec.d.ts +1257 -0
- package/FormSpecHelpers.d.ts +50 -0
- package/Helpers.d.ts +147 -0
- package/Interfaces.d.ts +70 -0
- package/Interop/FormSpec.Api.Helpers.d.ts +247 -0
- package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -0
- package/Interop/FormSpec.Api.Option.d.ts +384 -0
- package/Interop/FormSpec.Api.Option.d.ts.map +1 -0
- package/Interop/FormSpec.Values.Api.Option.d.ts +324 -0
- package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -0
- package/Migrator.d.ts +59 -0
- package/PathwayDataExtractor.d.ts +19 -0
- package/PathwayExecutor.d.ts +210 -0
- package/PathwayValidator.d.ts +52 -0
- package/PluginInterface.d.ts +36 -0
- package/Prelude.d.ts +11 -0
- package/README.TS.md +622 -0
- package/README.md +85 -0
- package/package.json +39 -0
- package/src/Components/HelloComponent.ts +48 -0
- package/src/Components/HelloComponent.ts.map +1 -0
- package/src/Designer.ts +389 -0
- package/src/Designer.ts.map +1 -0
- package/src/FormSpec.ts +3114 -0
- package/src/FormSpec.ts.map +1 -0
- package/src/FormSpecHelpers.ts +374 -0
- package/src/FormSpecHelpers.ts.map +1 -0
- package/src/Helpers.ts +765 -0
- package/src/Helpers.ts.map +1 -0
- package/src/Interfaces.ts +166 -0
- package/src/Interfaces.ts.map +1 -0
- package/src/Interop/FormSpec.Api.Helpers.ts +872 -0
- package/src/Interop/FormSpec.Api.Helpers.ts.map +1 -0
- package/src/Interop/FormSpec.Api.Option.ts +1618 -0
- package/src/Interop/FormSpec.Api.Option.ts.map +1 -0
- package/src/Interop/FormSpec.Values.Api.Option.ts +1214 -0
- package/src/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
- package/src/Logging/LogTypes.ts +212 -0
- package/src/Logging/LogTypes.ts.map +1 -0
- package/src/Migrator.ts +156 -0
- package/src/Migrator.ts.map +1 -0
- package/src/PathwayDataExtractor.ts +290 -0
- package/src/PathwayDataExtractor.ts.map +1 -0
- package/src/PathwayExecutor.ts +1102 -0
- package/src/PathwayExecutor.ts.map +1 -0
- package/src/PathwayValidator.ts +244 -0
- package/src/PathwayValidator.ts.map +1 -0
- package/src/PluginInterface.ts +79 -0
- package/src/PluginInterface.ts.map +1 -0
- package/src/Prelude.ts +21 -0
- package/src/Prelude.ts.map +1 -0
- package/src/Renderers/FormSpecMarkdownRenderer.ts +874 -0
- package/src/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
- package/src/Renderers/MermaidRenderer.ts +218 -0
- package/src/Renderers/MermaidRenderer.ts.map +1 -0
- package/src/Renderers/PathwayRenderers.ts +200 -0
- package/src/Renderers/PathwayRenderers.ts.map +1 -0
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
import { printf, toText, isNullOrWhiteSpace, join, replicate } from "@fable-org/fable-library-js/String.js";
|
|
2
|
+
import { int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
3
|
+
import { value as value_4, Option, map, defaultArg } from "@fable-org/fable-library-js/Option.js";
|
|
4
|
+
import { Values_FieldDetails$1, Shared_FieldKey, Values_StepOrder, Spec_FormStep$1, Spec_FormSpec$1, ClinicalPathway_ClinicalPathwaySpec, Spec_MatrixInfo, Shared_MatrixItemKey, Shared_MatrixAnswer, Spec_FormField$1, Shared_FieldValue_$union, Spec_FieldType_$union, Spec_MultiChoiceInfo, Spec_SingleChoiceInfo, Shared_PluginDataProperty, Shared_FieldAnswer, Shared_FieldOption } from "../FormSpec.js";
|
|
5
|
+
import { partition, isEmpty, FSharpList, map as map_1, choose, tryFind } from "@fable-org/fable-library-js/List.js";
|
|
6
|
+
import { FSharpSet, toList } from "@fable-org/fable-library-js/Set.js";
|
|
7
|
+
import { singleton, append, delay, toList as toList_1 } from "@fable-org/fable-library-js/Seq.js";
|
|
8
|
+
import { compare, IDisposable, disposeSafe, IEnumerator, getEnumerator } from "@fable-org/fable-library-js/Util.js";
|
|
9
|
+
import { FSharpMap, empty, FSharpMap__TryFind } from "@fable-org/fable-library-js/Map.js";
|
|
10
|
+
import { pathwaySpecToGraph } from "./PathwayRenderers.js";
|
|
11
|
+
import { MermaidRenderer_$ctor_Z1FBCCD16 } from "./MermaidRenderer.js";
|
|
12
|
+
|
|
13
|
+
function generateHeadingLevel(level: int32): string {
|
|
14
|
+
return replicate(level, "#");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function formatFieldValue(fieldType: Spec_FieldType_$union, fieldValue: Shared_FieldValue_$union, field: Spec_FormField$1<Spec_FieldType_$union>): string {
|
|
18
|
+
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>;
|
|
19
|
+
switch (fieldType.tag) {
|
|
20
|
+
case /* TextArea */ 1: {
|
|
21
|
+
switch (fieldValue.tag) {
|
|
22
|
+
case /* Multiple */ 1: {
|
|
23
|
+
matchResult = 23;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case /* Matrix */ 2: {
|
|
27
|
+
matchResult = 25;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
case /* PluginData */ 3: {
|
|
31
|
+
matchResult = 26;
|
|
32
|
+
pluginData = fieldValue.fields[0];
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
default: {
|
|
36
|
+
matchResult = 1;
|
|
37
|
+
answer_1 = fieldValue.fields[0];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case /* Email */ 2: {
|
|
43
|
+
switch (fieldValue.tag) {
|
|
44
|
+
case /* Multiple */ 1: {
|
|
45
|
+
matchResult = 23;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case /* Matrix */ 2: {
|
|
49
|
+
matchResult = 25;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case /* PluginData */ 3: {
|
|
53
|
+
matchResult = 26;
|
|
54
|
+
pluginData = fieldValue.fields[0];
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
default: {
|
|
58
|
+
matchResult = 2;
|
|
59
|
+
answer_2 = fieldValue.fields[0];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case /* Password */ 3: {
|
|
65
|
+
switch (fieldValue.tag) {
|
|
66
|
+
case /* Multiple */ 1: {
|
|
67
|
+
matchResult = 23;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case /* Matrix */ 2: {
|
|
71
|
+
matchResult = 25;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
case /* PluginData */ 3: {
|
|
75
|
+
matchResult = 26;
|
|
76
|
+
pluginData = fieldValue.fields[0];
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
default: {
|
|
80
|
+
matchResult = 3;
|
|
81
|
+
answer_3 = fieldValue.fields[0];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case /* Search */ 4: {
|
|
87
|
+
switch (fieldValue.tag) {
|
|
88
|
+
case /* Multiple */ 1: {
|
|
89
|
+
matchResult = 23;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case /* Matrix */ 2: {
|
|
93
|
+
matchResult = 25;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case /* PluginData */ 3: {
|
|
97
|
+
matchResult = 26;
|
|
98
|
+
pluginData = fieldValue.fields[0];
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
default: {
|
|
102
|
+
matchResult = 4;
|
|
103
|
+
answer_4 = fieldValue.fields[0];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case /* Color */ 5: {
|
|
109
|
+
switch (fieldValue.tag) {
|
|
110
|
+
case /* Multiple */ 1: {
|
|
111
|
+
matchResult = 23;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case /* Matrix */ 2: {
|
|
115
|
+
matchResult = 25;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case /* PluginData */ 3: {
|
|
119
|
+
matchResult = 26;
|
|
120
|
+
pluginData = fieldValue.fields[0];
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
default: {
|
|
124
|
+
matchResult = 5;
|
|
125
|
+
answer_5 = fieldValue.fields[0];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case /* Number */ 6: {
|
|
131
|
+
switch (fieldValue.tag) {
|
|
132
|
+
case /* Multiple */ 1: {
|
|
133
|
+
matchResult = 23;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case /* Matrix */ 2: {
|
|
137
|
+
matchResult = 25;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
case /* PluginData */ 3: {
|
|
141
|
+
matchResult = 26;
|
|
142
|
+
pluginData = fieldValue.fields[0];
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
default: {
|
|
146
|
+
matchResult = 6;
|
|
147
|
+
answer_6 = fieldValue.fields[0];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case /* Tel */ 7: {
|
|
153
|
+
switch (fieldValue.tag) {
|
|
154
|
+
case /* Multiple */ 1: {
|
|
155
|
+
matchResult = 23;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
case /* Matrix */ 2: {
|
|
159
|
+
matchResult = 25;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case /* PluginData */ 3: {
|
|
163
|
+
matchResult = 26;
|
|
164
|
+
pluginData = fieldValue.fields[0];
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
default: {
|
|
168
|
+
matchResult = 7;
|
|
169
|
+
answer_7 = fieldValue.fields[0];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case /* Date */ 8: {
|
|
175
|
+
switch (fieldValue.tag) {
|
|
176
|
+
case /* Multiple */ 1: {
|
|
177
|
+
matchResult = 23;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
case /* Matrix */ 2: {
|
|
181
|
+
matchResult = 25;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
case /* PluginData */ 3: {
|
|
185
|
+
matchResult = 26;
|
|
186
|
+
pluginData = fieldValue.fields[0];
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
default: {
|
|
190
|
+
matchResult = 8;
|
|
191
|
+
answer_8 = fieldValue.fields[0];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case /* DateTimeLocal */ 9: {
|
|
197
|
+
switch (fieldValue.tag) {
|
|
198
|
+
case /* Multiple */ 1: {
|
|
199
|
+
matchResult = 23;
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
case /* Matrix */ 2: {
|
|
203
|
+
matchResult = 25;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
case /* PluginData */ 3: {
|
|
207
|
+
matchResult = 26;
|
|
208
|
+
pluginData = fieldValue.fields[0];
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
default: {
|
|
212
|
+
matchResult = 9;
|
|
213
|
+
answer_9 = fieldValue.fields[0];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
case /* Time */ 10: {
|
|
219
|
+
switch (fieldValue.tag) {
|
|
220
|
+
case /* Multiple */ 1: {
|
|
221
|
+
matchResult = 23;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
case /* Matrix */ 2: {
|
|
225
|
+
matchResult = 25;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case /* PluginData */ 3: {
|
|
229
|
+
matchResult = 26;
|
|
230
|
+
pluginData = fieldValue.fields[0];
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
default: {
|
|
234
|
+
matchResult = 10;
|
|
235
|
+
answer_10 = fieldValue.fields[0];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
case /* Checkbox */ 11: {
|
|
241
|
+
switch (fieldValue.tag) {
|
|
242
|
+
case /* Multiple */ 1: {
|
|
243
|
+
matchResult = 23;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
case /* Matrix */ 2: {
|
|
247
|
+
matchResult = 25;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
case /* PluginData */ 3: {
|
|
251
|
+
matchResult = 26;
|
|
252
|
+
pluginData = fieldValue.fields[0];
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
default: {
|
|
256
|
+
matchResult = 11;
|
|
257
|
+
answer_11 = fieldValue.fields[0];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
case /* SingleChoice */ 13: {
|
|
263
|
+
switch (fieldValue.tag) {
|
|
264
|
+
case /* Multiple */ 1: {
|
|
265
|
+
matchResult = 23;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
case /* Matrix */ 2: {
|
|
269
|
+
matchResult = 25;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
case /* PluginData */ 3: {
|
|
273
|
+
matchResult = 26;
|
|
274
|
+
pluginData = fieldValue.fields[0];
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
default: {
|
|
278
|
+
matchResult = 12;
|
|
279
|
+
answer_12 = fieldValue.fields[0];
|
|
280
|
+
info = fieldType.fields[0];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
case /* Radio */ 12: {
|
|
286
|
+
switch (fieldValue.tag) {
|
|
287
|
+
case /* Multiple */ 1: {
|
|
288
|
+
matchResult = 23;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
case /* Matrix */ 2: {
|
|
292
|
+
matchResult = 25;
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
case /* PluginData */ 3: {
|
|
296
|
+
matchResult = 26;
|
|
297
|
+
pluginData = fieldValue.fields[0];
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
default: {
|
|
301
|
+
matchResult = 13;
|
|
302
|
+
answer_13 = fieldValue.fields[0];
|
|
303
|
+
info_1 = fieldType.fields[0];
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
case /* Dropdown */ 14: {
|
|
309
|
+
switch (fieldValue.tag) {
|
|
310
|
+
case /* Multiple */ 1: {
|
|
311
|
+
matchResult = 23;
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
case /* Matrix */ 2: {
|
|
315
|
+
matchResult = 25;
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
case /* PluginData */ 3: {
|
|
319
|
+
matchResult = 26;
|
|
320
|
+
pluginData = fieldValue.fields[0];
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
default: {
|
|
324
|
+
matchResult = 14;
|
|
325
|
+
answer_14 = fieldValue.fields[0];
|
|
326
|
+
info_2 = fieldType.fields[0];
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
case /* TextAutoComplete */ 18: {
|
|
332
|
+
switch (fieldValue.tag) {
|
|
333
|
+
case /* Multiple */ 1: {
|
|
334
|
+
matchResult = 23;
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
case /* Matrix */ 2: {
|
|
338
|
+
matchResult = 25;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
case /* PluginData */ 3: {
|
|
342
|
+
matchResult = 26;
|
|
343
|
+
pluginData = fieldValue.fields[0];
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
default: {
|
|
347
|
+
matchResult = 15;
|
|
348
|
+
answer_15 = fieldValue.fields[0];
|
|
349
|
+
info_3 = fieldType.fields[0];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
case /* MultiChoice */ 15: {
|
|
355
|
+
switch (fieldValue.tag) {
|
|
356
|
+
case /* Single */ 0: {
|
|
357
|
+
matchResult = 24;
|
|
358
|
+
answer_21 = fieldValue.fields[0];
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
case /* Matrix */ 2: {
|
|
362
|
+
matchResult = 25;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
case /* PluginData */ 3: {
|
|
366
|
+
matchResult = 26;
|
|
367
|
+
pluginData = fieldValue.fields[0];
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
default: {
|
|
371
|
+
matchResult = 16;
|
|
372
|
+
answers = fieldValue.fields[0];
|
|
373
|
+
info_4 = fieldType.fields[0];
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
case /* CheckboxList */ 16: {
|
|
379
|
+
switch (fieldValue.tag) {
|
|
380
|
+
case /* Single */ 0: {
|
|
381
|
+
matchResult = 24;
|
|
382
|
+
answer_21 = fieldValue.fields[0];
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
case /* Matrix */ 2: {
|
|
386
|
+
matchResult = 25;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
case /* PluginData */ 3: {
|
|
390
|
+
matchResult = 26;
|
|
391
|
+
pluginData = fieldValue.fields[0];
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
default: {
|
|
395
|
+
matchResult = 17;
|
|
396
|
+
answers_1 = fieldValue.fields[0];
|
|
397
|
+
info_5 = fieldType.fields[0];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
case /* TagList */ 17: {
|
|
403
|
+
switch (fieldValue.tag) {
|
|
404
|
+
case /* Single */ 0: {
|
|
405
|
+
matchResult = 24;
|
|
406
|
+
answer_21 = fieldValue.fields[0];
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
case /* Matrix */ 2: {
|
|
410
|
+
matchResult = 25;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
case /* PluginData */ 3: {
|
|
414
|
+
matchResult = 26;
|
|
415
|
+
pluginData = fieldValue.fields[0];
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
default: {
|
|
419
|
+
matchResult = 18;
|
|
420
|
+
answers_2 = fieldValue.fields[0];
|
|
421
|
+
info_6 = fieldType.fields[0];
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
case /* Signature */ 20: {
|
|
427
|
+
switch (fieldValue.tag) {
|
|
428
|
+
case /* Multiple */ 1: {
|
|
429
|
+
matchResult = 23;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
case /* Matrix */ 2: {
|
|
433
|
+
matchResult = 25;
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
case /* PluginData */ 3: {
|
|
437
|
+
matchResult = 26;
|
|
438
|
+
pluginData = fieldValue.fields[0];
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
default: {
|
|
442
|
+
matchResult = 19;
|
|
443
|
+
answer_19 = fieldValue.fields[0];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
case /* Message */ 21: {
|
|
449
|
+
matchResult = 20;
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
case /* PluginField */ 22: {
|
|
453
|
+
switch (fieldValue.tag) {
|
|
454
|
+
case /* Multiple */ 1: {
|
|
455
|
+
matchResult = 23;
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
case /* Matrix */ 2: {
|
|
459
|
+
matchResult = 25;
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
case /* PluginData */ 3: {
|
|
463
|
+
matchResult = 26;
|
|
464
|
+
pluginData = fieldValue.fields[0];
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
default: {
|
|
468
|
+
matchResult = 21;
|
|
469
|
+
answer_20 = fieldValue.fields[0];
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
case /* Matrix */ 19: {
|
|
475
|
+
matchResult = 22;
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
default:
|
|
479
|
+
switch (fieldValue.tag) {
|
|
480
|
+
case /* Multiple */ 1: {
|
|
481
|
+
matchResult = 23;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
case /* Matrix */ 2: {
|
|
485
|
+
matchResult = 25;
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
case /* PluginData */ 3: {
|
|
489
|
+
matchResult = 26;
|
|
490
|
+
pluginData = fieldValue.fields[0];
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
default: {
|
|
494
|
+
matchResult = 0;
|
|
495
|
+
answer = fieldValue.fields[0];
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
switch (matchResult) {
|
|
500
|
+
case 0:
|
|
501
|
+
return answer!.Value;
|
|
502
|
+
case 1:
|
|
503
|
+
return answer_1!.Value;
|
|
504
|
+
case 2:
|
|
505
|
+
return answer_2!.Value;
|
|
506
|
+
case 3:
|
|
507
|
+
return "***";
|
|
508
|
+
case 4:
|
|
509
|
+
return answer_4!.Value;
|
|
510
|
+
case 5:
|
|
511
|
+
return answer_5!.Value;
|
|
512
|
+
case 6:
|
|
513
|
+
return answer_6!.Value;
|
|
514
|
+
case 7:
|
|
515
|
+
return answer_7!.Value;
|
|
516
|
+
case 8:
|
|
517
|
+
return answer_8!.Value;
|
|
518
|
+
case 9:
|
|
519
|
+
return answer_9!.Value;
|
|
520
|
+
case 10:
|
|
521
|
+
return answer_10!.Value;
|
|
522
|
+
case 11: {
|
|
523
|
+
const matchValue_1: string = answer_11!.Value.toLowerCase();
|
|
524
|
+
switch (matchValue_1) {
|
|
525
|
+
case "true":
|
|
526
|
+
case "yes":
|
|
527
|
+
case "1":
|
|
528
|
+
return "Yes";
|
|
529
|
+
default:
|
|
530
|
+
return "No";
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
case 12:
|
|
534
|
+
return defaultArg(map<Shared_FieldOption, string>((opt_1: Shared_FieldOption): string => opt_1.Description, tryFind<Shared_FieldOption>((opt: Shared_FieldOption): boolean => (opt.Value === answer_12!.Value), info!.Options)), answer_12!.Value);
|
|
535
|
+
case 13:
|
|
536
|
+
return defaultArg(map<Shared_FieldOption, string>((opt_3: Shared_FieldOption): string => opt_3.Description, tryFind<Shared_FieldOption>((opt_2: Shared_FieldOption): boolean => (opt_2.Value === answer_13!.Value), info_1!.Options)), answer_13!.Value);
|
|
537
|
+
case 14:
|
|
538
|
+
return defaultArg(map<Shared_FieldOption, string>((opt_5: Shared_FieldOption): string => opt_5.Description, tryFind<Shared_FieldOption>((opt_4: Shared_FieldOption): boolean => (opt_4.Value === answer_14!.Value), info_2!.Options)), answer_14!.Value);
|
|
539
|
+
case 15:
|
|
540
|
+
return defaultArg(map<Shared_FieldOption, string>((opt_7: Shared_FieldOption): string => opt_7.Description, tryFind<Shared_FieldOption>((opt_6: Shared_FieldOption): boolean => (opt_6.Value === answer_15!.Value), info_3!.Options)), answer_15!.Value);
|
|
541
|
+
case 16:
|
|
542
|
+
return join(", ", choose<Shared_FieldAnswer, string>((answer_16: Shared_FieldAnswer): Option<string> => map<Shared_FieldOption, string>((opt_9: Shared_FieldOption): string => opt_9.Description, tryFind<Shared_FieldOption>((opt_8: Shared_FieldOption): boolean => (opt_8.Value === answer_16.Value), info_4!.Options)), toList<Shared_FieldAnswer>(answers!)));
|
|
543
|
+
case 17:
|
|
544
|
+
return join(", ", choose<Shared_FieldAnswer, string>((answer_17: Shared_FieldAnswer): Option<string> => map<Shared_FieldOption, string>((opt_11: Shared_FieldOption): string => opt_11.Description, tryFind<Shared_FieldOption>((opt_10: Shared_FieldOption): boolean => (opt_10.Value === answer_17.Value), info_5!.Options)), toList<Shared_FieldAnswer>(answers_1!)));
|
|
545
|
+
case 18:
|
|
546
|
+
return join(", ", choose<Shared_FieldAnswer, string>((answer_18: Shared_FieldAnswer): Option<string> => map<Shared_FieldOption, string>((opt_13: Shared_FieldOption): string => opt_13.Description, tryFind<Shared_FieldOption>((opt_12: Shared_FieldOption): boolean => (opt_12.Value === answer_18.Value), info_6!.Options)), toList<Shared_FieldAnswer>(answers_2!)));
|
|
547
|
+
case 19:
|
|
548
|
+
if (!isNullOrWhiteSpace(answer_19!.Value)) {
|
|
549
|
+
return "*Signature provided*";
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
return "*No signature*";
|
|
553
|
+
}
|
|
554
|
+
case 20:
|
|
555
|
+
return "";
|
|
556
|
+
case 21:
|
|
557
|
+
return answer_20!.Value;
|
|
558
|
+
case 22:
|
|
559
|
+
return "";
|
|
560
|
+
case 23:
|
|
561
|
+
return "*Type mismatch: Expected single value*";
|
|
562
|
+
case 24:
|
|
563
|
+
return answer_21!.Value;
|
|
564
|
+
case 25:
|
|
565
|
+
return "";
|
|
566
|
+
default:
|
|
567
|
+
return join(", ", map_1<Shared_PluginDataProperty, string>((prop: Shared_PluginDataProperty): string => {
|
|
568
|
+
const matchValue_2: Option<string> = prop.DisplayName;
|
|
569
|
+
if (matchValue_2 == null) {
|
|
570
|
+
return toText(printf("%s: %s"))(prop.Name)(prop.Value);
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
const displayName: string = value_4(matchValue_2);
|
|
574
|
+
return toText(printf("%s: %s"))(displayName)(prop.Value);
|
|
575
|
+
}
|
|
576
|
+
}, pluginData!));
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function formatMatrixFieldAsTable(fieldLabel: string, matrixInfo: Spec_MatrixInfo, matrixAnswer: Option<Shared_MatrixAnswer>): string {
|
|
581
|
+
let arg_3: string, arg_4: string, arg_6: string, sv_1: string, arg_5: string;
|
|
582
|
+
const items: FSharpList<Shared_FieldOption> = matrixInfo.Items;
|
|
583
|
+
const options: FSharpList<Shared_FieldOption> = matrixInfo.Options;
|
|
584
|
+
if (isEmpty(items) ? true : isEmpty(options)) {
|
|
585
|
+
return "";
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
const lines: string[] = [];
|
|
589
|
+
void (lines.push(toText(printf("#### %s"))(fieldLabel)));
|
|
590
|
+
void (lines.push(""));
|
|
591
|
+
const headerCells: FSharpList<string> = toList_1<string>(delay<string>((): Iterable<string> => append<string>(singleton<string>("Symptom"), delay<string>((): Iterable<string> => map_1<Shared_FieldOption, string>((opt: Shared_FieldOption): string => toText(printf("%s (%s)"))(opt.Description)(opt.Value), options)))));
|
|
592
|
+
void (lines.push((arg_3 = join(" | ", headerCells), toText(printf("| %s |"))(arg_3))));
|
|
593
|
+
const separators: FSharpList<string> = toList_1<string>(delay<string>((): Iterable<string> => append<string>(singleton<string>("---"), delay<string>((): Iterable<string> => map_1<Shared_FieldOption, string>((_arg: Shared_FieldOption): string => "---", options)))));
|
|
594
|
+
void (lines.push((arg_4 = join(" | ", separators), toText(printf("| %s |"))(arg_4))));
|
|
595
|
+
if (matrixAnswer == null) {
|
|
596
|
+
const enumerator_2: IEnumerator<Shared_FieldOption> = getEnumerator(items);
|
|
597
|
+
try {
|
|
598
|
+
while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
599
|
+
const item_1: Shared_FieldOption = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
600
|
+
const rowCells_1: FSharpList<string> = toList_1<string>(delay<string>((): Iterable<string> => append<string>(singleton<string>(item_1.Description), delay<string>((): Iterable<string> => map_1<Shared_FieldOption, string>((_arg_1: Shared_FieldOption): string => "", options)))));
|
|
601
|
+
void (lines.push((arg_6 = join(" | ", rowCells_1), toText(printf("| %s |"))(arg_6))));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
finally {
|
|
605
|
+
disposeSafe(enumerator_2 as IDisposable);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
const answer: Shared_MatrixAnswer = value_4(matrixAnswer);
|
|
610
|
+
const enumerator: IEnumerator<Shared_FieldOption> = getEnumerator(items);
|
|
611
|
+
try {
|
|
612
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
613
|
+
const item: Shared_FieldOption = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
614
|
+
const selectedValue: Option<string> = FSharpMap__TryFind(answer.Values, new Shared_MatrixItemKey(item.OptionKey.fields[0]));
|
|
615
|
+
const rowCells: string[] = [];
|
|
616
|
+
void (rowCells.push(item.Description));
|
|
617
|
+
const enumerator_1: IEnumerator<Shared_FieldOption> = getEnumerator(options);
|
|
618
|
+
try {
|
|
619
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
620
|
+
const option: Shared_FieldOption = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
621
|
+
if ((selectedValue != null) && ((value_4(selectedValue) === option.Value) && ((sv_1 = value_4(selectedValue), true)))) {
|
|
622
|
+
void (rowCells.push("✔️"));
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
void (rowCells.push(""));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
finally {
|
|
630
|
+
disposeSafe(enumerator_1 as IDisposable);
|
|
631
|
+
}
|
|
632
|
+
void (lines.push((arg_5 = join(" | ", rowCells), toText(printf("| %s |"))(arg_5))));
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
finally {
|
|
636
|
+
disposeSafe(enumerator as IDisposable);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
void (lines.push(""));
|
|
640
|
+
return join("\n", lines);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
function getFieldTypeName(fieldType: Spec_FieldType_$union): string {
|
|
645
|
+
switch (fieldType.tag) {
|
|
646
|
+
case /* TextArea */ 1:
|
|
647
|
+
return "TextArea";
|
|
648
|
+
case /* Email */ 2:
|
|
649
|
+
return "Email";
|
|
650
|
+
case /* Password */ 3:
|
|
651
|
+
return "Password";
|
|
652
|
+
case /* Search */ 4:
|
|
653
|
+
return "Search";
|
|
654
|
+
case /* Color */ 5:
|
|
655
|
+
return "Color";
|
|
656
|
+
case /* Number */ 6:
|
|
657
|
+
return "Number";
|
|
658
|
+
case /* Tel */ 7:
|
|
659
|
+
return "Tel";
|
|
660
|
+
case /* Date */ 8:
|
|
661
|
+
return "Date";
|
|
662
|
+
case /* DateTimeLocal */ 9:
|
|
663
|
+
return "DateTimeLocal";
|
|
664
|
+
case /* Time */ 10:
|
|
665
|
+
return "Time";
|
|
666
|
+
case /* Checkbox */ 11:
|
|
667
|
+
return "Checkbox";
|
|
668
|
+
case /* SingleChoice */ 13:
|
|
669
|
+
return "SingleChoice";
|
|
670
|
+
case /* Radio */ 12:
|
|
671
|
+
return "Radio";
|
|
672
|
+
case /* Dropdown */ 14:
|
|
673
|
+
return "Dropdown";
|
|
674
|
+
case /* TextAutoComplete */ 18:
|
|
675
|
+
return "TextAutoComplete";
|
|
676
|
+
case /* MultiChoice */ 15:
|
|
677
|
+
return "MultiChoice";
|
|
678
|
+
case /* CheckboxList */ 16:
|
|
679
|
+
return "CheckboxList";
|
|
680
|
+
case /* TagList */ 17:
|
|
681
|
+
return "TagList";
|
|
682
|
+
case /* Signature */ 20:
|
|
683
|
+
return "Signature";
|
|
684
|
+
case /* Message */ 21:
|
|
685
|
+
return "Message";
|
|
686
|
+
case /* Matrix */ 19:
|
|
687
|
+
return "Matrix";
|
|
688
|
+
case /* PluginField */ 22:
|
|
689
|
+
return "PluginField";
|
|
690
|
+
default:
|
|
691
|
+
return "Text";
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
function generatePathwayMermaid(pathway: ClinicalPathway_ClinicalPathwaySpec, formSpec: Spec_FormSpec$1<Spec_FieldType_$union>): string {
|
|
696
|
+
return pathwaySpecToGraph<void, void, string>(MermaidRenderer_$ctor_Z1FBCCD16(true), pathway, formSpec);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Renders a FormSpec to markdown format with configurable heading levels and optional pathway diagrams.
|
|
701
|
+
* Uses well-typed Spec.FieldType and Values.FieldValue throughout - NO boxing/unboxing.
|
|
702
|
+
*/
|
|
703
|
+
export function renderFormSpecToMarkdown(startHeading: int32, withPathway: boolean, formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, formValues: Option<FSharpMap<Values_StepOrder, FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>>>): string {
|
|
704
|
+
let matchValue_4: Option<Values_FieldDetails$1<Spec_FieldType_$union>>, matchValue_5: Shared_FieldValue_$union;
|
|
705
|
+
const lines: string[] = [];
|
|
706
|
+
const titleHeading: string = generateHeadingLevel(startHeading);
|
|
707
|
+
void (lines.push(`${titleHeading} ${formSpec.Title}`));
|
|
708
|
+
void (lines.push(""));
|
|
709
|
+
const matchValue: Option<string> = formSpec.Code;
|
|
710
|
+
if (matchValue == null) {
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
const code: string = value_4(matchValue);
|
|
714
|
+
void (lines.push(`**Code:** ${code}`));
|
|
715
|
+
}
|
|
716
|
+
void (lines.push(`**Version:** ${formSpec.Version}`));
|
|
717
|
+
void (lines.push(""));
|
|
718
|
+
if (!isNullOrWhiteSpace(formSpec.Abstract)) {
|
|
719
|
+
void (lines.push(formSpec.Abstract));
|
|
720
|
+
void (lines.push(""));
|
|
721
|
+
}
|
|
722
|
+
if (!isEmpty(formSpec.CategoryTags)) {
|
|
723
|
+
const categoryHeading: string = generateHeadingLevel(startHeading + 1);
|
|
724
|
+
void (lines.push(`${categoryHeading} Categories`));
|
|
725
|
+
void (lines.push(""));
|
|
726
|
+
const enumerator: IEnumerator<string> = getEnumerator(formSpec.CategoryTags);
|
|
727
|
+
try {
|
|
728
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
729
|
+
const tag: string = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
730
|
+
void (lines.push(`- ${tag}`));
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
finally {
|
|
734
|
+
disposeSafe(enumerator as IDisposable);
|
|
735
|
+
}
|
|
736
|
+
void (lines.push(""));
|
|
737
|
+
}
|
|
738
|
+
if (!isEmpty(formSpec.AssociatedCodes)) {
|
|
739
|
+
const codesHeading: string = generateHeadingLevel(startHeading + 1);
|
|
740
|
+
void (lines.push(`${codesHeading} Associated Codes`));
|
|
741
|
+
void (lines.push(""));
|
|
742
|
+
const enumerator_1: IEnumerator<string> = getEnumerator(formSpec.AssociatedCodes);
|
|
743
|
+
try {
|
|
744
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
745
|
+
const code_1: string = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
746
|
+
void (lines.push(`- \`${code_1}\``));
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
finally {
|
|
750
|
+
disposeSafe(enumerator_1 as IDisposable);
|
|
751
|
+
}
|
|
752
|
+
void (lines.push(""));
|
|
753
|
+
}
|
|
754
|
+
const stepHeading: string = generateHeadingLevel(startHeading + 1);
|
|
755
|
+
const enumerator_2: IEnumerator<Spec_FormStep$1<Spec_FieldType_$union>> = getEnumerator(formSpec.Steps);
|
|
756
|
+
try {
|
|
757
|
+
while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
758
|
+
const step: Spec_FormStep$1<Spec_FieldType_$union> = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
759
|
+
const stepLabel: string = isNullOrWhiteSpace(step.StepLabel) ? (`Step ${step.StepOrder}`) : step.StepLabel;
|
|
760
|
+
void (lines.push(`${stepHeading} ${stepLabel}`));
|
|
761
|
+
void (lines.push(""));
|
|
762
|
+
const patternInput: [FSharpList<Spec_FormField$1<Spec_FieldType_$union>>, FSharpList<Spec_FormField$1<Spec_FieldType_$union>>] = partition<Spec_FormField$1<Spec_FieldType_$union>>((field: Spec_FormField$1<Spec_FieldType_$union>): boolean => {
|
|
763
|
+
if (field.FieldType.tag === /* Matrix */ 19) {
|
|
764
|
+
return true;
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
769
|
+
}, step.Fields);
|
|
770
|
+
const regularFields: FSharpList<Spec_FormField$1<Spec_FieldType_$union>> = patternInput[1];
|
|
771
|
+
const matrixFields: FSharpList<Spec_FormField$1<Spec_FieldType_$union>> = patternInput[0];
|
|
772
|
+
if (formValues == null) {
|
|
773
|
+
if (!isEmpty(regularFields)) {
|
|
774
|
+
void (lines.push("**Fields:**"));
|
|
775
|
+
const enumerator_5: IEnumerator<Spec_FormField$1<Spec_FieldType_$union>> = getEnumerator(regularFields);
|
|
776
|
+
try {
|
|
777
|
+
while (enumerator_5["System.Collections.IEnumerator.MoveNext"]()) {
|
|
778
|
+
const field_3: Spec_FormField$1<Spec_FieldType_$union> = enumerator_5["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
779
|
+
const fieldTypeName: string = getFieldTypeName(field_3.FieldType);
|
|
780
|
+
const requiredText: string = field_3.IsOptional ? "" : " *(required)*";
|
|
781
|
+
void (lines.push(toText(printf("- %s%s [%s]"))(field_3.Label)(requiredText)(fieldTypeName)));
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
finally {
|
|
785
|
+
disposeSafe(enumerator_5 as IDisposable);
|
|
786
|
+
}
|
|
787
|
+
void (lines.push(""));
|
|
788
|
+
}
|
|
789
|
+
const enumerator_6: IEnumerator<Spec_FormField$1<Spec_FieldType_$union>> = getEnumerator(matrixFields);
|
|
790
|
+
try {
|
|
791
|
+
while (enumerator_6["System.Collections.IEnumerator.MoveNext"]()) {
|
|
792
|
+
const field_4: Spec_FormField$1<Spec_FieldType_$union> = enumerator_6["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
793
|
+
const fieldTypeName_1: string = getFieldTypeName(field_4.FieldType);
|
|
794
|
+
const requiredText_1: string = field_4.IsOptional ? "" : " *(required)*";
|
|
795
|
+
void (lines.push(toText(printf("- %s%s [%s]"))(field_4.Label)(requiredText_1)(fieldTypeName_1)));
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
finally {
|
|
799
|
+
disposeSafe(enumerator_6 as IDisposable);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
const stepValues: FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>> = defaultArg(FSharpMap__TryFind(value_4(formValues), new Values_StepOrder(step.StepOrder)), empty<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>({
|
|
804
|
+
Compare: compare,
|
|
805
|
+
}));
|
|
806
|
+
const enumerator_3: IEnumerator<Spec_FormField$1<Spec_FieldType_$union>> = getEnumerator(regularFields);
|
|
807
|
+
try {
|
|
808
|
+
while (enumerator_3["System.Collections.IEnumerator.MoveNext"]()) {
|
|
809
|
+
const field_1: Spec_FormField$1<Spec_FieldType_$union> = enumerator_3["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
810
|
+
const matchValue_2: Option<Values_FieldDetails$1<Spec_FieldType_$union>> = FSharpMap__TryFind(stepValues, field_1.FieldKey);
|
|
811
|
+
if (matchValue_2 == null) {
|
|
812
|
+
void (lines.push(toText(printf("- **%s**: *No response provided*"))(field_1.Label)));
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
const formattedValue: string = formatFieldValue(field_1.FieldType, value_4(matchValue_2).FieldValue, field_1);
|
|
816
|
+
if (!isNullOrWhiteSpace(formattedValue)) {
|
|
817
|
+
void (lines.push(toText(printf("- **%s**: %s"))(field_1.Label)(formattedValue)));
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
finally {
|
|
823
|
+
disposeSafe(enumerator_3 as IDisposable);
|
|
824
|
+
}
|
|
825
|
+
const enumerator_4: IEnumerator<Spec_FormField$1<Spec_FieldType_$union>> = getEnumerator(matrixFields);
|
|
826
|
+
try {
|
|
827
|
+
while (enumerator_4["System.Collections.IEnumerator.MoveNext"]()) {
|
|
828
|
+
const field_2: Spec_FormField$1<Spec_FieldType_$union> = enumerator_4["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
829
|
+
const matchValue_3: Spec_FieldType_$union = field_2.FieldType;
|
|
830
|
+
if (matchValue_3.tag === /* Matrix */ 19) {
|
|
831
|
+
const tableMarkdown: string = formatMatrixFieldAsTable(field_2.Label, matchValue_3.fields[0], (matchValue_4 = FSharpMap__TryFind(stepValues, field_2.FieldKey), (matchValue_4 == null) ? undefined : ((matchValue_5 = value_4(matchValue_4).FieldValue, (matchValue_5.tag === /* Single */ 0) ? undefined : ((matchValue_5.tag === /* Multiple */ 1) ? undefined : ((matchValue_5.tag === /* PluginData */ 3) ? undefined : matchValue_5.fields[0]))))));
|
|
832
|
+
if (!isNullOrWhiteSpace(tableMarkdown)) {
|
|
833
|
+
void (lines.push(""));
|
|
834
|
+
void (lines.push(tableMarkdown));
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
finally {
|
|
840
|
+
disposeSafe(enumerator_4 as IDisposable);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
void (lines.push(""));
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
finally {
|
|
847
|
+
disposeSafe(enumerator_2 as IDisposable);
|
|
848
|
+
}
|
|
849
|
+
if (withPathway) {
|
|
850
|
+
const matchValue_6: Option<ClinicalPathway_ClinicalPathwaySpec> = formSpec.ClinicalPathway;
|
|
851
|
+
if (matchValue_6 == null) {
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
const pathway: ClinicalPathway_ClinicalPathwaySpec = value_4(matchValue_6);
|
|
855
|
+
const pathwayHeading: string = generateHeadingLevel(startHeading + 1);
|
|
856
|
+
void (lines.push(`${pathwayHeading} Clinical Pathway`));
|
|
857
|
+
void (lines.push(""));
|
|
858
|
+
const mermaid: string = generatePathwayMermaid(pathway, formSpec);
|
|
859
|
+
void (lines.push(mermaid));
|
|
860
|
+
void (lines.push(""));
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
const reviewHeading: string = generateHeadingLevel(startHeading + 1);
|
|
864
|
+
void (lines.push(`${reviewHeading} Review Requirements`));
|
|
865
|
+
void (lines.push(""));
|
|
866
|
+
const requiresReviewText: string = formSpec.RequiresReview ? "Yes" : "No";
|
|
867
|
+
const requiresReviewAndApprovalText: string = formSpec.RequiresReviewAndApproval ? "Yes" : "No";
|
|
868
|
+
void (lines.push(toText(printf("- **Requires Review:** %s"))(requiresReviewText)));
|
|
869
|
+
void (lines.push(toText(printf("- **Requires Review and Approval:** %s"))(requiresReviewAndApprovalText)));
|
|
870
|
+
void (lines.push(""));
|
|
871
|
+
return join("\n", lines);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
//# sourceMappingURL=FormSpecMarkdownRenderer.ts.map
|