var alarms = JSON.parse(value);

var result = alarms.map(function (alarm) {
	summary = alarm['alarm-summary']
	if (summary['no-active-alarms'] !== null) {
		return {
			'{#ALARM_DESCR}': alarm['alarm-detail']['alarm-description'] !== null ? alarm['alarm-detail']['alarm-description'] : 'None',
			'{#ALARM_CLASS}': alarm['alarm-detail']['alarm-class'],
			'{#ALARM_TYPE}': alarm['alarm-detail']['alarm-type'],
			'{#ALARM_NAME}': alarm['alarm-detail']['alarm-short-description']
		};
	} else {
		return {
			'{#ALARM_NAME}': 'no-active-alarms',
			'{#ALARM_CLASS}': ''
		}
	};
});

return JSON.stringify(result);