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

Incorrect error message when trying to create an encounter and put it in a visit with incompatible start/end date

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: OpenMRS 1.9.0
    • Component/s: None
    • Labels:
    • Complexity:
      Undetermined

      Description

      I am trying to create an encounter (from admin/encounters/encounter.form) and I chose a visit with incompatible start date for the datetime of the encounter. I try to save, but I only see the error message "Please fix all errors and try again. encounter".

      I see a stack trace in my logs indicating the real error:

      ERROR - EncounterFormController.onSubmit(208) |2011-12-05 16:20:19,695| Error while trying to save the encounter
      org.openmrs.api.APIException: 'Encounter: [(no ID) Mon Dec 05 00:00:00 PST 2011 ADULTINITIAL (no Location) 2 (no Form) num Obs: [] num Orders: 0 ]' failed to validate with reason: encounterDatetime: The encounter datetime should be between the visit start and stop dates.
      	at org.openmrs.validator.ValidateUtil.validate(ValidateUtil.java:107)
      	at org.openmrs.api.db.hibernate.HibernateAdministrationDAO.validateInManualFlushMode(HibernateAdministrationDAO.java:353)
      	at org.openmrs.api.impl.AdministrationServiceImpl.validateInManualFlushMode(AdministrationServiceImpl.java:1224)
      

      The correct behavior is to show that error message next to the correct field in the form, and to write nothing to the log file.

      (I think this error may actually not exist until I do a commit shortly.)

        Gliffy Diagrams

          Attachments

            Issue Links

              Attachments-Category-Modification

                Activity

                  People

                  • Assignee:
                    dkayiwa Daniel Kayiwa
                    Reporter:
                    darius Darius Jazayeri
                  • Votes:
                    0 Vote for this issue
                    Watchers:
                    3 Start watching this issue

                    Dates

                    • Created:
                      Updated:
                      Resolved: