@olaboot/esm-form-engine-lib 4.1.0

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 (628) hide show
  1. package/LICENSE.txt +401 -0
  2. package/README.md +202 -0
  3. package/dist/adapters/control-adapter.d.ts +3 -0
  4. package/dist/adapters/control-adapter.d.ts.map +1 -0
  5. package/dist/adapters/control-adapter.js +17 -0
  6. package/dist/adapters/encounter-datetime-adapter.d.ts +3 -0
  7. package/dist/adapters/encounter-datetime-adapter.d.ts.map +1 -0
  8. package/dist/adapters/encounter-datetime-adapter.js +26 -0
  9. package/dist/adapters/encounter-diagnosis-adapter.d.ts +10 -0
  10. package/dist/adapters/encounter-diagnosis-adapter.d.ts.map +1 -0
  11. package/dist/adapters/encounter-diagnosis-adapter.js +89 -0
  12. package/dist/adapters/encounter-diagnosis-adapter.test.js +217 -0
  13. package/dist/adapters/encounter-location-adapter.d.ts +3 -0
  14. package/dist/adapters/encounter-location-adapter.d.ts.map +1 -0
  15. package/dist/adapters/encounter-location-adapter.js +25 -0
  16. package/dist/adapters/encounter-provider-adapter.d.ts +3 -0
  17. package/dist/adapters/encounter-provider-adapter.d.ts.map +1 -0
  18. package/dist/adapters/encounter-provider-adapter.js +34 -0
  19. package/dist/adapters/encounter-role-adapter.d.ts +3 -0
  20. package/dist/adapters/encounter-role-adapter.d.ts.map +1 -0
  21. package/dist/adapters/encounter-role-adapter.js +40 -0
  22. package/dist/adapters/inline-date-adapter.d.ts +3 -0
  23. package/dist/adapters/inline-date-adapter.d.ts.map +1 -0
  24. package/dist/adapters/inline-date-adapter.js +56 -0
  25. package/dist/adapters/obs-adapter.d.ts +29 -0
  26. package/dist/adapters/obs-adapter.d.ts.map +1 -0
  27. package/dist/adapters/obs-adapter.js +284 -0
  28. package/dist/adapters/obs-adapter.test.js +1443 -0
  29. package/dist/adapters/obs-comment-adapter.d.ts +4 -0
  30. package/dist/adapters/obs-comment-adapter.d.ts.map +1 -0
  31. package/dist/adapters/obs-comment-adapter.js +52 -0
  32. package/dist/adapters/orders-adapter.d.ts +4 -0
  33. package/dist/adapters/orders-adapter.d.ts.map +1 -0
  34. package/dist/adapters/orders-adapter.js +64 -0
  35. package/dist/adapters/patient-identifier-adapter.d.ts +3 -0
  36. package/dist/adapters/patient-identifier-adapter.d.ts.map +1 -0
  37. package/dist/adapters/patient-identifier-adapter.js +40 -0
  38. package/dist/adapters/person-attribute-adapter.d.ts +3 -0
  39. package/dist/adapters/person-attribute-adapter.d.ts.map +1 -0
  40. package/dist/adapters/person-attribute-adapter.js +39 -0
  41. package/dist/adapters/person-attribute-adapter.test.js +146 -0
  42. package/dist/adapters/program-state-adapter.d.ts +3 -0
  43. package/dist/adapters/program-state-adapter.d.ts.map +1 -0
  44. package/dist/adapters/program-state-adapter.js +41 -0
  45. package/dist/adapters/program-state-adapter.test.js +411 -0
  46. package/dist/api/index.d.ts +27 -0
  47. package/dist/api/index.d.ts.map +1 -0
  48. package/dist/api/index.js +170 -0
  49. package/dist/components/error/error-modal.component.d.ts +7 -0
  50. package/dist/components/error/error-modal.component.d.ts.map +1 -0
  51. package/dist/components/error/error-modal.component.js +31 -0
  52. package/dist/components/error/error.scss +4 -0
  53. package/dist/components/extension/extension-parcel.component.d.ts +5 -0
  54. package/dist/components/extension/extension-parcel.component.d.ts.map +1 -0
  55. package/dist/components/extension/extension-parcel.component.js +35 -0
  56. package/dist/components/field-label/field-label.component.d.ts +12 -0
  57. package/dist/components/field-label/field-label.component.d.ts.map +1 -0
  58. package/dist/components/field-label/field-label.component.js +33 -0
  59. package/dist/components/field-label/field-label.scss +15 -0
  60. package/dist/components/group/obs-group.component.d.ts +5 -0
  61. package/dist/components/group/obs-group.component.d.ts.map +1 -0
  62. package/dist/components/group/obs-group.component.js +48 -0
  63. package/dist/components/group/obs-group.scss +16 -0
  64. package/dist/components/inputs/content-switcher/content-switcher.component.d.ts +5 -0
  65. package/dist/components/inputs/content-switcher/content-switcher.component.d.ts.map +1 -0
  66. package/dist/components/inputs/content-switcher/content-switcher.component.js +70 -0
  67. package/dist/components/inputs/content-switcher/content-switcher.scss +55 -0
  68. package/dist/components/inputs/date/date.component.d.ts +5 -0
  69. package/dist/components/inputs/date/date.component.d.ts.map +1 -0
  70. package/dist/components/inputs/date/date.component.js +125 -0
  71. package/dist/components/inputs/date/date.scss +37 -0
  72. package/dist/components/inputs/date/date.test.js +85 -0
  73. package/dist/components/inputs/file/file-thumbnail.component.d.ts +10 -0
  74. package/dist/components/inputs/file/file-thumbnail.component.d.ts.map +1 -0
  75. package/dist/components/inputs/file/file-thumbnail.component.js +51 -0
  76. package/dist/components/inputs/file/file-thumbnail.scss +42 -0
  77. package/dist/components/inputs/file/file.component.d.ts +5 -0
  78. package/dist/components/inputs/file/file.component.d.ts.map +1 -0
  79. package/dist/components/inputs/file/file.component.js +90 -0
  80. package/dist/components/inputs/file/file.scss +21 -0
  81. package/dist/components/inputs/fixed-value/fixed-value.component.d.ts +5 -0
  82. package/dist/components/inputs/fixed-value/fixed-value.component.d.ts.map +1 -0
  83. package/dist/components/inputs/fixed-value/fixed-value.component.js +14 -0
  84. package/dist/components/inputs/markdown/markdown-wrapper.component.d.ts +6 -0
  85. package/dist/components/inputs/markdown/markdown-wrapper.component.d.ts.map +1 -0
  86. package/dist/components/inputs/markdown/markdown-wrapper.component.js +20 -0
  87. package/dist/components/inputs/markdown/markdown.component.d.ts +5 -0
  88. package/dist/components/inputs/markdown/markdown.component.d.ts.map +1 -0
  89. package/dist/components/inputs/markdown/markdown.component.js +26 -0
  90. package/dist/components/inputs/multi-select/multi-select.component.d.ts +5 -0
  91. package/dist/components/inputs/multi-select/multi-select.component.d.ts.map +1 -0
  92. package/dist/components/inputs/multi-select/multi-select.component.js +134 -0
  93. package/dist/components/inputs/multi-select/multi-select.scss +25 -0
  94. package/dist/components/inputs/multi-select/multi-select.test.js +106 -0
  95. package/dist/components/inputs/number/number.component.d.ts +5 -0
  96. package/dist/components/inputs/number/number.component.d.ts.map +1 -0
  97. package/dist/components/inputs/number/number.component.js +77 -0
  98. package/dist/components/inputs/number/number.scss +15 -0
  99. package/dist/components/inputs/number/number.test.js +98 -0
  100. package/dist/components/inputs/radio/radio.component.d.ts +5 -0
  101. package/dist/components/inputs/radio/radio.component.d.ts.map +1 -0
  102. package/dist/components/inputs/radio/radio.component.js +69 -0
  103. package/dist/components/inputs/radio/radio.scss +36 -0
  104. package/dist/components/inputs/radio/radio.test.js +190 -0
  105. package/dist/components/inputs/select/dropdown.component.d.ts +5 -0
  106. package/dist/components/inputs/select/dropdown.component.d.ts.map +1 -0
  107. package/dist/components/inputs/select/dropdown.component.js +82 -0
  108. package/dist/components/inputs/select/dropdown.scss +11 -0
  109. package/dist/components/inputs/select/dropdown.test.js +157 -0
  110. package/dist/components/inputs/text/text.component.d.ts +5 -0
  111. package/dist/components/inputs/text/text.component.d.ts.map +1 -0
  112. package/dist/components/inputs/text/text.component.js +62 -0
  113. package/dist/components/inputs/text/text.scss +15 -0
  114. package/dist/components/inputs/text/text.test.js +184 -0
  115. package/dist/components/inputs/text-area/text-area.component.d.ts +5 -0
  116. package/dist/components/inputs/text-area/text-area.component.d.ts.map +1 -0
  117. package/dist/components/inputs/text-area/text-area.component.js +60 -0
  118. package/dist/components/inputs/text-area/text-area.scss +11 -0
  119. package/dist/components/inputs/toggle/toggle.component.d.ts +5 -0
  120. package/dist/components/inputs/toggle/toggle.component.d.ts.map +1 -0
  121. package/dist/components/inputs/toggle/toggle.component.js +57 -0
  122. package/dist/components/inputs/toggle/toggle.scss +12 -0
  123. package/dist/components/inputs/ui-select-extended/ui-select-extended.component.d.ts +5 -0
  124. package/dist/components/inputs/ui-select-extended/ui-select-extended.component.d.ts.map +1 -0
  125. package/dist/components/inputs/ui-select-extended/ui-select-extended.component.js +203 -0
  126. package/dist/components/inputs/ui-select-extended/ui-select-extended.scss +19 -0
  127. package/dist/components/inputs/ui-select-extended/ui-select-extended.test.js +250 -0
  128. package/dist/components/inputs/unspecified/unspecified.component.d.ts +11 -0
  129. package/dist/components/inputs/unspecified/unspecified.component.d.ts.map +1 -0
  130. package/dist/components/inputs/unspecified/unspecified.component.js +65 -0
  131. package/dist/components/inputs/unspecified/unspecified.scss +7 -0
  132. package/dist/components/inputs/unspecified/unspecified.test.js +152 -0
  133. package/dist/components/inputs/workspace-launcher/workspace-launcher.component.d.ts +5 -0
  134. package/dist/components/inputs/workspace-launcher/workspace-launcher.component.d.ts.map +1 -0
  135. package/dist/components/inputs/workspace-launcher/workspace-launcher.component.js +64 -0
  136. package/dist/components/inputs/workspace-launcher/workspace-launcher.scss +21 -0
  137. package/dist/components/inputs/workspace-launcher/workspace-launcher.test.js +174 -0
  138. package/dist/components/label/label.component.d.ts +8 -0
  139. package/dist/components/label/label.component.d.ts.map +1 -0
  140. package/dist/components/label/label.component.js +15 -0
  141. package/dist/components/label/label.scss +15 -0
  142. package/dist/components/loaders/loader.component.d.ts +4 -0
  143. package/dist/components/loaders/loader.component.d.ts.map +1 -0
  144. package/dist/components/loaders/loader.component.js +14 -0
  145. package/dist/components/loaders/loader.scss +20 -0
  146. package/dist/components/patient-banner/patient-banner.component.d.ts +7 -0
  147. package/dist/components/patient-banner/patient-banner.component.d.ts.map +1 -0
  148. package/dist/components/patient-banner/patient-banner.component.js +16 -0
  149. package/dist/components/patient-banner/patient-banner.scss +12 -0
  150. package/dist/components/previous-value-review/previous-value-review.component.d.ts +12 -0
  151. package/dist/components/previous-value-review/previous-value-review.component.d.ts.map +1 -0
  152. package/dist/components/previous-value-review/previous-value-review.component.js +29 -0
  153. package/dist/components/previous-value-review/previous-value-review.scss +36 -0
  154. package/dist/components/processor-factory/form-processor-factory.component.d.ts +10 -0
  155. package/dist/components/processor-factory/form-processor-factory.component.d.ts.map +1 -0
  156. package/dist/components/processor-factory/form-processor-factory.component.js +114 -0
  157. package/dist/components/renderer/custom-hooks-renderer.component.d.ts +13 -0
  158. package/dist/components/renderer/custom-hooks-renderer.component.d.ts.map +1 -0
  159. package/dist/components/renderer/custom-hooks-renderer.component.js +13 -0
  160. package/dist/components/renderer/field/fieldLogic.d.ts +16 -0
  161. package/dist/components/renderer/field/fieldLogic.d.ts.map +1 -0
  162. package/dist/components/renderer/field/fieldLogic.js +238 -0
  163. package/dist/components/renderer/field/fieldLogic.test.js +140 -0
  164. package/dist/components/renderer/field/fieldRenderUtils.d.ts +9 -0
  165. package/dist/components/renderer/field/fieldRenderUtils.d.ts.map +1 -0
  166. package/dist/components/renderer/field/fieldRenderUtils.js +8 -0
  167. package/dist/components/renderer/field/fieldRenderUtils.test.js +51 -0
  168. package/dist/components/renderer/field/form-field-renderer.component.d.ts +19 -0
  169. package/dist/components/renderer/field/form-field-renderer.component.d.ts.map +1 -0
  170. package/dist/components/renderer/field/form-field-renderer.component.js +214 -0
  171. package/dist/components/renderer/field/form-field-renderer.scss +5 -0
  172. package/dist/components/renderer/form/form-renderer.component.d.ts +10 -0
  173. package/dist/components/renderer/form/form-renderer.component.d.ts.map +1 -0
  174. package/dist/components/renderer/form/form-renderer.component.js +102 -0
  175. package/dist/components/renderer/form/state.d.ts +41 -0
  176. package/dist/components/renderer/form/state.d.ts.map +1 -0
  177. package/dist/components/renderer/form/state.js +69 -0
  178. package/dist/components/renderer/page/page.renderer.component.d.ts +9 -0
  179. package/dist/components/renderer/page/page.renderer.component.d.ts.map +1 -0
  180. package/dist/components/renderer/page/page.renderer.component.js +85 -0
  181. package/dist/components/renderer/page/page.renderer.scss +74 -0
  182. package/dist/components/renderer/section/section-renderer.component.d.ts +6 -0
  183. package/dist/components/renderer/section/section-renderer.component.d.ts.map +1 -0
  184. package/dist/components/renderer/section/section-renderer.component.js +20 -0
  185. package/dist/components/renderer/section/section-renderer.scss +19 -0
  186. package/dist/components/repeat/helpers.d.ts +6 -0
  187. package/dist/components/repeat/helpers.d.ts.map +1 -0
  188. package/dist/components/repeat/helpers.js +64 -0
  189. package/dist/components/repeat/helpers.test.js +25 -0
  190. package/dist/components/repeat/repeat-controls.component.d.ts +12 -0
  191. package/dist/components/repeat/repeat-controls.component.d.ts.map +1 -0
  192. package/dist/components/repeat/repeat-controls.component.js +22 -0
  193. package/dist/components/repeat/repeat-controls.scss +7 -0
  194. package/dist/components/repeat/repeat.component.d.ts +5 -0
  195. package/dist/components/repeat/repeat.component.d.ts.map +1 -0
  196. package/dist/components/repeat/repeat.component.js +185 -0
  197. package/dist/components/repeat/repeat.scss +30 -0
  198. package/dist/components/repeat/repeat.test.js +25 -0
  199. package/dist/components/sidebar/page-observer.d.ts +20 -0
  200. package/dist/components/sidebar/page-observer.d.ts.map +1 -0
  201. package/dist/components/sidebar/page-observer.js +60 -0
  202. package/dist/components/sidebar/sidebar.component.d.ts +14 -0
  203. package/dist/components/sidebar/sidebar.component.d.ts.map +1 -0
  204. package/dist/components/sidebar/sidebar.component.js +77 -0
  205. package/dist/components/sidebar/sidebar.scss +114 -0
  206. package/dist/components/sidebar/useCurrentActivePage.d.ts +34 -0
  207. package/dist/components/sidebar/useCurrentActivePage.d.ts.map +1 -0
  208. package/dist/components/sidebar/useCurrentActivePage.js +114 -0
  209. package/dist/components/sidebar/useCurrentActivePage.test.js +208 -0
  210. package/dist/components/sidebar/usePageObserver.d.ts +11 -0
  211. package/dist/components/sidebar/usePageObserver.d.ts.map +1 -0
  212. package/dist/components/sidebar/usePageObserver.js +42 -0
  213. package/dist/components/value/value.component.d.ts +6 -0
  214. package/dist/components/value/value.component.d.ts.map +1 -0
  215. package/dist/components/value/value.component.js +24 -0
  216. package/dist/components/value/value.scss +17 -0
  217. package/dist/components/value/view/field-value-view.component.d.ts +10 -0
  218. package/dist/components/value/view/field-value-view.component.d.ts.map +1 -0
  219. package/dist/components/value/view/field-value-view.component.js +29 -0
  220. package/dist/components/value/view/field-value-view.scss +31 -0
  221. package/dist/constants.d.ts +9 -0
  222. package/dist/constants.d.ts.map +1 -0
  223. package/dist/constants.js +13 -0
  224. package/dist/datasources/concept-data-source.d.ts +6 -0
  225. package/dist/datasources/concept-data-source.d.ts.map +1 -0
  226. package/dist/datasources/concept-data-source.js +35 -0
  227. package/dist/datasources/data-source.d.ts +10 -0
  228. package/dist/datasources/data-source.d.ts.map +1 -0
  229. package/dist/datasources/data-source.js +41 -0
  230. package/dist/datasources/encounter-role-datasource.d.ts +6 -0
  231. package/dist/datasources/encounter-role-datasource.d.ts.map +1 -0
  232. package/dist/datasources/encounter-role-datasource.js +13 -0
  233. package/dist/datasources/historical-data-source.d.ts +6 -0
  234. package/dist/datasources/historical-data-source.d.ts.map +1 -0
  235. package/dist/datasources/historical-data-source.js +24 -0
  236. package/dist/datasources/location-data-source.d.ts +6 -0
  237. package/dist/datasources/location-data-source.d.ts.map +1 -0
  238. package/dist/datasources/location-data-source.js +24 -0
  239. package/dist/datasources/provider-datasource.d.ts +6 -0
  240. package/dist/datasources/provider-datasource.d.ts.map +1 -0
  241. package/dist/datasources/provider-datasource.js +13 -0
  242. package/dist/datasources/select-concept-answers-datasource.d.ts +9 -0
  243. package/dist/datasources/select-concept-answers-datasource.d.ts.map +1 -0
  244. package/dist/datasources/select-concept-answers-datasource.js +19 -0
  245. package/dist/declarations.d.js +0 -0
  246. package/dist/external-function-context.d.ts +7 -0
  247. package/dist/external-function-context.d.ts.map +1 -0
  248. package/dist/external-function-context.js +2 -0
  249. package/dist/form-engine.component.d.ts +23 -0
  250. package/dist/form-engine.component.d.ts.map +1 -0
  251. package/dist/form-engine.component.js +174 -0
  252. package/dist/form-engine.scss +148 -0
  253. package/dist/form-engine.test.js +1253 -0
  254. package/dist/globals.d.ts +3 -0
  255. package/dist/globals.d.ts.map +1 -0
  256. package/dist/globals.js +2 -0
  257. package/dist/hooks/useConcepts.d.ts +23 -0
  258. package/dist/hooks/useConcepts.d.ts.map +1 -0
  259. package/dist/hooks/useConcepts.js +31 -0
  260. package/dist/hooks/useDataSourceDependentValue.d.ts +4 -0
  261. package/dist/hooks/useDataSourceDependentValue.d.ts.map +1 -0
  262. package/dist/hooks/useDataSourceDependentValue.js +14 -0
  263. package/dist/hooks/useEncounter.d.ts +7 -0
  264. package/dist/hooks/useEncounter.d.ts.map +1 -0
  265. package/dist/hooks/useEncounter.js +38 -0
  266. package/dist/hooks/useEncounterRole.d.ts +7 -0
  267. package/dist/hooks/useEncounterRole.d.ts.map +1 -0
  268. package/dist/hooks/useEncounterRole.js +18 -0
  269. package/dist/hooks/useEvaluateFormFieldExpressions.d.ts +7 -0
  270. package/dist/hooks/useEvaluateFormFieldExpressions.d.ts.map +1 -0
  271. package/dist/hooks/useEvaluateFormFieldExpressions.js +112 -0
  272. package/dist/hooks/useExternalFormAction.d.ts +43 -0
  273. package/dist/hooks/useExternalFormAction.d.ts.map +1 -0
  274. package/dist/hooks/useExternalFormAction.js +71 -0
  275. package/dist/hooks/useFormCollapse.d.ts +6 -0
  276. package/dist/hooks/useFormCollapse.d.ts.map +1 -0
  277. package/dist/hooks/useFormCollapse.js +35 -0
  278. package/dist/hooks/useFormFieldValidators.d.ts +3 -0
  279. package/dist/hooks/useFormFieldValidators.d.ts.map +1 -0
  280. package/dist/hooks/useFormFieldValidators.js +20 -0
  281. package/dist/hooks/useFormFieldValueAdapters.d.ts +3 -0
  282. package/dist/hooks/useFormFieldValueAdapters.d.ts.map +1 -0
  283. package/dist/hooks/useFormFieldValueAdapters.js +21 -0
  284. package/dist/hooks/useFormFields.d.ts +6 -0
  285. package/dist/hooks/useFormFields.d.ts.map +1 -0
  286. package/dist/hooks/useFormFields.js +62 -0
  287. package/dist/hooks/useFormFieldsMeta.d.ts +4 -0
  288. package/dist/hooks/useFormFieldsMeta.d.ts.map +1 -0
  289. package/dist/hooks/useFormFieldsMeta.js +42 -0
  290. package/dist/hooks/useFormJson.d.ts +19 -0
  291. package/dist/hooks/useFormJson.d.ts.map +1 -0
  292. package/dist/hooks/useFormJson.js +198 -0
  293. package/dist/hooks/useFormJson.test.js +194 -0
  294. package/dist/hooks/useFormStateHelpers.d.ts +15 -0
  295. package/dist/hooks/useFormStateHelpers.d.ts.map +1 -0
  296. package/dist/hooks/useFormStateHelpers.js +83 -0
  297. package/dist/hooks/useFormWorkspaceSize.d.ts +7 -0
  298. package/dist/hooks/useFormWorkspaceSize.d.ts.map +1 -0
  299. package/dist/hooks/useFormWorkspaceSize.js +46 -0
  300. package/dist/hooks/useFormWorkspaceSize.test.js +141 -0
  301. package/dist/hooks/useInitialValues.d.ts +9 -0
  302. package/dist/hooks/useInitialValues.d.ts.map +1 -0
  303. package/dist/hooks/useInitialValues.js +29 -0
  304. package/dist/hooks/useInitialValues.test.js +78 -0
  305. package/dist/hooks/usePatientData.d.ts +6 -0
  306. package/dist/hooks/usePatientData.d.ts.map +1 -0
  307. package/dist/hooks/usePatientData.js +30 -0
  308. package/dist/hooks/usePatientPrograms.d.ts +7 -0
  309. package/dist/hooks/usePatientPrograms.d.ts.map +1 -0
  310. package/dist/hooks/usePatientPrograms.js +22 -0
  311. package/dist/hooks/usePostSubmissionActions.d.ts +13 -0
  312. package/dist/hooks/usePostSubmissionActions.d.ts.map +1 -0
  313. package/dist/hooks/usePostSubmissionActions.js +23 -0
  314. package/dist/hooks/usePostSubmissionActions.test.js +55 -0
  315. package/dist/hooks/useProcessorDependencies.d.ts +8 -0
  316. package/dist/hooks/useProcessorDependencies.d.ts.map +1 -0
  317. package/dist/hooks/useProcessorDependencies.js +33 -0
  318. package/dist/index.d.ts +12 -0
  319. package/dist/index.d.ts.map +1 -0
  320. package/dist/index.js +11 -0
  321. package/dist/lifecycle.d.ts +11 -0
  322. package/dist/lifecycle.d.ts.map +1 -0
  323. package/dist/lifecycle.js +25 -0
  324. package/dist/post-submission-actions/mark-patient-deceased-action.d.ts +4 -0
  325. package/dist/post-submission-actions/mark-patient-deceased-action.d.ts.map +1 -0
  326. package/dist/post-submission-actions/mark-patient-deceased-action.js +53 -0
  327. package/dist/post-submission-actions/program-enrollment-action.d.ts +4 -0
  328. package/dist/post-submission-actions/program-enrollment-action.d.ts.map +1 -0
  329. package/dist/post-submission-actions/program-enrollment-action.js +105 -0
  330. package/dist/processors/encounter/encounter-form-processor.d.ts +26 -0
  331. package/dist/processors/encounter/encounter-form-processor.d.ts.map +1 -0
  332. package/dist/processors/encounter/encounter-form-processor.js +376 -0
  333. package/dist/processors/encounter/encounter-form-processor.test.js +207 -0
  334. package/dist/processors/encounter/encounter-processor-helper.d.ts +19 -0
  335. package/dist/processors/encounter/encounter-processor-helper.d.ts.map +1 -0
  336. package/dist/processors/encounter/encounter-processor-helper.js +293 -0
  337. package/dist/processors/form-processor.d.ts +25 -0
  338. package/dist/processors/form-processor.d.ts.map +1 -0
  339. package/dist/processors/form-processor.js +26 -0
  340. package/dist/provider/form-factory-helper.d.ts +8 -0
  341. package/dist/provider/form-factory-helper.d.ts.map +1 -0
  342. package/dist/provider/form-factory-helper.js +73 -0
  343. package/dist/provider/form-factory-provider.d.ts +48 -0
  344. package/dist/provider/form-factory-provider.d.ts.map +1 -0
  345. package/dist/provider/form-factory-provider.js +136 -0
  346. package/dist/provider/form-provider.d.ts +26 -0
  347. package/dist/provider/form-provider.d.ts.map +1 -0
  348. package/dist/provider/form-provider.js +17 -0
  349. package/dist/registry/inbuilt-components/InbuiltPostSubmissionActions.d.ts +4 -0
  350. package/dist/registry/inbuilt-components/InbuiltPostSubmissionActions.d.ts.map +1 -0
  351. package/dist/registry/inbuilt-components/InbuiltPostSubmissionActions.js +10 -0
  352. package/dist/registry/inbuilt-components/control-templates.d.ts +4 -0
  353. package/dist/registry/inbuilt-components/control-templates.d.ts.map +1 -0
  354. package/dist/registry/inbuilt-components/control-templates.js +54 -0
  355. package/dist/registry/inbuilt-components/inbuiltControls.d.ts +7 -0
  356. package/dist/registry/inbuilt-components/inbuiltControls.d.ts.map +1 -0
  357. package/dist/registry/inbuilt-components/inbuiltControls.js +94 -0
  358. package/dist/registry/inbuilt-components/inbuiltDataSources.d.ts +8 -0
  359. package/dist/registry/inbuilt-components/inbuiltDataSources.d.ts.map +1 -0
  360. package/dist/registry/inbuilt-components/inbuiltDataSources.js +36 -0
  361. package/dist/registry/inbuilt-components/inbuiltFieldValueAdapters.d.ts +4 -0
  362. package/dist/registry/inbuilt-components/inbuiltFieldValueAdapters.d.ts.map +1 -0
  363. package/dist/registry/inbuilt-components/inbuiltFieldValueAdapters.js +71 -0
  364. package/dist/registry/inbuilt-components/inbuiltTransformers.d.ts +4 -0
  365. package/dist/registry/inbuilt-components/inbuiltTransformers.d.ts.map +1 -0
  366. package/dist/registry/inbuilt-components/inbuiltTransformers.js +7 -0
  367. package/dist/registry/inbuilt-components/inbuiltValidators.d.ts +7 -0
  368. package/dist/registry/inbuilt-components/inbuiltValidators.d.ts.map +1 -0
  369. package/dist/registry/inbuilt-components/inbuiltValidators.js +29 -0
  370. package/dist/registry/inbuilt-components/template-component-map.d.ts +5 -0
  371. package/dist/registry/inbuilt-components/template-component-map.d.ts.map +1 -0
  372. package/dist/registry/inbuilt-components/template-component-map.js +27 -0
  373. package/dist/registry/registry.d.ts +61 -0
  374. package/dist/registry/registry.d.ts.map +1 -0
  375. package/dist/registry/registry.js +184 -0
  376. package/dist/registry/registry.test.js +17 -0
  377. package/dist/setup-tests.js +30 -0
  378. package/dist/transformers/default-schema-transformer.d.ts +4 -0
  379. package/dist/transformers/default-schema-transformer.d.ts.map +1 -0
  380. package/dist/transformers/default-schema-transformer.js +308 -0
  381. package/dist/transformers/default-schema-transformer.test.js +319 -0
  382. package/dist/types/domain.d.ts +219 -0
  383. package/dist/types/domain.d.ts.map +1 -0
  384. package/dist/types/domain.js +1 -0
  385. package/dist/types/index.d.ts +126 -0
  386. package/dist/types/index.d.ts.map +1 -0
  387. package/dist/types/index.js +2 -0
  388. package/dist/types/schema.d.ts +243 -0
  389. package/dist/types/schema.d.ts.map +1 -0
  390. package/dist/types/schema.js +1 -0
  391. package/dist/typings.d.js +1 -0
  392. package/dist/utils/boolean-utils.d.ts +13 -0
  393. package/dist/utils/boolean-utils.d.ts.map +1 -0
  394. package/dist/utils/boolean-utils.js +22 -0
  395. package/dist/utils/common-expression-helpers.d.ts +261 -0
  396. package/dist/utils/common-expression-helpers.d.ts.map +1 -0
  397. package/dist/utils/common-expression-helpers.js +538 -0
  398. package/dist/utils/common-expression-helpers.test.js +461 -0
  399. package/dist/utils/common-utils.d.ts +51 -0
  400. package/dist/utils/common-utils.d.ts.map +1 -0
  401. package/dist/utils/common-utils.js +102 -0
  402. package/dist/utils/common-utils.test.js +134 -0
  403. package/dist/utils/error-utils.d.ts +11 -0
  404. package/dist/utils/error-utils.d.ts.map +1 -0
  405. package/dist/utils/error-utils.js +34 -0
  406. package/dist/utils/expression-runner.d.ts +25 -0
  407. package/dist/utils/expression-runner.d.ts.map +1 -0
  408. package/dist/utils/expression-runner.js +104 -0
  409. package/dist/utils/expression-runner.test.js +362 -0
  410. package/dist/utils/form-helper.d.ts +37 -0
  411. package/dist/utils/form-helper.d.ts.map +1 -0
  412. package/dist/utils/form-helper.js +239 -0
  413. package/dist/utils/form-helper.test.js +638 -0
  414. package/dist/utils/form-page-utils.d.ts +3 -0
  415. package/dist/utils/form-page-utils.d.ts.map +1 -0
  416. package/dist/utils/form-page-utils.js +10 -0
  417. package/dist/utils/forms-loader.d.ts +45 -0
  418. package/dist/utils/forms-loader.d.ts.map +1 -0
  419. package/dist/utils/forms-loader.js +246 -0
  420. package/dist/utils/forms-loader.test.js +333 -0
  421. package/dist/utils/post-submission-action-helper.d.ts +2 -0
  422. package/dist/utils/post-submission-action-helper.d.ts.map +1 -0
  423. package/dist/utils/post-submission-action-helper.js +57 -0
  424. package/dist/utils/test-utils.js +66 -0
  425. package/dist/utils/zscore-service.d.ts +6 -0
  426. package/dist/utils/zscore-service.d.ts.map +1 -0
  427. package/dist/utils/zscore-service.js +54 -0
  428. package/dist/validators/conditional-answered-validator.d.ts +3 -0
  429. package/dist/validators/conditional-answered-validator.d.ts.map +1 -0
  430. package/dist/validators/conditional-answered-validator.js +18 -0
  431. package/dist/validators/conditional-answered-validator.test.js +63 -0
  432. package/dist/validators/date-validator.d.ts +3 -0
  433. package/dist/validators/date-validator.d.ts.map +1 -0
  434. package/dist/validators/date-validator.js +21 -0
  435. package/dist/validators/date-validator.test.js +53 -0
  436. package/dist/validators/default-value-validator.d.ts +3 -0
  437. package/dist/validators/default-value-validator.d.ts.map +1 -0
  438. package/dist/validators/default-value-validator.js +46 -0
  439. package/dist/validators/default-value-validator.test.js +95 -0
  440. package/dist/validators/form-validator.d.ts +9 -0
  441. package/dist/validators/form-validator.d.ts.map +1 -0
  442. package/dist/validators/form-validator.js +82 -0
  443. package/dist/validators/form-validator.test.js +158 -0
  444. package/dist/validators/js-expression-validator.d.ts +3 -0
  445. package/dist/validators/js-expression-validator.d.ts.map +1 -0
  446. package/dist/validators/js-expression-validator.js +25 -0
  447. package/dist/validators/js-expression-validator.test.js +115 -0
  448. package/dist/validators/schema.d.ts +1 -0
  449. package/dist/validators/schema.d.ts.map +1 -0
  450. package/dist/validators/schema.js +32 -0
  451. package/dist/zscore/bfa_boys_5_above.json +2522 -0
  452. package/dist/zscore/bfa_girls_5_above.json +2522 -0
  453. package/dist/zscore/hfa_boys_5_above.json +2186 -0
  454. package/dist/zscore/hfa_boys_below5.json +22286 -0
  455. package/dist/zscore/hfa_girls_5_above.json +2186 -0
  456. package/dist/zscore/hfa_girls_below5.json +22286 -0
  457. package/dist/zscore/wfl_boys_below5.json +7814 -0
  458. package/dist/zscore/wfl_girls_below5.json +7814 -0
  459. package/dist/zscore-tests/bmi-age.test.js +84 -0
  460. package/dist/zscore-tests/height-age.test.js +88 -0
  461. package/dist/zscore-tests/weight-height.test.js +82 -0
  462. package/package.json +105 -0
  463. package/src/adapters/control-adapter.ts +29 -0
  464. package/src/adapters/encounter-datetime-adapter.ts +38 -0
  465. package/src/adapters/encounter-diagnosis-adapter.ts +121 -0
  466. package/src/adapters/encounter-location-adapter.ts +39 -0
  467. package/src/adapters/encounter-provider-adapter.ts +48 -0
  468. package/src/adapters/encounter-role-adapter.ts +54 -0
  469. package/src/adapters/inline-date-adapter.ts +59 -0
  470. package/src/adapters/obs-adapter.ts +349 -0
  471. package/src/adapters/obs-comment-adapter.ts +61 -0
  472. package/src/adapters/orders-adapter.ts +82 -0
  473. package/src/adapters/patient-identifier-adapter.ts +46 -0
  474. package/src/adapters/person-attribute-adapter.ts +45 -0
  475. package/src/adapters/program-state-adapter.ts +57 -0
  476. package/src/api/index.ts +224 -0
  477. package/src/components/error/error-modal.component.tsx +37 -0
  478. package/src/components/error/error.scss +4 -0
  479. package/src/components/extension/extension-parcel.component.tsx +32 -0
  480. package/src/components/field-label/field-label.component.tsx +55 -0
  481. package/src/components/field-label/field-label.scss +15 -0
  482. package/src/components/group/obs-group.component.tsx +59 -0
  483. package/src/components/group/obs-group.scss +16 -0
  484. package/src/components/inputs/content-switcher/content-switcher.component.tsx +81 -0
  485. package/src/components/inputs/content-switcher/content-switcher.scss +55 -0
  486. package/src/components/inputs/date/date.component.tsx +141 -0
  487. package/src/components/inputs/date/date.scss +37 -0
  488. package/src/components/inputs/file/file-thumbnail.component.tsx +55 -0
  489. package/src/components/inputs/file/file-thumbnail.scss +42 -0
  490. package/src/components/inputs/file/file.component.tsx +98 -0
  491. package/src/components/inputs/file/file.scss +21 -0
  492. package/src/components/inputs/fixed-value/fixed-value.component.tsx +19 -0
  493. package/src/components/inputs/markdown/markdown-wrapper.component.tsx +14 -0
  494. package/src/components/inputs/markdown/markdown.component.tsx +24 -0
  495. package/src/components/inputs/multi-select/multi-select.component.tsx +152 -0
  496. package/src/components/inputs/multi-select/multi-select.scss +25 -0
  497. package/src/components/inputs/number/number.component.tsx +85 -0
  498. package/src/components/inputs/number/number.scss +15 -0
  499. package/src/components/inputs/radio/radio.component.tsx +81 -0
  500. package/src/components/inputs/radio/radio.scss +36 -0
  501. package/src/components/inputs/select/dropdown.component.tsx +86 -0
  502. package/src/components/inputs/select/dropdown.scss +11 -0
  503. package/src/components/inputs/text/text.component.tsx +67 -0
  504. package/src/components/inputs/text/text.scss +15 -0
  505. package/src/components/inputs/text-area/text-area.component.tsx +63 -0
  506. package/src/components/inputs/text-area/text-area.scss +11 -0
  507. package/src/components/inputs/toggle/toggle.component.tsx +66 -0
  508. package/src/components/inputs/toggle/toggle.scss +12 -0
  509. package/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx +208 -0
  510. package/src/components/inputs/ui-select-extended/ui-select-extended.scss +19 -0
  511. package/src/components/inputs/unspecified/unspecified.component.tsx +84 -0
  512. package/src/components/inputs/unspecified/unspecified.scss +7 -0
  513. package/src/components/inputs/workspace-launcher/workspace-launcher.component.tsx +80 -0
  514. package/src/components/inputs/workspace-launcher/workspace-launcher.scss +21 -0
  515. package/src/components/label/label.component.tsx +20 -0
  516. package/src/components/label/label.scss +15 -0
  517. package/src/components/loaders/loader.component.tsx +16 -0
  518. package/src/components/loaders/loader.scss +20 -0
  519. package/src/components/patient-banner/patient-banner.component.tsx +20 -0
  520. package/src/components/patient-banner/patient-banner.scss +12 -0
  521. package/src/components/previous-value-review/previous-value-review.component.tsx +49 -0
  522. package/src/components/previous-value-review/previous-value-review.scss +36 -0
  523. package/src/components/processor-factory/form-processor-factory.component.tsx +128 -0
  524. package/src/components/renderer/custom-hooks-renderer.component.tsx +30 -0
  525. package/src/components/renderer/field/fieldLogic.ts +314 -0
  526. package/src/components/renderer/field/fieldRenderUtils.ts +16 -0
  527. package/src/components/renderer/field/form-field-renderer.component.tsx +291 -0
  528. package/src/components/renderer/field/form-field-renderer.scss +5 -0
  529. package/src/components/renderer/form/form-renderer.component.tsx +123 -0
  530. package/src/components/renderer/form/state.ts +59 -0
  531. package/src/components/renderer/page/page.renderer.component.tsx +120 -0
  532. package/src/components/renderer/page/page.renderer.scss +74 -0
  533. package/src/components/renderer/section/section-renderer.component.tsx +25 -0
  534. package/src/components/renderer/section/section-renderer.scss +19 -0
  535. package/src/components/repeat/helpers.ts +77 -0
  536. package/src/components/repeat/repeat-controls.component.tsx +38 -0
  537. package/src/components/repeat/repeat-controls.scss +7 -0
  538. package/src/components/repeat/repeat.component.tsx +206 -0
  539. package/src/components/repeat/repeat.scss +30 -0
  540. package/src/components/sidebar/page-observer.ts +58 -0
  541. package/src/components/sidebar/sidebar.component.tsx +121 -0
  542. package/src/components/sidebar/sidebar.scss +114 -0
  543. package/src/components/sidebar/useCurrentActivePage.ts +137 -0
  544. package/src/components/sidebar/usePageObserver.ts +45 -0
  545. package/src/components/value/value.component.tsx +30 -0
  546. package/src/components/value/value.scss +17 -0
  547. package/src/components/value/view/field-value-view.component.tsx +36 -0
  548. package/src/components/value/view/field-value-view.scss +31 -0
  549. package/src/constants.ts +14 -0
  550. package/src/datasources/concept-data-source.ts +42 -0
  551. package/src/datasources/data-source.ts +34 -0
  552. package/src/datasources/encounter-role-datasource.ts +15 -0
  553. package/src/datasources/historical-data-source.ts +11 -0
  554. package/src/datasources/location-data-source.ts +27 -0
  555. package/src/datasources/provider-datasource.ts +15 -0
  556. package/src/datasources/select-concept-answers-datasource.ts +25 -0
  557. package/src/declarations.d.ts +2 -0
  558. package/src/external-function-context.tsx +8 -0
  559. package/src/form-engine.component.tsx +222 -0
  560. package/src/form-engine.scss +148 -0
  561. package/src/globals.ts +2 -0
  562. package/src/hooks/useConcepts.ts +58 -0
  563. package/src/hooks/useDataSourceDependentValue.ts +16 -0
  564. package/src/hooks/useEncounter.ts +40 -0
  565. package/src/hooks/useEncounterRole.ts +15 -0
  566. package/src/hooks/useEvaluateFormFieldExpressions.ts +152 -0
  567. package/src/hooks/useExternalFormAction.ts +94 -0
  568. package/src/hooks/useFormCollapse.ts +36 -0
  569. package/src/hooks/useFormFieldValidators.ts +22 -0
  570. package/src/hooks/useFormFieldValueAdapters.ts +23 -0
  571. package/src/hooks/useFormFields.ts +65 -0
  572. package/src/hooks/useFormFieldsMeta.ts +48 -0
  573. package/src/hooks/useFormJson.ts +257 -0
  574. package/src/hooks/useFormStateHelpers.ts +72 -0
  575. package/src/hooks/useFormWorkspaceSize.ts +52 -0
  576. package/src/hooks/useInitialValues.ts +39 -0
  577. package/src/hooks/usePatientData.ts +32 -0
  578. package/src/hooks/usePatientPrograms.ts +38 -0
  579. package/src/hooks/usePostSubmissionActions.ts +31 -0
  580. package/src/hooks/useProcessorDependencies.ts +42 -0
  581. package/src/index.ts +11 -0
  582. package/src/lifecycle.ts +32 -0
  583. package/src/post-submission-actions/mark-patient-deceased-action.ts +68 -0
  584. package/src/post-submission-actions/program-enrollment-action.ts +137 -0
  585. package/src/processors/encounter/encounter-form-processor.ts +445 -0
  586. package/src/processors/encounter/encounter-processor-helper.ts +387 -0
  587. package/src/processors/form-processor.ts +40 -0
  588. package/src/provider/form-factory-helper.ts +106 -0
  589. package/src/provider/form-factory-provider.tsx +211 -0
  590. package/src/provider/form-provider.tsx +39 -0
  591. package/src/registry/inbuilt-components/InbuiltPostSubmissionActions.ts +13 -0
  592. package/src/registry/inbuilt-components/control-templates.ts +57 -0
  593. package/src/registry/inbuilt-components/inbuiltControls.ts +99 -0
  594. package/src/registry/inbuilt-components/inbuiltDataSources.ts +41 -0
  595. package/src/registry/inbuilt-components/inbuiltFieldValueAdapters.ts +74 -0
  596. package/src/registry/inbuilt-components/inbuiltTransformers.ts +10 -0
  597. package/src/registry/inbuilt-components/inbuiltValidators.ts +33 -0
  598. package/src/registry/inbuilt-components/template-component-map.ts +28 -0
  599. package/src/registry/registry.ts +290 -0
  600. package/src/transformers/default-schema-transformer.ts +340 -0
  601. package/src/types/domain.ts +237 -0
  602. package/src/types/index.ts +153 -0
  603. package/src/types/schema.ts +259 -0
  604. package/src/typings.d.ts +9 -0
  605. package/src/utils/boolean-utils.ts +25 -0
  606. package/src/utils/common-expression-helpers.ts +636 -0
  607. package/src/utils/common-utils.ts +108 -0
  608. package/src/utils/error-utils.ts +37 -0
  609. package/src/utils/expression-runner.ts +172 -0
  610. package/src/utils/form-helper.ts +283 -0
  611. package/src/utils/form-page-utils.ts +13 -0
  612. package/src/utils/forms-loader.ts +306 -0
  613. package/src/utils/post-submission-action-helper.ts +71 -0
  614. package/src/utils/zscore-service.ts +59 -0
  615. package/src/validators/conditional-answered-validator.ts +17 -0
  616. package/src/validators/date-validator.ts +19 -0
  617. package/src/validators/default-value-validator.ts +36 -0
  618. package/src/validators/form-validator.ts +95 -0
  619. package/src/validators/js-expression-validator.ts +44 -0
  620. package/src/validators/schema.ts +34 -0
  621. package/src/zscore/bfa_boys_5_above.json +2522 -0
  622. package/src/zscore/bfa_girls_5_above.json +2522 -0
  623. package/src/zscore/hfa_boys_5_above.json +2186 -0
  624. package/src/zscore/hfa_boys_below5.json +22286 -0
  625. package/src/zscore/hfa_girls_5_above.json +2186 -0
  626. package/src/zscore/hfa_girls_below5.json +22286 -0
  627. package/src/zscore/wfl_boys_below5.json +7814 -0
  628. package/src/zscore/wfl_girls_below5.json +7814 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,401 @@
1
+ Mozilla Public License, version 2.0
2
+
3
+ 1. Definitions
4
+
5
+ 1.1. "Contributor"
6
+
7
+ means each individual or legal entity that creates, contributes to the
8
+ creation of, or owns Covered Software.
9
+
10
+ 1.2. "Contributor Version"
11
+
12
+ means the combination of the Contributions of others (if any) used by a
13
+ Contributor and that particular Contributor's Contribution.
14
+
15
+ 1.3. "Contribution"
16
+
17
+ means Covered Software of a particular Contributor.
18
+
19
+ 1.4. "Covered Software"
20
+
21
+ means Source Code Form to which the initial Contributor has attached the
22
+ notice in Exhibit A, the Executable Form of such Source Code Form, and
23
+ Modifications of such Source Code Form, in each case including portions
24
+ thereof.
25
+
26
+ 1.5. "Incompatible With Secondary Licenses"
27
+ means
28
+
29
+ a. that the initial Contributor has attached the notice described in
30
+ Exhibit B to the Covered Software; or
31
+
32
+ b. that the Covered Software was made available under the terms of
33
+ version 1.1 or earlier of the License, but not also under the terms of
34
+ a Secondary License.
35
+
36
+ 1.6. "Executable Form"
37
+
38
+ means any form of the work other than Source Code Form.
39
+
40
+ 1.7. "Larger Work"
41
+
42
+ means a work that combines Covered Software with other material, in a
43
+ separate file or files, that is not Covered Software.
44
+
45
+ 1.8. "License"
46
+
47
+ means this document.
48
+
49
+ 1.9. "Licensable"
50
+
51
+ means having the right to grant, to the maximum extent possible, whether
52
+ at the time of the initial grant or subsequently, any and all of the
53
+ rights conveyed by this License.
54
+
55
+ 1.10. "Modifications"
56
+
57
+ means any of the following:
58
+
59
+ a. any file in Source Code Form that results from an addition to,
60
+ deletion from, or modification of the contents of Covered Software; or
61
+
62
+ b. any new file in Source Code Form that contains any Covered Software.
63
+
64
+ 1.11. "Patent Claims" of a Contributor
65
+
66
+ means any patent claim(s), including without limitation, method,
67
+ process, and apparatus claims, in any patent Licensable by such
68
+ Contributor that would be infringed, but for the grant of the License,
69
+ by the making, using, selling, offering for sale, having made, import,
70
+ or transfer of either its Contributions or its Contributor Version.
71
+
72
+ 1.12. "Secondary License"
73
+
74
+ means either the GNU General Public License, Version 2.0, the GNU Lesser
75
+ General Public License, Version 2.1, the GNU Affero General Public
76
+ License, Version 3.0, or any later versions of those licenses.
77
+
78
+ 1.13. "Source Code Form"
79
+
80
+ means the form of the work preferred for making modifications.
81
+
82
+ 1.14. "You" (or "Your")
83
+
84
+ means an individual or a legal entity exercising rights under this
85
+ License. For legal entities, "You" includes any entity that controls, is
86
+ controlled by, or is under common control with You. For purposes of this
87
+ definition, "control" means (a) the power, direct or indirect, to cause
88
+ the direction or management of such entity, whether by contract or
89
+ otherwise, or (b) ownership of more than fifty percent (50%) of the
90
+ outstanding shares or beneficial ownership of such entity.
91
+
92
+
93
+ 2. License Grants and Conditions
94
+
95
+ 2.1. Grants
96
+
97
+ Each Contributor hereby grants You a world-wide, royalty-free,
98
+ non-exclusive license:
99
+
100
+ a. under intellectual property rights (other than patent or trademark)
101
+ Licensable by such Contributor to use, reproduce, make available,
102
+ modify, display, perform, distribute, and otherwise exploit its
103
+ Contributions, either on an unmodified basis, with Modifications, or
104
+ as part of a Larger Work; and
105
+
106
+ b. under Patent Claims of such Contributor to make, use, sell, offer for
107
+ sale, have made, import, and otherwise transfer either its
108
+ Contributions or its Contributor Version.
109
+
110
+ 2.2. Effective Date
111
+
112
+ The licenses granted in Section 2.1 with respect to any Contribution
113
+ become effective for each Contribution on the date the Contributor first
114
+ distributes such Contribution.
115
+
116
+ 2.3. Limitations on Grant Scope
117
+
118
+ The licenses granted in this Section 2 are the only rights granted under
119
+ this License. No additional rights or licenses will be implied from the
120
+ distribution or licensing of Covered Software under this License.
121
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
122
+ Contributor:
123
+
124
+ a. for any code that a Contributor has removed from Covered Software; or
125
+
126
+ b. for infringements caused by: (i) Your and any other third party's
127
+ modifications of Covered Software, or (ii) the combination of its
128
+ Contributions with other software (except as part of its Contributor
129
+ Version); or
130
+
131
+ c. under Patent Claims infringed by Covered Software in the absence of
132
+ its Contributions.
133
+
134
+ This License does not grant any rights in the trademarks, service marks,
135
+ or logos of any Contributor (except as may be necessary to comply with
136
+ the notice requirements in Section 3.4).
137
+
138
+ 2.4. Subsequent Licenses
139
+
140
+ No Contributor makes additional grants as a result of Your choice to
141
+ distribute the Covered Software under a subsequent version of this
142
+ License (see Section 10.2) or under the terms of a Secondary License (if
143
+ permitted under the terms of Section 3.3).
144
+
145
+ 2.5. Representation
146
+
147
+ Each Contributor represents that the Contributor believes its
148
+ Contributions are its original creation(s) or it has sufficient rights to
149
+ grant the rights to its Contributions conveyed by this License.
150
+
151
+ 2.6. Fair Use
152
+
153
+ This License is not intended to limit any rights You have under
154
+ applicable copyright doctrines of fair use, fair dealing, or other
155
+ equivalents.
156
+
157
+ 2.7. Conditions
158
+
159
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
160
+ Section 2.1.
161
+
162
+
163
+ 3. Responsibilities
164
+
165
+ 3.1. Distribution of Source Form
166
+
167
+ All distribution of Covered Software in Source Code Form, including any
168
+ Modifications that You create or to which You contribute, must be under
169
+ the terms of this License. You must inform recipients that the Source
170
+ Code Form of the Covered Software is governed by the terms of this
171
+ License, and how they can obtain a copy of this License. You may not
172
+ attempt to alter or restrict the recipients' rights in the Source Code
173
+ Form.
174
+
175
+ 3.2. Distribution of Executable Form
176
+
177
+ If You distribute Covered Software in Executable Form then:
178
+
179
+ a. such Covered Software must also be made available in Source Code Form,
180
+ as described in Section 3.1, and You must inform recipients of the
181
+ Executable Form how they can obtain a copy of such Source Code Form by
182
+ reasonable means in a timely manner, at a charge no more than the cost
183
+ of distribution to the recipient; and
184
+
185
+ b. You may distribute such Executable Form under the terms of this
186
+ License, or sublicense it under different terms, provided that the
187
+ license for the Executable Form does not attempt to limit or alter the
188
+ recipients' rights in the Source Code Form under this License.
189
+
190
+ 3.3. Distribution of a Larger Work
191
+
192
+ You may create and distribute a Larger Work under terms of Your choice,
193
+ provided that You also comply with the requirements of this License for
194
+ the Covered Software. If the Larger Work is a combination of Covered
195
+ Software with a work governed by one or more Secondary Licenses, and the
196
+ Covered Software is not Incompatible With Secondary Licenses, this
197
+ License permits You to additionally distribute such Covered Software
198
+ under the terms of such Secondary License(s), so that the recipient of
199
+ the Larger Work may, at their option, further distribute the Covered
200
+ Software under the terms of either this License or such Secondary
201
+ License(s).
202
+
203
+ 3.4. Notices
204
+
205
+ You may not remove or alter the substance of any license notices
206
+ (including copyright notices, patent notices, disclaimers of warranty, or
207
+ limitations of liability) contained within the Source Code Form of the
208
+ Covered Software, except that You may alter any license notices to the
209
+ extent required to remedy known factual inaccuracies.
210
+
211
+ 3.5. Application of Additional Terms
212
+
213
+ You may choose to offer, and to charge a fee for, warranty, support,
214
+ indemnity or liability obligations to one or more recipients of Covered
215
+ Software. However, You may do so only on Your own behalf, and not on
216
+ behalf of any Contributor. You must make it absolutely clear that any
217
+ such warranty, support, indemnity, or liability obligation is offered by
218
+ You alone, and You hereby agree to indemnify every Contributor for any
219
+ liability incurred by such Contributor as a result of warranty, support,
220
+ indemnity or liability terms You offer. You may include additional
221
+ disclaimers of warranty and limitations of liability specific to any
222
+ jurisdiction.
223
+
224
+ 4. Inability to Comply Due to Statute or Regulation
225
+
226
+ If it is impossible for You to comply with any of the terms of this License
227
+ with respect to some or all of the Covered Software due to statute,
228
+ judicial order, or regulation then You must: (a) comply with the terms of
229
+ this License to the maximum extent possible; and (b) describe the
230
+ limitations and the code they affect. Such description must be placed in a
231
+ text file included with all distributions of the Covered Software under
232
+ this License. Except to the extent prohibited by statute or regulation,
233
+ such description must be sufficiently detailed for a recipient of ordinary
234
+ skill to be able to understand it.
235
+
236
+ 5. Termination
237
+
238
+ 5.1. The rights granted under this License will terminate automatically if You
239
+ fail to comply with any of its terms. However, if You become compliant,
240
+ then the rights granted under this License from a particular Contributor
241
+ are reinstated (a) provisionally, unless and until such Contributor
242
+ explicitly and finally terminates Your grants, and (b) on an ongoing
243
+ basis, if such Contributor fails to notify You of the non-compliance by
244
+ some reasonable means prior to 60 days after You have come back into
245
+ compliance. Moreover, Your grants from a particular Contributor are
246
+ reinstated on an ongoing basis if such Contributor notifies You of the
247
+ non-compliance by some reasonable means, this is the first time You have
248
+ received notice of non-compliance with this License from such
249
+ Contributor, and You become compliant prior to 30 days after Your receipt
250
+ of the notice.
251
+
252
+ 5.2. If You initiate litigation against any entity by asserting a patent
253
+ infringement claim (excluding declaratory judgment actions,
254
+ counter-claims, and cross-claims) alleging that a Contributor Version
255
+ directly or indirectly infringes any patent, then the rights granted to
256
+ You by any and all Contributors for the Covered Software under Section
257
+ 2.1 of this License shall terminate.
258
+
259
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
260
+ license agreements (excluding distributors and resellers) which have been
261
+ validly granted by You or Your distributors under this License prior to
262
+ termination shall survive termination.
263
+
264
+ 6. Disclaimer of Warranty
265
+
266
+ Covered Software is provided under this License on an "as is" basis,
267
+ without warranty of any kind, either expressed, implied, or statutory,
268
+ including, without limitation, warranties that the Covered Software is free
269
+ of defects, merchantable, fit for a particular purpose or non-infringing.
270
+ The entire risk as to the quality and performance of the Covered Software
271
+ is with You. Should any Covered Software prove defective in any respect,
272
+ You (not any Contributor) assume the cost of any necessary servicing,
273
+ repair, or correction. This disclaimer of warranty constitutes an essential
274
+ part of this License. No use of any Covered Software is authorized under
275
+ this License except under this disclaimer.
276
+
277
+ 7. Limitation of Liability
278
+
279
+ Under no circumstances and under no legal theory, whether tort (including
280
+ negligence), contract, or otherwise, shall any Contributor, or anyone who
281
+ distributes Covered Software as permitted above, be liable to You for any
282
+ direct, indirect, special, incidental, or consequential damages of any
283
+ character including, without limitation, damages for lost profits, loss of
284
+ goodwill, work stoppage, computer failure or malfunction, or any and all
285
+ other commercial damages or losses, even if such party shall have been
286
+ informed of the possibility of such damages. This limitation of liability
287
+ shall not apply to liability for death or personal injury resulting from
288
+ such party's negligence to the extent applicable law prohibits such
289
+ limitation. Some jurisdictions do not allow the exclusion or limitation of
290
+ incidental or consequential damages, so this exclusion and limitation may
291
+ not apply to You.
292
+
293
+ 8. Litigation
294
+
295
+ Any litigation relating to this License may be brought only in the courts
296
+ of a jurisdiction where the defendant maintains its principal place of
297
+ business and such litigation shall be governed by laws of that
298
+ jurisdiction, without reference to its conflict-of-law provisions. Nothing
299
+ in this Section shall prevent a party's ability to bring cross-claims or
300
+ counter-claims.
301
+
302
+ 9. Miscellaneous
303
+
304
+ This License represents the complete agreement concerning the subject
305
+ matter hereof. If any provision of this License is held to be
306
+ unenforceable, such provision shall be reformed only to the extent
307
+ necessary to make it enforceable. Any law or regulation which provides that
308
+ the language of a contract shall be construed against the drafter shall not
309
+ be used to construe this License against a Contributor.
310
+
311
+
312
+ 10. Versions of the License
313
+
314
+ 10.1. New Versions
315
+
316
+ Mozilla Foundation is the license steward. Except as provided in Section
317
+ 10.3, no one other than the license steward has the right to modify or
318
+ publish new versions of this License. Each version will be given a
319
+ distinguishing version number.
320
+
321
+ 10.2. Effect of New Versions
322
+
323
+ You may distribute the Covered Software under the terms of the version
324
+ of the License under which You originally received the Covered Software,
325
+ or under the terms of any subsequent version published by the license
326
+ steward.
327
+
328
+ 10.3. Modified Versions
329
+
330
+ If you create software not governed by this License, and you want to
331
+ create a new license for such software, you may create and use a
332
+ modified version of this License if you rename the license and remove
333
+ any references to the name of the license steward (except to note that
334
+ such modified license differs from this License).
335
+
336
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
337
+ Licenses If You choose to distribute Source Code Form that is
338
+ Incompatible With Secondary Licenses under the terms of this version of
339
+ the License, the notice described in Exhibit B of this License must be
340
+ attached.
341
+
342
+ Exhibit A - Source Code Form License Notice
343
+
344
+ This Source Code Form is subject to the
345
+ terms of the Mozilla Public License, v.
346
+ 2.0. If a copy of the MPL was not
347
+ distributed with this file, You can
348
+ obtain one at
349
+ http://mozilla.org/MPL/2.0/.
350
+
351
+ If it is not possible or desirable to put the notice in a particular file,
352
+ then You may include the notice in a location (such as a LICENSE file in a
353
+ relevant directory) where a recipient would be likely to look for such a
354
+ notice.
355
+
356
+ You may add additional accurate notices of copyright ownership.
357
+
358
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
359
+
360
+ This Source Code Form is "Incompatible
361
+ With Secondary Licenses", as defined by
362
+ the Mozilla Public License, v. 2.0.
363
+
364
+ ---------------------
365
+
366
+ Healthcare Disclaimer
367
+
368
+ In the United States, or any other jurisdictions where they may apply, the
369
+ following additional disclaimer of warranty and limitation of liability are
370
+ hereby incorporated into the terms and conditions of MPL 2.0:
371
+
372
+ 1. No warranties of any kind whatsoever are made as to the results that
373
+ You will obtain from relying upon the covered code (or any information
374
+ or content obtained by way of the covered code), including but not
375
+ limited to compliance with privacy laws or regulations or clinical
376
+ care industry standards and protocols. Use of the covered code is not
377
+ a substitute for a health care provider’s standard practice or
378
+ professional judgment. Any decision with regard to the appropriateness
379
+ of treatment, or the validity or reliability of information or content
380
+ made available by the covered code, is the sole responsibility of the
381
+ health care provider. Consequently, it is incumbent upon each health
382
+ care provider to verify all medical history and treatment plans with
383
+ each patient.
384
+
385
+ 2. Under no circumstances and under no legal theory, whether tort
386
+ (including negligence), contract, or otherwise, shall any Contributor,
387
+ or anyone who distributes Covered Software as permitted by the
388
+ license, be liable to You for any indirect, special, incidental,
389
+ consequential damages of any character including, without limitation,
390
+ damages for loss of goodwill, work stoppage, computer failure or
391
+ malfunction, or any and all other damages or losses, of any nature
392
+ whatsoever (direct or otherwise) on account of or associated with the
393
+ use or inability to use the covered content (including, without
394
+ limitation, the use of information or content made available by the
395
+ covered code, all documentation associated therewith, and the failure
396
+ of the covered code to comply with privacy laws and regulations or
397
+ clinical care industry standards and protocols), even if such party
398
+ shall have been informed of the possibility of such damages.
399
+
400
+ Copyright (c) OpenMRS Inc.
401
+ OpenMRS is a registered trademark and the OpenMRS graphic logo is a trademark of OpenMRS Inc.
package/README.md ADDED
@@ -0,0 +1,202 @@
1
+ <div id="top"></div>
2
+
3
+ :wave: *New to O3? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://o3-docs.openmrs.org/).* :teacher:
4
+
5
+ # OpenMRS ESM Form Engine Library
6
+
7
+ ![GitHub release](https://img.shields.io/github/v/release/openmrs/openmrs-esm-form-engine-lib)
8
+ ![OpenMRS CI](https://github.com/openmrs/openmrs-esm-form-engine-lib/actions/workflows/ci.yml/badge.svg)
9
+
10
+ <img src="readme/form-engine.jpeg" alt="https://raw.githubusercontent.com/openmrs/openmrs-esm-form-engine-lib/main/readme/form-engine.jpeg" >
11
+
12
+ The OpenMRS Form Engine is a React library that enables the creation and rendering of standardized medical forms within the OpenMRS 3 (O3) ecosystem. It provides a flexible, JSON-based form schema system with built-in validation, conditional rendering, and multilingual support - making it ideal for complex healthcare data collection needs.
13
+
14
+ O3 form schemas are written in JSON and conform to the [O3 standard JSON schema spec](https://github.com/openmrs/openmrs-contrib-json-schemas/blob/main/form.schema.json) which defines the structure and constraints of the form data. The [O3 reference application](https://o3.openmrs.org/openmrs/spa) ships an embedded [Form Builder](https://github.com/openmrs/openmrs-esm-form-builder) that users can leverage to build forms interactively, using the interactive schema builder, or by writing code into the built-in JSON schema editor.
15
+
16
+ The Form Engine is a versatile library that can be integrated into any frontend module within the O3 ecosystem that requires form rendering capabilities. It's currently used in the following modules:
17
+
18
+ - [Form Builder](https://github.com/openmrs/openmrs-esm-form-builder) - where the form rendering in the Form Preview component is powered by the Form Engine
19
+ - [Patient Chart](https://github.com/openmrs/openmrs-esm-patient-chart) - specifically in the form engine wrapper app where the form engine is used to render clinical forms in the patient chart workspace
20
+
21
+ Key features of the Form Engine include:
22
+
23
+ - **Validation** - The form engine enables the validation of form data based on the form schema. Arbitrarily complex validation rules can be defined within the schema and evaluated by the form engine.
24
+ - **Subforms** - The form engine supports the rendering of subforms within a form. This allows for the creation of complex forms that can be reused across multiple forms.
25
+ - **Conditional rendering** - The form engine supports the conditional rendering of form fields based on the values of other form fields. This allows for the creation of dynamic forms that can adapt to the user's input.
26
+ - **Data sources** - The form engine supports the use of data sources to populate form fields. This allows for the creation of forms that can be populated with data from external sources.
27
+ - **Expression helpers** - The form engine supports the use of expression helpers to evaluate expressions within the form schema. This allows for the creation of complex expressions that can be evaluated by the form engine.
28
+ - **Translations** - The form engine supports translations for various elements such as action items, notifications, validators, and questions within the forms. Translations for pages, sections, and question labels are retrieved from the backend.
29
+ - **Drug orders** - The form engine facilitates drug orders by enabling the launch of the drug order basket. This feature allows users to add drugs along with medication details contained in the template for the specified drug.
30
+ - **Lab orders** - The form engine supports lab orders created using observations (obs) by utilizing the testOrders type on a specific question.
31
+ - **Markdown/ Read only fields** - The form engine includes support for read-only fields embedded within forms. These fields are utilized to provide additional information or guide users without allowing input.
32
+ - **Multiple form rendering modes** - The form engine provides several rendering modes that can be used to render forms in different contexts, including:
33
+ - **Enter Mode** - This is the default mode that allows the user to enter data into the form. The form is rendered in a read-write mode.
34
+ - **Edit Mode** - This mode allows the user to edit data that has already been entered into the form. The form is rendered in a read-write mode.
35
+ - **View Mode** - This mode allows the user to view data that has already been entered into the form. The form is rendered in a read-only mode.
36
+ - **Embedded View** - This mode is a condensed version of the `view mode` without the section headers and form actions. It can be used to display entered form data within a widget.
37
+
38
+ ## Documentation
39
+
40
+ Read the full docs in the OpenMRS Wiki [here](https://openmrs.atlassian.net/wiki/spaces/projects/pages/68747273/O3+Form+Docs).
41
+
42
+ ## Adding and Managing Translations
43
+
44
+ The Form Engine uses a combination of frontend and backend features to support translations.
45
+
46
+ - **Frontend translations** - Translations for static strings within the library are managed using Transifex, a localization platform that allows for the translation of strings. This repository being a library, the language specific translations are managed within the [esm-form-engine-app](https://github.com/openmrs/openmrs-esm-patient-chart/tree/main/packages/esm-form-engine-app) in the [Patient Chart](https://github.com/openmrs/openmrs-esm-patient-chart) repository and are loaded dynamically based on the user's locale.
47
+ - **Backend translations** - Translations for pages, sections, and question labels are retrieved from the backend. These are loaded automatically based on the concept translations as well as the form translation files included within the distribution.
48
+
49
+ You can read more about translations in the [OpenMRS Wiki](https://openmrs.atlassian.net/wiki/spaces/docs/pages/105512985/How+to+Translate+OpenMRS)
50
+
51
+ ## Getting started
52
+
53
+ *NB: The Form Engine is a React library, not a standalone [O3 frontend module](https://openmrs.atlassian.net/wiki/spaces/docs/pages/151093806/Overview+of+Frontend+Modules). It can only be consumed by bundling it within a frontend module that incorporates it within a UI workflow.*
54
+
55
+ ### Prerequisites
56
+
57
+ - [Node.js](https://nodejs.org/en/about/releases) 20 or later (LTS version recommended)
58
+ - [Yarn](https://yarnpkg.com/) 4.x or later (We use Yarn as our package manager)
59
+ - [Git](https://git-scm.com) (for version control)
60
+
61
+ ### Installation
62
+
63
+ ```bash
64
+ yarn add @openmrs/esm-form-engine-lib@latest
65
+ ```
66
+
67
+ ### Local development
68
+
69
+ #### Clone the repository
70
+
71
+ ```bash
72
+ git clone git@github.com:openmrs/openmrs-esm-form-engine-lib.git
73
+ ```
74
+
75
+ Or using https:
76
+
77
+ ```bash
78
+ git clone https://github.com/openmrs/openmrs-esm-form-engine-lib.git
79
+ ```
80
+
81
+ #### Install dependencies
82
+
83
+ ```bash
84
+ yarn
85
+ ```
86
+
87
+ #### Build the library
88
+
89
+ ```bash
90
+ yarn build
91
+ ```
92
+
93
+ #### Link the library to the consuming frontend module
94
+
95
+ To test your local Form Engine changes, you'll need to link the library to a frontend module that uses it (like Form Builder or Patient Chart). Here's how:
96
+
97
+ 1. Build the library
98
+
99
+ ```bash
100
+ yarn build
101
+ ```
102
+
103
+ 2. Copy the relative path to the built library
104
+
105
+ Copy the relative path to the built library by running the following command on Mac:
106
+
107
+ ```bash
108
+ pwd | pbcopy # copy the path to form-engine-lib to the clipboard
109
+ ```
110
+
111
+ Or the equivalent command on Linux:
112
+
113
+ ```bash
114
+ # Copy the path to clipboard
115
+ pwd | xclip
116
+
117
+ # Link the library using the copied path
118
+ yarn link `xclip -o`
119
+ ```
120
+
121
+ 3. Symlink the library to the consuming frontend module
122
+
123
+ Then run the following command from the root of the consuming frontend module. For example, if you are working on the `openmrs-esm-form-builder` module, you would navigate to the root of the module and run:
124
+
125
+ ```bash
126
+ yarn link `pbpaste` # paste the path to the openmrs-form-engine-lib where `pbpaste` is the command to paste the clipboard content
127
+ ```
128
+
129
+ 4. Run the consuming frontend module
130
+
131
+ After linking the library, run the relevant `start` command from the frontend module. For example, if you're working on the form builder module, you would run:
132
+
133
+ ```bash
134
+ yarn start
135
+ ```
136
+
137
+ Whereas for the patient chart you would have to start the Form Engine Lib frontend module like so:
138
+
139
+ ```bash
140
+ yarn start --sources packages/esm-form-engine-app
141
+ ```
142
+
143
+ You could also optionally proxy to a different backend where your forms are hosted by appending `backend` followed by the URL to the backend. For example:
144
+
145
+ ```bash
146
+ yarn start --sources packages/esm-form-engine-app --backend https://link-to-my-backend.com
147
+ ```
148
+
149
+ #### Troubleshooting linking issues
150
+
151
+ You might run into dependency version mismatches when attempting to link the library to the consuming frontend module. `@carbon/react` is a common culprit. If you see an error like this in your terminal after running `yarn link`:
152
+
153
+ ```sh
154
+ @carbon/react@npm:1.74.0 [5ffd1] conflicts with parent dependency @carbon/react@npm:1.60.3 [faad]
155
+ ```
156
+
157
+ That's because the consuming frontend module is using a different version of `@carbon/react` than the Form Engine Lib.
158
+
159
+ To resolve this, you set a `resolutions` field in your consuming frontend module's root `package.json` file to force the use of the same version of `@carbon/react` in the Form Engine Lib.
160
+
161
+ ```json
162
+ "resolutions": {
163
+ "@carbon/react": "1.60.3"
164
+ }
165
+ ```
166
+
167
+ Once you've added the `resolutions` field, you'll need to run `yarn` again to install the dependencies. After that, you should be able to link the library to the consuming frontend module and run the consuming frontend module without any issues.
168
+
169
+ ### Production
170
+
171
+ Note that in addition to this library, other form engine alternatives exist within the O3 ecosystem, including:
172
+
173
+ - [The HTML Form Entry module](https://github.com/openmrs/openmrs-module-htmlformentry)
174
+ - [The Angular Form Engine](https://github.com/openmrs/openmrs-ngx-formentry)
175
+
176
+ To use this library as the default form engine in your O3 instance, you will need to add this to your [spa-assemble-config.json](https://github.com/openmrs/openmrs-distro-referenceapplication/blob/main/frontend/spa-assemble-config.json) file:
177
+
178
+ ```json
179
+ {
180
+ "frontendModules": {
181
+ // Add this line to the list of frontend modules
182
+ "@openmrs/esm-form-engine-app": "next"
183
+ }
184
+ }
185
+ ```
186
+
187
+ **NB**: *If you are currently using the Angular Form Engine (@openmrs/esm-form-entry-app), you will need to remove it from your importmap and replace it with the Form Engine App (@openmrs/esm-form-engine-app). The two libraries are not compatible.*
188
+
189
+ ### Report an issue
190
+
191
+ - [File an issue](https://github.com/openmrs/openmrs-esm-form-engine-lib/issues)
192
+ - [Post in the react-form-engine Slack channel](https://openmrs.slack.com/archives/C04QZ5DDVMG)
193
+
194
+ ## Contributing
195
+
196
+ Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. Read our [contributing guide](https://o3-docs.openmrs.org/docs/frontend-modules/contributing) for more information on how to contribute.
197
+
198
+ ## License
199
+
200
+ Distributed under the MPLv2 with Healthcare Disclaimer License. See `LICENSE.txt` for more information.
201
+
202
+ <p align="right">(<a href="#top">Back to top</a>)</p>
@@ -0,0 +1,3 @@
1
+ import { type FormFieldValueAdapter } from '../types';
2
+ export declare const ControlAdapter: FormFieldValueAdapter;
3
+ //# sourceMappingURL=control-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/control-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkD,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtG,eAAO,MAAM,cAAc,EAAE,qBAwB5B,CAAC"}
@@ -0,0 +1,17 @@
1
+ export const ControlAdapter = {
2
+ getDisplayValue: (field, value)=>{
3
+ return value;
4
+ },
5
+ transformFieldValue: function(field, value, context) {
6
+ return null;
7
+ },
8
+ getInitialValue: function(field, sourceObject, context) {
9
+ return null;
10
+ },
11
+ getPreviousValue: function(field, sourceObject, context) {
12
+ return null;
13
+ },
14
+ tearDown: function() {
15
+ return;
16
+ }
17
+ };
@@ -0,0 +1,3 @@
1
+ import { type FormFieldValueAdapter } from '../types';
2
+ export declare const EncounterDatetimeAdapter: FormFieldValueAdapter;
3
+ //# sourceMappingURL=encounter-datetime-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encounter-datetime-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/encounter-datetime-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,wBAAwB,EAAE,qBA2BtC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { formatDate } from "@openmrs/esm-framework";
2
+ import { gracefullySetSubmission } from "../utils/common-utils.js";
3
+ export const EncounterDatetimeAdapter = {
4
+ transformFieldValue: function(field, value, context) {
5
+ gracefullySetSubmission(field, value, null);
6
+ },
7
+ getInitialValue: function(field, sourceObject, context) {
8
+ return sourceObject?.encounterDatetime ? new Date(sourceObject.encounterDatetime) : context.sessionDate;
9
+ },
10
+ getPreviousValue: function(field, sourceObject, context) {
11
+ if (sourceObject?.encounterDatetime) {
12
+ const date = new Date(sourceObject.encounterDatetime);
13
+ return {
14
+ value: date,
15
+ display: this.getDisplayValue(field, date)
16
+ };
17
+ }
18
+ return null;
19
+ },
20
+ getDisplayValue: function(field, value) {
21
+ return formatDate(value);
22
+ },
23
+ tearDown: function() {
24
+ return;
25
+ }
26
+ };
@@ -0,0 +1,10 @@
1
+ import { type OpenmrsResource } from '@openmrs/esm-framework';
2
+ import { type FormFieldValueAdapter } from '../types';
3
+ export declare let assignedDiagnosesIds: string[];
4
+ export declare const EncounterDiagnosisAdapter: FormFieldValueAdapter;
5
+ export declare function hasPreviousDiagnosisValueChanged(previousDiagnosis: OpenmrsResource, newValue: string): boolean;
6
+ export declare function voidDiagnosis(diagnosis: OpenmrsResource): {
7
+ uuid: string;
8
+ voided: boolean;
9
+ };
10
+ //# sourceMappingURL=encounter-diagnosis-adapter.d.ts.map