vintasend 0.4.0 → 0.4.7

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 (284) hide show
  1. package/README.md +5 -0
  2. package/dist/examples/vintasend-medplum-example/.env.example +11 -0
  3. package/dist/examples/vintasend-medplum-example/IMPLEMENTATION_PLAN_FILE_ATTACHMENTS.md +597 -0
  4. package/dist/examples/vintasend-medplum-example/README.md +190 -0
  5. package/dist/examples/vintasend-medplum-example/TUTORIAL_EMAIL_NOTIFICATIONS.md +2596 -0
  6. package/dist/examples/vintasend-medplum-example/bots/handlers/send-pending-notifications-bot.ts +39 -0
  7. package/dist/examples/vintasend-medplum-example/bots/handlers/send-task-assignment-email.ts +41 -0
  8. package/dist/examples/vintasend-medplum-example/bots/handlers/task-due-soon-notification-bot.ts +86 -0
  9. package/dist/examples/vintasend-medplum-example/bots/index.ts +53 -0
  10. package/dist/examples/vintasend-medplum-example/bots/services/emails/schedule-task-due-soon-email.ts +84 -0
  11. package/dist/examples/vintasend-medplum-example/bots/services/emails/send-task-assignment-email.test.ts +388 -0
  12. package/dist/examples/vintasend-medplum-example/bots/services/emails/send-task-assignment-email.ts +113 -0
  13. package/dist/examples/vintasend-medplum-example/bots/shared/task-due-soon-helpers.ts +115 -0
  14. package/dist/examples/vintasend-medplum-example/bots/task-assignment-bot.ts +41 -0
  15. package/dist/examples/vintasend-medplum-example/compiled-notification-templates.json +6 -0
  16. package/dist/examples/vintasend-medplum-example/esbuild-script.mjs +71 -0
  17. package/dist/examples/vintasend-medplum-example/index.html +14 -0
  18. package/dist/examples/vintasend-medplum-example/lib/constants.ts +32 -0
  19. package/dist/examples/vintasend-medplum-example/lib/extensions.ts +1 -0
  20. package/dist/examples/vintasend-medplum-example/lib/file-upload.test.ts +389 -0
  21. package/dist/examples/vintasend-medplum-example/lib/file-upload.ts +222 -0
  22. package/dist/examples/vintasend-medplum-example/lib/medplum-singleton.ts +18 -0
  23. package/dist/examples/vintasend-medplum-example/lib/notification-service.test.ts +293 -0
  24. package/dist/examples/vintasend-medplum-example/lib/notification-service.ts +284 -0
  25. package/dist/examples/vintasend-medplum-example/lib/patients.ts +20 -0
  26. package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-assignment/body.html.pug +37 -0
  27. package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-assignment/subject.txt.pug +4 -0
  28. package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-due-soon/body.html.pug +34 -0
  29. package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-due-soon/subject.txt.pug +4 -0
  30. package/dist/examples/vintasend-medplum-example/package.json +75 -0
  31. package/dist/examples/vintasend-medplum-example/plugins/gql-plugin.mjs +31 -0
  32. package/dist/examples/vintasend-medplum-example/postcss.config.mjs +21 -0
  33. package/dist/examples/vintasend-medplum-example/public/favicon.ico +0 -0
  34. package/dist/examples/vintasend-medplum-example/public/img/integrations/acuity.png +0 -0
  35. package/dist/examples/vintasend-medplum-example/public/img/integrations/auth0.png +0 -0
  36. package/dist/examples/vintasend-medplum-example/public/img/integrations/azure.png +0 -0
  37. package/dist/examples/vintasend-medplum-example/public/img/integrations/calcom.png +0 -0
  38. package/dist/examples/vintasend-medplum-example/public/img/integrations/candid.png +0 -0
  39. package/dist/examples/vintasend-medplum-example/public/img/integrations/claude.png +0 -0
  40. package/dist/examples/vintasend-medplum-example/public/img/integrations/datadog.png +0 -0
  41. package/dist/examples/vintasend-medplum-example/public/img/integrations/deepseek.png +0 -0
  42. package/dist/examples/vintasend-medplum-example/public/img/integrations/entra.png +0 -0
  43. package/dist/examples/vintasend-medplum-example/public/img/integrations/epic.png +0 -0
  44. package/dist/examples/vintasend-medplum-example/public/img/integrations/google.png +0 -0
  45. package/dist/examples/vintasend-medplum-example/public/img/integrations/healthgorilla.png +0 -0
  46. package/dist/examples/vintasend-medplum-example/public/img/integrations/healthie.png +0 -0
  47. package/dist/examples/vintasend-medplum-example/public/img/integrations/labcorp.png +0 -0
  48. package/dist/examples/vintasend-medplum-example/public/img/integrations/okta.png +0 -0
  49. package/dist/examples/vintasend-medplum-example/public/img/integrations/openai.png +0 -0
  50. package/dist/examples/vintasend-medplum-example/public/img/integrations/particle.png +0 -0
  51. package/dist/examples/vintasend-medplum-example/public/img/integrations/quest.png +0 -0
  52. package/dist/examples/vintasend-medplum-example/public/img/integrations/recaptcha.png +0 -0
  53. package/dist/examples/vintasend-medplum-example/public/img/integrations/snowflake.png +0 -0
  54. package/dist/examples/vintasend-medplum-example/public/img/integrations/stedi.png +0 -0
  55. package/dist/examples/vintasend-medplum-example/public/img/integrations/stripe.png +0 -0
  56. package/dist/examples/vintasend-medplum-example/public/img/integrations/sumo.png +0 -0
  57. package/dist/examples/vintasend-medplum-example/scripts/README.md +162 -0
  58. package/dist/examples/vintasend-medplum-example/scripts/client.ts +18 -0
  59. package/dist/examples/vintasend-medplum-example/scripts/deploy-bots.ts +171 -0
  60. package/dist/examples/vintasend-medplum-example/src/App.tsx +185 -0
  61. package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemList.test.tsx +350 -0
  62. package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemList.tsx +241 -0
  63. package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemPanel.test.tsx +616 -0
  64. package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemPanel.tsx +138 -0
  65. package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionItem.test.tsx +92 -0
  66. package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionItem.tsx +47 -0
  67. package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionList.test.tsx +464 -0
  68. package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionList.tsx +186 -0
  69. package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionModal.test.tsx +80 -0
  70. package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionModal.tsx +82 -0
  71. package/dist/examples/vintasend-medplum-example/src/components/DoseSpotIcon.test.tsx +100 -0
  72. package/dist/examples/vintasend-medplum-example/src/components/DoseSpotIcon.tsx +20 -0
  73. package/dist/examples/vintasend-medplum-example/src/components/IntegrationCard.module.css +3 -0
  74. package/dist/examples/vintasend-medplum-example/src/components/IntegrationCard.tsx +62 -0
  75. package/dist/examples/vintasend-medplum-example/src/components/MessageWithLinks.tsx +47 -0
  76. package/dist/examples/vintasend-medplum-example/src/components/PerformingLabInput.test.tsx +299 -0
  77. package/dist/examples/vintasend-medplum-example/src/components/PerformingLabInput.tsx +52 -0
  78. package/dist/examples/vintasend-medplum-example/src/components/ResourceFormWithRequiredProfile.tsx +82 -0
  79. package/dist/examples/vintasend-medplum-example/src/components/encounter/BillingTab.test.tsx +1016 -0
  80. package/dist/examples/vintasend-medplum-example/src/components/encounter/BillingTab.tsx +298 -0
  81. package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterChart.test.tsx +732 -0
  82. package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterChart.tsx +282 -0
  83. package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterHeader.test.tsx +268 -0
  84. package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterHeader.tsx +224 -0
  85. package/dist/examples/vintasend-medplum-example/src/components/encounter/SignAddendum.test.tsx +255 -0
  86. package/dist/examples/vintasend-medplum-example/src/components/encounter/SignAddendum.tsx +212 -0
  87. package/dist/examples/vintasend-medplum-example/src/components/encounter/SignLockDialog.test.tsx +120 -0
  88. package/dist/examples/vintasend-medplum-example/src/components/encounter/SignLockDialog.tsx +57 -0
  89. package/dist/examples/vintasend-medplum-example/src/components/encounter/VisitDetailsPanel.test.tsx +224 -0
  90. package/dist/examples/vintasend-medplum-example/src/components/encounter/VisitDetailsPanel.tsx +100 -0
  91. package/dist/examples/vintasend-medplum-example/src/components/labs/CoverageInput.test.tsx +431 -0
  92. package/dist/examples/vintasend-medplum-example/src/components/labs/CoverageInput.tsx +130 -0
  93. package/dist/examples/vintasend-medplum-example/src/components/labs/LabListItem.module.css +31 -0
  94. package/dist/examples/vintasend-medplum-example/src/components/labs/LabListItem.test.tsx +234 -0
  95. package/dist/examples/vintasend-medplum-example/src/components/labs/LabListItem.tsx +143 -0
  96. package/dist/examples/vintasend-medplum-example/src/components/labs/LabOrderDetails.module.css +11 -0
  97. package/dist/examples/vintasend-medplum-example/src/components/labs/LabOrderDetails.test.tsx +875 -0
  98. package/dist/examples/vintasend-medplum-example/src/components/labs/LabOrderDetails.tsx +943 -0
  99. package/dist/examples/vintasend-medplum-example/src/components/labs/LabResultDetails.test.tsx +413 -0
  100. package/dist/examples/vintasend-medplum-example/src/components/labs/LabResultDetails.tsx +203 -0
  101. package/dist/examples/vintasend-medplum-example/src/components/labs/LabSelectEmpty.tsx +22 -0
  102. package/dist/examples/vintasend-medplum-example/src/components/labs/README.md +104 -0
  103. package/dist/examples/vintasend-medplum-example/src/components/labs/TestMetadataCardInput.test.tsx +318 -0
  104. package/dist/examples/vintasend-medplum-example/src/components/labs/TestMetadataCardInput.tsx +87 -0
  105. package/dist/examples/vintasend-medplum-example/src/components/messages/ChatList.test.tsx +126 -0
  106. package/dist/examples/vintasend-medplum-example/src/components/messages/ChatList.tsx +38 -0
  107. package/dist/examples/vintasend-medplum-example/src/components/messages/ChatListItem.module.css +23 -0
  108. package/dist/examples/vintasend-medplum-example/src/components/messages/ChatListItem.test.tsx +167 -0
  109. package/dist/examples/vintasend-medplum-example/src/components/messages/ChatListItem.tsx +53 -0
  110. package/dist/examples/vintasend-medplum-example/src/components/messages/NewTopicDialog.test.tsx +94 -0
  111. package/dist/examples/vintasend-medplum-example/src/components/messages/NewTopicDialog.tsx +165 -0
  112. package/dist/examples/vintasend-medplum-example/src/components/messages/ParticipantFilter.module.css +8 -0
  113. package/dist/examples/vintasend-medplum-example/src/components/messages/ParticipantFilter.test.tsx +523 -0
  114. package/dist/examples/vintasend-medplum-example/src/components/messages/ParticipantFilter.tsx +230 -0
  115. package/dist/examples/vintasend-medplum-example/src/components/messages/ThreadInbox.module.css +23 -0
  116. package/dist/examples/vintasend-medplum-example/src/components/messages/ThreadInbox.test.tsx +567 -0
  117. package/dist/examples/vintasend-medplum-example/src/components/messages/ThreadInbox.tsx +358 -0
  118. package/dist/examples/vintasend-medplum-example/src/components/plandefinition/AddPlanDefinition.module.css +40 -0
  119. package/dist/examples/vintasend-medplum-example/src/components/plandefinition/AddPlanDefinition.tsx +257 -0
  120. package/dist/examples/vintasend-medplum-example/src/components/schedule/CreateVisit.module.css +7 -0
  121. package/dist/examples/vintasend-medplum-example/src/components/schedule/CreateVisit.test.tsx +279 -0
  122. package/dist/examples/vintasend-medplum-example/src/components/schedule/CreateVisit.tsx +156 -0
  123. package/dist/examples/vintasend-medplum-example/src/components/spaces/HistoryList.module.css +45 -0
  124. package/dist/examples/vintasend-medplum-example/src/components/spaces/HistoryList.test.tsx +90 -0
  125. package/dist/examples/vintasend-medplum-example/src/components/spaces/HistoryList.tsx +84 -0
  126. package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourceBox.module.css +26 -0
  127. package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourceBox.tsx +90 -0
  128. package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourcePanel.test.tsx +305 -0
  129. package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourcePanel.tsx +46 -0
  130. package/dist/examples/vintasend-medplum-example/src/components/spaces/SpacesInbox.module.css +262 -0
  131. package/dist/examples/vintasend-medplum-example/src/components/spaces/SpacesInbox.test.tsx +622 -0
  132. package/dist/examples/vintasend-medplum-example/src/components/spaces/SpacesInbox.tsx +286 -0
  133. package/dist/examples/vintasend-medplum-example/src/components/tasks/NewTaskModal.tsx +275 -0
  134. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskAttachmentList.tsx +132 -0
  135. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskBoard.module.css +45 -0
  136. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskBoard.test.tsx +749 -0
  137. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskBoard.tsx +416 -0
  138. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailPanel.test.tsx +278 -0
  139. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailPanel.tsx +133 -0
  140. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailsModal.module.css +16 -0
  141. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailsModal.test.tsx +255 -0
  142. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailsModal.tsx +203 -0
  143. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFileUpload.tsx +129 -0
  144. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFilterMenu.test.tsx +156 -0
  145. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFilterMenu.tsx +142 -0
  146. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFilterMenu.utils.ts +28 -0
  147. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskInputNote.test.tsx +134 -0
  148. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskInputNote.tsx +250 -0
  149. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskListItem.module.css +23 -0
  150. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskListItem.test.tsx +149 -0
  151. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskListItem.tsx +53 -0
  152. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskNoteItem.test.tsx +68 -0
  153. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskNoteItem.tsx +46 -0
  154. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskProperties.test.tsx +555 -0
  155. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskProperties.tsx +170 -0
  156. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskSelectEmpty.test.tsx +32 -0
  157. package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskSelectEmpty.tsx +34 -0
  158. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/SimpleTask.test.tsx +47 -0
  159. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/SimpleTask.tsx +29 -0
  160. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskPanel.test.tsx +285 -0
  161. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskPanel.tsx +129 -0
  162. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskQuestionnaireForm.test.tsx +455 -0
  163. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskQuestionnaireForm.tsx +167 -0
  164. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskServiceRequest.test.tsx +435 -0
  165. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskServiceRequest.tsx +116 -0
  166. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskStatusPanel.module.css +38 -0
  167. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskStatusPanel.test.tsx +200 -0
  168. package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskStatusPanel.tsx +84 -0
  169. package/dist/examples/vintasend-medplum-example/src/components/utils.test.ts +176 -0
  170. package/dist/examples/vintasend-medplum-example/src/components/utils.ts +17 -0
  171. package/dist/examples/vintasend-medplum-example/src/config/constants.ts +3 -0
  172. package/dist/examples/vintasend-medplum-example/src/hooks/useDebouncedUpdateResource.test.tsx +166 -0
  173. package/dist/examples/vintasend-medplum-example/src/hooks/useDebouncedUpdateResource.ts +28 -0
  174. package/dist/examples/vintasend-medplum-example/src/hooks/useEncounter.test.tsx +94 -0
  175. package/dist/examples/vintasend-medplum-example/src/hooks/useEncounter.ts +11 -0
  176. package/dist/examples/vintasend-medplum-example/src/hooks/useEncounterChart.test.tsx +477 -0
  177. package/dist/examples/vintasend-medplum-example/src/hooks/useEncounterChart.ts +191 -0
  178. package/dist/examples/vintasend-medplum-example/src/hooks/usePatient.test.tsx +100 -0
  179. package/dist/examples/vintasend-medplum-example/src/hooks/usePatient.ts +18 -0
  180. package/dist/examples/vintasend-medplum-example/src/hooks/useThreadInbox.test.tsx +379 -0
  181. package/dist/examples/vintasend-medplum-example/src/hooks/useThreadInbox.ts +194 -0
  182. package/dist/examples/vintasend-medplum-example/src/index.css +8 -0
  183. package/dist/examples/vintasend-medplum-example/src/main.tsx +57 -0
  184. package/dist/examples/vintasend-medplum-example/src/pages/SearchPage.module.css +6 -0
  185. package/dist/examples/vintasend-medplum-example/src/pages/SearchPage.test.tsx +295 -0
  186. package/dist/examples/vintasend-medplum-example/src/pages/SearchPage.tsx +124 -0
  187. package/dist/examples/vintasend-medplum-example/src/pages/SignInPage.test.tsx +77 -0
  188. package/dist/examples/vintasend-medplum-example/src/pages/SignInPage.tsx +22 -0
  189. package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterChartPage.test.tsx +87 -0
  190. package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterChartPage.tsx +27 -0
  191. package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterModal.module.css +16 -0
  192. package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterModal.test.tsx +287 -0
  193. package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterModal.tsx +151 -0
  194. package/dist/examples/vintasend-medplum-example/src/pages/integrations/DoseSpotFavoritesPage.test.tsx +519 -0
  195. package/dist/examples/vintasend-medplum-example/src/pages/integrations/DoseSpotFavoritesPage.tsx +179 -0
  196. package/dist/examples/vintasend-medplum-example/src/pages/integrations/FavoriteMedicationsTable.tsx +76 -0
  197. package/dist/examples/vintasend-medplum-example/src/pages/integrations/IntegrationsPage.test.tsx +234 -0
  198. package/dist/examples/vintasend-medplum-example/src/pages/integrations/IntegrationsPage.tsx +222 -0
  199. package/dist/examples/vintasend-medplum-example/src/pages/labs/OrderLabsPage.test.tsx +356 -0
  200. package/dist/examples/vintasend-medplum-example/src/pages/labs/OrderLabsPage.tsx +275 -0
  201. package/dist/examples/vintasend-medplum-example/src/pages/messages/MessagesPage.module.css +8 -0
  202. package/dist/examples/vintasend-medplum-example/src/pages/messages/MessagesPage.test.tsx +103 -0
  203. package/dist/examples/vintasend-medplum-example/src/pages/messages/MessagesPage.tsx +78 -0
  204. package/dist/examples/vintasend-medplum-example/src/pages/patient/CommunicationTab.test.tsx +84 -0
  205. package/dist/examples/vintasend-medplum-example/src/pages/patient/CommunicationTab.tsx +82 -0
  206. package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotAdvancedOptions.test.tsx +364 -0
  207. package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotAdvancedOptions.tsx +149 -0
  208. package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotTab.test.tsx +159 -0
  209. package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotTab.tsx +37 -0
  210. package/dist/examples/vintasend-medplum-example/src/pages/patient/EditTab.test.tsx +140 -0
  211. package/dist/examples/vintasend-medplum-example/src/pages/patient/EditTab.tsx +72 -0
  212. package/dist/examples/vintasend-medplum-example/src/pages/patient/ExportTab.test.tsx +57 -0
  213. package/dist/examples/vintasend-medplum-example/src/pages/patient/ExportTab.tsx +14 -0
  214. package/dist/examples/vintasend-medplum-example/src/pages/patient/IntakeFormPage.test.tsx +241 -0
  215. package/dist/examples/vintasend-medplum-example/src/pages/patient/IntakeFormPage.tsx +710 -0
  216. package/dist/examples/vintasend-medplum-example/src/pages/patient/LabsPage.module.css +37 -0
  217. package/dist/examples/vintasend-medplum-example/src/pages/patient/LabsPage.test.tsx +428 -0
  218. package/dist/examples/vintasend-medplum-example/src/pages/patient/LabsPage.tsx +334 -0
  219. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.module.css +24 -0
  220. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.test.tsx +154 -0
  221. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.tsx +115 -0
  222. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.utils.test.ts +223 -0
  223. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.utils.ts +89 -0
  224. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientSearchPage.test.tsx +147 -0
  225. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientSearchPage.tsx +79 -0
  226. package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientTabsNavigation.tsx +35 -0
  227. package/dist/examples/vintasend-medplum-example/src/pages/patient/TasksTab.test.tsx +185 -0
  228. package/dist/examples/vintasend-medplum-example/src/pages/patient/TasksTab.tsx +115 -0
  229. package/dist/examples/vintasend-medplum-example/src/pages/patient/TimelineTab.tsx +14 -0
  230. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceCreatePage.test.tsx +170 -0
  231. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceCreatePage.tsx +117 -0
  232. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceDetailPage.tsx +28 -0
  233. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceEditPage.test.tsx +131 -0
  234. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceEditPage.tsx +65 -0
  235. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceHistoryPage.test.tsx +108 -0
  236. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceHistoryPage.tsx +16 -0
  237. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourcePage.module.css +7 -0
  238. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourcePage.test.tsx +37 -0
  239. package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourcePage.tsx +44 -0
  240. package/dist/examples/vintasend-medplum-example/src/pages/resource/useResourceType.ts +44 -0
  241. package/dist/examples/vintasend-medplum-example/src/pages/resource/utils.ts +9 -0
  242. package/dist/examples/vintasend-medplum-example/src/pages/schedule/SchedulePage.test.tsx +302 -0
  243. package/dist/examples/vintasend-medplum-example/src/pages/schedule/SchedulePage.tsx +416 -0
  244. package/dist/examples/vintasend-medplum-example/src/pages/spaces/ChatInput.tsx +91 -0
  245. package/dist/examples/vintasend-medplum-example/src/pages/spaces/SpacesPage.module.css +6 -0
  246. package/dist/examples/vintasend-medplum-example/src/pages/spaces/SpacesPage.test.tsx +102 -0
  247. package/dist/examples/vintasend-medplum-example/src/pages/spaces/SpacesPage.tsx +44 -0
  248. package/dist/examples/vintasend-medplum-example/src/pages/tasks/TasksPage.module.css +7 -0
  249. package/dist/examples/vintasend-medplum-example/src/pages/tasks/TasksPage.test.tsx +133 -0
  250. package/dist/examples/vintasend-medplum-example/src/pages/tasks/TasksPage.tsx +91 -0
  251. package/dist/examples/vintasend-medplum-example/src/test-utils/render.tsx +20 -0
  252. package/dist/examples/vintasend-medplum-example/src/test.setup.ts +49 -0
  253. package/dist/examples/vintasend-medplum-example/src/types/encounter.ts +8 -0
  254. package/dist/examples/vintasend-medplum-example/src/types/spaces.ts +10 -0
  255. package/dist/examples/vintasend-medplum-example/src/utils/chargeitems.test.ts +141 -0
  256. package/dist/examples/vintasend-medplum-example/src/utils/chargeitems.ts +59 -0
  257. package/dist/examples/vintasend-medplum-example/src/utils/claims.test.ts +153 -0
  258. package/dist/examples/vintasend-medplum-example/src/utils/claims.ts +65 -0
  259. package/dist/examples/vintasend-medplum-example/src/utils/communication-search.ts +47 -0
  260. package/dist/examples/vintasend-medplum-example/src/utils/coverage.test.ts +48 -0
  261. package/dist/examples/vintasend-medplum-example/src/utils/coverage.ts +33 -0
  262. package/dist/examples/vintasend-medplum-example/src/utils/documentReference.test.ts +102 -0
  263. package/dist/examples/vintasend-medplum-example/src/utils/documentReference.ts +55 -0
  264. package/dist/examples/vintasend-medplum-example/src/utils/encounter.test.ts +169 -0
  265. package/dist/examples/vintasend-medplum-example/src/utils/encounter.ts +261 -0
  266. package/dist/examples/vintasend-medplum-example/src/utils/intake-form.test.ts +154 -0
  267. package/dist/examples/vintasend-medplum-example/src/utils/intake-form.ts +272 -0
  268. package/dist/examples/vintasend-medplum-example/src/utils/intake-utils.test.ts +1137 -0
  269. package/dist/examples/vintasend-medplum-example/src/utils/intake-utils.ts +827 -0
  270. package/dist/examples/vintasend-medplum-example/src/utils/notifications.test.ts +27 -0
  271. package/dist/examples/vintasend-medplum-example/src/utils/notifications.ts +15 -0
  272. package/dist/examples/vintasend-medplum-example/src/utils/spaceMessaging.ts +249 -0
  273. package/dist/examples/vintasend-medplum-example/src/utils/spacePersistence.test.ts +450 -0
  274. package/dist/examples/vintasend-medplum-example/src/utils/spacePersistence.ts +147 -0
  275. package/dist/examples/vintasend-medplum-example/src/utils/task-search.ts +63 -0
  276. package/dist/examples/vintasend-medplum-example/src/vite-env.d.ts +3 -0
  277. package/dist/examples/vintasend-medplum-example/tsconfig.bots.json +4 -0
  278. package/dist/examples/vintasend-medplum-example/tsconfig.json +19 -0
  279. package/dist/examples/vintasend-medplum-example/vercel.json +3 -0
  280. package/dist/examples/vintasend-medplum-example/vite.config.ts +44 -0
  281. package/dist/services/notification-backends/base-notification-backend.d.ts +5 -0
  282. package/dist/services/notification-service.js +11 -1
  283. package/dist/services/notification-template-renderers/base-email-template-renderer.d.ts +5 -0
  284. package/package.json +1 -1
@@ -0,0 +1,710 @@
1
+ // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { Alert } from '@mantine/core';
4
+ import { showNotification } from '@mantine/notifications';
5
+ import { normalizeErrorString } from '@medplum/core';
6
+ import type { Questionnaire, QuestionnaireItem, QuestionnaireResponse } from '@medplum/fhirtypes';
7
+ import { Document, Loading, QuestionnaireForm, useMedplum, useMedplumProfile } from '@medplum/react';
8
+ import { useCallback, useEffect, useState } from 'react';
9
+ import type { JSX } from 'react';
10
+ import { useNavigate } from 'react-router';
11
+ import { onboardPatient } from '../../utils/intake-form';
12
+ import { showErrorNotification } from '../../utils/notifications';
13
+
14
+ export interface IntakeFormPageProps {
15
+ skipValueSetCheck?: boolean;
16
+ questionnaire?: Questionnaire;
17
+ }
18
+
19
+ export function IntakeFormPage({
20
+ skipValueSetCheck = false,
21
+ questionnaire: propQuestionnaire,
22
+ }: IntakeFormPageProps = {}): JSX.Element {
23
+ const navigate = useNavigate();
24
+ const medplum = useMedplum();
25
+ const profile = useMedplumProfile();
26
+ const [unavailableValueSets, setUnavailableValueSets] = useState<ValueSetInfo[]>([]);
27
+ const [checkingValueSets, setCheckingValueSets] = useState(false);
28
+ const questionnaire = propQuestionnaire ?? defaultQuestionnaire;
29
+
30
+ useEffect(() => {
31
+ const abortController = new AbortController();
32
+ let isActive = true;
33
+
34
+ async function checkValueSets(): Promise<void> {
35
+ if (!isActive || skipValueSetCheck) {
36
+ return;
37
+ }
38
+ setCheckingValueSets(true);
39
+
40
+ if (!questionnaire) {
41
+ if (isActive) {
42
+ setCheckingValueSets(false);
43
+ }
44
+ return;
45
+ }
46
+
47
+ const allValueSets = extractValueSets(questionnaire.item);
48
+ const uniqueValueSets = new Map<string, ValueSetInfo>();
49
+ for (const vs of allValueSets) {
50
+ if (!uniqueValueSets.has(vs.url)) {
51
+ uniqueValueSets.set(vs.url, vs);
52
+ }
53
+ }
54
+ const valueSets = Array.from(uniqueValueSets.values());
55
+
56
+ const unavailable: ValueSetInfo[] = [];
57
+
58
+ await Promise.allSettled(
59
+ valueSets.map(async (vs) => {
60
+ if (abortController.signal.aborted) {
61
+ return;
62
+ }
63
+ const isAvailable = await checkValueSetAvailability(vs.url, medplum);
64
+ if (!isAvailable && !abortController.signal.aborted) {
65
+ unavailable.push(vs);
66
+ }
67
+ })
68
+ );
69
+
70
+ if (isActive && !abortController.signal.aborted) {
71
+ setUnavailableValueSets(unavailable);
72
+ }
73
+ }
74
+
75
+ checkValueSets()
76
+ .catch((error) => {
77
+ if (isActive && !abortController.signal.aborted) {
78
+ showErrorNotification(error);
79
+ }
80
+ })
81
+ .finally(() => {
82
+ if (isActive) {
83
+ setCheckingValueSets(false);
84
+ }
85
+ });
86
+
87
+ return () => {
88
+ isActive = false;
89
+ abortController.abort();
90
+ };
91
+ }, [medplum, skipValueSetCheck, questionnaire]);
92
+
93
+ const handleOnSubmit = useCallback(
94
+ async (response: QuestionnaireResponse) => {
95
+ if (!questionnaire || !profile) {
96
+ return;
97
+ }
98
+ try {
99
+ const patient = await onboardPatient(medplum, questionnaire, response);
100
+ navigate(`/Patient/${patient.id}/timeline`)?.catch(console.error);
101
+ } catch (error) {
102
+ showNotification({
103
+ color: 'red',
104
+ message: normalizeErrorString(error),
105
+ autoClose: false,
106
+ });
107
+ }
108
+ },
109
+ [medplum, navigate, profile, questionnaire]
110
+ );
111
+
112
+ return (
113
+ <Document width={800}>
114
+ {checkingValueSets && <Loading />}
115
+ {!checkingValueSets && unavailableValueSets.length > 0 && (
116
+ <Alert color="red" title="Some valuesets are unavailable" mb="md">
117
+ <p>
118
+ The following questions may not display correctly because their valuesets are not available. Please contact
119
+ sales to enable these valuesets.
120
+ </p>
121
+ <ul>
122
+ {unavailableValueSets.map((vs) => (
123
+ <li key={vs.linkId}>{vs.url}</li>
124
+ ))}
125
+ </ul>
126
+ </Alert>
127
+ )}
128
+ <QuestionnaireForm questionnaire={questionnaire} onSubmit={handleOnSubmit} />
129
+ </Document>
130
+ );
131
+ }
132
+
133
+ interface ValueSetInfo {
134
+ url: string;
135
+ questionText: string;
136
+ linkId: string;
137
+ }
138
+
139
+ /**
140
+ * Recursively extracts all valueset URLs from questionnaire items
141
+ * @param items - The questionnaire items to extract valuesets from
142
+ * @param result - Accumulator array for valueset information
143
+ * @returns Array of valueset information including URL, question text, and linkId
144
+ */
145
+ function extractValueSets(items: QuestionnaireItem[] | undefined, result: ValueSetInfo[] = []): ValueSetInfo[] {
146
+ if (!items) {
147
+ return result;
148
+ }
149
+
150
+ for (const item of items) {
151
+ if (item.answerValueSet) {
152
+ result.push({
153
+ url: item.answerValueSet,
154
+ questionText: item.text || item.linkId || 'Unknown question',
155
+ linkId: item.linkId || 'unknown',
156
+ });
157
+ }
158
+ if (item.item) {
159
+ extractValueSets(item.item, result);
160
+ }
161
+ }
162
+
163
+ return result;
164
+ }
165
+
166
+ /**
167
+ * Checks if a valueset is available by attempting to expand it
168
+ * @param valueSetUrl - The URL of the valueset to check
169
+ * @param medplum - The Medplum client instance
170
+ * @returns Promise that resolves to true if valueset is available, false otherwise
171
+ */
172
+ async function checkValueSetAvailability(
173
+ valueSetUrl: string,
174
+ medplum: ReturnType<typeof useMedplum>
175
+ ): Promise<boolean> {
176
+ try {
177
+ await medplum.valueSetExpand({
178
+ url: valueSetUrl,
179
+ count: 1,
180
+ });
181
+ return true;
182
+ } catch {
183
+ return false;
184
+ }
185
+ }
186
+
187
+ const defaultQuestionnaire: Questionnaire = {
188
+ resourceType: 'Questionnaire',
189
+ status: 'active',
190
+ title: 'Patient Intake Questionnaire',
191
+ url: 'https://medplum.com/Questionnaire/patient-intake-questionnaire-example',
192
+ name: 'patient-intake',
193
+ item: [
194
+ {
195
+ linkId: 'patient-demographics',
196
+ text: 'Demographics',
197
+ type: 'group',
198
+ item: [
199
+ {
200
+ linkId: 'first-name',
201
+ text: 'First Name',
202
+ type: 'string',
203
+ required: true,
204
+ },
205
+ {
206
+ linkId: 'middle-name',
207
+ text: 'Middle Name',
208
+ type: 'string',
209
+ },
210
+ {
211
+ linkId: 'last-name',
212
+ text: 'Last Name',
213
+ type: 'string',
214
+ required: true,
215
+ },
216
+ {
217
+ linkId: 'dob',
218
+ text: 'Date of Birth',
219
+ type: 'date',
220
+ },
221
+ {
222
+ linkId: 'street',
223
+ text: 'Street',
224
+ type: 'string',
225
+ },
226
+ {
227
+ linkId: 'city',
228
+ text: 'City',
229
+ type: 'string',
230
+ },
231
+ {
232
+ linkId: 'state',
233
+ text: 'State',
234
+ type: 'choice',
235
+ answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state',
236
+ },
237
+ {
238
+ linkId: 'zip',
239
+ text: 'Zip',
240
+ type: 'string',
241
+ },
242
+ {
243
+ linkId: 'phone',
244
+ text: 'Phone',
245
+ type: 'string',
246
+ },
247
+ {
248
+ linkId: 'ssn',
249
+ text: 'Social Security Number',
250
+ type: 'string',
251
+ required: true,
252
+ },
253
+ {
254
+ linkId: 'race',
255
+ text: 'Race',
256
+ type: 'choice',
257
+ answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/omb-race-category',
258
+ },
259
+ {
260
+ linkId: 'ethnicity',
261
+ text: 'Ethnicity',
262
+ type: 'choice',
263
+ answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category',
264
+ },
265
+ {
266
+ linkId: 'gender-identity',
267
+ text: 'Gender Identity',
268
+ type: 'choice',
269
+ answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.32',
270
+ required: true,
271
+ },
272
+ {
273
+ linkId: 'sexual-orientation',
274
+ text: 'Sexual Orientation',
275
+ type: 'choice',
276
+ answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-sexual-orientation',
277
+ },
278
+ ],
279
+ },
280
+ {
281
+ linkId: 'emergency-contact',
282
+ text: 'Emergency Contact',
283
+ type: 'group',
284
+ repeats: true,
285
+ item: [
286
+ {
287
+ linkId: 'emergency-contact-first-name',
288
+ text: 'First Name',
289
+ type: 'string',
290
+ },
291
+ {
292
+ linkId: 'emergency-contact-middle-name',
293
+ text: 'Middle Name',
294
+ type: 'string',
295
+ },
296
+ {
297
+ linkId: 'emergency-contact-last-name',
298
+ text: 'Last Name',
299
+ type: 'string',
300
+ },
301
+ {
302
+ linkId: 'emergency-contact-phone',
303
+ text: 'Phone',
304
+ type: 'string',
305
+ },
306
+ ],
307
+ },
308
+ {
309
+ linkId: 'allergies',
310
+ text: 'Allergies',
311
+ type: 'group',
312
+ repeats: true,
313
+ item: [
314
+ {
315
+ linkId: 'allergy-substance',
316
+ text: 'Substance',
317
+ type: 'choice',
318
+ answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.8',
319
+ },
320
+ {
321
+ linkId: 'allergy-reaction',
322
+ text: 'Reaction',
323
+ type: 'string',
324
+ },
325
+ {
326
+ linkId: 'allergy-onset',
327
+ text: 'Onset',
328
+ type: 'dateTime',
329
+ },
330
+ ],
331
+ },
332
+ {
333
+ linkId: 'medications',
334
+ text: 'Current medications',
335
+ type: 'group',
336
+ repeats: true,
337
+ item: [
338
+ {
339
+ linkId: 'medication-code',
340
+ text: 'Medication Name',
341
+ type: 'choice',
342
+ answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.4',
343
+ },
344
+ {
345
+ linkId: 'medication-note',
346
+ text: 'Note',
347
+ type: 'string',
348
+ },
349
+ ],
350
+ },
351
+ {
352
+ linkId: 'medical-history',
353
+ text: 'Medical History',
354
+ type: 'group',
355
+ repeats: true,
356
+ item: [
357
+ {
358
+ linkId: 'medical-history-problem',
359
+ text: 'Problem',
360
+ type: 'choice',
361
+ answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code',
362
+ },
363
+ {
364
+ linkId: 'medical-history-clinical-status',
365
+ text: 'Status',
366
+ type: 'choice',
367
+ answerValueSet: 'http://hl7.org/fhir/ValueSet/condition-clinical',
368
+ },
369
+ {
370
+ linkId: 'medical-history-onset',
371
+ text: 'Onset',
372
+ type: 'dateTime',
373
+ },
374
+ ],
375
+ },
376
+ {
377
+ linkId: 'family-member-history',
378
+ text: 'Family Member History',
379
+ type: 'group',
380
+ repeats: true,
381
+ item: [
382
+ {
383
+ linkId: 'family-member-history-problem',
384
+ text: 'Problem',
385
+ type: 'choice',
386
+ answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code',
387
+ },
388
+ {
389
+ linkId: 'family-member-history-relationship',
390
+ text: 'Relationship',
391
+ type: 'choice',
392
+ answerValueSet: 'http://terminology.hl7.org/ValueSet/v3-FamilyMember',
393
+ },
394
+ {
395
+ linkId: 'family-member-history-deceased',
396
+ text: 'Deceased',
397
+ type: 'boolean',
398
+ },
399
+ ],
400
+ },
401
+ {
402
+ linkId: 'vaccination-history',
403
+ text: 'Vaccination History',
404
+ type: 'group',
405
+ repeats: true,
406
+ item: [
407
+ {
408
+ linkId: 'immunization-vaccine',
409
+ text: 'Vaccine',
410
+ type: 'choice',
411
+ answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.6',
412
+ },
413
+ {
414
+ linkId: 'immunization-date',
415
+ text: 'Administration Date',
416
+ type: 'dateTime',
417
+ },
418
+ ],
419
+ },
420
+ {
421
+ linkId: 'preferred-pharmacy',
422
+ text: 'Preferred Pharmacy',
423
+ type: 'group',
424
+ item: [
425
+ {
426
+ linkId: 'preferred-pharmacy-reference',
427
+ text: 'Pharmacy',
428
+ type: 'reference',
429
+ extension: [
430
+ {
431
+ id: 'reference-pharmacy',
432
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource',
433
+ valueCodeableConcept: {
434
+ coding: [
435
+ {
436
+ system: 'http://hl7.org/fhir/fhir-types',
437
+ display: 'Organizations',
438
+ code: 'Organization',
439
+ },
440
+ ],
441
+ },
442
+ },
443
+ ],
444
+ },
445
+ ],
446
+ },
447
+ {
448
+ linkId: 'coverage-information',
449
+ text: 'Coverage Information',
450
+ type: 'group',
451
+ repeats: true,
452
+ item: [
453
+ {
454
+ linkId: 'insurance-provider',
455
+ text: 'Insurance Provider',
456
+ type: 'reference',
457
+ required: true,
458
+ extension: [
459
+ {
460
+ id: 'reference-insurance',
461
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource',
462
+ valueCodeableConcept: {
463
+ coding: [
464
+ {
465
+ system: 'http://hl7.org/fhir/fhir-types',
466
+ display: 'Organizations',
467
+ code: 'Organization',
468
+ },
469
+ ],
470
+ },
471
+ },
472
+ ],
473
+ },
474
+ {
475
+ linkId: 'subscriber-id',
476
+ text: 'Subscriber ID',
477
+ type: 'string',
478
+ required: true,
479
+ },
480
+ {
481
+ linkId: 'relationship-to-subscriber',
482
+ text: 'Relationship to Subscriber',
483
+ type: 'choice',
484
+ answerValueSet: 'http://hl7.org/fhir/ValueSet/subscriber-relationship',
485
+ required: true,
486
+ },
487
+ {
488
+ linkId: 'related-person',
489
+ text: 'Subscriber Information',
490
+ type: 'group',
491
+ enableBehavior: 'all',
492
+ enableWhen: [
493
+ {
494
+ question: 'relationship-to-subscriber',
495
+ operator: '!=',
496
+ answerCoding: {
497
+ system: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship',
498
+ code: 'other',
499
+ display: 'Other',
500
+ },
501
+ },
502
+ {
503
+ question: 'relationship-to-subscriber',
504
+ operator: '!=',
505
+ answerCoding: {
506
+ system: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship',
507
+ code: 'self',
508
+ display: 'Self',
509
+ },
510
+ },
511
+ {
512
+ question: 'relationship-to-subscriber',
513
+ operator: '!=',
514
+ answerCoding: {
515
+ system: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship',
516
+ code: 'injured',
517
+ display: 'Injured Party',
518
+ },
519
+ },
520
+ ],
521
+ item: [
522
+ {
523
+ linkId: 'related-person-first-name',
524
+ text: 'First Name',
525
+ type: 'string',
526
+ },
527
+ {
528
+ linkId: 'related-person-middle-name',
529
+ text: 'Middle Name',
530
+ type: 'string',
531
+ },
532
+ {
533
+ linkId: 'related-person-last-name',
534
+ text: 'Last Name',
535
+ type: 'string',
536
+ },
537
+ {
538
+ linkId: 'related-person-dob',
539
+ text: 'Date of Birth',
540
+ type: 'date',
541
+ },
542
+ {
543
+ linkId: 'related-person-gender-identity',
544
+ text: 'Gender Identity',
545
+ type: 'choice',
546
+ answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.32',
547
+ },
548
+ ],
549
+ },
550
+ ],
551
+ },
552
+ {
553
+ linkId: 'social-determinants-of-health',
554
+ text: 'Social Determinants of Health',
555
+ type: 'group',
556
+ item: [
557
+ {
558
+ linkId: 'housing-status',
559
+ text: 'Housing Status',
560
+ type: 'choice',
561
+ answerValueSet: 'http://terminology.hl7.org/ValueSet/v3-LivingArrangement',
562
+ },
563
+ {
564
+ linkId: 'education-level',
565
+ text: 'Education Level',
566
+ type: 'choice',
567
+ answerValueSet: 'http://terminology.hl7.org/ValueSet/v3-EducationLevel',
568
+ },
569
+ {
570
+ linkId: 'smoking-status',
571
+ text: 'Smoking Status',
572
+ type: 'choice',
573
+ answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.11.20.9.38',
574
+ },
575
+ {
576
+ linkId: 'veteran-status',
577
+ text: 'Veteran Status',
578
+ type: 'boolean',
579
+ },
580
+ {
581
+ linkId: 'pregnancy-status',
582
+ text: 'Pregnancy Status',
583
+ type: 'choice',
584
+ code: [
585
+ {
586
+ code: '82810-3',
587
+ display: 'Pregnancy status',
588
+ system: 'http://loinc.org',
589
+ },
590
+ ],
591
+ answerValueSet: 'http://example.com/pregnancy-status',
592
+ },
593
+ {
594
+ linkId: 'estimated-delivery-date',
595
+ text: 'Estimated Delivery Date',
596
+ type: 'date',
597
+ code: [
598
+ {
599
+ code: '11778-8',
600
+ display: 'Estimated date of delivery',
601
+ system: 'http://loinc.org',
602
+ },
603
+ ],
604
+ enableWhen: [
605
+ {
606
+ question: 'pregnancy-status',
607
+ operator: '=',
608
+ answerCoding: {
609
+ system: 'http://snomed.info/sct',
610
+ code: '77386006',
611
+ display: 'Pregnancy',
612
+ },
613
+ },
614
+ ],
615
+ },
616
+ ],
617
+ },
618
+ {
619
+ linkId: 'languages-spoken',
620
+ text: 'Languages Spoken',
621
+ type: 'choice',
622
+ answerValueSet: 'http://hl7.org/fhir/ValueSet/languages',
623
+ repeats: true,
624
+ },
625
+ {
626
+ linkId: 'preferred-language',
627
+ text: 'Preferred Language',
628
+ type: 'choice',
629
+ answerValueSet: 'http://hl7.org/fhir/ValueSet/languages',
630
+ },
631
+ {
632
+ linkId: 'consent-for-treatment',
633
+ text: 'Consent for Treatment',
634
+ type: 'group',
635
+ item: [
636
+ {
637
+ linkId: 'consent-for-treatment-signature',
638
+ text: 'I the undersigned patient (or authorized representative, or parent/guardian), consent to and authorize the performance of any treatments, examinations, medical services, surgical or diagnostic procedures, including lab and radiographic studies, as ordered by this office and it’s healthcare providers.',
639
+ type: 'boolean',
640
+ },
641
+ {
642
+ linkId: 'consent-for-treatment-date',
643
+ text: 'Date',
644
+ type: 'date',
645
+ },
646
+ ],
647
+ },
648
+ {
649
+ linkId: 'agreement-to-pay-for-treatment',
650
+ text: 'Agreement to Pay for Treatment',
651
+ type: 'group',
652
+ item: [
653
+ {
654
+ linkId: 'agreement-to-pay-for-treatment-help',
655
+ text: 'I, the responsible party, hereby agree to pay all the charges submitted by this office during the course of treatment for the patient. If the patient has insurance coverage with a managed care organization, with which this office has a contractual agreement, I agree to pay all applicable co‐payments, co‐insurance and deductibles, which arise during the course of treatment for the patient. The responsible party also agrees to pay for treatment rendered to the patient, which is not considered to be a covered service by my insurer and/or a third party insurer or other payor. I understand that Sample Hospital provides charges on a sliding fee; based on family size and household annual income, and that services will not be refused due to inability to pay at the time of the visit.',
656
+ type: 'boolean',
657
+ },
658
+ {
659
+ linkId: 'agreement-to-pay-for-treatment-date',
660
+ text: 'Date',
661
+ type: 'date',
662
+ },
663
+ ],
664
+ },
665
+ {
666
+ linkId: 'notice-of-privacy-practices',
667
+ text: 'Notice of Privacy Practices',
668
+ type: 'group',
669
+ item: [
670
+ {
671
+ linkId: 'notice-of-privacy-practices-help',
672
+ text: 'Sample Hospital Notice of Privacy Practices gives information about how Sample Hospital may use and release protected health information (PHI) about you. I understand that:\n- I have the right to receive a copy of Sample Hospital’s Notice of Privacy Practices.\n- I may request a copy at any time.\n- Sample Hospital‘s Notice of Privacy Practices may be revised.',
673
+ type: 'display',
674
+ },
675
+ {
676
+ linkId: 'notice-of-privacy-practices-signature',
677
+ text: 'I acknowledge the above and that I have received a copy of Sample Hospital’s Notice of Privacy Practices.',
678
+ type: 'boolean',
679
+ },
680
+ {
681
+ linkId: 'notice-of-privacy-practices-date',
682
+ text: 'Date',
683
+ type: 'date',
684
+ },
685
+ ],
686
+ },
687
+ {
688
+ linkId: 'acknowledgement-for-advance-directives',
689
+ text: 'Acknowledgement for Advance Directives',
690
+ type: 'group',
691
+ item: [
692
+ {
693
+ linkId: 'acknowledgement-for-advance-directives-help',
694
+ text: 'An Advance Medical Directive is a document by which a person makes provision for health care decisions in the event that, in the future, he/she becomes unable to make those decisions.',
695
+ type: 'display',
696
+ },
697
+ {
698
+ linkId: 'acknowledgement-for-advance-directives-signature',
699
+ text: 'I acknowledge I have received information about Advance Directives.',
700
+ type: 'boolean',
701
+ },
702
+ {
703
+ linkId: 'acknowledgement-for-advance-directives-date',
704
+ text: 'Date',
705
+ type: 'date',
706
+ },
707
+ ],
708
+ },
709
+ ],
710
+ };