Closed brylie closed 11 months ago
We aim to create a flattened Activities table (ResidentActivity
) for more efficient data aggregation and visualization in our Django-based caregiving project. This table should synchronize with the main Activity table and related entities. Our current challenge involves deciding on the most effective method to achieve this synchronization.
I agree, could I be assigned to this issue as well then?
Hey, I finished the metrics app and implemented the stacked bar chart. I manually tested to see if when an activity is created, the resident_activity table is also triggered and the activity is recorded. I wasn't sure how to go about writing tests. I tried using self.client.post to create an activity object. I receive a 200 response but no activity object is created. Could you take a look and help with writing tests?
Also since updating activity isn't currently a feature, I haven't implemented updating resident_activity_table.
https://github.com/adrienneli104/caregiving/tree/aeli_graphs
Great work! Go ahead and open a pull request so I can test the code.
Hey I've made a PR and my teammates have made PRs for the other issues. Would be great if you could test it out sometime!
Overview
Our current Activity data model, while robust, presents challenges in generating charts and reports due to its complex relationships, particularly the ManyToMany relationship between Residents and Activities. To streamline data aggregation and improve performance, we propose creating a new Django application,
metrics
, featuring a more efficient data model.Proposed Model: ResidentActivity
resident
: ForeignKey(Resident)activity
: ForeignKey(Activity)residency
: ForeignKey(Residency) - Linking Resident and Home at the activity timehome
: ForeignKey(Home) - Derived from residencyactivity_type
: stringactivity_minutes
: intcaregiver_role
: strSynchronization with Activity Model
Ensuring data consistency between the Activity and ResidentActivity models is critical. We are considering two approaches:
Custom Django Model Manager:
Django Signals:
Task Breakdown
metrics
App: Develop the new Django application within our project.Next Steps
Once the metrics application and ResidentActivity model are established, we will focus on defining specific metrics and developing visualizations to support caregiving in elder care communities.
Conclusion
This initiative aims to enhance our data handling capabilities, making it easier to generate meaningful insights and reports. The success of this implementation will lay the groundwork for advanced analytics in our caregiving project.