IoT & HardwareMOGI ALTIGAH

Wasfty — Automated Medication Dispensing

A self-service pharmacy kiosk that replaces traditional pharmacy counters with vending machines. Integrated with Saudi Arabia’s national Wasfaty (NUPCO) e-Prescribing platform. Patients scan a QR code or enter a prescription reference number, and the machine automatically dispenses their medications with printed labels — no pharmacist counter needed.

KotlinJetpack ComposeAndroidYS Vending SDKWebSocketRetrofitRoom DBQR CodeESC/POS PrinterWasfaty NUPCO APIsREST APIs

Key Highlights

1

Full 9-step Wasfaty dispensing cycle: download eRx, trade advisor, patient history, payer authorization, claim submission

2

YS Spring Vending Machine platform with 15–21″ capacitive touchscreen, QR scanner, spring motor dispensers, and drop sensors

3

Android kiosk app built with Kotlin + Jetpack Compose running on YS 5″ mainboard

4

Bilingual UI (Arabic/English) with real-time language toggle for patient interaction

5

QR code scanning + manual reference number entry with National ID for prescription lookup

6

Prescription preview screen showing patient details, prescribing hospital, available medications with dosage and quantities

7

Automated spring motor dispensing with per-slot infrared drop detection to verify delivery

8

Thermal label printing (ESC/POS) with medication name, dosage, and instructions in Arabic + English

9

Admin panel with PIN-protected access: lift control, door/partition toggles, LED/heating controls, slot configuration (spring/belt), merge/split slots, factory reset

10

Backend integration via WebSocket for real-time heartbeat, inventory sync, and transaction reporting

11

Offline mode with local caching and automatic retry when connectivity is restored

12

SFDA, NHIC, SCFHS regulatory compliance for medication dispensing in Saudi Arabia

Kiosk Walkthrough10 Screens

1Welcome & QR Scan(2)2Prescription Preview(1)3Processing & Authorization(1)4Dispensing Medications(1)5Completion & Collection(2)6Admin Panel(3)
1

Welcome & QR Scan

The kiosk greets patients with the Wasfaty (وصفتي) bilingual logo and “Welcome to Self-Service Pharmacy.” The header bar shows the machine ID (VM-XYS-001), location (Riyadh Central Mall — Floor 1), online status, and last sync time. Patients scan their prescription QR code using the built-in 2D barcode scanner, or manually enter the Reference Number from their SMS along with their National ID.

PHARMACY KIOSK
Welcome — QR Scan & Manual Entry
QR SCANNER
COLLECT

Welcome — QR Scan & Manual Entry

PHARMACY KIOSK
Scanning Prescription
QR SCANNER
COLLECT

Scanning Prescription

#Screen
1Welcome — QR Scan & Manual Entry
2Scanning Prescription
2

Prescription Preview

After scanning, the system downloads the e-prescription from the Wasfaty Hub and displays full details: patient name (masked for privacy), National ID, prescribing date, hospital (e.g. King Fahad Hospital), and number of available medications. Each medication card shows the drug name (e.g. Panadol Extra 500mg), form (Tablet), dosage (500mg, Oral), quantity (1 box), and availability status with a green checkmark. The patient confirms with “Confirm & Dispense.”

PHARMACY KIOSK
Prescription Details & Medications
QR SCANNER
COLLECT

Prescription Details & Medications

#Screen
1Prescription Details & Medications
3

Processing & Authorization

The system processes the prescription through the full Wasfaty 9-step cycle: authorization request to the payer, polling for approval, downloading the result, and preparing for dispensing. A circular progress indicator shows the percentage with bilingual text — “Processing your prescription / جاري معالجة الوصفة الطبية.” The process may take up to 2 minutes depending on payer response.

PHARMACY KIOSK
Processing Prescription (26%)
QR SCANNER
COLLECT

Processing Prescription (26%)

#Screen
1Processing Prescription (26%)
4

Dispensing Medications

Once authorized, the machine activates the spring motor for each medication slot. The screen shows each drug being dispensed with a progress counter (e.g. “Dispensing… 0 of 1”). A yellow warning banner reads “⚠ DO NOT LEAVE — Please wait until all items are dispensed / لا تغادر.” Drop sensors verify each item fell into the collection tray. If a drop is not detected, the system retries the slot automatically.

PHARMACY KIOSK
Dispensing — DO NOT LEAVE
QR SCANNER
COLLECT

Dispensing — DO NOT LEAVE

#Screen
1Dispensing — DO NOT LEAVE
5

Completion & Collection

A green checkmark confirms “Dispensing Complete! / إتم صرف الأدوية بنجاح.” Instructions tell the patient to collect medications from the pickup tray and printed labels from the printer slot. The dispensed medications list is shown with a checkmark. A support hotline number (800-XXX-XXXX) is displayed. The session auto-closes after 67 seconds. If an error occurs, the patient sees a red “Unable to Process” screen with retry and support options.

PHARMACY KIOSK
Dispensing Complete — Collect Items
QR SCANNER
COLLECT

Dispensing Complete — Collect Items

PHARMACY KIOSK
Error — Unable to Process
QR SCANNER
COLLECT

Error — Unable to Process

#Screen
1Dispensing Complete — Collect Items
2Error — Unable to Process
6

Admin Panel

Technicians access the admin panel via a PIN-protected lock screen. The panel provides full hardware control across 7 tabs: Dashboard (machine status), Shipment (inventory), Lift (floor control with Move Up / Return to Home), Temperature monitoring, Diagnostics, Slots (spring/belt per slot, merge/split, batch operations, factory reset), API settings, and Network configuration. Door & Partition toggles and LED/Glass Heating ON/OFF controls allow remote hardware management.

PHARMACY KIOSK
Admin PIN Access
QR SCANNER
COLLECT

Admin PIN Access

PHARMACY KIOSK
Lift, Door & Hardware Controls
QR SCANNER
COLLECT

Lift, Door & Hardware Controls

PHARMACY KIOSK
Slot Config & Factory Reset
QR SCANNER
COLLECT

Slot Config & Factory Reset

#Screen
1Admin PIN Access
2Lift, Door & Hardware Controls
3Slot Config & Factory Reset