This is a getting-started guide for SMART on FHIR server developers who want to support the SMART Growth Charts app. For background, SMART on FHRI is a plug-in app platform for health apps based on open standards.
To run SMART's open-source Growth Charts app against your own SMART on FHIR server, you'll need to:
- Expose clinical data using FHIR
Patient
andObservation
resources - Protect your clinical data via the SMART on FHIR Authorization protocols(based on OAuth2).
To get up and running as easily as possible, this Quick-start guide helps you through two scenarios: first, to run the app in debugging mode against an unprotected server, and second, to get the app running against an OAuth2-protected server.
Once you've exposed the necessary clinical data (see payload examples below for full details), you can launch the Growth Charts app in debugging mode (no authorization required) by pointing it at your server's FHIR base URL:
https://fhir.smartplatforms.org/apps/growth-chart/launch.html?
fhirServiceUrl={FHIR base URL of your unprotected server}
patientId={patient ID from your server}
Once you've implemented the SMART on FHIR Authorization protocols, you can launch the app in production mode (with authorization) by completing the following sequence:
-
On your back-end, create a SMART "launch context" that includes a patient ID and any other context details you want to track. You'll assign a "launch id" to this context, which you'll pass to the Growth Charts app as a URL parameter. In the real world, you'd create a launch context every time a user launches an app (but for prototyping, you might just want to create a trivial implementation that hard-codes whatever values you care about).
-
Publish your server's OAuth2 URLs in your FHIR conformance statement (
https://your-protected-server/fhir-base/metadata
) withinConformance.rest.security
:
{
"resourceType": "Conformance",
...
"rest": {
...
"security": {
"extension": [
{
"url": "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#authorize",
"valueUri": "{OAuth2 'authorize' URL for your OAuth2-protected server}""
},
{
"url": "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#token",
"valueUri": "{OAuth2 'token' URL for your OAuth2-protected server}""
}
],
...
- Open a new browser window with the following URL:
https://fhir.smartplatforms.org/apps/growth-chart/launch.html?
iss={FHIR base URL of your OAuth2-protected server}
launch={opaque launch ID generated by your server}
When the SMART Growth Charts, it will fetch:
curl 'https://fhir-open-api.smartplatforms.org/Patient/1482713' -H 'Accept: application/json'
Note LOINC Codes: 3141-9
, 8302-2
, 8287-5
, 39156-5
curl 'https://fhir-open-api.smartplatforms.org/Observation?subject%3APatient=1482713&name=3141-9%2C8302-2%2C8287-5%2C39156-5&_count=50' -H 'Accept: application/json'