Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Incidents: add the ability to document notes on a reported incident #2497

Open
blestab opened this issue Dec 6, 2020 · 10 comments 路 May be fixed by #2907
Open

Incidents: add the ability to document notes on a reported incident #2497

blestab opened this issue Dec 6, 2020 · 10 comments 路 May be fixed by #2907
Assignees
Labels
馃殌enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on incidents LOE - medium indicates that the level of effort to complete issue is medium
Projects
Milestone

Comments

@blestab
Copy link
Contributor

blestab commented Dec 6, 2020

馃殌 Feature Proposal

Add the ability to document notes onto a reported incident.

Motivation

During the incident's lifespan, there will be need to add multiple notes relating to the incident.

Technical Details

Incident Model

Add an optional notes field which hold multiple notes objects

notes?: Note[]

Note Model

Add an optional givenBy field which will store the currently logged in user writing the note.

givenBy?: string

Incident View/Edit

On the incident view/edit form, at the bottom

  • Add a Notes sections
    In the notes section:
    • Add a "+ Add New Note" button which opens a popup to add a new note to the incident
    • Display a table of already existing notes, showing the following fields: date, givenBy, note, actions
    • The Actions column will have buttons to Edit or Delete the note

image

NOTE: See patient view's add note popup for an example of how this should look/work.

image

@blestab blestab transferred this issue from HospitalRun/hospitalrun Dec 6, 2020
@blestab blestab added help wanted indicates that an issue is open for contributions incidents LOE - medium indicates that the level of effort to complete issue is medium 馃殌enhancement an issue/pull request that adds a feature to the application labels Dec 6, 2020
@blestab blestab added this to the v2.0 milestone Dec 6, 2020
@avigpt
Copy link

avigpt commented Dec 11, 2020

Hi @blestab, could I take this?

@blestab
Copy link
Contributor Author

blestab commented Dec 12, 2020

Yes you may @aguptamusic , thanks

@blestab blestab added in progress indicates that issue/pull request is currently being worked on and removed help wanted indicates that an issue is open for contributions labels Dec 12, 2020
@avigpt
Copy link

avigpt commented Dec 14, 2020

@blestab @jackcmeyer
The design provided above for the "+ New Note" button doesn't match the style of the "+ Add New Note" button in the patient notes view. The "+ New Note" design above has a green background and looks similar to the "Resolve Incident" button, whereas the "+ Add New Note" has a white background that turns blue when hovering. Which should we use?

@blestab
Copy link
Contributor Author

blestab commented Dec 15, 2020

Thanks @aguptamusic please go ahead and use button label, functionality (display message if there are no notes) and design/styling that matches the Patient Notes view. In addition though, we need a table of notes for this one instead of how Patient Notes displays the list of notes, with the ability to delete/edit a note.

@avigpt
Copy link

avigpt commented Dec 18, 2020

@blestab Given that the core team seems to still be working out logging in functionality, it is not obvious what role the current user plays (Doctor, etc.). How should we work with the givenBy field in a Note? A few options we're thinking about:

  1. Try to replicate App.tsx and use the current session and user object from a try/catch and handle the inevitable error case from RemoteDB.
  2. Comment out the givenBy field and ignore it for now.
  3. Insert a dummy string in the field, making them all uniform for now.

What do you recommend we do?

@jackcmeyer
Copy link
Member

You can get the current user from the redux store, which currently has mock data inside of it. You can see an example of how to do that in the report incident functionality.

@DrewGregory
Copy link
Contributor

DrewGregory commented Jan 3, 2021

If a user updates a note with the "Edit" functionality, should the date/givenBy fields be updated?

@blestab
Copy link
Contributor Author

blestab commented Jan 4, 2021

If a user updates a note with the "Edit" functionality, should the date/givenBy fields be updated?

I don't believe so as those are related to the "create" event. In future we could possibly look at introducing lastEditDate, and lastEditBy fields to track edits.

@DrewGregory
Copy link
Contributor

Makes sense.

The patient module also has a notes section. Would you like us to also make the notes section for the patient module use the same Notes Table UI? Currently the patient notes tab is a list without support for edit/delete.

@blestab
Copy link
Contributor Author

blestab commented Jan 4, 2021

Makes sense.

The patient module also has a notes section. Would you like us to also make the notes section for the patient module use the same Notes Table UI? Currently the patient notes tab is a list without support for edit/delete.

Good idea. That would be great for UX consistency; We will log a separate issue for it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
馃殌enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on incidents LOE - medium indicates that the level of effort to complete issue is medium
Projects
Version 2.0
  
To do
4 participants