Update AllergiesFrequency.groovy

bug fixes
1. checked for reference value instead of displayName (not consistent)
2. implemented check for null reference values
3. ONLY check for fields if allergy does exist