Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-1441

Default message when patient identifier validation fails

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: OpenMRS 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently, when a patient identifier is validated, the system checks it against a variety of specific PatientIdentifierExceptions, and outputs specific validation messages on each. However, if a PatientIdentifierException is thrown that is not specifically checked for, the default message is to display "Non-specific error with patient identifier".

      This is not particularly helpful. I would rather that the default behavior display whatever message was used when constructing this identifier. An example of where this behavior currently occurs is with "org.openmrs.api.MissingRequiredIdentifierException: Patient is missing the following required identifier(s): XXXX". This exception is masked in the UI currently, since it is not explicitly handled in the NewPatientFormController. Other examples would be if modules AOP'd around the savePatient method, and threw their own implementations of PatientIdentifierException. Ideally, the UI would be able to display these as useful validation error messages.

      Attached is a simple patch which just replaces the default generic error message with the message from the exception that is thrown.

      I would like to backport this to 1.4.x and 1.5.x as well.

      Any problems with this?

        Attachments

          Activity

            People

            Assignee:
            mseaton Mike Seaton
            Reporter:
            mseaton Mike Seaton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: