@f1studio/form-spec 5.0.0-alpha.111 → 5.0.0-alpha.113
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/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.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,502 @@
|
|
|
1
|
+
import { Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
|
+
import { some, filter, value as value_40, map, defaultArg, Option } from "@fable-org/fable-library-js/Option.js";
|
|
3
|
+
import { equals, createObj, IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
4
|
+
import { class_type, bool_type, record_type, option_type, string_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
5
|
+
import { mapValues, Field$3, IAttributes } from "../../../fable_modules/Fable.Form.3.0.0/Field.fs.js";
|
|
6
|
+
import { Form$3, FieldConfig$4, field as field_1 } from "../../../fable_modules/Fable.Form.3.0.0/Base.fs.js";
|
|
7
|
+
import { join, split, isNullOrWhiteSpace, isNullOrEmpty } from "@fable-org/fable-library-js/String.js";
|
|
8
|
+
import { newGuid } from "@fable-org/fable-library-js/Guid.js";
|
|
9
|
+
import { Spec_FormField$1, Spec_FieldType_$union, Shared_FieldValue_$union, Shared_FieldKey, Shared_FieldValue_PluginData, Shared_PluginDataProperty, Shared_PluginPropertyKey, Spec_PluginFieldConfig, Shared_FieldOption, Shared_FieldOptionKey } from "../../../FormSpec.FS/FormSpec.js";
|
|
10
|
+
import { empty as empty_1, tryFind, FSharpList, ofArray } from "@fable-org/fable-library-js/List.js";
|
|
11
|
+
import { item } from "@fable-org/fable-library-js/Array.js";
|
|
12
|
+
import { int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
13
|
+
import { createElement } from "react";
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { reactApi } from "../../../fable_modules/Feliz.2.8.0/Interop.fs.js";
|
|
16
|
+
import { ReactElement } from "../../../fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js";
|
|
17
|
+
import { withLabelAndError } from "../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Html.View.fs.js";
|
|
18
|
+
import { map as map_1, empty, singleton, append, delay, toList } from "@fable-org/fable-library-js/Seq.js";
|
|
19
|
+
import { IStandardField$3_$reflection, IStandardField$3, IField$1, StandardRenderFieldConfig$2 } from "../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Types.fs.js";
|
|
20
|
+
import { FSharpResult$2_$union, FSharpResult$2_Ok, FSharpResult$2_Error } from "@fable-org/fable-library-js/Result.js";
|
|
21
|
+
import { IPluginValueConverter } from "../../../FormSpec.FS/PluginInterface.js";
|
|
22
|
+
import { RenderPreviewProps$1 } from "../../../FormSpec.FS/Interfaces.js";
|
|
23
|
+
import { FieldDetails } from "../../../FormSpec.FS/Designer.js";
|
|
24
|
+
|
|
25
|
+
export class DemographicsField_DemographicsData extends Record implements IEquatable<DemographicsField_DemographicsData>, IComparable<DemographicsField_DemographicsData> {
|
|
26
|
+
readonly FirstName: Option<string>;
|
|
27
|
+
readonly LastName: Option<string>;
|
|
28
|
+
readonly Email: Option<string>;
|
|
29
|
+
readonly Phone: Option<string>;
|
|
30
|
+
readonly DateOfBirth: Option<string>;
|
|
31
|
+
readonly Address: Option<string>;
|
|
32
|
+
readonly MRN: Option<string>;
|
|
33
|
+
readonly Insurance: Option<string>;
|
|
34
|
+
readonly RaceEthnicity: Option<string>;
|
|
35
|
+
readonly EmergencyContact: Option<string>;
|
|
36
|
+
constructor(FirstName: Option<string>, LastName: Option<string>, Email: Option<string>, Phone: Option<string>, DateOfBirth: Option<string>, Address: Option<string>, MRN: Option<string>, Insurance: Option<string>, RaceEthnicity: Option<string>, EmergencyContact: Option<string>) {
|
|
37
|
+
super();
|
|
38
|
+
this.FirstName = FirstName;
|
|
39
|
+
this.LastName = LastName;
|
|
40
|
+
this.Email = Email;
|
|
41
|
+
this.Phone = Phone;
|
|
42
|
+
this.DateOfBirth = DateOfBirth;
|
|
43
|
+
this.Address = Address;
|
|
44
|
+
this.MRN = MRN;
|
|
45
|
+
this.Insurance = Insurance;
|
|
46
|
+
this.RaceEthnicity = RaceEthnicity;
|
|
47
|
+
this.EmergencyContact = EmergencyContact;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function DemographicsField_DemographicsData_$reflection(): TypeInfo {
|
|
52
|
+
return record_type("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.DemographicsData", [], DemographicsField_DemographicsData, () => [["FirstName", option_type(string_type)], ["LastName", option_type(string_type)], ["Email", option_type(string_type)], ["Phone", option_type(string_type)], ["DateOfBirth", option_type(string_type)], ["Address", option_type(string_type)], ["MRN", option_type(string_type)], ["Insurance", option_type(string_type)], ["RaceEthnicity", option_type(string_type)], ["EmergencyContact", option_type(string_type)]]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class DemographicsField_DemographicsConfig extends Record implements IEquatable<DemographicsField_DemographicsConfig>, IComparable<DemographicsField_DemographicsConfig> {
|
|
56
|
+
readonly IncludeName: boolean;
|
|
57
|
+
readonly IncludeEmail: boolean;
|
|
58
|
+
readonly IncludePhone: boolean;
|
|
59
|
+
readonly IncludeDOB: boolean;
|
|
60
|
+
readonly IncludeAddress: boolean;
|
|
61
|
+
readonly IncludeMRN: boolean;
|
|
62
|
+
readonly IncludeInsurance: boolean;
|
|
63
|
+
readonly IncludeRaceEthnicity: boolean;
|
|
64
|
+
readonly IncludeEmergencyContact: boolean;
|
|
65
|
+
readonly MedicalMode: boolean;
|
|
66
|
+
readonly IsRequiredName: boolean;
|
|
67
|
+
readonly IsRequiredEmail: boolean;
|
|
68
|
+
readonly IsRequiredPhone: boolean;
|
|
69
|
+
readonly IsRequiredDOB: boolean;
|
|
70
|
+
readonly IsRequiredAddress: boolean;
|
|
71
|
+
readonly IsRequiredMRN: boolean;
|
|
72
|
+
readonly IsRequiredInsurance: boolean;
|
|
73
|
+
readonly IsRequiredRaceEthnicity: boolean;
|
|
74
|
+
readonly IsRequiredEmergencyContact: boolean;
|
|
75
|
+
constructor(IncludeName: boolean, IncludeEmail: boolean, IncludePhone: boolean, IncludeDOB: boolean, IncludeAddress: boolean, IncludeMRN: boolean, IncludeInsurance: boolean, IncludeRaceEthnicity: boolean, IncludeEmergencyContact: boolean, MedicalMode: boolean, IsRequiredName: boolean, IsRequiredEmail: boolean, IsRequiredPhone: boolean, IsRequiredDOB: boolean, IsRequiredAddress: boolean, IsRequiredMRN: boolean, IsRequiredInsurance: boolean, IsRequiredRaceEthnicity: boolean, IsRequiredEmergencyContact: boolean) {
|
|
76
|
+
super();
|
|
77
|
+
this.IncludeName = IncludeName;
|
|
78
|
+
this.IncludeEmail = IncludeEmail;
|
|
79
|
+
this.IncludePhone = IncludePhone;
|
|
80
|
+
this.IncludeDOB = IncludeDOB;
|
|
81
|
+
this.IncludeAddress = IncludeAddress;
|
|
82
|
+
this.IncludeMRN = IncludeMRN;
|
|
83
|
+
this.IncludeInsurance = IncludeInsurance;
|
|
84
|
+
this.IncludeRaceEthnicity = IncludeRaceEthnicity;
|
|
85
|
+
this.IncludeEmergencyContact = IncludeEmergencyContact;
|
|
86
|
+
this.MedicalMode = MedicalMode;
|
|
87
|
+
this.IsRequiredName = IsRequiredName;
|
|
88
|
+
this.IsRequiredEmail = IsRequiredEmail;
|
|
89
|
+
this.IsRequiredPhone = IsRequiredPhone;
|
|
90
|
+
this.IsRequiredDOB = IsRequiredDOB;
|
|
91
|
+
this.IsRequiredAddress = IsRequiredAddress;
|
|
92
|
+
this.IsRequiredMRN = IsRequiredMRN;
|
|
93
|
+
this.IsRequiredInsurance = IsRequiredInsurance;
|
|
94
|
+
this.IsRequiredRaceEthnicity = IsRequiredRaceEthnicity;
|
|
95
|
+
this.IsRequiredEmergencyContact = IsRequiredEmergencyContact;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function DemographicsField_DemographicsConfig_$reflection(): TypeInfo {
|
|
100
|
+
return record_type("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.DemographicsConfig", [], DemographicsField_DemographicsConfig, () => [["IncludeName", bool_type], ["IncludeEmail", bool_type], ["IncludePhone", bool_type], ["IncludeDOB", bool_type], ["IncludeAddress", bool_type], ["IncludeMRN", bool_type], ["IncludeInsurance", bool_type], ["IncludeRaceEthnicity", bool_type], ["IncludeEmergencyContact", bool_type], ["MedicalMode", bool_type], ["IsRequiredName", bool_type], ["IsRequiredEmail", bool_type], ["IsRequiredPhone", bool_type], ["IsRequiredDOB", bool_type], ["IsRequiredAddress", bool_type], ["IsRequiredMRN", bool_type], ["IsRequiredInsurance", bool_type], ["IsRequiredRaceEthnicity", bool_type], ["IsRequiredEmergencyContact", bool_type]]);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export class DemographicsField_Attributes extends Record implements IEquatable<DemographicsField_Attributes>, IComparable<DemographicsField_Attributes>, IAttributes {
|
|
104
|
+
readonly FieldId: string;
|
|
105
|
+
readonly Label: string;
|
|
106
|
+
readonly Config: DemographicsField_DemographicsConfig;
|
|
107
|
+
constructor(FieldId: string, Label: string, Config: DemographicsField_DemographicsConfig) {
|
|
108
|
+
super();
|
|
109
|
+
this.FieldId = FieldId;
|
|
110
|
+
this.Label = Label;
|
|
111
|
+
this.Config = Config;
|
|
112
|
+
}
|
|
113
|
+
GetFieldId(): string {
|
|
114
|
+
const this$: DemographicsField_Attributes = this;
|
|
115
|
+
return this$.FieldId;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function DemographicsField_Attributes_$reflection(): TypeInfo {
|
|
120
|
+
return record_type("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.Attributes", [], DemographicsField_Attributes, () => [["FieldId", string_type], ["Label", string_type], ["Config", DemographicsField_DemographicsConfig_$reflection()]]);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function DemographicsField_form<Values, Field, Output>(): ((arg0: ((arg0: Field$3<DemographicsField_Attributes, string, Values>) => Field)) => ((arg0: FieldConfig$4<DemographicsField_Attributes, string, Values, Output>) => Form$3<Values, Output, Field>)) {
|
|
124
|
+
return (build: ((arg0: Field$3<DemographicsField_Attributes, string, Values>) => Field)): ((arg0: FieldConfig$4<DemographicsField_Attributes, string, Values, Output>) => Form$3<Values, Output, Field>) => ((config: FieldConfig$4<DemographicsField_Attributes, string, Values, Output>): Form$3<Values, Output, Field> => field_1<string, DemographicsField_Attributes, Values, Field, Output>(isNullOrEmpty, build, config));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const DemographicsField_defaultConfig: DemographicsField_DemographicsConfig = new DemographicsField_DemographicsConfig(true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Encode DemographicsConfig as FieldOption list for FormSpec PluginFieldConfig.Options (designer persistence)
|
|
131
|
+
*/
|
|
132
|
+
export function DemographicsField_configToOptions(config: DemographicsField_DemographicsConfig): FSharpList<Shared_FieldOption> {
|
|
133
|
+
const mk = (desc: string, v: string): Shared_FieldOption => (new Shared_FieldOption(desc, v, new Shared_FieldOptionKey(newGuid()), undefined));
|
|
134
|
+
return ofArray([mk("IncludeName", config.IncludeName ? "true" : "false"), mk("IncludeEmail", config.IncludeEmail ? "true" : "false"), mk("IncludePhone", config.IncludePhone ? "true" : "false"), mk("IncludeDOB", config.IncludeDOB ? "true" : "false"), mk("IncludeAddress", config.IncludeAddress ? "true" : "false"), mk("IncludeMRN", config.IncludeMRN ? "true" : "false"), mk("IncludeInsurance", config.IncludeInsurance ? "true" : "false"), mk("IncludeRaceEthnicity", config.IncludeRaceEthnicity ? "true" : "false"), mk("IncludeEmergencyContact", config.IncludeEmergencyContact ? "true" : "false"), mk("MedicalMode", config.MedicalMode ? "true" : "false"), mk("IsRequiredName", config.IsRequiredName ? "true" : "false"), mk("IsRequiredEmail", config.IsRequiredEmail ? "true" : "false"), mk("IsRequiredPhone", config.IsRequiredPhone ? "true" : "false"), mk("IsRequiredDOB", config.IsRequiredDOB ? "true" : "false"), mk("IsRequiredAddress", config.IsRequiredAddress ? "true" : "false"), mk("IsRequiredMRN", config.IsRequiredMRN ? "true" : "false"), mk("IsRequiredInsurance", config.IsRequiredInsurance ? "true" : "false"), mk("IsRequiredRaceEthnicity", config.IsRequiredRaceEthnicity ? "true" : "false"), mk("IsRequiredEmergencyContact", config.IsRequiredEmergencyContact ? "true" : "false")]);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Decode DemographicsConfig from FieldOption list (from FormSpec PluginFieldConfig.Options)
|
|
139
|
+
*/
|
|
140
|
+
export function DemographicsField_optionsToConfig(options: FSharpList<Shared_FieldOption>): DemographicsField_DemographicsConfig {
|
|
141
|
+
const getFlag = (name: string, defaultVal: boolean): boolean => defaultArg(map<Shared_FieldOption, boolean>((o_1: Shared_FieldOption): boolean => (o_1.Value === "true"), tryFind<Shared_FieldOption>((o: Shared_FieldOption): boolean => (o.Description === name), options)), defaultVal);
|
|
142
|
+
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));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export class DemographicsField_SerializedDemographics extends Record implements IEquatable<DemographicsField_SerializedDemographics>, IComparable<DemographicsField_SerializedDemographics> {
|
|
146
|
+
readonly Data: DemographicsField_DemographicsData;
|
|
147
|
+
readonly MedicalMode: boolean;
|
|
148
|
+
constructor(Data: DemographicsField_DemographicsData, MedicalMode: boolean) {
|
|
149
|
+
super();
|
|
150
|
+
this.Data = Data;
|
|
151
|
+
this.MedicalMode = MedicalMode;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function DemographicsField_SerializedDemographics_$reflection(): TypeInfo {
|
|
156
|
+
return record_type("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.SerializedDemographics", [], DemographicsField_SerializedDemographics, () => [["Data", DemographicsField_DemographicsData_$reflection()], ["MedicalMode", bool_type]]);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function DemographicsField_parseDemographicsData(value: string, medicalMode: boolean): DemographicsField_SerializedDemographics {
|
|
160
|
+
try {
|
|
161
|
+
if (isNullOrWhiteSpace(value)) {
|
|
162
|
+
return new DemographicsField_SerializedDemographics(new DemographicsField_DemographicsData(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined), medicalMode);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const parts: string[] = split(value, ["|"], undefined, 0);
|
|
166
|
+
const medicalModeFromStorage: boolean = ((parts.length > 0) && item(0, parts).startsWith("MEDICAL:")) ? (item(0, parts) === "MEDICAL:true") : medicalMode;
|
|
167
|
+
const offset: int32 = (item(0, parts).startsWith("MEDICAL:") ? 1 : 0) | 0;
|
|
168
|
+
const opt = (i: int32): Option<string> => {
|
|
169
|
+
const idx: int32 = (offset + i) | 0;
|
|
170
|
+
if ((parts.length > idx) && !isNullOrWhiteSpace(item(idx, parts))) {
|
|
171
|
+
return item(idx, parts);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
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);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (matchValue: any) {
|
|
181
|
+
return new DemographicsField_SerializedDemographics(new DemographicsField_DemographicsData(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined), medicalMode);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function DemographicsField_serializeDemographicsData(data: DemographicsField_DemographicsData, medicalMode: boolean): string {
|
|
186
|
+
return ((medicalMode ? "MEDICAL:true" : "MEDICAL:false") + "|") + join("|", [defaultArg(data.FirstName, ""), defaultArg(data.LastName, ""), defaultArg(data.Email, ""), defaultArg(data.Phone, ""), defaultArg(data.DateOfBirth, ""), defaultArg(data.Address, ""), defaultArg(data.MRN, ""), defaultArg(data.Insurance, ""), defaultArg(data.RaceEthnicity, ""), defaultArg(data.EmergencyContact, "")]);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export 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";
|
|
190
|
+
|
|
191
|
+
export function DemographicsField_DemographicsFieldComponent(config: StandardRenderFieldConfig$2<string, DemographicsField_Attributes>): ReactElement {
|
|
192
|
+
let elems_4: Iterable<ReactElement>, elems_3: Iterable<ReactElement>;
|
|
193
|
+
const cfg: DemographicsField_DemographicsConfig = config.Attributes.Config;
|
|
194
|
+
const data: DemographicsField_DemographicsData = DemographicsField_parseDemographicsData(config.Value, cfg.MedicalMode).Data;
|
|
195
|
+
let patternInput: [string, ((arg0: string) => void)];
|
|
196
|
+
const initial: string = defaultArg(data.FirstName, "");
|
|
197
|
+
patternInput = reactApi.useState<string, string>(initial);
|
|
198
|
+
const firstName: string = patternInput[0];
|
|
199
|
+
let patternInput_1: [string, ((arg0: string) => void)];
|
|
200
|
+
const initial_1: string = defaultArg(data.LastName, "");
|
|
201
|
+
patternInput_1 = reactApi.useState<string, string>(initial_1);
|
|
202
|
+
const lastName: string = patternInput_1[0];
|
|
203
|
+
let patternInput_2: [string, ((arg0: string) => void)];
|
|
204
|
+
const initial_2: string = defaultArg(data.Email, "");
|
|
205
|
+
patternInput_2 = reactApi.useState<string, string>(initial_2);
|
|
206
|
+
const email: string = patternInput_2[0];
|
|
207
|
+
let patternInput_3: [string, ((arg0: string) => void)];
|
|
208
|
+
const initial_3: string = defaultArg(data.Phone, "");
|
|
209
|
+
patternInput_3 = reactApi.useState<string, string>(initial_3);
|
|
210
|
+
const phone: string = patternInput_3[0];
|
|
211
|
+
let patternInput_4: [string, ((arg0: string) => void)];
|
|
212
|
+
const initial_4: string = defaultArg(data.DateOfBirth, "");
|
|
213
|
+
patternInput_4 = reactApi.useState<string, string>(initial_4);
|
|
214
|
+
const dob: string = patternInput_4[0];
|
|
215
|
+
let patternInput_5: [string, ((arg0: string) => void)];
|
|
216
|
+
const initial_5: string = defaultArg(data.Address, "");
|
|
217
|
+
patternInput_5 = reactApi.useState<string, string>(initial_5);
|
|
218
|
+
const address: string = patternInput_5[0];
|
|
219
|
+
let patternInput_6: [string, ((arg0: string) => void)];
|
|
220
|
+
const initial_6: string = defaultArg(data.MRN, "");
|
|
221
|
+
patternInput_6 = reactApi.useState<string, string>(initial_6);
|
|
222
|
+
const mrn: string = patternInput_6[0];
|
|
223
|
+
let patternInput_7: [string, ((arg0: string) => void)];
|
|
224
|
+
const initial_7: string = defaultArg(data.Insurance, "");
|
|
225
|
+
patternInput_7 = reactApi.useState<string, string>(initial_7);
|
|
226
|
+
const insurance: string = patternInput_7[0];
|
|
227
|
+
let patternInput_8: [string, ((arg0: string) => void)];
|
|
228
|
+
const initial_8: string = defaultArg(data.RaceEthnicity, "");
|
|
229
|
+
patternInput_8 = reactApi.useState<string, string>(initial_8);
|
|
230
|
+
const raceEthnicity: string = patternInput_8[0];
|
|
231
|
+
let patternInput_9: [string, ((arg0: string) => void)];
|
|
232
|
+
const initial_9: string = defaultArg(data.EmergencyContact, "");
|
|
233
|
+
patternInput_9 = reactApi.useState<string, string>(initial_9);
|
|
234
|
+
const emergencyContact: string = patternInput_9[0];
|
|
235
|
+
const dependencies: any[] = [firstName, lastName, email, phone, dob, address, mrn, insurance, raceEthnicity, emergencyContact];
|
|
236
|
+
reactApi.useEffect((): void => {
|
|
237
|
+
config.OnChange(DemographicsField_serializeDemographicsData(new DemographicsField_DemographicsData(isNullOrWhiteSpace(firstName) ? undefined : firstName, isNullOrWhiteSpace(lastName) ? undefined : lastName, isNullOrWhiteSpace(email) ? undefined : email, isNullOrWhiteSpace(phone) ? undefined : phone, isNullOrWhiteSpace(dob) ? undefined : dob, isNullOrWhiteSpace(address) ? undefined : address, isNullOrWhiteSpace(mrn) ? undefined : mrn, isNullOrWhiteSpace(insurance) ? undefined : insurance, isNullOrWhiteSpace(raceEthnicity) ? undefined : raceEthnicity, isNullOrWhiteSpace(emergencyContact) ? undefined : emergencyContact), cfg.MedicalMode));
|
|
238
|
+
}, dependencies);
|
|
239
|
+
const field = (label: string, value_10: string, setValue: ((arg0: string) => void), placeholder: string, isRequired: boolean): ReactElement => {
|
|
240
|
+
let elems: Iterable<ReactElement>;
|
|
241
|
+
return createElement<any>("div", createObj(ofArray([["className", "space-y-1"] as [string, any], (elems = [createElement<any>("label", {
|
|
242
|
+
className: "block text-xs font-medium text-slate-700",
|
|
243
|
+
children: isRequired ? (label + " *") : label,
|
|
244
|
+
}), createElement<any>("input", {
|
|
245
|
+
type: "text",
|
|
246
|
+
className: DemographicsField_inputClass,
|
|
247
|
+
value: value_10,
|
|
248
|
+
placeholder: placeholder,
|
|
249
|
+
disabled: config.Disabled ? true : config.IsReadOnly,
|
|
250
|
+
onChange: (ev: Event): void => {
|
|
251
|
+
setValue(ev.target.value);
|
|
252
|
+
},
|
|
253
|
+
})], ["children", reactApi.Children.toArray(Array.from(elems))] as [string, any])])));
|
|
254
|
+
};
|
|
255
|
+
return withLabelAndError(config.Attributes.Label, config.ShowError, config.Error, createElement<any>("div", createObj(ofArray([["className", "space-y-4"] as [string, any], (elems_4 = [createElement<any>("div", createObj(ofArray([["className", "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:gap-6"] as [string, any], (elems_3 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => {
|
|
256
|
+
let elems_1: Iterable<ReactElement>;
|
|
257
|
+
return append<ReactElement>(cfg.IncludeName ? singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "space-y-4 sm:col-span-2 sm:grid sm:grid-cols-2 sm:gap-4"] as [string, any], (elems_1 = [field("First name", firstName, patternInput[1], "First name", cfg.IsRequiredName), field("Last name", lastName, patternInput_1[1], "Last name", cfg.IsRequiredName)], ["children", reactApi.Children.toArray(Array.from(elems_1))] as [string, any])])))) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(cfg.IncludeEmail ? singleton<ReactElement>(field("Email", email, patternInput_2[1], "email@example.com", cfg.IsRequiredEmail)) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(cfg.IncludePhone ? singleton<ReactElement>(field("Phone", phone, patternInput_3[1], "Phone number", cfg.IsRequiredPhone)) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(cfg.IncludeDOB ? singleton<ReactElement>(field("Date of birth", dob, patternInput_4[1], "YYYY-MM-DD", cfg.IsRequiredDOB)) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => {
|
|
258
|
+
let elems_2: Iterable<ReactElement>;
|
|
259
|
+
return append<ReactElement>(cfg.IncludeAddress ? singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "sm:col-span-2"] as [string, any], (elems_2 = [field("Address", address, patternInput_5[1], "Street, city, state, zip", cfg.IsRequiredAddress)], ["children", reactApi.Children.toArray(Array.from(elems_2))] as [string, any])])))) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>((cfg.MedicalMode && cfg.IncludeMRN) ? singleton<ReactElement>(field("MRN", mrn, patternInput_6[1], "Medical record number", cfg.IsRequiredMRN)) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>((cfg.MedicalMode && cfg.IncludeInsurance) ? singleton<ReactElement>(field("Insurance", insurance, patternInput_7[1], "Insurance provider", cfg.IsRequiredInsurance)) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>((cfg.MedicalMode && cfg.IncludeRaceEthnicity) ? singleton<ReactElement>(field("Race / Ethnicity", raceEthnicity, patternInput_8[1], "Race or ethnicity", cfg.IsRequiredRaceEthnicity)) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => (cfg.IncludeEmergencyContact ? singleton<ReactElement>(field("Emergency contact", emergencyContact, patternInput_9[1], "Name and phone", cfg.IsRequiredEmergencyContact)) : empty<ReactElement>())))))))));
|
|
260
|
+
}))))))));
|
|
261
|
+
})), ["children", reactApi.Children.toArray(Array.from(elems_3))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_4))] as [string, any])]))));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export class DemographicsField_Field$1<Values> extends IStandardField$3<Values, string, DemographicsField_Attributes> implements IField$1<Values> {
|
|
265
|
+
readonly innerField_1: Field$3<DemographicsField_Attributes, string, Values>;
|
|
266
|
+
constructor(innerField: Field$3<DemographicsField_Attributes, string, Values>) {
|
|
267
|
+
super(innerField);
|
|
268
|
+
this.innerField_1 = innerField;
|
|
269
|
+
}
|
|
270
|
+
"Fable.Form.Simple.Bulma.IStandardField`3.RenderFieldZ43FEF6DC"(config: StandardRenderFieldConfig$2<string, DemographicsField_Attributes>): ReactElement {
|
|
271
|
+
return createElement(DemographicsField_DemographicsFieldComponent, config);
|
|
272
|
+
}
|
|
273
|
+
MapFieldValues<NewValues>(update: ((arg0: Values) => $a)): IField$1<$a> {
|
|
274
|
+
const _: DemographicsField_Field$1<Values> = this;
|
|
275
|
+
return DemographicsField_Field$1_$ctor_Z3F5C7C07<$a>(mapValues<Values, $a, DemographicsField_Attributes, string>(update, _.innerField_1));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export function DemographicsField_Field$1_$reflection(gen0: TypeInfo): TypeInfo {
|
|
280
|
+
return class_type("Fable.Form.Simple.Bulma.Fields.DemographicsField.DemographicsField.Field`1", [gen0], DemographicsField_Field$1, IStandardField$3_$reflection(gen0, string_type, DemographicsField_Attributes_$reflection()));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function DemographicsField_Field$1_$ctor_Z3F5C7C07<Values>(innerField: Field$3<DemographicsField_Attributes, string, Values>): DemographicsField_Field$1<Values> {
|
|
284
|
+
return new DemographicsField_Field$1(innerField);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export function Form_demographicsField<Values, Output>(config: FieldConfig$4<DemographicsField_Attributes, string, Values, Output>): Form$3<Values, Output, IField$1<Values>> {
|
|
288
|
+
return DemographicsField_form<Values, IField$1<Values>, Output>()(DemographicsField_Field$1_$ctor_Z3F5C7C07)(config);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export const Form_pluginConfig: Spec_PluginFieldConfig = new Spec_PluginFieldConfig("Fable.Form.Simple.Bulma.Fields.DemographicsField", undefined, undefined);
|
|
292
|
+
|
|
293
|
+
export const Form_PropertyKeys_IsMedicalField: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0001-4000-8000-000000000001");
|
|
294
|
+
|
|
295
|
+
export const Form_PropertyKeys_FirstName: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0002-4000-8000-000000000001");
|
|
296
|
+
|
|
297
|
+
export const Form_PropertyKeys_LastName: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0003-4000-8000-000000000001");
|
|
298
|
+
|
|
299
|
+
export const Form_PropertyKeys_Email: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0004-4000-8000-000000000001");
|
|
300
|
+
|
|
301
|
+
export const Form_PropertyKeys_Phone: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0005-4000-8000-000000000001");
|
|
302
|
+
|
|
303
|
+
export const Form_PropertyKeys_DateOfBirth: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0006-4000-8000-000000000001");
|
|
304
|
+
|
|
305
|
+
export const Form_PropertyKeys_Address: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0007-4000-8000-000000000001");
|
|
306
|
+
|
|
307
|
+
export const Form_PropertyKeys_MRN: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0008-4000-8000-000000000001");
|
|
308
|
+
|
|
309
|
+
export const Form_PropertyKeys_Insurance: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-0009-4000-8000-000000000001");
|
|
310
|
+
|
|
311
|
+
export const Form_PropertyKeys_RaceEthnicity: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-000a-4000-8000-000000000001");
|
|
312
|
+
|
|
313
|
+
export const Form_PropertyKeys_EmergencyContact: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("d0e0f0a0-000b-4000-8000-000000000001");
|
|
314
|
+
|
|
315
|
+
export function Form_isMedicalFieldProp(medicalMode: boolean): Shared_PluginDataProperty {
|
|
316
|
+
return new 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)");
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export const Form_enhancedDemographicsConverter: IPluginValueConverter = new IPluginValueConverter((fieldKey: Shared_FieldKey, pluginValue: any): Option<Shared_FieldValue_$union> => {
|
|
320
|
+
const data: DemographicsField_DemographicsData = pluginValue;
|
|
321
|
+
const cfg: DemographicsField_DemographicsConfig = DemographicsField_defaultConfig;
|
|
322
|
+
const props: Shared_PluginDataProperty[] = [];
|
|
323
|
+
void (props.push(Form_isMedicalFieldProp(cfg.MedicalMode)));
|
|
324
|
+
if (cfg.IncludeName && (data.FirstName != null)) {
|
|
325
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", value_40(data.FirstName), "First Name", undefined, undefined)));
|
|
326
|
+
}
|
|
327
|
+
if (cfg.IncludeName && (data.LastName != null)) {
|
|
328
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", value_40(data.LastName), "Last Name", undefined, undefined)));
|
|
329
|
+
}
|
|
330
|
+
if (cfg.IncludeEmail && (data.Email != null)) {
|
|
331
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", value_40(data.Email), "Email", undefined, undefined)));
|
|
332
|
+
}
|
|
333
|
+
if (cfg.IncludePhone && (data.Phone != null)) {
|
|
334
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", value_40(data.Phone), "Phone", undefined, undefined)));
|
|
335
|
+
}
|
|
336
|
+
if (cfg.IncludeDOB && (data.DateOfBirth != null)) {
|
|
337
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", value_40(data.DateOfBirth), "Date of Birth", undefined, undefined)));
|
|
338
|
+
}
|
|
339
|
+
if (cfg.IncludeAddress && (data.Address != null)) {
|
|
340
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", value_40(data.Address), "Address", undefined, undefined)));
|
|
341
|
+
}
|
|
342
|
+
if ((cfg.MedicalMode && cfg.IncludeMRN) && (data.MRN != null)) {
|
|
343
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", value_40(data.MRN), "MRN", undefined, undefined)));
|
|
344
|
+
}
|
|
345
|
+
if ((cfg.MedicalMode && cfg.IncludeInsurance) && (data.Insurance != null)) {
|
|
346
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", value_40(data.Insurance), "Insurance", undefined, undefined)));
|
|
347
|
+
}
|
|
348
|
+
if ((cfg.MedicalMode && cfg.IncludeRaceEthnicity) && (data.RaceEthnicity != null)) {
|
|
349
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", value_40(data.RaceEthnicity), "Race / Ethnicity", undefined, undefined)));
|
|
350
|
+
}
|
|
351
|
+
if (cfg.IncludeEmergencyContact && (data.EmergencyContact != null)) {
|
|
352
|
+
void (props.push(new Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", value_40(data.EmergencyContact), "Emergency Contact", undefined, undefined)));
|
|
353
|
+
}
|
|
354
|
+
return Shared_FieldValue_PluginData(toList<Shared_PluginDataProperty>(props));
|
|
355
|
+
}, (fieldValue: Shared_FieldValue_$union): Option<any> => {
|
|
356
|
+
switch (fieldValue.tag) {
|
|
357
|
+
case /* PluginData */ 3: {
|
|
358
|
+
const properties: FSharpList<Shared_PluginDataProperty> = fieldValue.fields[0];
|
|
359
|
+
const getVal = (name: string): Option<string> => filter<string>((v: string): boolean => !isNullOrWhiteSpace(v), map<Shared_PluginDataProperty, string>((p_1: Shared_PluginDataProperty): string => p_1.Value, tryFind<Shared_PluginDataProperty>((p: Shared_PluginDataProperty): boolean => (p.Name === name), properties)));
|
|
360
|
+
return 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")));
|
|
361
|
+
}
|
|
362
|
+
case /* Single */ 0:
|
|
363
|
+
return some(DemographicsField_parseDemographicsData(fieldValue.fields[0].Value, false).Data);
|
|
364
|
+
default:
|
|
365
|
+
return undefined;
|
|
366
|
+
}
|
|
367
|
+
}, (): Option<FSharpList<Shared_FieldOption>> => undefined, (): FSharpList<string> => ofArray(["is_medical_field", "first_name", "last_name", "email", "phone", "date_of_birth", "address", "mrn", "insurance", "race_ethnicity", "emergency_contact"]), (propertyName: string): Option<Shared_PluginDataProperty> => {
|
|
368
|
+
const meta = (pk: Shared_PluginPropertyKey, name_1: string, dt: string, disp: string): Option<Shared_PluginDataProperty> => (new Shared_PluginDataProperty(pk, name_1, dt, "", disp, undefined, undefined));
|
|
369
|
+
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))))))))));
|
|
370
|
+
}, (propertyKey: Shared_PluginPropertyKey): Option<Shared_PluginDataProperty> => map<[Shared_PluginPropertyKey, [string, string, string]], Shared_PluginDataProperty>((tupledArg_1: [Shared_PluginPropertyKey, [string, string, string]]): Shared_PluginDataProperty => {
|
|
371
|
+
const _arg_1: [string, string, string] = tupledArg_1[1];
|
|
372
|
+
return new Shared_PluginDataProperty(tupledArg_1[0], _arg_1[0], _arg_1[1], "", _arg_1[2], undefined, undefined);
|
|
373
|
+
}, tryFind<[Shared_PluginPropertyKey, [string, string, string]]>((tupledArg: [Shared_PluginPropertyKey, [string, string, string]]): boolean => equals(tupledArg[0], propertyKey), ofArray([[Form_PropertyKeys_IsMedicalField, ["is_medical_field", "bool", "Is Medical Field"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_FirstName, ["first_name", "string", "First Name"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_LastName, ["last_name", "string", "Last Name"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_Email, ["email", "string", "Email"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_Phone, ["phone", "string", "Phone"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_DateOfBirth, ["date_of_birth", "datetime", "Date of Birth"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_Address, ["address", "string", "Address"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_MRN, ["mrn", "string", "MRN"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_Insurance, ["insurance", "string", "Insurance"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_RaceEthnicity, ["race_ethnicity", "string", "Race / Ethnicity"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]], [Form_PropertyKeys_EmergencyContact, ["emergency_contact", "string", "Emergency Contact"] as [string, string, string]] as [Shared_PluginPropertyKey, [string, string, string]]]))), (propertyName_1: string, fieldValue_1: Shared_FieldValue_$union): Option<Shared_PluginDataProperty> => {
|
|
374
|
+
switch (fieldValue_1.tag) {
|
|
375
|
+
case /* PluginData */ 3:
|
|
376
|
+
return tryFind<Shared_PluginDataProperty>((p_2: Shared_PluginDataProperty): boolean => (p_2.Name === propertyName_1), fieldValue_1.fields[0]);
|
|
377
|
+
case /* Single */ 0: {
|
|
378
|
+
const parsed_1: DemographicsField_SerializedDemographics = DemographicsField_parseDemographicsData(fieldValue_1.fields[0].Value, false);
|
|
379
|
+
const data_1: DemographicsField_DemographicsData = parsed_1.Data;
|
|
380
|
+
return (propertyName_1 === "is_medical_field") ? Form_isMedicalFieldProp(parsed_1.MedicalMode) : ((propertyName_1 === "first_name") ? map<string, Shared_PluginDataProperty>((v_1: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", v_1, "First Name", undefined, undefined)), data_1.FirstName) : ((propertyName_1 === "last_name") ? map<string, Shared_PluginDataProperty>((v_2: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", v_2, "Last Name", undefined, undefined)), data_1.LastName) : ((propertyName_1 === "email") ? map<string, Shared_PluginDataProperty>((v_3: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", v_3, "Email", undefined, undefined)), data_1.Email) : ((propertyName_1 === "phone") ? map<string, Shared_PluginDataProperty>((v_4: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", v_4, "Phone", undefined, undefined)), data_1.Phone) : ((propertyName_1 === "date_of_birth") ? map<string, Shared_PluginDataProperty>((v_5: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", v_5, "Date of Birth", undefined, undefined)), data_1.DateOfBirth) : ((propertyName_1 === "address") ? map<string, Shared_PluginDataProperty>((v_6: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", v_6, "Address", undefined, undefined)), data_1.Address) : ((propertyName_1 === "mrn") ? map<string, Shared_PluginDataProperty>((v_7: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", v_7, "MRN", undefined, undefined)), data_1.MRN) : ((propertyName_1 === "insurance") ? map<string, Shared_PluginDataProperty>((v_8: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", v_8, "Insurance", undefined, undefined)), data_1.Insurance) : ((propertyName_1 === "race_ethnicity") ? map<string, Shared_PluginDataProperty>((v_9: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", v_9, "Race / Ethnicity", undefined, undefined)), data_1.RaceEthnicity) : ((propertyName_1 === "emergency_contact") ? map<string, Shared_PluginDataProperty>((v_10: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", v_10, "Emergency Contact", undefined, undefined)), data_1.EmergencyContact) : undefined))))))))));
|
|
381
|
+
}
|
|
382
|
+
default:
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
}, (propertyKey_1: Shared_PluginPropertyKey, fieldValue_2: Shared_FieldValue_$union): Option<Shared_PluginDataProperty> => {
|
|
386
|
+
switch (fieldValue_2.tag) {
|
|
387
|
+
case /* PluginData */ 3:
|
|
388
|
+
return tryFind<Shared_PluginDataProperty>((p_3: Shared_PluginDataProperty): boolean => equals(p_3.PropertyKey, propertyKey_1), fieldValue_2.fields[0]);
|
|
389
|
+
case /* Single */ 0: {
|
|
390
|
+
const parsed_2: DemographicsField_SerializedDemographics = DemographicsField_parseDemographicsData(fieldValue_2.fields[0].Value, false);
|
|
391
|
+
const data_2: DemographicsField_DemographicsData = parsed_2.Data;
|
|
392
|
+
return equals(propertyKey_1, Form_PropertyKeys_IsMedicalField) ? Form_isMedicalFieldProp(parsed_2.MedicalMode) : (equals(propertyKey_1, Form_PropertyKeys_FirstName) ? map<string, Shared_PluginDataProperty>((v_11: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", v_11, "First Name", undefined, undefined)), data_2.FirstName) : (equals(propertyKey_1, Form_PropertyKeys_LastName) ? map<string, Shared_PluginDataProperty>((v_12: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", v_12, "Last Name", undefined, undefined)), data_2.LastName) : (equals(propertyKey_1, Form_PropertyKeys_Email) ? map<string, Shared_PluginDataProperty>((v_13: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", v_13, "Email", undefined, undefined)), data_2.Email) : (equals(propertyKey_1, Form_PropertyKeys_Phone) ? map<string, Shared_PluginDataProperty>((v_14: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", v_14, "Phone", undefined, undefined)), data_2.Phone) : (equals(propertyKey_1, Form_PropertyKeys_DateOfBirth) ? map<string, Shared_PluginDataProperty>((v_15: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", v_15, "Date of Birth", undefined, undefined)), data_2.DateOfBirth) : (equals(propertyKey_1, Form_PropertyKeys_Address) ? map<string, Shared_PluginDataProperty>((v_16: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", v_16, "Address", undefined, undefined)), data_2.Address) : (equals(propertyKey_1, Form_PropertyKeys_MRN) ? map<string, Shared_PluginDataProperty>((v_17: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", v_17, "MRN", undefined, undefined)), data_2.MRN) : (equals(propertyKey_1, Form_PropertyKeys_Insurance) ? map<string, Shared_PluginDataProperty>((v_18: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", v_18, "Insurance", undefined, undefined)), data_2.Insurance) : (equals(propertyKey_1, Form_PropertyKeys_RaceEthnicity) ? map<string, Shared_PluginDataProperty>((v_19: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", v_19, "Race / Ethnicity", undefined, undefined)), data_2.RaceEthnicity) : (equals(propertyKey_1, Form_PropertyKeys_EmergencyContact) ? map<string, Shared_PluginDataProperty>((v_20: string): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", v_20, "Emergency Contact", undefined, undefined)), data_2.EmergencyContact) : undefined))))))))));
|
|
393
|
+
}
|
|
394
|
+
default:
|
|
395
|
+
return undefined;
|
|
396
|
+
}
|
|
397
|
+
}, (propertyName_2: string, value: string): FSharpResult$2_$union<void, string> => ((propertyName_2 === "is_medical_field") ? FSharpResult$2_Error<void, string>("is_medical_field is derived from MedicalMode and cannot be set directly") : FSharpResult$2_Ok<void, string>(undefined)), (fieldValue_3: Shared_FieldValue_$union): FSharpList<Shared_PluginDataProperty> => {
|
|
398
|
+
switch (fieldValue_3.tag) {
|
|
399
|
+
case /* PluginData */ 3:
|
|
400
|
+
return fieldValue_3.fields[0];
|
|
401
|
+
case /* Single */ 0: {
|
|
402
|
+
const parsed_3: DemographicsField_SerializedDemographics = DemographicsField_parseDemographicsData(fieldValue_3.fields[0].Value, false);
|
|
403
|
+
const data_3: DemographicsField_DemographicsData = parsed_3.Data;
|
|
404
|
+
const props_1: Shared_PluginDataProperty[] = [];
|
|
405
|
+
void (props_1.push(Form_isMedicalFieldProp(parsed_3.MedicalMode)));
|
|
406
|
+
if (data_3.FirstName != null) {
|
|
407
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_FirstName, "first_name", "string", value_40(data_3.FirstName), "First Name", undefined, undefined)));
|
|
408
|
+
}
|
|
409
|
+
if (data_3.LastName != null) {
|
|
410
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_LastName, "last_name", "string", value_40(data_3.LastName), "Last Name", undefined, undefined)));
|
|
411
|
+
}
|
|
412
|
+
if (data_3.Email != null) {
|
|
413
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_Email, "email", "string", value_40(data_3.Email), "Email", undefined, undefined)));
|
|
414
|
+
}
|
|
415
|
+
if (data_3.Phone != null) {
|
|
416
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_Phone, "phone", "string", value_40(data_3.Phone), "Phone", undefined, undefined)));
|
|
417
|
+
}
|
|
418
|
+
if (data_3.DateOfBirth != null) {
|
|
419
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_DateOfBirth, "date_of_birth", "datetime", value_40(data_3.DateOfBirth), "Date of Birth", undefined, undefined)));
|
|
420
|
+
}
|
|
421
|
+
if (data_3.Address != null) {
|
|
422
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_Address, "address", "string", value_40(data_3.Address), "Address", undefined, undefined)));
|
|
423
|
+
}
|
|
424
|
+
if (parsed_3.MedicalMode && (data_3.MRN != null)) {
|
|
425
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_MRN, "mrn", "string", value_40(data_3.MRN), "MRN", undefined, undefined)));
|
|
426
|
+
}
|
|
427
|
+
if (parsed_3.MedicalMode && (data_3.Insurance != null)) {
|
|
428
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_Insurance, "insurance", "string", value_40(data_3.Insurance), "Insurance", undefined, undefined)));
|
|
429
|
+
}
|
|
430
|
+
if (parsed_3.MedicalMode && (data_3.RaceEthnicity != null)) {
|
|
431
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_RaceEthnicity, "race_ethnicity", "string", value_40(data_3.RaceEthnicity), "Race / Ethnicity", undefined, undefined)));
|
|
432
|
+
}
|
|
433
|
+
if (data_3.EmergencyContact != null) {
|
|
434
|
+
void (props_1.push(new Shared_PluginDataProperty(Form_PropertyKeys_EmergencyContact, "emergency_contact", "string", value_40(data_3.EmergencyContact), "Emergency Contact", undefined, undefined)));
|
|
435
|
+
}
|
|
436
|
+
return toList<Shared_PluginDataProperty>(props_1);
|
|
437
|
+
}
|
|
438
|
+
default:
|
|
439
|
+
return empty_1<Shared_PluginDataProperty>();
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
export function Form_designerPreview(props: RenderPreviewProps$1<Spec_FieldType_$union>): ReactElement {
|
|
444
|
+
let value: string, elems_2: Iterable<ReactElement>, elems: Iterable<ReactElement>, elems_1: Iterable<ReactElement>;
|
|
445
|
+
return createElement<any>("div", createObj(ofArray([(value = "flex items-center justify-between rounded-lg border border-dashed border-gray-300 bg-gray-50/80 px-3 py-2", ["className", value] as [string, any]), (elems_2 = [createElement<any>("div", createObj(ofArray([["className", "flex flex-col gap-0.5"] as [string, any], (elems = [createElement<any>("span", {
|
|
446
|
+
className: "text-sm font-semibold text-gray-800",
|
|
447
|
+
children: "Demographics",
|
|
448
|
+
}), createElement<any>("span", {
|
|
449
|
+
className: "text-xs text-gray-500",
|
|
450
|
+
children: "Name, contact, DOB, and optional medical fields",
|
|
451
|
+
})], ["children", reactApi.Children.toArray(Array.from(elems))] as [string, any])]))), createElement<any>("div", createObj(ofArray([["className", "flex items-center gap-2 text-gray-400"] as [string, any], (elems_1 = [createElement<any>("span", {
|
|
452
|
+
className: "text-base",
|
|
453
|
+
children: "👤",
|
|
454
|
+
}), createElement<any>("span", {
|
|
455
|
+
className: "w-1.5 h-1.5 rounded-full bg-red-400 shrink-0",
|
|
456
|
+
}), createElement<any>("span", {
|
|
457
|
+
className: "text-xs",
|
|
458
|
+
children: "🔗",
|
|
459
|
+
})], ["children", reactApi.Children.toArray(Array.from(elems_1))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_2))] as [string, any])])));
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export function Form_markdownRenderer(field: Spec_FormField$1<Spec_FieldType_$union>, fieldDetails: FieldDetails): string {
|
|
463
|
+
let value: string;
|
|
464
|
+
const matchValue: Shared_FieldValue_$union = fieldDetails.FieldValue;
|
|
465
|
+
value = ((matchValue.tag === /* Single */ 0) ? matchValue.fields[0].Value : "");
|
|
466
|
+
if (isNullOrWhiteSpace(value)) {
|
|
467
|
+
return `**${field.Label}:** *[No demographics recorded]*`;
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
try {
|
|
471
|
+
const data: DemographicsField_DemographicsData = DemographicsField_parseDemographicsData(value, false).Data;
|
|
472
|
+
const parts: string[] = [];
|
|
473
|
+
if (data.FirstName != null) {
|
|
474
|
+
const lastNameStr: string = defaultArg(data.LastName, "");
|
|
475
|
+
void (parts.push((`Name: ${value_40(data.FirstName)} ${lastNameStr}`).trim()));
|
|
476
|
+
}
|
|
477
|
+
if (data.Email != null) {
|
|
478
|
+
void (parts.push(`Email: ${value_40(data.Email)}`));
|
|
479
|
+
}
|
|
480
|
+
if (data.Phone != null) {
|
|
481
|
+
void (parts.push(`Phone: ${value_40(data.Phone)}`));
|
|
482
|
+
}
|
|
483
|
+
if (data.DateOfBirth != null) {
|
|
484
|
+
void (parts.push(`DOB: ${value_40(data.DateOfBirth)}`));
|
|
485
|
+
}
|
|
486
|
+
if (data.Address != null) {
|
|
487
|
+
void (parts.push(`Address: ${value_40(data.Address)}`));
|
|
488
|
+
}
|
|
489
|
+
if (data.MRN != null) {
|
|
490
|
+
void (parts.push(`MRN: ${value_40(data.MRN)}`));
|
|
491
|
+
}
|
|
492
|
+
return (parts.length > 0) ? ((`**${field.Label}**
|
|
493
|
+
|
|
494
|
+
`) + join("\n", map_1<string, string>((p: string): string => ("- " + p), parts))) : (`**${field.Label}:** *[No demographics recorded]*`);
|
|
495
|
+
}
|
|
496
|
+
catch (ex: any) {
|
|
497
|
+
return `**${field.Label}:** *[Error: ${ex.message}]*`;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
//# sourceMappingURL=DemographicsField.ts.map
|
|
@@ -480,7 +480,7 @@ export function Form_markdownRenderer(field: Spec_FormField$1<Spec_FieldType_$un
|
|
|
480
480
|
else {
|
|
481
481
|
let patternInput: [FSharpList<Shared_FieldOption>, FSharpList<Shared_FieldOption>];
|
|
482
482
|
const matchValue_2: Spec_FieldType_$union = field.FieldType;
|
|
483
|
-
if (matchValue_2.tag === /* PluginField */
|
|
483
|
+
if (matchValue_2.tag === /* PluginField */ 23) {
|
|
484
484
|
const cfg: Spec_PluginFieldConfig = matchValue_2.fields[0];
|
|
485
485
|
patternInput = ([defaultArg(cfg.Items, empty_1<Shared_FieldOption>()), defaultArg(cfg.Options, empty_1<Shared_FieldOption>())] as [FSharpList<Shared_FieldOption>, FSharpList<Shared_FieldOption>]);
|
|
486
486
|
}
|