[url removed, login to view]
Will post what is above in order to be published but is redundant and incomplete:
This project consists of two programs (mainly two nested mysql queries) with same logic:
a) Cron Program -> Will make calculations for ALL patients and for the day of YESTERDAY
b) Calculator Program -> Will make calculations for a SINGLE patient and for the day of TODAY
So, we will refer to a single logic regarding the Calculator Program
1. For some reason out of the scope of this project we have the table PATIENTS MEALS
Check it and you will see structure and you will see that you can modify the field QTY
That field means the quantity in grams ingested of a food code (row).
Once all quantities are edited, rows will be calculated pressing the calculator icon which is the project program.
Patient will only see the foods for TODAY. Maybe you can see other dates because it is a different view and we are developing other programs and inserting data into such table from other dates.
Reference tables are NUTRIENTS PER FOOD and NUTRIENT CODES for better understanding. Check them to understand.
a) For every row (for the day of today and the selected patient) on table PATIENTS MEALS:
Check on table NUTRIENTS PER FOOD the amount of each individual nutrient for such food (row) and:
a.1) Multiply (qty on table PATIENTS MEALS by qty on table NUTRIENTS PER FOOD) and divide such resulting quantity by 100 and store it in a temporary variable (one for each defined nutrient)
a.2) Do this for all nutrients existing on table NUTRIENTS PER FOOD for such selected food (row) in PATIENTS MEALS and store each individual nutrient calculated quantity in its correspondient temporary variable.
Do this, for each row selected on PATIENTS MEALS making the cummulative sum of all nutrients contained in the entire meal (all selected rows)
After having all cummulative sums of nutrients per entire meal (all rows for such patient and the day of today)
b) Check if there is a row on table PATIENT DIARY (for such date and patient) and if so, delete it.
if non existent:
Add a new record on table PATIENT DIARY (Patient ID, date) plus all nutrients cummulative sums corresponding to table PATIENT DIARY fields and corresponding to the sum of all nutrients in the entire
As said before cron program will do the same but for ALL patients and for the day of YESTERDAY. At the end of the cron program, it will delete all records with qty=0 in table PATIENTS MEALS for cleaning purposes. (maybe should be done before calculting).
2. There is other small program to be done:
We have other TABLE X with the following fields:
id, patient_id, ndb_no, fdgrp_no, long_desc
Ask in an ajax form patient to be copied from (patient_id)
and patient to be copied to (also patient_id lets say "new" )
If there are rows for patient_id "new" in TABLE X, delete them
and copy all rows from patient_id to patient_id "new"
There are about 300 records for patient to be copied from, as an average.
Send mesaage of completion with processed rows.
php [url removed, login to view]
mySQL [url removed, login to view]
8 freelancers are bidding on average $208 for this job
Hi we checked your requirement,We could develop as per your need. u could check that out. we would work till your satisfaction. Thanks & Regards Techwelfare -- Please check inbox for our previous work.