Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #764 (new defect)

Opened 3 months ago

fix patient search auto jump

Reported by: catullus Assigned to: somebody
Priority: major Milestone:
Component: OpenMRS Code Base Keywords:
Cc:

Description

In [4302] I changed allowAutoJump in findPatient.jsp to always return false.

function allowAutoJump() {
					if (autoJump == false) {
						autoJump = true;
						return false;
					}
					//	only allow the first item to be automatically selected if:
					//		the entered text is a string or the entered text is a valid identifier
					//return (savedText.match(/\d/) == false || isValidCheckDigit(savedText));
					
					//don't autojump anymore.  keeping the above functionality
					//would require adding a field to PatientListItem, and this inelegant solution
					//doesn't seem worth the minimal functionality conferred above.
					return false;
				}

The method isValidCheckDigit() was removed because it can not be supported synchronously (since identifier validation happens in the java layer). For allowAutoJump to work correctly again, the validation in the java layer must get back up to the javascript layer. I am not sure how this can be done elegantly. Ben proposed the less than perfect but workable solution to add a flag in patientListItem; however, one must be careful if this route is chosen, since the correct validator must be used for the correct identifier, and patientListItem stores identifiers in a peculiar way.