Bug #657
closedWalk-in visit has to pay, follow up doesn't need to pay
0%
Description
Module: OPD → Patient Registration
Environment: Test, NSSH (https://nssh.test.clinq.health/opd/register)
Severity: High, because it causes revenue leakage
Priority: P1
Description
When a returning patient is registered with Visit type Walk-in and their previous visit was within 3 days, the system waives the consultation fee. The 3-day free window should only apply to Follow-up visits. Every walk-in visit should be charged, however recent the last visit was.
Steps to reproduce
Register patient A as a Walk-in under a department and doctor. The fee is charged (Registration ₹200 + Consultation ₹300 = ₹500).
Within 3 days, register patient A again under the same department and doctor.
Set Visit type to Walk-in.
Look at the Payment section and the generated bill.
Expected result
The consultation fee (₹300) is charged for the Walk-in visit.
The free-visit rule applies only when Visit type = Follow-up and the visit is within the 3-day window.
Actual result
The consultation fee is waived (₹0) for the Walk-in visit because the previous visit was within 3 days.
Business rule
Visit type Within 3 days of last visit After 3 days
Walk-in Charged Charged
Follow-up Free Charged
Emergency / Referral Charged (to confirm) Charged
Suspected cause
The free-window check probably looks only at the last visit date and ignores visit type. It needs a visitType == FOLLOW_UP condition. Check the fee logic in both the registration UI and the backend billing service, so a direct API call can’t bypass it.