You need to create Standalone Patient Launch page for the Growth Chart. Create the growth-chart/standalone/patient.html file with the following content (which is just modified example from the Growth Chart repository):
Create the .env file and fill in your Aidbox License ID and License Key:
AIDBOX_LICENSE_ID=AIDBOX_LICENSE_KEY=AIDBOX_BASE_URL=http://localhost:8888# Client to create on start upAIDBOX_CLIENT_ID=rootAIDBOX_CLIENT_SECRET=secret# root user to create on start upAIDBOX_ADMIN_ID=adminAIDBOX_ADMIN_PASSWORD=secret# db connection paramsPGPORT=5432PGUSER=postgresPGPASSWORD=postgresPGDATABASE=aidbox
Start Containers
run the docker-compose up command.
Configure Aidbox
You need to create Client, User, Patient, Access Policies, and load Observations
Sign In
Go to http://localhost:8888 and login as admin then use Notebooks to run the following queries.
Create Client
PUT /Client/growth-chartauth:authorization_code:audience: - http://localhost:8888/smartredirect_uri:http://localhost:9000/smart:launch_uri:http://localhost:9000/launch.htmlsecret:gcgrant_types: - authorization_code
Create Patient
PUT /Patient/patient-1idyaml:patient-1name:- given: - Marcusfamily:Berguse:usualbirthDate:'2000-12-27'active:truegender:male
Create User
The user needs to be linked with a Patient resource
PUT /User/useremail:user@test.comfhirUser:id:patient-1resourceType:Patientpassword:'123456'
Create Role
POST /Rolename:Patientuser:id:userresourceType:Userlinks:patient:id:patient-1resourceType:Patient
Create Access policies
Allow Growth Chart to Access Patient Data
PUT /AccessPolicy/smart-read-patient-on-behalfengine:matchomatcho:uri:'#/smart/Patient/.*'params:id:.on-behalf.fhirUser.id
Allow Growth Chart to Access Patient Observations
PUT /AccessPolicy/smart-search-on-behalfengine:matchomatcho:uri:'#/smart/Observation'params:patient:.on-behalf.fhirUser.id
Open http://localhost:9000/standalone/patient.html it will redirect you to login page. Sign in as user and allow access to the data for the Growth Chart App.
Now you should be able to see a plot of Observations