You can create a "Published Function" in QIE.
function calcAge(dobIn) {
var dob = new Date(qie.formatDate('MM/dd/yyyy', qie.deduceDate(dobIn)));
var year = dob.getFullYear();
var month = dob.getMonth();
var day = dob.getDate();
var today = new Date();
var age = today.getFullYear()-year;
if(today.getMonth()<month || (today.getMonth()==month && today.getDate()<day)){age--;}
return age;
}
From a mapping function in QIE you can call this function and pass in a DOB.
var patientAge = calcAge(source.getNode('PID-7'));