Open yleeyilin opened 7 months ago
Thanks for pointing this out. There are multiple bugs in this bug report:
lack of validation checks on the drug allergies
find function can conduct a substring search instead
The result you encountered has little to do with the functionality of the find
command but rather the drug allergy validation which has been acknowledged in issue #5249. According to the user guide, the result to not return the patient with drug allergy Penicillin|paracetamol
with find d/paracetamol
is the desired outcome.
The find
behaviour that it only returns matching full words has been documented in the UG:
Thus, not performing a substring search is the correct behaviour. This is somewhat a limitation, but a choice had to be made between convenience and efficiency, and the team chose to prioritise efficiency. Furthermore, this situation is only possible as the user has not followed the drug allergy format suggested in the user guide, example commands and sample data where when entering multiple drug allergies, they should be separated with |
and spaces.
Drug allergy entry in UG:
As this is an issue caused by an error in user entry and not the functionality of find
, we will be rejecting this bug.
Team chose [response.Rejected
]
Reason for disagreement: While I understand that your UG has specifically mentioned that drug allergies should be separated using spaces and special characters, there was no warning thrown for your users who may have used a special character without spacing in the first place.
Additionally, given that there was also no mention of the spaces affecting the find function, it is unfair to blame the user for their wrong input. From the users perspective, "penicillin" is indeed a full word and also looks like a full word just by looking at the contact card since there is a special character to differentiate between the 2 words.
Blaming users for their input overlooks the responsibility of the product to provide clear warning and validate user inputs effectively. The absence of user input validation within the drug validation process cannot reasonably justify the functionality bug encountered in the find command.
This is still considered a functionality bug since the find command do not behave as expected.
Steps to reproduce:
add ic/S0074567D n/John Doe g/M b/10-07-1999 p/98765432 e/johnd@example.com d/Penicillin|paracetamol i/Infectious Disease i/Genetic Disorders
, thenfind d/paracetamol
.Expected:
Actual:
Screenshots: