Skip to content

Patient facing app for generating health data on iOS devices and reporting back to the practitioner/health system

License

Notifications You must be signed in to change notification settings

SMARTMarkers/easipro-patient-ios

Repository files navigation

EASI-PRO Home App

A Health app for Patient Generated Health Data

EASI-PRO Home is a standalone patient facing iOS app built on the SMART on FHIR open specification and powered by the SMART Markers [framework] to receive and respond to practitioner's requests with PGHD data generated through survey like modules in-app. Built using Swift for iOS.

PGHD Instruments

The app relies on the SMART Markers framework's supported PGHD instruments to create a data generating user session. Many types of instruments are supported out of the box with more being actively developed. Some examples include: FHIR Questionnaire encoded surveys, PROMIS CAT surveys, activity data, sensor based activity tests and more. Check here for a complete list.

Functionality

  1. Users can login to their SMART enabled health system
  2. Fetch all practitioner dispatched requests for data
  3. Users generate or aggregate health data as per the request and/or the Instrument requested
  4. Users submit data to their health systems through the app.

Configuration

  1. You will need Xcode version 11.3 and Swift 5.0 and a FHIR Server endpoints and optionally their SMART credentials.
  2. Clone repository: $ git clone --recursive https://github.com/smartmarkers/easipro-patient-ios
  3. Make sure SMARTMarkers and its submodules are downloaded
  4. Add SMARTMarkers.xcodeproj, ResearchKit.xcodeproj, SMART.xcodeproj to the application's project workspace
  5. Compile ResearchKit and SMARTMarkers.xcodeproj
  6. Go to Project Settings -> General Tab and add the three frameworks and HealthKit to the Frameworks, Libraries, and Embedded Content.
  7. Build and run the app

You will need a SMART on FHIR endpoint to get started

extension FHIRManager {

    /**
     SMART Sandbox Credentials take from Config.xcconfig via App's
     - REPLACE Settings or create a new Client for other FHIR Servers
     */
    class func SMARTSandbox() -> FHIRManager {

        let infoDict = Bundle.main.infoDictionary!
        guard var baseURI = infoDict["FHIR_BASE_URL"] as? String else {
            fatalError("Need FHIR Endpoint")
        }
        if !baseURI.hasPrefix("http") {
            baseURI = "https://" + baseURI
        }

        let settings = [
            "client_name"   : "easipro-clinic",
            "client_id"     : "easipro-clinic-id",
            "redirect"      : "smartmarkers-home://smartcallback",
            "scope"         : "openid profile user/*.* launch"
        ]
        let smart_baseURL = URL(string: baseURI)!
        let client = Client(baseURL: smart_baseURL, settings: settings)
        client.authProperties.granularity = .tokenOnly

        //Initalize PROMIS FHIR server client with base uri, id, secret
        let promis = PROMISClient(..)
        return FHIRManager(main: client, promis: promis)
    }
}

  /*
  Initialize FHIRManager
  Can be done in AppDelegate
  */

lazy var fhir: FHIRManager! = {
        return FHIRManager.SMARTSandbox()
    }()


// Catch callback for SMART authorization
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

        if fhir.main.awaitingAuthCallback {
            return fhir.main.didRedirect(to: url)
        }

        return false
    }

SMART Markers

This app was built on top of the SMART Markers framework but with its own custom interface and user experience designed specifically for PROMIS instruments and has now expanded to include various instruments enabled by the framework. ResearchKit and SwiftSMART are used as its submodules

About

Patient facing app for generating health data on iOS devices and reporting back to the practitioner/health system

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages