PatientCard.Name
A text component for displaying patient names with configurable formatting options. Built to work with FHIR HumanName resources and provides intelligent fallbacks for missing or incomplete name data in healthcare applications.
Basic Example
import { PatientCard } from "@ovok/native";
import * as React from "react";
const BasicPatientName: React.FC = () => {
return <PatientCard.Name name={[{ given: ["John"], family: "Doe" }]} />;
};
export default BasicPatientName;
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | HumanName[] | - | - | Array of FHIR HumanName objects |
format | "firstLast" | "lastFirst" | - | "firstLast" | Name display format |
style | StyleProp<TextStyle> | - | - | Custom styles for the text |
testID | string | - | - | Test identifier for the component |
Inherits all props from TextProps
Component Behavior
Name Formatting
- firstLast: "John Michael Doe" format (given names followed by family name)
- lastFirst: "Doe, John Michael" format (family name followed by given names)
- Multiple Given Names: Automatically joins multiple given names with spaces
- Missing Data Handling: Gracefully handles missing given or family names
Fallback Logic
- Uses the first
HumanNameobject from the array - Falls back to "Unknown Patient" for completely missing names
- Shows only available name parts when some fields are missing
- Returns empty display for invalid or empty name objects
FHIR Compliance
- Fully compatible with FHIR R4
HumanNamestructure - Supports
givenandfamilyname components - Handles arrays of given names appropriately
- Ignores FHIR
use,text, and other metadata fields
Styling
Theme Colors Used
theme.colors.onSurface- Primary text color for patient namestheme.fonts.headlineSmall- Typography scale for prominent name display