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

VisitValidator should ensure that the visit start date can't be before the birth date of the patient

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: Platform 1.12.0, Platform 1.11.6, Platform 2.0.0
    • Fix Version/s: Core 2.2.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      Visit validation should fail if the startDatetime is before the patient's birthdate.

      If the patient's birthdate is estimated, then we cannot strictly validate against the exact value of patient.birthdate (because the OpenMRS API should be pretty permissive, though specific UIs and forms can choose to be stricter).

      Open Questions

      • Darius's proposal: if patient.birthdateEstimated is true, then add a 50% margin of error to patient.birthdate before validating, adding a minimum of 1 year. (E.g. if a patient is approximately 20 years old we would allow visits up to 30 years ago. If a patient is approximately 9 months old, we'd allow visits up to 1 year and 9 months ago.)

        Attachments

        1. exception.txt
          4 kB
        2. testsError.txt
          0.6 kB

          Issue Links

            Activity

              People

              Assignee:
              benwaters Ben Waters [X] (Inactive)
              Reporter:
              ssmusoke Stephen Senkomago Musoke
              Designated Committer:
              Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days
                  3d