@awell-health/awell-extensions 1.0.109 → 1.0.111

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 (355) hide show
  1. package/dist/extensions/calDotCom/actions/createBooking/createBooking.js +1 -1
  2. package/dist/extensions/calDotCom/actions/createBooking/createBooking.js.map +1 -1
  3. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.d.ts +4 -0
  4. package/dist/extensions/healthie/actions/{applyTagToPatient.js → applyTagToPatient/applyTagToPatient.js} +6 -22
  5. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.js.map +1 -0
  6. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.test.d.ts +1 -0
  7. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.test.js +33 -0
  8. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.test.js.map +1 -0
  9. package/dist/extensions/healthie/actions/{applyTagToPatient.d.ts → applyTagToPatient/config/fields.d.ts} +2 -5
  10. package/dist/extensions/healthie/actions/applyTagToPatient/config/fields.js +21 -0
  11. package/dist/extensions/healthie/actions/applyTagToPatient/config/fields.js.map +1 -0
  12. package/dist/extensions/healthie/actions/applyTagToPatient/config/index.d.ts +1 -0
  13. package/dist/extensions/healthie/actions/applyTagToPatient/config/index.js +6 -0
  14. package/dist/extensions/healthie/actions/applyTagToPatient/config/index.js.map +1 -0
  15. package/dist/extensions/healthie/actions/applyTagToPatient/index.d.ts +1 -0
  16. package/dist/extensions/healthie/actions/applyTagToPatient/index.js +18 -0
  17. package/dist/extensions/healthie/actions/applyTagToPatient/index.js.map +1 -0
  18. package/dist/extensions/healthie/actions/archivePatient/archivePatient.d.ts +4 -0
  19. package/dist/extensions/healthie/actions/{archivePatient.js → archivePatient/archivePatient.js} +6 -15
  20. package/dist/extensions/healthie/actions/archivePatient/archivePatient.js.map +1 -0
  21. package/dist/extensions/healthie/actions/archivePatient/archivePatient.test.d.ts +1 -0
  22. package/dist/extensions/healthie/actions/archivePatient/archivePatient.test.js +42 -0
  23. package/dist/extensions/healthie/actions/archivePatient/archivePatient.test.js.map +1 -0
  24. package/dist/extensions/healthie/actions/archivePatient/config/fields.d.ts +10 -0
  25. package/dist/extensions/healthie/actions/archivePatient/config/fields.js +14 -0
  26. package/dist/extensions/healthie/actions/archivePatient/config/fields.js.map +1 -0
  27. package/dist/extensions/healthie/actions/archivePatient/config/index.d.ts +1 -0
  28. package/dist/extensions/healthie/actions/archivePatient/config/index.js +6 -0
  29. package/dist/extensions/healthie/actions/archivePatient/config/index.js.map +1 -0
  30. package/dist/extensions/healthie/actions/archivePatient/index.d.ts +1 -0
  31. package/dist/extensions/healthie/actions/archivePatient/index.js +18 -0
  32. package/dist/extensions/healthie/actions/archivePatient/index.js.map +1 -0
  33. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.d.ts +4 -0
  34. package/dist/extensions/healthie/actions/{assignPatientToGroup.js → assignPatientToGroup/assignPatientToGroup.js} +6 -22
  35. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.js.map +1 -0
  36. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.test.d.ts +1 -0
  37. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.test.js +42 -0
  38. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.test.js.map +1 -0
  39. package/dist/extensions/healthie/actions/{assignPatientToGroup.d.ts → assignPatientToGroup/config/fields.d.ts} +2 -5
  40. package/dist/extensions/healthie/actions/assignPatientToGroup/config/fields.js +21 -0
  41. package/dist/extensions/healthie/actions/assignPatientToGroup/config/fields.js.map +1 -0
  42. package/dist/extensions/healthie/actions/assignPatientToGroup/config/index.d.ts +1 -0
  43. package/dist/extensions/healthie/actions/assignPatientToGroup/config/index.js +6 -0
  44. package/dist/extensions/healthie/actions/assignPatientToGroup/config/index.js.map +1 -0
  45. package/dist/extensions/healthie/actions/assignPatientToGroup/index.d.ts +1 -0
  46. package/dist/extensions/healthie/actions/assignPatientToGroup/index.js +18 -0
  47. package/dist/extensions/healthie/actions/assignPatientToGroup/index.js.map +1 -0
  48. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.d.ts +4 -0
  49. package/dist/extensions/healthie/actions/{cancelAppointment.js → cancelAppointment/cancelAppointment.js} +6 -15
  50. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.js.map +1 -0
  51. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.test.d.ts +1 -0
  52. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.test.js +37 -0
  53. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.test.js.map +1 -0
  54. package/dist/extensions/healthie/actions/cancelAppointment/config/fields.d.ts +10 -0
  55. package/dist/extensions/healthie/actions/cancelAppointment/config/fields.js +14 -0
  56. package/dist/extensions/healthie/actions/cancelAppointment/config/fields.js.map +1 -0
  57. package/dist/extensions/healthie/actions/cancelAppointment/config/index.d.ts +1 -0
  58. package/dist/extensions/healthie/actions/cancelAppointment/config/index.js +6 -0
  59. package/dist/extensions/healthie/actions/cancelAppointment/config/index.js.map +1 -0
  60. package/dist/extensions/healthie/actions/cancelAppointment/index.d.ts +1 -0
  61. package/dist/extensions/healthie/actions/cancelAppointment/index.js +6 -0
  62. package/dist/extensions/healthie/actions/cancelAppointment/index.js.map +1 -0
  63. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.d.ts +4 -0
  64. package/dist/extensions/healthie/actions/{closeChatConversation.js → closeChatConversation/closeChatConversation.js} +6 -22
  65. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.js.map +1 -0
  66. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.test.d.ts +1 -0
  67. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.test.js +38 -0
  68. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.test.js.map +1 -0
  69. package/dist/extensions/healthie/actions/{closeChatConversation.d.ts → closeChatConversation/config/fields.d.ts} +2 -5
  70. package/dist/extensions/healthie/actions/closeChatConversation/config/fields.js +21 -0
  71. package/dist/extensions/healthie/actions/closeChatConversation/config/fields.js.map +1 -0
  72. package/dist/extensions/healthie/actions/closeChatConversation/config/index.d.ts +1 -0
  73. package/dist/extensions/healthie/actions/closeChatConversation/config/index.js +6 -0
  74. package/dist/extensions/healthie/actions/closeChatConversation/config/index.js.map +1 -0
  75. package/dist/extensions/healthie/actions/closeChatConversation/index.d.ts +1 -0
  76. package/dist/extensions/healthie/actions/closeChatConversation/index.js +6 -0
  77. package/dist/extensions/healthie/actions/closeChatConversation/index.js.map +1 -0
  78. package/dist/extensions/healthie/actions/completeTask/completeTask.d.ts +4 -0
  79. package/dist/extensions/healthie/actions/{completeTask.js → completeTask/completeTask.js} +6 -15
  80. package/dist/extensions/healthie/actions/completeTask/completeTask.js.map +1 -0
  81. package/dist/extensions/healthie/actions/completeTask/completeTask.test.d.ts +1 -0
  82. package/dist/extensions/healthie/actions/completeTask/completeTask.test.js +37 -0
  83. package/dist/extensions/healthie/actions/completeTask/completeTask.test.js.map +1 -0
  84. package/dist/extensions/healthie/actions/completeTask/config/fields.d.ts +10 -0
  85. package/dist/extensions/healthie/actions/completeTask/config/fields.js +14 -0
  86. package/dist/extensions/healthie/actions/completeTask/config/fields.js.map +1 -0
  87. package/dist/extensions/healthie/actions/completeTask/config/index.d.ts +1 -0
  88. package/dist/extensions/healthie/actions/completeTask/config/index.js +6 -0
  89. package/dist/extensions/healthie/actions/completeTask/config/index.js.map +1 -0
  90. package/dist/extensions/healthie/actions/completeTask/index.d.ts +1 -0
  91. package/dist/extensions/healthie/actions/completeTask/index.js +6 -0
  92. package/dist/extensions/healthie/actions/completeTask/index.js.map +1 -0
  93. package/dist/extensions/healthie/actions/createAppointment/config/dataPoints.d.ts +6 -0
  94. package/dist/extensions/healthie/actions/createAppointment/config/dataPoints.js +10 -0
  95. package/dist/extensions/healthie/actions/createAppointment/config/dataPoints.js.map +1 -0
  96. package/dist/extensions/healthie/actions/{createAppointment.d.ts → createAppointment/config/fields.d.ts} +2 -11
  97. package/dist/extensions/healthie/actions/createAppointment/config/fields.js +41 -0
  98. package/dist/extensions/healthie/actions/createAppointment/config/fields.js.map +1 -0
  99. package/dist/extensions/healthie/actions/createAppointment/config/index.d.ts +2 -0
  100. package/dist/extensions/healthie/actions/createAppointment/config/index.js +8 -0
  101. package/dist/extensions/healthie/actions/createAppointment/config/index.js.map +1 -0
  102. package/dist/extensions/healthie/actions/createAppointment/createAppointment.d.ts +4 -0
  103. package/dist/extensions/healthie/actions/{createAppointment.js → createAppointment/createAppointment.js} +7 -49
  104. package/dist/extensions/healthie/actions/createAppointment/createAppointment.js.map +1 -0
  105. package/dist/extensions/healthie/actions/createAppointment/index.d.ts +1 -0
  106. package/dist/extensions/healthie/actions/createAppointment/index.js +6 -0
  107. package/dist/extensions/healthie/actions/createAppointment/index.js.map +1 -0
  108. package/dist/extensions/healthie/actions/{createChartingNote.d.ts → createChartingNote/config/fields.d.ts} +2 -5
  109. package/dist/extensions/healthie/actions/createChartingNote/config/fields.js +35 -0
  110. package/dist/extensions/healthie/actions/createChartingNote/config/fields.js.map +1 -0
  111. package/dist/extensions/healthie/actions/createChartingNote/config/index.d.ts +1 -0
  112. package/dist/extensions/healthie/actions/createChartingNote/config/index.js +6 -0
  113. package/dist/extensions/healthie/actions/createChartingNote/config/index.js.map +1 -0
  114. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.d.ts +4 -0
  115. package/dist/extensions/healthie/actions/{createChartingNote.js → createChartingNote/createChartingNote.js} +6 -36
  116. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.js.map +1 -0
  117. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.test.d.ts +1 -0
  118. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.test.js +36 -0
  119. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.test.js.map +1 -0
  120. package/dist/extensions/healthie/actions/createChartingNote/index.d.ts +1 -0
  121. package/dist/extensions/healthie/actions/createChartingNote/index.js +6 -0
  122. package/dist/extensions/healthie/actions/createChartingNote/index.js.map +1 -0
  123. package/dist/extensions/healthie/actions/createJournalEntry/config/dataPoints.d.ts +6 -0
  124. package/dist/extensions/healthie/actions/createJournalEntry/config/dataPoints.js +10 -0
  125. package/dist/extensions/healthie/actions/createJournalEntry/config/dataPoints.js.map +1 -0
  126. package/dist/extensions/healthie/actions/{createJournalEntry.d.ts → createJournalEntry/config/fields.d.ts} +2 -11
  127. package/dist/extensions/healthie/actions/createJournalEntry/config/fields.js +27 -0
  128. package/dist/extensions/healthie/actions/createJournalEntry/config/fields.js.map +1 -0
  129. package/dist/extensions/healthie/actions/createJournalEntry/config/index.d.ts +2 -0
  130. package/dist/extensions/healthie/actions/createJournalEntry/config/index.js +8 -0
  131. package/dist/extensions/healthie/actions/createJournalEntry/config/index.js.map +1 -0
  132. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.d.ts +4 -0
  133. package/dist/extensions/healthie/actions/{createJournalEntry.js → createJournalEntry/createJournalEntry.js} +7 -35
  134. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.js.map +1 -0
  135. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.test.d.ts +1 -0
  136. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.test.js +34 -0
  137. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.test.js.map +1 -0
  138. package/dist/extensions/healthie/actions/createJournalEntry/index.d.ts +1 -0
  139. package/dist/extensions/healthie/actions/createJournalEntry/index.js +6 -0
  140. package/dist/extensions/healthie/actions/createJournalEntry/index.js.map +1 -0
  141. package/dist/extensions/healthie/actions/createLocation/config/dataPoints.d.ts +6 -0
  142. package/dist/extensions/healthie/actions/createLocation/config/dataPoints.js +10 -0
  143. package/dist/extensions/healthie/actions/createLocation/config/dataPoints.js.map +1 -0
  144. package/dist/extensions/healthie/actions/{createLocation.d.ts → createLocation/config/fields.d.ts} +2 -11
  145. package/dist/extensions/healthie/actions/createLocation/config/fields.js +57 -0
  146. package/dist/extensions/healthie/actions/createLocation/config/fields.js.map +1 -0
  147. package/dist/extensions/healthie/actions/createLocation/config/index.d.ts +2 -0
  148. package/dist/extensions/healthie/actions/createLocation/config/index.js +8 -0
  149. package/dist/extensions/healthie/actions/createLocation/config/index.js.map +1 -0
  150. package/dist/extensions/healthie/actions/createLocation/createLocation.d.ts +4 -0
  151. package/dist/extensions/healthie/actions/createLocation/createLocation.js +100 -0
  152. package/dist/extensions/healthie/actions/createLocation/createLocation.js.map +1 -0
  153. package/dist/extensions/healthie/actions/createLocation/createLocation.test.d.ts +1 -0
  154. package/dist/extensions/healthie/actions/createLocation/createLocation.test.js +39 -0
  155. package/dist/extensions/healthie/actions/createLocation/createLocation.test.js.map +1 -0
  156. package/dist/extensions/healthie/actions/createLocation/index.d.ts +1 -0
  157. package/dist/extensions/healthie/actions/createLocation/index.js +6 -0
  158. package/dist/extensions/healthie/actions/createLocation/index.js.map +1 -0
  159. package/dist/extensions/healthie/actions/{createPatient.d.ts → createPatient/config/fields.d.ts} +2 -11
  160. package/dist/extensions/healthie/actions/createPatient/config/fields.js +59 -0
  161. package/dist/extensions/healthie/actions/createPatient/config/fields.js.map +1 -0
  162. package/dist/extensions/healthie/actions/createPatient/config/index.d.ts +1 -0
  163. package/dist/extensions/healthie/actions/createPatient/config/index.js +6 -0
  164. package/dist/extensions/healthie/actions/createPatient/config/index.js.map +1 -0
  165. package/dist/extensions/healthie/actions/createPatient/createPatient.d.ts +11 -0
  166. package/dist/extensions/healthie/actions/{createPatient.js → createPatient/createPatient.js} +6 -60
  167. package/dist/extensions/healthie/actions/createPatient/createPatient.js.map +1 -0
  168. package/dist/extensions/healthie/actions/createPatient/createPatient.test.d.ts +1 -0
  169. package/dist/extensions/healthie/actions/createPatient/createPatient.test.js +43 -0
  170. package/dist/extensions/healthie/actions/createPatient/createPatient.test.js.map +1 -0
  171. package/dist/extensions/healthie/actions/createPatient/index.d.ts +1 -0
  172. package/dist/extensions/healthie/actions/createPatient/index.js +6 -0
  173. package/dist/extensions/healthie/actions/createPatient/index.js.map +1 -0
  174. package/dist/extensions/healthie/actions/createTask/config/dataPoints.d.ts +6 -0
  175. package/dist/extensions/healthie/actions/createTask/config/dataPoints.js +10 -0
  176. package/dist/extensions/healthie/actions/createTask/config/dataPoints.js.map +1 -0
  177. package/dist/extensions/healthie/actions/{createTask.d.ts → createTask/config/fields.d.ts} +2 -11
  178. package/dist/extensions/healthie/actions/createTask/config/fields.js +64 -0
  179. package/dist/extensions/healthie/actions/createTask/config/fields.js.map +1 -0
  180. package/dist/extensions/healthie/actions/createTask/config/index.d.ts +2 -0
  181. package/dist/extensions/healthie/actions/createTask/config/index.js +8 -0
  182. package/dist/extensions/healthie/actions/createTask/config/index.js.map +1 -0
  183. package/dist/extensions/healthie/actions/createTask/createTask.d.ts +4 -0
  184. package/dist/extensions/healthie/actions/createTask/createTask.js +96 -0
  185. package/dist/extensions/healthie/actions/createTask/createTask.js.map +1 -0
  186. package/dist/extensions/healthie/actions/createTask/createTask.test.d.ts +1 -0
  187. package/dist/extensions/healthie/actions/createTask/createTask.test.js +245 -0
  188. package/dist/extensions/healthie/actions/createTask/createTask.test.js.map +1 -0
  189. package/dist/extensions/healthie/actions/createTask/index.d.ts +1 -0
  190. package/dist/extensions/healthie/actions/createTask/index.js +6 -0
  191. package/dist/extensions/healthie/actions/createTask/index.js.map +1 -0
  192. package/dist/extensions/healthie/actions/deleteAppointment/config/fields.d.ts +10 -0
  193. package/dist/extensions/healthie/actions/deleteAppointment/config/fields.js +14 -0
  194. package/dist/extensions/healthie/actions/deleteAppointment/config/fields.js.map +1 -0
  195. package/dist/extensions/healthie/actions/deleteAppointment/config/index.d.ts +1 -0
  196. package/dist/extensions/healthie/actions/deleteAppointment/config/index.js +6 -0
  197. package/dist/extensions/healthie/actions/deleteAppointment/config/index.js.map +1 -0
  198. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.d.ts +4 -0
  199. package/dist/extensions/healthie/actions/{deleteAppointment.js → deleteAppointment/deleteAppointment.js} +6 -15
  200. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.js.map +1 -0
  201. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.test.d.ts +1 -0
  202. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.test.js +34 -0
  203. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.test.js.map +1 -0
  204. package/dist/extensions/healthie/actions/deleteAppointment/index.d.ts +1 -0
  205. package/dist/extensions/healthie/actions/deleteAppointment/index.js +6 -0
  206. package/dist/extensions/healthie/actions/deleteAppointment/index.js.map +1 -0
  207. package/dist/extensions/healthie/actions/deleteTask/config/fields.d.ts +10 -0
  208. package/dist/extensions/healthie/actions/deleteTask/config/fields.js +14 -0
  209. package/dist/extensions/healthie/actions/deleteTask/config/fields.js.map +1 -0
  210. package/dist/extensions/healthie/actions/deleteTask/config/index.d.ts +1 -0
  211. package/dist/extensions/healthie/actions/deleteTask/config/index.js +6 -0
  212. package/dist/extensions/healthie/actions/deleteTask/config/index.js.map +1 -0
  213. package/dist/extensions/healthie/actions/deleteTask/deleteTask.d.ts +4 -0
  214. package/dist/extensions/healthie/actions/{deleteTask.js → deleteTask/deleteTask.js} +6 -15
  215. package/dist/extensions/healthie/actions/deleteTask/deleteTask.js.map +1 -0
  216. package/dist/extensions/healthie/actions/deleteTask/deleteTask.test.d.ts +1 -0
  217. package/dist/extensions/healthie/actions/deleteTask/deleteTask.test.js +34 -0
  218. package/dist/extensions/healthie/actions/deleteTask/deleteTask.test.js.map +1 -0
  219. package/dist/extensions/healthie/actions/deleteTask/index.d.ts +1 -0
  220. package/dist/extensions/healthie/actions/deleteTask/index.js +6 -0
  221. package/dist/extensions/healthie/actions/deleteTask/index.js.map +1 -0
  222. package/dist/extensions/healthie/actions/getAppointment/config/dataPoints.d.ts +22 -0
  223. package/dist/extensions/healthie/actions/getAppointment/config/dataPoints.js +26 -0
  224. package/dist/extensions/healthie/actions/getAppointment/config/dataPoints.js.map +1 -0
  225. package/dist/extensions/healthie/actions/getAppointment/config/fields.d.ts +9 -0
  226. package/dist/extensions/healthie/actions/getAppointment/config/fields.js +13 -0
  227. package/dist/extensions/healthie/actions/getAppointment/config/fields.js.map +1 -0
  228. package/dist/extensions/healthie/actions/getAppointment/config/index.d.ts +2 -0
  229. package/dist/extensions/healthie/actions/getAppointment/config/index.js +8 -0
  230. package/dist/extensions/healthie/actions/getAppointment/config/index.js.map +1 -0
  231. package/dist/extensions/healthie/actions/getAppointment/getAppointment.d.ts +4 -0
  232. package/dist/extensions/healthie/actions/{getAppointment.js → getAppointment/getAppointment.js} +8 -38
  233. package/dist/extensions/healthie/actions/getAppointment/getAppointment.js.map +1 -0
  234. package/dist/extensions/healthie/actions/getAppointment/getAppointment.test.d.ts +1 -0
  235. package/dist/extensions/healthie/actions/getAppointment/getAppointment.test.js +83 -0
  236. package/dist/extensions/healthie/actions/getAppointment/getAppointment.test.js.map +1 -0
  237. package/dist/extensions/healthie/actions/getAppointment/index.d.ts +1 -0
  238. package/dist/extensions/healthie/actions/getAppointment/index.js +6 -0
  239. package/dist/extensions/healthie/actions/getAppointment/index.js.map +1 -0
  240. package/dist/extensions/healthie/actions/{getPatient.d.ts → getPatient/config/dataPoints.d.ts} +1 -13
  241. package/dist/extensions/healthie/actions/getPatient/config/dataPoints.js +42 -0
  242. package/dist/extensions/healthie/actions/getPatient/config/dataPoints.js.map +1 -0
  243. package/dist/extensions/healthie/actions/getPatient/config/fields.d.ts +9 -0
  244. package/dist/extensions/healthie/actions/getPatient/config/fields.js +13 -0
  245. package/dist/extensions/healthie/actions/getPatient/config/fields.js.map +1 -0
  246. package/dist/extensions/healthie/actions/getPatient/config/index.d.ts +2 -0
  247. package/dist/extensions/healthie/actions/getPatient/config/index.js +8 -0
  248. package/dist/extensions/healthie/actions/getPatient/config/index.js.map +1 -0
  249. package/dist/extensions/healthie/actions/getPatient/getPatient.d.ts +4 -0
  250. package/dist/extensions/healthie/actions/{getPatient.js → getPatient/getPatient.js} +9 -55
  251. package/dist/extensions/healthie/actions/{getPatient.js.map → getPatient/getPatient.js.map} +1 -1
  252. package/dist/extensions/healthie/actions/getPatient/getPatient.test.d.ts +1 -0
  253. package/dist/extensions/healthie/actions/getPatient/getPatient.test.js +235 -0
  254. package/dist/extensions/healthie/actions/getPatient/getPatient.test.js.map +1 -0
  255. package/dist/extensions/healthie/actions/getPatient/index.d.ts +1 -0
  256. package/dist/extensions/healthie/actions/getPatient/index.js +18 -0
  257. package/dist/extensions/healthie/actions/getPatient/index.js.map +1 -0
  258. package/dist/extensions/healthie/actions/index.d.ts +8 -2
  259. package/dist/extensions/healthie/actions/index.js +4 -4
  260. package/dist/extensions/healthie/actions/index.js.map +1 -1
  261. package/dist/extensions/healthie/actions/{removeTagFromPatient.d.ts → removeTagFromPatient/config/fields.d.ts} +2 -5
  262. package/dist/extensions/healthie/actions/removeTagFromPatient/config/fields.js +21 -0
  263. package/dist/extensions/healthie/actions/removeTagFromPatient/config/fields.js.map +1 -0
  264. package/dist/extensions/healthie/actions/removeTagFromPatient/config/index.d.ts +1 -0
  265. package/dist/extensions/healthie/actions/removeTagFromPatient/config/index.js +6 -0
  266. package/dist/extensions/healthie/actions/removeTagFromPatient/config/index.js.map +1 -0
  267. package/dist/extensions/healthie/actions/removeTagFromPatient/index.d.ts +1 -0
  268. package/dist/extensions/healthie/actions/removeTagFromPatient/index.js +6 -0
  269. package/dist/extensions/healthie/actions/removeTagFromPatient/index.js.map +1 -0
  270. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.d.ts +4 -0
  271. package/dist/extensions/healthie/actions/{removeTagFromPatient.js → removeTagFromPatient/removeTagFromPatient.js} +6 -22
  272. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.js.map +1 -0
  273. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.test.d.ts +1 -0
  274. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.test.js +33 -0
  275. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.test.js.map +1 -0
  276. package/dist/extensions/healthie/actions/sendChatMessage/config/dataPoints.d.ts +6 -0
  277. package/dist/extensions/healthie/actions/sendChatMessage/config/dataPoints.js +10 -0
  278. package/dist/extensions/healthie/actions/sendChatMessage/config/dataPoints.js.map +1 -0
  279. package/dist/extensions/healthie/actions/{sendChatMessage.d.ts → sendChatMessage/config/fields.d.ts} +2 -11
  280. package/dist/extensions/healthie/actions/sendChatMessage/config/fields.js +28 -0
  281. package/dist/extensions/healthie/actions/sendChatMessage/config/fields.js.map +1 -0
  282. package/dist/extensions/healthie/actions/sendChatMessage/config/index.d.ts +2 -0
  283. package/dist/extensions/healthie/actions/sendChatMessage/config/index.js +8 -0
  284. package/dist/extensions/healthie/actions/sendChatMessage/config/index.js.map +1 -0
  285. package/dist/extensions/healthie/actions/sendChatMessage/index.d.ts +1 -0
  286. package/dist/extensions/healthie/actions/sendChatMessage/index.js +6 -0
  287. package/dist/extensions/healthie/actions/sendChatMessage/index.js.map +1 -0
  288. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.d.ts +4 -0
  289. package/dist/extensions/healthie/actions/{sendChatMessage.js → sendChatMessage/sendChatMessage.js} +7 -36
  290. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.js.map +1 -0
  291. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.test.d.ts +1 -0
  292. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.test.js +142 -0
  293. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.test.js.map +1 -0
  294. package/dist/extensions/healthie/actions/{sendFormCompletionRequest.d.ts → sendFormCompletionRequest/config/fields.d.ts} +2 -5
  295. package/dist/extensions/healthie/actions/sendFormCompletionRequest/config/fields.js +77 -0
  296. package/dist/extensions/healthie/actions/sendFormCompletionRequest/config/fields.js.map +1 -0
  297. package/dist/extensions/healthie/actions/sendFormCompletionRequest/config/index.d.ts +1 -0
  298. package/dist/extensions/healthie/actions/sendFormCompletionRequest/config/index.js +6 -0
  299. package/dist/extensions/healthie/actions/sendFormCompletionRequest/config/index.js.map +1 -0
  300. package/dist/extensions/healthie/actions/sendFormCompletionRequest/index.d.ts +1 -0
  301. package/dist/extensions/healthie/actions/sendFormCompletionRequest/index.js +6 -0
  302. package/dist/extensions/healthie/actions/sendFormCompletionRequest/index.js.map +1 -0
  303. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.d.ts +4 -0
  304. package/dist/extensions/healthie/actions/{sendFormCompletionRequest.js → sendFormCompletionRequest/sendFormCompletionRequest.js} +7 -79
  305. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.js.map +1 -0
  306. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.test.d.ts +1 -0
  307. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.test.js +199 -0
  308. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.test.js.map +1 -0
  309. package/dist/extensions/healthie/actions/{updatePatient.d.ts → updatePatient/config/fields.d.ts} +2 -6
  310. package/dist/extensions/healthie/actions/updatePatient/config/fields.js +99 -0
  311. package/dist/extensions/healthie/actions/updatePatient/config/fields.js.map +1 -0
  312. package/dist/extensions/healthie/actions/updatePatient/config/index.d.ts +1 -0
  313. package/dist/extensions/healthie/actions/updatePatient/config/index.js +6 -0
  314. package/dist/extensions/healthie/actions/updatePatient/config/index.js.map +1 -0
  315. package/dist/extensions/healthie/actions/updatePatient/index.d.ts +1 -0
  316. package/dist/extensions/healthie/actions/updatePatient/index.js +18 -0
  317. package/dist/extensions/healthie/actions/updatePatient/index.js.map +1 -0
  318. package/dist/extensions/healthie/actions/updatePatient/updatePatient.d.ts +4 -0
  319. package/dist/extensions/healthie/actions/updatePatient/updatePatient.js +100 -0
  320. package/dist/extensions/healthie/actions/updatePatient/updatePatient.js.map +1 -0
  321. package/dist/extensions/healthie/actions/updatePatient/updatePatient.test.d.ts +1 -0
  322. package/dist/extensions/healthie/actions/updatePatient/updatePatient.test.js +46 -0
  323. package/dist/extensions/healthie/actions/updatePatient/updatePatient.test.js.map +1 -0
  324. package/dist/extensions/healthie/graphqlClient.test.d.ts +1 -0
  325. package/dist/extensions/healthie/graphqlClient.test.js +63 -0
  326. package/dist/extensions/healthie/graphqlClient.test.js.map +1 -0
  327. package/package.json +1 -1
  328. package/dist/extensions/healthie/actions/applyTagToPatient.js.map +0 -1
  329. package/dist/extensions/healthie/actions/archivePatient.d.ts +0 -13
  330. package/dist/extensions/healthie/actions/archivePatient.js.map +0 -1
  331. package/dist/extensions/healthie/actions/assignPatientToGroup.js.map +0 -1
  332. package/dist/extensions/healthie/actions/cancelAppointment.d.ts +0 -13
  333. package/dist/extensions/healthie/actions/cancelAppointment.js.map +0 -1
  334. package/dist/extensions/healthie/actions/closeChatConversation.js.map +0 -1
  335. package/dist/extensions/healthie/actions/completeTask.d.ts +0 -13
  336. package/dist/extensions/healthie/actions/completeTask.js.map +0 -1
  337. package/dist/extensions/healthie/actions/createAppointment.js.map +0 -1
  338. package/dist/extensions/healthie/actions/createChartingNote.js.map +0 -1
  339. package/dist/extensions/healthie/actions/createJournalEntry.js.map +0 -1
  340. package/dist/extensions/healthie/actions/createLocation.js +0 -158
  341. package/dist/extensions/healthie/actions/createLocation.js.map +0 -1
  342. package/dist/extensions/healthie/actions/createPatient.js.map +0 -1
  343. package/dist/extensions/healthie/actions/createTask.js +0 -161
  344. package/dist/extensions/healthie/actions/createTask.js.map +0 -1
  345. package/dist/extensions/healthie/actions/deleteAppointment.d.ts +0 -13
  346. package/dist/extensions/healthie/actions/deleteAppointment.js.map +0 -1
  347. package/dist/extensions/healthie/actions/deleteTask.d.ts +0 -13
  348. package/dist/extensions/healthie/actions/deleteTask.js.map +0 -1
  349. package/dist/extensions/healthie/actions/getAppointment.d.ts +0 -34
  350. package/dist/extensions/healthie/actions/getAppointment.js.map +0 -1
  351. package/dist/extensions/healthie/actions/removeTagFromPatient.js.map +0 -1
  352. package/dist/extensions/healthie/actions/sendChatMessage.js.map +0 -1
  353. package/dist/extensions/healthie/actions/sendFormCompletionRequest.js.map +0 -1
  354. package/dist/extensions/healthie/actions/updatePatient.js +0 -194
  355. package/dist/extensions/healthie/actions/updatePatient.js.map +0 -1
@@ -4,46 +4,17 @@ exports.sendChatMessage = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  const cheerio_1 = require("cheerio");
6
6
  const extensions_core_1 = require("@awell-health/extensions-core");
7
- const extensions_core_2 = require("@awell-health/extensions-core");
8
- const sdk_1 = require("../gql/sdk");
9
- const graphqlClient_1 = require("../graphqlClient");
10
- const errors_1 = require("../errors");
11
- const fields = {
12
- healthie_patient_id: {
13
- id: 'healthie_patient_id',
14
- label: 'Healthie Patient ID',
15
- description: 'The ID of the patient in Healthie you would like to send a chat message to.',
16
- type: extensions_core_1.FieldType.STRING,
17
- required: true,
18
- },
19
- provider_id: {
20
- id: 'provider_id',
21
- label: 'Provider ID',
22
- description: 'The ID of the provider, the chat message will be sent in name of this provider.',
23
- type: extensions_core_1.FieldType.STRING,
24
- required: true,
25
- },
26
- message: {
27
- id: 'message',
28
- label: 'Message',
29
- description: 'The chat message you would like to send.',
30
- type: extensions_core_1.FieldType.HTML,
31
- required: true,
32
- },
33
- };
34
- const dataPoints = {
35
- conversationId: {
36
- key: 'conversationId',
37
- valueType: 'string',
38
- },
39
- };
7
+ const sdk_1 = require("../../gql/sdk");
8
+ const graphqlClient_1 = require("../../graphqlClient");
9
+ const errors_1 = require("../../errors");
10
+ const config_1 = require("./config");
40
11
  exports.sendChatMessage = {
41
12
  key: 'sendChatMessage',
42
- category: extensions_core_2.Category.EHR_INTEGRATIONS,
13
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
43
14
  title: 'Send chat message',
44
15
  description: 'Send a chat message to a patient in Healthie.',
45
- fields,
46
- dataPoints,
16
+ fields: config_1.fields,
17
+ dataPoints: config_1.dataPoints,
47
18
  previewable: true,
48
19
  onActivityCreated: async (payload, onComplete, onError) => {
49
20
  const { fields, settings } = payload;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendChatMessage.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/sendChatMessage/sendChatMessage.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,qCAA6C;AAE7C,mEAAwD;AACxD,uCAAsC;AACtC,uDAAsD;AAGtD,yCAAwE;AACxE,qCAA6C;AAEhC,QAAA,eAAe,GAIxB;IACF,GAAG,EAAE,iBAAiB;IACtB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,+CAA+C;IAC5D,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QACpC,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;QAC5D,IAAI;YACF,IAAI,mBAAmB,KAAK,SAAS,EAAE;gBACrC,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE;4BAClC,KAAK,EAAE;gCACL,QAAQ,EAAE,gBAAgB;gCAC1B,OAAO,EAAE,kCAAkC;6BAC5C;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;aACP;YAED,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,QAAQ,CAAC,CAAA;YACzC,IAAI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CAAA;aACH;iBAAM;gBACL,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,4CAA4C,EAAE;4BAC1D,KAAK,EAAE;gCACL,QAAQ,EAAE,kBAAkB;gCAC5B,OAAO,EAAE,4BAA4B;6BACtC;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,sBAAa,EAAE;gBAChC,MAAM,MAAM,GAAG,IAAA,mCAA0B,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACrD,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,MAAM;iBACf,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAY,CAAA;gBAC1B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;4BAC9C,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tests_1 = require("../../../../src/tests");
4
+ const sdk_1 = require("../../gql/sdk");
5
+ const sdk_2 = require("../../gql/__mocks__/sdk");
6
+ const sendChatMessage_1 = require("../sendChatMessage");
7
+ jest.mock('../../gql/sdk');
8
+ jest.mock('../../graphqlClient');
9
+ describe('sendChatMessage action', () => {
10
+ const onComplete = jest.fn();
11
+ beforeAll(() => {
12
+ ;
13
+ sdk_1.getSdk.mockImplementation(sdk_2.mockGetSdk);
14
+ });
15
+ beforeEach(() => {
16
+ jest.clearAllMocks();
17
+ });
18
+ test("Should create a new message when it doesn't exist", async () => {
19
+ await sendChatMessage_1.sendChatMessage.onActivityCreated((0, tests_1.generateTestPayload)({
20
+ fields: {
21
+ healthie_patient_id: 'patient-1',
22
+ message: 'hello',
23
+ provider_id: 'provider-1',
24
+ },
25
+ settings: {
26
+ apiKey: 'apiKey',
27
+ apiUrl: 'test-url',
28
+ },
29
+ }), onComplete, jest.fn());
30
+ expect(sdk_2.mockGetSdkReturn.getConversationList).toHaveReturnedWith({
31
+ data: { conversationMemberships: [] },
32
+ });
33
+ expect(sdk_2.mockGetSdkReturn.createConversation).toHaveBeenCalled();
34
+ expect(sdk_2.mockGetSdkReturn.sendChatMessage).toHaveBeenCalled();
35
+ expect(onComplete).toHaveBeenCalledWith({
36
+ data_points: {
37
+ conversationId: 'conversation-1',
38
+ },
39
+ });
40
+ });
41
+ test.skip('Should not create a new message when it exists', async () => {
42
+ ;
43
+ sdk_1.getSdk.mockReturnValueOnce({
44
+ ...sdk_2.mockGetSdkReturn,
45
+ getConversationList: sdk_2.mockGetSdkReturn.getConversationList.mockReturnValueOnce({
46
+ data: {
47
+ conversationMemberships: [
48
+ {
49
+ convo: {
50
+ id: 'conversation-2',
51
+ owner: { id: 'provider-1' },
52
+ },
53
+ },
54
+ ],
55
+ },
56
+ }),
57
+ });
58
+ await sendChatMessage_1.sendChatMessage.onActivityCreated((0, tests_1.generateTestPayload)({
59
+ fields: {
60
+ healthie_patient_id: 'patient-1',
61
+ message: 'hello',
62
+ provider_id: 'provider-1',
63
+ },
64
+ settings: {
65
+ apiKey: 'apiKey',
66
+ apiUrl: 'test-url',
67
+ },
68
+ }), onComplete, jest.fn());
69
+ expect(sdk_2.mockGetSdkReturn.createConversation).not.toHaveBeenCalled();
70
+ expect(sdk_2.mockGetSdkReturn.sendChatMessage).toHaveBeenCalled();
71
+ expect(onComplete).toHaveBeenCalledWith({
72
+ data_points: {
73
+ conversationId: 'conversation-2',
74
+ },
75
+ });
76
+ });
77
+ test.each([
78
+ {
79
+ input: {
80
+ message: '<p class="slate-p">https://securestaging.gethealthie.com/appointments/embed_appt?dietitian_id=123&amp;provider_ids=[<span>123</span>]&amp;appt_type_ids=[19420]&amp;org_level=true</p>',
81
+ },
82
+ output: {
83
+ message: '<p class="slate-p">https://securestaging.gethealthie.com/appointments/embed_appt?dietitian_id=123&amp;provider_ids=[123]&amp;appt_type_ids=[19420]&amp;org_level=true</p>',
84
+ },
85
+ },
86
+ {
87
+ input: {
88
+ message: 'a normal non-html message without a <span> tag',
89
+ },
90
+ output: {
91
+ message: 'a normal non-html message without a <span> tag',
92
+ },
93
+ },
94
+ // This test highlights the problem with our current implementation, but it's good enough.
95
+ {
96
+ input: {
97
+ message: '<div>a normal non-html message without a <span> tag</div>',
98
+ },
99
+ output: {
100
+ message: '<div>a normal non-html message without a tag</div>',
101
+ },
102
+ },
103
+ ])('$#. Should correctly parse message', async ({ input, output }) => {
104
+ ;
105
+ sdk_1.getSdk.mockReturnValueOnce({
106
+ ...sdk_2.mockGetSdkReturn,
107
+ getConversationList: sdk_2.mockGetSdkReturn.getConversationList.mockReturnValueOnce({
108
+ data: {
109
+ conversationMemberships: [
110
+ {
111
+ convo: {
112
+ id: 'conversation-2',
113
+ owner: { id: 'provider-1' },
114
+ },
115
+ },
116
+ ],
117
+ },
118
+ }),
119
+ });
120
+ await sendChatMessage_1.sendChatMessage.onActivityCreated((0, tests_1.generateTestPayload)({
121
+ fields: {
122
+ healthie_patient_id: 'patient-1',
123
+ message: input.message,
124
+ provider_id: 'provider-1',
125
+ },
126
+ settings: {
127
+ apiKey: 'apiKey',
128
+ apiUrl: 'test-url',
129
+ },
130
+ }), onComplete, jest.fn());
131
+ expect(sdk_2.mockGetSdkReturn.createConversation).not.toHaveBeenCalled();
132
+ expect(sdk_2.mockGetSdkReturn.sendChatMessage).toHaveBeenCalledWith({
133
+ input: expect.objectContaining({ content: output.message }),
134
+ });
135
+ expect(onComplete).toHaveBeenCalledWith({
136
+ data_points: {
137
+ conversationId: 'conversation-2',
138
+ },
139
+ });
140
+ });
141
+ });
142
+ //# sourceMappingURL=sendChatMessage.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendChatMessage.test.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/sendChatMessage/sendChatMessage.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,uCAAsC;AACtC,iDAAsE;AACtE,wDAAoD;AAEpD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AAC1B,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;AAEhC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAE5B,SAAS,CAAC,GAAG,EAAE;QACb,CAAC;QAAC,YAAoB,CAAC,kBAAkB,CAAC,gBAAU,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,iCAAe,CAAC,iBAAiB,CACrC,IAAA,2BAAmB,EAAC;YAClB,MAAM,EAAE;gBACN,mBAAmB,EAAE,WAAW;gBAChC,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,YAAY;aAC1B;YACD,QAAQ,EAAE;gBACR,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,UAAU;aACnB;SACF,CAAC,EACF,UAAU,EACV,IAAI,CAAC,EAAE,EAAE,CACV,CAAA;QAED,MAAM,CAAC,sBAAgB,CAAC,mBAAmB,CAAC,CAAC,kBAAkB,CAAC;YAC9D,IAAI,EAAE,EAAE,uBAAuB,EAAE,EAAE,EAAE;SACtC,CAAC,CAAA;QACF,MAAM,CAAC,sBAAgB,CAAC,kBAAkB,CAAC,CA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AC;YAC5D,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SAC5D,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,cAAc,EAAE,gBAAgB;aACjC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,6 +1,5 @@
1
- import { FieldType, type Action } from '@awell-health/extensions-core';
2
- import { type settings } from '../settings';
3
- declare const fields: {
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ export declare const fields: {
4
3
  healthie_patient_id: {
5
4
  id: string;
6
5
  label: string;
@@ -72,5 +71,3 @@ declare const fields: {
72
71
  required: false;
73
72
  };
74
73
  };
75
- export declare const sendFormCompletionRequest: Action<typeof fields, typeof settings>;
76
- export {};
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fields = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ exports.fields = {
6
+ healthie_patient_id: {
7
+ id: 'healthie_patient_id',
8
+ label: 'Healthie Patient ID',
9
+ description: 'The ID of the patient that should receive the form completion request.',
10
+ type: extensions_core_1.FieldType.STRING,
11
+ required: true,
12
+ },
13
+ form_id: {
14
+ id: 'form_id',
15
+ label: 'Form ID',
16
+ description: 'The ID of the form you would like the patient to complete.',
17
+ type: extensions_core_1.FieldType.STRING,
18
+ required: true,
19
+ },
20
+ is_recurring: {
21
+ id: 'is_recurring',
22
+ label: 'Is recurring',
23
+ description: 'Set to true if the Form completion should be recurring.',
24
+ type: extensions_core_1.FieldType.BOOLEAN,
25
+ required: false,
26
+ },
27
+ frequency: {
28
+ id: 'frequency',
29
+ label: 'Frequency',
30
+ description: 'Required if "Is recurring" is set to true. Valid options are: Daily, Weekly, Monthly.',
31
+ type: extensions_core_1.FieldType.STRING,
32
+ required: false,
33
+ },
34
+ period: {
35
+ id: 'period',
36
+ label: 'Period',
37
+ description: 'AM or PM.',
38
+ type: extensions_core_1.FieldType.STRING,
39
+ required: false,
40
+ },
41
+ hour: {
42
+ id: 'hour',
43
+ label: 'Hour',
44
+ description: 'For instance, if you want to trigger the completion request at 1:05 PM, use "1".',
45
+ type: extensions_core_1.FieldType.NUMERIC,
46
+ required: false,
47
+ },
48
+ minute: {
49
+ id: 'minute',
50
+ label: 'Minute',
51
+ description: 'For instance, if you want to trigger the completion request at 1:05 PM, use "5".',
52
+ type: extensions_core_1.FieldType.NUMERIC,
53
+ required: false,
54
+ },
55
+ weekday: {
56
+ id: 'weekday',
57
+ label: 'Weekday',
58
+ description: 'Use the full weekday name, e.g. "Monday".',
59
+ type: extensions_core_1.FieldType.STRING,
60
+ required: false,
61
+ },
62
+ monthday: {
63
+ id: 'monthday',
64
+ label: 'Monthday',
65
+ description: 'Number of the day of month, e.g. "27th".',
66
+ type: extensions_core_1.FieldType.STRING,
67
+ required: false,
68
+ },
69
+ ends_on: {
70
+ id: 'ends_on',
71
+ label: 'Ends on',
72
+ description: 'Recurrence end date in the YYYY-MM-DD format.',
73
+ type: extensions_core_1.FieldType.DATE,
74
+ required: false,
75
+ },
76
+ };
77
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/healthie/actions/sendFormCompletionRequest/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,mBAAmB,EAAE;QACnB,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,wEAAwE;QAC1E,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,4DAA4D;QACzE,IAAI,EA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,EAAE,+CAA+C;QAC5D,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA"}
@@ -0,0 +1 @@
1
+ export { fields } from './fields';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/healthie/actions/sendFormCompletionRequest/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA"}
@@ -0,0 +1 @@
1
+ export { sendFormCompletionRequest } from './sendFormCompletionRequest';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendFormCompletionRequest = void 0;
4
+ var sendFormCompletionRequest_1 = require("./sendFormCompletionRequest");
5
+ Object.defineProperty(exports, "sendFormCompletionRequest", { enumerable: true, get: function () { return sendFormCompletionRequest_1.sendFormCompletionRequest; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/sendFormCompletionRequest/index.ts"],"names":[],"mappings":";;;AAAA,yEAAuE;AAA9D,sIAAA,yBAAyB,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { fields } from './config';
4
+ export declare const sendFormCompletionRequest: Action<typeof fields, typeof settings>;
@@ -1,91 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sendFormCompletionRequest = void 0;
4
- const errors_1 = require("../errors");
4
+ const errors_1 = require("../../errors");
5
5
  const extensions_core_1 = require("@awell-health/extensions-core");
6
- const extensions_core_2 = require("@awell-health/extensions-core");
7
- const sdk_1 = require("../gql/sdk");
8
- const graphqlClient_1 = require("../graphqlClient");
9
- const sendFormCompletionRequest_zod_1 = require("../validation/sendFormCompletionRequest.zod");
6
+ const sdk_1 = require("../../gql/sdk");
7
+ const graphqlClient_1 = require("../../graphqlClient");
8
+ const sendFormCompletionRequest_zod_1 = require("../../validation/sendFormCompletionRequest.zod");
10
9
  const lodash_1 = require("lodash");
11
- const fields = {
12
- healthie_patient_id: {
13
- id: 'healthie_patient_id',
14
- label: 'Healthie Patient ID',
15
- description: 'The ID of the patient that should receive the form completion request.',
16
- type: extensions_core_1.FieldType.STRING,
17
- required: true,
18
- },
19
- form_id: {
20
- id: 'form_id',
21
- label: 'Form ID',
22
- description: 'The ID of the form you would like the patient to complete.',
23
- type: extensions_core_1.FieldType.STRING,
24
- required: true,
25
- },
26
- is_recurring: {
27
- id: 'is_recurring',
28
- label: 'Is recurring',
29
- description: 'Set to true if the Form completion should be recurring.',
30
- type: extensions_core_1.FieldType.BOOLEAN,
31
- required: false,
32
- },
33
- frequency: {
34
- id: 'frequency',
35
- label: 'Frequency',
36
- description: 'Required if "Is recurring" is set to true. Valid options are: Daily, Weekly, Monthly.',
37
- type: extensions_core_1.FieldType.STRING,
38
- required: false,
39
- },
40
- period: {
41
- id: 'period',
42
- label: 'Period',
43
- description: 'AM or PM.',
44
- type: extensions_core_1.FieldType.STRING,
45
- required: false,
46
- },
47
- hour: {
48
- id: 'hour',
49
- label: 'Hour',
50
- description: 'For instance, if you want to trigger the completion request at 1:05 PM, use "1".',
51
- type: extensions_core_1.FieldType.NUMERIC,
52
- required: false,
53
- },
54
- minute: {
55
- id: 'minute',
56
- label: 'Minute',
57
- description: 'For instance, if you want to trigger the completion request at 1:05 PM, use "5".',
58
- type: extensions_core_1.FieldType.NUMERIC,
59
- required: false,
60
- },
61
- weekday: {
62
- id: 'weekday',
63
- label: 'Weekday',
64
- description: 'Use the full weekday name, e.g. "Monday".',
65
- type: extensions_core_1.FieldType.STRING,
66
- required: false,
67
- },
68
- monthday: {
69
- id: 'monthday',
70
- label: 'Monthday',
71
- description: 'Number of the day of month, e.g. "27th".',
72
- type: extensions_core_1.FieldType.STRING,
73
- required: false,
74
- },
75
- ends_on: {
76
- id: 'ends_on',
77
- label: 'Ends on',
78
- description: 'Recurrence end date in the YYYY-MM-DD format.',
79
- type: extensions_core_1.FieldType.DATE,
80
- required: false,
81
- },
82
- };
10
+ const config_1 = require("./config");
83
11
  exports.sendFormCompletionRequest = {
84
12
  key: 'sendFormCompletionRequest',
85
- category: extensions_core_2.Category.EHR_INTEGRATIONS,
13
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
86
14
  title: 'Send form completion request',
87
15
  description: 'Send a form completion request to a patient in Healthie.',
88
- fields,
16
+ fields: config_1.fields,
89
17
  previewable: true,
90
18
  onActivityCreated: async (payload, onComplete, onError) => {
91
19
  const { fields, settings } = payload;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendFormCompletionRequest.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.ts"],"names":[],"mappings":";;;AAAA,yCAAwE;AAExE,mEAAwD;AACxD,uCAAsC;AACtC,uDAAsD;AAEtD,kGAA6E;AAC7E,mCAA8B;AAC9B,qCAAiC;AAEpB,QAAA,yBAAyB,GACpC;IACE,GAAG,EAAE,2BAA2B;IAChC,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QACpC,IAAI;YACF,MAAM,EACJ,mBAAmB,EACnB,OAAO,EACP,YAAY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AAA;gBAC1B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;4BAC9C,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tests_1 = require("../../../../src/tests");
4
+ const sdk_1 = require("../../gql/sdk");
5
+ const sdk_2 = require("../../gql/__mocks__/sdk");
6
+ const sendFormCompletionRequest_1 = require("../sendFormCompletionRequest");
7
+ jest.mock('../../gql/sdk');
8
+ jest.mock('../../graphqlClient');
9
+ const sampleFormCompletion = {
10
+ form: 'form-template-1',
11
+ recipient_ids: 'patient-1',
12
+ is_recurring: undefined,
13
+ frequency: undefined,
14
+ monthday: undefined,
15
+ weekday: undefined,
16
+ hour: undefined,
17
+ minute: undefined,
18
+ period: undefined,
19
+ recurrence_ends: false,
20
+ ends_on: undefined,
21
+ };
22
+ const samplePayload = (0, tests_1.generateTestPayload)({
23
+ fields: {
24
+ form_id: 'form-template-1',
25
+ healthie_patient_id: 'patient-1',
26
+ is_recurring: undefined,
27
+ frequency: undefined,
28
+ monthday: undefined,
29
+ weekday: undefined,
30
+ hour: undefined,
31
+ minute: undefined,
32
+ period: undefined,
33
+ ends_on: undefined,
34
+ },
35
+ settings: {
36
+ apiKey: 'apiKey',
37
+ apiUrl: 'test-url',
38
+ },
39
+ });
40
+ describe('sendFormCompletionRequest action', () => {
41
+ const onComplete = jest.fn();
42
+ const onError = jest.fn();
43
+ beforeAll(() => {
44
+ ;
45
+ sdk_1.getSdk.mockImplementation(sdk_2.mockGetSdk);
46
+ });
47
+ beforeEach(() => {
48
+ jest.clearAllMocks();
49
+ });
50
+ test('Should send form completion request', async () => {
51
+ await sendFormCompletionRequest_1.sendFormCompletionRequest.onActivityCreated(samplePayload, onComplete, onError);
52
+ expect(sdk_2.mockGetSdkReturn.createFormCompletionRequest).toHaveBeenCalled();
53
+ expect(onComplete).toHaveBeenCalled();
54
+ });
55
+ test.each([
56
+ { endsOnInput: '1990-01-01', endsOnExpected: '1990-01-01' },
57
+ { endsOnInput: '2011-10-05T14:48:00.000Z', endsOnExpected: '2011-10-05' },
58
+ { endsOnInput: '06 August 2015 14:48 UTC', endsOnExpected: '2015-08-06' },
59
+ ])('$#. Should set "recurrence_ends" to "true" and "ends_on" to $endsOnExpected when provided with $endsOnInput"', async ({ endsOnInput, endsOnExpected }) => {
60
+ await sendFormCompletionRequest_1.sendFormCompletionRequest.onActivityCreated({
61
+ ...samplePayload,
62
+ fields: {
63
+ ...samplePayload.fields,
64
+ is_recurring: true,
65
+ frequency: 'Daily',
66
+ hour: 1,
67
+ minute: 1,
68
+ period: 'PM',
69
+ ends_on: endsOnInput,
70
+ },
71
+ }, onComplete, onError);
72
+ expect(sdk_2.mockGetSdkReturn.createFormCompletionRequest).toHaveBeenCalledWith({
73
+ input: {
74
+ ...sampleFormCompletion,
75
+ is_recurring: true,
76
+ frequency: 'Daily',
77
+ hour: '1',
78
+ minute: '1',
79
+ period: 'PM',
80
+ recurrence_ends: true,
81
+ ends_on: endsOnExpected,
82
+ },
83
+ });
84
+ expect(onComplete).toHaveBeenCalled();
85
+ });
86
+ describe('Frequency validation', () => {
87
+ describe('No recurring', () => {
88
+ test.each([false, undefined])('Should call onComplete when is_recurring is %p and rest is undefined', async (value) => {
89
+ await sendFormCompletionRequest_1.sendFormCompletionRequest.onActivityCreated({
90
+ ...samplePayload,
91
+ fields: {
92
+ ...samplePayload.fields,
93
+ is_recurring: value,
94
+ },
95
+ }, onComplete, onError);
96
+ expect(onComplete).toHaveBeenCalled();
97
+ expect(sdk_2.mockGetSdkReturn.createFormCompletionRequest).toHaveBeenCalledWith({
98
+ input: {
99
+ ...sampleFormCompletion,
100
+ is_recurring: false,
101
+ },
102
+ });
103
+ });
104
+ });
105
+ describe('Frequency = daily', () => {
106
+ test.each([
107
+ {
108
+ hour: 1,
109
+ minute: 1,
110
+ period: 'am',
111
+ },
112
+ {
113
+ hour: '1',
114
+ minute: '1',
115
+ period: 'PM',
116
+ },
117
+ ])('Should call onComplete when %p', async (value) => {
118
+ await sendFormCompletionRequest_1.sendFormCompletionRequest.onActivityCreated({
119
+ ...samplePayload,
120
+ fields: {
121
+ ...samplePayload.fields,
122
+ is_recurring: true,
123
+ frequency: 'daily',
124
+ ...value,
125
+ },
126
+ }, onComplete, onError);
127
+ expect(onComplete).toHaveBeenCalled();
128
+ expect(sdk_2.mockGetSdkReturn.createFormCompletionRequest).toHaveBeenCalledWith({
129
+ input: {
130
+ ...sampleFormCompletion,
131
+ is_recurring: true,
132
+ frequency: 'Daily',
133
+ hour: String(value.hour),
134
+ minute: String(value.minute),
135
+ period: value.period.toUpperCase(),
136
+ },
137
+ });
138
+ });
139
+ });
140
+ describe('Frequency = weekly', () => {
141
+ test.each([
142
+ {
143
+ weekday: 'Monday',
144
+ weekdayActual: 'Monday',
145
+ },
146
+ {
147
+ weekday: 'tuesday',
148
+ weekdayActual: 'Tuesday',
149
+ },
150
+ {
151
+ weekday: 'wednesdaY',
152
+ weekdayActual: 'Wednesday',
153
+ },
154
+ ])('Should call onComplete when %p', async (value) => {
155
+ await sendFormCompletionRequest_1.sendFormCompletionRequest.onActivityCreated({
156
+ ...samplePayload,
157
+ fields: {
158
+ ...samplePayload.fields,
159
+ is_recurring: true,
160
+ frequency: 'weekly',
161
+ weekday: value.weekday,
162
+ },
163
+ }, onComplete, onError);
164
+ expect(sdk_2.mockGetSdkReturn.createFormCompletionRequest).toHaveBeenCalledWith({
165
+ input: {
166
+ ...sampleFormCompletion,
167
+ is_recurring: true,
168
+ frequency: 'Weekly',
169
+ weekday: value.weekdayActual,
170
+ },
171
+ });
172
+ expect(onComplete).toHaveBeenCalled();
173
+ });
174
+ });
175
+ describe('Frequency = monthly', () => {
176
+ test('Should call onComplete when "monthday" is not empty', async () => {
177
+ await sendFormCompletionRequest_1.sendFormCompletionRequest.onActivityCreated({
178
+ ...samplePayload,
179
+ fields: {
180
+ ...samplePayload.fields,
181
+ is_recurring: true,
182
+ frequency: 'monthly',
183
+ monthday: '27th',
184
+ },
185
+ }, onComplete, onError);
186
+ expect(onComplete).toHaveBeenCalled();
187
+ expect(sdk_2.mockGetSdkReturn.createFormCompletionRequest).toHaveBeenCalledWith({
188
+ input: {
189
+ ...sampleFormCompletion,
190
+ is_recurring: true,
191
+ frequency: 'Monthly',
192
+ monthday: '27th',
193
+ },
194
+ });
195
+ });
196
+ });
197
+ });
198
+ });
199
+ //# sourceMappingURL=sendFormCompletionRequest.test.js.map