@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
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get DemographicsField_Attributes () {
|
|
13
|
+
return DemographicsField_Attributes;
|
|
14
|
+
},
|
|
15
|
+
get DemographicsField_Attributes_$reflection () {
|
|
16
|
+
return DemographicsField_Attributes_$reflection;
|
|
17
|
+
},
|
|
18
|
+
get DemographicsField_DemographicsConfig () {
|
|
19
|
+
return DemographicsField_DemographicsConfig;
|
|
20
|
+
},
|
|
21
|
+
get DemographicsField_DemographicsConfig_$reflection () {
|
|
22
|
+
return DemographicsField_DemographicsConfig_$reflection;
|
|
23
|
+
},
|
|
24
|
+
get DemographicsField_DemographicsData () {
|
|
25
|
+
return DemographicsField_DemographicsData;
|
|
26
|
+
},
|
|
27
|
+
get DemographicsField_DemographicsData_$reflection () {
|
|
28
|
+
return DemographicsField_DemographicsData_$reflection;
|
|
29
|
+
},
|
|
30
|
+
get DemographicsField_DemographicsFieldComponent () {
|
|
31
|
+
return DemographicsField_DemographicsFieldComponent;
|
|
32
|
+
},
|
|
33
|
+
get DemographicsField_Field$1 () {
|
|
34
|
+
return DemographicsField_Field$1;
|
|
35
|
+
},
|
|
36
|
+
get DemographicsField_Field$1_$ctor_Z3F5C7C07 () {
|
|
37
|
+
return DemographicsField_Field$1_$ctor_Z3F5C7C07;
|
|
38
|
+
},
|
|
39
|
+
get DemographicsField_Field$1_$reflection () {
|
|
40
|
+
return DemographicsField_Field$1_$reflection;
|
|
41
|
+
},
|
|
42
|
+
get DemographicsField_SerializedDemographics () {
|
|
43
|
+
return DemographicsField_SerializedDemographics;
|
|
44
|
+
},
|
|
45
|
+
get DemographicsField_SerializedDemographics_$reflection () {
|
|
46
|
+
return DemographicsField_SerializedDemographics_$reflection;
|
|
47
|
+
},
|
|
48
|
+
get DemographicsField_configToOptions () {
|
|
49
|
+
return DemographicsField_configToOptions;
|
|
50
|
+
},
|
|
51
|
+
get DemographicsField_defaultConfig () {
|
|
52
|
+
return DemographicsField_defaultConfig;
|
|
53
|
+
},
|
|
54
|
+
get DemographicsField_form () {
|
|
55
|
+
return DemographicsField_form;
|
|
56
|
+
},
|
|
57
|
+
get DemographicsField_inputClass () {
|
|
58
|
+
return DemographicsField_inputClass;
|
|
59
|
+
},
|
|
60
|
+
get DemographicsField_optionsToConfig () {
|
|
61
|
+
return DemographicsField_optionsToConfig;
|
|
62
|
+
},
|
|
63
|
+
get DemographicsField_parseDemographicsData () {
|
|
64
|
+
return DemographicsField_parseDemographicsData;
|
|
65
|
+
},
|
|
66
|
+
get DemographicsField_serializeDemographicsData () {
|
|
67
|
+
return DemographicsField_serializeDemographicsData;
|
|
68
|
+
},
|
|
69
|
+
get Form_PropertyKeys_Address () {
|
|
70
|
+
return Form_PropertyKeys_Address;
|
|
71
|
+
},
|
|
72
|
+
get Form_PropertyKeys_DateOfBirth () {
|
|
73
|
+
return Form_PropertyKeys_DateOfBirth;
|
|
74
|
+
},
|
|
75
|
+
get Form_PropertyKeys_Email () {
|
|
76
|
+
return Form_PropertyKeys_Email;
|
|
77
|
+
},
|
|
78
|
+
get Form_PropertyKeys_EmergencyContact () {
|
|
79
|
+
return Form_PropertyKeys_EmergencyContact;
|
|
80
|
+
},
|
|
81
|
+
get Form_PropertyKeys_FirstName () {
|
|
82
|
+
return Form_PropertyKeys_FirstName;
|
|
83
|
+
},
|
|
84
|
+
get Form_PropertyKeys_Insurance () {
|
|
85
|
+
return Form_PropertyKeys_Insurance;
|
|
86
|
+
},
|
|
87
|
+
get Form_PropertyKeys_IsMedicalField () {
|
|
88
|
+
return Form_PropertyKeys_IsMedicalField;
|
|
89
|
+
},
|
|
90
|
+
get Form_PropertyKeys_LastName () {
|
|
91
|
+
return Form_PropertyKeys_LastName;
|
|
92
|
+
},
|
|
93
|
+
get Form_PropertyKeys_MRN () {
|
|
94
|
+
return Form_PropertyKeys_MRN;
|
|
95
|
+
},
|
|
96
|
+
get Form_PropertyKeys_Phone () {
|
|
97
|
+
return Form_PropertyKeys_Phone;
|
|
98
|
+
},
|
|
99
|
+
get Form_PropertyKeys_RaceEthnicity () {
|
|
100
|
+
return Form_PropertyKeys_RaceEthnicity;
|
|
101
|
+
},
|
|
102
|
+
get Form_demographicsField () {
|
|
103
|
+
return Form_demographicsField;
|
|
104
|
+
},
|
|
105
|
+
get Form_designerPreview () {
|
|
106
|
+
return Form_designerPreview;
|
|
107
|
+
},
|
|
108
|
+
get Form_enhancedDemographicsConverter () {
|
|
109
|
+
return Form_enhancedDemographicsConverter;
|
|
110
|
+
},
|
|
111
|
+
get Form_isMedicalFieldProp () {
|
|
112
|
+
return Form_isMedicalFieldProp;
|
|
113
|
+
},
|
|
114
|
+
get Form_markdownRenderer () {
|
|
115
|
+
return Form_markdownRenderer;
|
|
116
|
+
},
|
|
117
|
+
get Form_pluginConfig () {
|
|
118
|
+
return Form_pluginConfig;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const _Types = require("@fable-org/fable-library-js/Types.js");
|
|
122
|
+
const _Option = require("@fable-org/fable-library-js/Option.js");
|
|
123
|
+
const _Util = require("@fable-org/fable-library-js/Util.js");
|
|
124
|
+
const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
|
|
125
|
+
const _Fieldfs = require("../../../fable_modules/Fable.Form.3.0.0/Field.fs.js");
|
|
126
|
+
const _Basefs = require("../../../fable_modules/Fable.Form.3.0.0/Base.fs.js");
|
|
127
|
+
const _String = require("@fable-org/fable-library-js/String.js");
|
|
128
|
+
const _Guid = require("@fable-org/fable-library-js/Guid.js");
|
|
129
|
+
const _FormSpec = require("../../../FormSpec.FS/FormSpec.js");
|
|
130
|
+
const _List = require("@fable-org/fable-library-js/List.js");
|
|
131
|
+
const _Array = require("@fable-org/fable-library-js/Array.js");
|
|
132
|
+
const _react = require("react");
|
|
133
|
+
const _Interopfs = require("../../../fable_modules/Feliz.2.8.0/Interop.fs.js");
|
|
134
|
+
const _HtmlViewfs = require("../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Html.View.fs.js");
|
|
135
|
+
const _Seq = require("@fable-org/fable-library-js/Seq.js");
|
|
136
|
+
const _Typesfs = require("../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Types.fs.js");
|
|
137
|
+
const _Result = require("@fable-org/fable-library-js/Result.js");
|
|
138
|
+
const _PluginInterface = require("../../../FormSpec.FS/PluginInterface.js");
|
|
139
|
+
class DemographicsField_DemographicsData extends _Types.Record {
|
|
140
|
+
constructor(FirstName, LastName, Email, Phone, DateOfBirth, Address, MRN, Insurance, RaceEthnicity, EmergencyContact){
|
|
141
|
+
super();
|
|
142
|
+
this.FirstName = FirstName;
|
|
143
|
+
this.LastName = LastName;
|
|
144
|
+
this.Email = Email;
|
|
145
|
+
this.Phone = Phone;
|
|
146
|
+
this.DateOfBirth = DateOfBirth;
|
|
147
|
+
this.Address = Address;
|
|
148
|
+
this.MRN = MRN;
|
|
149
|
+
this.Insurance = Insurance;
|
|
150
|
+
this.RaceEthnicity = RaceEthnicity;
|
|
151
|
+
this.EmergencyContact = EmergencyContact;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function DemographicsField_DemographicsData_$reflection() {
|
|
155
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.DemographicsData", [], DemographicsField_DemographicsData, ()=>[
|
|
156
|
+
[
|
|
157
|
+
"FirstName",
|
|
158
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
"LastName",
|
|
162
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"Email",
|
|
166
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
167
|
+
],
|
|
168
|
+
[
|
|
169
|
+
"Phone",
|
|
170
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
"DateOfBirth",
|
|
174
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
175
|
+
],
|
|
176
|
+
[
|
|
177
|
+
"Address",
|
|
178
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
179
|
+
],
|
|
180
|
+
[
|
|
181
|
+
"MRN",
|
|
182
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
183
|
+
],
|
|
184
|
+
[
|
|
185
|
+
"Insurance",
|
|
186
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
"RaceEthnicity",
|
|
190
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
191
|
+
],
|
|
192
|
+
[
|
|
193
|
+
"EmergencyContact",
|
|
194
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
195
|
+
]
|
|
196
|
+
]);
|
|
197
|
+
}
|
|
198
|
+
class DemographicsField_DemographicsConfig extends _Types.Record {
|
|
199
|
+
constructor(IncludeName, IncludeEmail, IncludePhone, IncludeDOB, IncludeAddress, IncludeMRN, IncludeInsurance, IncludeRaceEthnicity, IncludeEmergencyContact, MedicalMode, IsRequiredName, IsRequiredEmail, IsRequiredPhone, IsRequiredDOB, IsRequiredAddress, IsRequiredMRN, IsRequiredInsurance, IsRequiredRaceEthnicity, IsRequiredEmergencyContact){
|
|
200
|
+
super();
|
|
201
|
+
this.IncludeName = IncludeName;
|
|
202
|
+
this.IncludeEmail = IncludeEmail;
|
|
203
|
+
this.IncludePhone = IncludePhone;
|
|
204
|
+
this.IncludeDOB = IncludeDOB;
|
|
205
|
+
this.IncludeAddress = IncludeAddress;
|
|
206
|
+
this.IncludeMRN = IncludeMRN;
|
|
207
|
+
this.IncludeInsurance = IncludeInsurance;
|
|
208
|
+
this.IncludeRaceEthnicity = IncludeRaceEthnicity;
|
|
209
|
+
this.IncludeEmergencyContact = IncludeEmergencyContact;
|
|
210
|
+
this.MedicalMode = MedicalMode;
|
|
211
|
+
this.IsRequiredName = IsRequiredName;
|
|
212
|
+
this.IsRequiredEmail = IsRequiredEmail;
|
|
213
|
+
this.IsRequiredPhone = IsRequiredPhone;
|
|
214
|
+
this.IsRequiredDOB = IsRequiredDOB;
|
|
215
|
+
this.IsRequiredAddress = IsRequiredAddress;
|
|
216
|
+
this.IsRequiredMRN = IsRequiredMRN;
|
|
217
|
+
this.IsRequiredInsurance = IsRequiredInsurance;
|
|
218
|
+
this.IsRequiredRaceEthnicity = IsRequiredRaceEthnicity;
|
|
219
|
+
this.IsRequiredEmergencyContact = IsRequiredEmergencyContact;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function DemographicsField_DemographicsConfig_$reflection() {
|
|
223
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.DemographicsConfig", [], DemographicsField_DemographicsConfig, ()=>[
|
|
224
|
+
[
|
|
225
|
+
"IncludeName",
|
|
226
|
+
_Reflection.bool_type
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
"IncludeEmail",
|
|
230
|
+
_Reflection.bool_type
|
|
231
|
+
],
|
|
232
|
+
[
|
|
233
|
+
"IncludePhone",
|
|
234
|
+
_Reflection.bool_type
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
"IncludeDOB",
|
|
238
|
+
_Reflection.bool_type
|
|
239
|
+
],
|
|
240
|
+
[
|
|
241
|
+
"IncludeAddress",
|
|
242
|
+
_Reflection.bool_type
|
|
243
|
+
],
|
|
244
|
+
[
|
|
245
|
+
"IncludeMRN",
|
|
246
|
+
_Reflection.bool_type
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
"IncludeInsurance",
|
|
250
|
+
_Reflection.bool_type
|
|
251
|
+
],
|
|
252
|
+
[
|
|
253
|
+
"IncludeRaceEthnicity",
|
|
254
|
+
_Reflection.bool_type
|
|
255
|
+
],
|
|
256
|
+
[
|
|
257
|
+
"IncludeEmergencyContact",
|
|
258
|
+
_Reflection.bool_type
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
"MedicalMode",
|
|
262
|
+
_Reflection.bool_type
|
|
263
|
+
],
|
|
264
|
+
[
|
|
265
|
+
"IsRequiredName",
|
|
266
|
+
_Reflection.bool_type
|
|
267
|
+
],
|
|
268
|
+
[
|
|
269
|
+
"IsRequiredEmail",
|
|
270
|
+
_Reflection.bool_type
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
"IsRequiredPhone",
|
|
274
|
+
_Reflection.bool_type
|
|
275
|
+
],
|
|
276
|
+
[
|
|
277
|
+
"IsRequiredDOB",
|
|
278
|
+
_Reflection.bool_type
|
|
279
|
+
],
|
|
280
|
+
[
|
|
281
|
+
"IsRequiredAddress",
|
|
282
|
+
_Reflection.bool_type
|
|
283
|
+
],
|
|
284
|
+
[
|
|
285
|
+
"IsRequiredMRN",
|
|
286
|
+
_Reflection.bool_type
|
|
287
|
+
],
|
|
288
|
+
[
|
|
289
|
+
"IsRequiredInsurance",
|
|
290
|
+
_Reflection.bool_type
|
|
291
|
+
],
|
|
292
|
+
[
|
|
293
|
+
"IsRequiredRaceEthnicity",
|
|
294
|
+
_Reflection.bool_type
|
|
295
|
+
],
|
|
296
|
+
[
|
|
297
|
+
"IsRequiredEmergencyContact",
|
|
298
|
+
_Reflection.bool_type
|
|
299
|
+
]
|
|
300
|
+
]);
|
|
301
|
+
}
|
|
302
|
+
class DemographicsField_Attributes extends _Types.Record {
|
|
303
|
+
GetFieldId() {
|
|
304
|
+
const this$ = this;
|
|
305
|
+
return this$.FieldId;
|
|
306
|
+
}
|
|
307
|
+
constructor(FieldId, Label, Config){
|
|
308
|
+
super();
|
|
309
|
+
this.FieldId = FieldId;
|
|
310
|
+
this.Label = Label;
|
|
311
|
+
this.Config = Config;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function DemographicsField_Attributes_$reflection() {
|
|
315
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.Attributes", [], DemographicsField_Attributes, ()=>[
|
|
316
|
+
[
|
|
317
|
+
"FieldId",
|
|
318
|
+
_Reflection.string_type
|
|
319
|
+
],
|
|
320
|
+
[
|
|
321
|
+
"Label",
|
|
322
|
+
_Reflection.string_type
|
|
323
|
+
],
|
|
324
|
+
[
|
|
325
|
+
"Config",
|
|
326
|
+
DemographicsField_DemographicsConfig_$reflection()
|
|
327
|
+
]
|
|
328
|
+
]);
|
|
329
|
+
}
|
|
330
|
+
function DemographicsField_form() {
|
|
331
|
+
return (build)=>(config)=>(0, _Basefs.field)(_String.isNullOrEmpty, build, config);
|
|
332
|
+
}
|
|
333
|
+
const DemographicsField_defaultConfig = new DemographicsField_DemographicsConfig(true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
|
|
334
|
+
function DemographicsField_configToOptions(config) {
|
|
335
|
+
const mk = (desc, v)=>new _FormSpec.Shared_FieldOption(desc, v, new _FormSpec.Shared_FieldOptionKey((0, _Guid.newGuid)()), undefined);
|
|
336
|
+
return (0, _List.ofArray)([
|
|
337
|
+
mk("IncludeName", config.IncludeName ? "true" : "false"),
|
|
338
|
+
mk("IncludeEmail", config.IncludeEmail ? "true" : "false"),
|
|
339
|
+
mk("IncludePhone", config.IncludePhone ? "true" : "false"),
|
|
340
|
+
mk("IncludeDOB", config.IncludeDOB ? "true" : "false"),
|
|
341
|
+
mk("IncludeAddress", config.IncludeAddress ? "true" : "false"),
|
|
342
|
+
mk("IncludeMRN", config.IncludeMRN ? "true" : "false"),
|
|
343
|
+
mk("IncludeInsurance", config.IncludeInsurance ? "true" : "false"),
|
|
344
|
+
mk("IncludeRaceEthnicity", config.IncludeRaceEthnicity ? "true" : "false"),
|
|
345
|
+
mk("IncludeEmergencyContact", config.IncludeEmergencyContact ? "true" : "false"),
|
|
346
|
+
mk("MedicalMode", config.MedicalMode ? "true" : "false"),
|
|
347
|
+
mk("IsRequiredName", config.IsRequiredName ? "true" : "false"),
|
|
348
|
+
mk("IsRequiredEmail", config.IsRequiredEmail ? "true" : "false"),
|
|
349
|
+
mk("IsRequiredPhone", config.IsRequiredPhone ? "true" : "false"),
|
|
350
|
+
mk("IsRequiredDOB", config.IsRequiredDOB ? "true" : "false"),
|
|
351
|
+
mk("IsRequiredAddress", config.IsRequiredAddress ? "true" : "false"),
|
|
352
|
+
mk("IsRequiredMRN", config.IsRequiredMRN ? "true" : "false"),
|
|
353
|
+
mk("IsRequiredInsurance", config.IsRequiredInsurance ? "true" : "false"),
|
|
354
|
+
mk("IsRequiredRaceEthnicity", config.IsRequiredRaceEthnicity ? "true" : "false"),
|
|
355
|
+
mk("IsRequiredEmergencyContact", config.IsRequiredEmergencyContact ? "true" : "false")
|
|
356
|
+
]);
|
|
357
|
+
}
|
|
358
|
+
function DemographicsField_optionsToConfig(options) {
|
|
359
|
+
const getFlag = (name, defaultVal)=>(0, _Option.defaultArg)((0, _Option.map)((o_1)=>o_1.Value === "true", (0, _List.tryFind)((o)=>o.Description === name, options)), defaultVal);
|
|
360
|
+
return new DemographicsField_DemographicsConfig(getFlag("IncludeName", DemographicsField_defaultConfig.IncludeName), getFlag("IncludeEmail", DemographicsField_defaultConfig.IncludeEmail), getFlag("IncludePhone", DemographicsField_defaultConfig.IncludePhone), getFlag("IncludeDOB", DemographicsField_defaultConfig.IncludeDOB), getFlag("IncludeAddress", DemographicsField_defaultConfig.IncludeAddress), getFlag("IncludeMRN", DemographicsField_defaultConfig.IncludeMRN), getFlag("IncludeInsurance", DemographicsField_defaultConfig.IncludeInsurance), getFlag("IncludeRaceEthnicity", DemographicsField_defaultConfig.IncludeRaceEthnicity), getFlag("IncludeEmergencyContact", DemographicsField_defaultConfig.IncludeEmergencyContact), getFlag("MedicalMode", DemographicsField_defaultConfig.MedicalMode), getFlag("IsRequiredName", DemographicsField_defaultConfig.IsRequiredName), getFlag("IsRequiredEmail", DemographicsField_defaultConfig.IsRequiredEmail), getFlag("IsRequiredPhone", DemographicsField_defaultConfig.IsRequiredPhone), getFlag("IsRequiredDOB", DemographicsField_defaultConfig.IsRequiredDOB), getFlag("IsRequiredAddress", DemographicsField_defaultConfig.IsRequiredAddress), getFlag("IsRequiredMRN", DemographicsField_defaultConfig.IsRequiredMRN), getFlag("IsRequiredInsurance", DemographicsField_defaultConfig.IsRequiredInsurance), getFlag("IsRequiredRaceEthnicity", DemographicsField_defaultConfig.IsRequiredRaceEthnicity), getFlag("IsRequiredEmergencyContact", DemographicsField_defaultConfig.IsRequiredEmergencyContact));
|
|
361
|
+
}
|
|
362
|
+
class DemographicsField_SerializedDemographics extends _Types.Record {
|
|
363
|
+
constructor(Data, MedicalMode){
|
|
364
|
+
super();
|
|
365
|
+
this.Data = Data;
|
|
366
|
+
this.MedicalMode = MedicalMode;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function DemographicsField_SerializedDemographics_$reflection() {
|
|
370
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.SerializedDemographics", [], DemographicsField_SerializedDemographics, ()=>[
|
|
371
|
+
[
|
|
372
|
+
"Data",
|
|
373
|
+
DemographicsField_DemographicsData_$reflection()
|
|
374
|
+
],
|
|
375
|
+
[
|
|
376
|
+
"MedicalMode",
|
|
377
|
+
_Reflection.bool_type
|
|
378
|
+
]
|
|
379
|
+
]);
|
|
380
|
+
}
|
|
381
|
+
function DemographicsField_parseDemographicsData(value, medicalMode) {
|
|
382
|
+
try {
|
|
383
|
+
if ((0, _String.isNullOrWhiteSpace)(value)) {
|
|
384
|
+
return new DemographicsField_SerializedDemographics(new DemographicsField_DemographicsData(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined), medicalMode);
|
|
385
|
+
} else {
|
|
386
|
+
const parts = (0, _String.split)(value, [
|
|
387
|
+
"|"
|
|
388
|
+
], undefined, 0);
|
|
389
|
+
const medicalModeFromStorage = parts.length > 0 && (0, _Array.item)(0, parts).startsWith("MEDICAL:") ? (0, _Array.item)(0, parts) === "MEDICAL:true" : medicalMode;
|
|
390
|
+
const offset = ((0, _Array.item)(0, parts).startsWith("MEDICAL:") ? 1 : 0) | 0;
|
|
391
|
+
const opt = (i)=>{
|
|
392
|
+
const idx = offset + i | 0;
|
|
393
|
+
if (parts.length > idx && !(0, _String.isNullOrWhiteSpace)((0, _Array.item)(idx, parts))) {
|
|
394
|
+
return (0, _Array.item)(idx, parts);
|
|
395
|
+
} else {
|
|
396
|
+
return undefined;
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
return new DemographicsField_SerializedDemographics(new DemographicsField_DemographicsData(opt(0), opt(1), opt(2), opt(3), opt(4), opt(5), opt(6), opt(7), opt(8), opt(9)), medicalModeFromStorage);
|
|
400
|
+
}
|
|
401
|
+
} catch (matchValue) {
|
|
402
|
+
return new DemographicsField_SerializedDemographics(new DemographicsField_DemographicsData(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined), medicalMode);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function DemographicsField_serializeDemographicsData(data, medicalMode) {
|
|
406
|
+
return (medicalMode ? "MEDICAL:true" : "MEDICAL:false") + "|" + (0, _String.join)("|", [
|
|
407
|
+
(0, _Option.defaultArg)(data.FirstName, ""),
|
|
408
|
+
(0, _Option.defaultArg)(data.LastName, ""),
|
|
409
|
+
(0, _Option.defaultArg)(data.Email, ""),
|
|
410
|
+
(0, _Option.defaultArg)(data.Phone, ""),
|
|
411
|
+
(0, _Option.defaultArg)(data.DateOfBirth, ""),
|
|
412
|
+
(0, _Option.defaultArg)(data.Address, ""),
|
|
413
|
+
(0, _Option.defaultArg)(data.MRN, ""),
|
|
414
|
+
(0, _Option.defaultArg)(data.Insurance, ""),
|
|
415
|
+
(0, _Option.defaultArg)(data.RaceEthnicity, ""),
|
|
416
|
+
(0, _Option.defaultArg)(data.EmergencyContact, "")
|
|
417
|
+
]);
|
|
418
|
+
}
|
|
419
|
+
const DemographicsField_inputClass = "mt-1 block w-full rounded-md border border-slate-300 bg-white px-2.5 py-1.5 text-sm text-slate-900 shadow-sm placeholder:text-slate-400 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/30 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-500";
|
|
420
|
+
function DemographicsField_DemographicsFieldComponent(config) {
|
|
421
|
+
let elems_4, elems_3;
|
|
422
|
+
const cfg = config.Attributes.Config;
|
|
423
|
+
const data = DemographicsField_parseDemographicsData(config.Value, cfg.MedicalMode).Data;
|
|
424
|
+
let patternInput;
|
|
425
|
+
const initial = (0, _Option.defaultArg)(data.FirstName, "");
|
|
426
|
+
patternInput = _Interopfs.reactApi.useState(initial);
|
|
427
|
+
const firstName = patternInput[0];
|
|
428
|
+
let patternInput_1;
|
|
429
|
+
const initial_1 = (0, _Option.defaultArg)(data.LastName, "");
|
|
430
|
+
patternInput_1 = _Interopfs.reactApi.useState(initial_1);
|
|
431
|
+
const lastName = patternInput_1[0];
|
|
432
|
+
let patternInput_2;
|
|
433
|
+
const initial_2 = (0, _Option.defaultArg)(data.Email, "");
|
|
434
|
+
patternInput_2 = _Interopfs.reactApi.useState(initial_2);
|
|
435
|
+
const email = patternInput_2[0];
|
|
436
|
+
let patternInput_3;
|
|
437
|
+
const initial_3 = (0, _Option.defaultArg)(data.Phone, "");
|
|
438
|
+
patternInput_3 = _Interopfs.reactApi.useState(initial_3);
|
|
439
|
+
const phone = patternInput_3[0];
|
|
440
|
+
let patternInput_4;
|
|
441
|
+
const initial_4 = (0, _Option.defaultArg)(data.DateOfBirth, "");
|
|
442
|
+
patternInput_4 = _Interopfs.reactApi.useState(initial_4);
|
|
443
|
+
const dob = patternInput_4[0];
|
|
444
|
+
let patternInput_5;
|
|
445
|
+
const initial_5 = (0, _Option.defaultArg)(data.Address, "");
|
|
446
|
+
patternInput_5 = _Interopfs.reactApi.useState(initial_5);
|
|
447
|
+
const address = patternInput_5[0];
|
|
448
|
+
let patternInput_6;
|
|
449
|
+
const initial_6 = (0, _Option.defaultArg)(data.MRN, "");
|
|
450
|
+
patternInput_6 = _Interopfs.reactApi.useState(initial_6);
|
|
451
|
+
const mrn = patternInput_6[0];
|
|
452
|
+
let patternInput_7;
|
|
453
|
+
const initial_7 = (0, _Option.defaultArg)(data.Insurance, "");
|
|
454
|
+
patternInput_7 = _Interopfs.reactApi.useState(initial_7);
|
|
455
|
+
const insurance = patternInput_7[0];
|
|
456
|
+
let patternInput_8;
|
|
457
|
+
const initial_8 = (0, _Option.defaultArg)(data.RaceEthnicity, "");
|
|
458
|
+
patternInput_8 = _Interopfs.reactApi.useState(initial_8);
|
|
459
|
+
const raceEthnicity = patternInput_8[0];
|
|
460
|
+
let patternInput_9;
|
|
461
|
+
const initial_9 = (0, _Option.defaultArg)(data.EmergencyContact, "");
|
|
462
|
+
patternInput_9 = _Interopfs.reactApi.useState(initial_9);
|
|
463
|
+
const emergencyContact = patternInput_9[0];
|
|
464
|
+
const dependencies = [
|
|
465
|
+
firstName,
|
|
466
|
+
lastName,
|
|
467
|
+
email,
|
|
468
|
+
phone,
|
|
469
|
+
dob,
|
|
470
|
+
address,
|
|
471
|
+
mrn,
|
|
472
|
+
insurance,
|
|
473
|
+
raceEthnicity,
|
|
474
|
+
emergencyContact
|
|
475
|
+
];
|
|
476
|
+
_Interopfs.reactApi.useEffect(()=>{
|
|
477
|
+
config.OnChange(DemographicsField_serializeDemographicsData(new DemographicsField_DemographicsData((0, _String.isNullOrWhiteSpace)(firstName) ? undefined : firstName, (0, _String.isNullOrWhiteSpace)(lastName) ? undefined : lastName, (0, _String.isNullOrWhiteSpace)(email) ? undefined : email, (0, _String.isNullOrWhiteSpace)(phone) ? undefined : phone, (0, _String.isNullOrWhiteSpace)(dob) ? undefined : dob, (0, _String.isNullOrWhiteSpace)(address) ? undefined : address, (0, _String.isNullOrWhiteSpace)(mrn) ? undefined : mrn, (0, _String.isNullOrWhiteSpace)(insurance) ? undefined : insurance, (0, _String.isNullOrWhiteSpace)(raceEthnicity) ? undefined : raceEthnicity, (0, _String.isNullOrWhiteSpace)(emergencyContact) ? undefined : emergencyContact), cfg.MedicalMode));
|
|
478
|
+
}, dependencies);
|
|
479
|
+
const field = (label, value_10, setValue, placeholder, isRequired)=>{
|
|
480
|
+
let elems;
|
|
481
|
+
return (0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
482
|
+
[
|
|
483
|
+
"className",
|
|
484
|
+
"space-y-1"
|
|
485
|
+
],
|
|
486
|
+
(elems = [
|
|
487
|
+
(0, _react.createElement)("label", {
|
|
488
|
+
className: "block text-xs font-medium text-slate-700",
|
|
489
|
+
children: isRequired ? label + " *" : label
|
|
490
|
+
}),
|
|
491
|
+
(0, _react.createElement)("input", {
|
|
492
|
+
type: "text",
|
|
493
|
+
className: DemographicsField_inputClass,
|
|
494
|
+
value: value_10,
|
|
495
|
+
placeholder: placeholder,
|
|
496
|
+
disabled: config.Disabled ? true : config.IsReadOnly,
|
|
497
|
+
onChange: (ev)=>{
|
|
498
|
+
setValue(ev.target.value);
|
|
499
|
+
}
|
|
500
|
+
})
|
|
501
|
+
], [
|
|
502
|
+
"children",
|
|
503
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems))
|
|
504
|
+
])
|
|
505
|
+
])));
|
|
506
|
+
};
|
|
507
|
+
return (0, _HtmlViewfs.withLabelAndError)(config.Attributes.Label, config.ShowError, config.Error, (0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
508
|
+
[
|
|
509
|
+
"className",
|
|
510
|
+
"space-y-4"
|
|
511
|
+
],
|
|
512
|
+
(elems_4 = [
|
|
513
|
+
(0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
514
|
+
[
|
|
515
|
+
"className",
|
|
516
|
+
"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:gap-6"
|
|
517
|
+
],
|
|
518
|
+
(elems_3 = (0, _Seq.toList)((0, _Seq.delay)(()=>{
|
|
519
|
+
let elems_1;
|
|
520
|
+
return (0, _Seq.append)(cfg.IncludeName ? (0, _Seq.singleton)((0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
521
|
+
[
|
|
522
|
+
"className",
|
|
523
|
+
"space-y-4 sm:col-span-2 sm:grid sm:grid-cols-2 sm:gap-4"
|
|
524
|
+
],
|
|
525
|
+
(elems_1 = [
|
|
526
|
+
field("First name", firstName, patternInput[1], "First name", cfg.IsRequiredName),
|
|
527
|
+
field("Last name", lastName, patternInput_1[1], "Last name", cfg.IsRequiredName)
|
|
528
|
+
], [
|
|
529
|
+
"children",
|
|
530
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems_1))
|
|
531
|
+
])
|
|
532
|
+
])))) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(cfg.IncludeEmail ? (0, _Seq.singleton)(field("Email", email, patternInput_2[1], "email@example.com", cfg.IsRequiredEmail)) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(cfg.IncludePhone ? (0, _Seq.singleton)(field("Phone", phone, patternInput_3[1], "Phone number", cfg.IsRequiredPhone)) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(cfg.IncludeDOB ? (0, _Seq.singleton)(field("Date of birth", dob, patternInput_4[1], "YYYY-MM-DD", cfg.IsRequiredDOB)) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>{
|
|
533
|
+
let elems_2;
|
|
534
|
+
return (0, _Seq.append)(cfg.IncludeAddress ? (0, _Seq.singleton)((0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
535
|
+
[
|
|
536
|
+
"className",
|
|
537
|
+
"sm:col-span-2"
|
|
538
|
+
],
|
|
539
|
+
(elems_2 = [
|
|
540
|
+
field("Address", address, patternInput_5[1], "Street, city, state, zip", cfg.IsRequiredAddress)
|
|
541
|
+
], [
|
|
542
|
+
"children",
|
|
543
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems_2))
|
|
544
|
+
])
|
|
545
|
+
])))) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(cfg.MedicalMode && cfg.IncludeMRN ? (0, _Seq.singleton)(field("MRN", mrn, patternInput_6[1], "Medical record number", cfg.IsRequiredMRN)) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(cfg.MedicalMode && cfg.IncludeInsurance ? (0, _Seq.singleton)(field("Insurance", insurance, patternInput_7[1], "Insurance provider", cfg.IsRequiredInsurance)) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(cfg.MedicalMode && cfg.IncludeRaceEthnicity ? (0, _Seq.singleton)(field("Race / Ethnicity", raceEthnicity, patternInput_8[1], "Race or ethnicity", cfg.IsRequiredRaceEthnicity)) : (0, _Seq.empty)(), (0, _Seq.delay)(()=>cfg.IncludeEmergencyContact ? (0, _Seq.singleton)(field("Emergency contact", emergencyContact, patternInput_9[1], "Name and phone", cfg.IsRequiredEmergencyContact)) : (0, _Seq.empty)()))))))));
|
|
546
|
+
}))))))));
|
|
547
|
+
})), [
|
|
548
|
+
"children",
|
|
549
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems_3))
|
|
550
|
+
])
|
|
551
|
+
])))
|
|
552
|
+
], [
|
|
553
|
+
"children",
|
|
554
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems_4))
|
|
555
|
+
])
|
|
556
|
+
]))));
|
|
557
|
+
}
|
|
558
|
+
class DemographicsField_Field$1 extends _Typesfs.IStandardField$3 {
|
|
559
|
+
"Fable.Form.Simple.Bulma.IStandardField`3.RenderFieldZ43FEF6DC"(config) {
|
|
560
|
+
return (0, _react.createElement)(DemographicsField_DemographicsFieldComponent, config);
|
|
561
|
+
}
|
|
562
|
+
MapFieldValues(update) {
|
|
563
|
+
const _ = this;
|
|
564
|
+
return DemographicsField_Field$1_$ctor_Z3F5C7C07((0, _Fieldfs.mapValues)(update, _.innerField_1));
|
|
565
|
+
}
|
|
566
|
+
constructor(innerField){
|
|
567
|
+
super(innerField);
|
|
568
|
+
this.innerField_1 = innerField;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function DemographicsField_Field$1_$reflection(gen0) {
|
|
572
|
+
return (0, _Reflection.class_type)("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.Field`1", [
|
|
573
|
+
gen0
|
|
574
|
+
], DemographicsField_Field$1, (0, _Typesfs.IStandardField$3_$reflection)(gen0, _Reflection.string_type, DemographicsField_Attributes_$reflection()));
|
|
575
|
+
}
|
|
576
|
+
function DemographicsField_Field$1_$ctor_Z3F5C7C07(innerField) {
|
|
577
|
+
return new DemographicsField_Field$1(innerField);
|
|
578
|
+
}
|
|
579
|
+
function Form_demographicsField(config) {
|
|
580
|
+
return DemographicsField_form()(DemographicsField_Field$1_$ctor_Z3F5C7C07)(config);
|
|
581
|
+
}
|
|
582
|
+
const Form_pluginConfig = new _FormSpec.Spec_PluginFieldConfig("Fable.Form.Simple.Bulma.Fields.DemographicsField", undefined, undefined);
|
|
583
|
+
const Form_PropertyKeys_IsMedicalField = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0001-4000-8000-000000000001");
|
|
584
|
+
const Form_PropertyKeys_FirstName = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0002-4000-8000-000000000001");
|
|
585
|
+
const Form_PropertyKeys_LastName = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0003-4000-8000-000000000001");
|
|
586
|
+
const Form_PropertyKeys_Email = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0004-4000-8000-000000000001");
|
|
587
|
+
const Form_PropertyKeys_Phone = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0005-4000-8000-000000000001");
|
|
588
|
+
const Form_PropertyKeys_DateOfBirth = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0006-4000-8000-000000000001");
|
|
589
|
+
const Form_PropertyKeys_Address = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0007-4000-8000-000000000001");
|
|
590
|
+
const Form_PropertyKeys_MRN = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0008-4000-8000-000000000001");
|
|
591
|
+
const Form_PropertyKeys_Insurance = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-0009-4000-8000-000000000001");
|
|
592
|
+
const Form_PropertyKeys_RaceEthnicity = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-000a-4000-8000-000000000001");
|
|
593
|
+
const Form_PropertyKeys_EmergencyContact = new _FormSpec.Shared_PluginPropertyKey("d0e0f0a0-000b-4000-8000-000000000001");
|
|
594
|
+
function Form_isMedicalFieldProp(medicalMode) {
|
|
595
|
+
return new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_IsMedicalField, "is_medical_field", "bool", medicalMode ? "true" : "false", "Is Medical Field", undefined, "Indicates this field instance was configured in medical mode (PHI/HIPAA context)");
|
|
596
|
+
}
|
|
597
|
+
const Form_enhancedDemographicsConverter = new _PluginInterface.IPluginValueConverter((fieldKey, pluginValue)=>{
|
|
598
|
+
const data = pluginValue;
|
|
599
|
+
const cfg = DemographicsField_defaultConfig;
|
|
600
|
+
const props = [];
|
|
601
|
+
void props.push(Form_isMedicalFieldProp(cfg.MedicalMode));
|
|
602
|
+
if (cfg.IncludeName && data.FirstName != null) {
|
|
603
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", (0, _Option.value)(data.FirstName), "First Name", undefined, undefined));
|
|
604
|
+
}
|
|
605
|
+
if (cfg.IncludeName && data.LastName != null) {
|
|
606
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", (0, _Option.value)(data.LastName), "Last Name", undefined, undefined));
|
|
607
|
+
}
|
|
608
|
+
if (cfg.IncludeEmail && data.Email != null) {
|
|
609
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", (0, _Option.value)(data.Email), "Email", undefined, undefined));
|
|
610
|
+
}
|
|
611
|
+
if (cfg.IncludePhone && data.Phone != null) {
|
|
612
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", (0, _Option.value)(data.Phone), "Phone", undefined, undefined));
|
|
613
|
+
}
|
|
614
|
+
if (cfg.IncludeDOB && data.DateOfBirth != null) {
|
|
615
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", (0, _Option.value)(data.DateOfBirth), "Date of Birth", undefined, undefined));
|
|
616
|
+
}
|
|
617
|
+
if (cfg.IncludeAddress && data.Address != null) {
|
|
618
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", (0, _Option.value)(data.Address), "Address", undefined, undefined));
|
|
619
|
+
}
|
|
620
|
+
if (cfg.MedicalMode && cfg.IncludeMRN && data.MRN != null) {
|
|
621
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", (0, _Option.value)(data.MRN), "MRN", undefined, undefined));
|
|
622
|
+
}
|
|
623
|
+
if (cfg.MedicalMode && cfg.IncludeInsurance && data.Insurance != null) {
|
|
624
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", (0, _Option.value)(data.Insurance), "Insurance", undefined, undefined));
|
|
625
|
+
}
|
|
626
|
+
if (cfg.MedicalMode && cfg.IncludeRaceEthnicity && data.RaceEthnicity != null) {
|
|
627
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", (0, _Option.value)(data.RaceEthnicity), "Race / Ethnicity", undefined, undefined));
|
|
628
|
+
}
|
|
629
|
+
if (cfg.IncludeEmergencyContact && data.EmergencyContact != null) {
|
|
630
|
+
void props.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", (0, _Option.value)(data.EmergencyContact), "Emergency Contact", undefined, undefined));
|
|
631
|
+
}
|
|
632
|
+
return (0, _FormSpec.Shared_FieldValue_PluginData)((0, _Seq.toList)(props));
|
|
633
|
+
}, (fieldValue)=>{
|
|
634
|
+
switch(fieldValue.tag){
|
|
635
|
+
case /* PluginData */ 3:
|
|
636
|
+
{
|
|
637
|
+
const properties = fieldValue.fields[0];
|
|
638
|
+
const getVal = (name)=>(0, _Option.filter)((v)=>!(0, _String.isNullOrWhiteSpace)(v), (0, _Option.map)((p_1)=>p_1.Value, (0, _List.tryFind)((p)=>p.Name === name, properties)));
|
|
639
|
+
return (0, _Option.some)(new DemographicsField_DemographicsData(getVal("first_name"), getVal("last_name"), getVal("email"), getVal("phone"), getVal("date_of_birth"), getVal("address"), getVal("mrn"), getVal("insurance"), getVal("race_ethnicity"), getVal("emergency_contact")));
|
|
640
|
+
}
|
|
641
|
+
case /* Single */ 0:
|
|
642
|
+
return (0, _Option.some)(DemographicsField_parseDemographicsData(fieldValue.fields[0].Value, false).Data);
|
|
643
|
+
default:
|
|
644
|
+
return undefined;
|
|
645
|
+
}
|
|
646
|
+
}, ()=>undefined, ()=>(0, _List.ofArray)([
|
|
647
|
+
"is_medical_field",
|
|
648
|
+
"first_name",
|
|
649
|
+
"last_name",
|
|
650
|
+
"email",
|
|
651
|
+
"phone",
|
|
652
|
+
"date_of_birth",
|
|
653
|
+
"address",
|
|
654
|
+
"mrn",
|
|
655
|
+
"insurance",
|
|
656
|
+
"race_ethnicity",
|
|
657
|
+
"emergency_contact"
|
|
658
|
+
]), (propertyName)=>{
|
|
659
|
+
const meta = (pk, name_1, dt, disp)=>new _FormSpec.Shared_PluginDataProperty(pk, name_1, dt, "", disp, undefined, undefined);
|
|
660
|
+
return propertyName === "is_medical_field" ? meta(Form_PropertyKeys_IsMedicalField, "is_medical_field", "bool", "Is Medical Field") : propertyName === "first_name" ? meta(Form_PropertyKeys_FirstName, "first_name", "string", "First Name") : propertyName === "last_name" ? meta(Form_PropertyKeys_LastName, "last_name", "string", "Last Name") : propertyName === "email" ? meta(Form_PropertyKeys_Email, "email", "string", "Email") : propertyName === "phone" ? meta(Form_PropertyKeys_Phone, "phone", "string", "Phone") : propertyName === "date_of_birth" ? meta(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", "Date of Birth") : propertyName === "address" ? meta(Form_PropertyKeys_Address, "address", "string", "Address") : propertyName === "mrn" ? meta(Form_PropertyKeys_MRN, "mrn", "string", "MRN") : propertyName === "insurance" ? meta(Form_PropertyKeys_Insurance, "insurance", "string", "Insurance") : propertyName === "race_ethnicity" ? meta(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", "Race / Ethnicity") : propertyName === "emergency_contact" ? meta(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", "Emergency Contact") : undefined;
|
|
661
|
+
}, (propertyKey)=>(0, _Option.map)((tupledArg_1)=>{
|
|
662
|
+
const _arg_1 = tupledArg_1[1];
|
|
663
|
+
return new _FormSpec.Shared_PluginDataProperty(tupledArg_1[0], _arg_1[0], _arg_1[1], "", _arg_1[2], undefined, undefined);
|
|
664
|
+
}, (0, _List.tryFind)((tupledArg)=>(0, _Util.equals)(tupledArg[0], propertyKey), (0, _List.ofArray)([
|
|
665
|
+
[
|
|
666
|
+
Form_PropertyKeys_IsMedicalField,
|
|
667
|
+
[
|
|
668
|
+
"is_medical_field",
|
|
669
|
+
"bool",
|
|
670
|
+
"Is Medical Field"
|
|
671
|
+
]
|
|
672
|
+
],
|
|
673
|
+
[
|
|
674
|
+
Form_PropertyKeys_FirstName,
|
|
675
|
+
[
|
|
676
|
+
"first_name",
|
|
677
|
+
"string",
|
|
678
|
+
"First Name"
|
|
679
|
+
]
|
|
680
|
+
],
|
|
681
|
+
[
|
|
682
|
+
Form_PropertyKeys_LastName,
|
|
683
|
+
[
|
|
684
|
+
"last_name",
|
|
685
|
+
"string",
|
|
686
|
+
"Last Name"
|
|
687
|
+
]
|
|
688
|
+
],
|
|
689
|
+
[
|
|
690
|
+
Form_PropertyKeys_Email,
|
|
691
|
+
[
|
|
692
|
+
"email",
|
|
693
|
+
"string",
|
|
694
|
+
"Email"
|
|
695
|
+
]
|
|
696
|
+
],
|
|
697
|
+
[
|
|
698
|
+
Form_PropertyKeys_Phone,
|
|
699
|
+
[
|
|
700
|
+
"phone",
|
|
701
|
+
"string",
|
|
702
|
+
"Phone"
|
|
703
|
+
]
|
|
704
|
+
],
|
|
705
|
+
[
|
|
706
|
+
Form_PropertyKeys_DateOfBirth,
|
|
707
|
+
[
|
|
708
|
+
"date_of_birth",
|
|
709
|
+
"datetime",
|
|
710
|
+
"Date of Birth"
|
|
711
|
+
]
|
|
712
|
+
],
|
|
713
|
+
[
|
|
714
|
+
Form_PropertyKeys_Address,
|
|
715
|
+
[
|
|
716
|
+
"address",
|
|
717
|
+
"string",
|
|
718
|
+
"Address"
|
|
719
|
+
]
|
|
720
|
+
],
|
|
721
|
+
[
|
|
722
|
+
Form_PropertyKeys_MRN,
|
|
723
|
+
[
|
|
724
|
+
"mrn",
|
|
725
|
+
"string",
|
|
726
|
+
"MRN"
|
|
727
|
+
]
|
|
728
|
+
],
|
|
729
|
+
[
|
|
730
|
+
Form_PropertyKeys_Insurance,
|
|
731
|
+
[
|
|
732
|
+
"insurance",
|
|
733
|
+
"string",
|
|
734
|
+
"Insurance"
|
|
735
|
+
]
|
|
736
|
+
],
|
|
737
|
+
[
|
|
738
|
+
Form_PropertyKeys_RaceEthnicity,
|
|
739
|
+
[
|
|
740
|
+
"race_ethnicity",
|
|
741
|
+
"string",
|
|
742
|
+
"Race / Ethnicity"
|
|
743
|
+
]
|
|
744
|
+
],
|
|
745
|
+
[
|
|
746
|
+
Form_PropertyKeys_EmergencyContact,
|
|
747
|
+
[
|
|
748
|
+
"emergency_contact",
|
|
749
|
+
"string",
|
|
750
|
+
"Emergency Contact"
|
|
751
|
+
]
|
|
752
|
+
]
|
|
753
|
+
]))), (propertyName_1, fieldValue_1)=>{
|
|
754
|
+
switch(fieldValue_1.tag){
|
|
755
|
+
case /* PluginData */ 3:
|
|
756
|
+
return (0, _List.tryFind)((p_2)=>p_2.Name === propertyName_1, fieldValue_1.fields[0]);
|
|
757
|
+
case /* Single */ 0:
|
|
758
|
+
{
|
|
759
|
+
const parsed_1 = DemographicsField_parseDemographicsData(fieldValue_1.fields[0].Value, false);
|
|
760
|
+
const data_1 = parsed_1.Data;
|
|
761
|
+
return propertyName_1 === "is_medical_field" ? Form_isMedicalFieldProp(parsed_1.MedicalMode) : propertyName_1 === "first_name" ? (0, _Option.map)((v_1)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", v_1, "First Name", undefined, undefined), data_1.FirstName) : propertyName_1 === "last_name" ? (0, _Option.map)((v_2)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", v_2, "Last Name", undefined, undefined), data_1.LastName) : propertyName_1 === "email" ? (0, _Option.map)((v_3)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", v_3, "Email", undefined, undefined), data_1.Email) : propertyName_1 === "phone" ? (0, _Option.map)((v_4)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", v_4, "Phone", undefined, undefined), data_1.Phone) : propertyName_1 === "date_of_birth" ? (0, _Option.map)((v_5)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", v_5, "Date of Birth", undefined, undefined), data_1.DateOfBirth) : propertyName_1 === "address" ? (0, _Option.map)((v_6)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", v_6, "Address", undefined, undefined), data_1.Address) : propertyName_1 === "mrn" ? (0, _Option.map)((v_7)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", v_7, "MRN", undefined, undefined), data_1.MRN) : propertyName_1 === "insurance" ? (0, _Option.map)((v_8)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", v_8, "Insurance", undefined, undefined), data_1.Insurance) : propertyName_1 === "race_ethnicity" ? (0, _Option.map)((v_9)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", v_9, "Race / Ethnicity", undefined, undefined), data_1.RaceEthnicity) : propertyName_1 === "emergency_contact" ? (0, _Option.map)((v_10)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", v_10, "Emergency Contact", undefined, undefined), data_1.EmergencyContact) : undefined;
|
|
762
|
+
}
|
|
763
|
+
default:
|
|
764
|
+
return undefined;
|
|
765
|
+
}
|
|
766
|
+
}, (propertyKey_1, fieldValue_2)=>{
|
|
767
|
+
switch(fieldValue_2.tag){
|
|
768
|
+
case /* PluginData */ 3:
|
|
769
|
+
return (0, _List.tryFind)((p_3)=>(0, _Util.equals)(p_3.PropertyKey, propertyKey_1), fieldValue_2.fields[0]);
|
|
770
|
+
case /* Single */ 0:
|
|
771
|
+
{
|
|
772
|
+
const parsed_2 = DemographicsField_parseDemographicsData(fieldValue_2.fields[0].Value, false);
|
|
773
|
+
const data_2 = parsed_2.Data;
|
|
774
|
+
return (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_IsMedicalField) ? Form_isMedicalFieldProp(parsed_2.MedicalMode) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_FirstName) ? (0, _Option.map)((v_11)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", v_11, "First Name", undefined, undefined), data_2.FirstName) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_LastName) ? (0, _Option.map)((v_12)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", v_12, "Last Name", undefined, undefined), data_2.LastName) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_Email) ? (0, _Option.map)((v_13)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", v_13, "Email", undefined, undefined), data_2.Email) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_Phone) ? (0, _Option.map)((v_14)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", v_14, "Phone", undefined, undefined), data_2.Phone) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_DateOfBirth) ? (0, _Option.map)((v_15)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", v_15, "Date of Birth", undefined, undefined), data_2.DateOfBirth) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_Address) ? (0, _Option.map)((v_16)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", v_16, "Address", undefined, undefined), data_2.Address) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_MRN) ? (0, _Option.map)((v_17)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", v_17, "MRN", undefined, undefined), data_2.MRN) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_Insurance) ? (0, _Option.map)((v_18)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", v_18, "Insurance", undefined, undefined), data_2.Insurance) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_RaceEthnicity) ? (0, _Option.map)((v_19)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", v_19, "Race / Ethnicity", undefined, undefined), data_2.RaceEthnicity) : (0, _Util.equals)(propertyKey_1, Form_PropertyKeys_EmergencyContact) ? (0, _Option.map)((v_20)=>new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", v_20, "Emergency Contact", undefined, undefined), data_2.EmergencyContact) : undefined;
|
|
775
|
+
}
|
|
776
|
+
default:
|
|
777
|
+
return undefined;
|
|
778
|
+
}
|
|
779
|
+
}, (propertyName_2, value)=>propertyName_2 === "is_medical_field" ? (0, _Result.FSharpResult$2_Error)("is_medical_field is derived from MedicalMode and cannot be set directly") : (0, _Result.FSharpResult$2_Ok)(undefined), (fieldValue_3)=>{
|
|
780
|
+
switch(fieldValue_3.tag){
|
|
781
|
+
case /* PluginData */ 3:
|
|
782
|
+
return fieldValue_3.fields[0];
|
|
783
|
+
case /* Single */ 0:
|
|
784
|
+
{
|
|
785
|
+
const parsed_3 = DemographicsField_parseDemographicsData(fieldValue_3.fields[0].Value, false);
|
|
786
|
+
const data_3 = parsed_3.Data;
|
|
787
|
+
const props_1 = [];
|
|
788
|
+
void props_1.push(Form_isMedicalFieldProp(parsed_3.MedicalMode));
|
|
789
|
+
if (data_3.FirstName != null) {
|
|
790
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", (0, _Option.value)(data_3.FirstName), "First Name", undefined, undefined));
|
|
791
|
+
}
|
|
792
|
+
if (data_3.LastName != null) {
|
|
793
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", (0, _Option.value)(data_3.LastName), "Last Name", undefined, undefined));
|
|
794
|
+
}
|
|
795
|
+
if (data_3.Email != null) {
|
|
796
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", (0, _Option.value)(data_3.Email), "Email", undefined, undefined));
|
|
797
|
+
}
|
|
798
|
+
if (data_3.Phone != null) {
|
|
799
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", (0, _Option.value)(data_3.Phone), "Phone", undefined, undefined));
|
|
800
|
+
}
|
|
801
|
+
if (data_3.DateOfBirth != null) {
|
|
802
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", (0, _Option.value)(data_3.DateOfBirth), "Date of Birth", undefined, undefined));
|
|
803
|
+
}
|
|
804
|
+
if (data_3.Address != null) {
|
|
805
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", (0, _Option.value)(data_3.Address), "Address", undefined, undefined));
|
|
806
|
+
}
|
|
807
|
+
if (parsed_3.MedicalMode && data_3.MRN != null) {
|
|
808
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", (0, _Option.value)(data_3.MRN), "MRN", undefined, undefined));
|
|
809
|
+
}
|
|
810
|
+
if (parsed_3.MedicalMode && data_3.Insurance != null) {
|
|
811
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", (0, _Option.value)(data_3.Insurance), "Insurance", undefined, undefined));
|
|
812
|
+
}
|
|
813
|
+
if (parsed_3.MedicalMode && data_3.RaceEthnicity != null) {
|
|
814
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", (0, _Option.value)(data_3.RaceEthnicity), "Race / Ethnicity", undefined, undefined));
|
|
815
|
+
}
|
|
816
|
+
if (data_3.EmergencyContact != null) {
|
|
817
|
+
void props_1.push(new _FormSpec.Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", (0, _Option.value)(data_3.EmergencyContact), "Emergency Contact", undefined, undefined));
|
|
818
|
+
}
|
|
819
|
+
return (0, _Seq.toList)(props_1);
|
|
820
|
+
}
|
|
821
|
+
default:
|
|
822
|
+
return (0, _List.empty)();
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
function Form_designerPreview(props) {
|
|
826
|
+
let value, elems_2, elems, elems_1;
|
|
827
|
+
return (0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
828
|
+
(value = "flex items-center justify-between rounded-lg border border-dashed border-gray-300 bg-gray-50/80 px-3 py-2", [
|
|
829
|
+
"className",
|
|
830
|
+
value
|
|
831
|
+
]),
|
|
832
|
+
(elems_2 = [
|
|
833
|
+
(0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
834
|
+
[
|
|
835
|
+
"className",
|
|
836
|
+
"flex flex-col gap-0.5"
|
|
837
|
+
],
|
|
838
|
+
(elems = [
|
|
839
|
+
(0, _react.createElement)("span", {
|
|
840
|
+
className: "text-sm font-semibold text-gray-800",
|
|
841
|
+
children: "Demographics"
|
|
842
|
+
}),
|
|
843
|
+
(0, _react.createElement)("span", {
|
|
844
|
+
className: "text-xs text-gray-500",
|
|
845
|
+
children: "Name, contact, DOB, and optional medical fields"
|
|
846
|
+
})
|
|
847
|
+
], [
|
|
848
|
+
"children",
|
|
849
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems))
|
|
850
|
+
])
|
|
851
|
+
]))),
|
|
852
|
+
(0, _react.createElement)("div", (0, _Util.createObj)((0, _List.ofArray)([
|
|
853
|
+
[
|
|
854
|
+
"className",
|
|
855
|
+
"flex items-center gap-2 text-gray-400"
|
|
856
|
+
],
|
|
857
|
+
(elems_1 = [
|
|
858
|
+
(0, _react.createElement)("span", {
|
|
859
|
+
className: "text-base",
|
|
860
|
+
children: "👤"
|
|
861
|
+
}),
|
|
862
|
+
(0, _react.createElement)("span", {
|
|
863
|
+
className: "w-1.5 h-1.5 rounded-full bg-red-400 shrink-0"
|
|
864
|
+
}),
|
|
865
|
+
(0, _react.createElement)("span", {
|
|
866
|
+
className: "text-xs",
|
|
867
|
+
children: "🔗"
|
|
868
|
+
})
|
|
869
|
+
], [
|
|
870
|
+
"children",
|
|
871
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems_1))
|
|
872
|
+
])
|
|
873
|
+
])))
|
|
874
|
+
], [
|
|
875
|
+
"children",
|
|
876
|
+
_Interopfs.reactApi.Children.toArray(Array.from(elems_2))
|
|
877
|
+
])
|
|
878
|
+
])));
|
|
879
|
+
}
|
|
880
|
+
function Form_markdownRenderer(field, fieldDetails) {
|
|
881
|
+
let value;
|
|
882
|
+
const matchValue = fieldDetails.FieldValue;
|
|
883
|
+
value = matchValue.tag === /* Single */ 0 ? matchValue.fields[0].Value : "";
|
|
884
|
+
if ((0, _String.isNullOrWhiteSpace)(value)) {
|
|
885
|
+
return `**${field.Label}:** *[No demographics recorded]*`;
|
|
886
|
+
} else {
|
|
887
|
+
try {
|
|
888
|
+
const data = DemographicsField_parseDemographicsData(value, false).Data;
|
|
889
|
+
const parts = [];
|
|
890
|
+
if (data.FirstName != null) {
|
|
891
|
+
const lastNameStr = (0, _Option.defaultArg)(data.LastName, "");
|
|
892
|
+
void parts.push(`Name: ${(0, _Option.value)(data.FirstName)} ${lastNameStr}`.trim());
|
|
893
|
+
}
|
|
894
|
+
if (data.Email != null) {
|
|
895
|
+
void parts.push(`Email: ${(0, _Option.value)(data.Email)}`);
|
|
896
|
+
}
|
|
897
|
+
if (data.Phone != null) {
|
|
898
|
+
void parts.push(`Phone: ${(0, _Option.value)(data.Phone)}`);
|
|
899
|
+
}
|
|
900
|
+
if (data.DateOfBirth != null) {
|
|
901
|
+
void parts.push(`DOB: ${(0, _Option.value)(data.DateOfBirth)}`);
|
|
902
|
+
}
|
|
903
|
+
if (data.Address != null) {
|
|
904
|
+
void parts.push(`Address: ${(0, _Option.value)(data.Address)}`);
|
|
905
|
+
}
|
|
906
|
+
if (data.MRN != null) {
|
|
907
|
+
void parts.push(`MRN: ${(0, _Option.value)(data.MRN)}`);
|
|
908
|
+
}
|
|
909
|
+
return parts.length > 0 ? `**${field.Label}**
|
|
910
|
+
|
|
911
|
+
` + (0, _String.join)("\n", (0, _Seq.map)((p)=>"- " + p, parts)) : `**${field.Label}:** *[No demographics recorded]*`;
|
|
912
|
+
} catch (ex) {
|
|
913
|
+
return `**${field.Label}:** *[Error: ${ex.message}]*`;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
} //# sourceMappingURL=DemographicsField.ts.map
|
|
917
|
+
|
|
918
|
+
//# sourceMappingURL=DemographicsField.js.map
|