Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All fields in Daily Rounds table to treat no value specified as undefined instead instead of colaescing it with 0 or -1 in some fields #6985

Closed
2 tasks done
nihal467 opened this issue Jan 6, 2024 · 4 comments
Assignees

Comments

@nihal467
Copy link
Member

nihal467 commented Jan 6, 2024

Describe the bug

all the nutrition section field's in the patient critical care is saving the values as 0, when we save critical care without

To Reproduce
Steps to reproduce the behavior:

  1. Go to patient critical care and open nutrition section
  2. save the critical care without filling any nutrition section fields and save it
  3. go to the nutrition tab in the patient consultation page
  4. See error

Expected behavior
The empty field in the nutrition section should be a empty object not a 0

Tasks

This can be done as a two-part PR, front-end followed by back-end.

Screenshots

image
@rithviknishad
Copy link
Member

As discussed,

For ALL THE FIELDS IN DAILY ROUNDS TABLE, we need to send null for if there's no value in the input field. We should not internally coalesce with 0.

This can be done as a two-step exercise:

  • Update FE to have a clear distinction between null values and non-null values.
  • Custom Migration to clean existing records.

@rithviknishad rithviknishad changed the title Critical care nutrition section saving empty value as 0 All fields in Daily Rounds table to treat no value specified as undefined instead instead of colaescing it with 0 in some fields Jan 6, 2024
@rithviknishad rithviknishad changed the title All fields in Daily Rounds table to treat no value specified as undefined instead instead of colaescing it with 0 in some fields All fields in Daily Rounds table to treat no value specified as undefined instead instead of colaescing it with 0 or -1 in some fields Jan 6, 2024
@AshrafMd-1
Copy link
Contributor

@rithviknishad Except nutrition all others show - if there is no data
and in io balance
it's due to the fact that the intake and out-take starts from 0
image
as you can see now there is no below values
image

@rithviknishad
Copy link
Member

@AshrafMd-1 Let me rephrase how to replicate the issue:

Method 1:

Create a "NORMAL" log update

This form does not collect IO balance related information from the user, so we are NOT supposed to say that the IO Balance was ZERO at this point since we are not aware if it was actually zero since data wasn't collected.

But still we see a record in the chart that it was 0, even though no information about it was collected.

Method 2:

Create a "Critical Care" log update, but do not fill the I/O balance page and submit it.

Same situation here, information was not collected, so we are not supposed to represent that the IO balance was 0 during this log update. But still chart shows 0 in that record.

Copy link

github-actions bot commented Feb 4, 2024

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, @aparnacoronasafe, This issue has been automatically marked as stale because it has not had any recent activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants