CDR Tickets

Issue Number 4040
Summary PublishPreview fails for certain URLs
Created 2016-03-04 14:42:23
Issue Type Bug
Submitted By Englisch, Volker (NIH/NCI) [C]
Assigned To Englisch, Volker (NIH/NCI) [C]
Status Closed
Resolved 2016-03-28 18:01:36
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.180202
Description

Victoria reported one of her summaries failing when she ran the PP report. It's "Adult Hodgkin Lymphoma Treatment" (CDR62675). This summary contains xref attributes containing single quotes that are not escaped and this is causing a SQL script that's part of the PP report to fail.

Comment entered 2016-03-04 14:51:12 by Englisch, Volker (NIH/NCI) [C]

Adding Robin as a watcher. This ticket needs to go into Darwin (or sooner). It's a 5 minute fix, 5 hours testing.

Comment entered 2016-03-08 16:37:44 by Englisch, Volker (NIH/NCI) [C]

It appears that the URL for PUBMED citations can be entered two different ways. Once by using the title of the publication and once by using the PUBMED-ID. I've asked Louise to change the URL
http://www.ncbi.nlm.nih.gov/pubmed/?term=ABVD+alone+versus+radiation-based+therapy+in+limited-stage+Hodgkin's+lymphoma
to
http://www.ncbi.nlm.nih.gov/pubmed/22149921
in order to avoid the problem of the single quote getting in the way for the SQL query.

This is a workaround that should allow us to run the PP report as is until Darwin goes live.

Comment entered 2016-03-08 16:51:34 by Juthe, Robin (NIH/NCI) [E]

Victoria is going to ask Louise and Bonnie to use the PMID format above going forward (and also make sure summaries that have been published already with the new key references section have links in this format) since it's neater and more consistent. So, although this fix wouldn't hurt, it may no longer be needed. Let's discuss on Thursday.

Comment entered 2016-03-08 16:57:18 by Englisch, Volker (NIH/NCI) [C]

Please note:
The error is completely unrelated to the new Key References section. We have code in the PublishPreview.py program to identify if a link is an internal (on the page) link or not which requires to run a SQL query using the URL of the link. This query gets confused when the URL passed to the SQL query contains the single quote.

Comment entered 2016-03-18 14:11:51 by Englisch, Volker (NIH/NCI) [C]

The following program has been modified to fix the single quote (') error in the SELECT statement:

  • R13787: PublishPreview.py

This is ready for review on DEV.

Our workaround on PROD was to replace the "bad" URL with the PMID in the Key References section. I have replaced this URL again on DEV to include a URL with single quote for CDR62675.

Comment entered 2016-03-25 17:05:21 by Juthe, Robin (NIH/NCI) [E]

I am testing this in the Acupuncture patient summary (CDR458088). I added an External Ref with an ' in it at the beginning of the summary. However, I'm getting an error message when running Pub Preview:

Database failure: Incorrect syntax near 'Manning'.

Comment entered 2016-03-25 17:28:14 by Englisch, Volker (NIH/NCI) [C]

The link you created is the following, so somewhere an additional quote was created at the end of the URL:
http://www.ncbi.nlm.nih.gov/pubmed/?term='Manning+AT%2C+Wood+C%2C+Eaton+A%2C+et+al.+Nipple-sparing+mastectomy+in+patients+with+BRCA1%2F2+mutations+and+variants+of+uncertain+significance.+Br+J+Surg+102%2811%29%3A+1354-9%2C+2015.+PMID%3A+26313374'

Obviously, the PP report should not fail regardless if there's a single quote within the URL or at the beginning. I'll have to find out what's wrong with this string and fix it in the next iteration.

Comment entered 2016-03-28 18:01:10 by Englisch, Volker (NIH/NCI) [C]

The fix of the problem was as simple as copying the file. I must have tested in my local sandbox, versioned the file but not copied it to the Inetpub directory.
I've copied the file and was able to run the PP report for your modified summary without error.

I'm not sure if this ticket will be included in IT-1 tickets that will be moved to QA.

Comment entered 2016-03-29 12:09:21 by Englisch, Volker (NIH/NCI) [C]

I'm not sure if this ticket will be included in IT-1 tickets that will be moved to QA.

This fix is part of the IT-1 code on QA and may be tested.

Comment entered 2016-04-01 10:14:31 by Juthe, Robin (NIH/NCI) [E]

Verified on QA.

Comment entered 2016-06-15 09:55:41 by Juthe, Robin (NIH/NCI) [E]

I have not yet had a legitimate occasion to test this on PROD - closing the ticket and will reopen if we have a problem.

Elapsed: 0:00:00.001549