Patient Access API
In this tutorial you will learn how to enable Patient Access API (Smart on FHIR) in your Aidbox
Patient Access API enables Smart App to get Patient's healthcare data after Patient provided corresponding consent. Patient Access API is delivered as aidbox-project which can configured within any Aidbox instance.
In order to enable Patient Access API in your Aidbox instance you have to:
- 2.Set up patient-access-smart-api sample project. You need to add next env variables and restart your AidboxAIDBOX_ZEN_ENTRYPOINT=aidbox.patient-access-smart-api.sampleAIDBOX_ZEN_PATHS=url:edn:https://raw.githubusercontent.com/Aidbox/aidbox-project-samples/main/aidbox-project-samples/smart-on-fhir/aidbox/patient-access-smart-api.edn,url:edn:https://raw.githubusercontent.com/Aidbox/aidbox-project-samples/main/aidbox-project-samples/smart-on-fhir/aidbox/patient-access-smart-api/sample.edn,url:zip:https://github.com/zen-lang/fhir/releases/download/0.2.14/hl7-fhir-r4-core.zip,url:zip:https://github.com/zen-lang/fhir/releases/download/0.2.14/hl7-fhir-us-core.zipaidbox-project is a configuration of Aidbox. It uses zen-lang. You can learn our single-patient-api project and a sample entrypoint. If you are not satisfied with current smart-api distribution you can copy the config and build you own one.
- 3.Create allowing access policy for "/smart" api.id: patient-access-smart-apiresourceType: AccessPolicyengine: matchomatcho:uri: '#/smart'
Now you have your Smart on FHIR server.
Patient Access API expects that you have User in your system bound with Patient resources. You can do this by specifying
fhirUserfor a User.
Here you can find steps to pass inferno tests.
- 1.At first, you have to create Client for inferno# Run this request in REST ConsolePUT /Client/inferno-clientid: inferno-clientresourceType: Clientsecret: inferno-secretauth:authorization_code:redirect_uri: https://inferno.healthit.gov/inferno/oauth2/static/redirectrefresh_token: truesecret_required: trueaccess_token_expiration: 36000grant_types:- authorization_code- basic
- 2.Upload synthetic data# Run this request in REST ConsolePOST /fhir/$loadsource: https://storage.googleapis.com/aidbox-public/inferno/inferno-community-fixtures.ndjson.gz
- 3.You should have a user bound with Patient.
- 4.You need to expose your localhost Aidbox to the public. You can use ngrok for instance.ngrok http 8888You will see something like this:Then copy forwading https connection and update base url env. In my case it's
Now you are ready to run Inferno test.
Pay attention that FHIR base url for Smart on FHIR is [hostname]/smart
After running Standalone Patient App test you should open [host]/auth/grants and revoke the provided access for Inferno client
Inferno starting page
Standalone Patient App test
Limited App test
Other Inferno tests are related to Provider Access API. So, it's out of scope of Patient Access API which we are considering in current tutorial.