PatientBanner
Name, date of birth with age, administrative gender and the main identifier with its system.
Rule it enforces: Uses the official name, shows the identifier system, and handles a missing birth date and a deceased patient without breaking.
Install
npx shadcn@latest add https://raw.githubusercontent.com/Henrycarto/wardkit/main/public/r/patient-banner.jsonUsage
import { PatientBanner } from '@/components/wardkit/patient-banner';
<PatientBanner patient={patient} now={new Date()} timeZone="Europe/Vienna" />Examples
Three names: the official one is used
The record also has a usual name (Grete) and a maiden name (Steiner).
HUBER, Margarete Anna
- Date of birth
- Born 14 Mar 1955 (71 years)
- Gender (administrative)
- Female
- Identifier
- W4B-000317System: https://github.com/Henrycarto/wardkit/fixtures/sid/mrn
Deceased, with a date
WAGNER, Josef
Deceased 30 Sep 2026- Date of birth
- Born 2 Jun 1941, died aged 85 years
- Gender (administrative)
- Male
- Identifier
- W4B-000288System: https://github.com/Henrycarto/wardkit/fixtures/sid/mrn
Deceased, no date
deceasedBoolean true: no current age is shown.
GRUBER, Franz
Deceased, date not recorded- Date of birth
- Born 8 Nov 1944, age at death unknown
- Gender (administrative)
- Male
- Identifier
- W4B-000102System: https://github.com/Henrycarto/wardkit/fixtures/sid/mrn
Birth year only
NOVAK, Sabine
- Date of birth
- Born 1981 (44 or 45 years, from birth year only)
- Gender (administrative)
- Female
- Identifier
- W4B-000391System: https://github.com/Henrycarto/wardkit/fixtures/sid/mrn
No birth date, temporary name, identifier without a system
Unknown, female, Emergency Department arrival 21 Oct
- Date of birth
- Date of birth not recorded, age unknown
- Gender (administrative)
- Unknown
- Identifier
- ED-TEMP-0042System: not recorded
Props
| Prop | Type | Description |
|---|---|---|
| patient | Patient | A FHIR R4 Patient. Required. |
| now | Date | string | The day ages are counted to. Required so server and browser agree. Required. |
| timeZone? | string | IANA time zone that decides which calendar day now falls on. |
| className? | string | Extra classes for the outer element. |
Clinical rules and sources
- Name: use official, then usual, then the first name not marked old.Source: FHIR R4: NameUse
- Identifier: use official, then type MR, then usual, then the first not marked old. The system URI is always shown, or "not recorded".Source: FHIR R4: Identifier; HL7 v2 table 0203 (MR)
- Age from birthDate on the given day. A year or year-month only shows both possible ages, never one guessed. A missing birth date says so.Source: FHIR R4: Patient.birthDate
- deceasedBoolean or deceasedDateTime shows a "Deceased" badge. With a date, age at death is shown; without one, no age is shown.Source: FHIR R4: Patient.deceased[x]
- Gender is labelled administrative gender, the FHIR meaning of Patient.gender.Source: FHIR R4: AdministrativeGender