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:
  1. 1.
    Set up Aidbox.
  2. 2.
    Set up patient-access-smart-api sample project. You need to add next env variables and restart your Aidbox
    aidbox-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. 3.
    Create allowing access policy for "/smart" api.
    id: patient-access-smart-api
    resourceType: AccessPolicy
    engine: matcho
    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 fhirUser for a User.
resourceType: User
password: password
id: <patient-id>
resourceType: Patient

Inferno testing

Here you can find steps to pass inferno tests.
  1. 1.
    At first, you have to create Client for inferno
    # Run this request in REST Console
    PUT /Client/inferno-client
    id: inferno-client
    resourceType: Client
    secret: inferno-secret
    refresh_token: true
    secret_required: true
    access_token_expiration: 36000
    - authorization_code
    - basic
  2. 2.
    Upload synthetic data
    # Run this request in REST Console
    POST /fhir/$load
  3. 3.
    You should have a user bound with Patient.
  4. 4.
    You need to expose your localhost Aidbox to the public. You can use ngrok for instance.
    ngrok http 8888
    You will see something like this:
    Then copy forwading https connection and update base url env. In my case it's AIDBOX_BASE_URL=
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.
Last modified 5mo ago