A comprehensive medication management platform connecting patients and physicians through secure, FHIR-compliant healthcare data sharing.
MedSignal is a React Native mobile application that helps patients track their medications, maintain adherence, and seamlessly share health data with their physicians. Built with healthcare interoperability standards and enterprise-grade security, MedSignal bridges the gap between personal medication management and professional healthcare oversight.
MedSignal is a dual-interface healthcare application designed for two distinct user roles:
A personal medication assistant that:
- Tracks your medications and schedules with intelligent reminders
- Analyzes prescription photos using AI to automatically extract medication details
- Monitors your medication adherence and provides insights
- Connects you with trusted contacts (family/caregivers) for support
- Enables secure data sharing with your healthcare providers
- Helps you find nearby pharmacies and healthcare services
- Provides medication alternatives and detailed drug information
A practice management dashboard that:
- Monitors patient medication adherence in real-time
- Manages patient lists with comprehensive health metrics
- Sends prescription requests directly to patients
- Tracks key performance indicators (7-day, 30-day adherence rates)
- Connects with patients through secure QR code pairing
- Accesses FHIR-compliant patient medication data
- Smart Entry System: Add medications manually with autocomplete powered by NIH drug database
- AI Prescription Scanning: Take a photo of your prescription bottle or label, and OpenAI Vision API automatically extracts:
- Medication name
- Dosage strength
- Quantity
- Instructions
- Flexible Scheduling: Set custom medication times (e.g., 8:00 AM, 12:00 PM, 8:00 PM)
- Visual Organization: See all your medications in a clean, organized list with edit/delete capabilities
- Push Notifications: Timely medication reminders delivered as notifications
- Interactive Actions: Respond directly from notifications:
- β Taken: Mark medication as taken
- β° Snooze: Reminder reappears in 10 minutes
- β Skip: Mark as intentionally skipped
- Custom Sounds: Distinctive notification sounds for medication alerts
- Persistent Reminders: Notifications work even when app is closed
- Visual Analytics: See your medication compliance at a glance
- Historical Trends: Track adherence over 7-day and 30-day periods
- Per-Medication Stats: Individual compliance metrics for each medication
- Streak Tracking: Monitor consecutive days of perfect adherence
- Add Caregivers: Invite family members or friends to help monitor your medications
- Accountability Support: Trusted contacts can receive adherence updates (feature in development)
- Emergency Access: Designated contacts for healthcare emergencies
- Easy Management: Add, edit, or remove trusted contacts anytime
- Physician Integration: Receive prescription requests from your doctors
- One-Tap Acceptance: Accept requests to automatically add medications to your tracking
- Request History: View all past and pending prescription requests
- Notification Alerts: Get notified when physicians send new prescriptions
- QR Code Pairing: Scan your physician's QR code to establish secure connection
- Secure Data Sharing: Share medication data using FHIR healthcare standards
- Privacy Controls: Choose what data to share and with whom
- Connection Management: View and manage all physician connections
- Nearby Pharmacies: Find pharmacies near your current location
- Healthcare Providers: Locate doctors, clinics, and hospitals
- Interactive Map: Visual map interface powered by React Native Maps
- Navigation Integration: Get directions to selected locations
- Medication Alternatives: Find generic or alternative medications
- Drug Details: Access comprehensive medication information
- Cost Comparisons: View pricing information for alternatives
- Side Effects: Understand potential side effects and interactions
- Real-time KPIs: Monitor key metrics at a glance:
- Total active patients
- Patients seen today
- Average 7-day adherence across practice
- Average 30-day adherence across practice
- Animated Statistics: Engaging number animations for metric updates
- Professional Interface: Clean, medical-grade user experience
- Comprehensive Patient List: View all patients with:
- Name and contact information
- Current medications
- Adherence rates (7-day and 30-day)
- Last visit date
- Risk indicators
- Detailed Patient Profiles: Deep dive into individual patient data:
- Complete medication history
- Adherence trends and patterns
- Prescription request history
- Trusted contacts information
- Search and Filter: Quickly find patients or filter by adherence level
- Send Prescriptions: Create and send prescription requests to patients
- Request Tracking: Monitor which prescriptions have been accepted/declined
- Medication Details: Specify dosage, frequency, and duration
- Patient Notifications: Patients receive instant alerts for new prescriptions
- Secure Pairing: Generate unique QR codes for patient connections
- Session-based Security: QR codes expire after use for enhanced security
- Easy Onboarding: Patients simply scan to connect with your practice
- No Manual Entry: Eliminates errors from manual ID entry
- Adherence Trends: Identify patients who need additional support
- Practice Performance: Track overall practice medication compliance
- Risk Stratification: Flag patients with declining adherence
- Data-driven Care: Make informed decisions based on real medication data
- JWT Token System: Industry-standard JSON Web Tokens for authentication
- Access tokens (1-hour expiration)
- Refresh tokens (7-day expiration)
- Role-based Access Control: Strict separation between patient and physician interfaces
- Secure Password Storage: Argon2 and bcrypt hashing algorithms
- Session Management: Persistent, encrypted sessions with automatic cleanup
- Encrypted Storage: All sensitive data encrypted using Expo SecureStore
- HTTPS Communication: All API calls encrypted in transit
- Token Isolation: Separate storage for access/refresh tokens (2KB limit compliance)
- Automatic Session Validation: Corrupted sessions automatically cleared
- FHIR R4 Standard: Full compliance with healthcare interoperability standards
- Medplum Integration: Professional healthcare data platform integration
- HIPAA-ready Architecture: Built with healthcare privacy regulations in mind
- Audit Logging: Comprehensive logging for security and compliance
- Bearer Token Authentication: RFC 6750 compliant token handling
- CORS Protection: Configured cross-origin resource sharing
- Request Validation: Server-side validation of all API requests
- Rate Limiting: Protection against API abuse (ready for production)
- React Native 0.81.4: Cross-platform mobile development
- Expo ~54.0.10: Managed workflow with powerful SDKs
- TypeScript: Full type safety and developer experience
- React Navigation 7: Role-based navigation system
- Expo Notifications: Rich push notification system
- Expo Camera: QR code scanning capabilities
- React Native Maps: Location services and map display
- Node.js with Express 5.1.0: RESTful API server
- Better-SQLite3: Fast, embedded database
- JWT & Jose: Token generation and validation
- Argon2/Bcrypt: Password hashing algorithms
- Medplum Client: FHIR healthcare data integration
- OpenAI API: AI-powered prescription image analysis
- CORS Middleware: Secure cross-origin handling
- FHIR R4: Healthcare interoperability standard
- Medplum Platform: Professional FHIR server
- Patient Resources: Standardized patient data format
- MedicationStatement: FHIR medication tracking
- RxNorm Coding: Standardized medication identifiers
- NIH Drug API: Medication autocomplete and information
- OpenAI Vision API: Prescription image analysis
- Medplum FHIR Server: Healthcare data sync and storage
- Expo Push Notifications: Cloud notification delivery
- Node.js 16 or higher
- npm or yarn package manager
- Expo CLI (installed automatically with dependencies)
- iOS Simulator (Mac) or Android Emulator, or physical device
- Expo Go app (for device testing)
-
Clone the repository:
git clone <repository-url> cd HackGT12_Attempt2
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
Configure your
.envfile with:MEDPLUM_BASE: Medplum FHIR server URLMEDPLUM_CLIENT_ID: Your Medplum client IDMEDPLUM_CLIENT_SECRET: Your Medplum client secretOPENAI_API_KEY: OpenAI API key for prescription scanningPORT: Backend server port (default: 3000)
npm run dev-separatenpm run dev-separate-macnpm run dev-separate-linuxnpm run devThese commands will:
- Start the backend server on port 3000
- Launch the Expo development server
- Open the Expo DevTools in your browser
- Install Expo Go from App Store (iOS) or Play Store (Android)
- Scan the QR code displayed in the terminal
- App will load on your device
npm run iosnpm run android- Launch App: Open MedSignal
- Choose Role: Select "Patient"
- Create Account: Sign up with email and password
- Grant Permissions: Allow notifications and camera access
Manual Entry:
- Navigate to "Medication Entry" tab
- Tap in the medication name field
- Start typing - autocomplete suggestions appear
- Select your medication from the list
- Enter dosage (e.g., "500 mg")
- Set quantity on hand
- Choose times per day (1-6)
- Set specific times for each dose
- Tap "Save Medication"
AI Prescription Scanning:
- Navigate to "Medication Entry" tab
- Tap "π· Scan Prescription" button
- Choose "Take Photo" or "Choose from Library"
- Take a clear photo of your prescription label
- AI extracts medication details automatically
- Review and adjust any details if needed
- Tap "Save Medication"
- Edit: Tap medication card, modify details, save changes
- Delete: Swipe left on medication or tap delete button
- View Schedule: See all doses in the Adherence tab
- Mark as Taken: Tap checkmark when you take medication
When a notification appears:
- Taken: Tap to mark as taken (tracks adherence)
- Snooze: Reminds you again in 10 minutes
- Skip: Mark as intentionally skipped (affects adherence)
- Navigate to "Adherence" tab
- View overall adherence percentage
- See per-medication compliance
- Check 7-day and 30-day trends
- Identify missed doses
- Visit your physician's office
- Ask to scan their MedSignal QR code
- Open "Share" tab in app
- Tap "Scan Physician QR Code"
- Allow camera access and scan code
- Confirm connection
- Your medication data is now securely shared
- Receive notification of new prescription
- Tap notification or open "Prescription Requests" from home
- Review medication details from physician
- Tap "Accept" to add to your tracking
- Or "Decline" if incorrect/unwanted
- Navigate to "Trusted Contacts" from home screen
- Tap "Add Trusted Contact"
- Enter contact information:
- Name
- Relationship (spouse, parent, child, friend, caregiver)
- Phone number
- Tap "Save Contact"
- Contact is added to your support network
- Launch App: Open MedSignal
- Choose Role: Select "Physician"
- Create Account: Sign up with credentials
- Access Dashboard: View practice overview
- Total Patients: See total active patient count
- Seen Today: Patients with activity today
- 7-Day Adherence: Average compliance last week
- 30-Day Adherence: Average compliance last month
- From dashboard, tap "View All Patients"
- Browse patient list with adherence indicators
- Tap patient card to view details
- Review:
- Current medications
- Adherence rates
- Medication history
- Risk indicators
- Navigate to "QR Code" tab
- Display your unique QR code
- Have patient scan code with their device
- Connection established automatically
- Patient data becomes accessible
- Open patient detail screen
- Tap "Send Prescription"
- Enter medication details:
- Drug name
- Dosage
- Frequency
- Duration
- Tap "Send to Patient"
- Patient receives notification instantly
- Track acceptance status
- Green indicators: High adherence (>80%)
- Yellow indicators: Moderate adherence (60-80%)
- Red indicators: Low adherence (<60%)
- Detailed view: Tap patient for daily logs
npm run backend # Run backend server only
npm start # Run Expo frontend only
npm run dev # Run both (single terminal)
npm run dev-separate # Run both (Windows, separate windows)
npm run dev-separate-mac # Run both (macOS, separate terminals)
npm run smoke:share # Run security test suitenpm run smoke:shareValidates:
- JWT token generation
- Bearer authentication
- API security
- BOLA/IDOR protection
node initialize-db.js # Initialize database
node migrate-*.js # Run migrations
node test-*.js # Test database operationsHackGT12_Attempt2/
βββ App.tsx # Main app entry point
βββ server.js # Backend Express server
βββ database.js # Database operations
βββ medsignal.db # SQLite database
βββ package.json # Dependencies
βββ app.json # Expo configuration
β
βββ src/
β βββ auth/ # Authentication system
β β βββ AuthContext.tsx # Auth state management
β β βββ RoleGuard.tsx # Role-based routing
β β βββ session.ts # SecureStore session management
β β
β βββ components/ # Reusable components
β β βββ AuthFlow.tsx # Auth navigation
β β βββ DrugSearchField.tsx # Medication autocomplete
β β βββ QRScanner.tsx # QR code scanner
β β βββ ...
β β
β βββ screens/ # App screens
β β βββ HomeScreen.tsx # Patient home
β β βββ MedicationEntryScreen.tsx
β β βββ AdherenceScreen.tsx
β β βββ PhysicianDashboard.tsx
β β βββ PatientsList.tsx
β β βββ ...
β β
β βββ navigators/ # Navigation setup
β β βββ PatientNavigator.tsx
β β βββ PhysicianNavigator.tsx
β β
β βββ services/ # External services
β β βββ openaiVision.ts # Prescription scanning
β β βββ physicianApi.ts # Backend API calls
β β βββ ...
β β
β βββ notifications/ # Notification system
β βββ actions.ts # Channel setup
β βββ responseHandler.ts # Action handlers
β
βββ scripts/ # Utility scripts
βββ docs/ # Documentation
βββ assets/ # Images and sounds
# Medplum FHIR Integration
MEDPLUM_BASE=https://api.medplum.com/fhir/R4
MEDPLUM_CLIENT_ID=your_client_id
MEDPLUM_CLIENT_SECRET=your_client_secret
# OpenAI Integration
OPENAI_API_KEY=your_openai_api_key
# Server Configuration
PORT=3000
JWT_SECRET=your_secure_jwt_secret
# Environment
NODE_ENV=development- App Name: HackGT12_Attempt2
- Bundle ID: com.medsignal.app
- Permissions: Camera, Notifications, Location
- Plugins: Notifications, SecureStore, Barcode Scanner
- AI-Powered: First medication app with prescription scanning using OpenAI Vision
- FHIR Compliant: Built on healthcare interoperability standards from day one
- Dual Interface: Seamlessly connects patients and physicians in one platform
- Adherence Focus: Not just tracking, but actionable compliance insights
- Enterprise Security: JWT authentication, encrypted storage, role-based access
- Interactive Notifications: Respond to reminders without opening app
- Trusted Contacts: Family support network built into the platform
- Professional Grade: Healthcare provider dashboard with real analytics
- Family dashboard for trusted contacts
- Apple Health & Google Fit integration
- Medication interaction warnings
- Refill reminders and pharmacy integration
- Telemedicine appointment scheduling
- Multi-language support
- Wearable device integration (Apple Watch, Fitbit)
- Voice-activated medication logging
- Insurance and cost optimization
- Medication disposal guidance
- Clinical trial matching
- Patient education videos
- Social features (community support)
Copyright Β© 2025 MedSignal. All rights reserved.
MedSignal is a healthcare application handling sensitive medical data. Contributions must maintain:
- HIPAA compliance considerations
- FHIR standard adherence
- Security best practices
- Comprehensive testing
- Check troubleshooting section in docs
- Review error logs in server-log.txt
- Verify environment configuration
- Medplum documentation: https://www.medplum.com/docs
- FHIR specification: https://www.hl7.org/fhir/
Notifications not working:
- Grant notification permissions in device settings
- Ensure backend server is running
- Check notification channel setup (Android)
QR code scanning not working:
- Grant camera permissions
- Ensure adequate lighting
- Hold camera steady over QR code
Backend connection failed:
- Verify backend is running on port 3000
- Check
EXPO_PUBLIC_BACKEND_URLenvironment variable - Ensure device/emulator is on same network
Built with:
- React Native & Expo for cross-platform development
- Medplum for FHIR healthcare data management
- OpenAI for AI-powered prescription scanning
- NIH for comprehensive drug information database
- The open-source community for incredible tools and libraries
MedSignal - Empowering patients and physicians through intelligent medication management π₯π