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

Configurable mechanism for automatically assigning encounters to visits


    • Type: New Feature
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9 Road Map Sprint 4
    • Component/s: None
    • Labels:
    • Complexity:


      We need business logic that decides when to assign created encounters to existing visits, and when to create new visits.

      The tentative design is to have three built-in modes:

      1. "None, save encounters exactly as-they-are" (Burke doesn't like this.)
      2. "Assign encounters to existing visits but don't create new visits"
        • if encounterDatetime and location are compatible with an existing visit, assign the encounter to that visit
          • if visit.location contains encounter.location -> compatible
          • if encounter.location is null -> compatible
      3. "Assign encounters to existing or create if necessary"
        • (same as above, plus...)
        • if no suitable visit, start a new visit with startDatetime = encounterDatetime and endDatetime = lastMinuteOfDay(encounterDatetime)
          • if necessary, relax VisitValidator to allow endDatetime to be as late as midnight tonight, but no further in the future.

      We need to discuss with the broader community whether all three modes are necessary, and whether these are sufficient for the main (straightforward) use cases.

      Also, we need to implement this using an interface such that modules can plug in their own implementations.

      Presumably we need a global property that gives the classname of the handler to activate


          Issue Links



              • Assignee:
                darius Darius Jazayeri [X] (Inactive)
                darius Darius Jazayeri [X] (Inactive)
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: