This step-by-step guide walks you through the WSO2 Open Healthcare solution.
Note: The Sandbox Environment provides a limited set of functions. If you want to experience the full solution, contact us.
1. Signing Up
Sign up by creating a new account to access the sandbox.
1.1. Visit the Open Healthcare website, and click TRY IT OUT to open the sign-up page.
1.2. If you are a first-time user, create a new account to access the sandbox developer environment.
- Provide the required information as shown below, and click Sign Up.
- Add a valid business email address to obtain an email with your credentials.
1.3. In the email you receive with the credentials that are required to sign in, click Proceed to sign in.
2. Signing In
2.1. Sign in with the received credentials.
2.2. Update the password, and click Submit to reset your password at your first login before accessing the sandbox.
2.3. Enter the new username and password, and click Continue to sign in again with the new password.
3. WSO2 Open Healthcare Sandbox Environment
Once you have logged in, you view the homepage of the WSO2 Open Healthcare Sandbox Environment as shown below.
In the Sandbox Environment, you can deploy pre-built FHIR® APIs, create third-party applications, and invoke FHIR® APIs, etc.
3.1. You can access the API Publisher Portal and the API Developer Portal from the top navigation bar.
4. Deploying Pre-built FHIR® APIs
4.1. Click Open to start selecting FHIR® APIs.
4.2. Select the required FHIR® APIs from the given list.
Note: There is a limited number of APIs available in the Sandbox Environment.
- The selected APIs are shown on the right side as Selected FHIR® APIs.
- Click Next after selecting the APIs.
4.3. Configure the deployment options for the APIs.
4.4. Click Deploy.
4.5. Click Yes to confirm the deployment.
After the deployment, a summary of the deployment will be displayed as shown below.
You view the resources for each of the published APIs.
Note: Follow the below steps if you encounter any errors/failures when deploying your APIs.
- Sign in to the API Publisher portal and try to publish your APIs via the Publisher portal.
- Contact us for further assistance.
4.6. Click Download Integration Project to download the integration project file.
Info: Click the Learn more... to learn more about the integration project and how to import projects into WSO2 Enterprise Integrator.
4.7. When you are all set, click Finish.
4.8. Click Yes on the warning pop-up.
5. Registering a SMART on FHIR® Application
5.1. Sign in to the developer portal and click Applications.
The applications owned or shared with you are listed in the view below.
WSO2 Open Healthcare sandbox comes with a pre-created DefaultHealthcareApp application, which allows 10 requests per minute by default.
You can also register your own SMART on FHIR® applications.
5.2. Click Applications and click Add New Application.
5.3. Enter the required application details, and click Save.
Note: There is only one throttling policy (10PerMin) enabled in the sandbox.
Once you successfully create the application, you will be redirected to the application Overview page of the application.
5.4. Click Applications to navigate to the Applications listing page.
You view your new application listed with the other applications. The application owner can edit or delete the application.
6. Invoking APIs
When you sign in to the API Developer Portal as an application owner/developer, you view the published APIs on the Developer Portal. It allows you to discover and invoke the required APIs.
6.1. Sign in to the Developer Portal and click on an API you wish to invoke.
6.2. Scroll down the Overview page of the API and click Subscribe to subscribe to the API using an application and an available throttling policy.
6.3. Select an application and an available throttling policy, and click Subscribe.
You view all the subscriptions under the Subscriptions tab.
6.4. Click Applications
- Click on the application that you used to subscribe to the API.
- Click Production Keys.
- Click Generate Keys to generate a production key.
The sandbox supports the two options below to invoke APIs.
- Invoking an API using the Integrated API Console.
- Invoking an API using an API Client.
Option 1: Invoking an API Using the Integrated API Console
6.5. Click APIs, and click on the API that you need to invoke.
6.6. Click Test under the resources section of the API.
6.7. On the API Console, click Get Test Key to add the access token in the Authorization field to test your API.
6.8. Expand the resource method (e.g., GET method), click Try it out, and then click Execute.
Now, you view the success response for the API invocation on the console.
Option 2: Invoking an API Using an API Client
Follow the [steps 6.1 - 6.4] to successfully subscribe to an application and generate production keys for the same.
6.9. Copy the access token to the [clipboard you generated].
6.10. Click APIs and then click the API you want to invoke.
6.11. Click the “Overview tab and under the Gateway Environments section, and expand Production and Sandbox to retrieve the API’s base URL.
6.12. Use your preferred API client and invoke the API.
For example, if you use Postman, you can do it as shown below.
7. Invoking the Capability Statement and Well-Known Uniform Resource Identifiers
Capability statements are auto-generated based on the deployed FHIR® APIs.
The below are the open URLs (no authentication is required) for the statements. The following URL format has to be used to generate the capability statement.
- Well-Known Uniform Resource Identifiers - https://fhir.sandbox-healthcare.wso2.com/gw/t/<tenant>/.well-known/smart-configuration
- Capability Statement - https://fhir.sandbox-healthcare.wso2.com/gw/t/<tenant>/metadata
Your tenant name is the part that comes after the `@` character in your username.
For learning more, see HL7 FHIR® Capability Statements.
8. Sample Integration Project
Info: Sample Integration project includes an application which will connect to a back-end database, which contains the sample health data. It will transform that data from the database into FHIR® format and expose the same as FHIR® APIs accordingly.
Importing Projects into the WSO2 Integration Studio
You can import the downloaded project with the WSO2 integration Studio.
Configuring Integration Studio
8.1. Download WSO2 Integration Studio.
8.2. Navigate to the <microesb> folder.
8.3. For example, if you are using Linux, your <microesb> folder would be /IntegrationStudio/runtime/microesb.
8.4. Download the provided files and copy them into the required folder as shown below.
Note: Make sure to copy these files before starting the Integration Studio.
Importing the Downloaded Integration Project to the Integration Studio
Now, you can run the Integration Studio and import the previously-downloaded project file into it.
8.5. Open the Integration Studio application.
8.6. To import the project, click Open Project.
8.7. Select the root directory of the downloaded Integration Project file.
8.8. Click Finish to complete importing the project.
You have successfully imported the project into the Integration Studio.
8.9. Double click the project files to view the visual integration flow.
Info: The following advanced step-by-step instructions will explain how to export the APIs, invoke APIs and run the integration project.
Invoking APIS in Integration Studio
Executing the database scripts on MySQL
Note: You need to set up MySQL before going through the following steps.
8.10. Open a terminal
8.10.1. Start the MySQL service and log in as the root user. If you are using Linux, you can use the following commands.
sudo /etc/init.d/mysql start
mysql -u root -p
8.10.2. Execute the command below to create a database named ‘Insurance1DB’.
create database Insurance1DB;
8.10.3. Execute the command below to change the working database to the created database.
8.10.4. Execute the database script Insurance1DB_SelfContained.sql
This script is in the WSO2OHSampleIntegrationProjects/WSO2OHSampleHospitalDataService/dbscripts folder.
Use the below command to execute the script.
Setting up the MySQL configurations
8.11. Click Server Configuration.
This is the deployment.toml file for the Micro Integrator.
8.12. Add following configurations to the file.
id = "Insurance1DB"
url = "jdbc:mysql://localhost:3306/Insurance1DB"
username = "root"
password = "root"
driver = "com.mysql.jdbc.Driver"
Configuring Environment Variables in Micro Integrator
8.13. Right click on the WSO2OHSampleIntegrationProject and select Run As -> Run Configurations
8.14. In the Run configurations window, Click Generic Server.
8.15. Click Environment tab.
8.16. Click Add to add a new environment variable.
8.17. Add a new variable as given below and click OK.
Name = wso2_oh_sample_baseUrl
Value = https://localhost:8290/services/odata
8.18. Click Apply and close the window.
Running the Integration Project
8.19. Right click on the WSO2OHSampleIntegrationProject and select Run As -> Run on Micro Integrator.
8.20. Click Finish.
8.21. Invoke APIs using Postman as shown below.
GET url - https://localhost:8290/r4/Patient