Closed peetucket closed 1 year ago
Investigation of this by (1) searching for the title above on the PublicationsController#sourcelookup
method (which is what the API call for searching for publications uses) https://github.com/sul-dlss/sul_pub/blob/main/app/controllers/publications_controller.rb#L152C4-L152C4 and then (2) taking the resulting IDs and sending a message to AuthorshipsController#create
This worked as expected for the publication above. However, I noticed the response from the sourcelookup includes a PMID even though the search is from WoS. The PMID includes the "MEDLINE:" prefix. If you send a PMID with a MEDLINE: prefix to the authorship controller instead of sending the WOS_UID, the publication is not found. This is because when we get a request to add a publication for a specific PMID, we go straight to the Pubmed API to look for that PMID, and to do this, we do NOT want the MEDLINE: prefix.
I suspect the Profiles code is inspecting the response, and if it finds a PMID, it sends that preferentially over the WOS UID. (I verified that ONLY send the PMID in this example, even though our search result included both the WOS UID and the PMID) Previously I suspect the WOS record was not including the PMID, so Profiles was sending the WOS UID. Now the WOS response includes the PMID, so they are sending that instead, and with the MEDLINE: prefix, the lookup fails when adding.
Solutions:
The first is the best solution, but will likely take time from them to implement unless they are actively working on the code. In the meanwhile, we can implement two very easily. The only potential issue is that the search results will have come from WoS, but when they add the publication, it will actually come from Pubmed. I believe this is fine though, the metadata should all be the same.
Also, we are creating Pubhash records with invalid Pubmed URLs that look like this: https://www.ncbi.nlm.nih.gov/pubmed/MEDLINE:35414268
Reported in #sul-cap-collab :