A patient's conditions as a record keeps them: the active ones first, the past ones below, each with its coded term and when it began and ended.
| Problem | Dates |
|---|---|
| Active · 4 | |
| Essential hypertensionSNOMED CT 59621000 | Since Nov 17, 2009 |
| Type 2 diabetes mellitusSNOMED CT 44054006 | Since Mar 6, 2012 |
| Chronic kidney disease stage 3ASNOMED CT 700378005 | Since Jun 2, 2023 |
| Osteoarthritis of kneeSNOMED CT 239873007 | Since 2018 |
| Past · 2 | |
| Community acquired pneumoniaSNOMED CT 385093006 | Jan 8, 2024 – Feb 1, 2024 |
| Depressive disorderSNOMED CT 35489007 | Jan 12, 2015 – Jun 30, 2016 |
Installation
In a project set up as in Installation, run:
bunx shadcn@4.22.1 add https://organui.com/r/problem-list.jsonOr by name: bunx shadcn@4.22.1 add @organui/problem-list.
The source installs into your UI components directory, along with shadcn's table if you do not have it yet. It holds no state, so it renders in server and client components alike.
Usage
import { ProblemList, type Problem } from "@/components/ui/problem-list"
const problems: Problem[] = [
{
id: "diabetes",
name: "Type 2 diabetes mellitus",
code: { system: "SNOMED CT", value: "44054006" },
significance: "major",
onset: "2012-03-06",
},
{
id: "pneumonia",
name: "Community acquired pneumonia",
status: "resolved",
onset: "2024-01-08",
resolved: "2024-02-01",
},
]
export function Problems() {
return <ProblemList problems={problems} caption="Problems" />
}Active and past
Problems group under Active and Past, each group a labelled set of rows, with its count. A resolved or inactive problem goes under Past, muted. Within each group, major problems lead and are bold, as general practice records mark the conditions that shape care; groupProblems gives the same order for a view of your own.
A code shows under the name with its system, such as SNOMED CT 44054006, so the term can be traced to the record. Set showCodes={false} for a summary.
Dates
An active problem shows when it began, and a past one when it began and ended. Full ISO 8601 dates show as UTC dates in US English; pass formatDate for your own. Records often hold less than a date, such as a year or "Childhood", so any other text reads as written rather than as a guessed day.
A display component: it does not choose, code or reconcile problems. The examples are fictional.
Examples
Without Codes
Hide the coded terms for a summary view.
| Problem | Dates |
|---|---|
| Active · 4 | |
| Essential hypertension | Since Nov 17, 2009 |
| Type 2 diabetes mellitus | Since Mar 6, 2012 |
| Chronic kidney disease stage 3A | Since Jun 2, 2023 |
| Osteoarthritis of knee | Since 2018 |
| Past · 2 | |
| Community acquired pneumonia | Jan 8, 2024 – Feb 1, 2024 |
| Depressive disorder | Jan 12, 2015 – Jun 30, 2016 |
Dates as Recorded
Onsets such as "Childhood" or a year read as written; only full dates are formatted.
| Problem | Dates |
|---|---|
| Active · 2 | |
| Asthma | Since Childhood |
| Migraine | Since 2015 |
| Past · 1 | |
| Acute appendicitis | 1998 – 1998 |
API Reference
Import ProblemListProps from the same file as ProblemList.
| Prop | Type | Default |
|---|---|---|
problems | readonly Problem[]The problems, active and past, in any order. | Required |
caption | React.ReactNodeNames the table for assistive technology and shows below it. | — |
showCodes | booleanShows each problem's code beneath its name. Defaults to true. | true |
formatDate | (date: string) => stringFormats full ISO dates. Defaults to a UTC date such as "Oct 1, 2026". | defaultFormatDate |
Any other prop, such as className, id or aria-*, is passed to the root <div>.