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.
- package/README.md +5 -0
- package/dist/examples/vintasend-medplum-example/.env.example +11 -0
- package/dist/examples/vintasend-medplum-example/IMPLEMENTATION_PLAN_FILE_ATTACHMENTS.md +597 -0
- package/dist/examples/vintasend-medplum-example/README.md +190 -0
- package/dist/examples/vintasend-medplum-example/TUTORIAL_EMAIL_NOTIFICATIONS.md +2596 -0
- package/dist/examples/vintasend-medplum-example/bots/handlers/send-pending-notifications-bot.ts +39 -0
- package/dist/examples/vintasend-medplum-example/bots/handlers/send-task-assignment-email.ts +41 -0
- package/dist/examples/vintasend-medplum-example/bots/handlers/task-due-soon-notification-bot.ts +86 -0
- package/dist/examples/vintasend-medplum-example/bots/index.ts +53 -0
- package/dist/examples/vintasend-medplum-example/bots/services/emails/schedule-task-due-soon-email.ts +84 -0
- package/dist/examples/vintasend-medplum-example/bots/services/emails/send-task-assignment-email.test.ts +388 -0
- package/dist/examples/vintasend-medplum-example/bots/services/emails/send-task-assignment-email.ts +113 -0
- package/dist/examples/vintasend-medplum-example/bots/shared/task-due-soon-helpers.ts +115 -0
- package/dist/examples/vintasend-medplum-example/bots/task-assignment-bot.ts +41 -0
- package/dist/examples/vintasend-medplum-example/compiled-notification-templates.json +6 -0
- package/dist/examples/vintasend-medplum-example/esbuild-script.mjs +71 -0
- package/dist/examples/vintasend-medplum-example/index.html +14 -0
- package/dist/examples/vintasend-medplum-example/lib/constants.ts +32 -0
- package/dist/examples/vintasend-medplum-example/lib/extensions.ts +1 -0
- package/dist/examples/vintasend-medplum-example/lib/file-upload.test.ts +389 -0
- package/dist/examples/vintasend-medplum-example/lib/file-upload.ts +222 -0
- package/dist/examples/vintasend-medplum-example/lib/medplum-singleton.ts +18 -0
- package/dist/examples/vintasend-medplum-example/lib/notification-service.test.ts +293 -0
- package/dist/examples/vintasend-medplum-example/lib/notification-service.ts +284 -0
- package/dist/examples/vintasend-medplum-example/lib/patients.ts +20 -0
- package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-assignment/body.html.pug +37 -0
- package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-assignment/subject.txt.pug +4 -0
- package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-due-soon/body.html.pug +34 -0
- package/dist/examples/vintasend-medplum-example/notification-templates/emails/task-due-soon/subject.txt.pug +4 -0
- package/dist/examples/vintasend-medplum-example/package.json +75 -0
- package/dist/examples/vintasend-medplum-example/plugins/gql-plugin.mjs +31 -0
- package/dist/examples/vintasend-medplum-example/postcss.config.mjs +21 -0
- package/dist/examples/vintasend-medplum-example/public/favicon.ico +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/acuity.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/auth0.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/azure.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/calcom.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/candid.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/claude.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/datadog.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/deepseek.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/entra.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/epic.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/google.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/healthgorilla.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/healthie.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/labcorp.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/okta.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/openai.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/particle.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/quest.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/recaptcha.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/snowflake.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/stedi.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/stripe.png +0 -0
- package/dist/examples/vintasend-medplum-example/public/img/integrations/sumo.png +0 -0
- package/dist/examples/vintasend-medplum-example/scripts/README.md +162 -0
- package/dist/examples/vintasend-medplum-example/scripts/client.ts +18 -0
- package/dist/examples/vintasend-medplum-example/scripts/deploy-bots.ts +171 -0
- package/dist/examples/vintasend-medplum-example/src/App.tsx +185 -0
- package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemList.test.tsx +350 -0
- package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemList.tsx +241 -0
- package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemPanel.test.tsx +616 -0
- package/dist/examples/vintasend-medplum-example/src/components/ChargeItem/ChargeItemPanel.tsx +138 -0
- package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionItem.test.tsx +92 -0
- package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionItem.tsx +47 -0
- package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionList.test.tsx +464 -0
- package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionList.tsx +186 -0
- package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionModal.test.tsx +80 -0
- package/dist/examples/vintasend-medplum-example/src/components/Conditions/ConditionModal.tsx +82 -0
- package/dist/examples/vintasend-medplum-example/src/components/DoseSpotIcon.test.tsx +100 -0
- package/dist/examples/vintasend-medplum-example/src/components/DoseSpotIcon.tsx +20 -0
- package/dist/examples/vintasend-medplum-example/src/components/IntegrationCard.module.css +3 -0
- package/dist/examples/vintasend-medplum-example/src/components/IntegrationCard.tsx +62 -0
- package/dist/examples/vintasend-medplum-example/src/components/MessageWithLinks.tsx +47 -0
- package/dist/examples/vintasend-medplum-example/src/components/PerformingLabInput.test.tsx +299 -0
- package/dist/examples/vintasend-medplum-example/src/components/PerformingLabInput.tsx +52 -0
- package/dist/examples/vintasend-medplum-example/src/components/ResourceFormWithRequiredProfile.tsx +82 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/BillingTab.test.tsx +1016 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/BillingTab.tsx +298 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterChart.test.tsx +732 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterChart.tsx +282 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterHeader.test.tsx +268 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/EncounterHeader.tsx +224 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/SignAddendum.test.tsx +255 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/SignAddendum.tsx +212 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/SignLockDialog.test.tsx +120 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/SignLockDialog.tsx +57 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/VisitDetailsPanel.test.tsx +224 -0
- package/dist/examples/vintasend-medplum-example/src/components/encounter/VisitDetailsPanel.tsx +100 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/CoverageInput.test.tsx +431 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/CoverageInput.tsx +130 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabListItem.module.css +31 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabListItem.test.tsx +234 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabListItem.tsx +143 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabOrderDetails.module.css +11 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabOrderDetails.test.tsx +875 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabOrderDetails.tsx +943 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabResultDetails.test.tsx +413 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabResultDetails.tsx +203 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/LabSelectEmpty.tsx +22 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/README.md +104 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/TestMetadataCardInput.test.tsx +318 -0
- package/dist/examples/vintasend-medplum-example/src/components/labs/TestMetadataCardInput.tsx +87 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ChatList.test.tsx +126 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ChatList.tsx +38 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ChatListItem.module.css +23 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ChatListItem.test.tsx +167 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ChatListItem.tsx +53 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/NewTopicDialog.test.tsx +94 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/NewTopicDialog.tsx +165 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ParticipantFilter.module.css +8 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ParticipantFilter.test.tsx +523 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ParticipantFilter.tsx +230 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ThreadInbox.module.css +23 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ThreadInbox.test.tsx +567 -0
- package/dist/examples/vintasend-medplum-example/src/components/messages/ThreadInbox.tsx +358 -0
- package/dist/examples/vintasend-medplum-example/src/components/plandefinition/AddPlanDefinition.module.css +40 -0
- package/dist/examples/vintasend-medplum-example/src/components/plandefinition/AddPlanDefinition.tsx +257 -0
- package/dist/examples/vintasend-medplum-example/src/components/schedule/CreateVisit.module.css +7 -0
- package/dist/examples/vintasend-medplum-example/src/components/schedule/CreateVisit.test.tsx +279 -0
- package/dist/examples/vintasend-medplum-example/src/components/schedule/CreateVisit.tsx +156 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/HistoryList.module.css +45 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/HistoryList.test.tsx +90 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/HistoryList.tsx +84 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourceBox.module.css +26 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourceBox.tsx +90 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourcePanel.test.tsx +305 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/ResourcePanel.tsx +46 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/SpacesInbox.module.css +262 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/SpacesInbox.test.tsx +622 -0
- package/dist/examples/vintasend-medplum-example/src/components/spaces/SpacesInbox.tsx +286 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/NewTaskModal.tsx +275 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskAttachmentList.tsx +132 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskBoard.module.css +45 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskBoard.test.tsx +749 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskBoard.tsx +416 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailPanel.test.tsx +278 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailPanel.tsx +133 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailsModal.module.css +16 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailsModal.test.tsx +255 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskDetailsModal.tsx +203 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFileUpload.tsx +129 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFilterMenu.test.tsx +156 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFilterMenu.tsx +142 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskFilterMenu.utils.ts +28 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskInputNote.test.tsx +134 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskInputNote.tsx +250 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskListItem.module.css +23 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskListItem.test.tsx +149 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskListItem.tsx +53 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskNoteItem.test.tsx +68 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskNoteItem.tsx +46 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskProperties.test.tsx +555 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskProperties.tsx +170 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskSelectEmpty.test.tsx +32 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/TaskSelectEmpty.tsx +34 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/SimpleTask.test.tsx +47 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/SimpleTask.tsx +29 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskPanel.test.tsx +285 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskPanel.tsx +129 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskQuestionnaireForm.test.tsx +455 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskQuestionnaireForm.tsx +167 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskServiceRequest.test.tsx +435 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskServiceRequest.tsx +116 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskStatusPanel.module.css +38 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskStatusPanel.test.tsx +200 -0
- package/dist/examples/vintasend-medplum-example/src/components/tasks/encounter/TaskStatusPanel.tsx +84 -0
- package/dist/examples/vintasend-medplum-example/src/components/utils.test.ts +176 -0
- package/dist/examples/vintasend-medplum-example/src/components/utils.ts +17 -0
- package/dist/examples/vintasend-medplum-example/src/config/constants.ts +3 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useDebouncedUpdateResource.test.tsx +166 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useDebouncedUpdateResource.ts +28 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useEncounter.test.tsx +94 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useEncounter.ts +11 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useEncounterChart.test.tsx +477 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useEncounterChart.ts +191 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/usePatient.test.tsx +100 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/usePatient.ts +18 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useThreadInbox.test.tsx +379 -0
- package/dist/examples/vintasend-medplum-example/src/hooks/useThreadInbox.ts +194 -0
- package/dist/examples/vintasend-medplum-example/src/index.css +8 -0
- package/dist/examples/vintasend-medplum-example/src/main.tsx +57 -0
- package/dist/examples/vintasend-medplum-example/src/pages/SearchPage.module.css +6 -0
- package/dist/examples/vintasend-medplum-example/src/pages/SearchPage.test.tsx +295 -0
- package/dist/examples/vintasend-medplum-example/src/pages/SearchPage.tsx +124 -0
- package/dist/examples/vintasend-medplum-example/src/pages/SignInPage.test.tsx +77 -0
- package/dist/examples/vintasend-medplum-example/src/pages/SignInPage.tsx +22 -0
- package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterChartPage.test.tsx +87 -0
- package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterChartPage.tsx +27 -0
- package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterModal.module.css +16 -0
- package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterModal.test.tsx +287 -0
- package/dist/examples/vintasend-medplum-example/src/pages/encounter/EncounterModal.tsx +151 -0
- package/dist/examples/vintasend-medplum-example/src/pages/integrations/DoseSpotFavoritesPage.test.tsx +519 -0
- package/dist/examples/vintasend-medplum-example/src/pages/integrations/DoseSpotFavoritesPage.tsx +179 -0
- package/dist/examples/vintasend-medplum-example/src/pages/integrations/FavoriteMedicationsTable.tsx +76 -0
- package/dist/examples/vintasend-medplum-example/src/pages/integrations/IntegrationsPage.test.tsx +234 -0
- package/dist/examples/vintasend-medplum-example/src/pages/integrations/IntegrationsPage.tsx +222 -0
- package/dist/examples/vintasend-medplum-example/src/pages/labs/OrderLabsPage.test.tsx +356 -0
- package/dist/examples/vintasend-medplum-example/src/pages/labs/OrderLabsPage.tsx +275 -0
- package/dist/examples/vintasend-medplum-example/src/pages/messages/MessagesPage.module.css +8 -0
- package/dist/examples/vintasend-medplum-example/src/pages/messages/MessagesPage.test.tsx +103 -0
- package/dist/examples/vintasend-medplum-example/src/pages/messages/MessagesPage.tsx +78 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/CommunicationTab.test.tsx +84 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/CommunicationTab.tsx +82 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotAdvancedOptions.test.tsx +364 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotAdvancedOptions.tsx +149 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotTab.test.tsx +159 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/DoseSpotTab.tsx +37 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/EditTab.test.tsx +140 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/EditTab.tsx +72 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/ExportTab.test.tsx +57 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/ExportTab.tsx +14 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/IntakeFormPage.test.tsx +241 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/IntakeFormPage.tsx +710 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/LabsPage.module.css +37 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/LabsPage.test.tsx +428 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/LabsPage.tsx +334 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.module.css +24 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.test.tsx +154 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.tsx +115 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.utils.test.ts +223 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientPage.utils.ts +89 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientSearchPage.test.tsx +147 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientSearchPage.tsx +79 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/PatientTabsNavigation.tsx +35 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/TasksTab.test.tsx +185 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/TasksTab.tsx +115 -0
- package/dist/examples/vintasend-medplum-example/src/pages/patient/TimelineTab.tsx +14 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceCreatePage.test.tsx +170 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceCreatePage.tsx +117 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceDetailPage.tsx +28 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceEditPage.test.tsx +131 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceEditPage.tsx +65 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceHistoryPage.test.tsx +108 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourceHistoryPage.tsx +16 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourcePage.module.css +7 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourcePage.test.tsx +37 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/ResourcePage.tsx +44 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/useResourceType.ts +44 -0
- package/dist/examples/vintasend-medplum-example/src/pages/resource/utils.ts +9 -0
- package/dist/examples/vintasend-medplum-example/src/pages/schedule/SchedulePage.test.tsx +302 -0
- package/dist/examples/vintasend-medplum-example/src/pages/schedule/SchedulePage.tsx +416 -0
- package/dist/examples/vintasend-medplum-example/src/pages/spaces/ChatInput.tsx +91 -0
- package/dist/examples/vintasend-medplum-example/src/pages/spaces/SpacesPage.module.css +6 -0
- package/dist/examples/vintasend-medplum-example/src/pages/spaces/SpacesPage.test.tsx +102 -0
- package/dist/examples/vintasend-medplum-example/src/pages/spaces/SpacesPage.tsx +44 -0
- package/dist/examples/vintasend-medplum-example/src/pages/tasks/TasksPage.module.css +7 -0
- package/dist/examples/vintasend-medplum-example/src/pages/tasks/TasksPage.test.tsx +133 -0
- package/dist/examples/vintasend-medplum-example/src/pages/tasks/TasksPage.tsx +91 -0
- package/dist/examples/vintasend-medplum-example/src/test-utils/render.tsx +20 -0
- package/dist/examples/vintasend-medplum-example/src/test.setup.ts +49 -0
- package/dist/examples/vintasend-medplum-example/src/types/encounter.ts +8 -0
- package/dist/examples/vintasend-medplum-example/src/types/spaces.ts +10 -0
- package/dist/examples/vintasend-medplum-example/src/utils/chargeitems.test.ts +141 -0
- package/dist/examples/vintasend-medplum-example/src/utils/chargeitems.ts +59 -0
- package/dist/examples/vintasend-medplum-example/src/utils/claims.test.ts +153 -0
- package/dist/examples/vintasend-medplum-example/src/utils/claims.ts +65 -0
- package/dist/examples/vintasend-medplum-example/src/utils/communication-search.ts +47 -0
- package/dist/examples/vintasend-medplum-example/src/utils/coverage.test.ts +48 -0
- package/dist/examples/vintasend-medplum-example/src/utils/coverage.ts +33 -0
- package/dist/examples/vintasend-medplum-example/src/utils/documentReference.test.ts +102 -0
- package/dist/examples/vintasend-medplum-example/src/utils/documentReference.ts +55 -0
- package/dist/examples/vintasend-medplum-example/src/utils/encounter.test.ts +169 -0
- package/dist/examples/vintasend-medplum-example/src/utils/encounter.ts +261 -0
- package/dist/examples/vintasend-medplum-example/src/utils/intake-form.test.ts +154 -0
- package/dist/examples/vintasend-medplum-example/src/utils/intake-form.ts +272 -0
- package/dist/examples/vintasend-medplum-example/src/utils/intake-utils.test.ts +1137 -0
- package/dist/examples/vintasend-medplum-example/src/utils/intake-utils.ts +827 -0
- package/dist/examples/vintasend-medplum-example/src/utils/notifications.test.ts +27 -0
- package/dist/examples/vintasend-medplum-example/src/utils/notifications.ts +15 -0
- package/dist/examples/vintasend-medplum-example/src/utils/spaceMessaging.ts +249 -0
- package/dist/examples/vintasend-medplum-example/src/utils/spacePersistence.test.ts +450 -0
- package/dist/examples/vintasend-medplum-example/src/utils/spacePersistence.ts +147 -0
- package/dist/examples/vintasend-medplum-example/src/utils/task-search.ts +63 -0
- package/dist/examples/vintasend-medplum-example/src/vite-env.d.ts +3 -0
- package/dist/examples/vintasend-medplum-example/tsconfig.bots.json +4 -0
- package/dist/examples/vintasend-medplum-example/tsconfig.json +19 -0
- package/dist/examples/vintasend-medplum-example/vercel.json +3 -0
- package/dist/examples/vintasend-medplum-example/vite.config.ts +44 -0
- package/dist/services/notification-backends/base-notification-backend.d.ts +5 -0
- package/dist/services/notification-service.js +11 -1
- package/dist/services/notification-template-renderers/base-email-template-renderer.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { Button, Card, Flex, Group, Menu, Stack } from '@mantine/core';
|
|
4
|
+
import { showNotification } from '@mantine/notifications';
|
|
5
|
+
import type {
|
|
6
|
+
ChargeItem,
|
|
7
|
+
Claim,
|
|
8
|
+
ClaimDiagnosis,
|
|
9
|
+
Condition,
|
|
10
|
+
Coverage,
|
|
11
|
+
Encounter,
|
|
12
|
+
EncounterDiagnosis,
|
|
13
|
+
Patient,
|
|
14
|
+
Practitioner,
|
|
15
|
+
} from '@medplum/fhirtypes';
|
|
16
|
+
import { IconDownload, IconFileText, IconSend } from '@tabler/icons-react';
|
|
17
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
18
|
+
import type { JSX } from 'react';
|
|
19
|
+
import { VisitDetailsPanel } from './VisitDetailsPanel';
|
|
20
|
+
import { getReferenceString, HTTP_HL7_ORG } from '@medplum/core';
|
|
21
|
+
import { showErrorNotification } from '../../utils/notifications';
|
|
22
|
+
import { useMedplum } from '@medplum/react';
|
|
23
|
+
import { createSelfPayCoverage } from '../../utils/coverage';
|
|
24
|
+
import { ConditionList } from '../Conditions/ConditionList';
|
|
25
|
+
import { useDebouncedUpdateResource } from '../../hooks/useDebouncedUpdateResource';
|
|
26
|
+
import { ChargeItemList } from '../ChargeItem/ChargeItemList';
|
|
27
|
+
import { createClaimFromEncounter, getCptChargeItems } from '../../utils/claims';
|
|
28
|
+
import { SAVE_TIMEOUT_MS } from '../../config/constants';
|
|
29
|
+
import { calculateTotalPrice } from '../../utils/chargeitems';
|
|
30
|
+
import { useDebouncedCallback } from '@mantine/hooks';
|
|
31
|
+
|
|
32
|
+
interface BillingTabProps {
|
|
33
|
+
patient: Patient;
|
|
34
|
+
encounter: Encounter;
|
|
35
|
+
setEncounter: (encounter: Encounter) => void;
|
|
36
|
+
practitioner: Practitioner | undefined;
|
|
37
|
+
setPractitioner: (practitioner: Practitioner) => void;
|
|
38
|
+
chargeItems: ChargeItem[] | undefined;
|
|
39
|
+
setChargeItems: (chargeItems: ChargeItem[]) => void;
|
|
40
|
+
claim: Claim | undefined;
|
|
41
|
+
setClaim: (claim: Claim) => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const BillingTab = (props: BillingTabProps): JSX.Element => {
|
|
45
|
+
const {
|
|
46
|
+
encounter,
|
|
47
|
+
setEncounter,
|
|
48
|
+
claim,
|
|
49
|
+
patient,
|
|
50
|
+
practitioner,
|
|
51
|
+
setPractitioner,
|
|
52
|
+
chargeItems,
|
|
53
|
+
setChargeItems,
|
|
54
|
+
setClaim,
|
|
55
|
+
} = props;
|
|
56
|
+
const medplum = useMedplum();
|
|
57
|
+
const [conditions, setConditions] = useState<Condition[]>([]);
|
|
58
|
+
const [coverage, setCoverage] = useState<Coverage | undefined>();
|
|
59
|
+
const debouncedUpdateResource = useDebouncedUpdateResource(medplum);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const fetchCoverage = async (): Promise<void> => {
|
|
63
|
+
if (!patient) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const coverageResult = await medplum.searchResources('Coverage', `patient=${getReferenceString(patient)}`);
|
|
67
|
+
if (coverageResult.length > 0) {
|
|
68
|
+
setCoverage(coverageResult[0] as Coverage);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
fetchCoverage().catch((err) => showErrorNotification(err));
|
|
73
|
+
}, [medplum, patient]);
|
|
74
|
+
|
|
75
|
+
const exportClaimAsCMS1500 = async (): Promise<void> => {
|
|
76
|
+
if (!claim?.id || !patient?.id) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let coverageForClaim = coverage;
|
|
81
|
+
if (!coverageForClaim) {
|
|
82
|
+
const coverageResults = await medplum.searchResources(
|
|
83
|
+
'Coverage',
|
|
84
|
+
`patient=${getReferenceString(patient)}&status=active`
|
|
85
|
+
);
|
|
86
|
+
if (coverageResults === undefined) {
|
|
87
|
+
showErrorNotification('Failed to fetch coverage information');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (coverageResults.length > 0) {
|
|
92
|
+
coverageForClaim = coverageResults[0];
|
|
93
|
+
} else {
|
|
94
|
+
coverageForClaim = await createSelfPayCoverage(medplum, patient.id);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const diagnosisArray = createDiagnosisArray(conditions || []);
|
|
99
|
+
const claimToExport: Claim = {
|
|
100
|
+
...claim,
|
|
101
|
+
insurance: [
|
|
102
|
+
{
|
|
103
|
+
sequence: 1,
|
|
104
|
+
focal: true,
|
|
105
|
+
coverage: { reference: getReferenceString(coverageForClaim) },
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
diagnosis: diagnosisArray,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const response = await medplum.post(medplum.fhirUrl('Claim', '$export'), {
|
|
112
|
+
resourceType: 'Parameters',
|
|
113
|
+
parameter: [{ name: 'resource', resource: claimToExport }],
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
if (response.resourceType === 'Media' && response.content?.url) {
|
|
117
|
+
const url = response.content.url;
|
|
118
|
+
window.open(url, '_blank');
|
|
119
|
+
} else {
|
|
120
|
+
showErrorNotification('Failed to download PDF');
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const handleDiagnosisChange = useCallback(
|
|
125
|
+
async (diagnosis: EncounterDiagnosis[]): Promise<void> => {
|
|
126
|
+
const updatedEncounter = { ...encounter, diagnosis };
|
|
127
|
+
setEncounter(updatedEncounter);
|
|
128
|
+
await debouncedUpdateResource(updatedEncounter);
|
|
129
|
+
},
|
|
130
|
+
[encounter, setEncounter, debouncedUpdateResource]
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const handleEncounterChange = useDebouncedCallback(async (updatedEncounter: Encounter): Promise<void> => {
|
|
134
|
+
try {
|
|
135
|
+
const savedEncounter = await medplum.updateResource(updatedEncounter);
|
|
136
|
+
setEncounter(savedEncounter);
|
|
137
|
+
|
|
138
|
+
let currentPractitioner = practitioner;
|
|
139
|
+
if (savedEncounter?.participant?.[0]?.individual) {
|
|
140
|
+
const practitionerResult = await medplum.readReference(savedEncounter.participant[0].individual);
|
|
141
|
+
currentPractitioner = practitionerResult as Practitioner;
|
|
142
|
+
setPractitioner(currentPractitioner);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (!patient?.id || !savedEncounter?.id || !currentPractitioner?.id || !chargeItems?.length) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!claim) {
|
|
150
|
+
const newClaim = await createClaimFromEncounter(
|
|
151
|
+
medplum,
|
|
152
|
+
patient.id,
|
|
153
|
+
savedEncounter.id,
|
|
154
|
+
currentPractitioner.id,
|
|
155
|
+
chargeItems
|
|
156
|
+
);
|
|
157
|
+
if (newClaim) {
|
|
158
|
+
setClaim(newClaim);
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
const providerRefNeedsUpdate = claim.provider?.reference !== getReferenceString(currentPractitioner);
|
|
162
|
+
if (providerRefNeedsUpdate) {
|
|
163
|
+
const updatedClaim: Claim = await medplum.updateResource({
|
|
164
|
+
...claim,
|
|
165
|
+
provider: { reference: getReferenceString(currentPractitioner) },
|
|
166
|
+
});
|
|
167
|
+
setClaim(updatedClaim);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
} catch (err) {
|
|
171
|
+
showErrorNotification(err);
|
|
172
|
+
}
|
|
173
|
+
}, SAVE_TIMEOUT_MS);
|
|
174
|
+
|
|
175
|
+
const updateChargeItems = useCallback(
|
|
176
|
+
async (updatedChargeItems: ChargeItem[]): Promise<void> => {
|
|
177
|
+
setChargeItems(updatedChargeItems);
|
|
178
|
+
if (claim?.id && updatedChargeItems.length > 0 && encounter) {
|
|
179
|
+
const updatedClaim: Claim = {
|
|
180
|
+
...claim,
|
|
181
|
+
item: getCptChargeItems(updatedChargeItems, { reference: getReferenceString(encounter) }),
|
|
182
|
+
total: { value: calculateTotalPrice(updatedChargeItems) },
|
|
183
|
+
};
|
|
184
|
+
setClaim(updatedClaim);
|
|
185
|
+
await debouncedUpdateResource(updatedClaim);
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
[setChargeItems, claim, encounter, setClaim, debouncedUpdateResource]
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<Stack gap="md">
|
|
193
|
+
{claim && (
|
|
194
|
+
<Card withBorder shadow="sm">
|
|
195
|
+
<Flex justify="space-between">
|
|
196
|
+
<Menu shadow="md" width={200}>
|
|
197
|
+
<Menu.Target>
|
|
198
|
+
<Button variant="outline" leftSection={<IconDownload size={16} />}>
|
|
199
|
+
Export Claim
|
|
200
|
+
</Button>
|
|
201
|
+
</Menu.Target>
|
|
202
|
+
|
|
203
|
+
<Menu.Dropdown>
|
|
204
|
+
<Menu.Label>Export Options</Menu.Label>
|
|
205
|
+
|
|
206
|
+
<Menu.Item
|
|
207
|
+
leftSection={<IconFileText size={14} />}
|
|
208
|
+
onClick={async () => {
|
|
209
|
+
await exportClaimAsCMS1500();
|
|
210
|
+
}}
|
|
211
|
+
>
|
|
212
|
+
CMS 1500 Form
|
|
213
|
+
</Menu.Item>
|
|
214
|
+
|
|
215
|
+
<Menu.Item
|
|
216
|
+
leftSection={<IconFileText size={14} />}
|
|
217
|
+
onClick={() => {
|
|
218
|
+
showNotification({
|
|
219
|
+
title: 'EDI X12',
|
|
220
|
+
message: 'Please contact sales to enable EDI X12 export',
|
|
221
|
+
color: 'blue',
|
|
222
|
+
});
|
|
223
|
+
}}
|
|
224
|
+
>
|
|
225
|
+
EDI X12
|
|
226
|
+
</Menu.Item>
|
|
227
|
+
|
|
228
|
+
<Menu.Item
|
|
229
|
+
leftSection={<IconFileText size={14} />}
|
|
230
|
+
onClick={() => {
|
|
231
|
+
showNotification({
|
|
232
|
+
title: 'NUCC Crosswalk',
|
|
233
|
+
message: 'Please contact sales to enable NUCC Crosswalk export',
|
|
234
|
+
color: 'blue',
|
|
235
|
+
});
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
NUCC Crosswalk CSV
|
|
239
|
+
</Menu.Item>
|
|
240
|
+
</Menu.Dropdown>
|
|
241
|
+
</Menu>
|
|
242
|
+
|
|
243
|
+
<Button variant="outline" leftSection={<IconSend size={16} />}>
|
|
244
|
+
Request to connect a billing service
|
|
245
|
+
</Button>
|
|
246
|
+
</Flex>
|
|
247
|
+
</Card>
|
|
248
|
+
)}
|
|
249
|
+
|
|
250
|
+
<Group grow align="flex-start">
|
|
251
|
+
<VisitDetailsPanel
|
|
252
|
+
practitioner={practitioner}
|
|
253
|
+
encounter={encounter}
|
|
254
|
+
onEncounterChange={handleEncounterChange}
|
|
255
|
+
/>
|
|
256
|
+
</Group>
|
|
257
|
+
|
|
258
|
+
{encounter && (
|
|
259
|
+
<ConditionList
|
|
260
|
+
patient={patient}
|
|
261
|
+
encounter={encounter}
|
|
262
|
+
conditions={conditions}
|
|
263
|
+
setConditions={setConditions}
|
|
264
|
+
onDiagnosisChange={handleDiagnosisChange}
|
|
265
|
+
/>
|
|
266
|
+
)}
|
|
267
|
+
|
|
268
|
+
{chargeItems && (
|
|
269
|
+
<ChargeItemList
|
|
270
|
+
patient={patient}
|
|
271
|
+
encounter={encounter}
|
|
272
|
+
chargeItems={chargeItems}
|
|
273
|
+
updateChargeItems={updateChargeItems}
|
|
274
|
+
/>
|
|
275
|
+
)}
|
|
276
|
+
</Stack>
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const createDiagnosisArray = (conditions: Condition[]): ClaimDiagnosis[] => {
|
|
281
|
+
return conditions.map((condition, index) => {
|
|
282
|
+
const icd10Coding = condition.code?.coding?.find((c) => c.system === `${HTTP_HL7_ORG}/fhir/sid/icd-10-cm`);
|
|
283
|
+
return {
|
|
284
|
+
diagnosisCodeableConcept: {
|
|
285
|
+
coding: icd10Coding
|
|
286
|
+
? [
|
|
287
|
+
{
|
|
288
|
+
...icd10Coding,
|
|
289
|
+
system: `${HTTP_HL7_ORG}/fhir/sid/icd-10`,
|
|
290
|
+
},
|
|
291
|
+
]
|
|
292
|
+
: [],
|
|
293
|
+
},
|
|
294
|
+
sequence: index + 1,
|
|
295
|
+
type: [{ coding: [{ code: index === 0 ? 'principal' : 'secondary' }] }],
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
};
|