中文译文
你是一位资深软件架构师和药房管理系统专家。
为我在伊拉克摩苏尔的药房设计和构建一个私有的药房 CRM。
该系统用于管理患者、慢性病药物、随访、销售洞察、库存和客户关系。
主要目标
创建一个简单、快速、私有的 CRM,帮助我记住患者、了解他们的用药史、随访慢性病患者、发现销售机会,并改善药房服务,同时不鼓励不安全或不必要的用药。
用户
系统初期将只有一个管理员用户。
药剂师必须控制对患者信息的访问。
患者数据不得公开访问。
核心患者档案
每位患者应包含:
- 唯一患者 ID
- 二维码
- 全名
- 年龄或出生日期
- 性别
- 电话号码
- 地址或区域
- 备注
- 添加日期
- 最近就诊
- 下次随访日期
- 患者状态
用药档案
为每位患者存储:
- 药物名称
- 有效成分
- 规格
- 剂型
- 剂量
- 频次
- 疗程
- 开始日期
- 结束日期
- 开方医生
- 使用原因
- 当前或已停用状态
- 备注
用药史必须保持可用,以便我能查看既往用药。
慢性病药物管理
允许我将患者标记为慢性病照护患者。
对于慢性病患者,显示:
- 当前用药
- 既往用药
- 预计续药日期
- 最近购买日期
- 距上次购买天数
- 随访日期
- 错过续药
- 药剂师备注
系统应帮助识别可能需要随访的患者。
不要自动建议更改治疗或停止用药。
仪表盘
创建一个仪表盘,显示:
- 患者总数
- 活跃慢性病患者
- 待随访患者
- 错过的随访
- 待续药患者
- 新患者
- 复诊患者
- 今日随访
- 最近购买
- 销售额
- 利润
- 低库存产品
- 临近过期的产品 CRM 功能
允许我:
- 按姓名搜索患者
- 按电话号码搜索
- 按患者 ID 搜索
- 扫描二维码
- 快速打开患者档案
- 添加就诊记录
- 添加药物
- 编辑药物
- 记录购买
- 记录药剂师备注
- 设置随访日期
- 将随访标记为已完成
- 查看患者历史记录
二维码系统
每位患者都应拥有唯一的二维码。
扫描二维码应在已认证的 CRM 中打开该患者的档案。
二维码绝不能直接暴露患者的敏感信息。
库存集成
如果有药房库存数据可用,将 CRM 与其连接。
显示:
- 产品
- 类别
- 库存
- 采购成本
- 售价
- 利润
- 利润率
- 每日消耗量
- 预计缺货天数
- 有效期
营销与 CRM 分析
创建有用的客户细分,例如:
- 慢性病患者
- 常客
- 不活跃客户
- 待续方患者
- 待随访患者
- 高价值客户
- OTC 客户
- 保健品客户
利用这些细分来建议符合伦理的药房行动。
示例:
- 提醒续配慢性病药物
- 随访提醒
- 血压监测服务
- 用药依从性随访
- 在临床适当时推荐相关的 OTC 产品
- 根据客户需求推荐个人护理产品
绝不单纯为了增加销售额而推荐不必要的药物或保健品。
销售分析
跟踪:
- 每日销售额
- 每周销售额
- 每月销售额
- 毛利润
- 利润率
- 交易数量
- 平均交易金额
- 按类别划分的销售额
- 按产品划分的销售额
- OTC 销售额
- 保健品销售额
- 慢性病药物销售额
展示趋势并识别客户行为的变化。
提醒
为以下情况创建提醒:
- 随访到期
- 错过随访
- 预计续方
- 错过续方
- 库存不足
- 临近有效期
- 已过期产品
- 异常销售变化 隐私与安全
患者信息属于敏感信息。
使用:
- 身份验证
- 安全的本地存储或加密数据库
- 如果以后添加多个用户,则使用基于角色的访问控制
- 自动会话超时
- 数据库备份
- 恢复功能
- 对重要变更进行审计日志记录
系统应尽可能在本地运行。
除非我明确启用,否则避免将患者信息发送到外部 AI 服务。
界面
为在繁忙时段快速工作的药剂师设计界面。
优先考虑:
- 快速搜索
- 少量点击
- 大按钮
- 清晰的患者时间线
- 简单表单
- 移动端友好界面
- 阿拉伯语和英语支持
- 在适当情况下使用伊拉克药房术语
主要屏幕
创建:
- 仪表盘
- 患者
- 患者档案
- 用药历史
- 就诊
- 随访
- 库存
- 销售分析
- 警报
- 报告
- 设置
- 备份与恢复
患者时间线
每位患者都应有一条按时间顺序排列的时间线,包含:
- 登记
- 就诊
- 添加用药
- 用药变更
- 购买
- 随访
- 备注
分析
CRM 应生成可执行的洞察,而不仅仅是显示数字。
例如:
“23 名慢性患者预计将在 7 天内续药。”
“11 名患者未在预期续药期内返回。”
“本月 OTC 销售额增长了 14%。”
“X 类别销售额高但利润率低。”
“17 种产品可能在预期库存耗尽前过期。”
解释每条洞察为何重要,以及我应考虑采取什么行动。
AI 助手
包含一个可选的 AI 助手,能够回答关于 CRM 数据的问题。
示例:
本周哪些慢性患者需要续药?
哪些患者错过了预期续药?
我利润最高的 20 个产品是什么?
哪些类别销售额高但利润率低?
哪些产品有过期风险?
哪些日期的销售额最高?
与上个月相比有什么变化?
今天哪些患者需要随访? AI 必须区分:
数据库中直接可用的事实
计算
预测
建议
绝不编造患者信息或销售数据。
架构
推荐一个生产就绪的架构,且要简单到足以适用于一家小型药房。
优先采用本地优先的架构。
解释:
- 前端
- 后端
- 数据库
- 身份验证
- 二维码生成
- 备份系统
- API 结构
- AI 集成
- 部署
- 安全
在实现之前先设计数据库模式。
包含以下实体之间的关系:
- 患者
- 药物
- 就诊
- 购买
- 产品
- 随访
- 用户
- 警报
- 审计日志
重要约束
系统必须保持简单。
不要仅仅因为听起来很厉害就添加功能。
每个功能都应回答以下问题之一:
- 它是否节省药剂师的时间?
- 它是否改善患者随访?
- 它是否减少库存问题?
- 它是否提升业务可见性?
- 它是否改善患者服务?
- 它是否保护患者数据?
在编写实现代码之前:
- 定义完整的需求。
- 识别缺失的需求。
- 设计数据库。
- 设计用户工作流。
- 设计 API。
- 定义安全模型。
- 定义 MVP。
- 然后提出实现计划。
先构建 MVP。
不要过度设计系统。
English original
You are a senior software architect and pharmacy management systems specialist.
Design and build a private pharmacy CRM for my pharmacy in Mosul, Iraq.
The system is for managing patients, chronic medications, follow-ups, sales insights, inventory, and customer relationships.
Main goal
Create a simple, fast, private CRM that helps me remember patients, understand their medication history, follow up with chronic patients, identify sales opportunities, and improve pharmacy service without encouraging unsafe or unnecessary medication use.
Users
The system will initially have one administrator user.
The pharmacist must control access to patient information.
Patient data must not be publicly accessible.
Core patient profile
Each patient should have:
- Unique patient ID
- QR code
- Full name
- Age or date of birth
- Sex
- Phone number
- Address or area
- Notes
- Date added
- Last visit
- Next follow-up date
- Patient status
Medication profile
For each patient store:
- Medication name
- Active ingredient
- Strength
- Dosage form
- Dose
- Frequency
- Duration
- Start date
- End date
- Prescriber
- Reason for use
- Current or discontinued status
- Notes
Medication history must remain available so I can see previous medications.
Chronic medication management
Allow me to mark patients as chronic-care patients.
For chronic patients show:
- Active medications
- Previous medications
- Expected refill date
- Last purchase date
- Days since last purchase
- Follow-up date
- Missed refill
- Pharmacist notes
The system should help identify patients who may need follow-up.
Do not automatically recommend changing treatment or stopping medication.
Dashboard
Create a dashboard showing:
- Total patients
- Active chronic patients
- Patients due for follow-up
- Missed follow-ups
- Patients due for medication refill
- New patients
- Returning patients
- Today's follow-ups
- Recent purchases
- Sales
- Profit
- Low-stock products
- Products approaching expiry
CRM features
Allow me to:
- Search patients by name
- Search by phone number
- Search by patient ID
- Scan a QR code
- Open the patient profile quickly
- Add a visit
- Add medication
- Edit medication
- Record a purchase
- Record pharmacist notes
- Set a follow-up date
- Mark a follow-up as completed
- View patient history
QR system
Every patient should have a unique QR code.
Scanning the QR code should open the patient's profile inside the authenticated CRM.
The QR code must not expose sensitive patient information directly.
Inventory integration
If pharmacy inventory data is available, connect the CRM to it.
Show:
- Product
- Category
- Stock
- Purchase cost
- Selling price
- Profit
- Profit margin
- Daily consumption
- Estimated days until stockout
- Expiry date
Marketing and CRM analytics
Create useful customer segments such as:
- Chronic patients
- Frequent customers
- Inactive customers
- Patients due for refill
- Patients due for follow-up
- High-value customers
- OTC customers
- Supplement customers
Use these segments to suggest ethical pharmacy actions.
Examples:
- Reminder to refill a chronic medication
- Follow-up reminder
- Blood pressure monitoring service
- Medication adherence follow-up
- Relevant OTC product suggestion when clinically appropriate
- Personal-care recommendation based on customer needs
Never recommend unnecessary medication or supplements simply to increase sales.
Sales analytics
Track:
- Daily sales
- Weekly sales
- Monthly sales
- Gross profit
- Profit margin
- Number of transactions
- Average transaction value
- Sales by category
- Sales by product
- OTC sales
- Supplement sales
- Chronic medication sales
Show trends and identify changes in customer behavior.
Alerts
Create alerts for:
- Follow-up due
- Missed follow-up
- Expected refill
- Missed refill
- Low stock
- Near expiry
- Expired product
- Unusual sales changes
Privacy and security
Patient information is sensitive.
Use:
- Authentication
- Secure local storage or encrypted database
- Role-based access if multiple users are added later
- Automatic session timeout
- Database backup
- Restore function
- Audit log for important changes
The system should work locally whenever possible.
Avoid sending patient information to external AI services unless I explicitly enable it.
Interface
Design the interface for a pharmacist working quickly during busy hours.
Prioritize:
- Fast search
- Few clicks
- Large buttons
- Clear patient timeline
- Simple forms
- Mobile-friendly interface
- Arabic and English support
- Iraqi pharmacy terminology where appropriate
Main screens
Create:
- Dashboard
- Patients
- Patient profile
- Medication history
- Visits
- Follow-ups
- Inventory
- Sales analytics
- Alerts
- Reports
- Settings
- Backup and restore
Patient timeline
Every patient should have a chronological timeline containing:
- Registration
- Visits
- Medication additions
- Medication changes
- Purchases
- Follow-ups
- Notes
Analytics
The CRM should generate actionable insights rather than only displaying numbers.
For example:
"23 chronic patients are expected to refill within 7 days."
"11 patients have not returned within their expected refill period."
"OTC sales increased 14% this month."
"Category X has high sales but low profit margin."
"17 products may expire before expected stock depletion."
Explain why each insight matters and what action I should consider.
AI assistant
Include an optional AI assistant that can answer questions about CRM data.
Examples:
- Which chronic patients are due for refill this week?
- Which patients have missed their expected refill?
- What are my top 20 profitable products?
- Which categories have high sales but low margins?
- Which products are at risk of expiry?
- Which days have the highest sales?
- What changed compared with last month?
- Which patients need follow-up today?
The AI must distinguish between:
- Facts directly available in the database
- Calculations
- Predictions
- Suggestions
Never invent patient information or sales data.
Architecture
Recommend a production-ready architecture that is simple enough for a small pharmacy.
Prefer a local-first architecture.
Explain:
- Frontend
- Backend
- Database
- Authentication
- QR generation
- Backup system
- API structure
- AI integration
- Deployment
- Security
Design the database schema before implementation.
Include relationships between:
- Patients
- Medications
- Visits
- Purchases
- Products
- Follow-ups
- Users
- Alerts
- Audit logs
Important constraints
The system must remain simple.
Do not add features just because they sound impressive.
Every feature should answer one of these questions:
- Does it save pharmacist time?
- Does it improve patient follow-up?
- Does it reduce stock problems?
- Does it improve business visibility?
- Does it improve patient service?
- Does it protect patient data?
Before writing implementation code:
- Define the complete requirements.
- Identify missing requirements.
- Design the database.
- Design the user workflow.
- Design the API.
- Define the security model.
- Define the MVP.
- Then propose the implementation plan.
Build the MVP first.
Do not overengineer the system.