jkuester,
Thank you, I have modified my code as below:
module.exports = [
{
id: 'percentage-covid-test',
type: 'percent',
icon: 'icon-healthcare-assessment',
goal: -1,
translation_key: 'targets.covid.title',
subtitle_translation_key: 'targets.this_month.subtitle',
appliesTo: 'contacts',
appliesToType: ['person'],
passesIf: function covidPercTested(contact)
{
return contact.reports.some(report => report.form === 'screening' && report.fields.cov === 'true');
}
date:'reported'
},
];
I get ..../targets.js. SyntaxError: Unexpected identifier
Now that we have the function defined, I think we donāt need to define any function in the nools-extras.js
file
Still getting errors, need to figure this out today and define targets for the other items
If it works for Covid, it will work for the others