Reminder: Create & find trunk-related issues here. Legacy Trac tickets are still available. Problems? Workflow feedback? Need a module project? Open a support ticket.

OpenMRS Trunk

Default message when patient identifier validation fails

Details

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

    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?

    Show
    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?
  1. defaultIdentifierValidationError.patch
    (0.8 kB)
    Burke Mamlin
    2009-12-21 19:12:57 EST

Activity

Hide
Ben Wolfe added a comment - 2009-12-21 19:27:38 EST

Looks fine to me.

Show
Ben Wolfe added a comment - 2009-12-21 19:27:38 EST Looks fine to me.
Hide
Mike Seaton added a comment - 2009-12-22 01:38:27 EST

Committed to 1.5.x in rev:11547.
Committed to trunk in rev:11548.
Committed to 1.4.x in rev:11549.

Show
Mike Seaton added a comment - 2009-12-22 01:38:27 EST Committed to 1.5.x in rev:11547. Committed to trunk in rev:11548. Committed to 1.4.x in rev:11549.

People

Dates

  • Created:
    2009-12-21 19:12:43 EST
    Updated:
    2010-07-08 16:22:10 EDT
    Resolved:
    2010-07-01 22:45:42 EDT