/
Compare lab collections with date/ time of last meal

© 2025 IQVIA - All Rights Reserved

Compare lab collections with date/ time of last meal

Edit Check to compare lab collections with date/ time of last meal.

var ret = false; if ('Complete' == itemJson.item.dataCollectionStatus) { //make sure we're complete var fastingItem = findFirstItemByName(formJson, 'FastingDate'); if (fastingItem && fastingItem.dataCollectionStatus == 'Complete') { //now find fasting //get the date milliseconds of each var msInOneHour = (60*60*1000); varfastingDate = fastingItem.dateValueMs; var thisDate = itemJson.item.dateValueMs; var hourDelta = ((thisDate - fastingDate) / msInOneHour); ret = (hourDelta > 8); //need to be fasted for at least 8 hours } } return ret;

On line ‘3' is where we do the lookup of the fasting. Replace the second parameter (FastingDate) with the actual item name where you’re capturing the fasting datetime.

Line 10 is where we ensure they are fasting at least 8 hours.

Related content

Comparison of End of Study and AE Outcomes
Comparison of End of Study and AE Outcomes
More like this
Age-specific Validation
Age-specific Validation
Read with this
Cockcroft-Gault Equation
Cockcroft-Gault Equation
More like this
Custom Error Messages
Custom Error Messages
Read with this
Find Item Value From Same Study Event
Find Item Value From Same Study Event
More like this
Ongoing Consistent with End Date
Ongoing Consistent with End Date
Read with this

Exported and Printed Copies Are Uncontrolled