Currently, our foreign references use medicine name which can change.
This causes a problem when renaming / deleting a medicine
We'll need to either
- Update all references (remembering to update any new foreign data trees added down the line)
- Use userId and medicineId fields which would never change
Also, if an item is renamed / deleted while another user is looking at it, the app crashes because the item is removed from the apps collection and a re-render is triggered.