@f1studio/form-spec 5.0.0-alpha.149 → 5.0.0-alpha.152

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 (255) hide show
  1. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
  2. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +5 -3
  3. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
  4. package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.d.ts +19 -0
  5. package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.d.ts.map +1 -0
  6. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +39 -2
  7. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
  8. package/FormSpec.FS/Interop/Facade/BlueprintFilledForm.d.ts +16 -0
  9. package/FormSpec.FS/Interop/Facade/BlueprintFilledForm.d.ts.map +1 -1
  10. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +3 -3
  11. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -1
  12. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +2 -2
  13. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -1
  14. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +1 -1
  15. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
  16. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +23 -21
  17. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
  18. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +16 -7
  19. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
  20. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.js +580 -0
  21. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.js.map +1 -0
  22. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +199 -8
  23. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
  24. package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.js +25 -1
  25. package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.js.map +1 -1
  26. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -1
  27. package/README.md +7 -7
  28. package/package.json +13 -15
  29. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +3 -3
  30. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +3 -3
  31. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +1 -1
  32. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +25 -23
  33. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +19 -13
  34. package/src/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.ts +545 -0
  35. package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +120 -14
  36. package/src/FormSpec.FS/Interop/Facade/BlueprintFilledForm.ts +29 -1
  37. package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.ts.map +0 -1
  38. package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +0 -1
  39. package/FormSpec.TS/FormSpec.FS/Components/HelloComponent.ts.map +0 -1
  40. package/FormSpec.TS/FormSpec.FS/Designer.ts.map +0 -1
  41. package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +0 -1
  42. package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +0 -1
  43. package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +0 -1
  44. package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +0 -1
  45. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts.map +0 -1
  46. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +0 -1
  47. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +0 -1
  48. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts.map +0 -1
  49. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts.map +0 -1
  50. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts.map +0 -1
  51. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts.map +0 -1
  52. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts.map +0 -1
  53. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +0 -1
  54. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts.map +0 -1
  55. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +0 -1
  56. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +0 -1
  57. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts.map +0 -1
  58. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts.map +0 -1
  59. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts.map +0 -1
  60. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts.map +0 -1
  61. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts.map +0 -1
  62. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.ts.map +0 -1
  63. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +0 -1
  64. package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.ts.map +0 -1
  65. package/FormSpec.TS/FormSpec.FS/Interfaces.ts.map +0 -1
  66. package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.ts.map +0 -1
  67. package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.ts.map +0 -1
  68. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +0 -1
  69. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +0 -1
  70. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts.map +0 -1
  71. package/FormSpec.TS/FormSpec.FS/Logging/LogTypes.ts.map +0 -1
  72. package/FormSpec.TS/FormSpec.FS/Migrator.ts.map +0 -1
  73. package/FormSpec.TS/FormSpec.FS/PathwayDataExtractor.ts.map +0 -1
  74. package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +0 -1
  75. package/FormSpec.TS/FormSpec.FS/PathwayValidator.ts.map +0 -1
  76. package/FormSpec.TS/FormSpec.FS/PluginInterface.ts.map +0 -1
  77. package/FormSpec.TS/FormSpec.FS/Prelude.ts.map +0 -1
  78. package/FormSpec.TS/FormSpec.FS/Provenance.ts.map +0 -1
  79. package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts.map +0 -1
  80. package/FormSpec.TS/FormSpec.FS/Renderers/MermaidRenderer.ts.map +0 -1
  81. package/FormSpec.TS/FormSpec.FS/Renderers/PathwayRenderers.ts.map +0 -1
  82. package/FormSpec.TS/PluginRegistration.ts.map +0 -1
  83. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +0 -1
  84. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +0 -1
  85. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.ts.map +0 -1
  86. package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.ts.map +0 -1
  87. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +0 -511
  88. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts.map +0 -1
  89. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +0 -16
  90. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts.map +0 -1
  91. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +0 -50
  92. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts.map +0 -1
  93. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +0 -28
  94. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +0 -24
  95. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.ts.map +0 -1
  96. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +0 -31
  97. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +0 -178
  98. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts.map +0 -1
  99. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/CheckboxField.fs +0 -47
  100. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/CheckboxField.fs.ts.map +0 -1
  101. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/ColorField.fs +0 -49
  102. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/ColorField.fs.ts.map +0 -1
  103. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/DateField.fs +0 -52
  104. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/DateField.fs.ts.map +0 -1
  105. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/DateTimeLocalField.fs +0 -54
  106. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/DateTimeLocalField.fs.ts.map +0 -1
  107. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/EmailField.fs +0 -48
  108. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/EmailField.fs.ts.map +0 -1
  109. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Fable.Form.Simple.Bulma.fableproj +0 -53
  110. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/FileField.fs +0 -132
  111. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/FileField.fs.ts.map +0 -1
  112. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Form.fs +0 -537
  113. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Form.fs.ts.map +0 -1
  114. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/FormList.fs +0 -361
  115. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/FormList.fs.ts.map +0 -1
  116. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Group.fs +0 -52
  117. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Group.fs.ts.map +0 -1
  118. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Html.View.fs +0 -246
  119. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Html.View.fs.ts.map +0 -1
  120. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/InputField.fs +0 -52
  121. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/InputField.fs.ts.map +0 -1
  122. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/NumberField.fs +0 -56
  123. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/NumberField.fs.ts.map +0 -1
  124. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/PasswordField.fs +0 -46
  125. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/PasswordField.fs.ts.map +0 -1
  126. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/RadioField.fs +0 -51
  127. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/RadioField.fs.ts.map +0 -1
  128. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/SearchField.fs +0 -49
  129. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/SearchField.fs.ts.map +0 -1
  130. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Section.fs +0 -60
  131. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Section.fs.ts.map +0 -1
  132. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/SelectField.fs +0 -79
  133. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/SelectField.fs.ts.map +0 -1
  134. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TelField.fs +0 -44
  135. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TelField.fs.ts.map +0 -1
  136. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TextField.fs +0 -49
  137. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TextField.fs.ts.map +0 -1
  138. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TextareaField.fs +0 -59
  139. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TextareaField.fs.ts.map +0 -1
  140. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TimeField.fs +0 -44
  141. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/TimeField.fs.ts.map +0 -1
  142. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Types.fs +0 -143
  143. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Bulma.5.0.1/Types.fs.ts.map +0 -1
  144. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/CheckboxField.fs +0 -36
  145. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/CheckboxField.fs.ts.map +0 -1
  146. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/ColorField.fs +0 -49
  147. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/ColorField.fs.ts.map +0 -1
  148. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/DateField.fs +0 -67
  149. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/DateField.fs.ts.map +0 -1
  150. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/DateTimeLocalField.fs +0 -70
  151. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/DateTimeLocalField.fs.ts.map +0 -1
  152. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/EmailField.fs +0 -76
  153. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/EmailField.fs.ts.map +0 -1
  154. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/Fable.Form.Simple.Fields.Html.fableproj +0 -45
  155. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/NumberField.fs +0 -105
  156. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/NumberField.fs.ts.map +0 -1
  157. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/PasswordField.fs +0 -66
  158. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/PasswordField.fs.ts.map +0 -1
  159. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/RadioField.fs +0 -72
  160. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/RadioField.fs.ts.map +0 -1
  161. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/RangeField.fs +0 -102
  162. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/RangeField.fs.ts.map +0 -1
  163. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/SearchField.fs +0 -83
  164. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/SearchField.fs.ts.map +0 -1
  165. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/SelectField.fs +0 -83
  166. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/SelectField.fs.ts.map +0 -1
  167. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TelField.fs +0 -63
  168. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TelField.fs.ts.map +0 -1
  169. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TextField.fs +0 -83
  170. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TextField.fs.ts.map +0 -1
  171. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TextareaField.fs +0 -92
  172. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TextareaField.fs.ts.map +0 -1
  173. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TimeField.fs +0 -108
  174. package/FormSpec.TS/fable_modules/Fable.Form.Simple.Fields.Html.1.0.1/TimeField.fs.ts.map +0 -1
  175. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
  176. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.ts.map +0 -1
  177. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
  178. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs +0 -766
  179. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.ts.map +0 -1
  180. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +0 -31
  181. package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.ts.map +0 -1
  182. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +0 -17
  183. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +0 -152
  184. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts.map +0 -1
  185. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +0 -28
  186. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +0 -218
  187. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.ts.map +0 -1
  188. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +0 -27
  189. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +0 -82
  190. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.ts.map +0 -1
  191. package/FormSpec.TS/fable_modules/Feliz.2.8.0/BorderStyle.fs +0 -59
  192. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Colors.fs +0 -154
  193. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Colors.fs.ts.map +0 -1
  194. package/FormSpec.TS/fable_modules/Feliz.2.8.0/DateParsing.fs +0 -52
  195. package/FormSpec.TS/fable_modules/Feliz.2.8.0/DateParsing.fs.ts.map +0 -1
  196. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Feliz.fableproj +0 -53
  197. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Fonts.fs +0 -240
  198. package/FormSpec.TS/fable_modules/Feliz.2.8.0/GridTypes.fs +0 -24
  199. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Helpers.fs +0 -11
  200. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Helpers.fs.ts.map +0 -1
  201. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Html.fs +0 -826
  202. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Internal.fs +0 -176
  203. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Internal.fs.ts.map +0 -1
  204. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Interop.fs +0 -29
  205. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Interop.fs.ts.map +0 -1
  206. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Key.fs +0 -65
  207. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Key.fs.ts.map +0 -1
  208. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Length.fs +0 -145
  209. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Locale.fs +0 -876
  210. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Properties.fs +0 -4085
  211. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Properties.fs.ts.map +0 -1
  212. package/FormSpec.TS/fable_modules/Feliz.2.8.0/React.fs +0 -494
  213. package/FormSpec.TS/fable_modules/Feliz.2.8.0/ReactDOM.fs +0 -25
  214. package/FormSpec.TS/fable_modules/Feliz.2.8.0/ReactDOM.fs.ts.map +0 -1
  215. package/FormSpec.TS/fable_modules/Feliz.2.8.0/ReactInterop.fs +0 -20
  216. package/FormSpec.TS/fable_modules/Feliz.2.8.0/ReactTypes.fs +0 -42
  217. package/FormSpec.TS/fable_modules/Feliz.2.8.0/ReactTypes.fs.ts.map +0 -1
  218. package/FormSpec.TS/fable_modules/Feliz.2.8.0/StyleTypes.fs +0 -57
  219. package/FormSpec.TS/fable_modules/Feliz.2.8.0/StyleTypes.fs.ts.map +0 -1
  220. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Styles.fs +0 -6378
  221. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Svg.fs +0 -1455
  222. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Svg.fs.ts.map +0 -1
  223. package/FormSpec.TS/fable_modules/Feliz.2.8.0/TextDecorationLine.fs +0 -13
  224. package/FormSpec.TS/fable_modules/Feliz.2.8.0/TextDecorationStyle.fs +0 -33
  225. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Transform.fs +0 -181
  226. package/FormSpec.TS/fable_modules/Feliz.2.8.0/TransformOrigin.fs +0 -17
  227. package/FormSpec.TS/fable_modules/Feliz.2.8.0/TransitionProperty.fs +0 -162
  228. package/FormSpec.TS/fable_modules/Feliz.2.8.0/TransitionTimingFunction.fs +0 -62
  229. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Types.fs +0 -13
  230. package/FormSpec.TS/fable_modules/Feliz.2.8.0/Types.fs.ts.map +0 -1
  231. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/Bulma.fs +0 -990
  232. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/ElementBuilders.fs +0 -179
  233. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/ElementBuilders.fs.ts.map +0 -1
  234. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/Feliz.Bulma.fableproj +0 -32
  235. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/Modifiers.fs +0 -1986
  236. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/Modifiers.fs.ts.map +0 -1
  237. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/Operators.fs +0 -7
  238. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/Operators.fs.ts.map +0 -1
  239. package/FormSpec.TS/fable_modules/Feliz.Bulma.3.0.0/PropertyBuilders.fs +0 -8
  240. package/FormSpec.TS/fable_modules/Glutinum.Feliz.ReactSignaturePadWrapper.1.0.2/Exports.fs +0 -14
  241. package/FormSpec.TS/fable_modules/Glutinum.Feliz.ReactSignaturePadWrapper.1.0.2/Glutinum.Feliz.ReactSignaturePadWrapper.fableproj +0 -18
  242. package/FormSpec.TS/fable_modules/Glutinum.Feliz.ReactSignaturePadWrapper.1.0.2/Interop.fs +0 -6
  243. package/FormSpec.TS/fable_modules/Glutinum.Feliz.ReactSignaturePadWrapper.1.0.2/ReactSignaturePadWrapper.fs +0 -32
  244. package/FormSpec.TS/fable_modules/Glutinum.Feliz.ReactSignaturePadWrapper.1.0.2/Types.fs +0 -3
  245. package/FormSpec.TS/fable_modules/Glutinum.Feliz.ReactSignaturePadWrapper.1.0.2/Types.fs.ts.map +0 -1
  246. package/FormSpec.TS/fable_modules/project_cracked.json +0 -1
  247. package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.ts.map +0 -1
  248. package/FormSpec.TS/plugins/allergyfinder/src/AllergyLogic.ts.map +0 -1
  249. package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.ts.map +0 -1
  250. package/FormSpec.TS/plugins/bmi/src/BMIField.ts.map +0 -1
  251. package/FormSpec.TS/plugins/demographics/src/DemographicsField.ts.map +0 -1
  252. package/FormSpec.TS/plugins/likert/src/LikertField.ts.map +0 -1
  253. package/FormSpec.TS/plugins/signature/src/SignatureField.ts.map +0 -1
  254. package/FormSpec.TS/plugins/vitals/src/VitalsField.ts.map +0 -1
  255. package/FormSpec.TS/plugins/vitals/src/VitalsLogic.ts.map +0 -1
@@ -0,0 +1,545 @@
1
+ import { Helpers_generateDeterministicGuidRaw } from "../../Helpers.js";
2
+ import { ClinicalPathway_PathwayExecutionMode_MultiPathway, ClinicalPathway_MultiPathwayConfig, ClinicalPathway_ConflictResolution_CombineActions, ClinicalPathway_CombinationStrategy_AllMatching, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_PathRequirement, ClinicalPathway_ConstraintDefinition, ClinicalPathway_PathwayExecutionMode_TriggerBased, ClinicalPathway_TriggerBasedConfig, ClinicalPathway_TransitionDefinition, Shared_TransitionKey, ClinicalPathway_StateType_Terminal, ClinicalPathway_TerminalInfo, ClinicalPathway_StateType_Action, ClinicalPathway_StateType_CompoundAction, ClinicalPathway_StateDefinition, ClinicalPathway_StateType_Evaluation, ClinicalPathway_EvaluationInfo, Shared_StateKey, ClinicalPathway_ActionInfo_$union, ClinicalPathway_ActionInfo_Documentation, ClinicalPathway_DocumentationAction, ClinicalPathway_ActionInfo_Problem, ClinicalPathway_ProblemAction, ClinicalPathway_ProblemStatus_Active, ClinicalPathway_ActionInfo_Medication, ClinicalPathway_MedicationAction, ClinicalPathway_ActionInfo_Task, ClinicalPathway_TaskAction, ClinicalPathway_ActionInfo_Alert, ClinicalPathway_AlertAction, ClinicalPathway_AlertSeverity_High, ClinicalPathway_TransitionCondition_Always, ClinicalPathway_TransitionCondition_CompositeCondition, ClinicalPathway_LogicalOp_And, ClinicalPathway_LogicalOp_Or, ClinicalPathway_TransitionCondition_$union, ClinicalPathway_TransitionCondition_FieldCondition, ClinicalPathway_TransitionCondition_PluginPropertyCondition, Shared_PluginPropertyKey, Shared_ConditionValue_Single, Shared_ConditionValue_Multiple, Shared_ConditionValue_$union, Shared_FieldKey, ClinicalPathway_RecurrencePattern, ClinicalPathway_RecurrenceEnd_AfterOccurrences, ClinicalPathway_RecurrenceEnd_OnDate, ClinicalPathway_RecurrenceEnd_$union, ClinicalPathway_DueDate_$union, ClinicalPathway_DueDate_DaysFromNow, ClinicalPathway_DueDate_Tomorrow, ClinicalPathway_DueDate_Today, ClinicalPathway_TaskPriority_$union, ClinicalPathway_TaskPriority_Medium, ClinicalPathway_TaskPriority_Low, ClinicalPathway_TaskPriority_High, ClinicalPathway_TriggerTiming_$union, ClinicalPathway_TriggerTiming_OnFormLoad, ClinicalPathway_TriggerTiming_OnFormSubmit, ClinicalPathway_TriggerTiming_OnFormSave, ClinicalPathway_FieldEvaluator_$union, ClinicalPathway_FieldEvaluator_MatchesPattern, ClinicalPathway_FieldEvaluator_NotInSet, ClinicalPathway_FieldEvaluator_ContainsAll, ClinicalPathway_FieldEvaluator_LessOrEqual, ClinicalPathway_FieldEvaluator_LessThan, ClinicalPathway_FieldEvaluator_GreaterOrEqual, ClinicalPathway_FieldEvaluator_GreaterThan, ClinicalPathway_FieldEvaluator_NotEquals, ClinicalPathway_FieldEvaluator_Equals, ClinicalPathway_FieldEvaluator_InSet } from "../../FormSpec.js";
3
+ import { bind, map as map_1, defaultArgWith, Option, value as value_1, defaultArg } from "@fable-org/fable-library-js/Option.js";
4
+ import { sortByDescending, append, indexed, singleton, collect, filter, empty, ofArray, length, tryFind as tryFind_1, map, tail, head, isEmpty, FSharpList, tryHead } from "@fable-org/fable-library-js/List.js";
5
+ import { tryParse, int32 } from "@fable-org/fable-library-js/Int32.js";
6
+ import { substring, join, isNullOrEmpty, split, replace } from "@fable-org/fable-library-js/String.js";
7
+ import { FSharpRef } from "@fable-org/fable-library-js/Types.js";
8
+ import { utcNow, addDays } from "@fable-org/fable-library-js/DateOffset.js";
9
+ import { fromDays } from "@fable-org/fable-library-js/TimeSpan.js";
10
+ import { toList, FSharpMap, tryFind } from "@fable-org/fable-library-js/Map.js";
11
+ import { ofList } from "@fable-org/fable-library-js/Set.js";
12
+ import { IDisposable, disposeSafe, IEnumerator, getEnumerator, numberHash, stringHash, int32ToString, comparePrimitives } from "@fable-org/fable-library-js/Util.js";
13
+ import { TemplateForm, ItemTrigger, TemplateItem, TriggerAction, TriggerCondition } from "./TemplateManifestDecoder.js";
14
+ import { item as item_1 } from "@fable-org/fable-library-js/Array.js";
15
+ import { List_countBy, List_distinctBy, List_distinct } from "@fable-org/fable-library-js/Seq2.js";
16
+
17
+ function stableGuid(name: string): string {
18
+ return Helpers_generateDeterministicGuidRaw(`coremr:item_trigger:${name}`);
19
+ }
20
+
21
+ export function convertOperator(operator: string, values: FSharpList<string>): ClinicalPathway_FieldEvaluator_$union {
22
+ const matchValue: string = operator.toLowerCase();
23
+ switch (matchValue) {
24
+ case "any":
25
+ return ClinicalPathway_FieldEvaluator_InSet(values);
26
+ case "equals":
27
+ return ClinicalPathway_FieldEvaluator_Equals();
28
+ case "not_equals":
29
+ return ClinicalPathway_FieldEvaluator_NotEquals();
30
+ case "greater":
31
+ return ClinicalPathway_FieldEvaluator_GreaterThan();
32
+ case "greater_equals":
33
+ return ClinicalPathway_FieldEvaluator_GreaterOrEqual();
34
+ case "less":
35
+ return ClinicalPathway_FieldEvaluator_LessThan();
36
+ case "less_equals":
37
+ return ClinicalPathway_FieldEvaluator_LessOrEqual();
38
+ case "all":
39
+ return ClinicalPathway_FieldEvaluator_ContainsAll(values);
40
+ case "none":
41
+ return ClinicalPathway_FieldEvaluator_NotInSet(values);
42
+ case "regex":
43
+ return ClinicalPathway_FieldEvaluator_MatchesPattern(defaultArg(tryHead<string>(values), ".*"));
44
+ default:
45
+ throw new Error(`ItemTriggerConverter: unknown operator '${matchValue}'`);
46
+ }
47
+ }
48
+
49
+ export function convertTiming(eventName: string): ClinicalPathway_TriggerTiming_$union {
50
+ const matchValue: string = eventName.toLowerCase();
51
+ switch (matchValue) {
52
+ case "save":
53
+ return ClinicalPathway_TriggerTiming_OnFormSave();
54
+ case "lock":
55
+ return ClinicalPathway_TriggerTiming_OnFormSubmit();
56
+ case "open_first_time":
57
+ return ClinicalPathway_TriggerTiming_OnFormLoad();
58
+ default:
59
+ return ClinicalPathway_TriggerTiming_OnFormSave();
60
+ }
61
+ }
62
+
63
+ function convertPriority(priorityStr: string): ClinicalPathway_TaskPriority_$union {
64
+ switch (priorityStr) {
65
+ case "1":
66
+ return ClinicalPathway_TaskPriority_High();
67
+ case "3":
68
+ return ClinicalPathway_TaskPriority_Low();
69
+ default:
70
+ return ClinicalPathway_TaskPriority_Medium();
71
+ }
72
+ }
73
+
74
+ function parseDueDate(dateStr: string): ClinicalPathway_DueDate_$union {
75
+ const matchValue: string = dateStr.trim().toLowerCase();
76
+ let matchResult: int32;
77
+ switch (matchValue) {
78
+ case "today":
79
+ case "": {
80
+ matchResult = 0;
81
+ break;
82
+ }
83
+ case "tomorrow": {
84
+ matchResult = 1;
85
+ break;
86
+ }
87
+ default:
88
+ if (matchValue.startsWith("+")) {
89
+ matchResult = 2;
90
+ }
91
+ else {
92
+ matchResult = 3;
93
+ }
94
+ }
95
+ switch (matchResult) {
96
+ case 0:
97
+ return ClinicalPathway_DueDate_Today();
98
+ case 1:
99
+ return ClinicalPathway_DueDate_Tomorrow();
100
+ case 2: {
101
+ let matchValue_1: [boolean, int32];
102
+ let outArg = 0;
103
+ matchValue_1 = ([tryParse(replace(replace(replace(matchValue, "+", ""), "days", ""), "day", "").trim(), 511, false, 32, new FSharpRef<int32>((): int32 => outArg, (v: int32): void => {
104
+ outArg = (v | 0);
105
+ })), outArg] as [boolean, int32]);
106
+ if (matchValue_1[0]) {
107
+ return ClinicalPathway_DueDate_DaysFromNow(matchValue_1[1]);
108
+ }
109
+ else {
110
+ return ClinicalPathway_DueDate_Today();
111
+ }
112
+ }
113
+ default:
114
+ return ClinicalPathway_DueDate_Today();
115
+ }
116
+ }
117
+
118
+ function parseRecurrence(endStr: Option<string>): Option<ClinicalPathway_RecurrencePattern> {
119
+ let matchResult: int32, s: string;
120
+ if (endStr != null) {
121
+ if (value_1(endStr) === "") {
122
+ matchResult = 0;
123
+ }
124
+ else {
125
+ matchResult = 1;
126
+ s = value_1(endStr);
127
+ }
128
+ }
129
+ else {
130
+ matchResult = 0;
131
+ }
132
+ switch (matchResult) {
133
+ case 0:
134
+ return undefined;
135
+ default: {
136
+ const dueDate: ClinicalPathway_DueDate_$union = parseDueDate(s!);
137
+ let until: ClinicalPathway_RecurrenceEnd_$union;
138
+ if (dueDate.tag === /* DaysFromNow */ 2) {
139
+ const days: int32 = dueDate.fields[0] | 0;
140
+ until = ClinicalPathway_RecurrenceEnd_OnDate(addDays(utcNow(), days));
141
+ }
142
+ else {
143
+ until = ClinicalPathway_RecurrenceEnd_AfterOccurrences(7);
144
+ }
145
+ return new ClinicalPathway_RecurrencePattern(fromDays(1), until);
146
+ }
147
+ }
148
+ }
149
+
150
+ export function convertCondition(cond: TriggerCondition, itemFieldKeyMap: FSharpMap<int32, Shared_FieldKey>): ClinicalPathway_TransitionCondition_$union {
151
+ const fieldKey: Shared_FieldKey = defaultArgWith<Shared_FieldKey>(tryFind<int32, Shared_FieldKey>(cond.SourceFieldId, itemFieldKeyMap), (): Shared_FieldKey => (new Shared_FieldKey(stableGuid(`field_${cond.SourceFieldId}`))));
152
+ const evaluator: ClinicalPathway_FieldEvaluator_$union = convertOperator(cond.Operator, cond.Values);
153
+ let condValue: Shared_ConditionValue_$union;
154
+ const matchValue: string = cond.Operator.toLowerCase();
155
+ switch (matchValue) {
156
+ case "any":
157
+ case "all":
158
+ case "none": {
159
+ condValue = Shared_ConditionValue_Multiple(ofList<string>(cond.Values, {
160
+ Compare: comparePrimitives,
161
+ }));
162
+ break;
163
+ }
164
+ default: {
165
+ const matchValue_1: FSharpList<string> = cond.Values;
166
+ if (isEmpty(matchValue_1)) {
167
+ const matchValue_2: FSharpList<int32> = cond.RawChoiceIds;
168
+ condValue = (isEmpty(matchValue_2) ? Shared_ConditionValue_Single("") : Shared_ConditionValue_Single(int32ToString(head(matchValue_2))));
169
+ }
170
+ else {
171
+ condValue = Shared_ConditionValue_Single(head(matchValue_1));
172
+ }
173
+ }
174
+ }
175
+ const matchValue_3: string = cond.Source.toLowerCase();
176
+ switch (matchValue_3) {
177
+ case "flow_bp_sys":
178
+ return ClinicalPathway_TransitionCondition_PluginPropertyCondition(fieldKey, new Shared_PluginPropertyKey(stableGuid("bp_systolic")), evaluator, condValue);
179
+ case "flow_bp_dia":
180
+ return ClinicalPathway_TransitionCondition_PluginPropertyCondition(fieldKey, new Shared_PluginPropertyKey(stableGuid("bp_diastolic")), evaluator, condValue);
181
+ default:
182
+ return ClinicalPathway_TransitionCondition_FieldCondition(fieldKey, evaluator, condValue);
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Combine multiple conditions respecting booleanOperator
188
+ */
189
+ export function combineConditions(conditions: FSharpList<TriggerCondition>, itemFieldKeyMap: FSharpMap<int32, Shared_FieldKey>): ClinicalPathway_TransitionCondition_$union {
190
+ let matchValue: Option<string>;
191
+ if (!isEmpty(conditions)) {
192
+ if (isEmpty(tail(conditions))) {
193
+ return convertCondition(head(conditions), itemFieldKeyMap);
194
+ }
195
+ else {
196
+ const converted: FSharpList<ClinicalPathway_TransitionCondition_$union> = map<TriggerCondition, ClinicalPathway_TransitionCondition_$union>((c: TriggerCondition): ClinicalPathway_TransitionCondition_$union => convertCondition(c, itemFieldKeyMap), conditions);
197
+ return ClinicalPathway_TransitionCondition_CompositeCondition((matchValue = map_1<TriggerCondition, string>((c_1: TriggerCondition): string => c_1.BooleanOperator, tryHead<TriggerCondition>(conditions)), (matchValue != null) ? ((value_1(matchValue) === "||") ? ClinicalPathway_LogicalOp_Or() : ClinicalPathway_LogicalOp_And()) : ClinicalPathway_LogicalOp_And()), converted);
198
+ }
199
+ }
200
+ else {
201
+ return ClinicalPathway_TransitionCondition_Always();
202
+ }
203
+ }
204
+
205
+ function param(key: string, action: TriggerAction): string {
206
+ return defaultArg(tryFind<string, string>(key, action.Params), "");
207
+ }
208
+
209
+ export function convertAction(action: TriggerAction): ClinicalPathway_ActionInfo_$union {
210
+ let s: string, s_1: string;
211
+ const matchValue: string = action.ActionType.toLowerCase();
212
+ switch (matchValue) {
213
+ case "alert": {
214
+ const categoryName: string = param("category_name", action);
215
+ return ClinicalPathway_ActionInfo_Alert(new ClinicalPathway_AlertAction(categoryName, `Alert: ${categoryName}`, ClinicalPathway_AlertSeverity_High(), undefined));
216
+ }
217
+ case "task": {
218
+ const category: string = param("category_name", action);
219
+ let assignee: string;
220
+ const parts: string[] = split(category, ["-"], undefined, 0);
221
+ assignee = ((parts.length > 0) ? item_1(0, parts).trim() : "Staff");
222
+ return ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction(category, param("description", action), convertPriority(param("priority", action)), parseDueDate(param("start", action)), assignee, undefined));
223
+ }
224
+ case "recurring_task": {
225
+ const category_1: string = param("category_name", action);
226
+ let assignee_1: string;
227
+ const parts_1: string[] = split(category_1, ["-"], undefined, 0);
228
+ assignee_1 = ((parts_1.length > 0) ? item_1(0, parts_1).trim() : "Staff");
229
+ return ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction(category_1, param("description", action), convertPriority(param("priority", action)), parseDueDate(param("start", action)), assignee_1, parseRecurrence(tryFind<string, string>("end", action.Params))));
230
+ }
231
+ case "medset":
232
+ return ClinicalPathway_ActionInfo_Medication(new ClinicalPathway_MedicationAction(param("medset_name", action), "", "", "", "", false));
233
+ case "problem":
234
+ return ClinicalPathway_ActionInfo_Problem(new ClinicalPathway_ProblemAction((s = param("category_name", action), isNullOrEmpty(s) ? "Problem" : s), undefined, utcNow(), ClinicalPathway_ProblemStatus_Active(), undefined));
235
+ case "treatment":
236
+ return ClinicalPathway_ActionInfo_Medication(new ClinicalPathway_MedicationAction((s_1 = param("category_name", action), isNullOrEmpty(s_1) ? "Treatment" : s_1), "", "", "", "", false));
237
+ case "taskcomplete":
238
+ return ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction(`Complete: ${param("category_name", action)}`, "Mark task as complete", ClinicalPathway_TaskPriority_Medium(), ClinicalPathway_DueDate_Today(), "Staff", undefined));
239
+ case "approval":
240
+ return ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction("Approval Required", param("description", action), ClinicalPathway_TaskPriority_High(), ClinicalPathway_DueDate_Today(), "Supervisor", undefined));
241
+ case "groups":
242
+ return ClinicalPathway_ActionInfo_Documentation(new ClinicalPathway_DocumentationAction("Group Assignment", param("category_name", action), false));
243
+ default:
244
+ return ClinicalPathway_ActionInfo_Task(new ClinicalPathway_TaskAction(`Unknown action: ${matchValue}`, join("; ", map<[string, string], string>((tupledArg: [string, string]): string => (`${tupledArg[0]}=${tupledArg[1]}`), toList<string, string>(action.Params))), ClinicalPathway_TaskPriority_Medium(), ClinicalPathway_DueDate_Today(), "Staff", undefined));
245
+ }
246
+ }
247
+
248
+ export function generateEvaluationLabel(trigger: ItemTrigger, items: FSharpList<TemplateItem>): string {
249
+ let fieldLabel: string;
250
+ const s: string = defaultArg(bind<TriggerCondition, string>((c: TriggerCondition): Option<string> => map_1<TemplateItem, string>((i_1: TemplateItem): string => i_1.Text, tryFind_1<TemplateItem>((i: TemplateItem): boolean => (i.ItemId === c.SourceFieldId), items)), tryHead<TriggerCondition>(trigger.Conditions)), "field");
251
+ fieldLabel = ((s.length > 50) ? (substring(s, 0, 47) + "...") : s);
252
+ const matchValue: FSharpList<TriggerCondition> = trigger.Conditions;
253
+ if (!isEmpty(matchValue)) {
254
+ if (isEmpty(tail(matchValue))) {
255
+ const matchValue_1: string = head(matchValue).Operator.toLowerCase();
256
+ const matchValue_2: FSharpList<string> = head(matchValue).Values;
257
+ let matchResult: int32, v: string, vals_2: FSharpList<string>, vals_3: FSharpList<string>, v_1: string, v_2: string, v_3: string, v_4: string, v_5: string, v_6: string, vals_4: FSharpList<string>, op: string;
258
+ switch (matchValue_1) {
259
+ case "any": {
260
+ if (!isEmpty(matchValue_2)) {
261
+ if (isEmpty(tail(matchValue_2))) {
262
+ matchResult = 0;
263
+ v = head(matchValue_2);
264
+ }
265
+ else if (length(matchValue_2) <= 3) {
266
+ matchResult = 1;
267
+ vals_2 = matchValue_2;
268
+ }
269
+ else {
270
+ matchResult = 2;
271
+ vals_3 = matchValue_2;
272
+ }
273
+ }
274
+ else if (length(matchValue_2) <= 3) {
275
+ matchResult = 1;
276
+ vals_2 = matchValue_2;
277
+ }
278
+ else {
279
+ matchResult = 2;
280
+ vals_3 = matchValue_2;
281
+ }
282
+ break;
283
+ }
284
+ case "equals": {
285
+ if (!isEmpty(matchValue_2)) {
286
+ if (isEmpty(tail(matchValue_2))) {
287
+ matchResult = 3;
288
+ v_1 = head(matchValue_2);
289
+ }
290
+ else {
291
+ matchResult = 10;
292
+ op = matchValue_1;
293
+ }
294
+ }
295
+ else {
296
+ matchResult = 10;
297
+ op = matchValue_1;
298
+ }
299
+ break;
300
+ }
301
+ case "not_equals": {
302
+ if (!isEmpty(matchValue_2)) {
303
+ if (isEmpty(tail(matchValue_2))) {
304
+ matchResult = 4;
305
+ v_2 = head(matchValue_2);
306
+ }
307
+ else {
308
+ matchResult = 10;
309
+ op = matchValue_1;
310
+ }
311
+ }
312
+ else {
313
+ matchResult = 10;
314
+ op = matchValue_1;
315
+ }
316
+ break;
317
+ }
318
+ case "greater_equals": {
319
+ if (!isEmpty(matchValue_2)) {
320
+ if (isEmpty(tail(matchValue_2))) {
321
+ matchResult = 5;
322
+ v_3 = head(matchValue_2);
323
+ }
324
+ else {
325
+ matchResult = 10;
326
+ op = matchValue_1;
327
+ }
328
+ }
329
+ else {
330
+ matchResult = 10;
331
+ op = matchValue_1;
332
+ }
333
+ break;
334
+ }
335
+ case "greater": {
336
+ if (!isEmpty(matchValue_2)) {
337
+ if (isEmpty(tail(matchValue_2))) {
338
+ matchResult = 6;
339
+ v_4 = head(matchValue_2);
340
+ }
341
+ else {
342
+ matchResult = 10;
343
+ op = matchValue_1;
344
+ }
345
+ }
346
+ else {
347
+ matchResult = 10;
348
+ op = matchValue_1;
349
+ }
350
+ break;
351
+ }
352
+ case "less_equals": {
353
+ if (!isEmpty(matchValue_2)) {
354
+ if (isEmpty(tail(matchValue_2))) {
355
+ matchResult = 7;
356
+ v_5 = head(matchValue_2);
357
+ }
358
+ else {
359
+ matchResult = 10;
360
+ op = matchValue_1;
361
+ }
362
+ }
363
+ else {
364
+ matchResult = 10;
365
+ op = matchValue_1;
366
+ }
367
+ break;
368
+ }
369
+ case "less": {
370
+ if (!isEmpty(matchValue_2)) {
371
+ if (isEmpty(tail(matchValue_2))) {
372
+ matchResult = 8;
373
+ v_6 = head(matchValue_2);
374
+ }
375
+ else {
376
+ matchResult = 10;
377
+ op = matchValue_1;
378
+ }
379
+ }
380
+ else {
381
+ matchResult = 10;
382
+ op = matchValue_1;
383
+ }
384
+ break;
385
+ }
386
+ case "all": {
387
+ matchResult = 9;
388
+ vals_4 = matchValue_2;
389
+ break;
390
+ }
391
+ default: {
392
+ matchResult = 10;
393
+ op = matchValue_1;
394
+ }
395
+ }
396
+ switch (matchResult) {
397
+ case 0:
398
+ return `When ${fieldLabel} = ${v!}`;
399
+ case 1:
400
+ return `When ${fieldLabel} is ${join(" or ", vals_2!)}`;
401
+ case 2:
402
+ return `When ${fieldLabel} is any of ${length(vals_3!)} values`;
403
+ case 3:
404
+ return `When ${fieldLabel} = ${v_1!}`;
405
+ case 4:
406
+ return `When ${fieldLabel} ≠ ${v_2!}`;
407
+ case 5:
408
+ return `When ${fieldLabel} ≥ ${v_3!}`;
409
+ case 6:
410
+ return `When ${fieldLabel} > ${v_4!}`;
411
+ case 7:
412
+ return `When ${fieldLabel} ≤ ${v_5!}`;
413
+ case 8:
414
+ return `When ${fieldLabel} < ${v_6!}`;
415
+ case 9:
416
+ return `When ${fieldLabel} has all of: ${join(", ", vals_4!)}`;
417
+ default:
418
+ return `When ${fieldLabel} ${op!}`;
419
+ }
420
+ }
421
+ else {
422
+ return `When ${fieldLabel} (${length(matchValue)} conditions)`;
423
+ }
424
+ }
425
+ else {
426
+ return `When ${fieldLabel} (always)`;
427
+ }
428
+ }
429
+
430
+ export function generateActionLabel(trigger: ItemTrigger): string {
431
+ const matchValue: FSharpList<TriggerAction> = trigger.Actions;
432
+ if (!isEmpty(matchValue)) {
433
+ if (isEmpty(tail(matchValue))) {
434
+ const matchValue_1: string = head(matchValue).ActionType.toLowerCase();
435
+ switch (matchValue_1) {
436
+ case "alert":
437
+ return `Create Alert: ${param("category_name", head(matchValue))}`;
438
+ case "task": {
439
+ const p: string = param("priority", head(matchValue));
440
+ return `Create ${(p === "1") ? "High " : ((p === "3") ? "Low " : "")}Task: ${param("category_name", head(matchValue))}`;
441
+ }
442
+ case "recurring_task":
443
+ return `Schedule: ${param("category_name", head(matchValue))}`;
444
+ case "medset":
445
+ return `Order Medset: ${param("medset_name", head(matchValue))}`;
446
+ case "problem":
447
+ return "Add to Problem List";
448
+ default:
449
+ return `Execute: ${matchValue_1}`;
450
+ }
451
+ }
452
+ else {
453
+ const joined: string = join(", ", List_distinct<string>(map<TriggerAction, string>((a: TriggerAction): string => a.ActionType, matchValue), {
454
+ Equals: (x: string, y: string): boolean => (x === y),
455
+ GetHashCode: stringHash,
456
+ }));
457
+ return `Execute ${length(matchValue)} actions: ${joined}`;
458
+ }
459
+ }
460
+ else {
461
+ return "No actions";
462
+ }
463
+ }
464
+
465
+ export function convertTriggerToPathway(trigger: ItemTrigger, parentItemId: int32, items: FSharpList<TemplateItem>, itemFieldKeyMap: FSharpMap<int32, Shared_FieldKey>): ClinicalPathway_ClinicalPathwaySpec {
466
+ const tid: int32 = trigger.TriggerId | 0;
467
+ const startKey: Shared_StateKey = new Shared_StateKey(stableGuid(`t${tid}_start`));
468
+ const evalKey: Shared_StateKey = new Shared_StateKey(stableGuid(`t${tid}_eval`));
469
+ const actionKey: Shared_StateKey = new Shared_StateKey(stableGuid(`t${tid}_action`));
470
+ const endKey: Shared_StateKey = new Shared_StateKey(stableGuid(`t${tid}_end`));
471
+ const evalLabel: string = generateEvaluationLabel(trigger, items);
472
+ const actionLabel: string = generateActionLabel(trigger);
473
+ const startState: ClinicalPathway_StateDefinition = new ClinicalPathway_StateDefinition(startKey, "Start", 0, ClinicalPathway_StateType_Evaluation(new ClinicalPathway_EvaluationInfo("", undefined)), undefined);
474
+ const evalState: ClinicalPathway_StateDefinition = new ClinicalPathway_StateDefinition(evalKey, evalLabel, 1, ClinicalPathway_StateType_Evaluation(new ClinicalPathway_EvaluationInfo("", undefined)), undefined);
475
+ let actionState: ClinicalPathway_StateDefinition;
476
+ const actions: FSharpList<ClinicalPathway_ActionInfo_$union> = map<TriggerAction, ClinicalPathway_ActionInfo_$union>(convertAction, trigger.Actions);
477
+ actionState = (new ClinicalPathway_StateDefinition(actionKey, actionLabel, 2, isEmpty(actions) ? ClinicalPathway_StateType_CompoundAction(actions) : (isEmpty(tail(actions)) ? ClinicalPathway_StateType_Action(head(actions)) : ClinicalPathway_StateType_CompoundAction(actions)), undefined));
478
+ const endState: ClinicalPathway_StateDefinition = new ClinicalPathway_StateDefinition(endKey, "Complete", 3, ClinicalPathway_StateType_Terminal(new ClinicalPathway_TerminalInfo("Complete", "Trigger evaluation complete", undefined)), undefined);
479
+ const condition: ClinicalPathway_TransitionCondition_$union = combineConditions(trigger.Conditions, itemFieldKeyMap);
480
+ const transitions: FSharpList<ClinicalPathway_TransitionDefinition> = ofArray([new ClinicalPathway_TransitionDefinition(new Shared_TransitionKey(stableGuid(`t${tid}_start_to_eval`)), startKey, evalKey, ClinicalPathway_TransitionCondition_Always(), undefined), new ClinicalPathway_TransitionDefinition(new Shared_TransitionKey(stableGuid(`t${tid}_eval_to_action`)), evalKey, actionKey, condition, 0), new ClinicalPathway_TransitionDefinition(new Shared_TransitionKey(stableGuid(`t${tid}_action_to_end`)), actionKey, endKey, ClinicalPathway_TransitionCondition_Always(), undefined)]);
481
+ return new ClinicalPathway_ClinicalPathwaySpec(`item_trigger_${tid}`, `Trigger ${tid}: ${actionLabel}`, "1.0.0", "CoreMR Conduit - Item Trigger", ClinicalPathway_PathwayExecutionMode_TriggerBased(new ClinicalPathway_TriggerBasedConfig(convertTiming(trigger.EventName), true)), startKey, ofArray([startState, evalState, actionState, endState]), transitions, empty<ClinicalPathway_ConstraintDefinition>(), empty<ClinicalPathway_PathRequirement>(), utcNow(), undefined, undefined, 1);
482
+ }
483
+
484
+ export function convertFormTriggersToPathway(form: TemplateForm, itemFieldKeyMap: FSharpMap<int32, Shared_FieldKey>): Option<ClinicalPathway_ClinicalPathwaySpec> {
485
+ const allTriggers: FSharpList<[int32, ItemTrigger]> = filter<[int32, ItemTrigger]>((tupledArg_1: [int32, ItemTrigger]): boolean => {
486
+ const t_2: ItemTrigger = tupledArg_1[1];
487
+ if (t_2.Enabled) {
488
+ return !isEmpty(t_2.Actions);
489
+ }
490
+ else {
491
+ return false;
492
+ }
493
+ }, List_distinctBy<[int32, ItemTrigger], int32>((tupledArg: [int32, ItemTrigger]): int32 => tupledArg[1].TriggerId, collect<TemplateItem, [int32, ItemTrigger]>((item: TemplateItem): FSharpList<[int32, ItemTrigger]> => map<ItemTrigger, [int32, ItemTrigger]>((t: ItemTrigger): [int32, ItemTrigger] => ([item.ItemId, t] as [int32, ItemTrigger]), item.Triggers), form.Items), {
494
+ Equals: (x: int32, y: int32): boolean => (x === y),
495
+ GetHashCode: numberHash,
496
+ }));
497
+ if (!isEmpty(allTriggers)) {
498
+ if (isEmpty(tail(allTriggers))) {
499
+ return convertTriggerToPathway(head(allTriggers)[1], head(allTriggers)[0], form.Items, itemFieldKeyMap);
500
+ }
501
+ else {
502
+ const pathwayId = `form_${form.FormId}_pathway`;
503
+ const startKey: Shared_StateKey = new Shared_StateKey(stableGuid(`${pathwayId}_start`));
504
+ let allStates: FSharpList<ClinicalPathway_StateDefinition> = singleton(new ClinicalPathway_StateDefinition(startKey, "Start", 0, ClinicalPathway_StateType_Evaluation(new ClinicalPathway_EvaluationInfo("", undefined)), undefined));
505
+ let allTransitions: FSharpList<ClinicalPathway_TransitionDefinition> = empty<ClinicalPathway_TransitionDefinition>();
506
+ const enumerator: IEnumerator<[int32, [int32, ItemTrigger]]> = getEnumerator(indexed<[int32, ItemTrigger]>(allTriggers));
507
+ try {
508
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
509
+ const forLoopVar: [int32, [int32, ItemTrigger]] = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
510
+ const trigger: ItemTrigger = forLoopVar[1][1];
511
+ const idx: int32 = forLoopVar[0] | 0;
512
+ const tid: int32 = trigger.TriggerId | 0;
513
+ const evalKey: Shared_StateKey = new Shared_StateKey(stableGuid(`${pathwayId}_eval_${tid}`));
514
+ const actionKey: Shared_StateKey = new Shared_StateKey(stableGuid(`${pathwayId}_action_${tid}`));
515
+ const endKey: Shared_StateKey = new Shared_StateKey(stableGuid(`${pathwayId}_end_${tid}`));
516
+ const evalLabel: string = generateEvaluationLabel(trigger, form.Items);
517
+ const actionLabel: string = generateActionLabel(trigger);
518
+ const evalState: ClinicalPathway_StateDefinition = new ClinicalPathway_StateDefinition(evalKey, evalLabel, (idx * 3) + 1, ClinicalPathway_StateType_Evaluation(new ClinicalPathway_EvaluationInfo("", undefined)), undefined);
519
+ const actions: FSharpList<ClinicalPathway_ActionInfo_$union> = map<TriggerAction, ClinicalPathway_ActionInfo_$union>(convertAction, trigger.Actions);
520
+ const actionState: ClinicalPathway_StateDefinition = new ClinicalPathway_StateDefinition(actionKey, actionLabel, (idx * 3) + 2, isEmpty(actions) ? ClinicalPathway_StateType_CompoundAction(actions) : (isEmpty(tail(actions)) ? ClinicalPathway_StateType_Action(head(actions)) : ClinicalPathway_StateType_CompoundAction(actions)), undefined);
521
+ const endState: ClinicalPathway_StateDefinition = new ClinicalPathway_StateDefinition(endKey, "Complete", (idx * 3) + 3, ClinicalPathway_StateType_Terminal(new ClinicalPathway_TerminalInfo("Complete", `Trigger ${tid} complete`, undefined)), undefined);
522
+ const condition: ClinicalPathway_TransitionCondition_$union = combineConditions(trigger.Conditions, itemFieldKeyMap);
523
+ const transitions: FSharpList<ClinicalPathway_TransitionDefinition> = ofArray([new ClinicalPathway_TransitionDefinition(new Shared_TransitionKey(stableGuid(`${pathwayId}_start_to_eval_${tid}`)), startKey, evalKey, ClinicalPathway_TransitionCondition_Always(), idx), new ClinicalPathway_TransitionDefinition(new Shared_TransitionKey(stableGuid(`${pathwayId}_eval_to_action_${tid}`)), evalKey, actionKey, condition, idx), new ClinicalPathway_TransitionDefinition(new Shared_TransitionKey(stableGuid(`${pathwayId}_action_to_end_${tid}`)), actionKey, endKey, ClinicalPathway_TransitionCondition_Always(), undefined)]);
524
+ allStates = append(allStates, ofArray([evalState, actionState, endState]));
525
+ allTransitions = append(allTransitions, transitions);
526
+ }
527
+ }
528
+ finally {
529
+ disposeSafe(enumerator as IDisposable);
530
+ }
531
+ const primaryTiming: string = defaultArg(map_1<[string, int32], string>((tuple_1: [string, int32]): string => tuple_1[0], tryHead<[string, int32]>(sortByDescending<[string, int32], int32>((tuple: [string, int32]): int32 => tuple[1], List_countBy<string, string>((x_1: string): string => x_1, map<[int32, ItemTrigger], string>((tupledArg_2: [int32, ItemTrigger]): string => tupledArg_2[1].EventName, allTriggers), {
532
+ Equals: (x_2: string, y_1: string): boolean => (x_2 === y_1),
533
+ GetHashCode: stringHash,
534
+ }), {
535
+ Compare: comparePrimitives,
536
+ }))), "save");
537
+ return new ClinicalPathway_ClinicalPathwaySpec(pathwayId, `${form.Name} - Clinical Pathway`, "1.0.0", "CoreMR Conduit - Unified Item Triggers", (length(allTriggers) > 1) ? ClinicalPathway_PathwayExecutionMode_MultiPathway(new ClinicalPathway_MultiPathwayConfig(ClinicalPathway_CombinationStrategy_AllMatching(), ClinicalPathway_ConflictResolution_CombineActions(), undefined)) : ClinicalPathway_PathwayExecutionMode_TriggerBased(new ClinicalPathway_TriggerBasedConfig(convertTiming(primaryTiming), true)), startKey, allStates, allTransitions, empty<ClinicalPathway_ConstraintDefinition>(), empty<ClinicalPathway_PathRequirement>(), utcNow(), undefined, undefined, 1);
538
+ }
539
+ }
540
+ else {
541
+ return undefined;
542
+ }
543
+ }
544
+
545
+ //# sourceMappingURL=ItemTriggerConverter.ts.map