{"id":47923573,"url":"https://github.com/vintasoftware/vintasend-medplum-example","last_synced_at":"2026-04-04T06:22:07.408Z","repository":{"id":334386758,"uuid":"1138354659","full_name":"vintasoftware/vintasend-medplum-example","owner":"vintasoftware","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-26T06:30:55.000Z","size":620,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-26T11:33:39.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vintasoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-20T15:10:36.000Z","updated_at":"2026-02-26T06:30:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vintasoftware/vintasend-medplum-example","commit_stats":null,"previous_names":["vintasoftware/vintasend-medplum-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vintasoftware/vintasend-medplum-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fvintasend-medplum-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fvintasend-medplum-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fvintasend-medplum-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fvintasend-medplum-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vintasoftware","download_url":"https://codeload.github.com/vintasoftware/vintasend-medplum-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fvintasend-medplum-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31389812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T06:22:05.395Z","updated_at":"2026-04-04T06:22:07.380Z","avatar_url":"https://github.com/vintasoftware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eMedplum Provider with VintaSend Integration\u003c/h1\u003e\n\u003cp align=\"center\"\u003eA healthcare application demonstrating email notifications and file attachments using VintaSend and Medplum.\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/medplum/medplum-hello-world/blob/main/LICENSE.txt\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache-blue.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis application is based on [Medplum Provider](https://github.com/medplum/medplum-provider) and extends it with a comprehensive email notification system built using [VintaSend](https://github.com/vintasoftware/vintasend) and [VintaSend-Medplum](https://github.com/vintasoftware/vintasend-medplum).\n\n## Key Features\n\n### 🔔 Email Notifications with VintaSend\n\n- **Automated Task Assignment Emails**: Practitioners receive email notifications when assigned tasks\n- **Priority-Based Notifications**: Urgent tasks trigger special \"URGENT\" email subject lines\n- **Personalized Content**: Emails include practitioner names, task details, and requester information\n- **FHIR-Native Storage**: All notifications stored as FHIR `Communication` resources for full auditability\n- **Flexible Email Providers**: Mailgun integration with easy adapter swapping\n\n### 📎 File Attachment Management\n\n- **FHIR-Compliant Storage**: Files stored as `Binary` and `Media` resources following FHIR standards\n- **Automatic Deduplication**: Files with identical content stored once via checksum\n- **Email Attachments**: Files attached to tasks are automatically included in notification emails\n- **Type \u0026 Size Validation**: Support for PDFs, images, Office documents with configurable size limits\n- **Download \u0026 Preview**: UI for managing file attachments on tasks\n\n### 🏥 Healthcare Workflows\n\nThe application demonstrates the following core workflows:\n\n- **Task Creation and Assignment** with email notifications and file attachments\n- Visit documentation\n- Appointment scheduling\n- Patient registration/onboarding\n- Lab orders\n- Ordering medications\n- Claim creation and billing\n- Patient/Provider Messaging\n\n### 🛠️ Technical Implementation\n\n- [Medplum React Components](https://storybook.medplum.com/?path=/docs/medplum-introduction--docs) for healthcare UI\n- [Medplum GraphQL](https://graphiql.medplum.com/) queries for linked resources\n- [VintaSend](https://github.com/vintasoftware/vintasend) notification framework\n- [VintaSend-Medplum](https://github.com/vintasoftware/vintasend-medplum) FHIR adapters\n- Medplum Bots with FHIR Subscriptions for automated workflows\n- Pug templates compiled to JSON for email rendering\n\n### Getting Started\n\n#### Prerequisites\n\n- Node.js 18+ and npm installed\n- A [Medplum project](https://www.medplum.com/docs/tutorials/register) to store your data\n- A [Mailgun account](https://mailgun.com/) with API key for email delivery\n\n#### Installation\n\n[Fork](https://github.com/medplum/medplum-provider/fork) and clone the repo.\n\nInstall the dependencies:\n\n```bash\nnpm install\n```\n\n#### Environment Configuration\n\nCreate a `.env` file in the root directory with the following variables:\n\n```bash\n# Medplum Configuration\nMEDPLUM_BASE_URL=https://api.medplum.com\nMEDPLUM_CLIENT_ID=your-client-id-here\nMEDPLUM_CLIENT_SECRET=your-client-secret-here\n\n# Mailgun Configuration\nMAILGUN_API_KEY=your-mailgun-api-key-here\nMAILGUN_DOMAIN=yourdomain.com\nMAILGUN_FROM_EMAIL=noreply@yourdomain.com\nMAILGUN_FROM_NAME=BYour App Namea\n\n# Application Configuration\nPROVIDER_APP_BASE_URL=https://your-app-url.com\n```\n\n\u003e **Note**: Copy `.env.example` to `.env` and fill in your actual values. Never commit `.env` to version control.\n\n#### Build and Deploy Bots\n\nCompile notification templates and build bots:\n\n```bash\nnpm run bots:build\n```\n\nDeploy bots to Medplum (creates bots and subscriptions):\n\n```bash\nnpm run bots:deploy\n```\n\n#### Run the Application\n\nStart the development server:\n\n```bash\nnpm run dev\n```\n\nThe app should run on `http://localhost:3000/`\n\n### Project Structure\n\n```\nbots/\n  task-assignment-bot.ts          # Main bot triggered by task assignments\n  services/\n    emails/\n      send-task-assignment-email.ts  # Email notification service\nlib/\n  notification-service.ts          # VintaSend configuration\n  file-upload.ts                   # File attachment utilities\n  medplum-singleton.ts             # Shared Medplum client\n  patients.ts                      # Name formatting helpers\nnotification-templates/\n  emails/\n    task-assignment/\n      body.html.pug                # Email body template\n      subject.txt.pug              # Email subject template\nsrc/\n  components/\n    tasks/\n      TaskFileUpload.tsx           # File upload component\n      TaskAttachmentList.tsx       # Attachment list component\n```\n\n### How It Works\n\n#### Task Assignment Workflow\n\n1. **Task Created/Updated**: A practitioner is assigned to a FHIR `Task` resource\n2. **Subscription Triggers**: Medplum subscription evaluates criteria (`Task?owner:exists=true`)\n3. **Bot Executes**: Task assignment bot runs automatically\n4. **Data Enrichment**: Service fetches practitioner details, task attachments, and requester info\n5. **Email Sent**: VintaSend renders Pug templates and sends email via Mailgun\n6. **Notification Stored**: Email record saved as FHIR `Communication` resource\n\n#### File Attachment Workflow\n\n1. **File Upload**: User uploads file via `TaskFileUpload` component\n2. **FHIR Storage**: File stored as `Binary` resource, metadata as `Media` resource\n3. **Task Association**: Media reference added to task's `input` array\n4. **Email Inclusion**: Attachments automatically included in notification emails\n5. **Deduplication**: Identical files (by checksum) stored only once\n\n### Learn More\n\nFor a comprehensive tutorial on implementing email notifications and file attachments, see:\n- [TUTORIAL_EMAIL_NOTIFICATIONS.md](TUTORIAL_EMAIL_NOTIFICATIONS.md) - Complete walkthrough with code examples\n\n### About Medplum\n\n[Medplum](https://www.medplum.com/) is an open-source, API-first EHR. Medplum makes it easy to build healthcare apps quickly with less code.\n\nMedplum supports self-hosting and provides a [hosted service](https://app.medplum.com/).\n\n- Read our [documentation](https://www.medplum.com/docs)\n- Browse our [react component library](https://storybook.medplum.com/)\n- Join our [Discord](https://discord.gg/medplum)\n\n### About VintaSend\n\n[VintaSend](https://github.com/vintasoftware/vintasend) is a flexible TypeScript notification framework designed for transactional notifications in modern applications.\n\n**Key Benefits:**\n- 📦 Database-backed notification management with full audit trail\n- 📅 Smart scheduling with context fetched at send-time\n- 📎 File attachment support with automatic deduplication\n- 🔧 Modular architecture - swap databases, email providers, or template engines independently\n- 🏥 Healthcare-ready with FHIR compliance via VintaSend-Medplum\n\nLearn more:\n- [VintaSend Documentation](https://github.com/vintasoftware/vintasend)\n- [VintaSend-Medplum Adapters](https://github.com/vintasoftware/vintasend-medplum)\n\n## License\n\nApache 2.0 - See [LICENSE](LICENSE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvintasoftware%2Fvintasend-medplum-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvintasoftware%2Fvintasend-medplum-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvintasoftware%2Fvintasend-medplum-example/lists"}