Open larpra opened 4 years ago
It depends on your reason for this check.
If you only want to identify your research system you can simply use standard c# code to look for the pc-name because research systems are most often limited (we have only one): if (Environment.MachineName.ToString().ToLower() == vmstbox) ... else ...
All code that add, modify or delete things in a patient need script approval in clinical systems. Therefore you get errors if you do not approve them. Therefore you can use a try-catch-command to identify this cases. try {modify patient in some way. For instance AddStructure} catch{MessageBox.Show("ScriptApproval is missing")}
You can try some things that are only possible in research mode.
I found out that RemovePlanSetup is only possible in ResearchMOde. Therefore you could create a plan and then try to delete it. If it is not possible your are in clinical mode.
Other possible loops should be possible.
I wonder whether there is a more direct way? ESAPI must know whether it runs on a clinical system because several methods are only possible in Research mode.
Is there a way API code can identify whether the code is executed in a clinical system or in a development environment?