@f1studio/form-spec 5.0.0-alpha.111 → 5.0.0-alpha.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FormSpec.FS/BitmaskHelpers.d.ts +23 -0
- package/FormSpec.FS/BitmaskHelpers.d.ts.map +1 -0
- package/FormSpec.FS/BlueprintValidation.d.ts +16 -0
- package/FormSpec.FS/BlueprintValidation.d.ts.map +1 -0
- package/FormSpec.FS/FormSpec.d.ts +19 -5
- package/FormSpec.FS/FormSpec.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecHelpers.d.ts +4 -0
- package/FormSpec.FS/FormSpecHelpers.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecValues.d.ts +5 -0
- package/FormSpec.FS/FormSpecValues.d.ts.map +1 -1
- package/FormSpec.FS/Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts +13 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts +22 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts +22 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts +130 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts +37 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts +231 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts +10 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts +55 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts +69 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts +21 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +133 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.d.ts +52 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.d.ts +46 -0
- package/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.d.ts +4 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.d.ts +36 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts +95 -0
- package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts +449 -0
- package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts.map +1 -0
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +3 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Provenance.d.ts +10 -0
- package/FormSpec.FS/Provenance.d.ts.map +1 -0
- package/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js +56 -0
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +116 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Designer.js +2 -2
- package/FormSpec.TS/FormSpec.FS/Designer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Designer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.js +72 -3
- package/FormSpec.TS/FormSpec.FS/FormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +201 -3
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js +38 -3
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.js +44 -27
- package/FormSpec.TS/FormSpec.FS/Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js +45 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +145 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +139 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js +801 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js +121 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js +1380 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js +29 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +172 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js +406 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +317 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +622 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +448 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.js +198 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.js +57 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.js +144 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js +258 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js +1768 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +22 -18
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +18 -6
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Provenance.js +41 -0
- package/FormSpec.TS/FormSpec.FS/Provenance.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Provenance.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js +36 -13
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Renderers/PathwayRenderers.js +1 -1
- package/FormSpec.TS/PathwayExecutor.withPlugins.js +0 -5
- package/FormSpec.TS/PathwayExecutor.withPlugins.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.js +2 -0
- package/FormSpec.TS/PluginRegistration.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.ts.map +1 -1
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.js +918 -0
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.js.map +1 -0
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.ts.map +1 -0
- package/FormSpec.TS/plugins/likert/src/LikertField.js +1 -1
- package/PathwayExecutor.withPlugins.d.ts +0 -5
- package/PathwayExecutor.withPlugins.d.ts.map +1 -1
- package/README.md +7 -7
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts +3 -0
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts.map +1 -0
- package/package.json +4 -4
- package/plugins/demographics/src/DemographicsField.d.ts +104 -0
- package/plugins/demographics/src/DemographicsField.d.ts.map +1 -0
- package/src/FormSpec.FS/BitmaskHelpers.ts +52 -0
- package/src/FormSpec.FS/BlueprintValidation.ts +108 -0
- package/src/FormSpec.FS/Designer.ts +2 -2
- package/src/FormSpec.FS/FormSpec.ts +39 -8
- package/src/FormSpec.FS/FormSpecHelpers.ts +190 -12
- package/src/FormSpec.FS/FormSpecValues.ts +42 -3
- package/src/FormSpec.FS/Helpers.ts +44 -27
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts +37 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +103 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +129 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts +490 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts +87 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts +1046 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts +26 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +161 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts +386 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +320 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +371 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +372 -0
- package/src/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts +92 -0
- package/src/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts +51 -0
- package/src/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts +71 -0
- package/src/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts +15 -0
- package/src/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts +825 -0
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +19 -15
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +13 -7
- package/src/FormSpec.FS/PathwayExecutor.ts +1 -1
- package/src/FormSpec.FS/Provenance.ts +19 -0
- package/src/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts +32 -12
- package/src/FormSpec.FS/Renderers/PathwayRenderers.ts +1 -1
- package/src/PathwayExecutor.withPlugins.ts +0 -5
- package/src/PluginRegistration.ts +2 -0
- package/src/plugins/demographics/src/DemographicsField.ts +502 -0
- package/src/plugins/likert/src/LikertField.ts +1 -1
|
@@ -6,6 +6,7 @@ import { IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
|
6
6
|
import { FSharpMap } from "@fable-org/fable-library-js/Map.js";
|
|
7
7
|
import { FSharpSet } from "@fable-org/fable-library-js/Set.js";
|
|
8
8
|
import { ofArray, FSharpList } from "@fable-org/fable-library-js/List.js";
|
|
9
|
+
import { IntegrationProvenance_$reflection, IntegrationProvenance } from "./Provenance.js";
|
|
9
10
|
import { newGuid, tryParse } from "@fable-org/fable-library-js/Guid.js";
|
|
10
11
|
import { item } from "@fable-org/fable-library-js/Array.js";
|
|
11
12
|
import { split } from "@fable-org/fable-library-js/String.js";
|
|
@@ -996,6 +997,7 @@ export type Spec_FieldType_$union =
|
|
|
996
997
|
| Spec_FieldType<20>
|
|
997
998
|
| Spec_FieldType<21>
|
|
998
999
|
| Spec_FieldType<22>
|
|
1000
|
+
| Spec_FieldType<23>
|
|
999
1001
|
|
|
1000
1002
|
export type Spec_FieldType_$cases = {
|
|
1001
1003
|
0: ["Text", [Spec_TextInfo]],
|
|
@@ -1020,7 +1022,8 @@ export type Spec_FieldType_$cases = {
|
|
|
1020
1022
|
19: ["Matrix", [Spec_MatrixInfo]],
|
|
1021
1023
|
20: ["Signature", [Spec_SignatureInfo]],
|
|
1022
1024
|
21: ["Message", [Spec_MessageInfo]],
|
|
1023
|
-
22: ["
|
|
1025
|
+
22: ["UnsupportedField", [Spec_UnsupportedFieldInfo]],
|
|
1026
|
+
23: ["PluginField", [Spec_PluginFieldConfig]]
|
|
1024
1027
|
}
|
|
1025
1028
|
|
|
1026
1029
|
export function Spec_FieldType_Text(Item: Spec_TextInfo) {
|
|
@@ -1111,21 +1114,41 @@ export function Spec_FieldType_Message(Item: Spec_MessageInfo) {
|
|
|
1111
1114
|
return new Spec_FieldType<21>(21, [Item]);
|
|
1112
1115
|
}
|
|
1113
1116
|
|
|
1114
|
-
export function
|
|
1117
|
+
export function Spec_FieldType_UnsupportedField(Item: Spec_UnsupportedFieldInfo) {
|
|
1115
1118
|
return new Spec_FieldType<22>(22, [Item]);
|
|
1116
1119
|
}
|
|
1117
1120
|
|
|
1121
|
+
export function Spec_FieldType_PluginField(Item: Spec_PluginFieldConfig) {
|
|
1122
|
+
return new Spec_FieldType<23>(23, [Item]);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1118
1125
|
export class Spec_FieldType<Tag extends keyof Spec_FieldType_$cases> extends Union<Tag, Spec_FieldType_$cases[Tag][0]> {
|
|
1119
1126
|
constructor(readonly tag: Tag, readonly fields: Spec_FieldType_$cases[Tag][1]) {
|
|
1120
1127
|
super();
|
|
1121
1128
|
}
|
|
1122
1129
|
cases() {
|
|
1123
|
-
return ["Text", "TextArea", "Email", "Password", "Search", "Color", "Number", "Tel", "Date", "DateTimeLocal", "Time", "Checkbox", "Radio", "SingleChoice", "Dropdown", "MultiChoice", "CheckboxList", "TagList", "TextAutoComplete", "Matrix", "Signature", "Message", "PluginField"];
|
|
1130
|
+
return ["Text", "TextArea", "Email", "Password", "Search", "Color", "Number", "Tel", "Date", "DateTimeLocal", "Time", "Checkbox", "Radio", "SingleChoice", "Dropdown", "MultiChoice", "CheckboxList", "TagList", "TextAutoComplete", "Matrix", "Signature", "Message", "UnsupportedField", "PluginField"];
|
|
1124
1131
|
}
|
|
1125
1132
|
}
|
|
1126
1133
|
|
|
1127
1134
|
export function Spec_FieldType_$reflection(): TypeInfo {
|
|
1128
|
-
return union_type("F1.Studio.Spec.FieldType", [], Spec_FieldType, () => [[["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_BooleanInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_MultiChoiceInfo_$reflection()]], [["Item", Spec_MultiChoiceInfo_$reflection()]], [["Item", Spec_MultiChoiceInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_MatrixInfo_$reflection()]], [["Item", Spec_SignatureInfo_$reflection()]], [["Item", Spec_MessageInfo_$reflection()]], [["Item", Spec_PluginFieldConfig_$reflection()]]]);
|
|
1135
|
+
return union_type("F1.Studio.Spec.FieldType", [], Spec_FieldType, () => [[["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_TextInfo_$reflection()]], [["Item", Spec_BooleanInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_MultiChoiceInfo_$reflection()]], [["Item", Spec_MultiChoiceInfo_$reflection()]], [["Item", Spec_MultiChoiceInfo_$reflection()]], [["Item", Spec_SingleChoiceInfo_$reflection()]], [["Item", Spec_MatrixInfo_$reflection()]], [["Item", Spec_SignatureInfo_$reflection()]], [["Item", Spec_MessageInfo_$reflection()]], [["Item", Spec_UnsupportedFieldInfo_$reflection()]], [["Item", Spec_PluginFieldConfig_$reflection()]]]);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
export class Spec_UnsupportedFieldInfo extends Record implements IEquatable<Spec_UnsupportedFieldInfo>, IComparable<Spec_UnsupportedFieldInfo> {
|
|
1139
|
+
readonly CoreMRItemId: int32;
|
|
1140
|
+
readonly Code: string;
|
|
1141
|
+
readonly ItemTypeId: int32;
|
|
1142
|
+
constructor(CoreMRItemId: int32, Code: string, ItemTypeId: int32) {
|
|
1143
|
+
super();
|
|
1144
|
+
this.CoreMRItemId = (CoreMRItemId | 0);
|
|
1145
|
+
this.Code = Code;
|
|
1146
|
+
this.ItemTypeId = (ItemTypeId | 0);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
export function Spec_UnsupportedFieldInfo_$reflection(): TypeInfo {
|
|
1151
|
+
return record_type("F1.Studio.Spec.UnsupportedFieldInfo", [], Spec_UnsupportedFieldInfo, () => [["CoreMRItemId", int32_type], ["Code", string_type], ["ItemTypeId", int32_type]]);
|
|
1129
1152
|
}
|
|
1130
1153
|
|
|
1131
1154
|
export class Spec_FieldAnswerFlag extends Record implements IEquatable<Spec_FieldAnswerFlag>, IComparable<Spec_FieldAnswerFlag> {
|
|
@@ -1150,9 +1173,11 @@ export class Spec_FormField$1<FieldType> extends Record implements IEquatable<Sp
|
|
|
1150
1173
|
readonly DependsOn: Option<Spec_DependsOn>;
|
|
1151
1174
|
readonly IsOptional: boolean;
|
|
1152
1175
|
readonly IsDeprecated: boolean;
|
|
1176
|
+
readonly NeedsDocumentation: boolean;
|
|
1177
|
+
readonly Documentation: Option<string>;
|
|
1153
1178
|
readonly FieldType: FieldType;
|
|
1154
1179
|
readonly Value: Option<Shared_FieldValue_$union>;
|
|
1155
|
-
constructor(FieldOrder: int32, FieldKey: Shared_FieldKey, Label: string, Notes: Option<string>, DependsOn: Option<Spec_DependsOn>, IsOptional: boolean, IsDeprecated: boolean, FieldType: FieldType, Value: Option<Shared_FieldValue_$union>) {
|
|
1180
|
+
constructor(FieldOrder: int32, FieldKey: Shared_FieldKey, Label: string, Notes: Option<string>, DependsOn: Option<Spec_DependsOn>, IsOptional: boolean, IsDeprecated: boolean, NeedsDocumentation: boolean, Documentation: Option<string>, FieldType: FieldType, Value: Option<Shared_FieldValue_$union>) {
|
|
1156
1181
|
super();
|
|
1157
1182
|
this.FieldOrder = (FieldOrder | 0);
|
|
1158
1183
|
this.FieldKey = FieldKey;
|
|
@@ -1161,13 +1186,15 @@ export class Spec_FormField$1<FieldType> extends Record implements IEquatable<Sp
|
|
|
1161
1186
|
this.DependsOn = DependsOn;
|
|
1162
1187
|
this.IsOptional = IsOptional;
|
|
1163
1188
|
this.IsDeprecated = IsDeprecated;
|
|
1189
|
+
this.NeedsDocumentation = NeedsDocumentation;
|
|
1190
|
+
this.Documentation = Documentation;
|
|
1164
1191
|
this.FieldType = FieldType;
|
|
1165
1192
|
this.Value = Value;
|
|
1166
1193
|
}
|
|
1167
1194
|
}
|
|
1168
1195
|
|
|
1169
1196
|
export function Spec_FormField$1_$reflection(gen0: TypeInfo): TypeInfo {
|
|
1170
|
-
return record_type("F1.Studio.Spec.FormField`1", [gen0], Spec_FormField$1, () => [["FieldOrder", int32_type], ["FieldKey", Shared_FieldKey_$reflection()], ["Label", string_type], ["Notes", option_type(string_type)], ["DependsOn", option_type(Spec_DependsOn_$reflection())], ["IsOptional", bool_type], ["IsDeprecated", bool_type], ["FieldType", gen0], ["Value", option_type(Shared_FieldValue_$reflection())]]);
|
|
1197
|
+
return record_type("F1.Studio.Spec.FormField`1", [gen0], Spec_FormField$1, () => [["FieldOrder", int32_type], ["FieldKey", Shared_FieldKey_$reflection()], ["Label", string_type], ["Notes", option_type(string_type)], ["DependsOn", option_type(Spec_DependsOn_$reflection())], ["IsOptional", bool_type], ["IsDeprecated", bool_type], ["NeedsDocumentation", bool_type], ["Documentation", option_type(string_type)], ["FieldType", gen0], ["Value", option_type(Shared_FieldValue_$reflection())]]);
|
|
1171
1198
|
}
|
|
1172
1199
|
|
|
1173
1200
|
export class Spec_FormStep$1<FieldType> extends Record implements IEquatable<Spec_FormStep$1<FieldType>>, IComparable<Spec_FormStep$1<FieldType>> {
|
|
@@ -1362,7 +1389,9 @@ export class Spec_FormSpec$1<FieldType> extends Record implements IEquatable<Spe
|
|
|
1362
1389
|
readonly ClinicalPathway: Option<ClinicalPathway_ClinicalPathwaySpec>;
|
|
1363
1390
|
readonly Lifecycle: Spec_FormLifecycle_$union;
|
|
1364
1391
|
readonly FilledMeta: Option<Spec_FilledMeta>;
|
|
1365
|
-
|
|
1392
|
+
readonly CustomData: Option<FSharpMap<string, string>>;
|
|
1393
|
+
readonly Provenance: Option<IntegrationProvenance>;
|
|
1394
|
+
constructor(Id: string, Code: Option<string>, Title: string, Abstract: string, Version: string, FormSpecVersion: string, Steps: FSharpList<Spec_FormStep$1<FieldType>>, CategoryTags: FSharpList<string>, Score: Option<Spec_Score>, AssociatedCodes: FSharpList<string>, RequiresReview: boolean, RequiresReviewAndApproval: boolean, ClinicalPathway: Option<ClinicalPathway_ClinicalPathwaySpec>, Lifecycle: Spec_FormLifecycle_$union, FilledMeta: Option<Spec_FilledMeta>, CustomData: Option<FSharpMap<string, string>>, Provenance: Option<IntegrationProvenance>) {
|
|
1366
1395
|
super();
|
|
1367
1396
|
this.Id = Id;
|
|
1368
1397
|
this.Code = Code;
|
|
@@ -1379,11 +1408,13 @@ export class Spec_FormSpec$1<FieldType> extends Record implements IEquatable<Spe
|
|
|
1379
1408
|
this.ClinicalPathway = ClinicalPathway;
|
|
1380
1409
|
this.Lifecycle = Lifecycle;
|
|
1381
1410
|
this.FilledMeta = FilledMeta;
|
|
1411
|
+
this.CustomData = CustomData;
|
|
1412
|
+
this.Provenance = Provenance;
|
|
1382
1413
|
}
|
|
1383
1414
|
}
|
|
1384
1415
|
|
|
1385
1416
|
export function Spec_FormSpec$1_$reflection(gen0: TypeInfo): TypeInfo {
|
|
1386
|
-
return record_type("F1.Studio.Spec.FormSpec`1", [gen0], Spec_FormSpec$1, () => [["Id", class_type("System.Guid")], ["Code", option_type(string_type)], ["Title", string_type], ["Abstract", string_type], ["Version", string_type], ["FormSpecVersion", string_type], ["Steps", list_type(Spec_FormStep$1_$reflection(gen0))], ["CategoryTags", list_type(string_type)], ["Score", option_type(Spec_Score_$reflection())], ["AssociatedCodes", list_type(string_type)], ["RequiresReview", bool_type], ["RequiresReviewAndApproval", bool_type], ["ClinicalPathway", option_type(ClinicalPathway_ClinicalPathwaySpec_$reflection())], ["Lifecycle", Spec_FormLifecycle_$reflection()], ["FilledMeta", option_type(Spec_FilledMeta_$reflection())]]);
|
|
1417
|
+
return record_type("F1.Studio.Spec.FormSpec`1", [gen0], Spec_FormSpec$1, () => [["Id", class_type("System.Guid")], ["Code", option_type(string_type)], ["Title", string_type], ["Abstract", string_type], ["Version", string_type], ["FormSpecVersion", string_type], ["Steps", list_type(Spec_FormStep$1_$reflection(gen0))], ["CategoryTags", list_type(string_type)], ["Score", option_type(Spec_Score_$reflection())], ["AssociatedCodes", list_type(string_type)], ["RequiresReview", bool_type], ["RequiresReviewAndApproval", bool_type], ["ClinicalPathway", option_type(ClinicalPathway_ClinicalPathwaySpec_$reflection())], ["Lifecycle", Spec_FormLifecycle_$reflection()], ["FilledMeta", option_type(Spec_FilledMeta_$reflection())], ["CustomData", option_type(class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, string_type]))], ["Provenance", option_type(IntegrationProvenance_$reflection())]]);
|
|
1387
1418
|
}
|
|
1388
1419
|
|
|
1389
1420
|
export function Spec_Evaluator__get_Key(x: Spec_Evaluator_$union): string {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { singleton, head, isEmpty, ofSeq, iterate, forAll, exists, FSharpList, empty, sortBy, mapIndexed, map } from "@fable-org/fable-library-js/List.js";
|
|
2
|
-
import { float64, int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
1
|
+
import { singleton, head, isEmpty, ofSeq, iterate, forAll, exists, sumBy, collect, tryFind, FSharpList, empty, sortBy, mapIndexed, map } from "@fable-org/fable-library-js/List.js";
|
|
2
|
+
import { tryParse as tryParse_1, float64, int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
3
3
|
import { getFieldDetails, FormSpecMetadata, FieldDetails$1 } from "./FormSpecValues.js";
|
|
4
|
-
import { Shared_FieldValue_Single, Shared_FieldValue_PluginData, Shared_FieldValue_Matrix,
|
|
4
|
+
import { Shared_FieldValue_Single, Shared_FieldValue_PluginData, Shared_FieldValue_Matrix, Shared_FieldValue_Multiple, Shared_ConditionValue_Single, Shared_ConditionValue_PluginData, Shared_ConditionValue_Matrix, Shared_ConditionValue_Multiple, ClinicalPathway_ConstraintDefinition, ClinicalPathway_ConstraintType_$union, ClinicalPathway_TransitionDefinition, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_TransitionCondition_$union, ClinicalPathway_LogicalOp_$union, Shared_MatrixAnswer, Shared_PluginPropertyKey, Shared_FieldOptionKey, Shared_ConditionValue_$union, ClinicalPathway_FieldEvaluator_$union, Shared_PluginDataProperty_$reflection, Shared_PluginDataProperty, Shared_MatrixItemKey, Shared_FieldAnswer, Shared_FieldValue_$union, Spec_FormSpec$1, Spec_FormLifecycle_Draft, Values_StepOrder, Spec_FormStep$1, Shared_FieldKey, Spec_FormField$1, Spec_FieldType_$union } from "./FormSpec.js";
|
|
5
5
|
import { FSharpMap, toList } from "@fable-org/fable-library-js/Map.js";
|
|
6
|
-
import { compare, comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
6
|
+
import { compare, int32ToString, equals, comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
7
7
|
import { newGuid } from "@fable-org/fable-library-js/Guid.js";
|
|
8
|
-
import { value as value_2, Option, bind } from "@fable-org/fable-library-js/Option.js";
|
|
9
|
-
import { join } from "@fable-org/fable-library-js/String.js";
|
|
10
|
-
import { map as
|
|
8
|
+
import { orElse, map as map_1, filter, defaultArg, value as value_2, Option, bind } from "@fable-org/fable-library-js/Option.js";
|
|
9
|
+
import { isNullOrEmpty, join } from "@fable-org/fable-library-js/String.js";
|
|
10
|
+
import { map as map_2, toList as toList_1 } from "@fable-org/fable-library-js/Set.js";
|
|
11
11
|
import { Auto_generateBoxedEncoder_437914C6, toString } from "../fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
|
|
12
12
|
import { list_type } from "@fable-org/fable-library-js/Reflection.js";
|
|
13
13
|
import { tryParse } from "@fable-org/fable-library-js/Double.js";
|
|
14
14
|
import { FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
15
|
+
import { PluginValueRegistry_tryGet, IPluginValueConverter } from "./PluginInterface.js";
|
|
15
16
|
import { FSharpResult$2_$union, FSharpResult$2_Error, FSharpResult$2_Ok } from "@fable-org/fable-library-js/Result.js";
|
|
16
17
|
import { addRangeInPlace } from "@fable-org/fable-library-js/Array.js";
|
|
17
18
|
|
|
@@ -23,13 +24,13 @@ export function buildFormSpecFromResultStepsMap(details: FormSpecMetadata, steps
|
|
|
23
24
|
const stepOrder: int32 = tupledArg_1[0].fields[0] | 0;
|
|
24
25
|
return new Spec_FormStep$1(stepOrder, `Step ${stepOrder}`, mapIndexed<[Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>], Spec_FormField$1<Spec_FieldType_$union>>((i: int32, tupledArg_3: [Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>]): Spec_FormField$1<Spec_FieldType_$union> => {
|
|
25
26
|
const fd_1: FieldDetails$1<Spec_FieldType_$union> = tupledArg_3[1];
|
|
26
|
-
return new Spec_FormField$1(i + 1, tupledArg_3[0], fd_1.Label, undefined, undefined, false, false, fd_1.FieldType, fd_1.FieldValue);
|
|
27
|
+
return new Spec_FormField$1(i + 1, tupledArg_3[0], fd_1.Label, undefined, undefined, false, false, false, undefined, fd_1.FieldType, fd_1.FieldValue);
|
|
27
28
|
}, sortBy<[Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>], int32>((tupledArg_2: [Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>]): int32 => tupledArg_2[1].FieldOrder, toList<Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>>(tupledArg_1[1]), {
|
|
28
29
|
Compare: comparePrimitives,
|
|
29
30
|
})));
|
|
30
31
|
}, sortBy<[Values_StepOrder, FSharpMap<Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>>], int32>((tupledArg: [Values_StepOrder, FSharpMap<Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>>]): int32 => tupledArg[0].fields[0], toList<Values_StepOrder, FSharpMap<Shared_FieldKey, FieldDetails$1<Spec_FieldType_$union>>>(stepsMap), {
|
|
31
32
|
Compare: comparePrimitives,
|
|
32
|
-
})), empty<string>(), details.MaxScore, empty<string>(), false, false, undefined, Spec_FormLifecycle_Draft(newGuid()), undefined);
|
|
33
|
+
})), empty<string>(), details.MaxScore, empty<string>(), false, false, undefined, Spec_FormLifecycle_Draft(newGuid()), undefined, undefined, undefined);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -112,6 +113,140 @@ export function fieldLessThan(fieldKey: Shared_FieldKey, threshold: float64, for
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Evaluate a field condition when actual value is already known (for plugin property conditions)
|
|
118
|
+
*/
|
|
119
|
+
export function evaluateFieldConditionByValue(actualValue: string, evaluator: ClinicalPathway_FieldEvaluator_$union, expectedValue: string): boolean {
|
|
120
|
+
switch (evaluator.tag) {
|
|
121
|
+
case /* Equals */ 0:
|
|
122
|
+
return actualValue.trim().toLocaleLowerCase() === expectedValue.trim().toLocaleLowerCase();
|
|
123
|
+
case /* NotEquals */ 1:
|
|
124
|
+
return actualValue.trim().toLocaleLowerCase() !== expectedValue.trim().toLocaleLowerCase();
|
|
125
|
+
case /* GreaterThan */ 5: {
|
|
126
|
+
let matchValue: [boolean, float64];
|
|
127
|
+
let outArg = 0;
|
|
128
|
+
matchValue = ([tryParse(actualValue, new FSharpRef<float64>((): float64 => outArg, (v: float64): void => {
|
|
129
|
+
outArg = v;
|
|
130
|
+
})), outArg] as [boolean, float64]);
|
|
131
|
+
let matchValue_1: [boolean, float64];
|
|
132
|
+
let outArg_1 = 0;
|
|
133
|
+
matchValue_1 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_1, (v_1: float64): void => {
|
|
134
|
+
outArg_1 = v_1;
|
|
135
|
+
})), outArg_1] as [boolean, float64]);
|
|
136
|
+
let matchResult: int32;
|
|
137
|
+
if (matchValue[0]) {
|
|
138
|
+
if (matchValue_1[0]) {
|
|
139
|
+
matchResult = 0;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
matchResult = 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
matchResult = 1;
|
|
147
|
+
}
|
|
148
|
+
switch (matchResult) {
|
|
149
|
+
case 0:
|
|
150
|
+
return matchValue[1] > matchValue_1[1];
|
|
151
|
+
default:
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
case /* GreaterOrEqual */ 6: {
|
|
156
|
+
let matchValue_3: [boolean, float64];
|
|
157
|
+
let outArg_2 = 0;
|
|
158
|
+
matchValue_3 = ([tryParse(actualValue, new FSharpRef<float64>((): float64 => outArg_2, (v_2: float64): void => {
|
|
159
|
+
outArg_2 = v_2;
|
|
160
|
+
})), outArg_2] as [boolean, float64]);
|
|
161
|
+
let matchValue_4: [boolean, float64];
|
|
162
|
+
let outArg_3 = 0;
|
|
163
|
+
matchValue_4 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_3, (v_3: float64): void => {
|
|
164
|
+
outArg_3 = v_3;
|
|
165
|
+
})), outArg_3] as [boolean, float64]);
|
|
166
|
+
let matchResult_1: int32;
|
|
167
|
+
if (matchValue_3[0]) {
|
|
168
|
+
if (matchValue_4[0]) {
|
|
169
|
+
matchResult_1 = 0;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
matchResult_1 = 1;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
matchResult_1 = 1;
|
|
177
|
+
}
|
|
178
|
+
switch (matchResult_1) {
|
|
179
|
+
case 0:
|
|
180
|
+
return matchValue_3[1] >= matchValue_4[1];
|
|
181
|
+
default:
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
case /* LessThan */ 7: {
|
|
186
|
+
let matchValue_6: [boolean, float64];
|
|
187
|
+
let outArg_4 = 0;
|
|
188
|
+
matchValue_6 = ([tryParse(actualValue, new FSharpRef<float64>((): float64 => outArg_4, (v_4: float64): void => {
|
|
189
|
+
outArg_4 = v_4;
|
|
190
|
+
})), outArg_4] as [boolean, float64]);
|
|
191
|
+
let matchValue_7: [boolean, float64];
|
|
192
|
+
let outArg_5 = 0;
|
|
193
|
+
matchValue_7 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_5, (v_5: float64): void => {
|
|
194
|
+
outArg_5 = v_5;
|
|
195
|
+
})), outArg_5] as [boolean, float64]);
|
|
196
|
+
let matchResult_2: int32;
|
|
197
|
+
if (matchValue_6[0]) {
|
|
198
|
+
if (matchValue_7[0]) {
|
|
199
|
+
matchResult_2 = 0;
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
matchResult_2 = 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
matchResult_2 = 1;
|
|
207
|
+
}
|
|
208
|
+
switch (matchResult_2) {
|
|
209
|
+
case 0:
|
|
210
|
+
return matchValue_6[1] < matchValue_7[1];
|
|
211
|
+
default:
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
case /* LessOrEqual */ 8: {
|
|
216
|
+
let matchValue_9: [boolean, float64];
|
|
217
|
+
let outArg_6 = 0;
|
|
218
|
+
matchValue_9 = ([tryParse(actualValue, new FSharpRef<float64>((): float64 => outArg_6, (v_6: float64): void => {
|
|
219
|
+
outArg_6 = v_6;
|
|
220
|
+
})), outArg_6] as [boolean, float64]);
|
|
221
|
+
let matchValue_10: [boolean, float64];
|
|
222
|
+
let outArg_7 = 0;
|
|
223
|
+
matchValue_10 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_7, (v_7: float64): void => {
|
|
224
|
+
outArg_7 = v_7;
|
|
225
|
+
})), outArg_7] as [boolean, float64]);
|
|
226
|
+
let matchResult_3: int32;
|
|
227
|
+
if (matchValue_9[0]) {
|
|
228
|
+
if (matchValue_10[0]) {
|
|
229
|
+
matchResult_3 = 0;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
matchResult_3 = 1;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
matchResult_3 = 1;
|
|
237
|
+
}
|
|
238
|
+
switch (matchResult_3) {
|
|
239
|
+
case 0:
|
|
240
|
+
return matchValue_9[1] <= matchValue_10[1];
|
|
241
|
+
default:
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
default:
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
115
250
|
/**
|
|
116
251
|
* Evaluate a single field condition (string-based, for backward compatibility)
|
|
117
252
|
*/
|
|
@@ -215,7 +350,50 @@ export function evaluateCondition(formSpec: Spec_FormSpec$1<Spec_FieldType_$unio
|
|
|
215
350
|
const evaluator_2: ClinicalPathway_FieldEvaluator_$union = condition.fields[2];
|
|
216
351
|
const conditionValue_2: Shared_ConditionValue_$union = condition.fields[3];
|
|
217
352
|
const expectedValueStr_2: string = (conditionValue_2.tag === /* Multiple */ 1) ? join(",", toList_1<string>(conditionValue_2.fields[0])) : ((conditionValue_2.tag === /* Matrix */ 2) ? join(",", map<[Shared_MatrixItemKey, string], string>((tupledArg_2: [Shared_MatrixItemKey, string]): string => tupledArg_2[1], toList<Shared_MatrixItemKey, string>(conditionValue_2.fields[0]))) : ((conditionValue_2.tag === /* PluginData */ 3) ? conditionValue_2.fields[0].Value : conditionValue_2.fields[0]));
|
|
218
|
-
return
|
|
353
|
+
return evaluateFieldConditionByValue(defaultArg(bind<FieldDetails$1<Spec_FieldType_$union>, string>((details: FieldDetails$1<Spec_FieldType_$union>): Option<string> => {
|
|
354
|
+
const pluginIdOpt: Option<string> = filter<string>((id: string): boolean => !isNullOrEmpty(id), map_1<Spec_FormField$1<Spec_FieldType_$union>, string>((f_1: Spec_FormField$1<Spec_FieldType_$union>): string => {
|
|
355
|
+
const matchValue: Spec_FieldType_$union = f_1.FieldType;
|
|
356
|
+
switch (matchValue.tag) {
|
|
357
|
+
case /* PluginField */ 23:
|
|
358
|
+
return matchValue.fields[0].PluginId;
|
|
359
|
+
case /* Matrix */ 19:
|
|
360
|
+
return "Fable.Form.Simple.Bulma.Fields.LikertField";
|
|
361
|
+
default:
|
|
362
|
+
return "";
|
|
363
|
+
}
|
|
364
|
+
}, tryFind<Spec_FormField$1<Spec_FieldType_$union>>((f: Spec_FormField$1<Spec_FieldType_$union>): boolean => equals(f.FieldKey, fieldKey_2), collect<Spec_FormStep$1<Spec_FieldType_$union>, Spec_FormField$1<Spec_FieldType_$union>>((s: Spec_FormStep$1<Spec_FieldType_$union>): FSharpList<Spec_FormField$1<Spec_FieldType_$union>> => s.Fields, formSpec.Steps))));
|
|
365
|
+
if (pluginIdOpt == null) {
|
|
366
|
+
return undefined;
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
return bind<IPluginValueConverter, string>((converter: IPluginValueConverter): Option<string> => {
|
|
370
|
+
let matchValue_1: Shared_FieldValue_$union, matrixValue: Shared_MatrixAnswer;
|
|
371
|
+
return orElse(map_1<Shared_PluginDataProperty, string>((p: Shared_PluginDataProperty): string => p.Value, converter.GetPropertyByKey(propertyKey, details.FieldValue)), (matchValue_1 = details.FieldValue, (matchValue_1.tag === /* Matrix */ 2) ? ((matrixValue = matchValue_1.fields[0], bind<Shared_PluginDataProperty, string>((propMeta: Shared_PluginDataProperty): Option<string> => {
|
|
372
|
+
if (propMeta.Name === "TotalScore") {
|
|
373
|
+
return int32ToString(sumBy<[Shared_MatrixItemKey, string], int32>((tupledArg_3: [Shared_MatrixItemKey, string]): int32 => {
|
|
374
|
+
let matchValue_2: [boolean, int32];
|
|
375
|
+
let outArg = 0;
|
|
376
|
+
matchValue_2 = ([tryParse_1(tupledArg_3[1].trim(), 511, false, 32, new FSharpRef<int32>((): int32 => outArg, (v_7: int32): void => {
|
|
377
|
+
outArg = (v_7 | 0);
|
|
378
|
+
})), outArg] as [boolean, int32]);
|
|
379
|
+
if (matchValue_2[0]) {
|
|
380
|
+
return matchValue_2[1] | 0;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
return 0;
|
|
384
|
+
}
|
|
385
|
+
}, toList<Shared_MatrixItemKey, string>(matrixValue.Values), {
|
|
386
|
+
GetZero: (): int32 => 0,
|
|
387
|
+
Add: (x: int32, y: int32): int32 => (x + y),
|
|
388
|
+
}));
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
return undefined;
|
|
392
|
+
}
|
|
393
|
+
}, converter.GetPropertyMetadataByKey(propertyKey)))) : undefined));
|
|
394
|
+
}, PluginValueRegistry_tryGet(value_2(pluginIdOpt)));
|
|
395
|
+
}
|
|
396
|
+
}, getFieldDetails(formSpec, fieldKey_2)), ""), evaluator_2, expectedValueStr_2);
|
|
219
397
|
}
|
|
220
398
|
case /* CompositeCondition */ 6: {
|
|
221
399
|
const operator: ClinicalPathway_LogicalOp_$union = condition.fields[0];
|
|
@@ -357,7 +535,7 @@ export function validateGuidOnlyFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldTyp
|
|
|
357
535
|
export function fieldValueToConditionValue(fieldValue: Shared_FieldValue_$union): Shared_ConditionValue_$union {
|
|
358
536
|
switch (fieldValue.tag) {
|
|
359
537
|
case /* Multiple */ 1:
|
|
360
|
-
return Shared_ConditionValue_Multiple(
|
|
538
|
+
return Shared_ConditionValue_Multiple(map_2<Shared_FieldAnswer, string>((a: Shared_FieldAnswer): string => a.Value, fieldValue.fields[0], {
|
|
361
539
|
Compare: comparePrimitives,
|
|
362
540
|
}));
|
|
363
541
|
case /* Matrix */ 2:
|
|
@@ -382,7 +560,7 @@ export function fieldValueToConditionValue(fieldValue: Shared_FieldValue_$union)
|
|
|
382
560
|
export function conditionValueToFieldValue(conditionValue: Shared_ConditionValue_$union, fieldKey: Shared_FieldKey, fieldLabel: string): Shared_FieldValue_$union {
|
|
383
561
|
switch (conditionValue.tag) {
|
|
384
562
|
case /* Multiple */ 1:
|
|
385
|
-
return Shared_FieldValue_Multiple(
|
|
563
|
+
return Shared_FieldValue_Multiple(map_2<string, Shared_FieldAnswer>((value_1: string): Shared_FieldAnswer => (new Shared_FieldAnswer(fieldKey, fieldLabel, value_1)), conditionValue.fields[0], {
|
|
386
564
|
Compare: compare,
|
|
387
565
|
}));
|
|
388
566
|
case /* Matrix */ 2:
|
|
@@ -52,6 +52,22 @@ export function FieldDetails$1_$reflection(gen0: TypeInfo): TypeInfo {
|
|
|
52
52
|
function optionsFromField(field: Spec_FormField$1<Spec_FieldType_$union>): FSharpList<Shared_FieldOption> {
|
|
53
53
|
const matchValue: Spec_FieldType_$union = field.FieldType;
|
|
54
54
|
switch (matchValue.tag) {
|
|
55
|
+
case /* Checkbox */ 11:
|
|
56
|
+
case /* Email */ 2:
|
|
57
|
+
case /* Password */ 3:
|
|
58
|
+
case /* Search */ 4:
|
|
59
|
+
case /* Color */ 5:
|
|
60
|
+
case /* Number */ 6:
|
|
61
|
+
case /* Tel */ 7:
|
|
62
|
+
case /* Text */ 0:
|
|
63
|
+
case /* TextArea */ 1:
|
|
64
|
+
case /* Date */ 8:
|
|
65
|
+
case /* DateTimeLocal */ 9:
|
|
66
|
+
case /* Time */ 10:
|
|
67
|
+
case /* Message */ 21:
|
|
68
|
+
case /* Signature */ 20:
|
|
69
|
+
case /* PluginField */ 23:
|
|
70
|
+
return empty<Shared_FieldOption>();
|
|
55
71
|
case /* CheckboxList */ 16:
|
|
56
72
|
return matchValue.fields[0].Options;
|
|
57
73
|
case /* MultiChoice */ 15:
|
|
@@ -69,7 +85,7 @@ function optionsFromField(field: Spec_FormField$1<Spec_FieldType_$union>): FShar
|
|
|
69
85
|
case /* Matrix */ 19:
|
|
70
86
|
return matchValue.fields[0].Options;
|
|
71
87
|
default:
|
|
72
|
-
|
|
88
|
+
throw new Error("Match failure: F1.Studio.Spec.FieldType");
|
|
73
89
|
}
|
|
74
90
|
}
|
|
75
91
|
|
|
@@ -97,7 +113,30 @@ export function updateField<FieldType>(spec: Spec_FormSpec$1<FieldType>, fieldKe
|
|
|
97
113
|
if (i_1 === stepIndex) {
|
|
98
114
|
return new Spec_FormStep$1(step.StepOrder, step.StepLabel, map<Spec_FormField$1<FieldType>, Spec_FormField$1<FieldType>>((f: Spec_FormField$1<FieldType>): Spec_FormField$1<FieldType> => {
|
|
99
115
|
if (equals(f.FieldKey, fieldKey)) {
|
|
100
|
-
return new Spec_FormField$1(f.FieldOrder, f.FieldKey, f.Label, f.Notes, f.DependsOn, f.IsOptional, f.IsDeprecated, f.FieldType, newValue);
|
|
116
|
+
return new Spec_FormField$1(f.FieldOrder, f.FieldKey, f.Label, f.Notes, f.DependsOn, f.IsOptional, f.IsDeprecated, f.NeedsDocumentation, f.Documentation, f.FieldType, newValue);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return f;
|
|
120
|
+
}
|
|
121
|
+
}, step.Fields));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return step;
|
|
125
|
+
}
|
|
126
|
+
}, spec.Steps), spec.CategoryTags, spec.Score, spec.AssociatedCodes, spec.RequiresReview, spec.RequiresReviewAndApproval, spec.ClinicalPathway, spec.Lifecycle, spec.FilledMeta, spec.CustomData, spec.Provenance);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Update a single field's Documentation. Returns new FormSpec.
|
|
131
|
+
* If stepIndex is None, searches for the field across all steps.
|
|
132
|
+
*/
|
|
133
|
+
export function updateFieldDocumentation<FieldType>(spec: Spec_FormSpec$1<FieldType>, fieldKey: Shared_FieldKey, newDoc: Option<string>, stepIndexOpt: Option<int32>): Spec_FormSpec$1<FieldType> {
|
|
134
|
+
const stepIndex: int32 = ((stepIndexOpt == null) ? defaultArg(findStepIndexForField<FieldType>(spec, fieldKey), 0) : value_1(stepIndexOpt)) | 0;
|
|
135
|
+
return new Spec_FormSpec$1(spec.Id, spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, mapIndexed<Spec_FormStep$1<FieldType>, Spec_FormStep$1<FieldType>>((i_1: int32, step: Spec_FormStep$1<FieldType>): Spec_FormStep$1<FieldType> => {
|
|
136
|
+
if (i_1 === stepIndex) {
|
|
137
|
+
return new Spec_FormStep$1(step.StepOrder, step.StepLabel, map<Spec_FormField$1<FieldType>, Spec_FormField$1<FieldType>>((f: Spec_FormField$1<FieldType>): Spec_FormField$1<FieldType> => {
|
|
138
|
+
if (equals(f.FieldKey, fieldKey)) {
|
|
139
|
+
return new Spec_FormField$1(f.FieldOrder, f.FieldKey, f.Label, f.Notes, f.DependsOn, f.IsOptional, f.IsDeprecated, f.NeedsDocumentation, newDoc, f.FieldType, f.Value);
|
|
101
140
|
}
|
|
102
141
|
else {
|
|
103
142
|
return f;
|
|
@@ -107,7 +146,7 @@ export function updateField<FieldType>(spec: Spec_FormSpec$1<FieldType>, fieldKe
|
|
|
107
146
|
else {
|
|
108
147
|
return step;
|
|
109
148
|
}
|
|
110
|
-
}, spec.Steps), spec.CategoryTags, spec.Score, spec.AssociatedCodes, spec.RequiresReview, spec.RequiresReviewAndApproval, spec.ClinicalPathway, spec.Lifecycle, spec.FilledMeta);
|
|
149
|
+
}, spec.Steps), spec.CategoryTags, spec.Score, spec.AssociatedCodes, spec.RequiresReview, spec.RequiresReviewAndApproval, spec.ClinicalPathway, spec.Lifecycle, spec.FilledMeta, spec.CustomData, spec.Provenance);
|
|
111
150
|
}
|
|
112
151
|
|
|
113
152
|
/**
|