BIDMCDigitalPsychiatry / LAMP-platform

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

DBT Diary Card Graphs #49

Closed avaidyam closed 3 years ago

avaidyam commented 3 years ago

@sarithapillai8 - I'm splitting this issue out from the broader DBT Diary Card Updates one to ensure that we tackle it appropriately and prioritize it correctly. To recap:

elenamrv commented 3 years ago

@sarithapillai8 if you have any questions, please ask @avaidyam and myself! This has become a priority on our end. Thank you!!

avaidyam commented 3 years ago

@sarithapillai8 I'm still seeing some visual issues with the graphs in the staging build where the charts aren't populated correctly. Can you take another look at whether the data is being plugged in correctly in the right format to the Vega charts?

sarithapillai8 commented 3 years ago

@avaidyam Could you please specify the case where data is missing. I tested some cases and it was fine.

avaidyam commented 3 years ago

None of these graphs look correct to me (perhaps @elenamrv can elaborate if needed):

Screen Shot 2020-12-07 at 6 48 15 AM Screen Shot 2020-12-07 at 6 48 21 AM Screen Shot 2020-12-07 at 6 48 25 AM Screen Shot 2020-12-07 at 6 48 32 AM Screen Shot 2020-12-07 at 6 48 40 AM
sarithapillai8 commented 3 years ago

@avaidyam I am not getting this NaN values, but I understood that the graph is not showing actual required data. I can recheck and update ASAP.

sarithapillai8 commented 3 years ago

Which values to be used for plotting Actions and self-care graph? For the temporal_slices, the data is saved like :

0: {item: "Effective behavior 1", value: 1, type: "0", level: "target_effective", duration: 0}
1: {item: "In Effective behavior", value: 2, type: "0", level: "target_ineffective", duration: 0}
2: {item: "Emotions", value: 3, type: null, level: "emotion", duration: 0}
3: {item: "Mente Sabia", value: "Habilidades de conciencia plena", type: null, level: "skill", duration: 0}
4: {item: "efectividad en las relaciones (GIVE)", value: "Interpersonal", type: null, level: "skill", duration: 0}
5: {item: "Resolución de problemas", value: "Habilidades de regulación emocional", type: null, level: "skill", duration: 0}
6: {item: "Paired Muscle Relaxation", value: "Habilidades de aceptación radical", type: null, level: "skill", duration: 0}
avaidyam commented 3 years ago

@sarithapillai8 Using the level parameter, "Emotions" = emotion, "Urges (effective)" = target_effective, "Urges (ineffective)" = target_ineffective, "Actions" = skill. The "Self-care" should come from the "Did you use these skills today? (Yes/No)" question.

sarithapillai8 commented 3 years ago

@avaidyam This is the format expected in actions and selfcare graph : so what value expected for count here?

"data": {
    "values": [
      {"action": "Self-care", "count": 9},
      {"action": "Punching self", "count": 3},
      {"action": "Binging", "count": 20},
      {"action": "Violence towards others", "count": 1},
      {"action": "Substance abuse", "count": 5},
      {"action": "Mastery", "count": 25},
      {"action": "Self-harm / cutting", "count": 2},
      {"action": "Verbal assualts to others", "count": 1},
      {"action": "Compare self to others", "count": 10}
    ]
  },

It can be done like - count param value as 1, if the skill is selected. Is that ok?

avaidyam commented 3 years ago

The count parameter is the number of times that action appeared in the activity events, i.e. if the DBT Diary Card was taken 4 times and each time the "Self-care" item was marked, then the count should be 4. (@elenamrv can correct me if I'm wrong about this implementation detail!)

avaidyam commented 3 years ago

@sarithapillai8 Very sorry - it appears I misunderstood! @elenamrv clarified to me:

  1. [Multiple Line Chart] Emotions:
    • X axis: day (rolling, 7 days)
    • Y axis: rating scale value
    • Label: emotion name
  2. [Multiple Line Chart] Urges (both effective/ineffective)
    • X axis: day (rolling, 7 days)
    • Y axis: rating scale value
    • Label: target behavior name
  3. [Multiple Bar Chart] Actions (RENAME to "Actions (Summary)")
    • X axis: target behavior name
    • Y axis: rating scale units (mapped to event.temporal_slice.*.type)
    • Label: target behavior name
  4. [Multiple Bar Chart] Self-care (RENAME to "Actions (Timeline)")
    • X axis: day (rolling, 7 days)
    • Y axis: rating scale units (mapped to event.temporal_slice.*.type)
    • Label: target behavior name

Original Mockup

Desktop - Mood

elenamrv commented 3 years ago

@sarithapillai8 - if you have any questions about what values go where, please let me know! I am happy to explain on a call, too!

sarithapillai8 commented 3 years ago

@avaidyam @elenamrv I am not clear with the below things, especially what this mean - rating scale units (mapped to event.temporal_slice.*.type) :

[Multiple Bar Chart] Actions (RENAME to "Actions (Summary)") X axis: target behavior name Y axis: rating scale units (mapped to event.temporal_slice.*.type) Label: target behavior name

[Multiple Bar Chart] Self-care (RENAME to "Actions (Timeline)") X axis: day (rolling, 7 days) Y axis: rating scale units (mapped to event.temporal_slice.*.type) Label: target behavior name

temporal_slices - data is like below :

0 : {item: "Effective behavior 1", value: 4, type: "12", level: "target_effective", duration: 0}
1: {item: "In Effective behavior", value: 5, type: "1", level: "target_ineffective", duration: 0}
2: {item: "Emotions", value: 2, type: null, level: "emotion", duration: 0}
3: {item: "Observe: Just notice (Urge Surfing)", value: "Mindfulness", type: null, level: "skill", duration: 0}
4: {item: "Effectiveness: Focus on what works", value: "Mindfulness", type: null, level: "skill", duration: 0}
5: {item: "One-Mindfully: In-the-moment", value: "Mindfulness", type: null, level: "skill", duration: 0}
6: {item: "Validating Others", value: "Interpersonal", type: null, level: "skill", duration: 0}
7: {item: "Self-Validation", value: "Interpersonal", type: null, level: "skill", duration: 0}
8: {item: "Self-respect effectiveness: FAST", value: "Interpersonal", type: null, level: "skill", duration: 0}
9: {item: "Opposite Action to change emotions", value: "Emotion Regulation", type: null, level: "skill", duration: 0}
10: {item: "Accumulate positive emotions", value: "Emotion Regulation", type: null, level: "skill", duration: 0}
11: {item: "Cope Ahead", value: "Emotion Regulation", type: null, level: "skill", duration: 0}
12: {item: "Pros and Cons of acting on urges", value: "Distress Tolerance", type: null, level: "skill", duration: 0}
13: {item: "Effective Rethinking/Paired Relax", value: "Distress Tolerance", type: null, level: "skill", duration: 0}
avaidyam commented 3 years ago

@sarithapillai8

rating scale units (mapped to event.temporal_slice.*.type)

This means to use the type field from each object of the temporal_slices array of each activity event, since the value field is the rating scale input, and the type field is the units input that corresponds to that target behavior.

sarithapillai8 commented 3 years ago

@avaidyam The type field will have a value for effective and ineffective behaviors only. So only those to be considered for Actions(timeline) and Actions (summary)?

avaidyam commented 3 years ago

@sarithapillai8 Yes - only the effective and ineffective target behaviors should be considered.

sarithapillai8 commented 3 years ago

@avaidyam Ok Got it. One more confusion in "Actions (Timeline)" - X axis: day (rolling, 7 days) Y axis: rating scale units (mapped to event.temporal_slice.*.type) Label: target behavior name The graph in the sample showing like a total for both effective and ineffective for each day. Don't we need to differentiate the behavior?

avaidyam commented 3 years ago

@sarithapillai8 They should both be on the same graph despite these being different types of target behaviors. 👍

sarithapillai8 commented 3 years ago

Updated in staging with the changes.