T-monius / patient-list

A list of patients which can be ordered by clicking on a column.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Oncora Medical

Problem

Patient list

  • Star patients
    • Click on a star icon in right column
  • Star
    • 2 states
      1. Starred
      2. Unstarred
  • Starred patients move to the top
  • Persist state in db

Understanding

Add stars

  • Icon?
  • HTML? Style stars per selection state Sort list per selection state Create a click event on stars
  • Update db

Discovery

  1. Assess frontend
  • Identify React component where stars will render CHECK
  1. Identify how to interact w/ the db CHECK
  • better-sqlite3
  1. Survey the backend CHECK
  • Express app
    • Router
      • Modularized app
      • Declare routes

Examples / Test Cases

Running list

  • Has columns

Data Structures

  • N/A

Algorithm

  1. Create route handler CHECK
  2. Parse req.params for id of patient and state of starred
  3. POST - Update db - UPDATE patients SET starred = ? WHERE id == ? - Test w/ example patient id and Insomnia
  4. Modify column to be a star, conditionally filled CHECK
  5. Order table columns by 'starred' blocked
  • NOTE: Attempt to order DESC in SQL query ineffective
    • SELECT id, mrn, name, dob, starred FROM patients ORDER BY starred DESC
  • Reversed client side after ordering
  1. Create onClick for table column blocked
  2. Parse event for id of column (e.g. id of parent)
  3. Make axios call - POST to endpoint w/ desired parameters

About

A list of patients which can be ordered by clicking on a column.


Languages

Language:TypeScript 76.7%Language:CSS 9.2%Language:HTML 8.8%Language:Shell 5.3%