I am trying to make a diagnosis in my nutritional app, where depending on the body weight of the last evaluation, I can diagnose the body composition. But, I cannot adequately segregate the data of each of the patients (despite implementing the filters).
The PWA (Progressive Web App) is a SAAS (Software As A Service) aimed at Nutritionists and personal trainers. In their work, various body evaluations are done to know the amount of body fat and muscle mass that the patient has.
These measurements are used in algebraic formulas to obtain absolute values ​​(kilograms) or in percentages of the total body, and a health diagnosis is made with respect to international reference tables.
I already managed to build the Database (Collections and Properties) and managed to separate the measurements of each of the patients and each of the health professionals in charge of them, also, I already managed to build the formulas to produce the correct ones. results .
But, when I want to take the most recent data to use it in the diagnosis, it takes the sum of all the records in that “Property” and that “Collection”. I think the solution is to filter by dates, which, apart from the creation and update “Properties”, also create a “Evaluation Creation Date”