CDR Tickets

Issue Number 4425
Summary [Summary] Fragment ID not displaying in XMetal for Misc. Doc Links
Created 2018-02-20 20:14:14
Issue Type Bug
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Englisch, Volker (NIH/NCI) [C]
Status Closed
Resolved 2018-03-07 11:36:07
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.221470
Description

Misc. Docs links usually display the inline text as well as the fragment ID in XMetal. However, we are finding out that this is not happening for new links recently. Only the inline text is displaying although the attribute inspector is displaying the CDR ID and fragment id correctly. Please see attached sample screenshots.

Comment entered 2018-02-21 17:46:45 by Englisch, Volker (NIH/NCI) [C]

How do you enter this element? I don't seem to be able to select a fragment ID and when I select a misc. document it doesn't include a fragment that could be displayed.

Comment entered 2018-02-27 18:43:00 by Osei-Poku, William (NIH/NCI) [C]

You need to go into the Misc. Doc and Copy fragment link from there and then Paste the fragment link within the Misc Doc Link element in the summary.

Comment entered 2018-03-05 15:28:48 by Englisch, Volker (NIH/NCI) [C]

, this looks like it may be a Gauss bug.

When the user adds a MiscellaneousDocLink and selects a fragment, the element text is first displaying the DocTitle

Patient Summary Fragments;Patient summary fragments

which gets replaced by the DocTitle up to the semi-colon, I think

Patient Summary Fragments

once the summary is saved.
If the user enters a document fragment link, however, the replaced text would include the fragment ID

Patient Summary Fragments[Spanish] [_53]

but the system isn't replacing the original text anymore.
I have a strong feeling this again is related to a problem with the hash-sign when filtering the misc. doc with a fragment link.

Could you point me to where the saved document updates the displayed text in the original document? I'm guessing this is done via a filter.

Comment entered 2018-03-05 16:22:35 by Osei-Poku, William (NIH/NCI) [C]

Could you point me to where the saved document updates the displayed text in the original document? I'm guessing this is done via a filter.

If you take a look at this summary CDR0000256491 on PROD and scroll down to the "Treatment for adult primary liver cancer may cause side effects." section, you will find one there and several below that section.

Comment entered 2018-03-05 17:27:28 by Englisch, Volker (NIH/NCI) [C]

Sorry, , the question was actually for Bob. I wanted to know where in the CDR code the document gets saved and the link text gets filtered.

Comment entered 2018-03-05 17:58:28 by Kline, Bob (NIH/NCI) [C]

I think you're looking for the Fast Denormalization Filter (CDR0000000095). From a cursory glance, I'm going to guess it won't work properly if the `cdr:ref` attribute's value has a hash character in it.

  <xsl:template                  match = "*[@cdr:ref != '']">
    <xsl:variable                 name = "link"
                                select = "@cdr:ref"/>
    <xsl:variable                 name = "fragId">
      <xsl:if                     test = "contains($link, '#')">
        <xsl:value-of           select = "substring-after($link, '#')"/>
      </xsl:if>
    </xsl:variable>
    <xsl:variable                 name = "uri"
                                select = "concat('cdrx:', $link, '/DocTitle')"/>
    <xsl:variable                 name = "tmp">
      <xsl:value-of             select = "document($uri)/CdrDocTitle"/> <!-- fails for # -->
    </xsl:variable>
    <xsl:variable                 name = "title">
      <xsl:choose>
        <xsl:when                 test = "contains($tmp, ';')">
          <xsl:value-of         select = "substring-before($tmp, ';')"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of         select = "$tmp"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:element                  name = "{name()}">
      <xsl:apply-templates      select = "@*"/>
      <xsl:choose>
        <xsl:when                 test = "$title=''">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when             test = "$fragId=''">
              <xsl:value-of     select = "$title"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of     select = "concat($title, ' [', $fragId, ']')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:element>
  </xsl:template>

I guess this is one of the filters we hadn't gotten to yet in the unit testing process.

Comment entered 2018-03-05 18:03:23 by Englisch, Volker (NIH/NCI) [C]

Yes, that's what I was looking for. Thank you!

Comment entered 2018-03-07 11:35:50 by Englisch, Volker (NIH/NCI) [C]

This problem has been fixed on DEV and QA by modifying the following filter:

  • CDR000095: Fast Denormalization Filter [cdr4425-fragid 3fa0d96]

Please verify on QA (since DEV is still sick).

Comment entered 2018-03-07 18:36:53 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA. Thanks!

Comment entered 2018-03-08 16:08:00 by Englisch, Volker (NIH/NCI) [C]

This change has been moved to STAGE and PROD.

Please verify on PROD and close the ticket.

Comment entered 2018-04-18 17:43:13 by Englisch, Volker (NIH/NCI) [C]

can we close this ticket since the filter changes are already in production?

Comment entered 2018-04-19 11:21:09 by Osei-Poku, William (NIH/NCI) [C]

Yes, this can be closed. I will go ahead and close it. Thanks!

Attachments
File Name Posted User
Misc Doc Link.png 2018-02-20 20:13:03 Osei-Poku, William (NIH/NCI) [C]
Misc Doc Link ERROR.png 2018-02-20 20:13:03 Osei-Poku, William (NIH/NCI) [C]

Elapsed: 0:00:00.001857