ความสามารถของ MEDband
MEDband คือแพลตฟอร์มระบุตัวตนทางการแพทย์ฉุกเฉินผ่าน QR Code — ออกแบบมาเพื่อให้การช่วยเหลือในสถานการณ์ฉุกเฉินรวดเร็วและแม่นยำยิ่งขึ้น ด้วยข้อมูลทางการแพทย์ที่เข้าถึงได้ทันทีผ่านการสแกน QR Code
MEDband is an emergency medical identification platform powered by QR codes — designed to make emergency response faster and more accurate with instant access to critical medical information.
ภาพรวมแพลตฟอร์ม / Platform Overview
MEDband ให้บริการเต็มรูปแบบสำหรับการจัดการข้อมูลทางการแพทย์ฉุกเฉิน
โปรไฟล์ทางการแพทย์Medical Profile
โปรไฟล์สุขภาพส่วนบุคคลที่สมบูรณ์แบบ — เก็บข้อมูลชื่อ-สกุล, กรุ๊ปเลือด, ส่วนสูง, น้ำหนัก, วันเกิด, สัญชาติ, ศาสนา และข้อมูลติดต่อ พร้อมรูปโปรไฟล์
Complete personal health profile — store full name, blood type, height, weight, birthdate, nationality, religion, and contact details with a profile photo.
- ✓ข้อมูลส่วนตัวครบถ้วน: ชื่อ, เพศ, กรุ๊ปเลือด, วันเกิด, ส่วนสูง, น้ำหนักComplete profile: name, gender, blood type, DOB, height, weight
- ✓ประวัติโรคประจำตัว: โรคเบาหวาน, ความดัน, โรคหัวใจ และอื่นๆDisease history: diabetes, hypertension, heart conditions, and more
- ✓ประวัติการผ่าตัดและการฉีดวัคซีนSurgery and vaccination history
- ✓ประวัติการแพ้ยา, แพ้อาหาร, แพ้วัตถุ/สารDrug, food, and substance allergies
- ✓ข้อมูลประกันสุขภาพ: ผู้ให้บริการ, เลขกรมธรรม์, วันหมดอายุInsurance information: provider, policy number, expiry date
- ✓บันทึกส่วนตัวเพิ่มเติม (เช่น "ฉันใส่เครื่องกระตุ้นหัวใจ")Additional personal notes (e.g. 'I have a pacemaker')
ระบบ QR CodeQR Code System
ทุกกำไล MEDband มี QR Code ไม่ซ้ำกัน 14 ตัวอักษร (nanoid) — เมื่อมีเหตุฉุกเฉิน เจ้าหน้าที่เพียงสแกน QR Code ก็สามารถเข้าถึงข้อมูลทางการแพทย์ที่สำคัญได้ทันที
Every MEDband wristband has a unique 14-character nanoid QR code. In an emergency, first responders simply scan the QR code to instantly access critical medical information.
- ✓QR Code ไม่ซ้ำกัน สร้างด้วย nanoid 14 ตัวอักษรUnique QR codes generated with 14-character nanoid
- ✓QR Code 3 ประเภท: DOG_TAG (บุคคล), ORG (องค์กร), VIRTUAL (องค์กรออกให้)3 QR code types: DOG_TAG (individual), ORG (organization), VIRTUAL (org-issued)
- ✓ระบบวงจรชีวิต: Issued → Activating → Activated / Prefilled / DeactivatedLifecycle: Issued → Activating → Activated / Prefilled / Deactivated
- ✓สร้าง QR Code แบบเดี่ยวหรือแบบกลุ่ม (bulk)Single and bulk QR code generation
- ✓หน้าฉุกเฉินสาธารณะที่ /a/{code} — เข้าถึงได้โดยไม่ต้องล็อกอินPublic emergency view at /a/{code} — no login required
- ✓ผู้ใช้สามารถ claim กำไลผ่าน /c/{code}Users claim their band via /c/{code}
ระบบติดตามการรับประทานยาMedication Tracking & Reminders
ผู้ใช้สามารถเพิ่มยาที่รับประทาน พร้อมกำหนดขนาดยา (dosage), หน่วย, ความถี่ในการรับประทาน (เช่น วันละ 3 ครั้ง), เงื่อนไข (ก่อน/หลังอาหาร) และตั้งเวลาแจ้งเตือน
Users can add medications with dosage amount, unit, frequency (e.g. 3 times daily), conditions (before/after meals), and set reminder times.
- ✓เพิ่มยาพร้อมขนาดยา, หน่วย, ความถี่ (TID/BID/OD) และเงื่อนไขการรับประทานAdd medications with dosage, unit, frequency (TID/BID/OD), and conditions
- ✓ตั้งเวลาแจ้งเตือน — ส่งผ่าน LINE MessagingReminder scheduling — delivered via LINE Messaging
- ✓ระบบติดตามการรับประทาน: บันทึกการรับประทาน/พลาดรับประทาน พร้อมเวลาที่แน่นอนDose tracking: record doses as taken/missed with timestamps
- ✓หน้าแสดงยาที่ต้องรับประทานวันนี้ (Today's Doses)Today's doses view showing upcoming scheduled doses
- ✓สถิติการรับประทานยาต่อเนื่อง (Adherence Statistics & Streaks)Adherence statistics and streak tracking
- ✓ระบบยืนยันการรับประทานยาผ่าน LINE Deep LinkDose confirmation via LINE deep-link flow
ระบบตรวจสอบความปลอดภัยของยาDrug Safety Checking
ระบบตรวจสอบปฏิกิริยาระหว่างยา (drug-drug interaction) และการละเมิดกฎการรับประทานยา (timing rule violations) — ตรวจจับความเสี่ยงการใช้ยาเกินขนาดและแจ้งเตือนตามระดับความรุนแรง
System checks drug-drug interactions and timing rule violations — detects overdose risks with severity-based warnings.
- ✓ตรวจจับปฏิกิริยาระหว่างยาจากฐานข้อมูล pairwise interactionsDrug-drug interaction detection from pairwise interaction database
- ✓ตรวจจับการละเมิดกฎ: ปริมาณสูงสุดต่อวัน, ปริมาณสูงสุดต่อน้ำหนักตัว, ระยะห่างขั้นต่ำระหว่างมื้อTiming rule violations: max daily doses, max per body weight, min hours between doses
- ✓ระดับความรุนแรง: critical, serious, moderate, minorSeverity levels: critical, serious, moderate, minor
- ✓ระดับหลักฐาน: established, probable, suspected, possibleEvidence levels: established, probable, suspected, possible
- ✓แจ้งเตือนผ่านในแอพ (DrugSafetyModal, DrugWarningsBanner)In-app alerts (DrugSafetyModal, DrugWarningsBanner)
- ✓แจ้งเตือนผ่าน LINE พร้อมระบบ throttle 24 ชม. ป้องกัน spamLINE notifications with 24-hour cooldown throttle to prevent spam
LINE IntegrationLINE Messaging Integration
MEDband เชื่อมต่อกับ LINE อย่างลึกซึ้ง — ผู้ใช้สามารถล็อกอินด้วย LINE, รับการแจ้งเตือนเมื่อมีคนสแกน QR Code, รับการแจ้งเตือนการรับประทานยา, และรับคำเตือนความปลอดภัยของยาผ่าน LINE
Deep LINE integration — login with LINE, receive scan notifications, medication reminders, and drug safety alerts via LINE Messaging.
- ✓LINE OAuth Login — เข้าสู่ระบบด้วยบัญชี LINELINE OAuth Login for authentication
- ✓แจ้งเตือนเมื่อมีคนสแกน QR Code (จำกัด 1 ครั้ง/ผู้สแกน/20 นาที)Scan notification to LINE (rate limited: 1 per caller per 20 minutes)
- ✓แจ้งเตือนการรับประทานยาผ่าน LINE Flex MessagesMedication reminders via LINE Flex Messages
- ✓คำเตือนความปลอดภัยของยาส่งผ่าน LINEDrug safety warnings pushed to LINE
- ✓แจ้งเตือนให้อัพเดทโปรไฟล์ผ่าน LINEProfile update reminders via LINE
- ✓เชื่อมต่อ/ยกเลิกบัญชี LINE แยกตาม QR CodeLINE account linking/disconnecting per QR code
ระบบองค์กรOrganization System
พอร์ทัลสำหรับองค์กร (บริษัท, โรงเรียน, หน่วยงาน) — จัดการสมาชิกด้วยเลขบัตรประชาชน 13 หลัก, กำหนด quota ผู้ใช้, จัดการสมาชิกแบบกลุ่ม และรองรับการทำงานพร้อมกันอย่างปลอดภัย (race condition protection)
Organization portal for companies, schools, and institutions — manage members by 13-digit Thai national ID, set user quotas, bulk member management with concurrency-safe enrollment.
- ✓พอร์ทัลสำหรับองค์กรที่ /e/{orgCode}Organization portal at /e/{orgCode}
- ✓ระบุสมาชิกด้วยเลขบัตรประชาชน 13 หลัก เชื่อมกับ QR CodeMembers identified by 13-digit Thai national ID mapped to QR codes
- ✓กำหนด User Quota ต่อองค์กรPer-organization user quota enforcement
- ✓ค้นหาและจัดการสมาชิกแบบแบ่งหน้า (pagination)Member management with search and pagination
- ✓ย้ายสมาชิกองค์กรเป็นบัญชี DOG_TAG ส่วนตัว (Member Migration)Member migration from org to standalone DOG_TAG accounts
- ✓ลบบัญชีสมาชิกองค์กรพร้อมล้างข้อมูลที่เกี่ยวข้องAccount deletion with cascading cleanup
- ✓ระบบลงทะเบียนแบบ concurrency-safe ด้วย database transactionsConcurrency-safe enrollment with database transactions
Admin PanelAdministration Panel
แผงควบคุมสำหรับผู้ดูแลระบบ — จัดการ QR Code, องค์กร, ความปลอดภัยของยา, ฐานข้อมูลยา, และแผนการสมัครสมาชิก
Full administrator control panel — manage QR codes, organizations, drug safety rules, medicine knowledge base, and subscription plans.
- ✓จัดการ QR Code: ค้นหา, กรองตามสถานะ, ดำเนินการแบบกลุ่มQR code management: search, filter by status, bulk operations
- ✓จัดการองค์กร: สร้าง/แก้ไข/ลบ, จัดการสมาชิก, กำหนด quotaOrganization management: CRUD, member management, quota enforcement
- ✓จัดการปฏิกิริยาระหว่างยา: เพิ่ม/แก้ไข/ลบ rulesDrug interaction CRUD: add/edit/delete interaction rules
- ✓จัดการกฎการรับประทานยา: กำหนด max dose, timing rulesTiming rule CRUD: max doses, timing restrictions
- ✓เชื่อมโยงยาผู้ใช้กับฐานข้อมูลยา (Drug Link Management)Drug link management: connect user drugs to medicine KB
- ✓ค้นหายาจากฐานข้อมูลกว่า 1,000 รายการMedicine KB browser: search 1,000+ medicines by name, class, OTC status
- ✓กำหนดและจัดการแผนการสมัครสมาชิกให้ผู้ใช้Subscription plan assignment (single user or bulk)
ระบบจัดการไฟล์และเอกสารFile & Document Management
ผู้ใช้สามารถแนบไฟล์เอกสารทางการแพทย์ (รูปภาพ, PDF) สำหรับทุกรายการประวัติสุขภาพ — โรคประจำตัว, การผ่าตัด, การแพ้ยา, วัคซีน, และบันทึกแพทย์
Users can attach medical documents (images, PDFs) to any health record — diseases, surgeries, allergies, medications, vaccinations, and doctor records.
- ✓อัพโหลดไฟล์แนบสำหรับทุกรายการประวัติสุขภาพFile attachments on all medical history records
- ✓จัดเก็บไฟล์บน Cloudflare R2 — ปลอดภัย เข้าถึงได้จากทุกที่Cloudflare R2 storage — secure, accessible anywhere
- ✓อัพโหลดรูปโปรไฟล์ผ่าน ImageKitProfile photo uploads via ImageKit
- ✓ระบบ quota ไฟล์: FREE สูงสุด 3 ไฟล์, PRO สูงสุด 10 ไฟล์File quota: FREE 3 files, PRO 10 files
- ✓Presigned URLs สำหรับอัพโหลด/ดาวน์โหลดอย่างปลอดภัยPresigned URLs for secure upload/download
- ✓File Viewer Modal และ Upload Image ModalFile Viewer Modal and Upload Image Modal
- ✓ส่งออกประวัติทางการแพทย์เป็น PDF (PrintableReport)PDF export of medical profile (PrintableReport)
- ✓ระบบขอความยินยอม PDPA พร้อมสำเนา PDF เก็บใน R2PDPA consent with archived PDF copy stored in R2
ความปลอดภัยและความเป็นส่วนตัวSecurity & Compliance
MEDband ปฏิบัติตาม พ.ร.บ.คุ้มครองข้อมูลส่วนบุคคล (PDPA) ของประเทศไทย — ข้อมูลทางการแพทย์ถูกเข้ารหัส, ระบบควบคุมการเข้าถึงแบบหลายชั้น, และการตรวจสอบสิทธิ์ผู้ใช้ทุกครั้ง
MEDband is fully compliant with Thailand's Personal Data Protection Act (PDPA) — encrypted medical data, multi-layer access control, and strict authorization on every request.
- ✓ยืนยันตัวตนผ่าน Google OAuth + LINE OAuth (NextAuth.js)Google OAuth + LINE OAuth authentication (NextAuth.js)
- ✓ระบบขอความยินยอม PDPA — ผู้ใช้ต้องยอมรับก่อนแก้ไขข้อมูลPDPA consent flow — users must agree before editing, archived copy stored
- ✓Authorization middleware: ตรวจสอบความเป็นเจ้าของทุกคำขอ, admin ยกเว้นAuthorization middleware: ownership checks on all mutations, admins bypass
- ✓การกรองข้อมูล: ผู้เข้าชมสาธารณะเห็นเฉพาะข้อมูลที่กำหนด visible=trueVisibility filters: public viewers only see visible=true records
- ✓ข้อมูล sensitive (userId, prefilledBy, pdpaCopyKey) ถูกลบจาก API สาธารณะSensitive fields nulled for public API responses
- ✓ตรวจสอบความถูกต้องของข้อมูลผ่าน Zod schemasInput validation via Zod schemas
- ✓ตรวจสอบประเภทไฟล์ด้วย MIME sniffingFile type validation with MIME sniffing
- ✓Rate limiting บน LINE notificationsRate limiting on LINE notifications
- ✓การเปรียบเทียบรหัสผ่านแบบ constant-time ป้องกัน timing attacksConstant-time secret comparison to prevent timing attacks
PWA และ MobileProgressive Web App & Mobile
MEDband เป็น Progressive Web App — ติดตั้งบนมือถือได้, ใช้งานได้แม้ไม่มีอินเทอร์เน็ต, รองรับ Dark Mode และออกแบบให้ตอบสนองทุกขนาดหน้าจอ
MEDband is a Progressive Web App — installable on mobile, works offline, supports dark mode, and fully responsive for all screen sizes.
- ✓PWA ผ่าน next-pwa — ติดตั้งได้บน Android/iOSPWA via next-pwa — installable on Android and iOS
- ✓รองรับการใช้งานแบบ offline — แสดงแบนเนอร์เมื่อไม่มีอินเทอร์เน็ตOffline support with banner when no internet connection
- ✓Dark Mode พร้อมระบบตรวจจับค่าจากเครื่องอัตโนมัติDark mode with automatic system preference detection
- ✓ออกแบบ Responsive รองรับทุกขนาดหน้าจอFully responsive design for all screen sizes
- ✓รองรับ Capacitor สำหรับ Android/iOS buildsCapacitor support for Android/iOS native builds
- ✓แบบอักษร Prompt (Google Fonts) สำหรับภาษาไทยPrompt Thai typeface via Google Fonts
สถาปัตยกรรมของระบบ / System Architecture
MEDband สร้างด้วยเทคโนโลยีทันสมัยที่เน้นความน่าเชื่อถือและความปลอดภัย
Built with modern, reliable, and security-focused technologies
Frontend
Next.js 14 + Tailwind CSS
- Pages Router
- tRPC v9 (type-safe API)
- next-auth
- PWA via next-pwa
- Prompt Thai font
Backend
Node.js + Prisma ORM
- PostgreSQL (Prisma Postgres)
- Zod validation
- Cloudflare R2 storage
- ImageKit CDN
- Node.js runtime
Integrations
LINE + Google + Twilio
- LINE Messaging API
- LINE Login (OAuth)
- Google OAuth 2.0
- Twilio SMS
- Ackee Analytics
DevOps
CI/CD + Monitoring
- Cloudflare Pages
- GitHub Actions (CI/CD)
- LogRocket monitoring
- Playwright E2E tests
- Vitest unit tests