@aehrc/smart-forms-renderer 0.19.0 → 0.21.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 (514) hide show
  1. package/__mocks__/zustand.ts +1 -1
  2. package/lib/api/smartClient.js +1 -1
  3. package/lib/components/Alert.styles.js +1 -1
  4. package/lib/components/Box.styles.js +1 -1
  5. package/lib/components/FormComponents/AttachmentItem/AttachmentField.js +1 -1
  6. package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js +1 -1
  7. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.js +1 -1
  8. package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js +1 -1
  9. package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.js +1 -1
  10. package/lib/components/FormComponents/BooleanItem/BooleanField.js +1 -1
  11. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js +1 -1
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +1 -1
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +1 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +1 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +1 -1
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +1 -1
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +1 -1
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +1 -1
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +1 -1
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +1 -1
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +1 -1
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js +1 -1
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +1 -1
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +1 -1
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +1 -1
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +1 -1
  28. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +1 -1
  29. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +1 -1
  30. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.js +1 -1
  31. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js.map +1 -0
  32. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.d.ts +1 -1
  33. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.js +13 -13
  34. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js.map +1 -0
  35. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.js +1 -2
  36. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePicker.js.map +1 -0
  37. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.js +29 -0
  38. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.js.map +1 -0
  39. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.js +1 -1
  40. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/MuiDatePicker.js.map +1 -0
  41. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.d.ts +9 -0
  42. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js +116 -0
  43. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -0
  44. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.d.ts +15 -0
  45. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js +40 -0
  46. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js.map +1 -0
  47. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.d.ts +22 -0
  48. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js +28 -0
  49. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js.map +1 -0
  50. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.js +1 -1
  51. package/lib/components/FormComponents/DateTimeItems/index.js.map +1 -0
  52. package/lib/components/FormComponents/DateTimeItems/utils/index.d.ts +1 -0
  53. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/utils}/index.js +2 -2
  54. package/lib/components/FormComponents/DateTimeItems/utils/index.js.map +1 -0
  55. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.d.ts → DateTimeItems/utils/parseDate.d.ts} +2 -2
  56. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.js → DateTimeItems/utils/parseDate.js} +10 -10
  57. package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js.map +1 -0
  58. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.d.ts +19 -0
  59. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.js +81 -0
  60. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.js.map +1 -0
  61. package/lib/components/FormComponents/DecimalItem/DecimalField.js +1 -1
  62. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +1 -1
  63. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +1 -1
  64. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +1 -1
  65. package/lib/components/FormComponents/DisplayItem/DisplayItem.js +1 -1
  66. package/lib/components/FormComponents/GridGroup/GridGroup.js +1 -1
  67. package/lib/components/FormComponents/GridGroup/GridRow.js +1 -1
  68. package/lib/components/FormComponents/GridGroup/GridTable.js +1 -1
  69. package/lib/components/FormComponents/GridGroup/index.js +1 -1
  70. package/lib/components/FormComponents/GroupItem/GroupHeading.js +1 -1
  71. package/lib/components/FormComponents/GroupItem/GroupItem.js +1 -1
  72. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js +1 -1
  73. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +1 -1
  74. package/lib/components/FormComponents/GroupItem/NextTabButton.js +1 -1
  75. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +1 -1
  76. package/lib/components/FormComponents/IntegerItem/IntegerField.js +1 -1
  77. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +1 -1
  78. package/lib/components/FormComponents/Item.styles.js +1 -1
  79. package/lib/components/FormComponents/ItemParts/CheckboxSingle.js +1 -1
  80. package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js +1 -1
  81. package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js +1 -1
  82. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +1 -1
  83. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +1 -1
  84. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +1 -1
  85. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +1 -1
  86. package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +1 -1
  87. package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js +1 -1
  88. package/lib/components/FormComponents/Lists.styles.js +1 -1
  89. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +1 -1
  90. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +1 -1
  91. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +1 -1
  92. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +1 -1
  93. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +1 -1
  94. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +1 -1
  95. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +1 -1
  96. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +1 -1
  97. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +1 -1
  98. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +1 -1
  99. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +1 -1
  100. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +1 -1
  101. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +1 -1
  102. package/lib/components/FormComponents/RepeatGroup/index.js +1 -1
  103. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +1 -1
  104. package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js +1 -1
  105. package/lib/components/FormComponents/RepeatItem/RepeatField.js +1 -1
  106. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +1 -1
  107. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js +1 -1
  108. package/lib/components/FormComponents/RepeatItem/index.js +1 -1
  109. package/lib/components/FormComponents/SingleItem/SingleItem.js +1 -1
  110. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +4 -4
  111. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  112. package/lib/components/FormComponents/SingleItem/index.js +1 -1
  113. package/lib/components/FormComponents/SliderItem/Slider.styles.js +1 -1
  114. package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js +1 -1
  115. package/lib/components/FormComponents/SliderItem/SliderField.js +1 -1
  116. package/lib/components/FormComponents/SliderItem/SliderItem.js +1 -1
  117. package/lib/components/FormComponents/SliderItem/SliderLabels.js +1 -1
  118. package/lib/components/FormComponents/StringItem/StringField.js +1 -1
  119. package/lib/components/FormComponents/StringItem/StringItem.js +1 -1
  120. package/lib/components/FormComponents/Tables/AddRowButton.js +1 -1
  121. package/lib/components/FormComponents/Tables/GroupTable.js +1 -1
  122. package/lib/components/FormComponents/Tables/GroupTableBody.js +1 -1
  123. package/lib/components/FormComponents/Tables/GroupTableRow.js +1 -1
  124. package/lib/components/FormComponents/Tables/GroupTableRowCells.js +1 -1
  125. package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
  126. package/lib/components/FormComponents/Tables/RemoveRowButton.js +1 -1
  127. package/lib/components/FormComponents/Tables/SelectRowButton.js +1 -1
  128. package/lib/components/FormComponents/Tables/Table.styles.js +1 -1
  129. package/lib/components/FormComponents/Tables/index.js +1 -1
  130. package/lib/components/FormComponents/TextItem/MuiTextField.js +1 -1
  131. package/lib/components/FormComponents/TextItem/TextField.js +1 -1
  132. package/lib/components/FormComponents/TextItem/TextItem.js +1 -1
  133. package/lib/components/FormComponents/Textfield.styles.js +1 -1
  134. package/lib/components/FormComponents/TimeItem/TimeField.js +1 -1
  135. package/lib/components/FormComponents/TimeItem/TimeItem.js +1 -1
  136. package/lib/components/FormComponents/UrlItem/UrlField.js +1 -1
  137. package/lib/components/FormComponents/UrlItem/UrlItem.js +1 -1
  138. package/lib/components/FormComponents/index.d.ts +1 -1
  139. package/lib/components/FormComponents/index.js +2 -2
  140. package/lib/components/FormComponents/index.js.map +1 -1
  141. package/lib/components/Iconify/Iconify.js +1 -1
  142. package/lib/components/Lists.styles.js +1 -1
  143. package/lib/components/Renderer/BaseRenderer.js +1 -1
  144. package/lib/components/Renderer/FormBodyCollapsible.js +1 -1
  145. package/lib/components/Renderer/FormBodySingleCollapsible.js +1 -1
  146. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js +1 -1
  147. package/lib/components/Renderer/FormBodyTabbed.js +1 -1
  148. package/lib/components/Renderer/FormTitle.js +1 -1
  149. package/lib/components/Renderer/FormTopLevelItem.js +1 -1
  150. package/lib/components/Renderer/SmartFormsRenderer.js +1 -1
  151. package/lib/components/Renderer/index.js +1 -1
  152. package/lib/components/Tabs/CompleteTabButton.js +1 -1
  153. package/lib/components/Tabs/FormBodySingleTab.js +1 -1
  154. package/lib/components/Tabs/FormBodyTabList.js +1 -1
  155. package/lib/components/Tabs/FormBodyTabListWrapper.js +1 -1
  156. package/lib/components/Tabs/ShowCompletedTabsSection.js +1 -1
  157. package/lib/components/index.js +1 -1
  158. package/lib/hooks/useAttachmentUrlValidation.js +1 -1
  159. package/lib/hooks/useContextDisplayItems.js +1 -1
  160. package/lib/hooks/useDateTimeNonEmpty.d.ts +2 -0
  161. package/lib/{components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js → hooks/useDateTimeNonEmpty.js} +9 -3
  162. package/lib/hooks/useDateTimeNonEmpty.js.map +1 -0
  163. package/lib/hooks/useDateValidation.js +3 -3
  164. package/lib/hooks/useDateValidation.js.map +1 -1
  165. package/lib/hooks/useDebounce.js +1 -1
  166. package/lib/hooks/useDecimalCalculatedExpression.js +1 -1
  167. package/lib/hooks/useGroupTableRows.js +1 -1
  168. package/lib/hooks/useHidden.js +1 -1
  169. package/lib/hooks/useInitialiseGroupTable.js +1 -1
  170. package/lib/hooks/useInitialiseRenderer.js +1 -1
  171. package/lib/hooks/useInitialiseRepeatAnswers.js +1 -1
  172. package/lib/hooks/useInitialiseRepeatGroups.js +1 -1
  173. package/lib/hooks/useIntegerCalculatedExpression.js +1 -1
  174. package/lib/hooks/useNumberInput.js +1 -1
  175. package/lib/hooks/useQueryClient.js +1 -1
  176. package/lib/hooks/useReadOnly.js +1 -1
  177. package/lib/hooks/useRenderingExtensions.js +1 -1
  178. package/lib/hooks/useResponsive.js +1 -1
  179. package/lib/hooks/useSliderExtensions.js +1 -1
  180. package/lib/hooks/useStringCalculatedExpression.js +1 -1
  181. package/lib/hooks/useStringInput.js +1 -1
  182. package/lib/hooks/useTerminologyServerQuery.js +1 -1
  183. package/lib/hooks/useTimeValidation.d.ts +5 -0
  184. package/lib/hooks/useTimeValidation.js +54 -0
  185. package/lib/hooks/useTimeValidation.js.map +1 -0
  186. package/lib/hooks/useValidationFeedback.js +1 -1
  187. package/lib/hooks/useValueSetCodings.js +1 -1
  188. package/lib/interfaces/answerExpression.interface.js +1 -1
  189. package/lib/interfaces/choice.enum.js +1 -1
  190. package/lib/interfaces/enableWhen.interface.d.ts +11 -3
  191. package/lib/interfaces/enableWhen.interface.js +1 -1
  192. package/lib/interfaces/groupTable.interface.js +1 -1
  193. package/lib/interfaces/index.d.ts +1 -1
  194. package/lib/interfaces/populate.interface.js +1 -1
  195. package/lib/interfaces/questionnaireStore.interface.d.ts +2 -2
  196. package/lib/interfaces/questionnaireStore.interface.js +1 -1
  197. package/lib/interfaces/regex.interface.js +1 -1
  198. package/lib/interfaces/renderProps.interface.js +1 -1
  199. package/lib/interfaces/repeatGroup.interface.js +1 -1
  200. package/lib/interfaces/valueSet.interface.js +1 -1
  201. package/lib/interfaces/variables.interface.js +1 -1
  202. package/lib/stores/questionnaireResponseStore.js +1 -1
  203. package/lib/stores/questionnaireStore.d.ts +3 -3
  204. package/lib/stores/questionnaireStore.js +21 -6
  205. package/lib/stores/questionnaireStore.js.map +1 -1
  206. package/lib/stores/smartConfigStore.js +1 -1
  207. package/lib/stores/terminologyServerStore.js +1 -1
  208. package/lib/stories/MedicalHistoryTable.stories.js +1 -1
  209. package/lib/stories/SmartFormsRenderer.stories.js +1 -1
  210. package/lib/theme/customGlobalStyles.js +1 -1
  211. package/lib/theme/overrides/Accordion.js +1 -1
  212. package/lib/theme/overrides/Autocomplete.js +1 -1
  213. package/lib/theme/overrides/Button.js +1 -1
  214. package/lib/theme/overrides/Card.js +1 -1
  215. package/lib/theme/overrides/Input.js +1 -1
  216. package/lib/theme/overrides/Overrides.js +1 -1
  217. package/lib/theme/overrides/Paper.js +1 -1
  218. package/lib/theme/overrides/SpeedDial.js +1 -1
  219. package/lib/theme/overrides/Table.js +1 -1
  220. package/lib/theme/palette.js +1 -1
  221. package/lib/theme/shadows.js +1 -1
  222. package/lib/theme/typography.js +1 -1
  223. package/lib/utils/calculatedExpression.js +1 -1
  224. package/lib/utils/dayjsExtend.js +1 -1
  225. package/lib/utils/debounce.js +1 -1
  226. package/lib/utils/emptyResource.js +1 -1
  227. package/lib/utils/enableWhen.js +1 -1
  228. package/lib/utils/enableWhenExpression.d.ts +22 -5
  229. package/lib/utils/enableWhenExpression.js +98 -55
  230. package/lib/utils/enableWhenExpression.js.map +1 -1
  231. package/lib/utils/fhirpath.d.ts +3 -3
  232. package/lib/utils/fhirpath.js +1 -1
  233. package/lib/utils/formChanges.js +1 -1
  234. package/lib/utils/groupTable.js +1 -1
  235. package/lib/utils/index.js +1 -1
  236. package/lib/utils/initialise.d.ts +3 -3
  237. package/lib/utils/initialise.js +1 -1
  238. package/lib/utils/itemControl.js +1 -1
  239. package/lib/utils/mapItem.js +1 -1
  240. package/lib/utils/openChoice.js +1 -1
  241. package/lib/utils/parseInputs.js +1 -1
  242. package/lib/utils/populateContexts.js +1 -1
  243. package/lib/utils/qItem.d.ts +2 -2
  244. package/lib/utils/qItem.js +9 -9
  245. package/lib/utils/qItem.js.map +1 -1
  246. package/lib/utils/qrItem.js +1 -1
  247. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +1 -1
  248. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +2 -2
  249. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
  250. package/lib/utils/questionnaireStoreUtils/extractContainedValueSets.js +1 -1
  251. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +5 -5
  252. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js +99 -35
  253. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +1 -1
  254. package/lib/utils/questionnaireStoreUtils/extractTabs.js +1 -1
  255. package/lib/utils/questionnaireStoreUtils/extractVariables.js +1 -1
  256. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js +1 -1
  257. package/lib/utils/removeEmptyAnswers.d.ts +2 -2
  258. package/lib/utils/removeEmptyAnswers.js +1 -1
  259. package/lib/utils/removeEmptyAnswers.js.map +1 -1
  260. package/lib/utils/repopulateItems.d.ts +2 -2
  261. package/lib/utils/repopulateItems.js +1 -1
  262. package/lib/utils/slider.js +1 -1
  263. package/lib/utils/tabs.d.ts +6 -6
  264. package/lib/utils/tabs.js +4 -19
  265. package/lib/utils/tabs.js.map +1 -1
  266. package/lib/utils/validateQuestionnaire.d.ts +2 -2
  267. package/lib/utils/validateQuestionnaire.js +1 -8
  268. package/lib/utils/validateQuestionnaire.js.map +1 -1
  269. package/lib/utils/valueSet.js +1 -1
  270. package/package.json +3 -3
  271. package/src/api/smartClient.ts +1 -1
  272. package/src/components/Alert.styles.ts +1 -1
  273. package/src/components/Box.styles.ts +1 -1
  274. package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +1 -1
  275. package/src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx +1 -1
  276. package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.tsx +1 -1
  277. package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +1 -1
  278. package/src/components/FormComponents/AttachmentItem/AttachmentUrlField.tsx +1 -1
  279. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +1 -1
  280. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +1 -1
  281. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.tsx +1 -1
  282. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +1 -1
  283. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +1 -1
  284. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +1 -1
  285. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +1 -1
  286. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +1 -1
  287. package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +1 -1
  288. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +1 -1
  289. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +1 -1
  290. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +1 -1
  291. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +1 -1
  292. package/src/components/FormComponents/ChoiceItems/ChoiceRadioSingle.tsx +1 -1
  293. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +1 -1
  294. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +1 -1
  295. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +1 -1
  296. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +1 -1
  297. package/src/components/FormComponents/DateTimeItem/DateTimeField.tsx +1 -1
  298. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +1 -1
  299. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.tsx +1 -1
  300. package/src/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.tsx +15 -15
  301. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.tsx +1 -2
  302. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePickerButton.tsx +18 -1
  303. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.ts +1 -1
  304. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +222 -0
  305. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.tsx +117 -0
  306. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.tsx +96 -0
  307. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.ts +1 -1
  308. package/src/components/FormComponents/{CustomDateItem → DateTimeItems/utils}/index.ts +2 -2
  309. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.ts → DateTimeItems/utils/parseDate.ts} +10 -10
  310. package/src/components/FormComponents/DateTimeItems/utils/parseTime.ts +127 -0
  311. package/src/components/FormComponents/DecimalItem/DecimalField.tsx +1 -1
  312. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +1 -1
  313. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +1 -1
  314. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +1 -1
  315. package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +1 -1
  316. package/src/components/FormComponents/GridGroup/GridGroup.tsx +1 -1
  317. package/src/components/FormComponents/GridGroup/GridRow.tsx +1 -1
  318. package/src/components/FormComponents/GridGroup/GridTable.tsx +1 -1
  319. package/src/components/FormComponents/GridGroup/index.ts +1 -1
  320. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +1 -1
  321. package/src/components/FormComponents/GroupItem/GroupItem.styles.ts +1 -1
  322. package/src/components/FormComponents/GroupItem/GroupItem.tsx +1 -1
  323. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +1 -1
  324. package/src/components/FormComponents/GroupItem/NextTabButton.tsx +1 -1
  325. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +1 -1
  326. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -1
  327. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +1 -1
  328. package/src/components/FormComponents/Item.styles.ts +1 -1
  329. package/src/components/FormComponents/ItemParts/CheckboxSingle.tsx +1 -1
  330. package/src/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.tsx +1 -1
  331. package/src/components/FormComponents/ItemParts/ContextDisplayItem.tsx +1 -1
  332. package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +1 -1
  333. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +1 -1
  334. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +1 -1
  335. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +1 -1
  336. package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +1 -1
  337. package/src/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.tsx +1 -1
  338. package/src/components/FormComponents/Lists.styles.ts +1 -1
  339. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +1 -1
  340. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +1 -1
  341. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +1 -1
  342. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +1 -1
  343. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +1 -1
  344. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +1 -1
  345. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +1 -1
  346. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +1 -1
  347. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +1 -1
  348. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +1 -1
  349. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +1 -1
  350. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +1 -1
  351. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +1 -1
  352. package/src/components/FormComponents/RepeatGroup/index.ts +1 -1
  353. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +1 -1
  354. package/src/components/FormComponents/RepeatItem/RemoveItemButton.tsx +1 -1
  355. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +1 -1
  356. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.tsx +1 -1
  357. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +1 -1
  358. package/src/components/FormComponents/RepeatItem/index.ts +1 -1
  359. package/src/components/FormComponents/SingleItem/SingleItem.tsx +1 -1
  360. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +4 -4
  361. package/src/components/FormComponents/SingleItem/index.ts +1 -1
  362. package/src/components/FormComponents/SliderItem/Slider.styles.ts +1 -1
  363. package/src/components/FormComponents/SliderItem/SliderDisplayValue.tsx +1 -1
  364. package/src/components/FormComponents/SliderItem/SliderField.tsx +1 -1
  365. package/src/components/FormComponents/SliderItem/SliderItem.tsx +1 -1
  366. package/src/components/FormComponents/SliderItem/SliderLabels.tsx +1 -1
  367. package/src/components/FormComponents/StringItem/StringField.tsx +1 -1
  368. package/src/components/FormComponents/StringItem/StringItem.tsx +1 -1
  369. package/src/components/FormComponents/Tables/AddRowButton.tsx +1 -1
  370. package/src/components/FormComponents/Tables/GroupTable.tsx +1 -1
  371. package/src/components/FormComponents/Tables/GroupTableBody.tsx +1 -1
  372. package/src/components/FormComponents/Tables/GroupTableRow.tsx +1 -1
  373. package/src/components/FormComponents/Tables/GroupTableRowCells.tsx +1 -1
  374. package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -1
  375. package/src/components/FormComponents/Tables/RemoveRowButton.tsx +1 -1
  376. package/src/components/FormComponents/Tables/SelectRowButton.tsx +1 -1
  377. package/src/components/FormComponents/Tables/Table.styles.tsx +1 -1
  378. package/src/components/FormComponents/Tables/index.ts +1 -1
  379. package/src/components/FormComponents/TextItem/MuiTextField.ts +1 -1
  380. package/src/components/FormComponents/TextItem/TextField.tsx +1 -1
  381. package/src/components/FormComponents/TextItem/TextItem.tsx +1 -1
  382. package/src/components/FormComponents/Textfield.styles.ts +1 -1
  383. package/src/components/FormComponents/TimeItem/TimeField.tsx +1 -1
  384. package/src/components/FormComponents/TimeItem/TimeItem.tsx +1 -1
  385. package/src/components/FormComponents/UrlItem/UrlField.tsx +1 -1
  386. package/src/components/FormComponents/UrlItem/UrlItem.tsx +1 -1
  387. package/src/components/FormComponents/index.ts +2 -2
  388. package/src/components/Iconify/Iconify.tsx +1 -1
  389. package/src/components/Lists.styles.ts +1 -1
  390. package/src/components/Renderer/BaseRenderer.tsx +1 -1
  391. package/src/components/Renderer/FormBodyCollapsible.tsx +1 -1
  392. package/src/components/Renderer/FormBodySingleCollapsible.tsx +1 -1
  393. package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +1 -1
  394. package/src/components/Renderer/FormBodyTabbed.tsx +1 -1
  395. package/src/components/Renderer/FormTitle.tsx +1 -1
  396. package/src/components/Renderer/FormTopLevelItem.tsx +1 -1
  397. package/src/components/Renderer/SmartFormsRenderer.tsx +1 -1
  398. package/src/components/Renderer/index.ts +1 -1
  399. package/src/components/Tabs/CompleteTabButton.tsx +1 -1
  400. package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
  401. package/src/components/Tabs/FormBodyTabList.tsx +1 -1
  402. package/src/components/Tabs/FormBodyTabListWrapper.tsx +1 -1
  403. package/src/components/Tabs/ShowCompletedTabsSection.tsx +1 -1
  404. package/src/components/index.ts +1 -1
  405. package/src/hooks/useAttachmentUrlValidation.ts +1 -1
  406. package/src/hooks/useContextDisplayItems.ts +1 -1
  407. package/src/{components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.ts → hooks/useDateTimeNonEmpty.ts} +15 -2
  408. package/src/hooks/useDateValidation.tsx +3 -3
  409. package/src/hooks/useDebounce.ts +1 -1
  410. package/src/hooks/useDecimalCalculatedExpression.ts +1 -1
  411. package/src/hooks/useGroupTableRows.ts +1 -1
  412. package/src/hooks/useHidden.ts +1 -1
  413. package/src/hooks/useInitialiseGroupTable.ts +1 -1
  414. package/src/hooks/useInitialiseRenderer.ts +1 -1
  415. package/src/hooks/useInitialiseRepeatAnswers.ts +1 -1
  416. package/src/hooks/useInitialiseRepeatGroups.ts +1 -1
  417. package/src/hooks/useIntegerCalculatedExpression.ts +1 -1
  418. package/src/hooks/useNumberInput.ts +1 -1
  419. package/src/hooks/useQueryClient.ts +1 -1
  420. package/src/hooks/useReadOnly.ts +1 -1
  421. package/src/hooks/useRenderingExtensions.ts +1 -1
  422. package/src/hooks/useResponsive.ts +1 -1
  423. package/src/hooks/useSliderExtensions.ts +1 -1
  424. package/src/hooks/useStringCalculatedExpression.ts +1 -1
  425. package/src/hooks/useStringInput.ts +1 -1
  426. package/src/hooks/useTerminologyServerQuery.ts +1 -1
  427. package/src/hooks/useTimeValidation.tsx +70 -0
  428. package/src/hooks/useValidationFeedback.ts +1 -1
  429. package/src/hooks/useValueSetCodings.ts +1 -1
  430. package/src/interfaces/answerExpression.interface.ts +1 -1
  431. package/src/interfaces/choice.enum.ts +1 -1
  432. package/src/interfaces/enableWhen.interface.ts +14 -4
  433. package/src/interfaces/groupTable.interface.ts +1 -1
  434. package/src/interfaces/index.ts +4 -2
  435. package/src/interfaces/populate.interface.ts +1 -1
  436. package/src/interfaces/questionnaireStore.interface.ts +3 -3
  437. package/src/interfaces/regex.interface.ts +1 -1
  438. package/src/interfaces/renderProps.interface.ts +1 -1
  439. package/src/interfaces/repeatGroup.interface.ts +1 -1
  440. package/src/interfaces/tab.interface.ts +1 -1
  441. package/src/interfaces/valueSet.interface.ts +1 -1
  442. package/src/interfaces/variables.interface.ts +1 -1
  443. package/src/stores/questionnaireResponseStore.ts +1 -1
  444. package/src/stores/questionnaireStore.ts +24 -8
  445. package/src/stores/smartConfigStore.ts +1 -1
  446. package/src/stores/terminologyServerStore.ts +1 -1
  447. package/src/stories/MedicalHistoryTable.stories.tsx +1 -1
  448. package/src/stories/SmartFormsRenderer.stories.ts +1 -1
  449. package/src/theme/Theme.tsx +1 -1
  450. package/src/theme/customGlobalStyles.tsx +1 -1
  451. package/src/theme/overrides/Accordion.ts +1 -1
  452. package/src/theme/overrides/Autocomplete.ts +1 -1
  453. package/src/theme/overrides/Button.ts +1 -1
  454. package/src/theme/overrides/Card.ts +1 -1
  455. package/src/theme/overrides/Input.ts +1 -1
  456. package/src/theme/overrides/Overrides.ts +1 -1
  457. package/src/theme/overrides/Paper.ts +1 -1
  458. package/src/theme/overrides/SpeedDial.ts +1 -1
  459. package/src/theme/overrides/Table.ts +1 -1
  460. package/src/theme/palette.ts +1 -1
  461. package/src/theme/shadows.ts +1 -1
  462. package/src/theme/typography.ts +1 -1
  463. package/src/utils/calculatedExpression.ts +1 -1
  464. package/src/utils/choice.ts +1 -1
  465. package/src/utils/dayjsExtend.ts +1 -1
  466. package/src/utils/debounce.ts +1 -1
  467. package/src/utils/emptyResource.ts +1 -1
  468. package/src/utils/enableWhen.ts +1 -1
  469. package/src/utils/enableWhenExpression.ts +215 -79
  470. package/src/utils/fhirpath.ts +4 -4
  471. package/src/utils/formChanges.ts +1 -1
  472. package/src/utils/groupTable.ts +1 -1
  473. package/src/utils/index.ts +1 -1
  474. package/src/utils/initialise.ts +4 -4
  475. package/src/utils/itemControl.ts +1 -1
  476. package/src/utils/mapItem.ts +1 -1
  477. package/src/utils/openChoice.ts +1 -1
  478. package/src/utils/parseInputs.ts +1 -1
  479. package/src/utils/populateContexts.ts +1 -1
  480. package/src/utils/qItem.ts +12 -12
  481. package/src/utils/qrItem.ts +1 -1
  482. package/src/utils/questionnaireStoreUtils/addAdditionalVariables.ts +1 -1
  483. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +2 -2
  484. package/src/utils/questionnaireStoreUtils/extractContainedValueSets.ts +1 -1
  485. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +160 -40
  486. package/src/utils/questionnaireStoreUtils/extractTabs.ts +1 -1
  487. package/src/utils/questionnaireStoreUtils/extractVariables.ts +1 -1
  488. package/src/utils/questionnaireStoreUtils/resolveValueSets.ts +1 -1
  489. package/src/utils/removeEmptyAnswers.ts +5 -5
  490. package/src/utils/repopulateItems.ts +5 -5
  491. package/src/utils/slider.ts +1 -1
  492. package/src/utils/tabs.ts +10 -25
  493. package/src/utils/validateQuestionnaire.ts +4 -12
  494. package/src/utils/valueSet.ts +1 -1
  495. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +0 -1
  496. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js.map +0 -1
  497. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js.map +0 -1
  498. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js +0 -13
  499. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js.map +0 -1
  500. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js.map +0 -1
  501. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js.map +0 -1
  502. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.d.ts +0 -1
  503. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js.map +0 -1
  504. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js.map +0 -1
  505. package/lib/components/FormComponents/CustomDateItem/index.d.ts +0 -1
  506. package/lib/components/FormComponents/CustomDateItem/index.js.map +0 -1
  507. package/lib/components/FormComponents/DateItem/DateField.d.ts +0 -12
  508. package/lib/components/FormComponents/DateItem/DateItem.d.ts +0 -9
  509. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.d.ts +0 -7
  510. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.d.ts +0 -0
  511. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.d.ts +0 -0
  512. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePickerButton.d.ts +0 -0
  513. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.d.ts +0 -0
  514. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ import { getNumOfSeparators } from '../components/FormComponents/DateTimeItems/utils/parseDate';
19
+ import dayjs from 'dayjs';
20
+ import { validateTimeInput } from '../components/FormComponents/DateTimeItems/utils/parseTime';
21
+
22
+ function useTimeValidation(
23
+ timeInput: string,
24
+ periodInput: string,
25
+ parseFail: boolean = false
26
+ ): { timeFeedback: string | null; is24HourNotation: boolean } {
27
+ if (timeInput === '') {
28
+ return { timeFeedback: null, is24HourNotation: false };
29
+ }
30
+
31
+ if (timeInput.includes('.')) {
32
+ return {
33
+ timeFeedback: 'Input does not match the required format with ":" as the separator.',
34
+ is24HourNotation: false
35
+ };
36
+ }
37
+
38
+ if (timeInput.length !== 5 || !timeInput.includes(':')) {
39
+ return { timeFeedback: 'Input does not match the format HH:MM.', is24HourNotation: false };
40
+ }
41
+
42
+ const numOfSeparators = getNumOfSeparators(timeInput, ':');
43
+
44
+ if (numOfSeparators === 1) {
45
+ const timeDayJs = dayjs(timeInput, `hh:mm`);
46
+ if (!timeDayJs.isValid()) {
47
+ return { timeFeedback: 'Input does not match the format hh:mm.', is24HourNotation: false };
48
+ }
49
+
50
+ const { timeIsValid, is24HourNotation } = validateTimeInput(timeInput, periodInput);
51
+
52
+ if (periodInput === '' && !is24HourNotation) {
53
+ return { timeFeedback: 'Specify the period as AM or PM.', is24HourNotation: false };
54
+ }
55
+
56
+ if (!timeIsValid) {
57
+ return { timeFeedback: 'Input is an invalid time.', is24HourNotation: false };
58
+ }
59
+
60
+ return { timeFeedback: null, is24HourNotation };
61
+ }
62
+
63
+ if (parseFail) {
64
+ return { timeFeedback: 'Input is an invalid time.', is24HourNotation: false };
65
+ }
66
+
67
+ return { timeFeedback: 'Input is an invalid time.', is24HourNotation: false };
68
+ }
69
+
70
+ export default useTimeValidation;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,10 +21,20 @@ import type {
21
21
  QuestionnaireResponseItemAnswer
22
22
  } from 'fhir/r4';
23
23
 
24
- export interface EnableWhenExpression {
24
+ export interface EnableWhenExpressions {
25
+ singleExpressions: Record<string, EnableWhenSingleExpression>;
26
+ repeatExpressions: Record<string, EnableWhenRepeatExpression>;
27
+ }
28
+
29
+ export interface EnableWhenSingleExpression {
25
30
  expression: string;
26
- isEnabledSingle?: boolean;
27
- isEnabledMultiple?: boolean[];
31
+ isEnabled?: boolean;
32
+ }
33
+
34
+ export interface EnableWhenRepeatExpression {
35
+ expression: string;
36
+ parentLinkId: string;
37
+ enabledIndexes: boolean[];
28
38
  }
29
39
 
30
40
  export interface EnableWhenItems {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,8 +1,10 @@
1
1
  export {
2
- EnableWhenExpression,
3
2
  EnableWhenItems,
4
3
  EnableWhenSingleItemProperties,
5
4
  EnableWhenRepeatItemProperties,
6
5
  EnableWhenSingleLinkedItem,
7
- EnableWhenRepeatLinkedItem
6
+ EnableWhenRepeatLinkedItem,
7
+ EnableWhenExpressions,
8
+ EnableWhenSingleExpression,
9
+ EnableWhenRepeatExpression
8
10
  } from './enableWhen.interface';
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,7 +18,7 @@
18
18
  import type { Tabs } from './tab.interface';
19
19
  import type { Variables } from './variables.interface';
20
20
  import type { LaunchContext } from './populate.interface';
21
- import type { EnableWhenExpression, EnableWhenItems } from './enableWhen.interface';
21
+ import type { EnableWhenExpressions, EnableWhenItems } from './enableWhen.interface';
22
22
  import type { CalculatedExpression } from './calculatedExpression.interface';
23
23
  import type { AnswerExpression } from './answerExpression.interface';
24
24
  import type { Coding } from 'fhir/r4';
@@ -29,7 +29,7 @@ export interface QuestionnaireModel {
29
29
  variables: Variables;
30
30
  launchContexts: Record<string, LaunchContext>;
31
31
  enableWhenItems: EnableWhenItems;
32
- enableWhenExpressions: Record<string, EnableWhenExpression>;
32
+ enableWhenExpressions: EnableWhenExpressions;
33
33
  calculatedExpressions: Record<string, CalculatedExpression>;
34
34
  answerExpressions: Record<string, AnswerExpression>;
35
35
  processedValueSetCodings: Record<string, Coding[]>;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@ import type {
25
25
  import type { Variables } from '../interfaces/variables.interface';
26
26
  import type { LaunchContext } from '../interfaces/populate.interface';
27
27
  import type { CalculatedExpression } from '../interfaces/calculatedExpression.interface';
28
- import type { EnableWhenExpression, EnableWhenItems } from '../interfaces';
28
+ import type { EnableWhenExpressions, EnableWhenItems } from '../interfaces';
29
29
  import type { AnswerExpression } from '../interfaces/answerExpression.interface';
30
30
  import type { Tabs } from '../interfaces/tab.interface';
31
31
  import {
@@ -43,6 +43,8 @@ import { emptyQuestionnaire, emptyResponse } from '../utils/emptyResource';
43
43
  import cloneDeep from 'lodash.clonedeep';
44
44
  import { terminologyServerStore } from './terminologyServerStore';
45
45
  import { createSelectors } from './selector';
46
+ import { mutateRepeatEnableWhenExpressionInstances } from '../utils/enableWhenExpression';
47
+ import { questionnaireResponseStore } from './questionnaireResponseStore';
46
48
 
47
49
  interface QuestionnaireStoreType {
48
50
  sourceQuestionnaire: Questionnaire;
@@ -54,7 +56,7 @@ interface QuestionnaireStoreType {
54
56
  enableWhenItems: EnableWhenItems;
55
57
  enableWhenLinkedQuestions: Record<string, string[]>;
56
58
  enableWhenIsActivated: boolean;
57
- enableWhenExpressions: Record<string, EnableWhenExpression>;
59
+ enableWhenExpressions: EnableWhenExpressions;
58
60
  calculatedExpressions: Record<string, CalculatedExpression>;
59
61
  answerExpressions: Record<string, AnswerExpression>;
60
62
  processedValueSetCodings: Record<string, Coding[]>;
@@ -101,7 +103,7 @@ export const questionnaireStore = createStore<QuestionnaireStoreType>()((set, ge
101
103
  variables: { fhirPathVariables: {}, xFhirQueryVariables: {} },
102
104
  launchContexts: {},
103
105
  calculatedExpressions: {},
104
- enableWhenExpressions: {},
106
+ enableWhenExpressions: { singleExpressions: {}, repeatExpressions: {} },
105
107
  answerExpressions: {},
106
108
  enableWhenItems: { singleItems: {}, repeatItems: {} },
107
109
  enableWhenLinkedQuestions: {},
@@ -170,7 +172,7 @@ export const questionnaireStore = createStore<QuestionnaireStoreType>()((set, ge
170
172
  launchContexts: {},
171
173
  enableWhenItems: { singleItems: {}, repeatItems: {} },
172
174
  enableWhenLinkedQuestions: {},
173
- enableWhenExpressions: {},
175
+ enableWhenExpressions: { singleExpressions: {}, repeatExpressions: {} },
174
176
  calculatedExpressions: {},
175
177
  answerExpressions: {},
176
178
  processedValueSetCodings: {},
@@ -217,6 +219,7 @@ export const questionnaireStore = createStore<QuestionnaireStoreType>()((set, ge
217
219
  actionType: 'add' | 'remove'
218
220
  ) => {
219
221
  const enableWhenItems = get().enableWhenItems;
222
+ const enableWhenExpressions = get().enableWhenExpressions;
220
223
 
221
224
  const updatedEnableWhenItems = mutateRepeatEnableWhenItemInstances(
222
225
  {
@@ -227,9 +230,22 @@ export const questionnaireStore = createStore<QuestionnaireStoreType>()((set, ge
227
230
  actionType
228
231
  );
229
232
 
230
- set(() => ({
231
- enableWhenItems: updatedEnableWhenItems
232
- }));
233
+ const { updatedEnableWhenExpressions, isUpdated } = mutateRepeatEnableWhenExpressionInstances({
234
+ questionnaireResponse: questionnaireResponseStore.getState().updatableResponse,
235
+ variablesFhirPath: get().variables.fhirPathVariables,
236
+ existingFhirPathContext: get().fhirPathContext,
237
+ enableWhenExpressions: enableWhenExpressions,
238
+ parentRepeatGroupLinkId,
239
+ parentRepeatGroupIndex,
240
+ actionType
241
+ });
242
+
243
+ if (isUpdated) {
244
+ set(() => ({
245
+ enableWhenItems: updatedEnableWhenItems,
246
+ enableWhenExpressions: updatedEnableWhenExpressions
247
+ }));
248
+ }
233
249
  },
234
250
  toggleEnableWhenActivation: (isActivated: boolean) =>
235
251
  set(() => ({ enableWhenIsActivated: isActivated })),
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");