call javascript variable within velocityTest expression inside includeif

Hello everyone, i am working on a project that requires redirecting to another page after saving once the patient’s age is greater than 40 and HIV test is reactive. my challenge is how to use getValue(‘testresult.value’) inside velocityTest expression to pull obs data from the from. below is my code for review and assistance.

    <redirectOnSave url="/htmlformentryui/htmlform/enterHtmlFormWithStandardUi.page?patientId=$macroCurrentPatientID&amp;visitId=$macroCurrentPatientVisitID&amp;formUuid=$macroRecencyFormUUID&amp;returnUrl=%2Fopenmrs%2Fcoreapps%2Fclinicianfacing%2Fpatient.page%3FpatientId%3D3d0927bd-2c7b-459b-8bf7-d200f4bcf77f%26"/>

</includeIf>
    </ifMode>