where {{patient.patientId}} translates to the real patient id, like patientId=3838, however when am customizing the patient search widget to provide a chartsearch url as reported at: Defining unique URL for afterSelectedUrl property of patientsearch widget
the patientId translates to uuid, which @darius said is meant to be so, so i wanted to support both of these at the same time, however the second results into a NumberFormatException which i have not yet been able to trace where it happens within the module’s code.
Put a breakpoint in the exact place where the exception is thrown and follow the way back. However in the stacktrace you should see all the methods and classes involved, isn’t that right?
org.springframework.core.convert.support.StringToNumberConverterFactory$StringToNumber.convert(StringToNumberConverterFactory.java:59)
...
at org.openmrs.ui.framework.UiFrameworkUtil.determineArgumentValue(UiFrameworkUtil.java:236)
From this I guess that you have code in your controller like
and naturally this fails with a NumberFormatException if a UUID is passed in.
Take a look at the first argument to this controller. This supports either patient_id or uuid, because it just lets the UI Framework (and Spring’s underlying conversion service) automatically take care of things.
(Particularly, StringToPatientConverter in the uiframework module already knows how to fetch a patient based on either a patient_id or a uuid.)
something i noticed however is that patient becomes null at the controller level when i use jq(’#chart-search-form-submit’).serialize() as URL which returns/transforms into something like:
SEVERE: Servlet.service() for servlet openmrs threw exception
java.lang.NullPointerException
at org.openmrs.module.chartsearch.page.controller.ChartsearchPageController.searchAndReturnResults(ChartsearchPageController.java:78)
at org.openmrs.module.chartsearch.fragment.controller.TopAreaFragmentController.getResultsFromTheServer(TopAreaFragmentController.java:41)
Investigation shows that patient fails to be passed from the view.