GuidesComponentspatient

PatientList

High-performance patient directory component built on FlashList for efficient rendering of large patient datasets. Provides default patient card rendering with customizable item rendering and automatic spacing.

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

High-performance patient directory component built on FlashList for efficient rendering of large patient datasets. Provides default patient card rendering with customizable item rendering and automatic spacing.

Basic Example

import { PatientList } from "@ovok/native";
import { Patient } from "@medplum/fhirtypes";
import * as React from "react";
import { Alert } from "react-native";

const patients: Patient[] = [
  {
    id: "1",
    name: [{ given: ["John"], family: "Doe" }],
    gender: "male",
    birthDate: "1990-01-01",
    resourceType: "Patient",
  },
  {
    id: "2",
    name: [{ given: ["Jane"], family: "Smith" }],
    gender: "female",
    birthDate: "1985-05-15",
    resourceType: "Patient",
  },
  {
    id: "3",
    name: [{ given: ["Jim"], family: "Beam" }],
    gender: "male",
    birthDate: "1978-09-22",
    resourceType: "Patient",
  },
];

const PatientDirectory = () => {
  const handlePatientPress = React.useCallback(
    (patient: Patient, index: number) => {
      Alert.alert(
        "Patient Selected",
        `Selected: ${patient.name?.[0]?.given?.join(" ")} ${
          patient.name?.[0]?.family
        }`
      );
    },
    []
  );

  return (
    <PatientList
      data={patients}
      onItemPress={handlePatientPress}
      testID="patient-directory"
    />
  );
};

export default PatientDirectory;

Props

Every prop, with its type and description, is listed in the @ovok/native/patient API reference.

Component Behavior

Default Rendering

  • Automatically renders PatientCard with name, gender, and birth date
  • Uses conditional rendering for optional patient data
  • Applies consistent spacing and styling
  • Provides item separators with theme-based spacing

Performance Optimization

  • Built on FlashList for 60fps scrolling
  • Efficient memory usage for large patient datasets
  • Optimized for healthcare directories with hundreds of patients
  • Automatic viewport management and recycling

FHIR Integration

  • Direct compatibility with @medplum/fhirtypes Patient resources
  • Handles optional FHIR fields gracefully
  • Supports various patient data completeness levels

Styling

Theme Colors Used

  • theme.spacing(4) - Content container padding (16px default)
  • theme.spacing(3) - Item separator height (12px default)

Last updated on

On this page