Search Results and Json Regex validation

Hello friends,

I have 2 questions…

I am configuring the search screen to allow for the birthdate field. As you can see, first that the value is not appearing in the results list, even though it does exist.

I have

“customAttributes”: { “label”: “IDs”, “placeholder”: “OldID/ARTNumber/DOB”, “fields”: [“OldID”, “ARTNumber”, “birthdate”] }

in the /var/www/bahmni_config/openmrs/apps/registration/app.json file

Secondly, I am attempting to restrict to numbers/letters and spaces in the field validation section.

“address1” : {“pattern” : “[a-zA-Z\s*]{0,}”… and a couple of variations of \s but they are not working…

Sorry for the premature post.

The issue is that it is not in camel case. Please change it to “fields”: [“OldID”, “ARTNumber”, “birthDate”]

Please use the below validation pattern for Alpha Numeric with Spaces “address1” : {“pattern” : “[a-zA-Z0-9\\s]+”}

Both updates made and unfortunately, the birthdate is still showing up blank and not working in the search and the regex pattern is causing an error…please see below.


The Pattern for indicating space is supposed to be “\\s”. Please try and let us know.

Please follow the Bahmni Wiki to configure Registration Search Results. Currently you are configuring it in “patientSearch” section instead of “patientSearchResults”.

Wonderful…that did the trick! Thanks…now, I’ll walk through other one.

1 Like

@swathivarkala is it possible it’s not working because it’s not a user defined field? I added the lines according to the wiki info and unfortunately, still doesn’t allow me to search by OR display birthdate.

Sorry, I think only search by address and person attributes is possible right now… Person date of birth is not a person attribute. So you can’t search by that.

ah, thank you…makes sense.