Uploaded image for project: 'i2b2 Core Software'
  1. i2b2 Core Software
  2. CORE-184

Generated SQL is not escaping single quotes correctly if a space exists between multiple values in C_DIMCODE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.06
    • Fix Version/s: 1.7.08
    • Component/s: CRC Cell
    • Labels:
      None
    • Rank:
      0|i0023r:
    • Affects View/s:
      Query Tool
    • i2b2 Feature/s:
      Queries
    • i2b2 Related Project/s:
      BBP
    • Affects Database/s:
      All databases
    • Reproduction Notes:
      This can be reproduced in the i2b2 test environment.

      Description

      In the metadata tables, concepts can be setup as a multiple in which a single concept will automatically include other concepts when a query is run. The concepts to be included are defined in the C_DIMCODE column.

      The problem is when there is a space between the values entered in the C_DIMCODE the single quotes are not being escaped properly when the SQL is generated. This is resulting in the incorrect number of patients being returned.

      If you remove the spaces between values the single quotes are being escaped correctly.

      The following two examples were done using the i2b2 demo data.

      EXAMPLE 1: Spaces in the C_DIMCODE

      C_FULLNAME = \i2b2\Demographics\Race\Black\
      C_DIMCODE = 'b', 'black', 'hib', 'his/black'

      Excerpt of SQL Generated =
             RACE_CD IN ('b'', ''black'', ''hib'', ''his/black')


      EXAMPLE 2: No spaces in the C_DIMCODE

      C_FULLNAME = \i2b2\Demographics\Race\Black\
      C_DIMCODE = 'b','black','hib','his/black'

      Excerpt of SQL Generated =
            RACE_CD IN ('b','black','hib','his/black')


      WHAT SHOULD HAPPEN:
      Regardless of whether or not there are spaces between the values, the generated SQL should escape the single quotes correctly.


        Attachments

          Activity

            People

            • Assignee:
              jmd86 Janice Donahoe
              Reporter:
              jmd86 Janice Donahoe
              Participant/s:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code