{"record":{"id":"057e6905ca298a3f","repo":"jackwener/OpenCLI","slug":"pubmed-review","errorCode":null,"errorMessage":"pubmed review","messagePattern":"pubmed review","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/pubmed/review.js","lineNumber":54,"sourceCode":"        const sort = requireChoice(args.sort, ['date', 'relevance'], 'sort', 'date');\n        const searchQuery = buildSearchQuery(query, {\n            yearFrom,\n            yearTo,\n            articleType: 'Review',\n            hasAbstract: args['has-abstract'],\n        });\n        const esearch = await eutilsFetch('esearch', {\n            term: searchQuery,\n            retmax: limit,\n            usehistory: 'y',\n            sort: sort === 'date' ? 'pub_date' : '',\n        }, { label: 'pubmed review' });\n        const pmids = esearch?.esearchresult?.idlist;\n        if (!Array.isArray(pmids)) {\n            throw new CommandExecutionError('pubmed review did not return an id list', 'PubMed ESearch response shape may have changed.');\n        }\n        if (pmids.length === 0) {\n            throw new EmptyResultError('pubmed review', `No review articles matched \"${query}\".`);\n        }\n        return fetchSummaryRows(pmids, 'pubmed review summary');\n    },\n});\n","sourceCodeStart":36,"sourceCodeEnd":59,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pubmed/review.js#L36-L59","documentation":"This EmptyResultError ('pubmed review') is thrown when the review-article search completed successfully but matched zero PMIDs. The query was accepted by PubMed; no review-typed articles satisfied it. It is a normal empty result, not an infrastructure problem.","triggerScenarios":"A highly specific query with the review publication-type filter applied (e.g. rare disease plus narrow subheading) that no reviews cover; misspelled terms; an over-restrictive date range combined with the review filter.","commonSituations":"Searching niche topics expecting reviews that do not exist; combining many ANDed terms; restricting to a single recent year where no review was published; using field tags that conflict with the review filter.","solutions":["Broaden the query (drop the most specific term or split into multiple searches)","Remove or widen the date range","Confirm the topic has reviews by searching PubMed manually with the Review filter on","Fall back to the general `pubmed search` command and filter review-like articles yourself"],"exampleFix":"// before\nclis.pubmedReview({ query: 'CRISPR base editing AND retinitis pigmentosa AND 2025[PDAT]' });\n// after\nclis.pubmedReview({ query: 'CRISPR base editing' });","handlingStrategy":"fallback","validationCode":"// Pre-flight count with the review filter before the full call\nconst probe = await eutilsFetch('esearch', { term: `${query} AND review[pt]`, retmax: 0 }, { label: 'probe' });\nif (Number(probe?.esearchresult?.count ?? 0) === 0) console.warn('No review articles for this query — consider broadening');","typeGuard":null,"tryCatchPattern":"try {\n  return await clis.pubmedReview({ query, limit });\n} catch (e) {\n  if (e.name === 'EmptyResultError' && e.scope === 'pubmed review') {\n    return clis.pubmedSearch({ query }); // broader fallback search\n  }\n  throw e;\n}","preventionTips":["Start with broad queries and narrow iteratively","Widen or drop date ranges when combined with the review filter","Manually verify in PubMed (Review filter) that reviews exist before assuming a bug","Surface empty states to users instead of retrying — retries cannot create results"],"tags":["empty-result","search","pubmed","review"],"backgroundTag":"empty-search-result","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}