# ohcnetwork/care_pretty_print_fe architecture

> Architecture diagram of the GitHub repository ohcnetwork/care_pretty_print_fe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ohcnetwork/care_pretty_print_fe
- Repository: https://github.com/ohcnetwork/care_pretty_print_fe

## Overview

This React plugin lets CARE healthcare workers find a patient and print an ID card from the facility route or CARE patient actions. Search submits identifiers through the request client; the results and selection are handled in the search page, which presents the browser-print card. CARE action wrappers also expose that card, while a separate Zebra path generates ZPL and uses the printer manager. The README documents QR lookup and these entry points. Some page and printer code was only excerpted, so the graph omits unshown details rather than assuming additional calls.

Main entry points: [`src/pages/PatientSearchPage.tsx`](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/pages/PatientSearchPage.tsx) (Patient search), [`src/components/PatientIdCardPrint.tsx`](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PatientIdCardPrint.tsx) (Browser ID card), [`src/components/ui/phone-input.tsx`](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/phone-input.tsx) (Phone input), [`src/components/ZebraZC300CardPrint.tsx`](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ZebraZC300CardPrint.tsx) (Zebra card print)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CARE entry points"]
  node_manifest["Plugin manifest<br/>[manifest.ts]"]
  node_routes["Facility route<br/>[routes.tsx]"]
  node_home_actions["Patient home action"]
  node_profile_action["Profile print action"]
end

subgraph group_search["Patient search"]
  node_search_page["Patient search"]
  node_request_client["CARE API requests<br/>[requests.ts]"]
  node_patient_types["Patient data types<br/>[types.ts]"]
end

subgraph group_printing["Card printing"]
  node_card_print["Browser ID card"]
  node_patient_format["Patient formatting<br/>[utils.ts]"]
  node_zebra_print["Zebra card print"]
  node_printer_manager["Printer manager"]
end

subgraph group_ui["Interface and utilities"]
  node_button["Button<br/>[button.tsx]"]
  node_card_ui["Card UI<br/>[card.tsx]"]
  node_input["Text input<br/>[input.tsx]"]
  node_phone_input["Phone input<br/>[phone-input.tsx]"]
  node_command["Command selector<br/>[command.tsx]"]
  node_popover["Popover<br/>[popover.tsx]"]
  node_scroll_area["Scroll area<br/>[scroll-area.tsx]"]
end

node_worker(("Healthcare worker"))
node_care_api(("CARE API"))
node_zebra_service(("Zebra Browser Print"))

node_manifest -->|"registers"| node_routes
node_manifest -->|"registers"| node_home_actions
node_manifest -->|"registers"| node_profile_action
node_routes -->|"routes to"| node_search_page
node_worker -.->|"searches"| node_search_page
node_worker -.->|"opens"| node_home_actions
node_worker -.->|"opens"| node_profile_action
node_home_actions -->|"renders"| node_card_print
node_home_actions -->|"renders"| node_zebra_print
node_profile_action -->|"renders"| node_card_print
node_search_page -->|"requests"| node_request_client
node_request_client -->|"fetches"| node_care_api
node_search_page -->|"renders"| node_card_print
node_search_page -->|"uses types"| node_patient_types
node_search_page -->|"renders"| node_button
node_search_page -->|"renders"| node_card_ui
node_search_page -->|"renders"| node_input
node_search_page -->|"renders"| node_phone_input
node_card_print -->|"formats data"| node_patient_format
node_card_print -->|"uses types"| node_patient_types
node_card_print -->|"renders"| node_button
node_card_print -.->|"opens print dialog"| node_worker
node_zebra_print -->|"formats data"| node_patient_format
node_zebra_print -->|"uses types"| node_patient_types
node_zebra_print -->|"renders"| node_button
node_zebra_print -->|"connects and prints"| node_printer_manager
node_printer_manager -->|"controls printer"| node_zebra_service
node_phone_input -->|"renders"| node_button
node_phone_input -->|"renders"| node_command
node_phone_input -->|"renders"| node_input
node_phone_input -->|"uses trigger"| node_popover
node_phone_input -->|"renders"| node_scroll_area

click node_manifest "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/manifest.ts"
click node_routes "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/routes.tsx"
click node_home_actions "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PatientHomeActionsWrapper.tsx"
click node_profile_action "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PrintIDCardButtonWrapper.tsx"
click node_search_page "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/pages/PatientSearchPage.tsx"
click node_request_client "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/lib/requests.ts"
click node_patient_types "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/types/types.ts"
click node_card_print "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PatientIdCardPrint.tsx"
click node_patient_format "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/utils.ts"
click node_zebra_print "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ZebraZC300CardPrint.tsx"
click node_printer_manager "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/utils/ZC300PrinterManager.ts"
click node_button "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/button.tsx"
click node_card_ui "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/card.tsx"
click node_input "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/input.tsx"
click node_phone_input "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/phone-input.tsx"
click node_command "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/command.tsx"
click node_popover "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/popover.tsx"
click node_scroll_area "https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/scroll-area.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manifest,node_routes,node_home_actions,node_profile_action,node_zebra_service toneBlue
class node_search_page,node_request_client,node_patient_types toneAmber
class node_card_print,node_patient_format,node_zebra_print,node_printer_manager,node_care_api toneMint
class node_button,node_card_ui,node_input,node_phone_input,node_command,node_popover,node_scroll_area,node_worker toneRose
```

## Components

### CARE entry points

- [Plugin manifest](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/manifest.ts): `src/manifest.ts`
- [Facility route](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/routes.tsx): `src/routes.tsx`
- [Patient home action](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PatientHomeActionsWrapper.tsx): `src/components/PatientHomeActionsWrapper.tsx`
- [Profile print action](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PrintIDCardButtonWrapper.tsx): `src/components/PrintIDCardButtonWrapper.tsx`

### Patient search

- [Patient search](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/pages/PatientSearchPage.tsx): `src/pages/PatientSearchPage.tsx`
- [CARE API requests](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/lib/requests.ts): `src/lib/requests.ts`
- [Patient data types](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/types/types.ts): `src/types/types.ts`

### Card printing

- [Browser ID card](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/PatientIdCardPrint.tsx): `src/components/PatientIdCardPrint.tsx`
- [Patient formatting](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/utils.ts): `src/utils.ts`
- [Zebra card print](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ZebraZC300CardPrint.tsx): `src/components/ZebraZC300CardPrint.tsx`
- [Printer manager](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/utils/ZC300PrinterManager.ts): `src/utils/ZC300PrinterManager.ts`

### Interface and utilities

- [Button](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Card UI](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/card.tsx): `src/components/ui/card.tsx`
- [Text input](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/input.tsx): `src/components/ui/input.tsx`
- [Phone input](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/phone-input.tsx): `src/components/ui/phone-input.tsx`
- [Command selector](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/command.tsx): `src/components/ui/command.tsx`
- [Popover](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/popover.tsx): `src/components/ui/popover.tsx`
- [Scroll area](https://github.com/ohcnetwork/care_pretty_print_fe/blob/main/src/components/ui/scroll-area.tsx): `src/components/ui/scroll-area.tsx`

### Other components

- **Healthcare worker**
- **CARE API**
- **Zebra Browser Print**

## Connections

- Plugin manifest → Facility route: registers (evidence: `src/manifest.ts`)
- Plugin manifest → Patient home action: registers (evidence: `src/manifest.ts`)
- Plugin manifest → Profile print action: registers (evidence: `src/manifest.ts`)
- Facility route → Patient search: routes to (evidence: `src/routes.tsx`)
- Healthcare worker → Patient search: searches (evidence: `README.md`)
- Healthcare worker → Patient home action: opens (evidence: `README.md`)
- Healthcare worker → Profile print action: opens (evidence: `README.md`)
- Patient home action → Browser ID card: renders (evidence: `src/components/PatientHomeActionsWrapper.tsx`)
- Patient home action → Zebra card print: renders (evidence: `src/components/PatientHomeActionsWrapper.tsx`)
- Profile print action → Browser ID card: renders (evidence: `src/components/PrintIDCardButtonWrapper.tsx`)
- Patient search → CARE API requests: requests (evidence: `src/pages/PatientSearchPage.tsx`)
- CARE API requests → CARE API: fetches (evidence: `src/lib/requests.ts`)
- Patient search → Browser ID card: renders (evidence: `src/pages/PatientSearchPage.tsx`)
- Patient search → Patient data types: uses types (evidence: `src/pages/PatientSearchPage.tsx`)
- Patient search → Button: renders (evidence: `src/pages/PatientSearchPage.tsx`)
- Patient search → Card UI: renders (evidence: `src/pages/PatientSearchPage.tsx`)
- Patient search → Text input: renders (evidence: `src/pages/PatientSearchPage.tsx`)
- Patient search → Phone input: renders (evidence: `src/pages/PatientSearchPage.tsx`)
- Browser ID card → Patient formatting: formats data (evidence: `src/components/PatientIdCardPrint.tsx`)
- Browser ID card → Patient data types: uses types (evidence: `src/components/PatientIdCardPrint.tsx`)
- Browser ID card → Button: renders (evidence: `src/components/PatientIdCardPrint.tsx`)
- Browser ID card → Healthcare worker: opens print dialog (evidence: `README.md`)
- Zebra card print → Patient formatting: formats data (evidence: `src/components/ZebraZC300CardPrint.tsx`)
- Zebra card print → Patient data types: uses types (evidence: `src/components/ZebraZC300CardPrint.tsx`)
- Zebra card print → Button: renders (evidence: `src/components/ZebraZC300CardPrint.tsx`)
- Zebra card print → Printer manager: connects and prints (evidence: `src/components/ZebraZC300CardPrint.tsx`)
- Printer manager → Zebra Browser Print: controls printer (evidence: `src/utils/ZC300PrinterManager.ts`)
- Phone input → Button: renders (evidence: `src/components/ui/phone-input.tsx`)
- Phone input → Command selector: renders (evidence: `src/components/ui/phone-input.tsx`)
- Phone input → Text input: renders (evidence: `src/components/ui/phone-input.tsx`)
- Phone input → Popover: uses trigger (evidence: `src/components/ui/phone-input.tsx`)
- Phone input → Scroll area: renders (evidence: `src/components/ui/phone-input.tsx`)
