pharmacy-dev
/pharmacy-dev
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.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.
GPL-3.0, otwarta.
What it does and when to use it
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.
Original author 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.
How it works
- Key Documentation
- Configuration Options
- Common Patterns
- GRN Report Testing
- Backward Compatibility
SKILL.md preview
---
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:
- [Pharmaceutical Management API](../../../developer_docs/api/using-apis/API_PHARMACEUTICAL_MANAGEMENT.md) - REST API for managing VTM, ATM, VMP, AMP, VMPP, AMPP, categories, dosage forms, and measurement units
- [GRN Fixes](../../developer_docs/pharmacy/grn-fully-issued-fix.md) - GRN completion patterns
- [Multi-Window Sales](../../developer_docs/pharmacy/PHARMACY_RETAIL_SALE_MULTI_WINDOW_GUIDE.md.md) - Multi-window handling
- [Cost Accounting Signs](../../developer_docs/pharmacy/cost-accounting-sign-conventions.md) - Sign normalization
- [Disbursement Signs](../../developer_docs/pharmacy/disbursement-sign-normalization.md) - Disbursement conventions
- [Quantity Decimals](../../developer_docs/pharmacy/quantity-decimal-validation-guide.md) - Decimal validation
- [Transfer Disbursement](../../developer_docs/billing/PHARMACY_TRANSFER_DISBURSEMENT_DOCUMENTATION.md) - Transfer workflow
- [Purchase Order Workflow](../../developer_docs/po-workflow-documentation.md) - PO workflow
- [Pharmacy Token Workflow](../../../developer_docs/pharmacy/pharmacy-token-workflow.md) - Token issue → Retail Sale / Sale for Cashier → pay → call → complete; which bean backs each sale page
- [Bulk Stock Verification Adjustment](../../developer_docs/pharmacy/bulk-stock-verification-adjustment-guide.md) - Reconciling a physical stock count spreadsheet against system stock at scale via the adjustment/batch-creation APIs
## 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)
- `Pharmacy - Allow Cross-Department PO Receiving` (default `false`) - lets a PO created in one department be received/GRN'd from any other department in the same institution; see [Purchase Order Workflow § Receiving Department Scoping](../../developer_docs/po-workflow-documentation.md#receiving-department-scoping-issue-21848)
## 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
### Store module
- Hospitals issue and return Store items to BHTs through the pharmacy flow and controllers (e.g. `BhtIssueReturnController`). The `bean/store/*ReturnController` pages are still reachable (Theatre / Store → BHT Issue menus) but aren't used in practice. Don't add fixes or guards there unless an issue explicitly reports that path; fix the pharmacy controller and say so in the issue.
## GRN Report Testing
When testing GRN / Direct Purchase report changes:
- The `ruhunu` local database typically has richer GRN data than `rh` and is better for testing
- Test URL: `http://localhost:8080/rh/faces/reports/inventoryReports/grn.xhtml`
- Print view (navigated from grn.xhtml): `grn_detailed_view.xhtml`, `grn_summary_view.xhtml`
- Key bill types: `PHARMACY_GRN`, `PHARMACY_GRN_RETURN`, `PHARMACY_GRN_CANCELLED`, `PHARMACY_DIRECT_PURCHASE`, `PHARMACY_DIRECT_PURCHASE_REFUND`, `PHARMACY_DIRECT_PURCHASE_CANCELLED`
- `PHARMACY_DIRECT_PURCHASE` bills have **null** `referenceBill` — always null-guard before accessing `bill.getReferenceBill()`
- Date/time formats in exports must use `sessionController.getApplicationPreference().getLongDateTimeFormat()` — never hardcode
- Excel/PDF filenames must not contain colons — use `getLongDateFormat()` (not datetime) and sanitize with `.replaceAll("[: /]", "_")`
## Backward Compatibility
- Never "fix" `purcahseRate` spelling - it's a database column name
- Never rename composite components without checking ALL usage
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · hmislk/hmis | 90 | GPL-3.0 |
| hmislk/hmis | 90 | GPL-3.0 |
Database snapshot: 13.11.2026 · package version 22652dd164d8 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90darukade
Read-only Darukade (darukade.com) pharmacy: products, prices, ingredients, usage, reviews. Use when the user asks about Darukade Pharmacy (darukade.com) or wants doctors, clinics, labs, appointments or pharmacy products in Iran. - 100write-wiki
Create user documentation for the HMIS wiki following writing guidelines. Use when creating documentation for end users (pharmacy staff, nurses, doctors, administrators). Creates documentation directly in the sibling ../hmis.wiki directory. - 100pharmacy-technician
A certified pharmacy technician (CPhT/PTCB) with expertise in prescription processing, medication dispensing, inventory management, pharmacy calculations (dose conversions, day supplies), pharmacy law (DEA schedules, refill regulations), insurance billing... Use when:… - 91pharmacy-supply-chain
When the user wants to optimize pharmacy supply chain operations, manage medication distribution, ensure pharmaceutical compliance, or handle controlled substances. Also use when the user mentions "pharmacy logistics," "drug distribution," "controlled substances," "340B… - 90claims-eob
Generate Claim, ClaimResponse, and ExplanationOfBenefit (EOB) resources for healthcare billing including professional, institutional, pharmacy (Rx), dental, and vision claims. Use when user mentions claims, EOB, explanation of benefit, billing, reimbursement, adjudication,… - 100pharmacy-technician
Use when a task needs the judgment of a Pharmacy Technician — verifying a new prescription before data entry, triaging an insurance claim rejection code, reconciling days'-supply math after a dose change, deciding a compounding beyond-use date, or catching a…