Written by

Senior Startups and Community Programs Manager at InterSystems Corporation
Question Evgeny Shvarov · Apr 5, 2016

How to avoid writing duplicate code in dtl InterSystems Ensemble

Hi! 

There is a question for Ensemble on Stackoverflow:

I have the below dtl. In the foreach loop, I am just copying the same code in another part under anif condition. How can I avoid this redundancy? Can I reuse using sub transformation?

Here is the dtl class file :https://docs.google.com/document/d/1snJXElyw13hAfb8Lmg5IaySc7md_DE8J40FB79hBaXU/edit?usp=sharing

Original question.

Comments

Nic Lorenzen · Apr 16, 2016

Maybe I'm missing something, but it seems like you could have an OR condition to eliminate the code duplication 

if condition='ExcludeInactiveAllergiesAlerts="No" OR flag'="No"

0