Patient list
- Star patients
- Click on a star icon in right column
- Star
- 2 states
- Starred
- Unstarred
- 2 states
- Starred patients move to the top
- Persist state in db
Add stars
- Icon?
- HTML? Style stars per selection state Sort list per selection state Create a click event on stars
- Update db
- Assess frontend
- Identify React component where stars will render CHECK
- Identify how to interact w/ the db CHECK
better-sqlite3
- Survey the backend CHECK
- Express app
Router
- Modularized app
- Declare routes
Running list
- Has columns
- N/A
- Create route handler CHECK
- Parse
req.params
for id of patient and state of starred - POST
- Update db
-
UPDATE patients SET starred = ? WHERE id == ?
- Test w/ example patient id and Insomnia - Modify column to be a star, conditionally filled CHECK
- 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
- Create
onClick
for table column blocked - Parse event for id of column (e.g. id of parent)
- Make axios call - POST to endpoint w/ desired parameters