π₯ Hospital Profile: Dhaka Care Medical & Hospital Ltd.
The hospital runs both inpatient and outpatient care alongside its own diagnostic lab and pharmacy, which is exactly the kind of multi-department, multi-revenue-stream organization ERPNext is well suited to model once its core modules are combined with a couple of domain-specific custom modules. Its departments, for the purpose of this case study:
OPD
Emergency
IPD
ICU
CCU
OT
Pharmacy
Laboratory
Radiology
Blood Bank
Ambulance
Nursing
Every section below assumes this department list and reuses the same Part 1 implementation methodology β the base-module-first, custom-module-only-when-necessary discipline this series is built around.
πΆ The Patient Journey
Before mapping anything to ERPNext DocTypes, it helps to see the journey as a patient actually experiences it β one continuous path that later gets split across a custom clinical module, a custom lab module, and several base ERPNext modules:
Each stop on that journey touches a different record. Laid out as relationships instead of a sequence, the same journey looks like this:
Patient
Doctor
Appointment
Lab
Radiology
Pharmacy
Bed
Admission
Treatment
Billing
Everything in that second layer ultimately references the same Patient record β this is the "reference, don't duplicate" master-data pattern the base course establishes in Part 1's master/transaction table split, applied to a hospital instead of a warehouse.
π§© Hospital Operations on Base ERPNext
Most of what keeps a hospital's business running β not its clinical work, its business β is already covered by ERPNext's standard modules, exactly as introduced in Part 1 of the base course and detailed per-module in Part 3. Nothing here needs a custom DocType:
| Module | Used for, in this hospital |
|---|---|
| Accounting | Patient billing, doctor payment, supplier payment, pharmacy/diagnostic revenue, expenses, hospital assets, bank, cash, GL |
| Buying | Medicine procurement, medical equipment, lab consumables, surgical materials, office supplies |
| Stock | Medicines, consumables, surgical supplies, lab reagents, equipment inventory |
| HR | Doctors, nurses, pharmacists, lab technicians, receptionists, admin staff |
| Payroll | Salary, allowances, deductions, payroll accounting |
| Assets | MRI, CT scanner, X-ray machine, ICU equipment, ambulance, computers |
| Projects | Hospital expansion, new branch, equipment installation, construction projects |
What's not in that table β appointments, consultations, admissions, lab requests β is precisely what the two custom modules below exist to cover, following the same Configure β Customize β Custom Module β Integration decision ladder Part 1 establishes.
π©Ί Custom Module A: Hospital Clinical Management
Nothing in base ERPNext models a patient, an appointment slot, or a bed β so this is the "need new DocTypes" branch of the customization decision tree. The clinical module's DocTypes:
| DocType | Role |
|---|---|
| Patient | Master record for the person receiving care |
| Patient Registration | The intake event that creates or re-identifies a Patient |
| Appointment | A scheduled slot with a Doctor |
| Doctor | Master record for a consulting/attending physician |
| Consultation | The actual visit/encounter record |
| Diagnosis | Clinical finding(s) recorded against a Consultation |
| Prescription | Medicines and instructions issued from a Consultation |
| Admission | An inpatient stay, opened when OPD care isn't enough |
| Discharge | Closes an Admission |
| Bed | A physical, assignable inpatient resource |
| Ward | Groups Beds (general ward, ICU, CCU, β¦) |
The relationships branch in two directions from Patient, so they're shown as two focused diagrams rather than forcing one diagram to show both branches at once:
Outpatient branch
Inpatient branch
A compact field-level view of the Patient DocType only, in the same field-level training table shape Part 1 uses throughout that article for training end users field by field:
| Field | Type | Required? | Who enters? | When? | Why? | Example | Related DocType |
|---|---|---|---|---|---|---|---|
patient_id | Data (naming series) | Auto | System | On save | Unique, human-readable patient identifier used across the whole record | PAT-2026-00042 | β |
patient_name | Data | Yes | Receptionist | Registration | Identifies the patient on every downstream document | Abdul Karim | β |
date_of_birth | Date | Recommended | Receptionist | Registration | Age-appropriate dosing, pediatric vs adult routing | 1990-04-12 | β |
gender | Select | Recommended | Receptionist | Registration | Clinical relevance, ward assignment | Male | β |
contact_number | Data (Phone) | Yes | Receptionist | Registration | Appointment confirmation, emergency contact | +8801XXXXXXXXX | β |
address | Small Text | Recommended | Receptionist | Registration | Records District/Division for demographic and referral tracking | Mirpur, Dhaka | Address |
blood_group | Select | Recommended | Nurse/Receptionist | Registration or first admission | Emergency and transfusion safety | B+ | β |
customer | Link β Customer | Auto/System | System (on registration) | Registration | Lets the Patient bill through the standard ERPNext AR flow without duplicating billing logic | CUST-PAT-00042 | Customer |
π§« Custom Module B: Laboratory & Diagnostic Management
Concretely: Sample Type (blood, urine, swab, CSF, β¦) and Test Parameter (e.g. hemoglobin, WBC count, platelet count within one CBC Test) are the two additions that make the pattern hospital-grade β a single physical Sample can carry multiple Tests, and a single Test can carry multiple Test Parameters, each with its own reference range and Result row.
π Custom Module β ERPNext Core
Both custom modules exist to model things ERPNext doesn't know about natively β but every one of their key records ultimately drives a base ERPNext DocType, exactly the three-level integration pattern (UI, Data, Business Logic) from Part 1's custom module case study:
Custom Hospital Module
Patient
Appointment
Admission
Lab Request
Lab Result
Customer
Item
Employee
Billing
Stock
HR
Accounting
| Custom DocType | Base DocType | Relationship | Why | When |
|---|---|---|---|---|
| Patient | Customer | Link | Billing | At registration |
| Medicine | Item | Link | Inventory | Pharmacy setup |
| Hospital Employee | Employee | Link | HR | Staff onboarding |
| Lab Service | Item | Link | Billing | Service setup |
π Pharmacy
Once a Prescription reaches the Pharmacy counter, nothing about dispensing a medicine is hospital-specific anymore β it's a standard ERPNext Stock + Selling problem: every Medicine is an Item (typically inside an Item Group like "Pharmaceuticals"), tracked by Batch and expiry, held in a pharmacy Warehouse, and moved by whatever document issues it β each such movement writing a Stock Ledger Entry. Where Serial or Batch tracking, pricing, and Sales Invoice generation actually happen mechanically is covered in depth already, rather than re-derived here β see Part 3's Stock module walkthrough and Part 5's Stock Ledger Entry generation section.
The only hospital-specific piece is the front end of that chain: a Prescription (custom DocType) needs to resolve its medicine lines into ordinary Items before the pharmacy's stock/billing documents can pick them up β the same Link-field integration pattern used throughout this module.
π¬ Laboratory Workflow
Who can act at which step is a permissions question, not a workflow-state question alone β both matter together, the same layered idea from Part 1's permission flow:
| Role | Typical permission on Lab Request/Result |
|---|---|
| Receptionist | Create request |
| Lab Technician | Edit sample/result, no approval |
| Pathologist | Approve/verify |
| Lab Manager | Oversight/reassign |
| Accountant | View only, for billing |
| Administrator | Full |
π§Ύ Hospital Billing
A single hospital visit routinely bills across several departments at once β this is exactly the "many sources converge on one settlement layer" pattern from Part 1's module interconnection diagram, applied to billing specifically:
Consultation
Lab
Radiology
Bed
Medicine
Procedure
Patient Invoice
Payment
The mechanism that makes this possible without a custom billing engine: every billable custom-module concept β a Lab Service, a bed-day, a procedure β is mapped to an ordinary ERPNext Item, so it can appear as one line on a standard Sales Invoice alongside consultation fees and dispensed medicine. The hospital never needs its own invoice format; it needs its custom records to resolve to Items before the Sales Invoice is raised.
Why the Invoice and the Payment stay two separate records even here β a multi-service hospital bill is exactly the case where partial payments, insurance reimbursement delays, and installment settlement make that separation matter most β is the underlying accounting theory covered in full in Invoice vs Payment: The Core Concept and its Allocation model.
π§π© Bangladesh VAT/Tax for Hospital Services
Conceptually β not as guaranteed exact ERPNext behavior β a hospital's tax setup rests on a few pieces: a BIN (Business Identification Number) and VAT registration status recorded against the Company; a decision on VAT-inclusive vs VAT-exclusive pricing per price list; one or more Tax Categories (e.g. standard service, exempt service, corporate/insurance-billed service) that a Sales Invoice's customer or item resolves to; and Tax Templates that attach the actual percentage and the target VAT Payableβtype account. Whatever the resolved rate, the tax line ultimately posts through the same GL Entry mechanism as any other accounting impact β see Part 5's GL Entry generation section for how that posting mechanically happens.
| Service/Item | Illustrative tax treatment |
|---|---|
| Consultation | Example VAT rate = configurable placeholder (services can be exempt or reduced-rate β verify with NBR) |
| Diagnostic service | Example VAT rate = configurable placeholder |
| Medicine | Example VAT rate = configurable placeholder (pharmaceuticals often have distinct NBR treatment β verify) |
| Hospital bed | Example VAT rate = configurable placeholder |
| Procedure | Example VAT rate = configurable placeholder |
| Corporate/insurance service | Example VAT rate = configurable placeholder (billing entity may differ from the patient, affecting the applicable Tax Category) |
π Hospital Role/Permission Matrix
| Role | Patient | Doctor | Lab | Pharmacy | Billing | HR | Admin |
|---|---|---|---|---|---|---|---|
| Receptionist | Create/Edit | View | Create | No | View | No | No |
| Doctor | View/Edit (clinical) | View own | Create/View | View | No | No | No |
| Lab Technician | Limited (linked records only) | No | Edit | No | No | No | No |
| Pharmacist | Limited | No | No | Edit | Create (pharmacy invoice) | No | No |
| Accountant | View | View | View | View | Full | Limited | No |
| HR | No | Limited | No | No | No | Full | No |
| Administrator | Full | Full | Full | Full | Full | Full | Full |
π Hospital Dashboards
Management
- Daily Revenue
- Patient Count
- OPD Count
- IPD Occupancy
- Pharmacy Sales
- Lab Revenue
- Outstanding
- Expenses
Lab Manager
- Pending Samples
- Testing Queue
- Pending Verification
- Critical Results
- Turnaround Time
Pharmacy
- Low Stock
- Expired Medicine
- Daily Sales
- Fast Moving Items
π End-to-End Hospital Workflow
Reading that chain against what actually implements each step: Payment and Accounting/GL are pure base ERPNext β no custom code touches them. Appointment, Consultation, Admission, and Lab Request/Result are Custom Module territory β they don't exist in ERPNext core and are exactly what the two custom modules in this article were built to cover. Everything else in the chain (Prescription resolving to Pharmacy stock, Billing resolving to a Sales Invoice) is the seam where the custom modules hand off into base ERPNext via ordinary Link fields.
π§― Real-World Troubleshooting Scenarios
Scenario 1: Lab result cannot be approved
| Symptom | What to investigate |
|---|---|
| "Lab result cannot be approved" | Permission, Workflow state, Role, Validation, Server error |
Scenario 2: Medicine stock is incorrect
| Symptom | What to investigate |
|---|---|
| "Medicine stock is incorrect" | Stock Entry, Delivery, Purchase Receipt, Stock Ledger Entry, Warehouse, Batch |
Scenario 3: Patient invoice has wrong tax
| Symptom | What to investigate |
|---|---|
| "Patient invoice has wrong tax" | Item, Tax Category, Tax Template, Company, Customer, Invoice |
π‘οΈ Hospital Data Security
- Least privilege β every role gets only the access its job requires, nothing more
- Role separation β clinical, lab, pharmacy, billing, and HR access kept distinct
- Audit trail β owner, modified_by, and version history preserved on every document
- Access logging β who viewed or changed a patient record, and when
- Backups β scheduled, offsite, and periodically tested for actual recovery
- Encryption β data at rest and in transit
- HTTPS everywhere β no plaintext access to any hospital data
- Restricted database access β no shared or ad-hoc direct DB credentials
- Secure API β scoped keys, never a System Manager key for integrations
- File access controls on attachments (reports, scans, discharge summaries)
- Production secrets kept out of source control and rotated on exposure
As stated throughout this series: this article uses only fictional patient and company data, and does not represent any real Bangladesh hospital's actual data, systems, or security posture.
β Hospital UAT Checklist
Before go-live, walk every one of the following end to end on the actual configured site β not in isolation:
- Patient registration
- Appointment scheduling and rescheduling
- Lab: request through report (including an abnormal/flagged result path)
- Pharmacy: prescription through stock issue
- Billing: a multi-service invoice covering consultation, lab, and medicine together
- Payment: full, partial, and insurance/corporate settlement paths
- Reports: management, lab manager, and pharmacy dashboards render with real data
πΊοΈ What's Next
This is Part 2 of the 4-part ERPNext Bangladesh Implementation Case Study β a companion series to the 9-part base course, walking one fictional Bangladeshi organization's ERPNext rollout end to end.
| Part | Focus |
|---|---|
| 1 | Implementation methodology β company profile, the six-question training framework, and the customization decision tree |
| 2 | Hospital Management β Dhaka Care Medical & Hospital Ltd. (this article) |
| 3 | Real Estate & Construction β the next project in the series |
| 4 | Custom development, DevOps & production β how this hospital's two custom modules would actually be built and deployed |
Part 4 in particular is where the Clinical Management and Laboratory & Diagnostic modules sketched here stop being a design exercise and become an actual custom Frappe app: repository structure, CI, staging vs production sites, and a deployment pipeline β following the same custom-app architecture the base course establishes in Part 7.