Full-Stack-Collective / clerkwise

0 stars 1 forks source link

Patient Chart should update when creating clinical exam. #28

Open jeremiahfallin opened 1 year ago

jeremiahfallin commented 1 year ago

Currently the patient dashboard needs to be refreshed after creating a clinical exam in order to see that clinical exam.

Acceptance Critera:

jeremiahfallin commented 1 year ago

This might actually be an issue with any interactions with the database. Working on the edit exam issue the new exam info isn't updating on the form even though it's there when I refresh.

mentalcaries commented 1 year ago

This might actually be an issue with any interactions with the database. Working on the edit exam issue the new exam info isn't updating on the form even though it's there when I refresh.

Good catch. This was one I had some problems with. One idea I had was to implement it as a real time event

Maybe the implementation is not correct?

jeremiahfallin commented 1 year ago

I think there are 3 ways to handle it.

  1. Set up a subscription as you suggested.
  2. Set up polling. (Similar to a subscription but it's just calling the query every so often instead of there being a back and forth relationship between the db and the client)
  3. Refetch the query when appropriate (when the table that's related to the query is changed). I couldn't find anything in the supabase docs about this so we'd have to create the functionality ourselves.
mentalcaries commented 1 year ago

@jeremiahfallin There's some uncommented code in PatientClinicalExamCard.tsx on line 36 that's supposed to do this. It's possible that it was forgotten during testing. I tried it on my current branch and it seems to solve the problem. Can you try it on yours when you get a chance and let me know

jeremiahfallin commented 1 year ago

@mentalcaries It fixes it on the modal but not on the edit page I'm using for my tissue.

jeremiahfallin commented 1 year ago

I believe PR https://github.com/Full-Stack-Collective/clerkwise/pull/29 will close this as well with the subscription.