Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions components/NotesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default async function NotesList({
relatedConcepts,
notes,
conceptDetails,
total,
}: {
relatedConcepts: Array<{
inputConceptId: string;
Expand All @@ -22,6 +23,7 @@ export default async function NotesList({
conceptName: string;
domain: string;
}>;
total: number;
}) {
// Sort the PMC IDs for caching
const pmcids = Array.from(
Expand All @@ -36,10 +38,11 @@ export default async function NotesList({
pmcids.length > 0 ? await getMultiplePmcArticles(pmcids) : {};

return (
<Card className="col-span-2">
<Card className="col-span-2 ring-0" >
<CardHeader>
<CardTitle className="flex flex-wrap gap-2 items-center">
<span className="text-2xl">Case Reports for: </span>

{conceptDetails.map((c) => {
const related = relatedConcepts.find(
(r) => r.inputConceptId === c.conceptId,
Expand All @@ -52,7 +55,10 @@ export default async function NotesList({
/>
);
})}


</CardTitle>
<div className="text-sm text-muted-foreground">{total} results</div>
</CardHeader>

<CardContent>
Expand All @@ -68,7 +74,8 @@ export default async function NotesList({
</div>
) : (
<div className="grid grid-cols-1 gap-4">
<div className="mb-4 flex items-center gap-2">

<div className=" flex items-center gap-2">
<Badge variant="outline" className="bg-sky-100 dark:bg-[#1B3C53]">
Condition
</Badge>
Expand All @@ -91,7 +98,7 @@ export default async function NotesList({
Measurement
</Badge>
</div>
<div className="grid grid-cols-1 gap-4 px-1 py-1">
<div className="grid grid-cols-1 gap-4 py-1">
{notes.map((note) => {
const pmcid = note.note_source_value?.match(/PMC(\d+)/)?.[1];

Expand Down
2 changes: 1 addition & 1 deletion components/NotesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export default async function NotesSection({
const totalPages = Math.ceil(total / pageSize);
return (
<div className="p-4 space-y-4">
<div className="text-sm text-muted-foreground">{total} articles</div>
<NotesList
relatedConcepts={relatedConcepts}
notes={notes}
conceptDetails={conceptDetails}
total={total}
/>
<NotesPagination page={page} totalPages={totalPages} />
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/services/pmcService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ async function getPmcArticle(pmcid: string): Promise<any> {
const parser = new XMLParser({
ignoreAttributes: false,
attributeNamePrefix: "",
htmlEntities: true,
});

const json = parser.parse(xml);
Expand Down
128 changes: 72 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading