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

Skip creating event group if all fields are null #2134

Merged
merged 1 commit into from
May 13, 2024

Conversation

sainak
Copy link
Member

@sainak sainak commented May 7, 2024

Proposed Changes

  • check and skip if all fields of the group are null in an event group

Associated Issue

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@sainak sainak requested a review from a team as a code owner May 7, 2024 17:48
except KeyError:
value[field] = getattr(object_instance, field, None)
# if all values in the group are Falsy, skip creating the event for this group
if all(not v for v in value.values()):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider making the check against None instead?
What if any of the vital is 0 (falsy)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah makes sense, will update it

@vigneshhari vigneshhari merged commit 5be2e00 into develop May 13, 2024
9 checks passed
@vigneshhari vigneshhari deleted the sainak/fix/ignore-empty-events branch May 13, 2024 13:31
vigneshhari added a commit that referenced this pull request May 15, 2024
* Update max_length for phone numbers to adhere to ITU-T E.164 standard (#2138)

* Update max_length for phone numbers to adhere to ITU-T E.164 standard

* Clean up an empty line

* Adds missing migrations

---------

Co-authored-by: rithviknishad <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>

* Adds support for doctors and nurses discussions threads in Discussion Notes (#2137)

* Adds support for doctors and nurses discussions threads in Discussion Notes

* switch to using small integer field

* updated and fixes based on test cases

* rebase migrations

* Remake migrations

---------

Co-authored-by: Vignesh Hari <[email protected]>

* Allow `audio/mp4` by default (#2094)

Co-authored-by: Vignesh Hari <[email protected]>

* Bump Dependencies (#2143)

* Vigneshhari/bump dependencies (#2145)

* Bump Dependencies

* Bump Dependencies

* Bump Dependencies

* Bump Dependencies

* Skip creating event group if all fields are null (#2134)

* ABDM M3 (#1829)

Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Gigin George <[email protected]>

* Increase area of specialisation in doctors (#2102)

* update doctor types

* Add Migration

---------

Co-authored-by: Rithvik Nishad <[email protected]>
Co-authored-by: Gigin George <[email protected]>

* Added discharge patient filters (#2124)

* added discharge patient filters

* updated filters

---------

Co-authored-by: Vignesh Hari <[email protected]>

* converted investigation and investigation group data into JSON (#1912)

* converted investigation and investigation group data into JSON

* created json files for investigations and investigation_groups

* updated investigations.json

* fixed json data,command and migrations

* fixing migrations

* fixing lint issue

* update migrations

* update migrations

---------

Co-authored-by: Aakash Singh <[email protected]>

* Drops support for cloning previous log update (#2127)

* Drop support for cloning previous log update

* undo unrelated changes

---------

Co-authored-by: Vignesh Hari <[email protected]>

* Change devcontainer make up command to run after start (#2146)

Co-authored-by: Vignesh Hari <[email protected]>

* Removes unused `current_health` field from Daily Rounds (#2162)

Removes unused `current_health` from Daily Rounds

Co-authored-by: Vignesh Hari <[email protected]>

* Display users list based on user access limitation (#1742)

* Refactor get_queryset method in UserViewSet

* Used get_accessible_facilities instead of subquery
to fetch the facilities linked to the user

* fixed failing tests

* fix queryset

---------

Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: khavinshankar <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>

* adds missing merge migrations (#2169)

merge migrations

---------

Co-authored-by: Bodhish Thomas <[email protected]>
Co-authored-by: rithviknishad <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>
Co-authored-by: Rithvik Nishad <[email protected]>
Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Khavin Shankar <[email protected]>
Co-authored-by: Gigin George <[email protected]>
Co-authored-by: Rashmik <[email protected]>
Co-authored-by: Shivank Kacker <[email protected]>
Co-authored-by: Prafful Sharma <[email protected]>
Co-authored-by: Gokulram A <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Events are being created for empty groups
3 participants