Map text values

Mapping text values from the source data to specified text values or to a different hierarchy of terms involves a data transformation. For example, you can use mapping to do the following:

  • Combine multiple adverse events from the source data into a single combined event.
  • Specify that PTs from the source data should use a non-primary path for hierarchy values assigned by the application.
  • Recode drug names from the source data.

The mapped values can be selected for use in an MGPS data mining run.

Note:

See Defining custom terms for another way of mapping values to a term that you specify for a data mining run. See Comparing custom terms and mapped text values for information on the differences between these features.

To map text values, you use a text editor to create a file that contains the mappings and then you upload the file to a mapped variable in the configuration. To view the current mappings for a variable, edit the configuration, and for the mapped variable click View Current Mapping.

Note:

If you modify a mapping file, your changes are not applied automatically to the mapped variable. You must edit the configuration and upload the modified mapping file for the mapped variable.

Text mapping process

  1. Determine how you want to map values. This example maps several PTs to the term, Cognitive impairment, and specifies that the term Cognitive impairment will use hierarchy values for the PT, Mental impairment.
  2. In Microsoft Notepad or another text editor, create a mapping file and type the following column headings on the first line of the document:
    Create a mapping file and type the column headings.
  3. On the second line, type in the first old value (as it appears in the data, including capitalization), a comma, and then the new value. The new value does not need to exist in the source data. You must specify both an old value and new value. If you do not specify both values, values might be omitted from run results.
  4. Type in the value that uses the hierarchy that you want to use for the new value. The hierarchy value is used only if the mapped variable is set up with a hierarchy. An exact match (including capitalization) of the hierarchy value must exist in the hierarchy, although it does not need to exist in the source data. If the mapped variable is set up to use a hierarchy, you must specify a hierarchy value.
  5. You must separate each term with a comma. Do not include extra spaces or any extra carriage returns.
    Separate each term with a comma.

    Note:

    If a term includes a comma, enclose the term in double quotation marks (for example, "Gastric ulcer, perforated"). If a term includes a double quotation mark, enter a backslash before the double quotation mark (for example, "Gastric ulcer, \"perforated\""). When you view the current mapping on the Edit Variable page, the double quotation marks and/or backslashes do not appear.
  6. Repeat this process for each value that you want to map. This example maps several PTs to the same new value and hierarchy value. This is not a requirement for the mapping file. In the same mapping file, you can map different PTs to different new values and hierarchy values.
    You can map several PTs to the same new value and hierarchy value.

    Note:

    You can perform only one level of mapping. In the above example, if you also map Cognitive impairment to Cognitive decline, none of the old values are mapped to Cognitive decline.

    In the last line of the above example, the old value is mapped to a new value but continues to use the hierarchy of the old value. If the new value already exists in the source data, the hierarchy value applies to the existing value, as well. In this example, if Cognitive impairment is in the source data, the hierarchy for Mental impairment is used for it.

  7. Make sure that there are no extra carriage returns or spaces in the file. The mapping does not work properly if there are extra carriage returns or spaces.
  8. Save the file with the extension .csv.

Changing only the hierarchy

If you want to change only the hierarchy used for the old value, enter the same old and new value, and then the hierarchy value:

Changing only the hierarchy used for the old value

Generating results for mapped values

When creating a data mining run, choose the new variable. (Because you did not modify the original variable, that variable is also still available for selection.) Results are generated for combinations including the new value, as in the following example:

Generating results for mapped values.

Note:

There might be more results for Insulin and the pre-mapped terms than for Insulin and the new mapping term because cases that include multiple pre-mapped terms are counted only once for the new mapping term.