Use of environment info to control HL7 transformations
Hey everyone.
I was curious if anyone had any success/tips with regards to using a global or a system parameter/property to control the behavior of a transform or process/operation.
Is there a parameter I can currently reference from the system that can be used for an if/else, or am I best off creating a simple Global and setting it according to the environment I am in?
Comments
It depends what you really need.
SYSTEM MODE
There are existing global flags that are available through various classes. For instance SystemMode() will provide system wide constants for Live, Test and Dev...
The SystemMode() is admin configured via the Memory and Startup screen on the management portal.
LOOKUP TABLES
For some global settings, particularly business related, it would be good practice to use lookup tables and not a global...
UTIL FUNCTIONS
Also, if you are not aware of them yet, you should take a look at creating your own Ens util functions which are automatically inherited into routers and DTL's and provide a good place to stash various levels of global and business value / logic...
https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=EBUS_utility_functions
Hey Sean.
I had considered using the values from Memory and Startup, but was unsure of the exact class to call it, so thank you.
I think my approach will be to use a util function which then returns a value based on SystemMode (I say based on, as I would want the same behavior even when failed over in a mirrored setting)