Registration Search Error when apostrophe in name

Hello Bahmni Team–

Just a quick note that we’d discovered bug when searching for patients with apostrophes in their names.

In Sierra Leone we were looking to allow apostrophes in names (for example, “Troy O’Leary”) and so modified the Bahmni and OpenMRS regex to allow this. This seems to work fine, and we are able to create names with apostrophes.

However, searching for names with apostrophes in the registration apps results in an error.

Steps to reproduce

  1. Click on registration app
  2. Enter “Troy O’Leary” in the “Name” search box and hit “Search”

You’ll get a red error message “could not locate named parameter [limit]”.

Taking a quick look at the underlying server stack trace, I’m guessing this is due to the ’ not being properly escaped in the SQL error:

org.hibernate.QueryParameterException: could not locate named parameter [limit] at org.hibernate.engine.query.ParameterMetadata.getNamedParameterDescriptor( at org.hibernate.engine.query.ParameterMetadata.getNamedParameterExpectedType( at org.hibernate.impl.AbstractQueryImpl.determineType( at org.hibernate.impl.AbstractQueryImpl.setParameter( at at org.bahmni.module.bahmnicore.dao.impl.PatientDaoImpl.getPatients( at at at sun.reflect.GeneratedMethodAccessor1004.invoke(Unknown Source)

Hi Mark,

Thanks for pointing this out…We have created a card for tracking this issue.

You are welcome!