Interoperability layer

How to get started with interoperability?

This section contains developers guide for getting started with interoperability layer using HL7 FHIR. Let us dive in without further background. In this section, we discuss how to get started with resource server.

To read more about interoperability layer, please read following articles:

Prerequisite

Getting started

Follow the steps below:

  1. Download zip of the latest release of the INTROMAT FHIR project here: https://github.com/sureshHARDIYA/intromat-fhir. If you are familiar with GitHub, you can clone the repo in your preferred location.

  2. From your favourite command line, navigate to the root folder. If you downloaded the folder inside "download" then navigate to root folder as, cd /downloads/intromat-fhir.

  3. Open entire project in your favourite editor such as ATOM, Sublime, VSCODE. Trust me, there is no preferences.

  4. Now, the first thing is to create .env file. Create a file named .env and provide following variables. You need to get yourMONGODB_URL. NODE_ENV=development MONGODB_URI=YOUR_MONGODB_URL.Assuming you have MONGODB installed on your computer, you will get YOUR_MONGODB_URL once you run the mongo database. For details about URI check here.

  5. Once you get step 4 correctly. From the root directly install the dependencies. You can do this by npm install or yarnon which you installed.

  6. In order to test resource server alone, you need to disconnect it from authentication server. To do so, simply navigate to src/config.js and comment Auth configuration. The block should look like: // Auth configurations auth: { // name: 'bearer', <-- COMMNTED LINE strategy: smartBearerStrategy({ clientId: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, introspectionUrl: process.env.INTROSPECTION_URL, }), passportOptions: { session: false, }, },

  7. Similarly, navigate to src/environment.js and change process.env.SOF_AUTHENTICATION=false. The line should say as follows: if (process.env.NODE_ENV === 'production') { process.env.SOF_AUTHENTICATION = false; process.env.HAS_GRAPHIQL = false; }

  8. Finally, from your command line run yarn start. It should start your resource server. Look for following message as shown in the screenshot below:

Testing Resource server

To test resource server without authentication server, follow these steps:

  1. Use HTTP client like Postman https://www.getpostman.com/. Download and install.

  2. Example CRUDs can be found on the GitHub wiki: https://github.com/sureshHARDIYA/intromat-fhir/wiki

  3. Make a new request in postman

  4. Make it a GET or POST depending on what operation you are doing (create update and delete being posts and get(single) and get(list) being.)

  5. There is only one endpoint when working with GraphQL, in the request URL put: 127.0.0.1:3000/4_0_0/$graphql

  6. Go to Body and select GraphQL

  7. Paste one of the example queries into the TEXT box and hit Send

8. If you are using GET request, you should see the output on POST man. If you are using POST you should see appropriate output saying INSERT/Update is successful. Check if CUD (Create/Update/Delete) was successful or not by installing database client such as MongoDB Compass: https://www.mongodb.com/products/compass.

Last updated