Skip to content

Rebrand to Open Health and add Dashboard metrics view#1

Open
Masimbon3 wants to merge 1 commit intodependabot/npm_and_yarn/eslint-plugin-react-7.31.11from
codex/build-digital-health-platform-for-data-centralization
Open

Rebrand to Open Health and add Dashboard metrics view#1
Masimbon3 wants to merge 1 commit intodependabot/npm_and_yarn/eslint-plugin-react-7.31.11from
codex/build-digital-health-platform-for-data-centralization

Conversation

@Masimbon3
Copy link
Copy Markdown
Owner

@Masimbon3 Masimbon3 commented Feb 27, 2026

Motivation

  • Rebrand the frontend from "HospitalRun" to "Open Health" across UI and defaults.
  • Provide a central Dashboard that surfaces platform-wide metrics (patients, appointments, labs, medications, imagings, incidents).

Description

  • Replace branding strings and metadata: update README.md, public/index.html title/description, and navbar header label to Open Health and adjust default test user in src/user/user-slice.ts to match the new name.
  • Update the Navbar to display the new header label and update the corresponding unit test src/__tests__/shared/components/navbar/Navbar.test.tsx to expect Open Health.
  • Add a new Dashboard implementation in src/dashboard/Dashboard.tsx that uses react-query and repository count methods (PatientRepository, AppointmentRepository, LabRepository, MedicationRepository, ImagingRepository, IncidentRepository) to fetch metrics, and renders loading, error, total-records and per-domain cards using react-bootstrap components.
  • Add localized translation strings for the new dashboard labels, descriptions, and metric names across multiple locales under src/shared/locales/*/translations/dashboard/index.ts.

Testing

  • Ran unit tests with yarn test and updated Navbar tests; all tests passed.

Codex Task

Summary by Sourcery

Introduce a centralized dashboard that surfaces key platform metrics and rebrand visible frontend text from HospitalRun to Open Health.

New Features:

  • Add a dashboard view that aggregates and displays counts for patients, appointments, labs, medications, imaging, and incidents, including a total records summary.

Enhancements:

  • Localize new dashboard titles, descriptions, metric labels, and error messaging across all supported locales.
  • Update navbar branding, default user display names, and public HTML metadata to reflect the Open Health product name.

Tests:

  • Adjust navbar tests to validate the updated Open Health branding in the header label and navigation behavior.

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 27, 2026

Deploy Preview for storied-kelpie-ec8419 failed. Why did it fail? →

Name Link
🔨 Latest commit d6b0854
🔍 Latest deploy log https://app.netlify.com/projects/storied-kelpie-ec8419/deploys/69a217c334f1e1f7438b9135

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Feb 27, 2026

Reviewer's Guide

Rebrands the frontend from HospitalRun to Open Health and implements a metrics-driven Dashboard that aggregates counts from core repositories and displays them with localized labels across all supported locales.

Sequence diagram for loading dashboard metrics with react-query

sequenceDiagram
  actor User
  participant Dashboard
  participant ReactQuery_useQuery
  participant PatientRepository
  participant AppointmentRepository
  participant LabRepository
  participant MedicationRepository
  participant ImagingRepository
  participant IncidentRepository

  User->>Dashboard: Navigate to dashboard route
  Dashboard->>Dashboard: useEffect updateTitle(t(dashboard.label))
  Dashboard->>ReactQuery_useQuery: useQuery(dashboard-metrics, fetchPlatformMetrics)
  ReactQuery_useQuery-->>Dashboard: isLoading true, data undefined
  Dashboard->>User: Render Spinner loading state

  par Fetch_all_metrics_in_parallel
    ReactQuery_useQuery->>PatientRepository: count()
    ReactQuery_useQuery->>AppointmentRepository: count()
    ReactQuery_useQuery->>LabRepository: count()
    ReactQuery_useQuery->>MedicationRepository: count()
    ReactQuery_useQuery->>ImagingRepository: count()
    ReactQuery_useQuery->>IncidentRepository: count()
  and All_repositories_respond
    PatientRepository-->>ReactQuery_useQuery: patientsCount
    AppointmentRepository-->>ReactQuery_useQuery: appointmentsCount
    LabRepository-->>ReactQuery_useQuery: labsCount
    MedicationRepository-->>ReactQuery_useQuery: medicationsCount
    ImagingRepository-->>ReactQuery_useQuery: imagingsCount
    IncidentRepository-->>ReactQuery_useQuery: incidentsCount
  end

  alt Successful_metrics_fetch
    ReactQuery_useQuery-->>Dashboard: data DataMetric_array, isLoading false
    Dashboard->>Dashboard: totalRecords = sum(metrics.value)
    Dashboard->>User: Render central hub title and description
    Dashboard->>User: Render totalRecords card
    Dashboard->>User: Render per-domain metric cards
  else Metrics_fetch_error
    ReactQuery_useQuery-->>Dashboard: error, isError true, isLoading false
    Dashboard->>User: Render Alert with metricsLoadError
  end
Loading

Updated class diagram for the dashboard metrics aggregation

classDiagram
  class Dashboard {
    +render() JSXElement
    -useUpdateTitle() void
    -useTranslator() void
  }

  class DataMetric {
    +DataDomain domain
    +number value
  }

  class DataDomain {
  }

  class fetchPlatformMetrics {
    +call() Promise_DataMetric_array
  }

  class PatientRepository {
    +count() Promise_number
  }

  class AppointmentRepository {
    +count() Promise_number
  }

  class LabRepository {
    +count() Promise_number
  }

  class MedicationRepository {
    +count() Promise_number
  }

  class ImagingRepository {
    +count() Promise_number
  }

  class IncidentRepository {
    +count() Promise_number
  }

  Dashboard --> DataMetric : uses
  Dashboard ..> DataDomain : uses
  Dashboard ..> fetchPlatformMetrics : passes_to_useQuery

  fetchPlatformMetrics --> PatientRepository : calls_count
  fetchPlatformMetrics --> AppointmentRepository : calls_count
  fetchPlatformMetrics --> LabRepository : calls_count
  fetchPlatformMetrics --> MedicationRepository : calls_count
  fetchPlatformMetrics --> ImagingRepository : calls_count
  fetchPlatformMetrics --> IncidentRepository : calls_count
Loading

File-Level Changes

Change Details Files
Implement dashboard metrics view backed by repository count queries and react-query state management.
  • Introduce DataDomain and DataMetric types to model metric domains and values.
  • Add fetchPlatformMetrics helper that parallelizes count() calls across patient, appointment, lab, medication, imaging, and incident repositories.
  • Use useQuery with a stable cache key to fetch metrics and expose loading, error, and data states.
  • Compute a totalRecords aggregate from the fetched metrics array.
  • Render dashboard layout with react-bootstrap Container/Row/Col, showing intro text, error alert, loading spinner, a total records card, and per-domain metric cards keyed by domain.
  • Wire the dashboard title to the existing TitleContext with an effect that depends on translator and updateTitle callbacks.
src/dashboard/Dashboard.tsx
Add localized strings for the dashboard central hub copy, metrics labels, and error messaging across all locales.
  • Extend each locale’s dashboard translation section with centralHubTitle, centralHubDescription, totalRecordsLabel, and metricsLoadError entries.
  • Add a metrics object under dashboard in each locale with keys for patients, appointments, labs, medications, imagings, and incidents.
  • Keep existing dashboard.label entries intact while augmenting with the new strings.
src/shared/locales/ar/translations/dashboard/index.ts
src/shared/locales/de/translations/dashboard/index.ts
src/shared/locales/enUs/translations/dashboard/index.ts
src/shared/locales/es/translations/dashboard/index.ts
src/shared/locales/fr/translations/dashboard/index.ts
src/shared/locales/id/translations/dashboard/index.ts
src/shared/locales/it/translations/dashboard/index.ts
src/shared/locales/ja/translations/dashboard/index.ts
src/shared/locales/ptBr/translations/dashboard/index.ts
src/shared/locales/ru/translations/dashboard/index.ts
src/shared/locales/tr/translations/dashboard/index.ts
src/shared/locales/zhCN/translations/dashboard/index.ts
Rebrand visible UI and docs from HospitalRun to Open Health, including default test user identity.
  • Update README heading and product description text to use Open Health branding and a more general healthcare delivery description.
  • Change the HTML document title and meta description from HospitalRun to Open Health.
  • Adjust navbar header label to display Open Health and maintain navigation to the root route on click.
  • Update Navbar unit tests to assert Open Health text is rendered and clickable for navigation.
  • Change the default user slice to use Open Health names and an updated id prefix for the test user.
README.md
public/index.html
src/shared/components/navbar/Navbar.tsx
src/__tests__/shared/components/navbar/Navbar.test.tsx
src/user/user-slice.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6b0854428

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +22 to +26
const [patients, appointments, labs, medications, imagings, incidents] = await Promise.all([
PatientRepository.count(),
AppointmentRepository.count(),
LabRepository.count(),
MedicationRepository.count(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate dashboard metrics by user permissions

fetchPlatformMetrics always queries counts for patients, appointments, labs, medications, imaging, and incidents before rendering, but this component does not check state.user.permissions first. Users who are denied module access are redirected to / by PrivateRoute, so they can still see record counts for domains they are not authorized to read, which leaks restricted operational data. Filter metric queries/rendering by the corresponding read permissions (or skip unauthorized repositories entirely) before requesting these counts.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • All of the non-enUs locale entries for the new dashboard strings are currently English; if this isn’t intentional, consider providing localized text (or explicit TODO markers) so it’s clear these still need translation.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- All of the non-enUs locale entries for the new dashboard strings are currently English; if this isn’t intentional, consider providing localized text (or explicit TODO markers) so it’s clear these still need translation.

## Individual Comments

### Comment 1
<location path="src/dashboard/Dashboard.tsx" line_range="61" />
<code_context>
+        </Col>
+      </Row>
+      {isError && <Alert variant="danger">{t('dashboard.metricsLoadError')}</Alert>}
+      {isLoading && <Spinner animation="border" role="status" />}
+      {!isLoading && !isError && (
+        <>
</code_context>
<issue_to_address>
**suggestion:** The loading spinner could be made more accessible and visually integrated with the layout.

Consider wrapping the spinner in a `Row/Col` or flex container and centering it, and include accessible text per Bootstrap’s pattern, e.g.:

```tsx
<Spinner animation="border" role="status">
  <span className="visually-hidden">Loading...</span>
</Spinner>
```

This will make the loading state clearer and more accessible.

Suggested implementation:

```typescript
      {isError && <Alert variant="danger">{t('dashboard.metricsLoadError')}</Alert>}
      {isLoading && (
        <Row className="justify-content-center my-4">
          <Col xs="auto" className="text-center">
            <Spinner animation="border" role="status">
              <span className="visually-hidden">{t('dashboard.loading')}</span>
            </Spinner>
          </Col>
        </Row>
      )}
      {!isLoading && !isError && (

```

1. Ensure that a `dashboard.loading` key exists in your i18n translation files (e.g., `"dashboard.loading": "Loading..."`), or change the key in the code to match an existing translation such as `t('common.loading')` if that already exists in your project.
</issue_to_address>

### Comment 2
<location path="src/shared/locales/ar/translations/dashboard/index.ts" line_range="4-13" />
<code_context>
 export default {
   dashboard: {
     label: 'لوحة القيادة',
+    centralHubTitle: 'Digital Health Command Center',
+    centralHubDescription: 'Centralize your care data across patients, appointments, labs, medications, imaging, and incidents.',
+    totalRecordsLabel: 'Total clinical records',
+    metricsLoadError: 'Unable to load centralized healthcare metrics. Please try again.',
+    metrics: {
+      patients: 'Patients',
+      appointments: 'Appointments',
+      labs: 'Lab requests',
+      medications: 'Medication requests',
+      imagings: 'Imaging requests',
+      incidents: 'Incidents',
+    },
   },
</code_context>
<issue_to_address>
**issue:** New dashboard strings are left in English across non-English locale files.

These new keys (`centralHubTitle`, `centralHubDescription`, `totalRecordsLabel`, `metricsLoadError`, and `metrics.*`) are still in English in this non-en locale. If this bundle is user-facing, please either add translations now or mark them clearly as pending (e.g., with a TODO) to avoid a mixed-language UI.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

</Col>
</Row>
{isError && <Alert variant="danger">{t('dashboard.metricsLoadError')}</Alert>}
{isLoading && <Spinner animation="border" role="status" />}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The loading spinner could be made more accessible and visually integrated with the layout.

Consider wrapping the spinner in a Row/Col or flex container and centering it, and include accessible text per Bootstrap’s pattern, e.g.:

<Spinner animation="border" role="status">
  <span className="visually-hidden">Loading...</span>
</Spinner>

This will make the loading state clearer and more accessible.

Suggested implementation:

      {isError && <Alert variant="danger">{t('dashboard.metricsLoadError')}</Alert>}
      {isLoading && (
        <Row className="justify-content-center my-4">
          <Col xs="auto" className="text-center">
            <Spinner animation="border" role="status">
              <span className="visually-hidden">{t('dashboard.loading')}</span>
            </Spinner>
          </Col>
        </Row>
      )}
      {!isLoading && !isError && (
  1. Ensure that a dashboard.loading key exists in your i18n translation files (e.g., "dashboard.loading": "Loading..."), or change the key in the code to match an existing translation such as t('common.loading') if that already exists in your project.

Comment on lines +4 to +13
centralHubTitle: 'Digital Health Command Center',
centralHubDescription: 'Centralize your care data across patients, appointments, labs, medications, imaging, and incidents.',
totalRecordsLabel: 'Total clinical records',
metricsLoadError: 'Unable to load centralized healthcare metrics. Please try again.',
metrics: {
patients: 'Patients',
appointments: 'Appointments',
labs: 'Lab requests',
medications: 'Medication requests',
imagings: 'Imaging requests',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: New dashboard strings are left in English across non-English locale files.

These new keys (centralHubTitle, centralHubDescription, totalRecordsLabel, metricsLoadError, and metrics.*) are still in English in this non-en locale. If this bundle is user-facing, please either add translations now or mark them clearly as pending (e.g., with a TODO) to avoid a mixed-language UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant