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

Add upgrade script to set a preferred identifier for patients without one

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      After adding a check to enforce setting of a preferred patient identifier see TRUNK-256, whenever a user edits a patient that has no preferred identifier, the patient validator rejects the patient. This will be frustrating to users each time they edit such patients, so we need to update all patients by setting a preferred identifier. There are 2 approaches(not limited to these) we have in mind:

      a) Through a liquibase changeset that runs through all patients and sets a preferred identifier from the the collection of each patient's active identifiers.
      b) Through a scheduled task that runs when upgrade is done since this wouldn't have the admin stuck on the upgrade page for implementations with a large number of patients

      Things you might want to keep in mind:
      1 - You can ignore voided patients and those with a preferred identifier(might be a harder SQL statement to write but should be possible) when fetching the patients from the database in case of option 'a'
      2 - Make sure you are setting from active identifiers therefore ignore retired ones when fetching them from the database.
      3 - If the option 'b' above is chosen, fetch patients in batches rather than all in one go to save memory.

        Gliffy Diagrams

          Attachments

          1. 1_task_is_suspended_(table).png
            1_task_is_suspended_(table).png
            127 kB
          2. 1_task_is_suspended.png
            1_task_is_suspended.png
            152 kB
          3. 2_task_is_resumed_(part1).png
            2_task_is_resumed_(part1).png
            155 kB
          4. 2_task_is_resumed_(part2).png
            2_task_is_resumed_(part2).png
            242 kB
          5. 2_task_is_resumed_(table).png
            2_task_is_resumed_(table).png
            142 kB
          6. TRUNK-2152.patch
            1 kB
          7. TRUNK-2152-WITH-AFTER-REVIEW-FIXES.patch
            1 kB
          8. update_st_results.png
            update_st_results.png
            87 kB

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  cta Taras Chorny
                  Reporter:
                  wyclif Wyclif Luyima
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: