@f1studio/form-spec 5.0.0-alpha.139 → 5.0.0-alpha.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/FormSpec.FS/FormSpec.d.ts +5 -4
  2. package/FormSpec.FS/FormSpec.d.ts.map +1 -1
  3. package/FormSpec.FS/FormSpecValues.d.ts +0 -5
  4. package/FormSpec.FS/FormSpecValues.d.ts.map +1 -1
  5. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts +3 -2
  6. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts.map +1 -1
  7. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -1
  8. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
  9. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +1 -1
  10. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
  11. package/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.d.ts +74 -0
  12. package/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.d.ts.map +1 -0
  13. package/FormSpec.FS/Interop/Facade/BlueprintFilledForm.d.ts +106 -0
  14. package/FormSpec.FS/Interop/Facade/BlueprintFilledForm.d.ts.map +1 -0
  15. package/FormSpec.FS/Interop/Facade/FormAnswersGate.d.ts +105 -0
  16. package/FormSpec.FS/Interop/Facade/FormAnswersGate.d.ts.map +1 -0
  17. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +26 -13
  18. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  19. package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +1 -2
  20. package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
  21. package/FormSpec.FS/Interop/FormSpec.Values.Api.Option.d.ts +5 -3
  22. package/FormSpec.FS/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -1
  23. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +1 -1
  24. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -1
  25. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -1
  26. package/FormSpec.TS/FormSpec.FS/Designer.js +1 -1
  27. package/FormSpec.TS/FormSpec.FS/Designer.js.map +1 -1
  28. package/FormSpec.TS/FormSpec.FS/Designer.ts.map +1 -1
  29. package/FormSpec.TS/FormSpec.FS/FormSpec.js +13 -8
  30. package/FormSpec.TS/FormSpec.FS/FormSpec.js.map +1 -1
  31. package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +1 -1
  32. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +5 -5
  33. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
  34. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
  35. package/FormSpec.TS/FormSpec.FS/FormSpecValues.js +2 -21
  36. package/FormSpec.TS/FormSpec.FS/FormSpecValues.js.map +1 -1
  37. package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +1 -1
  38. package/FormSpec.TS/FormSpec.FS/Helpers.js +12 -12
  39. package/FormSpec.TS/FormSpec.FS/Helpers.js.map +1 -1
  40. package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +1 -1
  41. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +36 -30
  42. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -1
  43. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +1 -1
  44. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +5 -20
  45. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -1
  46. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +1 -1
  47. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js +1 -1
  48. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js.map +1 -1
  49. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts.map +1 -1
  50. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +1 -1
  51. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
  52. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -1
  53. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +24 -10
  54. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
  55. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
  56. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +1 -1
  57. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
  58. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -1
  59. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +2 -2
  60. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +1 -1
  61. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
  62. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +1 -1
  63. package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.js +282 -0
  64. package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.js.map +1 -0
  65. package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.ts.map +1 -0
  66. package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.js +184 -0
  67. package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.js.map +1 -0
  68. package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.ts.map +1 -0
  69. package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.js +752 -0
  70. package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.js.map +1 -0
  71. package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.ts.map +1 -0
  72. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +317 -81
  73. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  74. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
  75. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +5 -10
  76. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
  77. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
  78. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js +20 -10
  79. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
  80. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
  81. package/FormSpec.TS/FormSpec.FS/Migrator.js +1 -1
  82. package/FormSpec.TS/FormSpec.FS/Migrator.js.map +1 -1
  83. package/FormSpec.TS/FormSpec.FS/Migrator.ts.map +1 -1
  84. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js +3 -3
  85. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js.map +1 -1
  86. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +1 -1
  87. package/FormSpec.TS/FormSpec.FS/PathwayValidator.js +1 -1
  88. package/FormSpec.TS/FormSpec.FS/PathwayValidator.js.map +1 -1
  89. package/FormSpec.TS/FormSpec.FS/PathwayValidator.ts.map +1 -1
  90. package/FormSpec.TS/PluginRegistration.js +2 -0
  91. package/FormSpec.TS/PluginRegistration.js.map +1 -1
  92. package/FormSpec.TS/PluginRegistration.ts.map +1 -1
  93. package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Decode.js +63 -69
  94. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js.map +1 -0
  95. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +1 -0
  96. package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Encode.js +6 -10
  97. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -0
  98. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +1 -0
  99. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.js.map +1 -0
  100. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.ts.map +1 -0
  101. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.js.map +1 -0
  102. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.ts.map +1 -0
  103. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
  104. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +119 -0
  105. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +1 -0
  106. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.ts.map +1 -0
  107. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
  108. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
  109. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +165 -0
  110. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +1 -0
  111. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.ts.map +1 -0
  112. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
  113. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +32 -0
  114. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +1 -0
  115. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.ts.map +1 -0
  116. package/FormSpec.TS/fable_modules/Feliz.2.8.0/DateParsing.fs.js.map +1 -1
  117. package/FormSpec.TS/fable_modules/Feliz.2.8.0/DateParsing.fs.ts.map +1 -1
  118. package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
  119. package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.js +2431 -0
  120. package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.js.map +1 -0
  121. package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.ts.map +1 -0
  122. package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.js +107 -0
  123. package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.js.map +1 -0
  124. package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.ts.map +1 -0
  125. package/FormSpec.TS/plugins/signature/src/SignatureField.js +1 -1
  126. package/FormSpec.TS/plugins/signature/src/SignatureField.js.map +1 -1
  127. package/FormSpec.TS/plugins/signature/src/SignatureField.ts.map +1 -1
  128. package/FormSpec.TS/plugins/vitals/src/VitalsField.js +29 -312
  129. package/FormSpec.TS/plugins/vitals/src/VitalsField.js.map +1 -1
  130. package/FormSpec.TS/plugins/vitals/src/VitalsField.ts.map +1 -1
  131. package/FormSpec.TS/plugins/vitals/src/VitalsLogic.js +506 -0
  132. package/FormSpec.TS/plugins/vitals/src/VitalsLogic.js.map +1 -0
  133. package/FormSpec.TS/plugins/vitals/src/VitalsLogic.ts.map +1 -0
  134. package/README.md +7 -7
  135. package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Decode.d.ts +2 -2
  136. package/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +1 -0
  137. package/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +1 -0
  138. package/Thoth.Json/packages/Thoth.Json/Extra.d.ts.map +1 -0
  139. package/Thoth.Json/packages/Thoth.Json/Types.d.ts.map +1 -0
  140. package/fable_modules/Fable.Promise.3.2.0/Promise.fs.d.ts +112 -0
  141. package/fable_modules/Fable.Promise.3.2.0/Promise.fs.d.ts.map +1 -0
  142. package/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.d.ts +8 -0
  143. package/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.d.ts.map +1 -0
  144. package/package.json +9 -1
  145. package/plugins/allergyfinder/src/AllergyFinderField.d.ts +116 -0
  146. package/plugins/allergyfinder/src/AllergyFinderField.d.ts.map +1 -0
  147. package/plugins/allergyfinder/src/OpenFdaClient.d.ts +5 -0
  148. package/plugins/allergyfinder/src/OpenFdaClient.d.ts.map +1 -0
  149. package/plugins/vitals/src/VitalsField.d.ts +4 -43
  150. package/plugins/vitals/src/VitalsField.d.ts.map +1 -1
  151. package/plugins/vitals/src/VitalsLogic.d.ts +72 -0
  152. package/plugins/vitals/src/VitalsLogic.d.ts.map +1 -0
  153. package/src/FormSpec.FS/BlueprintValidation.ts +1 -1
  154. package/src/FormSpec.FS/Designer.ts +1 -1
  155. package/src/FormSpec.FS/FormSpec.ts +10 -8
  156. package/src/FormSpec.FS/FormSpecHelpers.ts +5 -5
  157. package/src/FormSpec.FS/FormSpecValues.ts +2 -25
  158. package/src/FormSpec.FS/Helpers.ts +12 -12
  159. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +35 -32
  160. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +6 -23
  161. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts +1 -1
  162. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +1 -1
  163. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +27 -11
  164. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +1 -1
  165. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +3 -3
  166. package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +3 -3
  167. package/src/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.ts +160 -0
  168. package/src/FormSpec.FS/Interop/Facade/BlueprintFilledForm.ts +244 -0
  169. package/src/FormSpec.FS/Interop/Facade/FormAnswersGate.ts +508 -0
  170. package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +376 -128
  171. package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +6 -8
  172. package/src/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts +17 -13
  173. package/src/FormSpec.FS/Migrator.ts +1 -1
  174. package/src/FormSpec.FS/PathwayExecutor.ts +3 -3
  175. package/src/FormSpec.FS/PathwayValidator.ts +1 -1
  176. package/src/PluginRegistration.ts +2 -0
  177. package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Decode.ts +38 -55
  178. package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Encode.ts +10 -16
  179. package/src/plugins/allergyfinder/src/AllergyFinderField.ts +1341 -0
  180. package/src/plugins/allergyfinder/src/OpenFdaClient.ts +103 -0
  181. package/src/plugins/signature/src/SignatureField.ts +1 -1
  182. package/src/plugins/vitals/src/VitalsField.ts +35 -244
  183. package/src/plugins/vitals/src/VitalsLogic.ts +360 -0
  184. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Decode.js.map +0 -1
  185. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Decode.ts.map +0 -1
  186. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Encode.js.map +0 -1
  187. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Encode.ts.map +0 -1
  188. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Extra.js.map +0 -1
  189. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Extra.ts.map +0 -1
  190. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Types.js.map +0 -1
  191. package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Types.ts.map +0 -1
  192. package/libs/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +0 -1
  193. package/libs/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +0 -1
  194. package/libs/Thoth.Json/packages/Thoth.Json/Extra.d.ts.map +0 -1
  195. package/libs/Thoth.Json/packages/Thoth.Json/Types.d.ts.map +0 -1
  196. /package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Extra.js +0 -0
  197. /package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Types.js +0 -0
  198. /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Encode.d.ts +0 -0
  199. /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Extra.d.ts +0 -0
  200. /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Types.d.ts +0 -0
  201. /package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Extra.ts +0 -0
  202. /package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Types.ts +0 -0
@@ -0,0 +1,160 @@
1
+ import { Record, Union } from "@fable-org/fable-library-js/Types.js";
2
+ import { list_type, record_type, int32_type, option_type, string_type, union_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
3
+ import { Option } from "@fable-org/fable-library-js/Option.js";
4
+ import { int32 } from "@fable-org/fable-library-js/Int32.js";
5
+ import { IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
6
+ import { FSharpList } from "@fable-org/fable-library-js/List.js";
7
+
8
+ export type AllergyCategory_$union =
9
+ | AllergyCategory<0>
10
+ | AllergyCategory<1>
11
+ | AllergyCategory<2>
12
+ | AllergyCategory<3>
13
+
14
+ export type AllergyCategory_$cases = {
15
+ 0: ["Drug", []],
16
+ 1: ["Food", []],
17
+ 2: ["Environmental", []],
18
+ 3: ["Custom", []]
19
+ }
20
+
21
+ export function AllergyCategory_Drug() {
22
+ return new AllergyCategory<0>(0, []);
23
+ }
24
+
25
+ export function AllergyCategory_Food() {
26
+ return new AllergyCategory<1>(1, []);
27
+ }
28
+
29
+ export function AllergyCategory_Environmental() {
30
+ return new AllergyCategory<2>(2, []);
31
+ }
32
+
33
+ export function AllergyCategory_Custom() {
34
+ return new AllergyCategory<3>(3, []);
35
+ }
36
+
37
+ export class AllergyCategory<Tag extends keyof AllergyCategory_$cases> extends Union<Tag, AllergyCategory_$cases[Tag][0]> {
38
+ constructor(readonly tag: Tag, readonly fields: AllergyCategory_$cases[Tag][1]) {
39
+ super();
40
+ }
41
+ cases() {
42
+ return ["Drug", "Food", "Environmental", "Custom"];
43
+ }
44
+ }
45
+
46
+ export function AllergyCategory_$reflection(): TypeInfo {
47
+ return union_type("F1.Studio.Integrations.OpenFda.AllergyCategory", [], AllergyCategory, () => [[], [], [], []]);
48
+ }
49
+
50
+ export class OpenFdaSearchResult extends Record implements IEquatable<OpenFdaSearchResult>, IComparable<OpenFdaSearchResult> {
51
+ readonly Name: string;
52
+ readonly GenericName: Option<string>;
53
+ readonly SubstanceName: string;
54
+ readonly Category: AllergyCategory_$union;
55
+ readonly Source: string;
56
+ readonly NdcCode: Option<string>;
57
+ readonly Manufacturer: Option<string>;
58
+ readonly Route: Option<string>;
59
+ readonly DosageForm: Option<string>;
60
+ readonly Strength: Option<string>;
61
+ readonly ReportCount: Option<int32>;
62
+ constructor(Name: string, GenericName: Option<string>, SubstanceName: string, Category: AllergyCategory_$union, Source: string, NdcCode: Option<string>, Manufacturer: Option<string>, Route: Option<string>, DosageForm: Option<string>, Strength: Option<string>, ReportCount: Option<int32>) {
63
+ super();
64
+ this.Name = Name;
65
+ this.GenericName = GenericName;
66
+ this.SubstanceName = SubstanceName;
67
+ this.Category = Category;
68
+ this.Source = Source;
69
+ this.NdcCode = NdcCode;
70
+ this.Manufacturer = Manufacturer;
71
+ this.Route = Route;
72
+ this.DosageForm = DosageForm;
73
+ this.Strength = Strength;
74
+ this.ReportCount = ReportCount;
75
+ }
76
+ }
77
+
78
+ export function OpenFdaSearchResult_$reflection(): TypeInfo {
79
+ return record_type("F1.Studio.Integrations.OpenFda.OpenFdaSearchResult", [], OpenFdaSearchResult, () => [["Name", string_type], ["GenericName", option_type(string_type)], ["SubstanceName", string_type], ["Category", AllergyCategory_$reflection()], ["Source", string_type], ["NdcCode", option_type(string_type)], ["Manufacturer", option_type(string_type)], ["Route", option_type(string_type)], ["DosageForm", option_type(string_type)], ["Strength", option_type(string_type)], ["ReportCount", option_type(int32_type)]]);
80
+ }
81
+
82
+ export class CountResult extends Record implements IEquatable<CountResult>, IComparable<CountResult> {
83
+ readonly Term: string;
84
+ readonly Count: int32;
85
+ constructor(Term: string, Count: int32) {
86
+ super();
87
+ this.Term = Term;
88
+ this.Count = (Count | 0);
89
+ }
90
+ }
91
+
92
+ export function CountResult_$reflection(): TypeInfo {
93
+ return record_type("F1.Studio.Integrations.OpenFda.CountResult", [], CountResult, () => [["Term", string_type], ["Count", int32_type]]);
94
+ }
95
+
96
+ export class LabelWarnings extends Record implements IEquatable<LabelWarnings>, IComparable<LabelWarnings> {
97
+ readonly Contraindications: Option<string>;
98
+ readonly Warnings: Option<string>;
99
+ readonly AdverseReactions: Option<string>;
100
+ constructor(Contraindications: Option<string>, Warnings: Option<string>, AdverseReactions: Option<string>) {
101
+ super();
102
+ this.Contraindications = Contraindications;
103
+ this.Warnings = Warnings;
104
+ this.AdverseReactions = AdverseReactions;
105
+ }
106
+ }
107
+
108
+ export function LabelWarnings_$reflection(): TypeInfo {
109
+ return record_type("F1.Studio.Integrations.OpenFda.LabelWarnings", [], LabelWarnings, () => [["Contraindications", option_type(string_type)], ["Warnings", option_type(string_type)], ["AdverseReactions", option_type(string_type)]]);
110
+ }
111
+
112
+ export class AllergenInsights extends Record implements IEquatable<AllergenInsights>, IComparable<AllergenInsights> {
113
+ readonly Reactions: FSharpList<CountResult>;
114
+ readonly TotalEvents: int32;
115
+ readonly LabelWarnings: Option<LabelWarnings>;
116
+ constructor(Reactions: FSharpList<CountResult>, TotalEvents: int32, LabelWarnings: Option<LabelWarnings>) {
117
+ super();
118
+ this.Reactions = Reactions;
119
+ this.TotalEvents = (TotalEvents | 0);
120
+ this.LabelWarnings = LabelWarnings;
121
+ }
122
+ }
123
+
124
+ export function AllergenInsights_$reflection(): TypeInfo {
125
+ return record_type("F1.Studio.Integrations.OpenFda.AllergenInsights", [], AllergenInsights, () => [["Reactions", list_type(CountResult_$reflection())], ["TotalEvents", int32_type], ["LabelWarnings", option_type(LabelWarnings_$reflection())]]);
126
+ }
127
+
128
+ export class OpenFdaSearchResponse extends Record implements IEquatable<OpenFdaSearchResponse>, IComparable<OpenFdaSearchResponse> {
129
+ readonly Results: FSharpList<OpenFdaSearchResult>;
130
+ readonly Query: string;
131
+ readonly CachedAt: Option<string>;
132
+ constructor(Results: FSharpList<OpenFdaSearchResult>, Query: string, CachedAt: Option<string>) {
133
+ super();
134
+ this.Results = Results;
135
+ this.Query = Query;
136
+ this.CachedAt = CachedAt;
137
+ }
138
+ }
139
+
140
+ export function OpenFdaSearchResponse_$reflection(): TypeInfo {
141
+ return record_type("F1.Studio.Integrations.OpenFda.OpenFdaSearchResponse", [], OpenFdaSearchResponse, () => [["Results", list_type(OpenFdaSearchResult_$reflection())], ["Query", string_type], ["CachedAt", option_type(string_type)]]);
142
+ }
143
+
144
+ export class OpenFdaInsightsResponse extends Record implements IEquatable<OpenFdaInsightsResponse>, IComparable<OpenFdaInsightsResponse> {
145
+ readonly Insights: AllergenInsights;
146
+ readonly SubstanceName: string;
147
+ readonly CachedAt: Option<string>;
148
+ constructor(Insights: AllergenInsights, SubstanceName: string, CachedAt: Option<string>) {
149
+ super();
150
+ this.Insights = Insights;
151
+ this.SubstanceName = SubstanceName;
152
+ this.CachedAt = CachedAt;
153
+ }
154
+ }
155
+
156
+ export function OpenFdaInsightsResponse_$reflection(): TypeInfo {
157
+ return record_type("F1.Studio.Integrations.OpenFda.OpenFdaInsightsResponse", [], OpenFdaInsightsResponse, () => [["Insights", AllergenInsights_$reflection()], ["SubstanceName", string_type], ["CachedAt", option_type(string_type)]]);
158
+ }
159
+
160
+ //# sourceMappingURL=OpenFdaTypes.ts.map
@@ -0,0 +1,244 @@
1
+ import { bind, Option, unwrap } from "@fable-org/fable-library-js/Option.js";
2
+ import { Shared_FieldValue_$union, Shared_PluginDataProperty, Shared_MatrixAnswer, Shared_FieldAnswer, Shared_MatrixItemKey, Shared_FieldKey } from "../../FormSpec.js";
3
+ import { parse } from "@fable-org/fable-library-js/Guid.js";
4
+ import { toList, minElement, toArray, FSharpSet } from "@fable-org/fable-library-js/Set.js";
5
+ import { map } from "@fable-org/fable-library-js/Array.js";
6
+ import { toArray as toArray_2, ofArray, tryHead } from "@fable-org/fable-library-js/List.js";
7
+ import { createObj } from "@fable-org/fable-library-js/Util.js";
8
+ import { toArray as toArray_1 } from "@fable-org/fable-library-js/Map.js";
9
+
10
+ export type Brand$1<T> = void;
11
+
12
+ export type Branded$1<Tag> = string;
13
+
14
+ export interface FieldKeyBrand {
15
+
16
+ }
17
+
18
+ export interface MatrixItemKeyBrand {
19
+
20
+ }
21
+
22
+ export interface PluginPropKeyBrand {
23
+
24
+ }
25
+
26
+ export type BlueprintFilledFormFieldValueAnswerKind =
27
+ | "single"
28
+ | "multiple"
29
+ | "matrix"
30
+ | "pluginData"
31
+
32
+ export interface IFieldAnswer {
33
+ description: string,
34
+ documentation?: string,
35
+ fieldKey: Branded$1<FieldKeyBrand>,
36
+ value: string
37
+ }
38
+
39
+ export interface IPluginDataProperty {
40
+ dataType: string,
41
+ description?: string,
42
+ displayName?: string,
43
+ name: string,
44
+ propertyKey: Branded$1<PluginPropKeyBrand>,
45
+ unit?: string,
46
+ value: string
47
+ }
48
+
49
+ export type PluginDataType =
50
+ | "string"
51
+ | "int"
52
+ | "float"
53
+ | "bool"
54
+ | "datetime"
55
+
56
+ export interface ITypedPluginDataProperty {
57
+ dataType: PluginDataType,
58
+ description?: string,
59
+ displayName?: string,
60
+ name: string,
61
+ propertyKey: Branded$1<PluginPropKeyBrand>,
62
+ unit?: string,
63
+ value: string
64
+ }
65
+
66
+ export interface ISingleValue {
67
+ description: string,
68
+ fieldKey: Branded$1<FieldKeyBrand>,
69
+ kind: BlueprintFilledFormFieldValueAnswerKind,
70
+ value: string
71
+ }
72
+
73
+ export interface IMultipleValue {
74
+ description: string,
75
+ fieldKey: Branded$1<FieldKeyBrand>,
76
+ kind: BlueprintFilledFormFieldValueAnswerKind,
77
+ values: IFieldAnswer[]
78
+ }
79
+
80
+ export interface IMatrixValue {
81
+ description: string,
82
+ fieldKey: Branded$1<FieldKeyBrand>,
83
+ kind: BlueprintFilledFormFieldValueAnswerKind,
84
+ values: any
85
+ }
86
+
87
+ export interface IPluginDataValue {
88
+ kind: BlueprintFilledFormFieldValueAnswerKind,
89
+ properties: ITypedPluginDataProperty[]
90
+ }
91
+
92
+ /**
93
+ * Create a single-value field answer
94
+ */
95
+ export function BlueprintFilledForm_single(fieldKey: Branded$1<FieldKeyBrand>, description: string, value: string, documentation: Option<string>): ISingleValue {
96
+ return {
97
+ description: description,
98
+ documentation: unwrap(documentation),
99
+ fieldKey: fieldKey,
100
+ kind: "single",
101
+ value: value,
102
+ };
103
+ }
104
+
105
+ /**
106
+ * Create a multi-select field answer
107
+ */
108
+ export function BlueprintFilledForm_multiple(fieldKey: Branded$1<FieldKeyBrand>, description: string, values: IFieldAnswer[], documentation: Option<string>): IMultipleValue {
109
+ return {
110
+ description: description,
111
+ documentation: unwrap(documentation),
112
+ fieldKey: fieldKey,
113
+ kind: "multiple",
114
+ values: values,
115
+ };
116
+ }
117
+
118
+ /**
119
+ * Create a matrix/likert answer
120
+ */
121
+ export function BlueprintFilledForm_matrix(fieldKey: Branded$1<FieldKeyBrand>, description: string, values: any, documentation: Option<string>): IMatrixValue {
122
+ return {
123
+ description: description,
124
+ documentation: unwrap(documentation),
125
+ fieldKey: fieldKey,
126
+ kind: "matrix",
127
+ values: values,
128
+ };
129
+ }
130
+
131
+ /**
132
+ * Create a plugin data field value
133
+ */
134
+ export function BlueprintFilledForm_pluginData(properties: ITypedPluginDataProperty[]): IPluginDataValue {
135
+ return {
136
+ kind: "pluginData",
137
+ properties: properties,
138
+ };
139
+ }
140
+
141
+ /**
142
+ * Create a single field answer record
143
+ */
144
+ export function BlueprintFilledForm_answer(fieldKey: Branded$1<FieldKeyBrand>, description: string, value: string, documentation: Option<string>): { description: string, documentation?: string, fieldKey: Branded$1<FieldKeyBrand>, value: string } {
145
+ return {
146
+ description: description,
147
+ documentation: unwrap(documentation),
148
+ fieldKey: fieldKey,
149
+ value: value,
150
+ };
151
+ }
152
+
153
+ /**
154
+ * Create a typed plugin data property
155
+ */
156
+ export function BlueprintFilledForm_pluginProp(key: Branded$1<PluginPropKeyBrand>, name: string, dataType: PluginDataType, value: string): { dataType: PluginDataType, description?: Option<any>, displayName?: Option<any>, name: string, propertyKey: Branded$1<PluginPropKeyBrand>, unit?: Option<any>, value: string } {
157
+ return {
158
+ dataType: dataType,
159
+ name: name,
160
+ propertyKey: key,
161
+ value: value,
162
+ };
163
+ }
164
+
165
+ export function Convert_domainKeyToTs(_arg: Shared_FieldKey): Branded$1<FieldKeyBrand> {
166
+ const guid: string = _arg.fields[0];
167
+ return guid;
168
+ }
169
+
170
+ export function Convert_tsKeyToDomain(tsKey: Branded$1<FieldKeyBrand>): Shared_FieldKey {
171
+ return new Shared_FieldKey(parse(tsKey));
172
+ }
173
+
174
+ export function Convert_domainMatrixItemKeyToTs(_arg: Shared_MatrixItemKey): Branded$1<MatrixItemKeyBrand> {
175
+ const guid: string = _arg.fields[0];
176
+ return guid;
177
+ }
178
+
179
+ export function Convert_fieldAnswerToTs(fa: Shared_FieldAnswer): { description: string, documentation?: string, fieldKey: Branded$1<FieldKeyBrand>, value: string } {
180
+ const guid: string = fa.FieldKey.fields[0];
181
+ return {
182
+ description: fa.Description,
183
+ documentation: unwrap(fa.Documentation),
184
+ fieldKey: guid,
185
+ value: fa.Value,
186
+ };
187
+ }
188
+
189
+ export function Convert_fieldValueToTs(fv: Shared_FieldValue_$union): any {
190
+ switch (fv.tag) {
191
+ case /* Multiple */ 1: {
192
+ const fas: FSharpSet<Shared_FieldAnswer> = fv.fields[0];
193
+ const answers: IFieldAnswer[] = map<Shared_FieldAnswer, IFieldAnswer>(Convert_fieldAnswerToTs, toArray<Shared_FieldAnswer>(fas));
194
+ const firstFk: Shared_FieldKey = minElement<Shared_FieldAnswer>(fas).FieldKey;
195
+ return {
196
+ description: "",
197
+ documentation: unwrap(bind<Shared_FieldAnswer, string>((fa_2: Shared_FieldAnswer): Option<string> => fa_2.Documentation, tryHead<Shared_FieldAnswer>(toList<Shared_FieldAnswer>(fas)))),
198
+ fieldKey: Convert_domainKeyToTs(firstFk),
199
+ kind: "multiple",
200
+ values: answers,
201
+ };
202
+ }
203
+ case /* Matrix */ 2: {
204
+ const ma: Shared_MatrixAnswer = fv.fields[0];
205
+ const valuesObj: any = createObj(ofArray<[string, any]>(map<[Shared_MatrixItemKey, string], [string, any]>((tupledArg: [Shared_MatrixItemKey, string]): [string, any] => ([tupledArg[0].fields[0], tupledArg[1]] as [string, any]), toArray_1<Shared_MatrixItemKey, string>(ma.Values))));
206
+ return {
207
+ description: ma.Description,
208
+ documentation: unwrap(ma.Documentation),
209
+ fieldKey: Convert_domainKeyToTs(ma.FieldKey),
210
+ kind: "matrix",
211
+ values: valuesObj,
212
+ };
213
+ }
214
+ case /* PluginData */ 3:
215
+ return {
216
+ kind: "pluginData",
217
+ properties: map<Shared_PluginDataProperty, ITypedPluginDataProperty>((p: Shared_PluginDataProperty): { dataType: PluginDataType, description?: string, displayName?: string, name: string, propertyKey: Branded$1<PluginPropKeyBrand>, unit?: string, value: string } => {
218
+ let matchValue: string;
219
+ const guid: string = p.PropertyKey.fields[0];
220
+ return {
221
+ dataType: (matchValue = p.DataType.toLowerCase(), (matchValue === "string") ? "string" : ((matchValue === "int") ? "int" : ((matchValue === "float") ? "float" : ((matchValue === "bool") ? "bool" : ((matchValue === "datetime") ? "datetime" : "string"))))),
222
+ description: unwrap(p.Description),
223
+ displayName: unwrap(p.DisplayName),
224
+ name: p.Name,
225
+ propertyKey: guid,
226
+ unit: unwrap(p.Unit),
227
+ value: p.Value,
228
+ };
229
+ }, toArray_2<Shared_PluginDataProperty>(fv.fields[0])),
230
+ };
231
+ default: {
232
+ const fa: Shared_FieldAnswer = fv.fields[0];
233
+ return {
234
+ description: fa.Description,
235
+ documentation: unwrap(fa.Documentation),
236
+ fieldKey: Convert_domainKeyToTs(fa.FieldKey),
237
+ kind: "single",
238
+ value: fa.Value,
239
+ };
240
+ }
241
+ }
242
+ }
243
+
244
+ //# sourceMappingURL=BlueprintFilledForm.ts.map