Minimal example of a SMART app deployed on OpenMRS 2.x

I am trying to setup a minimal example of a SMART on OpenMRS 2.x environment to explore the possibilities of the same. I am using the fhir2-1.1.0.omod as directed in the https://wiki.openmrs.org/display/projects/OpenMRS+FHIR+Module#OpenMRSFHIRModule-ExploreFHIRsupportforOpenMRS

However I am unable to figure out the Oauth mod that I require to host a SMART app on openmrs. I tried using the OAuth mod mentioned in https://wiki.openmrs.org/display/projects/OpenMRS±+OAuth2+Module. However upon installing this omod openmrs fails to open the login page.

Do we have any starter guide on setting up a quickstart for a SMART App on openmrs ? @ibacher. @ccwhite23

1 Like

Kindly share the error you are getting.

could this Enabling SMART Apps in OpenMRS - Projects - OpenMRS Wiki be useful to you.

I am getting a little lost here . So on the Smart Container project(https://github.com/openmrs/openmrs-module-smartcontainer) it says new development is being done in building SMART of FHIR apps.

I also see some work getting done here. This seems most likely the new support being built.

This seems to be a more recent development and I was looking for some recommendations from the community on building SMART on FHIR apps.

I am not getting any error. When i use the OAuth2 omod and restart the openmrs server I just dont get the openmrs slogin page anymore.

@som.bhattacharyya Currently, there is no supported way to run SMART-on-FHIR apps on OpenMRS.

The OAuth2 module might work, but certainly not on any version of OpenMRS platform after 2.3.x. This is because it depends on the deprecated Spring OAuth Server project which only works on a slightly older version of Spring than the version in the latest platform release. Your best bet would be to try things on OpenMRS platform 2.0.5, and even then, I think some code changes are necessary to account for the different URLs between the FHIR2 and FHIR module.

We have done more recent work as part of a GSoC project to create a newer SMART on FHIR flow. This work depends on having a Keycloak server as the OAuth2 provider and is currently waiting on this PR before we can really support the SMART protocol on Keycloak. The work for that is spread between the new smartonfhir module you found, but also two Keycloak plugins, one connecting Keycloak to the OpenMRS user store and one that actually implements the SMART protocol. Currently, this support is a little hacky as it’s in-development and it really only supports the standalone launch sequence of the SMART App Launch protocol.

You’re welcome to play around with things and PRs are always welcome, but you shouldn’t expect things to be in a state where we have a minimal recommended setup yet.

2 Likes

Thank you. I guess i just reached the bleeding edge ! I started looking for a decisions library and found CDS hooks holding that clue I ended up here in the SMART/FHIR module. Its very exciting to me. I will play around and see if I can make any meaningful contribution. May need to ask help to setup a dev workspace. Thank you very much for taking the time to impart the information.

2 Likes

Hi @som.bhattacharyya - I am also excited about SoF apps in OpenMRS. My team has been doing some SoF CDS apps outside of OpenMRS, plugging into Epic and other SoF supporting EMRs here in the US. @ibacher do you know if the MFE work will support the idea of SoF apps being used? Or if there is any SoF auth or launch momentum that we could leverage from any of our current projects? Wondering how we push the envelope here to support getting the foundation for being a EMR supporting SoF for our movement in the CDS realm (analytics squad, right?)

2 Likes

I think there are still some details to be worked out with the MFE work regarding how things are loaded, etc., but in principle there’s no reason that the MFE work stops us from launching SoF apps. It’s just a matter of ensuring that there are appropriate extension slots in the patient chart or elsewhere in the application.

I love the idea of support SoF in OpenMRS and if someone has the time and inclination, it shouldn’t be a huge lift to get the GSoC project into a working state. I know @sidvaish97 has expressed interest in continuing to work on it, but he’s still in school. Basically, if there’s some momentum and someone can commit a couple of months of developer time to it, there’s no reason we shouldn’t be able to get SoF fully working in OpenMRS.

CDS Hooks is also a bit orthogonal to the work to support CDS being done in the analytics engine. With the analytics engine, we want to leverage it’s streaming capabilities to enable real-time calculation of data that can be used for CDS. With CDS Hooks, we’d be sending a request to an external CDS system that does the calculation. Of course, one way we could get CDS integration with the analytics engine is to make the analytics engine one of those external systems :slight_smile:.

CDS Hooks is definitely on the list of things I’d like to see supported in OpenMRS. We do need to have some discussions around how we properly trigger CDS Hooks and what infrastructure we need in place for that. This might be an appropriate topic for a design forum at some point?

2 Likes