Interoperability layer
How to get started with interoperability?
Last updated
Was this helpful?
How to get started with interoperability?
Last updated
Was this helpful?
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:
NODEJS: Install latest version of Verify you have node JS installed by running node --version
in your terminal (Mac) or Command Line (Windows). We have tested resource server
using NODE version 10.24.0.
MONGODB: Install mongoDB on your system. . Instructions .
NPM or YARN: You can choose either NPM or YARN. During development, we chose yarn.
NPM: . For window followt.
YARN:
Follow the steps below:
Download zip of the latest release of the INTROMAT FHIR project here:. If you are familiar with GitHub, you can clone the repo in your preferred location.
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
.
Open entire project in your favourite editor such as ATOM, Sublime, VSCODE. Trust me, there is no preferences.
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 .
Once you get step 4 correctly. From the root directly install the dependencies. You can do this by npm install
or yarn
on which you installed.
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,
},
},
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;
}
Finally, from your command line run yarn start
. It should start your resource server
. Look for following message as shown in the screenshot below:
To test resource server without authentication server, follow these steps:
Make a new request in postman
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.)
Go to Body and select GraphQL
Paste one of the example queries into the TEXT box and hit Send
Use HTTP client like Postman . Download and install.
Example CRUDs can be found on the GitHub wiki:
There is only one endpoint when working with GraphQL, in the request URL put:
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: