This feature reminds me of when I co-developed a payroll app that would accept a variety of formulas to pay physicians and nurses (Hours times rate + RVUs times RVU Rate + Hours off shift times off shift rate, etc).
Since the formulas for each provider x hospital could vary wildly, the solution I could think of to accommodate with maximum flexibility was to have each formula converted to a C# class at runtime, pretty much like the "source" variable in the image, compile it to a DLL in memory, then run it after plugging in the values.
That was in .Net 1.1
It worked nicely for nearly 2 decades until they decided to reimplement it in a different platform and retire the app.
