PatientCard.BirthDate
A compound component for displaying patient birth date and age information with calendar icon support. Provides flexible date formatting and age calculation for healthcare applications.
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
A compound component for displaying patient birth date and age information with calendar icon support. Provides flexible date formatting and age calculation for healthcare applications.
Basic Example
import { PatientCard } from "@ovok/native";
import * as React from "react";
const birthDate = "1990-01-01";
const BasicAgeDisplay = () => (
<PatientCard.BirthDate>
<PatientCard.BirthDate.Icon />
<PatientCard.BirthDate.Text birthDate={birthDate} variant="both" />
</PatientCard.BirthDate>
);
export default BasicAgeDisplay;
Props
Every prop, with its type and description, is listed in the @ovok/native/patient API reference.
Compound Components
PatientCard.BirthDate.Icon- Calendar icon componentPatientCard.BirthDate.Text- Date and age text display component
Localization
The component uses these translation keys:
{
"patient-card": {
"age-years": "{{age}} years old",
"birth-date-with-age": "{{date}} ({{age}} years old)"
}
}Styling
Theme Colors Used
theme.colors.onSurfaceVariant- Icon and text colortheme.spacing(1)- Gap between icon and texttheme.fonts.bodyMedium- Text typography
Date Calculation
- Uses
date-fnsfor reliable age calculation - Handles timezone differences appropriately
- Supports various date format patterns
- Provides localized age display with translations
Last updated on
Patient
The Patient module provides a comprehensive solution for displaying and managing patient information in healthcare applications. Built on top of FHIR Patient resources with compound components, localization support, and performance optimizations using FlashList.
PatientCard.BirthDate.Icon
Calendar icon component using Calendar2 from iconsax-react-nativejs.