BIDMCDigitalPsychiatry / LAMP-platform

The LAMP Platform (issues and documentation).
https://docs.lamp.digital/
Other
12 stars 10 forks source link

Issues with visualization attachments (from cortex to mindLAMP) in mindLAMP portal tab #688

Open Tuna9129 opened 1 year ago

Tuna9129 commented 1 year ago

Describe the bug When I go to the portal tab on mindLAMP after attaching the visualizations via cortex (and enabling them on the Portal by choosing the data I want to see on the dashboard), I will see the visualizations I want. However, I also see something weird that should not be there. It happens on both my iPhone and my laptop. My coworker also noted the same issue on their devices as well.

To Reproduce Steps to reproduce the behavior:

  1. Go to cortex and attach a participant level visualization
  2. Go to mindLAMP Portal tab
  3. Click on + sign (for Cortex visualizations) and select the relevant data (participant lvl visualization that was attached via cortex)
  4. Scroll and see error

Expected behavior When doing the above, it should show only the participant level visualizations and not the weird "lamp.dashboard.experimental...." thing you will see in the screenshot below.

Screenshots

image

FF6C7DFE-3DC8-4EDD-8F17-93C3FE519293_1_102_o

Desktop (please complete the following information):

Smartphone (please complete the following information):

lukeoftheshire commented 1 year ago

Can you let me know the python code that you ran to get this in cortex?

Also, can you run list_attachments and also get the stored value of 'lamp.selectedExperimental' on the participant in question? This looks like LAMP is trying to find an attachment that doesn't exist.

Basically, the way the participant portal page works is the tag has to start with 'lamp.dashboard.experimental.NAME' and then the tag 'lamp.selectedExperimental' will be an array of strings. If one of those strings is "NAME" (NOTE: NOT 'lamp.dashboard.experimental.NAME' [I think]) then LAMP will fetch 'lamp.dashboard.experimental.NAME'. So I'm guessing that 'lamp.dashboard.experimental.NAME' has been erroneously put into the 'lamp.selectedExperimental' array and is causing this issue, because LAMP is trying to fetch something like 'lamp.dashboard.experimental.lamp.dashboard.experimental.NAME'.

Tuna9129 commented 1 year ago

Sure! I've put it in a screenshot.

So I think you're right. When the stored value of 'lamp.selectedExperimental' is returned, it returns BOTH 'lamp.dashboard.experimental.NAME' AND just 'NAME' for every single visualization.

image
lukeoftheshire commented 1 year ago

Yup - so the "bug" here is most likely in the code that generated/attached these tags. If you want to post it I can take a look (up to you!). If this was generated only with cortex functions (as opposed to someone writing a block of code) it should be looked into so we don't have buggy methods in cortex.

Otherwise, a solution to this is probably not to show tags that don't load on the portal page - which we maybe should do anyway.

Tuna9129 commented 1 year ago

Thanks for the response!

This was generated only with the cortex function (cortex.visualizations.participant.passive(id)) A coworker was also having a similar issue so I think it is an issue with the relevant methods in cortex.

Regarding your last sentence, should I reassign the issue to orangeloops?

avaidyam commented 1 year ago

@Tuna9129 I've reassigned the issue for you. Please be sure to add the right labels and project to each GitHub issue when creating them. //cc @ertjlane @carlan1 @lugray1

Tuna9129 commented 1 year ago

ok, will do, thank you!

mcurbelo-orangeloops commented 1 year ago

Hey @avaidyam and @Tuna9129 , I think this was mistakenly assigned to me ?

mcurbelo-orangeloops commented 1 year ago

@lukeoftheshire @avaidyam I just created this PR which I believe will fix this problem. as mentioned in the PR though, I have no way to verify because I don't have access to any data sets that will replicate this issue.

avaidyam commented 1 year ago

@Tuna9129 I've merged the PR so please check the staging Dashboard. Also, @lukeoftheshire @Tuna9129 the PR removes static PNG/image support - is that okay?

mcurbelo-orangeloops commented 1 year ago

@avaidyam I can re add the support on a different way, the reason I went with outright removal is because it would always show an empty image. The image tag was on the else branch of this statement visualizations["lamp.dashboard.experimental." + x] !== null where the visualization result was always nil and being used as the src for the image, therefore always showing empty.

avaidyam commented 1 year ago

Ah, that's a great catch! Thanks, could you add the functionality back in a more robust way? Vega graphs are our goal but we'd like image fallback just in case.

mcurbelo-orangeloops commented 1 year ago

Any ideas for what the condition should be for displaying either ? Not too familiar with the data being shown so any help is appreciated. Or is it a matter of "try one, if it doesn't work, try the other one"?

avaidyam commented 1 year ago

I suppose it's a fallback only in case the first one doesn't work.

ertjlane commented 1 year ago

Looking in the staging dashboard it appears that visualizations are still not showing up. Should we expect this to be the case?

Screenshot 2022-10-25 at 16 43 00
ertjlane commented 1 year ago

@SethgunterOL

falmeida-orangeloops commented 1 year ago

@ertjlane Even though I checked the existing participants in the staging dashboard, I haven't been able to reproduce this issue. Here's an example of what the Cortex section looks like for me: Screenshot 2022-11-10 at 19-13-06 User U1610343133 I could not find a participant with a Cortex section that looks like your screenshot. Could you give more instructions/data so as to reproduce this?

Tuna9129 commented 1 year ago

image

Hello! I went and created a new test participant today and attached some graphs using cortex. cortex.visualizations.participant.passive('U7827153000', attach_graphs=True)

I then went to the staging dashboard and got the above screenshot. I'm looking into cortex right now because we are fairly certain that there's a bug within cortex causing this.

However, in the meantime, we want to do this: "a solution to this is probably not to show tags that don't load on the portal page - which we maybe should do anyway."

falmeida-orangeloops commented 1 year ago

@Tuna9129 thank you very much! Now I see the exact same as your screenshot. I'll look into that.

falmeida-orangeloops commented 1 year ago

This should be fixed by BIDMCDigitalPsychiatry/LAMP-dashboard#681. I tested this fix with the data that was provided above, as well as with some of the other previously existing data, and it is working for all of them now.

For screenshots showing the change, you can check that pull request's comments. @ertjlane let me know if you happen to run into this issue again!

Tuna9129 commented 1 year ago

Hello! Thank you, it is better but now there is another small issue. Basically, the visualizations no longer match up with what is selected to be displayed. Now, when I go to select a visualisation for display after attaching the graphs through the cortex method, the visualizations are doubled! I don't think I can explain it as well, so I have attached a video depicting the bug.

https://user-images.githubusercontent.com/105741216/206771290-fe408b74-2150-44da-8c2b-88d8671dbfd5.mov

However, we have decided to put this one on hold because we are thinking of having the portal page changed quite a bit anyways, so we have decided to wait.

falmeida-orangeloops commented 1 year ago

Ok I see, let me check again when I finish with the high priority issues!