AgentSkillsCN

pharmacy-dev

HMIS 项目药房模块开发指南。适用于药房相关功能的开发,包括 GRN、采购订单、库存调拨、药品发放、零售销售、药房报表、库存管理、药品替换,以及药房计费流程等。

SKILL.md
--- frontmatter
name: pharmacy-dev
description: >
  Pharmacy module development guide for the HMIS project. Use when working on pharmacy
  features including GRN, purchase orders, stock transfers, disbursements, retail sales,
  pharmacy reports, stock management, item substitution, or pharmacy billing workflows.
user-invocable: true

Pharmacy Module Development Guide

Key Documentation

For detailed pharmacy development, refer to these files:

Configuration Options

Pharmacy uses configOptionApplicationController.getBooleanValueByKey() for feature toggles. Key patterns:

  • Pharmacy Transfer is by Purchase Rate / Cost Rate / Retail Rate
  • Display Colours for Stock Autocomplete Items
  • Pharmacy Disbursement Reports - Display * (various column visibility)

Common Patterns

Stock Queries

  • Always include s.retired = false and s.itemBatch.item.retired = false
  • Filter inactive items with s.itemBatch.item.inactive = false
  • Use DTOs for display, entities for business logic

Transfer Workflow

  • Transfer Request -> Transfer Issue -> Transfer Receive
  • Each step creates a Bill with appropriate BillType
  • Sign conventions matter for cost accounting

Retail Sale

  • Use StockDTO for autocomplete performance
  • Cache autocomplete results for converter
  • Defer expensive discount calculations

Backward Compatibility

  • Never "fix" purcahseRate spelling - it's a database column name
  • Never rename composite components without checking ALL usage