@f1studio/form-spec 5.0.0-alpha.117 → 5.0.0-alpha.123

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 (95) hide show
  1. package/FormSpec.FS/FormSpec.d.ts +41 -1
  2. package/FormSpec.FS/FormSpec.d.ts.map +1 -1
  3. package/FormSpec.FS/FormSpecHelpers.d.ts.map +1 -1
  4. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts +6 -1
  5. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts.map +1 -1
  6. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts +5 -0
  7. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts.map +1 -1
  8. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts +72 -0
  9. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts.map +1 -0
  10. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts.map +1 -1
  11. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
  12. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +15 -9
  13. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
  14. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +0 -7
  15. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  16. package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
  17. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +1 -1
  18. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -1
  19. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -1
  20. package/FormSpec.TS/FormSpec.FS/Designer.js +1 -1
  21. package/FormSpec.TS/FormSpec.FS/Designer.js.map +1 -1
  22. package/FormSpec.TS/FormSpec.FS/Designer.ts.map +1 -1
  23. package/FormSpec.TS/FormSpec.FS/FormSpec.js +129 -1
  24. package/FormSpec.TS/FormSpec.FS/FormSpec.js.map +1 -1
  25. package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +1 -1
  26. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +1 -1
  27. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
  28. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
  29. package/FormSpec.TS/FormSpec.FS/FormSpecValues.js +2 -2
  30. package/FormSpec.TS/FormSpec.FS/FormSpecValues.js.map +1 -1
  31. package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +1 -1
  32. package/FormSpec.TS/FormSpec.FS/Helpers.js +11 -11
  33. package/FormSpec.TS/FormSpec.FS/Helpers.js.map +1 -1
  34. package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +1 -1
  35. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js +4 -4
  36. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js.map +1 -1
  37. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts.map +1 -1
  38. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +9 -2
  39. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -1
  40. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +1 -1
  41. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js +360 -0
  42. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js.map +1 -0
  43. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts.map +1 -0
  44. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +1 -1
  45. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
  46. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -1
  47. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +119 -46
  48. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
  49. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
  50. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +40 -24
  51. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
  52. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -1
  53. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +41 -106
  54. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  55. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
  56. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +1 -1
  57. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
  58. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
  59. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
  60. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
  61. package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
  62. package/FormSpec.TS/plugins/bmi/src/BMIField.js +193 -275
  63. package/FormSpec.TS/plugins/bmi/src/BMIField.js.map +1 -1
  64. package/FormSpec.TS/plugins/bmi/src/BMIField.ts.map +1 -1
  65. package/FormSpec.TS/plugins/likert/src/LikertField.js +19 -138
  66. package/FormSpec.TS/plugins/likert/src/LikertField.js.map +1 -1
  67. package/FormSpec.TS/plugins/likert/src/LikertField.ts.map +1 -1
  68. package/README.md +19 -13
  69. package/package.json +1 -1
  70. package/plugins/bmi/src/BMIField.d.ts.map +1 -1
  71. package/plugins/likert/src/LikertField.d.ts.map +1 -1
  72. package/src/FormSpec.FS/BlueprintValidation.ts +1 -1
  73. package/src/FormSpec.FS/Designer.ts +1 -1
  74. package/src/FormSpec.FS/FormSpec.ts +92 -2
  75. package/src/FormSpec.FS/FormSpecHelpers.ts +2 -2
  76. package/src/FormSpec.FS/FormSpecValues.ts +2 -2
  77. package/src/FormSpec.FS/Helpers.ts +11 -11
  78. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts +8 -4
  79. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +11 -2
  80. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts +222 -0
  81. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +2 -2
  82. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +123 -51
  83. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +44 -25
  84. package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +57 -102
  85. package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +2 -2
  86. package/src/plugins/bmi/src/BMIField.ts +62 -82
  87. package/src/plugins/likert/src/LikertField.ts +20 -95
  88. package/FormSpec.FS/Interop/PluginPropertyKeyRegistry.d.ts +0 -16
  89. package/FormSpec.FS/Interop/PluginPropertyKeyRegistry.d.ts.map +0 -1
  90. package/FormSpec.TS/FormSpec.FS/Interop/PluginPropertyKeyRegistry.js +0 -121
  91. package/FormSpec.TS/FormSpec.FS/Interop/PluginPropertyKeyRegistry.js.map +0 -1
  92. package/FormSpec.TS/FormSpec.FS/Interop/PluginPropertyKeyRegistry.ts.map +0 -1
  93. package/fable_modules/Feliz.2.8.0/Colors.fs.d.ts +0 -9
  94. package/fable_modules/Feliz.2.8.0/Colors.fs.d.ts.map +0 -1
  95. package/src/FormSpec.FS/Interop/PluginPropertyKeyRegistry.ts +0 -96
@@ -1,24 +1,23 @@
1
- import { map as map_1, value as value_11, unwrap, defaultArgWith as defaultArgWith_1, Option, defaultArg as defaultArg_1 } from "@fable-org/fable-library-js/Option.js";
2
- import { tryPick, filter, mapIndexed as mapIndexed_1, isEmpty, map as map_3, ofSeq, fold, partition, ofArray, append, singleton, empty, collect, tryFind, FSharpList } from "@fable-org/fable-library-js/List.js";
3
- import { join, substring, isNullOrEmpty, printf, toConsole } from "@fable-org/fable-library-js/String.js";
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 { 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
4
  import { Auto_generateBoxedEncoder_437914C6, toString } from "../../fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
5
5
  import { array_type, string_type, union_type, TypeInfo, obj_type } from "@fable-org/fable-library-js/Reflection.js";
6
6
  import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
7
- import { equals, stringHash, compare, createObj, IDisposable, disposeSafe, IEnumerator, getEnumerator, IMap, isArrayLike, uncurry2 } from "@fable-org/fable-library-js/Util.js";
8
- import { ClinicalPathway_StateType_$union, ClinicalPathway_TaskPriority_$union, ClinicalPathway_AlertSeverity_$union, ClinicalPathway_ReferralUrgency_$union, ClinicalPathway_ActionInfo_$union, ClinicalPathway_NavigateToFormAction, ClinicalPathway_ProblemAction, ClinicalPathway_AlertAction, ClinicalPathway_EducationAction, ClinicalPathway_ProcedureAction, ClinicalPathway_TestAction, ClinicalPathway_DocumentationAction, ClinicalPathway_FieldValueSource_$union, ClinicalPathway_SetFieldValueAction, ClinicalPathway_PrescriptionAction, ClinicalPathway_MedicationAction, ClinicalPathway_ReferralAction, Shared_FieldValue, Shared_FieldValue_$union, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_PathRequirement, ClinicalPathway_ConstraintDefinition, ClinicalPathway_PathwayExecutionMode_SinglePathway, ClinicalPathway_SinglePathwayConfig, ClinicalPathway_SelectionStrategy_HighestPriority, ClinicalPathway_TransitionDefinition, ClinicalPathway_TransitionCondition_FieldCondition, Shared_ConditionValue_Single, ClinicalPathway_FieldEvaluator_Equals, Shared_TransitionKey, ClinicalPathway_StateType_Terminal, ClinicalPathway_TerminalInfo, ClinicalPathway_StateDefinition, ClinicalPathway_StateType_Action, ClinicalPathway_ActionInfo_Task, ClinicalPathway_TaskAction, ClinicalPathway_DueDate_Today, ClinicalPathway_TaskPriority_Medium, ClinicalPathway_TaskPriority_Low, ClinicalPathway_TaskPriority_High, Shared_StateKey, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Matrix, Spec_MatrixInfo, Spec_FormLifecycle_Blueprint, Spec_FieldType_Text, Spec_TextInfo, Spec_FieldType_CheckboxList, Spec_MultiChoiceInfo, Shared_FieldOptionKey, Spec_FieldType_Checkbox, Spec_BooleanInfo, Shared_FieldKey, Shared_FieldOption, Shared_FieldValue_Single, Shared_FieldValue_PluginData, Shared_PluginDataProperty, Shared_PluginPropertyKey, Shared_FieldValue_Matrix, Shared_MatrixAnswer, Shared_MatrixItemKey, Shared_FieldValue_Multiple, Shared_FieldAnswer, Spec_FormStep$1, Spec_FormField$1, Spec_FieldType_$union, Spec_FormSpec$1, Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection } from "../FormSpec.js";
7
+ import { equals, createObj, stringHash, compare, IDisposable, disposeSafe, IEnumerator, getEnumerator, IMap, isArrayLike, uncurry2 } from "@fable-org/fable-library-js/Util.js";
8
+ import { ClinicalPathway_StateType_$union, ClinicalPathway_TaskPriority_$union, ClinicalPathway_AlertSeverity_$union, ClinicalPathway_ReferralUrgency_$union, ClinicalPathway_ActionInfo_$union, ClinicalPathway_NavigateToFormAction, ClinicalPathway_ProblemAction, ClinicalPathway_AlertAction, ClinicalPathway_EducationAction, ClinicalPathway_ProcedureAction, ClinicalPathway_TestAction, ClinicalPathway_DocumentationAction, ClinicalPathway_FieldValueSource_$union, ClinicalPathway_SetFieldValueAction, ClinicalPathway_PrescriptionAction, ClinicalPathway_MedicationAction, ClinicalPathway_ReferralAction, Shared_FieldValue, Shared_FieldValue_$union, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_PathRequirement, ClinicalPathway_ConstraintDefinition, ClinicalPathway_PathwayExecutionMode_SinglePathway, ClinicalPathway_SinglePathwayConfig, ClinicalPathway_SelectionStrategy_HighestPriority, ClinicalPathway_TransitionDefinition, ClinicalPathway_TransitionCondition_FieldCondition, Shared_ConditionValue_Single, ClinicalPathway_FieldEvaluator_Equals, Shared_TransitionKey, ClinicalPathway_StateType_Terminal, ClinicalPathway_TerminalInfo, ClinicalPathway_StateDefinition, ClinicalPathway_StateType_Action, ClinicalPathway_ActionInfo_Task, ClinicalPathway_TaskAction, ClinicalPathway_DueDate_Today, ClinicalPathway_TaskPriority_Medium, ClinicalPathway_TaskPriority_Low, ClinicalPathway_TaskPriority_High, Shared_StateKey, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Matrix, Spec_MatrixInfo, Spec_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";
9
9
  import { FSharpResult$2_Ok, FSharpResult$2_Error, FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
10
10
  import { newGuid, parse, tryParse } from "@fable-org/fable-library-js/Guid.js";
11
- import { toString as toString_1, Union, FSharpRef } from "@fable-org/fable-library-js/Types.js";
11
+ import { Union, FSharpRef } from "@fable-org/fable-library-js/Types.js";
12
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
13
  import { ErrorReason_$union } from "../../fable_modules/Thoth.Json.10.4.1/Types.fs.js";
14
14
  import { 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
- import { extractPropertyKeyFromUnknown, resolvePropertyKey } from "./PluginPropertyKeyRegistry.js";
18
- import { empty as empty_1, append as append_1, mapIndexed, map as map_2, choose, singleton as singleton_1, collect as collect_1, delay, toList as toList_1 } from "@fable-org/fable-library-js/Seq.js";
19
- import { map } from "@fable-org/fable-library-js/Array.js";
20
- import { getFieldDetails as getFieldDetails_1, FieldDetails$1, updateField, findStepIndexForField, updateFieldDocumentation } from "../FormSpecValues.js";
21
- import { toArray, ofArray as ofArray_1 } from "@fable-org/fable-library-js/Set.js";
17
+ import { getFieldDetails as getFieldDetails_1, FieldDetails$1, findStepIndexForField, updateField } from "../FormSpecValues.js";
18
+ import { singleton as singleton_1, empty as empty_1, collect as collect_1, delay, toList as toList_1, mapIndexed, map as map_2, choose } from "@fable-org/fable-library-js/Seq.js";
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";
22
21
  import { now } from "@fable-org/fable-library-js/DateOffset.js";
23
22
  import { initializeExecution } from "../PathwayExecutor.js";
24
23
  import { List_distinct, distinct } from "@fable-org/fable-library-js/Seq2.js";
@@ -371,86 +370,36 @@ export function createFormFieldData(fieldKey: string, objectValue: any): { field
371
370
  };
372
371
  }
373
372
 
374
- function normalizePluginDataItem(item: any): any {
375
- const name: string = toString_1((item["Name"] != null && item["Name"] !== undefined ? item["Name"] : (item["name"] != null && item["name"] !== undefined ? item["name"] : null)));
376
- const value_2: string = toString_1((item["Value"] != null && item["Value"] !== undefined ? item["Value"] : (item["value"] != null && item["value"] !== undefined ? item["value"] : null)));
377
- const dataType: string = toString_1((item["DataType"] != null && item["DataType"] !== undefined ? item["DataType"] : (item["dataType"] != null && item["dataType"] !== undefined ? item["dataType"] : null)));
378
- const displayName: any = (item["DisplayName"] != null && item["DisplayName"] !== undefined ? item["DisplayName"] : (item["displayName"] != null && item["displayName"] !== undefined ? item["displayName"] : null));
379
- const unitVal: any = (item["Unit"] != null && item["Unit"] !== undefined ? item["Unit"] : (item["unit"] != null && item["unit"] !== undefined ? item["unit"] : null));
380
- const description: any = (item["Description"] != null && item["Description"] !== undefined ? item["Description"] : (item["description"] != null && item["description"] !== undefined ? item["description"] : null));
381
- const pk: any = (item["PropertyKey"] != null && item["PropertyKey"] !== undefined ? item["PropertyKey"] : (item["propertyKey"] != null && item["propertyKey"] !== undefined ? item["propertyKey"] : null));
382
- const withOpt = (k: string, v: any): FSharpList<[string, any]> => {
383
- if (v == null) {
384
- return empty<[string, any]>();
385
- }
386
- else {
387
- return singleton([k, v] as [string, any]);
388
- }
389
- };
390
- return createObj(append(ofArray([["propertyKey", resolvePropertyKey(name, (pk == null) ? undefined : extractPropertyKeyFromUnknown(pk))] as [string, any], ["name", name] as [string, any], ["dataType", isNullOrEmpty(dataType) ? "string" : dataType] as [string, any], ["value", value_2] as [string, any]]), append(withOpt("displayName", displayName), append(withOpt("unit", unitVal), withOpt("description", description)))));
391
- }
392
-
393
- /**
394
- * Normalize filledFormData for platform API (fill_form, buildFormSpecWithValues).
395
- * Converts PluginData arrays from PascalCase to camelCase, resolves propertyKey.
396
- * Passes through non-PluginData values (e.g. fieldKey_doc) unchanged.
397
- * TypeScript: import { normalizeFormValuesForPlatformApi } from '@f1studio/form-spec/Interop/FormSpec.Api.Helpers'
398
- */
399
- export function normalizeFormValuesForPlatformApi(formValues: any): any {
400
- if (formValues == null) {
401
- throw new Error("normalizeFormValuesForPlatformApi: formValues is null");
402
- }
403
- const entries: [string, any][] = Object.entries(formValues);
404
- return createObj(toList_1<[string, any]>(delay<[string, any]>((): Iterable<[string, any]> => collect_1<[string, any], Iterable<[string, any]>, [string, any]>((matchValue: [string, any]): Iterable<[string, any]> => {
405
- const value: any = matchValue[1];
406
- return singleton_1<[string, any]>([matchValue[0], (Array.isArray(value) && value.length > 0 && typeof value[0] === 'object' && value[0] !== null && ('Name' in value[0] || 'name' in value[0])) ? map<any, any>(normalizePluginDataItem, value as any[]) : value] as [string, any]);
407
- }, entries))));
408
- }
409
-
410
373
  /**
411
374
  * Build FormSpec with field values applied. Primary API - pathway uses FormSpec directly.
412
375
  * TypeScript: buildFormSpecWithValues(formSpec: FormSpec, fieldData: FieldInput[]) => FormSpec
413
376
  */
414
377
  export function buildFormSpecWithValues(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, fieldData: { fieldKey: string, objectValue: any }[]): Spec_FormSpec$1<Spec_FieldType_$union> {
415
- const patternInput: [FSharpList<{ fieldKey: string, objectValue: any }>, FSharpList<{ fieldKey: string, objectValue: any }>] = partition<{ fieldKey: string, objectValue: any }>((input: { fieldKey: string, objectValue: any }): boolean => !input.fieldKey.endsWith("_doc"), toList_1<{ fieldKey: string, objectValue: any }>(fieldData));
416
- return fold<{ fieldKey: string, objectValue: any }, Spec_FormSpec$1<Spec_FieldType_$union>>((spec_1: Spec_FormSpec$1<Spec_FieldType_$union>, input_2: { fieldKey: string, objectValue: any }): Spec_FormSpec$1<Spec_FieldType_$union> => {
417
- const baseKey: string = substring(input_2.fieldKey, 0, input_2.fieldKey.length - 4);
418
- const matchValue_3: Option<Spec_FormField$1<Spec_FieldType_$union>> = findFieldByKey(spec_1, baseKey);
419
- if (matchValue_3 == null) {
420
- toConsole(`Warning: Documentation field ${input_2.fieldKey} - base field ${baseKey} not found in FormSpec`);
421
- return spec_1;
422
- }
423
- else {
424
- const field_2: Spec_FormField$1<Spec_FieldType_$union> = value_11(matchValue_3);
425
- const docStr: string = decodeAsString(input_2.fieldKey, input_2.objectValue);
426
- const docOpt: Option<string> = isNullOrEmpty(docStr) ? undefined : docStr;
427
- return defaultArg_1(map_1<int32, Spec_FormSpec$1<Spec_FieldType_$union>>((stepIdx_1: int32): Spec_FormSpec$1<Spec_FieldType_$union> => updateFieldDocumentation<Spec_FieldType_$union>(spec_1, field_2.FieldKey, docOpt, stepIdx_1), findStepIndexForField<Spec_FieldType_$union>(spec_1, field_2.FieldKey)), spec_1);
428
- }
429
- }, fold<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>], Spec_FormSpec$1<Spec_FieldType_$union>>((spec: Spec_FormSpec$1<Spec_FieldType_$union>, tupledArg: [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]): Spec_FormSpec$1<Spec_FieldType_$union> => {
378
+ return fold<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>], Spec_FormSpec$1<Spec_FieldType_$union>>((spec: Spec_FormSpec$1<Spec_FieldType_$union>, tupledArg: [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]): Spec_FormSpec$1<Spec_FieldType_$union> => {
430
379
  const field_1: Spec_FormField$1<Spec_FieldType_$union> = tupledArg[0];
431
- return defaultArg_1(map_1<int32, Spec_FormSpec$1<Spec_FieldType_$union>>((stepIdx: int32): Spec_FormSpec$1<Spec_FieldType_$union> => updateField<Spec_FieldType_$union>(spec, field_1.FieldKey, tupledArg[1].FieldValue, stepIdx), findStepIndexForField<Spec_FieldType_$union>(spec, field_1.FieldKey)), spec);
432
- }, formSpec, ofSeq<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]>(choose<{ fieldKey: string, objectValue: any }, [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]>((input_1: { fieldKey: string, objectValue: any }): Option<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]> => {
380
+ return defaultArg_1(map<int32, Spec_FormSpec$1<Spec_FieldType_$union>>((stepIdx: int32): Spec_FormSpec$1<Spec_FieldType_$union> => updateField<Spec_FieldType_$union>(spec, field_1.FieldKey, tupledArg[1].FieldValue, stepIdx), findStepIndexForField<Spec_FieldType_$union>(spec, field_1.FieldKey)), spec);
381
+ }, formSpec, ofSeq<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]>(choose<{ fieldKey: string, objectValue: any }, [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]>((input: { fieldKey: string, objectValue: any }): Option<[Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>]> => {
433
382
  let matchValue_1: ExpectedFieldValueType_$union, matrixData: { description: string, values: IMap<string, string> }, matrixValues: FSharpMap<Shared_MatrixItemKey, string>, matrixAnswer: Shared_MatrixAnswer, arg_1: int32, matchValue_2: Spec_FieldType_$union;
434
- const matchValue: Option<Spec_FormField$1<Spec_FieldType_$union>> = findFieldByKey(formSpec, input_1.fieldKey);
383
+ const matchValue: Option<Spec_FormField$1<Spec_FieldType_$union>> = findFieldByKey(formSpec, input.fieldKey);
435
384
  if (matchValue == null) {
436
- toConsole(`Warning: Field ${input_1.fieldKey} not found in FormSpec`);
385
+ toConsole(`Warning: Field ${input.fieldKey} not found in FormSpec`);
437
386
  return undefined;
438
387
  }
439
388
  else {
440
389
  const field: Spec_FormField$1<Spec_FieldType_$union> = value_11(matchValue);
441
390
  try {
442
- 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_1<Shared_FieldAnswer>(map<string, Shared_FieldAnswer>((value: string): Shared_FieldAnswer => (new Shared_FieldAnswer(field.FieldKey, field.Label, value)), decodeAsStringArray(input_1.fieldKey, input_1.objectValue)), {
391
+ return [field, new FieldDetails$1(field.FieldOrder, field.FieldKey, field.Label, (matchValue_1 = getExpectedFieldValueType(field.FieldType), (matchValue_1.tag === /* MultipleValues */ 1) ? Shared_FieldValue_Multiple(ofArray<Shared_FieldAnswer>(map_1<string, Shared_FieldAnswer>((value: string): Shared_FieldAnswer => (new Shared_FieldAnswer(field.FieldKey, field.Label, value)), decodeAsStringArray(input.fieldKey, input.objectValue)), {
443
392
  Compare: compare,
444
- })) : ((matchValue_1.tag === /* MatrixValue */ 2) ? ((matrixData = decodeAsMatrixValue(input_1.fieldKey, input_1.objectValue), (matrixValues = ofSeq_1<Shared_MatrixItemKey, string>(map_2<[string, string], [Shared_MatrixItemKey, string]>((kvp: [string, string]): [Shared_MatrixItemKey, string] => ([new Shared_MatrixItemKey(parse(kvp[0])), kvp[1]] as [Shared_MatrixItemKey, string]), matrixData.values), {
393
+ })) : ((matchValue_1.tag === /* MatrixValue */ 2) ? ((matrixData = decodeAsMatrixValue(input.fieldKey, input.objectValue), (matrixValues = ofSeq_1<Shared_MatrixItemKey, string>(map_2<[string, string], [Shared_MatrixItemKey, string]>((kvp: [string, string]): [Shared_MatrixItemKey, string] => ([new Shared_MatrixItemKey(parse(kvp[0])), kvp[1]] as [Shared_MatrixItemKey, string]), matrixData.values), {
445
394
  Compare: compare,
446
- }), (matrixAnswer = (new Shared_MatrixAnswer(field.FieldKey, matrixData.description, matrixValues)), ((arg_1 = (count<Shared_MatrixItemKey, string>(matrixValues) | 0), toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] buildFormSpecWithValues Matrix fieldKey=%s valuesCount=%d"))(input_1.fieldKey)(arg_1)), Shared_FieldValue_Matrix(matrixAnswer)))))) : ((matchValue_1.tag === /* PluginDataValue */ 3) ? Shared_FieldValue_PluginData(ofArray<Shared_PluginDataProperty>(map<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }, Shared_PluginDataProperty>((prop: { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }): Shared_PluginDataProperty => (new Shared_PluginDataProperty(new Shared_PluginPropertyKey(parse(prop.propertyKey)), prop.name, prop.dataType, prop.value, prop.displayName, prop.unit, prop.description)), decodeAsPluginDataArray(input_1.fieldKey, input_1.objectValue)))) : Shared_FieldValue_Single(new Shared_FieldAnswer(field.FieldKey, field.Label, decodeAsString(input_1.fieldKey, input_1.objectValue)))))), field.FieldType, (matchValue_2 = field.FieldType, (matchValue_2.tag === /* Radio */ 12) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* SingleChoice */ 13) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Dropdown */ 14) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* MultiChoice */ 15) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* CheckboxList */ 16) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TagList */ 17) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TextAutoComplete */ 18) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Matrix */ 19) ? matchValue_2.fields[0].Options : empty<Shared_FieldOption>())))))))))] as [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>];
395
+ }), (matrixAnswer = (new Shared_MatrixAnswer(field.FieldKey, matrixData.description, matrixValues)), ((arg_1 = (count<Shared_MatrixItemKey, string>(matrixValues) | 0), toConsole(printf("[DEBUGGING_FORMSPEC_RENDERER] buildFormSpecWithValues Matrix fieldKey=%s valuesCount=%d"))(input.fieldKey)(arg_1)), Shared_FieldValue_Matrix(matrixAnswer)))))) : ((matchValue_1.tag === /* PluginDataValue */ 3) ? Shared_FieldValue_PluginData(ofArray_1<Shared_PluginDataProperty>(map_1<{ dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }, Shared_PluginDataProperty>((prop: { dataType: string, description?: string, displayName?: string, name: string, propertyKey: string, unit?: string, value: string }): Shared_PluginDataProperty => (new Shared_PluginDataProperty(new Shared_PluginPropertyKey(parse(prop.propertyKey)), prop.name, prop.dataType, prop.value, prop.displayName, prop.unit, prop.description)), decodeAsPluginDataArray(input.fieldKey, input.objectValue)))) : Shared_FieldValue_Single(new Shared_FieldAnswer(field.FieldKey, field.Label, decodeAsString(input.fieldKey, input.objectValue)))))), field.FieldType, (matchValue_2 = field.FieldType, (matchValue_2.tag === /* Radio */ 12) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* SingleChoice */ 13) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Dropdown */ 14) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* MultiChoice */ 15) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* CheckboxList */ 16) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TagList */ 17) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* TextAutoComplete */ 18) ? matchValue_2.fields[0].Options : ((matchValue_2.tag === /* Matrix */ 19) ? matchValue_2.fields[0].Options : empty<Shared_FieldOption>())))))))))] as [Spec_FormField$1<Spec_FieldType_$union>, FieldDetails$1<Spec_FieldType_$union>];
447
396
  }
448
397
  catch (ex: any) {
449
- toConsole(`Error processing field ${input_1.fieldKey}: ${ex.message}`);
398
+ toConsole(`Error processing field ${input.fieldKey}: ${ex.message}`);
450
399
  return undefined;
451
400
  }
452
401
  }
453
- }, patternInput[0]))), patternInput[1]);
402
+ }, fieldData)));
454
403
  }
455
404
 
456
405
  /**
@@ -491,7 +440,7 @@ export function createFormStep(stepOrder: int32, stepLabel: string, fields: Spec
491
440
  * TypeScript: createFormSpec(id: string, title: string, steps: FormStep[])
492
441
  */
493
442
  export function createFormSpec(idString: string, title: string, steps: Spec_FormStep$1<Spec_FieldType_$union>[]): Spec_FormSpec$1<Spec_FieldType_$union> {
494
- return new Spec_FormSpec$1(parse(idString), "DYN", title, "Dynamically created FormSpec", "1.0.0", "2.0.5", ofSeq<Spec_FormStep$1<Spec_FieldType_$union>>(steps), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined);
443
+ return new Spec_FormSpec$1(parse(idString), "DYN", title, "Dynamically created FormSpec", "1.0.0", "2.0.5", ofSeq<Spec_FormStep$1<Spec_FieldType_$union>>(steps), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined, Spec_FormClassification_General());
495
444
  }
496
445
 
497
446
  /**
@@ -557,7 +506,7 @@ export function createClinicalPathway(name: string, states: ClinicalPathway_Stat
557
506
  * TypeScript: addPathwayToFormSpec(formSpec: FormSpec, pathway: ClinicalPathwaySpec)
558
507
  */
559
508
  export function addPathwayToFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, pathway: ClinicalPathway_ClinicalPathwaySpec): Spec_FormSpec$1<Spec_FieldType_$union> {
560
- return new Spec_FormSpec$1(formSpec.Id, formSpec.Code, formSpec.Title, formSpec.Abstract, formSpec.Version, formSpec.FormSpecVersion, formSpec.Steps, formSpec.CategoryTags, formSpec.Score, formSpec.AssociatedCodes, formSpec.RequiresReview, formSpec.RequiresReviewAndApproval, pathway, formSpec.Lifecycle, formSpec.FilledMeta, formSpec.CustomData, formSpec.Provenance);
509
+ return new Spec_FormSpec$1(formSpec.Id, formSpec.Code, formSpec.Title, formSpec.Abstract, formSpec.Version, formSpec.FormSpecVersion, formSpec.Steps, formSpec.CategoryTags, formSpec.Score, formSpec.AssociatedCodes, formSpec.RequiresReview, formSpec.RequiresReviewAndApproval, pathway, formSpec.Lifecycle, formSpec.FilledMeta, formSpec.CustomData, formSpec.Provenance, formSpec.Classification);
561
510
  }
562
511
 
563
512
  /**
@@ -565,7 +514,7 @@ export function addPathwayToFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$u
565
514
  * TypeScript: getFieldDataFromFormSpec(formSpec: FormSpec, stepOrder: number, fieldKey: string)
566
515
  */
567
516
  export function getFieldDataFromFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, _stepOrder: int32, fieldKeyString: string): Option<any> {
568
- return map_1<FieldDetails$1<Spec_FieldType_$union>, any>((fieldDetails: FieldDetails$1<Spec_FieldType_$union>): any => ({
517
+ return map<FieldDetails$1<Spec_FieldType_$union>, any>((fieldDetails: FieldDetails$1<Spec_FieldType_$union>): any => ({
569
518
  FieldOrder: fieldDetails.FieldOrder,
570
519
  FieldType: fieldDetails.FieldType,
571
520
  FieldValue: fieldDetails.FieldValue,
@@ -588,7 +537,7 @@ export function getFormResultStepOrders(formSpec: Spec_FormSpec$1<Spec_FieldType
588
537
  * TypeScript: getFormResultFieldKeys(formSpec: FormSpec, stepOrder: number)
589
538
  */
590
539
  export function getFormResultFieldKeys(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, stepOrder: int32): string[] {
591
- return defaultArgWith_1<string[]>(map_1<Spec_FormStep$1<Spec_FieldType_$union>, string[]>((step_1: Spec_FormStep$1<Spec_FieldType_$union>): string[] => {
540
+ return defaultArgWith_1<string[]>(map<Spec_FormStep$1<Spec_FieldType_$union>, string[]>((step_1: Spec_FormStep$1<Spec_FieldType_$union>): string[] => {
592
541
  const collection: FSharpList<string> = map_3<Spec_FormField$1<Spec_FieldType_$union>, string>((f: Spec_FormField$1<Spec_FieldType_$union>): string => f.FieldKey.fields[0], step_1.Fields);
593
542
  return Array.from(collection);
594
543
  }, tryFind<Spec_FormStep$1<Spec_FieldType_$union>>((step: Spec_FormStep$1<Spec_FieldType_$union>): boolean => (step.StepOrder === stepOrder), formSpec.Steps)), (): string[] => []);
@@ -607,7 +556,7 @@ export function getResultSteps(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>)
607
556
  * TypeScript: getFieldValue(formSpec: FormSpec, stepOrder: number, fieldKey: string)
608
557
  */
609
558
  export function getFieldValue(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, _stepOrder: int32, fieldKeyString: string): Option<any> {
610
- return map_1<FieldDetails$1<Spec_FieldType_$union>, any>((details: FieldDetails$1<Spec_FieldType_$union>): any => details.FieldValue, getFieldDetails_1(formSpec, new Shared_FieldKey(parse(fieldKeyString))));
559
+ return map<FieldDetails$1<Spec_FieldType_$union>, any>((details: FieldDetails$1<Spec_FieldType_$union>): any => details.FieldValue, getFieldDetails_1(formSpec, new Shared_FieldKey(parse(fieldKeyString))));
611
560
  }
612
561
 
613
562
  /**
@@ -615,7 +564,7 @@ export function getFieldValue(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>,
615
564
  * TypeScript: getFieldDetails(formSpec: FormSpec, stepOrder: number, fieldKey: string)
616
565
  */
617
566
  export function getFieldDetails(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, _stepOrder: int32, fieldKeyString: string): Option<any> {
618
- return map_1<FieldDetails$1<Spec_FieldType_$union>, any>((details: FieldDetails$1<Spec_FieldType_$union>): any => details, getFieldDetails_1(formSpec, new Shared_FieldKey(parse(fieldKeyString))));
567
+ return map<FieldDetails$1<Spec_FieldType_$union>, any>((details: FieldDetails$1<Spec_FieldType_$union>): any => details, getFieldDetails_1(formSpec, new Shared_FieldKey(parse(fieldKeyString))));
619
568
  }
620
569
 
621
570
  /**
@@ -625,8 +574,8 @@ export function getFieldDetails(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>
625
574
  export function createTestFormSpec(): Spec_FormSpec$1<Spec_FieldType_$union> {
626
575
  const option1: Shared_FieldOption = new Shared_FieldOption("Option 1", "opt1", new Shared_FieldOptionKey(newGuid()), undefined);
627
576
  const option2: Shared_FieldOption = new Shared_FieldOption("Option 2", "opt2", new Shared_FieldOptionKey(newGuid()), undefined);
628
- const testStep: Spec_FormStep$1<Spec_FieldType_$union> = new Spec_FormStep$1(1, "Test Step", ofArray([new Spec_FormField$1(1, new Shared_FieldKey("11111111-1111-1111-1111-111111111111"), "Test Text Field", undefined, undefined, false, false, false, undefined, Spec_FieldType_Text(new Spec_TextInfo(undefined)), undefined), new Spec_FormField$1(2, new Shared_FieldKey("22222222-2222-2222-2222-222222222222"), "Test Checkbox List", undefined, undefined, false, false, false, undefined, Spec_FieldType_CheckboxList(new Spec_MultiChoiceInfo(ofArray([option1, option2]))), undefined), new Spec_FormField$1(3, new Shared_FieldKey("33333333-3333-3333-3333-333333333333"), "Test Matrix", undefined, undefined, false, false, false, undefined, Spec_FieldType_Matrix(new Spec_MatrixInfo(ofArray([option1, option2]), ofArray([new Shared_FieldOption("Scale 1", "1", new Shared_FieldOptionKey(newGuid()), 1), new Shared_FieldOption("Scale 2", "2", new Shared_FieldOptionKey(newGuid()), 2)]))), undefined), new Spec_FormField$1(4, new Shared_FieldKey("44444444-4444-4444-4444-444444444444"), "Test Plugin Field", undefined, undefined, false, false, false, undefined, Spec_FieldType_PluginField(new Spec_PluginFieldConfig("test.plugin", undefined, undefined)), undefined)]));
629
- return new Spec_FormSpec$1(newGuid(), "TEST-001", "Test Form", "Test form for buildDynamicFormResultData", "1.0.0", "5.0.0", singleton(testStep), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined);
577
+ const testStep: Spec_FormStep$1<Spec_FieldType_$union> = new Spec_FormStep$1(1, "Test Step", ofArray_1([new Spec_FormField$1(1, new Shared_FieldKey("11111111-1111-1111-1111-111111111111"), "Test Text Field", undefined, undefined, false, false, false, undefined, Spec_FieldType_Text(new Spec_TextInfo(undefined)), undefined), new Spec_FormField$1(2, new Shared_FieldKey("22222222-2222-2222-2222-222222222222"), "Test Checkbox List", undefined, undefined, false, false, false, undefined, Spec_FieldType_CheckboxList(new Spec_MultiChoiceInfo(ofArray_1([option1, option2]))), undefined), new Spec_FormField$1(3, new Shared_FieldKey("33333333-3333-3333-3333-333333333333"), "Test Matrix", undefined, undefined, false, false, false, undefined, Spec_FieldType_Matrix(new Spec_MatrixInfo(ofArray_1([option1, option2]), ofArray_1([new Shared_FieldOption("Scale 1", "1", new Shared_FieldOptionKey(newGuid()), 1), new Shared_FieldOption("Scale 2", "2", new Shared_FieldOptionKey(newGuid()), 2)]))), undefined), new Spec_FormField$1(4, new Shared_FieldKey("44444444-4444-4444-4444-444444444444"), "Test Plugin Field", undefined, undefined, false, false, false, undefined, Spec_FieldType_PluginField(new Spec_PluginFieldConfig("test.plugin", undefined, undefined)), undefined)]));
578
+ return new Spec_FormSpec$1(newGuid(), "TEST-001", "Test Form", "Test form for buildDynamicFormResultData", "1.0.0", "5.0.0", singleton(testStep), empty<string>(), undefined, empty<string>(), false, false, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined, Spec_FormClassification_General());
630
579
  }
631
580
 
632
581
  /**
@@ -670,14 +619,14 @@ export function getPluginFieldConfig(field: Spec_FormField$1<Spec_FieldType_$uni
670
619
  if (matchValue.tag === /* PluginField */ 23) {
671
620
  const config: Spec_PluginFieldConfig = matchValue.fields[0];
672
621
  return {
673
- items: unwrap(map_1<FSharpList<Shared_FieldOption>, { key: string, label: string }[]>((items: FSharpList<Shared_FieldOption>): { key: string, label: string }[] => {
622
+ items: unwrap(map<FSharpList<Shared_FieldOption>, { key: string, label: string }[]>((items: FSharpList<Shared_FieldOption>): { key: string, label: string }[] => {
674
623
  const collection: FSharpList<{ key: string, label: string }> = map_3<Shared_FieldOption, { key: string, label: string }>((item: Shared_FieldOption): { key: string, label: string } => ({
675
624
  key: item.OptionKey.fields[0],
676
625
  label: item.Description,
677
626
  }), items);
678
627
  return Array.from(collection);
679
628
  }, config.Items)),
680
- options: unwrap(map_1<FSharpList<Shared_FieldOption>, { description: string, key: string, value: string }[]>((opts: FSharpList<Shared_FieldOption>): { description: string, key: string, value: string }[] => {
629
+ options: unwrap(map<FSharpList<Shared_FieldOption>, { description: string, key: string, value: string }[]>((opts: FSharpList<Shared_FieldOption>): { description: string, key: string, value: string }[] => {
681
630
  const collection_1: FSharpList<{ description: string, key: string, value: string }> = map_3<Shared_FieldOption, { description: string, key: string, value: string }>((opt: Shared_FieldOption): { description: string, key: string, value: string } => ({
682
631
  description: opt.Description,
683
632
  key: opt.OptionKey.fields[0],
@@ -908,27 +857,33 @@ export function getFieldKeyString(fieldKey: Shared_FieldKey): string {
908
857
  */
909
858
  export function extractFormValuesFromFormSpec(spec: Spec_FormSpec$1<Spec_FieldType_$union>): any {
910
859
  const pairs: FSharpList<[string, any]> = toList_1<[string, any]>(delay<[string, any]>((): Iterable<[string, any]> => collect_1<Spec_FormStep$1<Spec_FieldType_$union>, Iterable<[string, any]>, [string, any]>((step: Spec_FormStep$1<Spec_FieldType_$union>): Iterable<[string, any]> => collect_1<Spec_FormField$1<Spec_FieldType_$union>, Iterable<[string, any]>, [string, any]>((field: Spec_FormField$1<Spec_FieldType_$union>): Iterable<[string, any]> => {
911
- let matchValue: Option<Shared_FieldValue_$union>, fv: Shared_FieldValue_$union, arr: string[], ma: Shared_MatrixAnswer, dict: IMap<string, string>, enumerator: IEnumerator<[Shared_MatrixItemKey, string]>, arr_1: FSharpList<any>;
912
- const keyStr: string = getFieldKeyString(field.FieldKey);
913
- return append_1<[string, any]>((matchValue = field.Value, (matchValue == null) ? (empty_1<[string, any]>()) : ((fv = value_11(matchValue), singleton_1<[string, any]>([keyStr, (fv.tag === /* Multiple */ 1) ? ((arr = map<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), (() => {
914
- try {
915
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
916
- const kvp: [Shared_MatrixItemKey, string] = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
917
- addToDict(dict, kvp[0].fields[0], kvp[1]);
860
+ let arr: string[], ma: Shared_MatrixAnswer, dict: IMap<string, string>, enumerator: IEnumerator<[Shared_MatrixItemKey, string]>, arr_1: FSharpList<any>;
861
+ const matchValue: Option<Shared_FieldValue_$union> = field.Value;
862
+ if (matchValue == null) {
863
+ return empty_1<[string, any]>();
864
+ }
865
+ else {
866
+ const fv: Shared_FieldValue_$union = value_11(matchValue);
867
+ 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), (() => {
868
+ try {
869
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
870
+ const kvp: [Shared_MatrixItemKey, string] = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
871
+ addToDict(dict, kvp[0].fields[0], kvp[1]);
872
+ }
918
873
  }
919
- }
920
- finally {
921
- disposeSafe(enumerator as IDisposable);
922
- }
923
- })()), dict)))) : ((fv.tag === /* PluginData */ 3) ? ((arr_1 = map_3<Shared_PluginDataProperty, any>((p: Shared_PluginDataProperty): any => ({
924
- dataType: p.DataType,
925
- description: unwrap(p.Description),
926
- displayName: unwrap(p.DisplayName),
927
- name: p.Name,
928
- propertyKey: p.PropertyKey.fields[0],
929
- unit: unwrap(p.Unit),
930
- value: p.Value,
931
- }), fv.fields[0]), Array.from(arr_1))) : fv.fields[0].Value))] as [string, any])))), delay<[string, any]>((): Iterable<[string, any]> => (field.NeedsDocumentation ? singleton_1<[string, any]>([keyStr + "_doc", defaultArg_1(field.Documentation, "")] as [string, any]) : empty_1<[string, any]>())));
874
+ finally {
875
+ disposeSafe(enumerator as IDisposable);
876
+ }
877
+ })()), dict)))) : ((fv.tag === /* PluginData */ 3) ? ((arr_1 = map_3<Shared_PluginDataProperty, any>((p: Shared_PluginDataProperty): any => ({
878
+ dataType: p.DataType,
879
+ description: unwrap(p.Description),
880
+ displayName: unwrap(p.DisplayName),
881
+ name: p.Name,
882
+ propertyKey: p.PropertyKey.fields[0],
883
+ unit: unwrap(p.Unit),
884
+ value: p.Value,
885
+ }), fv.fields[0]), Array.from(arr_1))) : fv.fields[0].Value))] as [string, any]);
886
+ }
932
887
  }, step.Fields), spec.Steps)));
933
888
  if (isEmpty(pairs)) {
934
889
  return {};
@@ -1040,7 +995,7 @@ export function convertActionInfo(action: ClinicalPathway_ActionInfo_$union): an
1040
995
  case /* Problem */ 8: {
1041
996
  const prob: ClinicalPathway_ProblemAction = action.fields[0];
1042
997
  return {
1043
- description: `${prob.ProblemName}${defaultArg_1(map_1<string, string>((code: string): string => (` (ICD: ${code})`), prob.IcdCode), "")}`,
998
+ description: `${prob.ProblemName}${defaultArg_1(map<string, string>((code: string): string => (` (ICD: ${code})`), prob.IcdCode), "")}`,
1044
999
  icdCode: unwrap(prob.IcdCode),
1045
1000
  problemName: prob.ProblemName,
1046
1001
  type: "problem",
@@ -3,7 +3,7 @@ import { uncurry2, IComparable, IEquatable } from "@fable-org/fable-library-js/U
3
3
  import { obj_type, enum_type, int32_type, array_type, bool_type, option_type, record_type, string_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
4
4
  import { map as map_2, value as value_2, Option } from "@fable-org/fable-library-js/Option.js";
5
5
  import { int32 } from "@fable-org/fable-library-js/Int32.js";
6
- import { Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection, Spec_FormLifecycle_Blueprint, Spec_FormSpec$1, Spec_FilledMeta, Spec_FormLifecycle_$union, ClinicalPathway_ClinicalPathwaySpec, Spec_Score, Spec_ScoreRange, Spec_ScoreColor_Danger, Spec_ScoreColor_Warning, Spec_ScoreColor_Success, Spec_ScoreColor_Info, Spec_ScoreColor_Link, Spec_ScoreColor_Primary, Spec_ScoreColor_Unspecified, Spec_ScoreColor_$union, Spec_FormStep$1, Spec_FormField$1, Shared_FieldValue_$union, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Message, Spec_FieldType_Signature, Spec_SignatureInfo, Spec_FieldType_Matrix, Spec_FieldType_TextAutoComplete, Spec_FieldType_TagList, Spec_FieldType_CheckboxList, Spec_FieldType_MultiChoice, Spec_MultiChoiceInfo, Spec_FieldType_Dropdown, Spec_FieldType_SingleChoice, Spec_FieldType_Radio, Spec_SingleChoiceInfo, Spec_FieldType_Checkbox, Spec_FieldType_Time, Spec_FieldType_DateTimeLocal, Spec_FieldType_Date, Spec_FieldType_Tel, Spec_FieldType_Number, Spec_FieldType_Color, Spec_FieldType_Search, Spec_FieldType_Password, Spec_FieldType_Email, Spec_FieldType_TextArea, Spec_FieldType_Text, Spec_TextInfo, Spec_FieldType_$union, Spec_MessageInfo, Spec_MatrixInfo, Spec_BooleanInfo, Spec_MessageType_Danger, Spec_MessageType_Info, Spec_MessageType_Error, Spec_MessageType_Success, Spec_MessageType_Warning, Spec_MessageType_$union, Spec_DependsOn, Spec_Evaluator_Contains, Spec_Evaluator_IsEmpty, Spec_Evaluator_Exists, Spec_Evaluator_LessThanOrEquals, Spec_Evaluator_LessThan, Spec_Evaluator_GreaterThanOrEquals, Spec_Evaluator_GreaterThan, Spec_Evaluator_NotEquals, Spec_Evaluator_Equals, Spec_Evaluator_$union, Shared_FieldOption, Shared_FieldOptionKey, Shared_MatrixItemKey, Shared_TransitionKey, Shared_StateKey, Shared_FieldKey } from "../FormSpec.js";
6
+ import { Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection, Spec_FormClassification_General, Spec_FormLifecycle_Blueprint, Spec_FormSpec$1, Spec_FilledMeta, Spec_FormLifecycle_$union, ClinicalPathway_ClinicalPathwaySpec, Spec_Score, Spec_ScoreRange, Spec_ScoreColor_Danger, Spec_ScoreColor_Warning, Spec_ScoreColor_Success, Spec_ScoreColor_Info, Spec_ScoreColor_Link, Spec_ScoreColor_Primary, Spec_ScoreColor_Unspecified, Spec_ScoreColor_$union, Spec_FormStep$1, Spec_FormField$1, Shared_FieldValue_$union, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Message, Spec_FieldType_Signature, Spec_SignatureInfo, Spec_FieldType_Matrix, Spec_FieldType_TextAutoComplete, Spec_FieldType_TagList, Spec_FieldType_CheckboxList, Spec_FieldType_MultiChoice, Spec_MultiChoiceInfo, Spec_FieldType_Dropdown, Spec_FieldType_SingleChoice, Spec_FieldType_Radio, Spec_SingleChoiceInfo, Spec_FieldType_Checkbox, Spec_FieldType_Time, Spec_FieldType_DateTimeLocal, Spec_FieldType_Date, Spec_FieldType_Tel, Spec_FieldType_Number, Spec_FieldType_Color, Spec_FieldType_Search, Spec_FieldType_Password, Spec_FieldType_Email, Spec_FieldType_TextArea, Spec_FieldType_Text, Spec_TextInfo, Spec_FieldType_$union, Spec_MessageInfo, Spec_MatrixInfo, Spec_BooleanInfo, Spec_MessageType_Danger, Spec_MessageType_Info, Spec_MessageType_Error, Spec_MessageType_Success, Spec_MessageType_Warning, Spec_MessageType_$union, Spec_DependsOn, Spec_Evaluator_Contains, Spec_Evaluator_IsEmpty, Spec_Evaluator_Exists, Spec_Evaluator_LessThanOrEquals, Spec_Evaluator_LessThan, Spec_Evaluator_GreaterThanOrEquals, Spec_Evaluator_GreaterThan, Spec_Evaluator_NotEquals, Spec_Evaluator_Equals, Spec_Evaluator_$union, Shared_FieldOption, Shared_FieldOptionKey, Shared_MatrixItemKey, Shared_TransitionKey, Shared_StateKey, Shared_FieldKey } from "../FormSpec.js";
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";
@@ -1457,7 +1457,7 @@ export function Converters_formSpecFromTS(spec: Types_FormSpecTS): Option<Spec_F
1457
1457
  return undefined;
1458
1458
  }
1459
1459
  else {
1460
- return new Spec_FormSpec$1(matchValue[1], spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, reverse<Spec_FormStep$1<Spec_FieldType_$union>>(value_2(convertedSteps)), ofArray<string>(spec.CategoryTags), scoreResult, ofArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined);
1460
+ return new Spec_FormSpec$1(matchValue[1], spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, reverse<Spec_FormStep$1<Spec_FieldType_$union>>(value_2(convertedSteps)), ofArray<string>(spec.CategoryTags), scoreResult, ofArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined, Spec_FormClassification_General());
1461
1461
  }
1462
1462
  }
1463
1463
  else {
@@ -1,6 +1,6 @@
1
1
  import { FSharpRef, Record } from "@fable-org/fable-library-js/Types.js";
2
2
  import { int32, float64 } from "@fable-org/fable-library-js/Int32.js";
3
- import { some, bind, defaultArg, map, value as value_97, Option } from "@fable-org/fable-library-js/Option.js";
3
+ import { some, bind, defaultArg, map, value as value_90, Option } from "@fable-org/fable-library-js/Option.js";
4
4
  import { equals, createObj, IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
5
5
  import { class_type, record_type, string_type, option_type, float64_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
6
6
  import { mapValues, Field$3, IAttributes } from "../../../fable_modules/Fable.Form.3.0.0/Field.fs.js";
@@ -13,9 +13,7 @@ import React from "react";
13
13
  import { reactApi } from "../../../fable_modules/Feliz.2.8.0/Interop.fs.js";
14
14
  import { withLabelAndError } from "../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Html.View.fs.js";
15
15
  import { empty, singleton, append, delay, toList } from "@fable-org/fable-library-js/Seq.js";
16
- import { Helpers_combineClasses } from "../../../fable_modules/Feliz.Bulma.3.0.0/ElementBuilders.fs.js";
17
- import { empty as empty_1, tryFind, FSharpList, ofArray, cons, singleton as singleton_1 } from "@fable-org/fable-library-js/List.js";
18
- import { IReactProperty } from "../../../fable_modules/Feliz.2.8.0/Types.fs.js";
16
+ import { empty as empty_1, tryFind, FSharpList, ofArray } from "@fable-org/fable-library-js/List.js";
19
17
  import { ReactElement } from "../../../fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js";
20
18
  import { IStandardField$3_$reflection, IStandardField$3, IField$1, StandardRenderFieldConfig$2 } from "../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Types.fs.js";
21
19
  import { Spec_FormField$1, Spec_FieldType_$union, Shared_FieldOption, Shared_FieldValue_$union, Shared_FieldKey, Shared_FieldValue_PluginData, Shared_PluginDataProperty, Shared_PluginPropertyKey, Spec_PluginFieldConfig } from "../../../FormSpec.FS/FormSpec.js";
@@ -121,7 +119,7 @@ export function BMIField_serializeBMIData(bmiData: BMIField_BMIData): string {
121
119
  }
122
120
 
123
121
  export function BMIField_BMIFieldComponent(config: StandardRenderFieldConfig$2<string, BMIField_Attributes>): ReactElement {
124
- let elems_12: Iterable<ReactElement>;
122
+ let elems_9: Iterable<ReactElement>;
125
123
  const bmiData: BMIField_BMIData = BMIField_parseBMIData(config.Value);
126
124
  let patternInput: [string, ((arg0: string) => void)];
127
125
  const initial: string = (bmiData.Height > 0) ? bmiData.Height.toString() : "";
@@ -224,61 +222,56 @@ export function BMIField_BMIFieldComponent(config: StandardRenderFieldConfig$2<s
224
222
  default:
225
223
  currentBMI = undefined;
226
224
  }
227
- return withLabelAndError(config.Attributes.Label, config.ShowError, config.Error, createElement<any>("div", createObj(ofArray([["className", "bmi-calculator"] as [string, any], (elems_12 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => {
228
- let children_5: Iterable<ReactElement>, children_4: Iterable<ReactElement>, elems_2: Iterable<ReactElement>, children_1: Iterable<ReactElement>, children: Iterable<ReactElement>, elems_5: Iterable<ReactElement>, children_3: Iterable<ReactElement>, children_2: Iterable<ReactElement>;
229
- return append<ReactElement>(singleton<ReactElement>((children_5 = [(children_4 = [createElement<any>("div", createObj(Helpers_combineClasses("column", ofArray([["className", "is-half"] as [string, any], (elems_2 = [(children_1 = [createElement<any>("label", createObj(Helpers_combineClasses("label", singleton_1(["children", "Height (cm)"] as [string, any])))), (children = [createElement<any>("input", createObj(cons(["type", "number"] as [string, any], Helpers_combineClasses("input", toList<IReactProperty>(delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["value", height] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["placeholder", "Enter height in cm"] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["disabled", config.Disabled ? true : config.IsReadOnly] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["onChange", (ev: Event): void => {
230
- patternInput[1](ev.target.value);
231
- }] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => ((config.ShowError && (config.Error != null)) ? singleton<IReactProperty>(["className", "is-danger"] as [string, any]) : empty<IReactProperty>())))))))))))))))], createElement<any>("div", {
232
- className: "control",
233
- children: reactApi.Children.toArray(Array.from(children)),
234
- }))], createElement<any>("div", {
235
- className: "field",
236
- children: reactApi.Children.toArray(Array.from(children_1)),
237
- }))], ["children", reactApi.Children.toArray(Array.from(elems_2))] as [string, any])])))), createElement<any>("div", createObj(Helpers_combineClasses("column", ofArray([["className", "is-half"] as [string, any], (elems_5 = [(children_3 = [createElement<any>("label", createObj(Helpers_combineClasses("label", singleton_1(["children", "Weight (kg)"] as [string, any])))), (children_2 = [createElement<any>("input", createObj(cons(["type", "number"] as [string, any], Helpers_combineClasses("input", toList<IReactProperty>(delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["value", weight] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["placeholder", "Enter weight in kg"] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["disabled", config.Disabled ? true : config.IsReadOnly] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["onChange", (ev_1: Event): void => {
238
- patternInput_1[1](ev_1.target.value);
239
- }] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => ((config.ShowError && (config.Error != null)) ? singleton<IReactProperty>(["className", "is-danger"] as [string, any]) : empty<IReactProperty>())))))))))))))))], createElement<any>("div", {
240
- className: "control",
241
- children: reactApi.Children.toArray(Array.from(children_2)),
242
- }))], createElement<any>("div", {
243
- className: "field",
244
- children: reactApi.Children.toArray(Array.from(children_3)),
245
- }))], ["children", reactApi.Children.toArray(Array.from(elems_5))] as [string, any])]))))], createElement<any>("div", {
246
- className: "columns",
247
- children: reactApi.Children.toArray(Array.from(children_4)),
248
- }))], createElement<any>("div", {
249
- className: "field",
250
- children: reactApi.Children.toArray(Array.from(children_5)),
251
- }))), delay<ReactElement>((): Iterable<ReactElement> => {
252
- let children_6: Iterable<ReactElement>, elems_10: Iterable<ReactElement>, elems_9: Iterable<ReactElement>, elems_8: Iterable<ReactElement>;
225
+ return withLabelAndError(config.Attributes.Label, config.ShowError, config.Error, createElement<any>("div", createObj(ofArray([["className", "bmi-calculator"] as [string, any], (elems_9 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => {
226
+ let elems_4: Iterable<ReactElement>, elems_1: Iterable<ReactElement>, elems: Iterable<ReactElement>, elems_3: Iterable<ReactElement>, elems_2: Iterable<ReactElement>;
227
+ return append<ReactElement>(singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "grid grid-cols-1 md:grid-cols-2 gap-4"] as [string, any], (elems_4 = [createElement<any>("div", createObj(ofArray([["className", "field"] as [string, any], (elems_1 = [createElement<any>("label", {
228
+ className: "label",
229
+ children: "Height (cm)",
230
+ }), createElement<any>("div", createObj(ofArray([["className", "control"] as [string, any], (elems = [createElement<any>("input", {
231
+ type: "number",
232
+ className: join(" ", toList<string>(delay<string>((): Iterable<string> => append<string>(singleton<string>("input input-bordered w-full"), delay<string>((): Iterable<string> => ((config.ShowError && (config.Error != null)) ? singleton<string>("input-error") : empty<string>())))))),
233
+ value: height,
234
+ placeholder: "Enter height in cm",
235
+ disabled: config.Disabled ? true : config.IsReadOnly,
236
+ onChange: (ev: Event): void => {
237
+ patternInput[1](ev.target.value);
238
+ },
239
+ })], ["children", reactApi.Children.toArray(Array.from(elems))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_1))] as [string, any])]))), createElement<any>("div", createObj(ofArray([["className", "field"] as [string, any], (elems_3 = [createElement<any>("label", {
240
+ className: "label",
241
+ children: "Weight (kg)",
242
+ }), createElement<any>("div", createObj(ofArray([["className", "control"] as [string, any], (elems_2 = [createElement<any>("input", {
243
+ type: "number",
244
+ className: join(" ", toList<string>(delay<string>((): Iterable<string> => append<string>(singleton<string>("input input-bordered w-full"), delay<string>((): Iterable<string> => ((config.ShowError && (config.Error != null)) ? singleton<string>("input-error") : empty<string>())))))),
245
+ value: weight,
246
+ placeholder: "Enter weight in kg",
247
+ disabled: config.Disabled ? true : config.IsReadOnly,
248
+ onChange: (ev_1: Event): void => {
249
+ patternInput_1[1](ev_1.target.value);
250
+ },
251
+ })], ["children", reactApi.Children.toArray(Array.from(elems_2))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_3))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_4))] as [string, any])])))), delay<ReactElement>((): Iterable<ReactElement> => {
252
+ let elems_8: Iterable<ReactElement>, elems_7: Iterable<ReactElement>, elems_6: Iterable<ReactElement>, elems_5: Iterable<ReactElement>;
253
253
  const matchValue_5: Option<[float64, string]> = currentBMI;
254
254
  if (matchValue_5 == null) {
255
255
  return singleton<ReactElement>(createElement<any>("div", {
256
- className: "has-text-grey-light has-text-centered",
257
- style: {
258
- padding: 20,
259
- },
256
+ className: "text-center text-base-content/70 py-5 mt-4",
260
257
  children: "Enter height and weight to calculate BMI",
261
258
  }));
262
259
  }
263
260
  else {
264
- const category: string = value_97(matchValue_5)[1];
265
- const bmi_1: float64 = value_97(matchValue_5)[0];
266
- return singleton<ReactElement>((children_6 = [createElement<any>("label", createObj(Helpers_combineClasses("label", singleton_1(["children", "BMI Result"] as [string, any])))), createElement<any>("div", createObj(Helpers_combineClasses("box", ofArray([["style", {
267
- backgroundColor: "#f0f9ff",
268
- border: (((1 + "px ") + "solid") + " ") + "#0ea5e9",
269
- }] as [string, any], (elems_10 = [createElement<any>("div", createObj(ofArray([["className", "has-text-centered"] as [string, any], (elems_9 = [createElement<any>("p", {
270
- className: "is-size-4 has-text-weight-bold",
271
- style: {
272
- color: "#0ea5e9",
273
- },
261
+ const category: string = value_90(matchValue_5)[1];
262
+ const bmi_1: float64 = value_90(matchValue_5)[0];
263
+ return singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "field mt-4"] as [string, any], (elems_8 = [createElement<any>("label", {
264
+ className: "label",
265
+ children: "BMI Result",
266
+ }), createElement<any>("div", createObj(ofArray([["className", "rounded-lg border border-info bg-info/20 p-4"] as [string, any], (elems_7 = [createElement<any>("div", createObj(ofArray([["className", "text-center"] as [string, any], (elems_6 = [createElement<any>("p", {
267
+ className: "text-xl font-bold text-info",
274
268
  children: toText(interpolate("BMI: %.1f%P()", [bmi_1])),
275
269
  }), createElement<any>("p", {
276
- className: "is-size-6",
270
+ className: (category === "Underweight") ? "text-sm text-warning" : ((category === "Normal weight") ? "text-sm text-success" : ((category === "Overweight") ? "text-sm text-warning" : ((category === "Obese") ? "text-sm text-error" : "text-sm text-base-content/70"))),
277
271
  children: `Category: ${category}`,
278
- style: {
279
- color: (category === "Underweight") ? "#f59e0b" : ((category === "Normal weight") ? "#10b981" : ((category === "Overweight") ? "#f59e0b" : ((category === "Obese") ? "#ef4444" : "#6b7280"))),
280
- },
281
- }), createElement<any>("hr", {}), createElement<any>("div", createObj(ofArray([["className", "is-size-7"] as [string, any], (elems_8 = [createElement<any>("p", {
272
+ }), createElement<any>("hr", {
273
+ className: "my-2 border-base-300",
274
+ }), createElement<any>("div", createObj(ofArray([["className", "text-xs text-base-content"] as [string, any], (elems_5 = [createElement<any>("p", {
282
275
  children: "BMI Categories:",
283
276
  }), createElement<any>("p", {
284
277
  children: "• Underweight: < 18.5",
@@ -288,13 +281,10 @@ export function BMIField_BMIFieldComponent(config: StandardRenderFieldConfig$2<s
288
281
  children: "• Overweight: 25.0-29.9",
289
282
  }), createElement<any>("p", {
290
283
  children: "• Obese: ≥ 30.0",
291
- })], ["children", reactApi.Children.toArray(Array.from(elems_8))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_9))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_10))] as [string, any])]))))], createElement<any>("div", {
292
- className: "field",
293
- children: reactApi.Children.toArray(Array.from(children_6)),
294
- })));
284
+ })], ["children", reactApi.Children.toArray(Array.from(elems_5))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_6))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_7))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_8))] as [string, any])]))));
295
285
  }
296
286
  }));
297
- })), ["children", reactApi.Children.toArray(Array.from(elems_12))] as [string, any])]))));
287
+ })), ["children", reactApi.Children.toArray(Array.from(elems_9))] as [string, any])]))));
298
288
  }
299
289
 
300
290
  export class BMIField_Field$1<Values> extends IStandardField$3<Values, string, BMIField_Attributes> implements IField$1<Values> {
@@ -442,34 +432,24 @@ export const Form_enhancedBMIConverter: IPluginValueConverter = new IPluginValue
442
432
  });
443
433
 
444
434
  export function Form_designerPreview(props: RenderPreviewProps$1<Spec_FieldType_$union>): ReactElement {
445
- let elems_3: Iterable<ReactElement>, elems_2: Iterable<ReactElement>, elems: Iterable<ReactElement>, elems_1: Iterable<ReactElement>;
446
- const children: Iterable<ReactElement> = [createElement<any>("div", createObj(Helpers_combineClasses("box", ofArray([["style", {
447
- border: (((1 + "px ") + "dashed") + " ") + "hsl(0, 0%, 86%)",
448
- backgroundColor: "hsl(0, 0%, 98%)",
449
- textAlign: "center",
450
- padding: 20,
451
- }] as [string, any], (elems_3 = [createElement<any>("div", {
452
- className: "has-text-weight-bold",
435
+ let elems_1: Iterable<ReactElement>, elems: Iterable<ReactElement>;
436
+ return createElement<any>("div", createObj(ofArray([["className", "rounded-lg border border-dashed border-base-300 bg-base-200 text-center p-5"] as [string, any], (elems_1 = [createElement<any>("div", {
437
+ className: "font-bold mb-2",
453
438
  children: "📊 BMI Calculator",
454
- style: {
455
- marginBottom: 10,
456
- },
457
- }), createElement<any>("div", createObj(Helpers_combineClasses("columns", ofArray([["className", "is-gapless"] as [string, any], ["className", "is-mobile"] as [string, any], (elems_2 = [createElement<any>("div", createObj(Helpers_combineClasses("column", singleton_1((elems = [createElement<any>("input", createObj(cons(["type", "text"] as [string, any], Helpers_combineClasses("input", ofArray([["readOnly", true] as [string, any], ["placeholder", "Height (cm)"] as [string, any], ["style", {
458
- fontSize: 12 + "px",
459
- }] as [string, any]])))))], ["children", reactApi.Children.toArray(Array.from(elems))] as [string, any]))))), createElement<any>("div", createObj(Helpers_combineClasses("column", singleton_1((elems_1 = [createElement<any>("input", createObj(cons(["type", "text"] as [string, any], Helpers_combineClasses("input", ofArray([["readOnly", true] as [string, any], ["placeholder", "Weight (kg)"] as [string, any], ["style", {
460
- fontSize: 12 + "px",
461
- }] as [string, any]])))))], ["children", reactApi.Children.toArray(Array.from(elems_1))] as [string, any])))))], ["children", reactApi.Children.toArray(Array.from(elems_2))] as [string, any])])))), createElement<any>("div", {
462
- style: {
463
- fontSize: 10 + "px",
464
- color: "hsl(0, 0%, 60%)",
465
- marginTop: 5,
466
- },
439
+ }), createElement<any>("div", createObj(ofArray([["className", "grid grid-cols-2 gap-2"] as [string, any], (elems = [createElement<any>("input", {
440
+ type: "text",
441
+ readOnly: true,
442
+ placeholder: "Height (cm)",
443
+ className: "input input-bordered input-sm w-full",
444
+ }), createElement<any>("input", {
445
+ type: "text",
446
+ readOnly: true,
447
+ placeholder: "Weight (kg)",
448
+ className: "input input-bordered input-sm w-full",
449
+ })], ["children", reactApi.Children.toArray(Array.from(elems))] as [string, any])]))), createElement<any>("div", {
450
+ className: "text-xs text-base-content/60 mt-1.5",
467
451
  children: "Automatically calculates BMI and category",
468
- })], ["children", reactApi.Children.toArray(Array.from(elems_3))] as [string, any])]))))];
469
- return createElement<any>("div", {
470
- className: "control",
471
- children: reactApi.Children.toArray(Array.from(children)),
472
- });
452
+ })], ["children", reactApi.Children.toArray(Array.from(elems_1))] as [string, any])])));
473
453
  }
474
454
 
475
455
  export function Form_markdownRenderer(field: Spec_FormField$1<Spec_FieldType_$union>, fieldDetails: FieldDetails): string {
@@ -483,7 +463,7 @@ export function Form_markdownRenderer(field: Spec_FormField$1<Spec_FieldType_$un
483
463
  else {
484
464
  try {
485
465
  const bmiData: BMIField_BMIData = BMIField_parseBMIData(value);
486
- return ((((bmiData.Height > 0) && (bmiData.Weight > 0)) && (bmiData.BMI != null)) && (bmiData.Category != null)) ? join("\n", [`**${field.Label}** ${(matchValue_1 = value_97(bmiData.Category), (matchValue_1 === "Underweight") ? "⚖️" : ((matchValue_1 === "Normal weight") ? "✅" : ((matchValue_1 === "Overweight") ? "⚠️" : ((matchValue_1 === "Obese") ? "🚨" : "📊"))))}`, "", "| Metric | Value |", "|--------|-------|", `| **Height** | %P(F1) cm |`, `| **Weight** | %P(F1) kg |`, `| **BMI** | **%P(F1)** |`, `| **Category** | **${value_97(bmiData.Category)}** |`, "", "> 💡 *BMI is calculated as weight (kg) divided by height (m) squared*"]) : (`**${field.Label}:** *[Incomplete data: Height=%P(F1)cm, Weight=%P(F1)kg]*`);
466
+ return ((((bmiData.Height > 0) && (bmiData.Weight > 0)) && (bmiData.BMI != null)) && (bmiData.Category != null)) ? join("\n", [`**${field.Label}** ${(matchValue_1 = value_90(bmiData.Category), (matchValue_1 === "Underweight") ? "⚖️" : ((matchValue_1 === "Normal weight") ? "✅" : ((matchValue_1 === "Overweight") ? "⚠️" : ((matchValue_1 === "Obese") ? "🚨" : "📊"))))}`, "", "| Metric | Value |", "|--------|-------|", `| **Height** | %P(F1) cm |`, `| **Weight** | %P(F1) kg |`, `| **BMI** | **%P(F1)** |`, `| **Category** | **${value_90(bmiData.Category)}** |`, "", "> 💡 *BMI is calculated as weight (kg) divided by height (m) squared*"]) : (`**${field.Label}:** *[Incomplete data: Height=%P(F1)cm, Weight=%P(F1)kg]*`);
487
467
  }
488
468
  catch (ex: any) {
489
469
  return `**${field.Label}:** *[Error processing data: ${ex.message}]*`;