Skip to content

Commit

Permalink
Updates to use preprint item type (#3279)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam3smith committed Mar 25, 2024
1 parent b2c73c9 commit e5d3420
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 134 deletions.
45 changes: 27 additions & 18 deletions Europe PMC.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-06-19 08:52:49"
"lastUpdated": "2024-03-23 01:38:15"
}

/*
Expand Down Expand Up @@ -39,7 +39,7 @@
function detectWeb(doc, url) {
if (url.includes('/article/')) {
if (url.includes('/PPR/')) {
return 'report';
return 'preprint';
}
else {
return "journalArticle";
Expand All @@ -66,28 +66,30 @@ function getSearchResults(doc, checkOnly) {
return found ? items : false;
}

function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
Zotero.selectItems(getSearchResults(doc, false), function (items) {
if (!items) return;
Object.keys(items).forEach(scrape);
});
async function doWeb(doc, url) {
if (detectWeb(doc, url) == 'multiple') {
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
await scrape(await requestDocument(url));
}
}
else {
let jsonURL = getJSONURL(url);
if (jsonURL) {
scrape(jsonURL);
await scrape(jsonURL);
}
else {
Z.debug('Couldn\'t extract ID from URL: ' + url);
}
}
}

function scrape(jsonURL) {
ZU.doGet(jsonURL, function (respText) {
processJSON(JSON.parse(respText));
});

async function scrape(jsonURL) {
// Z.debug(jsonURL);
let respText = await requestJSON(jsonURL);
processJSON(respText);
}

function getJSONURL(pageURL) {
Expand All @@ -98,6 +100,7 @@ function getJSONURL(pageURL) {
}

function processJSON(json) {
// Z.debug(json);
if (!json.resultList || !json.resultList.result || !json.resultList.result.length) {
Z.debug('Query returned no results');
return;
Expand Down Expand Up @@ -145,8 +148,7 @@ function processPubTypeList(pubTypeList, item) {
if (!pubTypeList || !pubTypeList.pubType) return;

if (pubTypeList.pubType.length == 1 && pubTypeList.pubType[0] == 'Preprint') {
item.itemType = 'report';
item.extra = (item.extra || '') + `Type: article\n`;
item.itemType = 'preprint';
}
else {
item.itemType = 'journalArticle';
Expand Down Expand Up @@ -214,6 +216,7 @@ function processKeywordList(keywordList, item) {
}
}


/** BEGIN TEST CASES **/
var testCases = [
{
Expand Down Expand Up @@ -363,7 +366,7 @@ var testCases = [
"url": "https://europepmc.org/article/PPR/PPR358366",
"items": [
{
"itemType": "report",
"itemType": "preprint",
"title": "Fly ash application in moorum embankment and its stability analysis using FLAC/SLOPE and Response Surface Metho",
"creators": [
{
Expand All @@ -378,11 +381,17 @@ var testCases = [
}
],
"date": "2021",
"DOI": "10.21203/rs.3.rs-631949/v1",
"abstractNote": "This paper presents the application of fly ash in moorum embankment by partial replacement of moorum with fly ash and its stability analysis has been carried out. An experimental investigation was carried out on moorum blended with fly ash at different proportions of fly ash by dry weight of soil for the moorum embankment stability analysis. The Index properties and strength properties were assessed by performing Atterberg's limit, specific gravity, grain size distribution, compaction test, direct shear test (DST), and California Bearing Ratio (CBR) test respectively. The embankment slope stability analysis was performed using FLAC/SLOPE version 8.10 (Fast Lagrangian Analysis of Continua) software at a various slope angle of 30°, 32°, and 34° and different heights of the embankment of 6 m, 8 m, and 10 m to calculate Factor of Safety (FOS). FOS decreases with the increment of fly ash content, the height of embankment, and slope angle respectively. In addition to the numerical analysis, Response Surface Methodology (RSM) based (Face-Centered Central Composite Design) was used to predict FOS. The developed mathematical equation illustrates that the RSM model was statistically significant and the results give a reliable prediction of FOS.",
"extra": "Type: article",
"libraryCatalog": "Europe PMC",
"rights": "cc by",
"url": "https://doi.org/10.21203/rs.3.rs-631949/v1",
"attachments": [],
"attachments": [
{
"title": "Full Text PDF (Open access)",
"mimeType": "application/pdf"
}
],
"tags": [],
"notes": [],
"seeAlso": []
Expand Down
64 changes: 33 additions & 31 deletions F1000 Research.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-08-16 20:40:08"
"lastUpdated": "2024-03-21 19:05:49"
}

/*
Expand Down Expand Up @@ -44,7 +44,7 @@
function detectWeb(doc, url) {
if (url.includes('/articles/')
&& doc.querySelector('meta[name="citation_title"]')) {
return "report";
return "preprint";
}
else if (getSearchResults(doc, true)) {
return "multiple";
Expand Down Expand Up @@ -85,20 +85,21 @@ function scrape(doc, url) {
translator.setDocument(doc);

translator.setHandler('itemDone', function (obj, item) {
item.itemType = 'report';
item.extra = (item.extra || '') + '\nType: article'; // preprint

item.itemType = 'preprint';
delete item.pages;
delete item.reportType;

item.reportNumber = `${item.volume}:${item.issue}`;
delete item.genre;
if (item.volume && item.issue) {
item.archiveID = `${item.volume}:${item.issue}`;
}
delete item.volume;
delete item.issue;
delete item.number;

item.institution = item.publicationTitle;
delete item.publisher;
item.publisher = item.publicationTitle;
delete item.publicationTitle;
delete item.distributor;
delete item.company;
delete item.institution;
delete item.label;

if (item.date) {
item.date = ZU.strToISO(item.date);
Expand All @@ -110,7 +111,7 @@ function scrape(doc, url) {
});

translator.getTranslatorObject(function (trans) {
trans.itemType = "report";
trans.itemType = "preprint";
trans.doWeb(doc, url);
});
}
Expand All @@ -122,8 +123,8 @@ var testCases = [
"url": "https://f1000research.com/articles/10-614",
"items": [
{
"itemType": "report",
"title": "Cerebrospinal fluid neurofilament light levels in CLN2 disease patients treated with enzyme replacement therapy normalise after two years on treatment",
"itemType": "preprint",
"title": "Cerebrospinal fluid neurofilament light chain levels in CLN2 disease patients treated with enzyme replacement therapy normalise after two years on treatment",
"creators": [
{
"firstName": "Katharina",
Expand Down Expand Up @@ -186,13 +187,13 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2021-07-20",
"date": "2022-01-05",
"DOI": "10.12688/f1000research.54556.2",
"abstractNote": "Classic late infantile neuronal ceroid lipofuscinosis (CLN2 disease) is caused by a deficiency of tripeptidyl-peptidase-1. In 2017, the first CLN2 enzyme replacement therapy (ERT) cerliponase alfa (Brineura) was approved by the FDA and EMA. The CLN2 disease clinical rating scale (CLN2 CRS) was developed to monitor loss of motor function, language and vision as well as frequency of generalised tonic clonic seizures. Using CLN2 CRS in an open label clinical trial it was shown that Brineura slowed down the progression of CLN2 symptoms. Neurofilament light chain (NfL) is a protein highly expressed in myelinated axons. An increase of cerebrospinal fluid (CSF) and blood NfL is found in a variety of neuroinflammatory, neurodegenerative, traumatic, and cerebrovascular diseases. We analysed CSF NfL in CLN2 patients treated with Brineura to establish whether it can be used as a possible biomarker of response to therapy. Newly diagnosed patients had CSF samples collected and analysed at first treatment dose and up to 12 weeks post-treatment to look at acute changes. Patients on a compassionate use programme who were already receiving ERT for approximately 1yr had CSF samples collected and NfL analysed over the following 1.3 years (2.3 years post-initiation of ERT) to look at long-term changes. All newly diagnosed patients we investigated with classical late infantile phenotype had high NfL levels >2000 pg/ml at start of treatment. No significant change was observed in NfL up to 12 weeks post-treatment. After one year of ERT, two out of six patients still had high NfL levels, but all patients showed a continued decrease, and all had low NfL levels after two years on ERT. NfL levels appear to correspond and predict improved clinical status of patients on ERT and could be useful as a biomarker to monitor neurodegeneration and verify disease modification in CLN2 patients on ERT.",
"extra": "Type: article",
"institution": "F1000Research",
"archiveID": "10:614",
"language": "en",
"libraryCatalog": "f1000research.com",
"reportNumber": "10:614",
"repository": "F1000Research",
"rights": "http://creativecommons.org/licenses/by/4.0/",
"url": "https://f1000research.com/articles/10-614",
"attachments": [
Expand All @@ -203,7 +204,7 @@ var testCases = [
],
"tags": [
{
"tag": "Enzyme replacment therapy"
"tag": "Enzyme replacement therapy"
},
{
"tag": "Neurofilament light"
Expand All @@ -222,7 +223,7 @@ var testCases = [
"url": "https://f1000research.com/articles/10-153",
"items": [
{
"itemType": "report",
"itemType": "preprint",
"title": "Regional disparities in postnatal care among mothers aged 15-49 years old: An analysis of the Indonesian Demographic and Health Survey 2017",
"creators": [
{
Expand Down Expand Up @@ -252,12 +253,12 @@ var testCases = [
}
],
"date": "2021-08-16",
"DOI": "10.12688/f1000research.50938.2",
"abstractNote": "Background: In Indonesia, maternal mortality remains high, significantly 61.59% occur in the postnatal period. Postnatal care (PNC) provision is a critical intervention between six hours and 42 days after childbirth and is the primary strategy to reduce maternal mortality rates. However, underutilisation of PNC in Indonesia still remains high, and limited studies have shown the regional disparities of PNC in Indonesia. Methods: This study aims to explore the gaps between regions in PNC service for mothers who have had live births during the last five years in Indonesia. This study was a secondary data analysis study using the Indonesian Demographic and Health Survey (IDHS) in 2017. A total of 13,901 mothers aged 15-49 years having had live births within five years were included. Chi-squared test and binary logistic regression were performed to determine regional disparities in PNC. Results: Results indicated that the prevalence of PNC service utilisation among mothers aged 15-49 years was 70.94%. However, regional gaps in the utilisation of PNC service were indicated. Mothers in the Central of Indonesia have used PNC services 2.54 times compared to mothers in the Eastern of Indonesia (OR = 2.54; 95% CI = 1.77-3.65, p<0.001). Apart from the region, other variables have a positive relationship with PNC service, including wealth quintile, accessibility health facilities, age of children, childbirth order, mother's education, maternal occupation, spouse's age, and spouse's education. Conclusion: The results suggest the need for national policy focuses on service equality, accessible, and reliable implementation to improve postnatal care utilisation among mothers to achieve the maximum results for the Indonesian Universal Health Coverage plan.",
"extra": "Type: article",
"institution": "F1000Research",
"archiveID": "10:153",
"language": "en",
"libraryCatalog": "f1000research.com",
"reportNumber": "10:153",
"repository": "F1000Research",
"rights": "http://creativecommons.org/licenses/by/4.0/",
"shortTitle": "Regional disparities in postnatal care among mothers aged 15-49 years old",
"url": "https://f1000research.com/articles/10-153",
Expand Down Expand Up @@ -475,7 +476,7 @@ var testCases = [
"url": "https://hrbopenresearch.org/articles/4-87",
"items": [
{
"itemType": "report",
"itemType": "preprint",
"title": "Effectiveness of quality improvement strategies for type 1 diabetes in children and adolescents: a systematic review protocol",
"creators": [
{
Expand Down Expand Up @@ -525,12 +526,12 @@ var testCases = [
}
],
"date": "2021-08-10",
"DOI": "10.12688/hrbopenres.13223.1",
"abstractNote": "Introduction: Optimal glycaemic control is often a challenge in children and adolescents with type 1 diabetes (T1D). Implementation of patient, clinician or organisation-targeted quality improvement (QI) strategies has been proven to be beneficial in terms of improving glycaemic outcomes in adults living with diabetes. This review aims to assess the effectiveness of such QI interventions in improving glycaemic control, care delivery, and screening rates in children and adolescents with T1D. Methods and analysis: MEDLINE, EMBASE, CINAHL and Cochrane CENTRAL databases will be searched for relevant studies up to January 2021. Trial registries, ClinicalTrials.gov and ICTRP, will also be explored for any ongoing trials of relevance. We will include trials which examine QI strategies as defined by a modified version of the Cochrane Effective Practice and Organisation of Care 2015 Taxonomy in children (<18 years) with a diagnosis of T1D. The primary outcome to be assessed is glycated haemoglobin (HbA1c), although a range of secondary outcomes relating to clinical management, adverse events, healthcare engagement, screening rates and psychosocial parameters will also be assessed. Our primary intention is to generate a best-evidence narrative to summarise and synthesise the resulting studies. If a group of studies are deemed to be highly similar, then a meta-analysis using a random effects model will be considered. Cochrane Risk of Bias 1.0 tool will be applied for quality assessment. All screening, data extraction and quality assessment will be performed by two independent researchers. Dissemination: The results of this review will be disseminated through peer-reviewed publication in order to inform invested partners (e.g., Paediatric Endocrinologists) on the potential of QI strategies to improve glycaemic management and other related health outcomes in children with T1D, thereby guiding best practices in the outpatient management of the disorder. PROSPERO registration number: CRD42021233974 (28/02/2021).",
"extra": "Type: article",
"institution": "HRB Open Research",
"archiveID": "4:87",
"language": "en",
"libraryCatalog": "hrbopenresearch.org",
"reportNumber": "4:87",
"repository": "HRB Open Research",
"rights": "http://creativecommons.org/licenses/by/4.0/",
"shortTitle": "Effectiveness of quality improvement strategies for type 1 diabetes in children and adolescents",
"url": "https://hrbopenresearch.org/articles/4-87",
Expand Down Expand Up @@ -569,6 +570,7 @@ var testCases = [
},
{
"type": "web",
"defer": true,
"url": "https://f1000research.com/search?q=test",
"items": "multiple"
},
Expand All @@ -577,7 +579,7 @@ var testCases = [
"url": "https://gatesopenresearch.org/articles/5-122",
"items": [
{
"itemType": "report",
"itemType": "preprint",
"title": "Young infant clinical signs study­­, Pakistan: a data note",
"creators": [
{
Expand Down Expand Up @@ -612,12 +614,12 @@ var testCases = [
}
],
"date": "2021-08-12",
"DOI": "10.12688/gatesopenres.13317.1",
"abstractNote": "Neonatal sepsis is the leading cause of child death globally with most of these deaths occurring in the first week of life.  It is of utmost public health importance that clinical signs predictive of severe illness and need for referral are identified early in the course of illness. From 2002-2005, a multi country trial called the Young Infant Clinical Signs Study (YICSS) was conducted in seven sites across three South-Asian (Bangladesh, India, and Pakistan), two African (Ghana, and South Africa), and one South American (Bolivia) country. The study aimed to develop a simplified algorithm to be used by primary healthcare workers for the identification of sick young infants needing prompt referral and treatment. The main study enrolled 8,889 young infants between the ages of 0-59 days old. This dataset contains observations on 2950 young infants aged 0-59 days from the Pakistan site. The data was collected between 2003-2004 with information on the most prevalent signs and symptoms. The data from this study was used to update the Integrated Management of Childhood Illness guidelines. The World Health Organisation (WHO) seven-sign algorithm has been used in other major community-based trials to study possible serious bacterial infection and its treatment regimens.",
"extra": "Type: article",
"institution": "Gates Open Research",
"archiveID": "5:122",
"language": "en",
"libraryCatalog": "gatesopenresearch.org",
"reportNumber": "5:122",
"repository": "Gates Open Research",
"rights": "http://creativecommons.org/licenses/by/4.0/",
"shortTitle": "Young infant clinical signs study­­, Pakistan",
"url": "https://gatesopenresearch.org/articles/5-122",
Expand Down
44 changes: 21 additions & 23 deletions NASA NTRS.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-09-01 04:47:52"
"lastUpdated": "2024-03-21 20:00:21"
}

/*
Expand Down Expand Up @@ -67,18 +67,16 @@ function getSearchResults(doc, checkOnly) {
return found ? items : false;
}

function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
Zotero.selectItems(getSearchResults(doc, false), function (items) {
if (!items) return;
for (let url of Object.keys(items)) {
// don't bother fetching the doc, it's useless
scrape(null, url);
}
});
async function doWeb(doc, url) {
if (detectWeb(doc, url) == 'multiple') {
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
await scrape(null, url);
}
}
else {
scrape(doc, url);
await scrape(doc, url);
}
}

Expand All @@ -98,7 +96,8 @@ function mapType(docType) {
patent: 'patent',
'computer program': 'computerProgram',
'motion picture|video': 'videoRecording',
'preprint|manuscript': 'manuscript'
preprint: 'preprint',
manuscript: 'manuscript'
};

for (let [regex, itemType] of Object.entries(mapping)) {
Expand Down Expand Up @@ -216,16 +215,14 @@ function processJSON(json) {
return item;
}

function scrape(doc, url) {
ZU.doGet(url.replace('/citations', '/api/citations'), function (text) {
let json = JSON.parse(text);
let item = processJSON(json);
item.url = url;
if (doc) {
item.attachments.push({ title: "Snapshot", document: doc });
}
item.complete();
});
async function scrape(doc, url) {
let json = await requestJSON(url.replace('/citations', '/api/citations'));
let item = processJSON(json);
item.url = url;
if (doc) {
item.attachments.push({ title: "Snapshot", document: doc });
}
item.complete();
}

/** BEGIN TEST CASES **/
Expand Down Expand Up @@ -550,7 +547,7 @@ var testCases = [
],
"tags": [
{
"tag": "SPACE VEHICLES"
"tag": "Space Vehicles"
}
],
"notes": [],
Expand Down Expand Up @@ -609,4 +606,5 @@ var testCases = [
]
}
]

/** END TEST CASES **/

0 comments on commit e5d3420

Please sign in to comment.