NPE for patient Identifier type when not required in HTML form

This is how I am using it in my form

<patient field="identifier" identifierTypeId="2" required="false"/>

When I submit I get such exceptions.

Caused by: java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.<init>(Unknown Source)
        at org.openmrs.module.htmlformentry.element.PatientDetailSubmissionElement.getIdentifierType(
        at org.openmrs.module.htmlformentry.element.PatientDetailSubmissionElement.handleSubmission(
        at org.openmrs.module.htmlformentry.FormSubmissionController.handleFormSubmission(
        at org.openmrs.module.htmlformentryui.fragment.controller.htmlform.EnterHtmlFormFragmentController.submit(
        ... 70 more

@slubwama What is the question to your problem that you want help on?

1 Like

These attributes in this patient tag still seems to throw this NPE error because am getting

For input string: “”

as my error. I suspected it may be due to the predefined regEx but iam not sure since the identifierType being used doesnt seem to have any regEx defined when i checked via the legacy UI.

The question is why this error pops up when I enter a value as the Identifier(even if i insert a number since this appears to be an issue of conversion from string to int)? Could it be that the value is meant to be autopopulated after having been inserted from some other ui rather than the form? cc @mogoodrich @dkayiwa @mksd @samuel34

Are you able to reproduce it here?