IFrame-ability of the O3 App
Summary of the Problem
In some cases, organizations need to embed the OpenMRS EMR into another system where their users already exist. This is generally approaced as an IFrame (iFrame, Iframe). For example, orgs may want users to go through a structured how-to-use-the-EMR online course, or embed a demo in their site.
Use case in 2022-2023: FAIMER needs O3 to be embedded in a Moodle course for IMG students to practice using an EMR within the context of a course on "how to use EMRs".
Helpful documentation from Moodle: https://docs.moodle.org/311/en/Iframe
Links to Know
Key Contacts: @Grace Potma Faimer Project EMR PoC for OpenMRS, & @Romain Buisson Technical Lead (Mekom)
Epic:
Error rendering macro 'jira' : Unable to locate Jira server for this macro. It may be due to Application Link configuration.Communication: Tbd
Designs: ______
Code: ______
Timeline: Needed for real-world use by IMG students using Moodle by end of March 2023.
In this page:
Sample Visual
Example image of an IFrame within a Moodle. Source: How to use the Generico plugin to add an iframe in Moodle
Requirements Discussion 2023-01-11
Romain, Florian, Ian, Grace
SSO? Assume no - login to EMR direct (not leveraging student's account)
Assume no communication needed btwn iframe and parent application
RefApp currently set up to block ability to iframe the app, because this has been a more secure option - in general you don't want the app to be iframed by just anything, because of risk of someone writing a malicious app that would place an invisible layer over the iframe and register key presses etc. But just a matter of tweaking a few settings. And this security concern is not a concern for Moodle or Demos.
Assuming we're using the same set of basically everything else
Is there anything in libraries, JS, etc that would prevent iFraming? Not really - options exist in JS but doesn't seem we are using those. (Need to adjust Security Headers then should work, minus unforseen issues.)
Ticket:
UI you get depends on the size you set in Moodle - caution around breakpoints. E.g. in this example there wasn't much room so it's showing in Tablet mode.
Example of O3 loading in an iFrame in a blank HTML page:
(but needs to be tested more)
To do:
Headings blocking iframe display all come from proxy nginx server → override
Config: Enable an environment variable?
Currently blocked in 19 & 37:
Ian to reach out to Emmanuel to test
Ian will start work on this or next week