Skip to content

brianpos/smart-on-fhir

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMART on FHIR demo implementation

This specific fork of the project is intended to further expand on implementing the FHIR Smart App Launch inside a legacy desktop application (on Windows).

These types of systems are typically rich or fat clients, that directly connect to a database, or maybe through web services. This project is not intended to demonstrate how to create a FHIR Facade onto your existing system, there are other projects that do that. In this Smart Facade project, I leverage the fhir-net-web-api (NuGet package) to implement the FHIR server - so if you've already used that project, this will add in the Smart App launch capability quickly.

Introduction

This demo show cases Smart Health IT's Pediatric Growth Application, a web application using the SMART on FHIR specification to access data from the EHR

The demo consist of four components:

How to use the demo:

Note: Step 4 and step 7 might take some time to execute if the web apps are cold started

  1. Set both Solution Platform and Platform Target in Visual Studio to x86 for the EHRApp project. This step is required because we use the CefSharp browser component.
  2. Start EHRApp
  3. Select File -> Open -> Patient
  4. In the Find who text field enter: Susan
  5. Select Susan Clark with Patient Id smart-1482713, click the button Open
  6. Susan Clark's Patient form is open and the EHR context is Susan Clark
  7. Select Tools -> Pediatric Growth Application.
  8. If a consent screen pops up, let the defaults be and press the button "Yes, allow". This will authorize the Pediatric Growth Application to access "your" data
  9. You have now started a web app which is running in the context of your EHR authorized by your EHR system to use your data

Development Notes

  • Each Launch of a smart application for a patient will have it's own Launch Context, Fhir Facade instance, and Authentication API instance
  • API instances aren't exposed to the HTTP layer, so there is no attach surface open outside the Legacy Application
  • The cefsharp component provides the modern browser experience, without external dependencies
  • The example proxy sample stuff going out to the external server kinda skips browser CORS stuff as the proxy directly calls the remote API, not through the browser

There are several things that your application will need to CORS is implemented to only permit access to it's facade by pages in the registered web app's domain (or others specifically registered for it)

Legacy EHR App

  • Implementation of the Facade Model (System and Resource)
  • Provide the User/Patient Context on App Launch
  • Implement the Auth Verification - providing the User Identity Token

Useful External references

(CORS AuthProtocolHandler/SmartApplicationDetails) https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-3.1#host-filtering

cefsharp documentation https://github.com/cefsharp/CefSharp/wiki/General-Usage#handlers

Test Launch the Smart Forms test client https://launch.smarthealthit.org/?auth_error=&fhir_version_1=r4&fhir_version_2=r4&iss=&launch_ehr=1&launch_url=https%3A%2F%2Fsmartqedit4.azurewebsites.net%2Fsmart-launch.html&patient=fc200fa2-12c9-4276-ba4a-e0601d424e55&prov_skip_auth=1&prov_skip_login=1&provider=a6ba35b7-22d7-4bea-b87b-afbc9ff2f2ee&pt_skip_auth=1&public_key=&sb=&sde=&sim_ehr=1&token_lifetime=15&user_pt=

About

.NET Smart on FHIR support library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 82.4%
  • C# 15.8%
  • HTML 1.6%
  • CSS 0.2%