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

added webpush on notes creation #1553

Closed
wants to merge 20 commits into from

Conversation

Bhavik-ag
Copy link
Contributor

@Bhavik-ag Bhavik-ag commented Aug 24, 2023

Changes

  • Create webpush notification on note creation
  • Send patient_id and facility_id in the message
  • Add new notification type PATIENT_NOTE_ADDED
  • fixes make patient notes realtime  #1552

@nihal467
Copy link
Member

nihal467 commented Sep 6, 2023

PR looks good to me

facility_users = FacilityUser.objects.filter(facility_id=patient.facility.id)
for facility_user in facility_users:
if facility_user.user.id != self.request.user.id:
send_webpush(username=facility_user.user, message=json.dumps(message))
Copy link
Member

@vigneshhari vigneshhari Sep 11, 2023

Choose a reason for hiding this comment

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

@sainak is this call deterministic, if not can we move it to the notification generator, it sends the webpush from the worker.

Copy link
Member

Choose a reason for hiding this comment

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

Yes this is non-deterministic.

@Bhavik-ag can you move this to the notification generator?

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (2829067) 59.11% compared to head (00dc1ce) 59.17%.

❗ Current head 00dc1ce differs from pull request most recent head 40f1da5. Consider uploading reports for the commit 40f1da5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1553      +/-   ##
==========================================
+ Coverage   59.11%   59.17%   +0.05%     
==========================================
  Files         207      205       -2     
  Lines       11264    11162     -102     
  Branches     1599     1590       -9     
==========================================
- Hits         6659     6605      -54     
+ Misses       4405     4356      -49     
- Partials      200      201       +1     
Files Coverage Δ
care/facility/api/viewsets/patient.py 63.85% <100.00%> (+1.66%) ⬆️
care/facility/models/notification.py 100.00% <100.00%> (ø)
care/utils/notification_handler.py 47.39% <100.00%> (+2.01%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vigneshhari
Copy link
Member

Closing stale MR

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

Successfully merging this pull request may close these issues.

make patient notes realtime
6 participants