Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-4569

CiviCase : String and pattern-based redaction for Case Details report

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.5
    • Fix Version/s: 3.0
    • Component/s: CiviCase
    • Labels:
      None

      Description

      This issue supplements the existing redaction of contact names, handling redaction of user input strings occuring in the following data elements:

      • Activity subject and description
      • Activity custom fields of type Text and Memo (note)

      Redaction output should allow readers to recognize repeated instances of the same string within case data and to identify the "semantic type of the data element" (e.g. "Vancouver" is always redacted as "city_20adx1").

      Implementation
      ===========
      Redaction should be implemented as a standalone class - such that strings can be passed to it for a variety of output cases going forwarded. The redaction function should be a wrapper around the actual string rewrite method - which will be MD5 for the initial implementation - so it's easy to change the actual modification method if necessary.

      1. Admin interface for adding and editing Redaction Rules:

      • Create new "group" in administration console for CiviCase
      • Create a new option group for "Redaction Rules" - and provide access to view and edit option value records in this group under the CiviCase admin section.
      • ** Move "Case Type" option list into the CiviCase admin section

      2 The input strings/dates etc to be redacted are stored in the 'civicrm_option_value' table :
      a) Explicit string replacement
      For strings like Vancouver, store :

      "Vancouver" => label (this is the string to match)
      "city_" => value (this is prefix descriptor to use in redacted output)

      Redaction logic should replace all occurrences of "label" with the "value" appended by md5 of the label. Matches and md5 operations are all done lower-cased.
      EX: 'Vancouver' or 'vancouver' are replaced by "city_" . md5('vancouver')

      b) Pattern replacement
      Regular expressions are used to identify and place string patterns such as initials and date.
      Set civicrm_option_value.filter = 1 to distinguish Regular Expression rules from explicit string matches.

      Example for dates :

      "/\d

      {4}

      -?\d

      {2}-?\d{2}

      /" => label
      "date_" => value
      1 => filter

      Redaction logic replaces the matched regular expression with "date_" appended with md5($dateString)

        Attachments

        1. Picture 2.png
          71 kB
          David Greenberg
        2. Picture 3.png
          46 kB
          David Greenberg

          Issue Links

            Activity

              People

              • Assignee:
                mover Michał Mach
                Reporter:
                dgg David Greenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: