Skip to content

About

The official github submission repo for the JanoHealth Intern Assessment.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

Repository files navigation

Dialysis Dashboard

Available Scripts

In the project directory, you can run:

npm install

Installs all the dependencies required by the webapp. Run this right after cloning the repository in the root folder of the project.

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm run development

Runs the backend in the development mode.

This will also run the seeding script required to populate the data with 10 patients.

You can use Postman to make POST and PATCH requests that are used to create and complete dialysis sessions.

{
  "postWeight": int,
  "systolicBP": int,
  "diastolicBP": int,
  "endTime": string,
  "notes": string,
}

npm test

Launches the test runner.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Critical Assumptions and Tradeoffs

PMC: PubMed Central Papers (Official sources for the figures used)

  • The source for the maximum weight gain interdialysis: PCMID- PMC9584995
  • The source for the maximum systolic BP post-dialysis: PCMID- PMC3320527
  • The source for the minimum dialysis session duration: PCMID- PMC3685306
  • The source for the maximum dialysis session duration: PCMID- PMC5695674

Tech Stack

Backend

  • Node.js + Express (TypeScript).

  • In-memory data store (assignment-allowed simplification).

  • Layered architecture (routes → controllers → services).

  • Jest + Supertest for testing.

Frontend

  • React (TypeScript).

  • React Query for server state management.

  • Modular CSS styling (no UI framework).

Architecture Overview

Backend Structure

server/
 ├── controllers/
 ├── routes/
 ├── services/
 ├── config/
 ├── data/
 ├── scripts/

Frontend Structure

src/
 ├── api/
 ├── components/
 ├── config/
 ├── pages/
 ├── styles/
 ├── types/

Design Principles

Separation of concerns

  • Routes → HTTP layer

  • Clinical thresholds stored in config (no magic numbers).

  • Anomaly detection is a pure function and fully unit tested.

  • App/server split for testability.

Frontend Behavior

Dashboard

Displays:

  • All patients scheduled today

  • Status: not_started / in_progress / completed

Key session fields:

  • Pre-weight

  • Post-weight

  • Blood pressure

  • Duration

Visual anomaly banner when detected.

Data Layer

Trade Offs

Data is saved in memory for assignment purposes.

Pros

  • Fast setup

  • No DB dependency

Cons

  • No persistence

  • No indexing

  • Not scalable

In production, MongoDB would be appropriate due to:

  • Flexible document schema

  • Natural embedding of session data

  • Indexing on unitId and scheduledDate

Seed Data

On server start:

  • 10 synthetic patients generated

Mixed session states:

  • Not started

  • In progress

  • Completed

  • Randomized vitals and anomaly cases

  • Allows instant demo without manual API setup.

Testing

Backend Tests

Unit Tests:

  • Anomaly detection edge cases

  • Weight mismatch

  • High BP

  • Abnormal duration

Integration Tests

POST /api/sessions

Verifies:

  • 201 response

  • Correct session structure

Frontend Tests

Component Test

  • PatientCard

  • Verifies anomaly banner renders conditionally

AI Accomplice

Majority help

Majority of the help was taken in describing the visual stricture of the webpage as no mockups were provided and no experience in handling or viewing nurse dashboards.

Besides it, some help was garnished during debugging and defining the data structures for quality improvement and some help with the overall workflow describing for such a project, what should be done first and what not.

Also the description of a good Readme and what it should include and what not were taken from ChatGPT.

Major Disagreement

During this project, there was an assumption taken by Claude that adding a patient and starting a dialysis session could be combined into a single action. I initially followed that idea and implemented a composite endpoint that created a patient and started a session simultaneously. However, after thinking through the domain model more carefully, I realized that patient registration and session initiation are distinct domain events.

In real clinical workflows, patients may be registered in advance, scheduled for the day, and only later begin treatment. Coupling those two operations tightly could introduce partial state issues and reduce flexibility.

So I refactored the design to:

  • Keep patient creation independent
  • Automatically schedule them for today
  • Allow sessions to be started separately via the dashboard.

About

The official github submission repo for the JanoHealth Intern Assessment.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages