@yeyuan98/opencode-bioresearcher-plugin 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -93,7 +93,6 @@ export interface ParsedArticle {
|
|
|
93
93
|
doi: string | null;
|
|
94
94
|
abstract: string | null;
|
|
95
95
|
keywords: string[];
|
|
96
|
-
publicationDate?: string;
|
|
97
96
|
error?: string;
|
|
98
97
|
}
|
|
99
98
|
export interface ProcessingStats {
|
|
@@ -104,7 +103,6 @@ export interface ProcessingStats {
|
|
|
104
103
|
export interface ExcelRow {
|
|
105
104
|
PMID: string;
|
|
106
105
|
Title: string;
|
|
107
|
-
PublicationDate: string;
|
|
108
106
|
Authors: string;
|
|
109
107
|
Journal: string;
|
|
110
108
|
DOI: string;
|
|
@@ -8,7 +8,6 @@ export declare function extractJournalInfo(article: PubmedArticle): string;
|
|
|
8
8
|
export declare function extractDOI(article: PubmedArticle): string | null;
|
|
9
9
|
export declare function extractAbstract(article: PubmedArticle): string | null;
|
|
10
10
|
export declare function extractKeywords(article: PubmedArticle): string[];
|
|
11
|
-
export declare function extractPublicationDate(article: PubmedArticle): string | undefined;
|
|
12
11
|
export declare function extractAllFields(article: PubmedArticle): ParsedArticle;
|
|
13
12
|
export declare function generateArticleMarkdown(data: ParsedArticle): string;
|
|
14
13
|
export declare function generateExcelFile(articles: ParsedArticle[], outputFilePath: string): void;
|
|
@@ -53,7 +53,6 @@ export function extractJournalInfo(article) {
|
|
|
53
53
|
const year = getText(pubDate?.Year) || '';
|
|
54
54
|
const volume = getText(journalIssue?.Volume) || '';
|
|
55
55
|
const issue = getText(journalIssue?.Issue) || '';
|
|
56
|
-
const pages = getText(article.MedlineCitation?.Article?.Pagination?.MedlinePgn) || '';
|
|
57
56
|
let info = title;
|
|
58
57
|
if (year)
|
|
59
58
|
info += `, ${year}`;
|
|
@@ -64,8 +63,6 @@ export function extractJournalInfo(article) {
|
|
|
64
63
|
if (issue)
|
|
65
64
|
info += `(${issue})`;
|
|
66
65
|
}
|
|
67
|
-
if (pages)
|
|
68
|
-
info += `:${pages}`;
|
|
69
66
|
return info;
|
|
70
67
|
}
|
|
71
68
|
export function extractDOI(article) {
|
|
@@ -98,26 +95,6 @@ export function extractKeywords(article) {
|
|
|
98
95
|
.map(kw => getText(kw))
|
|
99
96
|
.filter((kw) => kw !== null && kw.length > 0);
|
|
100
97
|
}
|
|
101
|
-
export function extractPublicationDate(article) {
|
|
102
|
-
const history = article.PubmedData?.History;
|
|
103
|
-
if (!history)
|
|
104
|
-
return undefined;
|
|
105
|
-
const pubDates = toArray(history.PubMedPubDate);
|
|
106
|
-
const pubDate = pubDates.find(p => p['@_PubStatus'] === 'pubmed' || p['@_PubStatus'] === 'medline');
|
|
107
|
-
if (!pubDate)
|
|
108
|
-
return undefined;
|
|
109
|
-
const year = getText(pubDate.Year) || '';
|
|
110
|
-
const month = getText(pubDate.Month) || '';
|
|
111
|
-
const day = getText(pubDate.Day) || '';
|
|
112
|
-
let date;
|
|
113
|
-
if (year)
|
|
114
|
-
date = year;
|
|
115
|
-
if (month)
|
|
116
|
-
date = `${date || ''} ${month}`;
|
|
117
|
-
if (day)
|
|
118
|
-
date = `${date || ''} ${day}`;
|
|
119
|
-
return date || undefined;
|
|
120
|
-
}
|
|
121
98
|
export function extractAllFields(article) {
|
|
122
99
|
return {
|
|
123
100
|
PMID: extractPMID(article),
|
|
@@ -126,8 +103,7 @@ export function extractAllFields(article) {
|
|
|
126
103
|
journal: extractJournalInfo(article),
|
|
127
104
|
doi: extractDOI(article),
|
|
128
105
|
abstract: extractAbstract(article),
|
|
129
|
-
keywords: extractKeywords(article)
|
|
130
|
-
publicationDate: extractPublicationDate(article)
|
|
106
|
+
keywords: extractKeywords(article)
|
|
131
107
|
};
|
|
132
108
|
}
|
|
133
109
|
export function generateArticleMarkdown(data) {
|
|
@@ -137,9 +113,6 @@ export function generateArticleMarkdown(data) {
|
|
|
137
113
|
}
|
|
138
114
|
markdown += `## PMID\n${data.PMID}\n\n`;
|
|
139
115
|
markdown += `## Title\n${data.title}\n\n`;
|
|
140
|
-
if (data.publicationDate) {
|
|
141
|
-
markdown += `## Publication Date\n${data.publicationDate}\n\n`;
|
|
142
|
-
}
|
|
143
116
|
markdown += `## Authors\n`;
|
|
144
117
|
data.authors.forEach(author => {
|
|
145
118
|
markdown += `- ${author}\n`;
|
|
@@ -161,7 +134,6 @@ export function generateExcelFile(articles, outputFilePath) {
|
|
|
161
134
|
const excelRows = articles.map(article => ({
|
|
162
135
|
PMID: article.error ? `[ERROR] ${article.PMID}` : article.PMID,
|
|
163
136
|
Title: article.title,
|
|
164
|
-
PublicationDate: article.publicationDate || '',
|
|
165
137
|
Authors: article.authors.join(', '),
|
|
166
138
|
Journal: article.journal,
|
|
167
139
|
DOI: article.doi || '',
|