@f1studio/form-spec 5.0.0-alpha.127 → 5.0.0-alpha.129

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.
Files changed (99) hide show
  1. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
  2. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +1 -1
  3. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
  4. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +1 -1
  5. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
  6. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +9 -3
  7. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  8. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +2 -2
  9. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -1
  10. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -1
  11. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +2 -2
  12. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
  13. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
  14. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +2 -2
  15. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
  16. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -1
  17. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +21 -20
  18. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
  19. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
  20. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +20 -20
  21. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
  22. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -1
  23. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +21 -21
  24. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js.map +1 -1
  25. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +105 -41
  26. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
  27. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +1 -1
  28. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +269 -42
  29. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  30. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
  31. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +8 -8
  32. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
  33. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
  34. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js +12 -12
  35. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
  36. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
  37. package/FormSpec.TS/FormSpec.FS/Migrator.js +2 -2
  38. package/FormSpec.TS/FormSpec.FS/Migrator.js.map +1 -1
  39. package/FormSpec.TS/FormSpec.FS/Migrator.ts.map +1 -1
  40. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js +4 -4
  41. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js.map +1 -1
  42. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +1 -1
  43. package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Decode.fs.js → Thoth.Json/packages/Thoth.Json/Decode.js} +119 -113
  44. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js.map +1 -0
  45. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +1 -0
  46. package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Encode.fs.js → Thoth.Json/packages/Thoth.Json/Encode.js} +7 -7
  47. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -0
  48. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +1 -0
  49. package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Extra.fs.js → Thoth.Json/packages/Thoth.Json/Extra.js} +4 -4
  50. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.js.map +1 -0
  51. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.ts.map +1 -0
  52. package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Types.fs.js → Thoth.Json/packages/Thoth.Json/Types.js} +2 -2
  53. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.js.map +1 -0
  54. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.ts.map +1 -0
  55. package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
  56. package/README.md +7 -7
  57. package/{fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts → Thoth.Json/packages/Thoth.Json/Decode.d.ts} +2 -2
  58. package/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +1 -0
  59. package/{fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts → Thoth.Json/packages/Thoth.Json/Encode.d.ts} +2 -2
  60. package/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +1 -0
  61. package/Thoth.Json/packages/Thoth.Json/Extra.d.ts +3 -0
  62. package/Thoth.Json/packages/Thoth.Json/Extra.d.ts.map +1 -0
  63. package/{fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts → Thoth.Json/packages/Thoth.Json/Types.d.ts} +1 -1
  64. package/Thoth.Json/packages/Thoth.Json/Types.d.ts.map +1 -0
  65. package/package.json +1 -1
  66. package/src/FormSpec.FS/BlueprintValidation.ts +1 -1
  67. package/src/FormSpec.FS/FormSpecHelpers.ts +1 -1
  68. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +1 -1
  69. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +12 -11
  70. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +4 -4
  71. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +3 -3
  72. package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +95 -16
  73. package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +231 -50
  74. package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +2 -2
  75. package/src/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts +2 -2
  76. package/src/FormSpec.FS/Migrator.ts +1 -1
  77. package/src/FormSpec.FS/PathwayExecutor.ts +1 -1
  78. package/src/Thoth.Json/packages/Thoth.Json/Decode.ts +1938 -0
  79. package/src/Thoth.Json/packages/Thoth.Json/Encode.ts +475 -0
  80. package/src/Thoth.Json/packages/Thoth.Json/Extra.ts +11 -0
  81. package/src/Thoth.Json/packages/Thoth.Json/Types.ts +176 -0
  82. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +0 -1768
  83. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +0 -1
  84. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +0 -1
  85. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +0 -811
  86. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +0 -1
  87. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +0 -1
  88. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +0 -47
  89. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +0 -1
  90. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +0 -1
  91. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +0 -34
  92. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +0 -68
  93. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +0 -1
  94. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +0 -1
  95. package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts.map +0 -1
  96. package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts.map +0 -1
  97. package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts +0 -3
  98. package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts.map +0 -1
  99. package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts.map +0 -1
@@ -1,23 +1,23 @@
1
- import { value as value_11, map, unwrap, defaultArgWith as defaultArgWith_1, Option, defaultArg as defaultArg_1 } from "@fable-org/fable-library-js/Option.js";
2
- import { toArray as toArray_1, length as length_1, tryPick, filter, mapIndexed as mapIndexed_1, isEmpty, singleton, map as map_3, empty, ofArray as ofArray_1, ofSeq, fold, collect, tryFind, FSharpList } from "@fable-org/fable-library-js/List.js";
3
- import { join, printf, toConsole } from "@fable-org/fable-library-js/String.js";
4
- import { Auto_generateBoxedEncoder_437914C6, toString } from "../../fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
5
- import { array_type, string_type, union_type, TypeInfo, obj_type } from "@fable-org/fable-library-js/Reflection.js";
6
- import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
7
- import { defaultOf, equals, createObj, stringHash, compare, IDisposable, disposeSafe, IEnumerator, getEnumerator, IMap, isArrayLike, uncurry2 } from "@fable-org/fable-library-js/Util.js";
8
- import { Spec_ClinicalInstrumentInfo, Spec_FormClassification_$union, 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_FormClassification_General, 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";
1
+ import { map, unwrap, value as value_19, orElseWith, orElse, defaultArgWith as defaultArgWith_1, Option, defaultArg as defaultArg_1 } from "@fable-org/fable-library-js/Option.js";
2
+ import { toArray as toArray_1, length as length_1, tryPick, filter, mapIndexed as mapIndexed_1, isEmpty, map as map_3, empty, ofArray as ofArray_1, ofSeq, fold, singleton, collect, tryFind, FSharpList } from "@fable-org/fable-library-js/List.js";
3
+ import { toText, isNullOrEmpty, join, isNullOrWhiteSpace, printf, toConsole } from "@fable-org/fable-library-js/String.js";
4
+ import { Auto_generateBoxedEncoder_437914C6, toString } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
5
+ import { Spec_SingleChoiceInfo, Spec_ClinicalInstrumentInfo, Spec_FormClassification_$union, 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_FormClassification_General, 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";
6
+ import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
7
+ import { comparePrimitives, defaultOf, equals, createObj, stringHash, compare, IDisposable, disposeSafe, IEnumerator, getEnumerator, IMap, isArrayLike, uncurry2 } from "@fable-org/fable-library-js/Util.js";
9
8
  import { FSharpResult$2_Ok, FSharpResult$2_Error, FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
10
9
  import { newGuid, parse, tryParse } from "@fable-org/fable-library-js/Guid.js";
11
10
  import { Union, FSharpRef } from "@fable-org/fable-library-js/Types.js";
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";
13
- import { ErrorReason_$union } from "../../fable_modules/Thoth.Json.10.4.1/Types.fs.js";
14
- import { count, ofSeq as ofSeq_1, toList, FSharpMap } from "@fable-org/fable-library-js/Map.js";
11
+ import { array_type, string_type, obj_type, union_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
12
+ import { array as array_7, at, IOptionalGetter, IGetters, dict as dict_1, string, IRequiredGetter, object, fromString as fromString_1 } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
13
+ import { ErrorReason_$union } from "../../Thoth.Json/packages/Thoth.Json/Types.js";
14
+ import { tryFind as tryFind_1, empty as empty_2, count, ofSeq as ofSeq_1, toList, FSharpMap } from "@fable-org/fable-library-js/Map.js";
15
15
  import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
16
16
  import { int32 } from "@fable-org/fable-library-js/Int32.js";
17
17
  import { getFieldDetails as getFieldDetails_1, FieldDetails$1, findStepIndexForField, updateField } from "../FormSpecValues.js";
18
18
  import { length, 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";
19
19
  import { toArray, ofArray } from "@fable-org/fable-library-js/Set.js";
20
- import { map as map_1 } from "@fable-org/fable-library-js/Array.js";
20
+ import { tryFind as tryFind_2, append, map as map_1 } from "@fable-org/fable-library-js/Array.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";
@@ -74,10 +74,10 @@ export function normalizeFormValuesForPlatformApi(formValues: any): any {
74
74
  return formValues;
75
75
  }
76
76
 
77
- export function serializeFormSpec(formSpec: any): string {
77
+ export function serializeFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>): string {
78
78
  toConsole(printf("[API.Helpers] Serializing FormSpec!!"));
79
- toConsole(`[API.Helpers] FormSpec: ${formSpec}`);
80
- return toString(0, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(formSpec));
79
+ toConsole(`[API.Helpers] FormSpec: ${formSpec.Title}`);
80
+ return toString(0, Auto_generateBoxedEncoder_437914C6(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined, undefined)(formSpec));
81
81
  }
82
82
 
83
83
  export function deserializeFormSpec(json: string): Option<Spec_FormSpec$1<Spec_FieldType_$union>> {
@@ -329,40 +329,57 @@ export function decodeAsMatrixValue(fieldKey: string, obj: any): { description:
329
329
  }
330
330
  }
331
331
 
332
+ function decodePropertyKey(get$: IGetters): string {
333
+ let objectArg: IOptionalGetter, objectArg_2: IOptionalGetter;
334
+ const matchValue: Option<string> = orElse(orElseWith<string>((objectArg = get$.Optional, objectArg.Field<string>("PropertyKey", string)), (): Option<string> => {
335
+ const objectArg_1: IOptionalGetter = get$.Optional;
336
+ return objectArg_1.Field<string>("propertyKey", string);
337
+ }), orElseWith<string>((objectArg_2 = get$.Optional, objectArg_2.Field<string>("PropertyKey", (firstPath: string, firstValue: any): FSharpResult$2_$union<string, [string, ErrorReason_$union]> => at<string>(singleton("Value"), string, firstPath, firstValue))), (): Option<string> => {
338
+ const objectArg_3: IOptionalGetter = get$.Optional;
339
+ return objectArg_3.Field<string>("propertyKey", (firstPath_1: string, firstValue_1: any): FSharpResult$2_$union<string, [string, ErrorReason_$union]> => at<string>(singleton("Value"), string, firstPath_1, firstValue_1));
340
+ }));
341
+ let matchResult: int32, s_1: string;
342
+ if (matchValue != null) {
343
+ if (!isNullOrWhiteSpace(value_19(matchValue))) {
344
+ matchResult = 0;
345
+ s_1 = value_19(matchValue);
346
+ }
347
+ else {
348
+ matchResult = 1;
349
+ }
350
+ }
351
+ else {
352
+ matchResult = 1;
353
+ }
354
+ switch (matchResult) {
355
+ case 0:
356
+ return parse(s_1!);
357
+ default:
358
+ return newGuid();
359
+ }
360
+ }
361
+
332
362
  export function decodeAsPluginDataArray(fieldKey: string, obj: any): { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[] {
333
363
  let str: string;
334
364
  const objAsString: string = (typeof obj === "string") ? ((str = (obj as string), str)) : toString(0, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(obj));
335
365
  try {
336
- const matchValue: FSharpResult$2_$union<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[], string> = fromString_1<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[]>((path_8: string, value_10: any): FSharpResult$2_$union<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[], [string, ErrorReason_$union]> => array_4<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }>((path_7: string, v: any): FSharpResult$2_$union<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }, [string, ErrorReason_$union]> => object<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }>((get$: IGetters): { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string } => {
337
- let objectArg_6: IOptionalGetter;
338
- let propertyKey: string;
339
- const objectArg: IRequiredGetter = get$.Required;
340
- propertyKey = objectArg.Field<string>("propertyKey", string);
341
- let name: string;
342
- const objectArg_1: IRequiredGetter = get$.Required;
343
- name = objectArg_1.Field<string>("name", string);
344
- let dataType: string;
345
- const objectArg_2: IRequiredGetter = get$.Required;
346
- dataType = objectArg_2.Field<string>("dataType", string);
347
- let value_6: string;
348
- const objectArg_3: IRequiredGetter = get$.Required;
349
- value_6 = objectArg_3.Field<string>("value", string);
350
- let displayName: Option<string>;
351
- const objectArg_4: IOptionalGetter = get$.Optional;
352
- displayName = objectArg_4.Field<string>("displayName", string);
353
- let unit: Option<string>;
354
- const objectArg_5: IOptionalGetter = get$.Optional;
355
- unit = objectArg_5.Field<string>("unit", string);
366
+ const matchValue: FSharpResult$2_$union<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[], string> = fromString_1<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[]>((path_13: string, value_18: any): FSharpResult$2_$union<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }[], [string, ErrorReason_$union]> => array_7<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }>((path_12: string, v: any): FSharpResult$2_$union<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }, [string, ErrorReason_$union]> => object<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }>((get$: IGetters): { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string } => {
367
+ let objectArg: IOptionalGetter, objectArg_1: IOptionalGetter, objectArg_2: IOptionalGetter, objectArg_3: IOptionalGetter, objectArg_4: IOptionalGetter, objectArg_5: IOptionalGetter, objectArg_6: IOptionalGetter, objectArg_7: IOptionalGetter, objectArg_8: IOptionalGetter, objectArg_9: IOptionalGetter, objectArg_10: IOptionalGetter, objectArg_11: IOptionalGetter;
368
+ const name: string = defaultArg_1(orElse((objectArg = get$.Optional, objectArg.Field<string>("Name", string)), (objectArg_1 = get$.Optional, objectArg_1.Field<string>("name", string))), "");
369
+ const dataType: string = defaultArg_1(orElse((objectArg_2 = get$.Optional, objectArg_2.Field<string>("DataType", string)), (objectArg_3 = get$.Optional, objectArg_3.Field<string>("dataType", string))), "string");
370
+ const value_11: string = defaultArg_1(orElse((objectArg_4 = get$.Optional, objectArg_4.Field<string>("Value", string)), (objectArg_5 = get$.Optional, objectArg_5.Field<string>("value", string))), "");
371
+ const displayName: Option<string> = orElse((objectArg_6 = get$.Optional, objectArg_6.Field<string>("DisplayName", string)), (objectArg_7 = get$.Optional, objectArg_7.Field<string>("displayName", string)));
372
+ const unitVal: Option<string> = orElse((objectArg_8 = get$.Optional, objectArg_8.Field<string>("Unit", string)), (objectArg_9 = get$.Optional, objectArg_9.Field<string>("unit", string)));
356
373
  return {
357
374
  dataType: dataType,
358
- description: unwrap((objectArg_6 = get$.Optional, objectArg_6.Field<string>("description", string))),
375
+ description: unwrap(orElse((objectArg_10 = get$.Optional, objectArg_10.Field<string>("Description", string)), (objectArg_11 = get$.Optional, objectArg_11.Field<string>("description", string)))),
359
376
  displayName: unwrap(displayName),
360
377
  name: name,
361
- propertyKey: propertyKey,
362
- unit: unwrap(unit),
363
- value: value_6,
378
+ propertyKey: decodePropertyKey(get$),
379
+ unit: unwrap(unitVal),
380
+ value: value_11,
364
381
  };
365
- }, path_7, v), path_8, value_10), objAsString);
382
+ }, path_12, v), path_13, value_18), objAsString);
366
383
  if (matchValue.tag === /* Error */ 1) {
367
384
  throw new Error(`Field ${fieldKey}: Invalid plugin data format - ${matchValue.fields[0]}`);
368
385
  }
@@ -398,7 +415,7 @@ export function buildFormSpecWithValues(formSpec: Spec_FormSpec$1<Spec_FieldType
398
415
  return undefined;
399
416
  }
400
417
  else {
401
- const field: Spec_FormField$1<Spec_FieldType_$union> = value_11(matchValue);
418
+ const field: Spec_FormField$1<Spec_FieldType_$union> = value_19(matchValue);
402
419
  try {
403
420
  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)), {
404
421
  Compare: compare,
@@ -484,7 +501,7 @@ export function createPluginField(fieldKeyString: string, label: string, config:
484
501
  * TypeScript: createActionState(stateKey: string, label: string, taskDescription: string, priority?: string)
485
502
  */
486
503
  export function createActionState(stateKeyString: string, label: string, taskDescription: string, priority: Option<string>): ClinicalPathway_StateDefinition {
487
- return new ClinicalPathway_StateDefinition(new Shared_StateKey(parse(stateKeyString)), label, 1, ClinicalPathway_StateType_Action(ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction("Clinical", taskDescription, (priority != null) ? ((value_11(priority) === "High") ? ClinicalPathway_TaskPriority_High() : ((value_11(priority) === "Low") ? ClinicalPathway_TaskPriority_Low() : ClinicalPathway_TaskPriority_Medium())) : ClinicalPathway_TaskPriority_Medium(), ClinicalPathway_DueDate_Today(), "Clinical Staff", undefined))), undefined);
504
+ return new ClinicalPathway_StateDefinition(new Shared_StateKey(parse(stateKeyString)), label, 1, ClinicalPathway_StateType_Action(ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction("Clinical", taskDescription, (priority != null) ? ((value_19(priority) === "High") ? ClinicalPathway_TaskPriority_High() : ((value_19(priority) === "Low") ? ClinicalPathway_TaskPriority_Low() : ClinicalPathway_TaskPriority_Medium())) : ClinicalPathway_TaskPriority_Medium(), ClinicalPathway_DueDate_Today(), "Clinical Staff", undefined))), undefined);
488
505
  }
489
506
 
490
507
  /**
@@ -755,12 +772,12 @@ export function getFieldMatrixInfo(field: Spec_FormField$1<Spec_FieldType_$union
755
772
  items: (collection_2 = map_3<Shared_FieldOption, { key: string, label: string }>((item_1: Shared_FieldOption): { key: string, label: string } => ({
756
773
  key: item_1.OptionKey.fields[0],
757
774
  label: item_1.Description,
758
- }), value_11(config_1!.Items)), Array.from(collection_2)),
775
+ }), value_19(config_1!.Items)), Array.from(collection_2)),
759
776
  options: (collection_3 = map_3<Shared_FieldOption, { description: string, key: string, value: string }>((opt_1: Shared_FieldOption): { description: string, key: string, value: string } => ({
760
777
  description: opt_1.Description,
761
778
  key: opt_1.OptionKey.fields[0],
762
779
  value: opt_1.Value,
763
- }), value_11(config_1!.Options)), Array.from(collection_3)),
780
+ }), value_19(config_1!.Options)), Array.from(collection_3)),
764
781
  };
765
782
  default:
766
783
  return undefined;
@@ -777,15 +794,15 @@ export function getFieldMatrixInfoFromValue(field: Spec_FormField$1<Spec_FieldTy
777
794
  const matchValue: Option<Shared_FieldValue_$union> = field.Value;
778
795
  let matchResult: int32, ma: Shared_MatrixAnswer, props: FSharpList<Shared_PluginDataProperty>;
779
796
  if (matchValue != null) {
780
- switch (value_11(matchValue).tag) {
797
+ switch (value_19(matchValue).tag) {
781
798
  case /* Matrix */ 2: {
782
799
  matchResult = 0;
783
- ma = (value_11(matchValue) as Shared_FieldValue<2>).fields[0];
800
+ ma = (value_19(matchValue) as Shared_FieldValue<2>).fields[0];
784
801
  break;
785
802
  }
786
803
  case /* PluginData */ 3: {
787
804
  matchResult = 1;
788
- props = (value_11(matchValue) as Shared_FieldValue<3>).fields[0];
805
+ props = (value_19(matchValue) as Shared_FieldValue<3>).fields[0];
789
806
  break;
790
807
  }
791
808
  default:
@@ -875,7 +892,7 @@ export function extractFormValuesFromFormSpec(spec: Spec_FormSpec$1<Spec_FieldTy
875
892
  return empty_1<[string, any]>();
876
893
  }
877
894
  else {
878
- const fv: Shared_FieldValue_$union = value_11(matchValue);
895
+ const fv: Shared_FieldValue_$union = value_19(matchValue);
879
896
  return singleton_1<[string, any]>([getFieldKeyString(field.FieldKey), (fv.tag === /* Multiple */ 1) ? ((arr = map_1<Shared_FieldAnswer, string>((fa_1: Shared_FieldAnswer): string => fa_1.Value, toArray<Shared_FieldAnswer>(fv.fields[0])), Array.from(arr))) : ((fv.tag === /* Matrix */ 2) ? ((ma = fv.fields[0], (dict = (new Map<string, string>([])), ((enumerator = getEnumerator(ma.Values), (() => {
880
897
  try {
881
898
  while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
@@ -1191,7 +1208,7 @@ export function validateAndBuildFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldTyp
1191
1208
  }));
1192
1209
  }
1193
1210
  else {
1194
- const field: Spec_FormField$1<Spec_FieldType_$union> = value_11(matchValue);
1211
+ const field: Spec_FormField$1<Spec_FieldType_$union> = value_19(matchValue);
1195
1212
  try {
1196
1213
  validFieldCount = ((validFieldCount + 1) | 0);
1197
1214
  }
@@ -1249,7 +1266,7 @@ export function tryEncodeToFormAnswers(provenancePayload: string, filledFormSpec
1249
1266
  error: result.fields[0],
1250
1267
  success: false,
1251
1268
  } : {
1252
- answerCount: (matchValue = result.fields[0].Answers, (matchValue == null) ? 0 : length_1<CoreMRAnswer>(value_11(matchValue))),
1269
+ answerCount: (matchValue = result.fields[0].Answers, (matchValue == null) ? 0 : length_1<CoreMRAnswer>(value_19(matchValue))),
1253
1270
  error: defaultOf(),
1254
1271
  success: true,
1255
1272
  };
@@ -1272,4 +1289,168 @@ export function getAllFieldKeys(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>
1272
1289
  return toArray_1<string>(map_3<Spec_FormField$1<Spec_FieldType_$union>, string>((field: Spec_FormField$1<Spec_FieldType_$union>): string => getFieldKeyString(field.FieldKey), 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, formSpec.Steps)));
1273
1290
  }
1274
1291
 
1292
+ /**
1293
+ * Get comprehensive validation telemetry - structure, data, and provenance validation.
1294
+ * TypeScript: getFullValidationTelemetry(formSpec: FormSpec, values: any) => ValidationTelemetry
1295
+ * ACTIONABLE intelligence - not just counts!
1296
+ */
1297
+ export function getFullValidationTelemetry(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, values: any): any {
1298
+ let dict: any;
1299
+ const valuesDict: FSharpMap<string, any> = empty_2<string, any>({
1300
+ Compare: comparePrimitives,
1301
+ });
1302
+ const fieldTelemetry: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }[] = toArray_1<{ actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }>(map_3<Spec_FormField$1<Spec_FieldType_$union>, { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }>((field: Spec_FormField$1<Spec_FieldType_$union>): { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean } => {
1303
+ let matchValue_2: Spec_FieldType_$union;
1304
+ const fieldKey: string = getFieldKeyString(field.FieldKey);
1305
+ const fieldLabel: string = isNullOrEmpty(field.Label) ? fieldKey : field.Label;
1306
+ const fieldTypeInfo: { isRequired: boolean, typeName: string } = getFieldTypeInfo(field);
1307
+ const fieldValue: Option<any> = tryFind_1<string, any>(fieldKey, valuesDict);
1308
+ let patternInput: [boolean, any[], string[], string[]];
1309
+ const matchValue: Spec_FieldType_$union = field.FieldType;
1310
+ let matchResult: int32, info_2: Spec_SingleChoiceInfo;
1311
+ switch (matchValue.tag) {
1312
+ case /* CheckboxList */ 16: {
1313
+ matchResult = 0;
1314
+ break;
1315
+ }
1316
+ case /* Matrix */ 19: {
1317
+ matchResult = 1;
1318
+ break;
1319
+ }
1320
+ case /* Radio */ 12: {
1321
+ matchResult = 2;
1322
+ info_2 = matchValue.fields[0];
1323
+ break;
1324
+ }
1325
+ case /* SingleChoice */ 13: {
1326
+ matchResult = 2;
1327
+ info_2 = matchValue.fields[0];
1328
+ break;
1329
+ }
1330
+ case /* Dropdown */ 14: {
1331
+ matchResult = 2;
1332
+ info_2 = matchValue.fields[0];
1333
+ break;
1334
+ }
1335
+ default:
1336
+ matchResult = 3;
1337
+ }
1338
+ switch (matchResult) {
1339
+ case 0: {
1340
+ const expected: string[] = toArray_1<string>(map_3<Shared_FieldOption, string>((opt: Shared_FieldOption): string => opt.Value, matchValue.fields[0].Options));
1341
+ patternInput = ([true, [], expected, expected] as [boolean, any[], string[], string[]]);
1342
+ break;
1343
+ }
1344
+ case 1: {
1345
+ const info_1: Spec_MatrixInfo = matchValue.fields[0];
1346
+ const expected_1: string[] = append<string>(toArray_1<string>(map_3<Shared_FieldOption, string>((item: Shared_FieldOption): string => item.Value, info_1.Items)), toArray_1<string>(map_3<Shared_FieldOption, string>((opt_1: Shared_FieldOption): string => opt_1.Value, info_1.Options)));
1347
+ patternInput = ([true, [], expected_1, expected_1] as [boolean, any[], string[], string[]]);
1348
+ break;
1349
+ }
1350
+ case 2: {
1351
+ const expected_2: string[] = toArray_1<string>(map_3<Shared_FieldOption, string>((opt_2: Shared_FieldOption): string => opt_2.Value, info_2!.Options));
1352
+ patternInput = ([true, [], expected_2, expected_2] as [boolean, any[], string[], string[]]);
1353
+ break;
1354
+ }
1355
+ default:
1356
+ patternInput = ([true, [], [], []] as [boolean, any[], string[], string[]]);
1357
+ }
1358
+ let patternInput_1: [boolean, string[], string, string];
1359
+ const isRequired: boolean = !field.IsOptional;
1360
+ const hasValue: boolean = fieldValue != null;
1361
+ let expectedValueDesc: string;
1362
+ const matchValue_1: Spec_FieldType_$union = field.FieldType;
1363
+ switch (matchValue_1.tag) {
1364
+ case /* Text */ 0:
1365
+ case /* TextArea */ 1:
1366
+ case /* Email */ 2: {
1367
+ expectedValueDesc = "text";
1368
+ break;
1369
+ }
1370
+ case /* Number */ 6: {
1371
+ expectedValueDesc = "number";
1372
+ break;
1373
+ }
1374
+ case /* Date */ 8: {
1375
+ expectedValueDesc = "date";
1376
+ break;
1377
+ }
1378
+ case /* Checkbox */ 11: {
1379
+ expectedValueDesc = "boolean";
1380
+ break;
1381
+ }
1382
+ case /* Radio */ 12:
1383
+ case /* SingleChoice */ 13:
1384
+ case /* Dropdown */ 14: {
1385
+ expectedValueDesc = "single choice";
1386
+ break;
1387
+ }
1388
+ case /* CheckboxList */ 16:
1389
+ case /* MultiChoice */ 15: {
1390
+ expectedValueDesc = "multiple choices";
1391
+ break;
1392
+ }
1393
+ case /* Matrix */ 19: {
1394
+ expectedValueDesc = "matrix values";
1395
+ break;
1396
+ }
1397
+ case /* Signature */ 20: {
1398
+ expectedValueDesc = "signature";
1399
+ break;
1400
+ }
1401
+ default:
1402
+ expectedValueDesc = "value";
1403
+ }
1404
+ let actualValueDesc: string;
1405
+ if (fieldValue == null) {
1406
+ actualValueDesc = "null";
1407
+ }
1408
+ else {
1409
+ const v: any = value_19(fieldValue);
1410
+ actualValueDesc = toText(printf("present (%A)"))(v);
1411
+ }
1412
+ patternInput_1 = ((isRequired && !hasValue) ? ([false, ["Required field is empty"], expectedValueDesc, actualValueDesc] as [boolean, string[], string, string]) : (hasValue ? ([true, [], expectedValueDesc, actualValueDesc] as [boolean, string[], string, string]) : ([true, [], expectedValueDesc, actualValueDesc] as [boolean, string[], string, string])));
1413
+ const dataValid: boolean = patternInput_1[0];
1414
+ return {
1415
+ actionHint: !dataValid ? ((matchValue_2 = field.FieldType, (matchValue_2.tag === /* Signature */ 20) ? "Tap to sign" : ((matchValue_2.tag === /* CheckboxList */ 16) ? "Select at least one option" : ((matchValue_2.tag === /* Radio */ 12) ? "Select an option" : ((matchValue_2.tag === /* Text */ 0) ? ("Enter " + fieldLabel) : "Complete this field"))))) : "",
1416
+ actualChoices: patternInput[3],
1417
+ actualValue: patternInput_1[3],
1418
+ dataIssues: patternInput_1[1],
1419
+ dataValid: dataValid,
1420
+ expectedChoices: patternInput[2],
1421
+ expectedValue: patternInput_1[2],
1422
+ fieldKey: fieldKey,
1423
+ fieldLabel: fieldLabel,
1424
+ fieldType: fieldTypeInfo.typeName,
1425
+ severity: !dataValid ? "error" : "success",
1426
+ structureIssues: patternInput[1],
1427
+ structureValid: patternInput[0],
1428
+ };
1429
+ }, 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, formSpec.Steps)));
1430
+ const totalFields: int32 = fieldTelemetry.length | 0;
1431
+ let validFields: int32;
1432
+ const array_1: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }[] = fieldTelemetry.filter((f: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }): boolean => f.dataValid);
1433
+ validFields = array_1.length;
1434
+ let structuralIssues: int32;
1435
+ const array_3: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }[] = fieldTelemetry.filter((f_1: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }): boolean => !f_1.structureValid);
1436
+ structuralIssues = array_3.length;
1437
+ let dataIssues_1: int32;
1438
+ const array_5: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }[] = fieldTelemetry.filter((f_2: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }): boolean => !f_2.dataValid);
1439
+ dataIssues_1 = array_5.length;
1440
+ const overallStatus: string = (structuralIssues > 0) ? "critical" : ((dataIssues_1 > 0) ? "incomplete" : "valid");
1441
+ const progressPercent: int32 = ((totalFields === 0) ? 100 : ~~((validFields * 100) / totalFields)) | 0;
1442
+ return {
1443
+ dataIssues: dataIssues_1,
1444
+ estimatedTimeToComplete: (dataIssues_1 === 0) ? "Complete" : ((dataIssues_1 <= 2) ? "1-2 minutes" : "3-5 minutes"),
1445
+ fields: fieldTelemetry,
1446
+ formValid: (dataIssues_1 === 0) && (structuralIssues === 0),
1447
+ nextCriticalAction: defaultArg_1(map<{ actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }, string>((f_4: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }): string => f_4.actionHint, tryFind_2<{ actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }>((f_3: { actionHint: string, actualChoices: string[], actualValue: string, dataIssues: string[], dataValid: boolean, expectedChoices: string[], expectedValue: string, fieldKey: string, fieldLabel: string, fieldType: string, severity: string, structureIssues: any[], structureValid: boolean }): boolean => !f_3.dataValid, fieldTelemetry)), ""),
1448
+ overallStatus: overallStatus,
1449
+ progressPercent: progressPercent,
1450
+ structuralIssues: structuralIssues,
1451
+ totalFields: totalFields,
1452
+ validFields: validFields,
1453
+ };
1454
+ }
1455
+
1275
1456
  //# sourceMappingURL=FormSpec.Api.Helpers.ts.map
@@ -7,9 +7,9 @@ import { Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection, Spec_FormClass
7
7
  import { tryParse } from "@fable-org/fable-library-js/Guid.js";
8
8
  import { ofArray, reverse, empty, FSharpList, cons, map, toArray } from "@fable-org/fable-library-js/List.js";
9
9
  import { sumBy, tryFind, collect, map as map_1, fold } from "@fable-org/fable-library-js/Array.js";
10
- import { Auto_generateBoxedEncoder_437914C6, toString } from "../../fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
10
+ import { Auto_generateBoxedEncoder_437914C6, toString } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
11
11
  import { FSharpResult$2_$union, Result_ToOption } from "@fable-org/fable-library-js/Result.js";
12
- import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
12
+ import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
13
13
  import { printf, toConsole } from "@fable-org/fable-library-js/String.js";
14
14
 
15
15
  export class Types_FieldKeyTS extends Record implements IEquatable<Types_FieldKeyTS>, IComparable<Types_FieldKeyTS> {
@@ -13,9 +13,9 @@ import { ofArray, empty as empty_1, add as add_1, FSharpSet, toList as toList_1
13
13
  import { resultStepsMapToFormSpec, formSpecToResultStepsMap, formSpecToMetadata, FormSpecMetadata, FieldDetails$1 } from "../FormSpecValues.js";
14
14
  import { tryParse as tryParse_1, minValue, toString } from "@fable-org/fable-library-js/Date.js";
15
15
  import { buildFormSpecFromResultStepsMap } from "../FormSpecHelpers.js";
16
- import { Auto_generateBoxedEncoder_437914C6, toString as toString_1 } from "../../fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
16
+ import { Auto_generateBoxedEncoder_437914C6, toString as toString_1 } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
17
17
  import { FSharpResult$2_$union, Result_ToOption } from "@fable-org/fable-library-js/Result.js";
18
- import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
18
+ import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
19
19
 
20
20
  export class ValuesTypes_FieldAnswerTS extends Record implements IEquatable<ValuesTypes_FieldAnswerTS>, IComparable<ValuesTypes_FieldAnswerTS> {
21
21
  readonly FieldKey: Types_FieldKeyTS;
@@ -1,7 +1,7 @@
1
1
  import { Union } from "@fable-org/fable-library-js/Types.js";
2
2
  import { string_type, union_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
3
3
  import { Spec_FieldType_$union, Spec_FieldType_$reflection, Spec_FormSpec$1_$reflection, Spec_FormSpec$1 } from "./FormSpec.js";
4
- import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
4
+ import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../Thoth.Json/packages/Thoth.Json/Decode.js";
5
5
  import { uncurry2 } from "@fable-org/fable-library-js/Util.js";
6
6
  import { FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
7
7
 
@@ -10,7 +10,7 @@ import { tryFind as tryFind_1, FSharpMap, ofList, toList as toList_1 } from "@fa
10
10
  import { updateField, getFieldDetails, FieldDetails$1, fieldToDetails } from "./FormSpecValues.js";
11
11
  import { Helpers_generateDeterministicGuidRaw, Helpers_canonicalizeFieldKey } from "./Helpers.js";
12
12
  import { printf, toText, isNullOrEmpty, isNullOrWhiteSpace, join } from "@fable-org/fable-library-js/String.js";
13
- import { Auto_generateBoxedEncoder_437914C6, toString } from "../fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
13
+ import { Auto_generateBoxedEncoder_437914C6, toString } from "../Thoth.Json/packages/Thoth.Json/Encode.js";
14
14
  import { tryParse } from "@fable-org/fable-library-js/Double.js";
15
15
  import { create, isMatch } from "@fable-org/fable-library-js/RegExp.js";
16
16
  import { map as map_3 } from "@fable-org/fable-library-js/Array.js";