Set up Smartbox locally
This tutorial will guide you through Smartbox installation and accepting developer SMART application process
Get licenses
Go to the Aidbox user portal and request 2 "self-hosted" Aidbox licenses for Portal and Develop Sandbox. It is a long string like
This string is your license key.
Install Docker and Docker Compose
Follow the official Docker guide to install Docker and Docker Compose
Configure cloud storage
Aidbox bulk API supports GCP, AWS and Azure cloud storages. To pass the Inferno tests cloud storage should be properly set up.
Set up email provider
In this guide mailgun
is used to send email. Also Smartbox supports different email providers and SMTP
Email provider (mailgun
) is used to communicate with users (developers, patients). It sends emails for resetting a password, email verification, etc.
Create docker-compose.yaml
Create a docker-compose.yaml
file and paste there following content.
There are three services: aidbox-db, smartbox and developer sandbox. The first one is PostgreSQL database and the other ones are Aidboxes.
Create .env file
To configure Aidbox we need to pass environment variables to it. We can pass them with .env file.
By default Aidbox logs are turned off, you can enable them by setting:
AIDBOX_STDOUT_JSON=true
To use alternative email provider see the document
Launch Aidbox
Run the following command:
Now Smartbox is ready.
Admin portal
Open the admin portal http://localhost:8888/ and login using credentials from the .env file AIDBOX_ADMIN_ID
and AIDBOX_ADMIN_PASSWORD
.
On the admin portal you can manage apps, patients and other admins.
Register developer
Submit developer registration form
Open Developer Sandbox on http://localhost:9999
Click the Sign Up button
Register a new developer
Once you submitted the developer registration form, you should receive an email with the verification link.
Follow the link to confirm your email address.
You will be redirected on creation password form
Create a password, submit it.
Now you can Sign In as developer to the Developer Sandbox.
Create a SMART app in developer sandbox
Get and deploy Growth Chart
To get and the Growth Chart downloaded and start it
Register a SMART App
Once you launched the Growth Chart app, you can register it in the Sandbox.
Click the Create app button
Populate the form:
App name: Growth Chart
Confidentiality: public
Redirect URL: http://localhost:9000/
Launch URL: http://localhost:9000/launch.html
Submit the new app form
Click the Submit for Review button to send the application to review
After Growth Chart is registered copy its Client ID
.
Update Growth Chart client_id
client_id
Open the file growth-chart-app/launch.html
and fill the client_id
property. Then save changes to the file.
Approve SMART App Publishing Request
Go back to admin portal on http://localhost:8888. You will see list of SMART App waiting for review.
Open the review request, made on the previous step,
click the Approve button.
Now the smart app is available for your patients
Enable FHIR API for tenant
Register a tenant
In order to register a tenant you need to create Tenant resource in Aidbox.
Open admin portal.
Go to tenants page.
Create new tenant named My Clinic (id will be
my-clinic
).
Once you created tenant, you enabled FHIR API for patient, practitioners and bulk clients. Patient portal is related to the tenant as well. The approved smart app is available for patient in that tenant.
Populate test data
Go to Aidbox REST Console. You may open it from admin portal
Run the following import:
Once you saw 200 OK, Patient resource (id=test-pt-1) and corresponding resources had been uploaded into Aidbox. New we can create a User which has access to that data.
Create User resource
In order to enroll your patient, you need to create User resource. Open Aidbox REST Console and run the following command:
Sign in as a User
User
Go to My Clinic's patient portal and login as the user, created above with example@mail.com
login and password
password. Launch smart app and provide requested consent.
That's it
In this tutorial we learned how to install Smartbox and to get your first SMART app approved.
Last updated