Read about OpenEMR's Response to the COVID-19 Pandemic at

Prevent OpenEMR from breaking out of iframe

For our implementation of OpenEMR we need to embed it in the Boonex Dolphin CMS system by means of an iframe.
The problem is that when you enter login details and click Enter, the program “breaks out” of the iframe and displays full-page in the browser, replacing our web site.
Preventing this by iframe settings such as sandboxing also disables the login and was no solution.
I then went through the code and found 3 files where… is used and tried changing that to window.location.href
To no avail, OpenEMR continues to break out of the iframe.
I would appreciate it if you could tell me what and where to tweak to stop it from “going for the top” so we can use it embedded on our site.

OK, I found the solution. If anyone ever needs this, here’s the way to do it.
It is not the files with the top.location code that I mentioned in my post.
It is 3 other files, where one has to change target="_top" to target="_self".
The files are: