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
NODEJS: Install latest version of nodeJS. Verify you have node JS installed by running
node --version
in your terminal (Mac) or Command Line (Windows). We have testedresource server
using NODE version 10.24.0.MONGODB: Install mongoDB on your system. Instructions for mac is available here. Instructions for windows is available here.
NPM or YARN: You can choose either NPM or YARN. During development, we chose yarn.
NPM: Follow these instructions for Mac. For window follow these instruction set.
Getting started
Follow the steps below:
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.
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 haveMONGODB
installed on your computer, you will getYOUR_MONGODB_URL
once you run the mongo database. For details about URI check here.Once you get step 4 correctly. From the root directly install the dependencies. You can do this by
npm install
oryarn
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 changeprocess.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 yourresource server
. Look for following message as shown in the screenshot below:
Testing Resource server
To test resource server without authentication server, follow these steps:
Use HTTP client like Postman https://www.getpostman.com/. Download and install.
Example CRUDs can be found on the GitHub wiki: https://github.com/sureshHARDIYA/intromat-fhir/wiki
Make a new request in postman
Make it a
GET
orPOST
depending on what operation you are doing (create update and delete being posts and get(single) and get(list) being.)There is only one endpoint when working with GraphQL, in the request URL put:
127.0.0.1:3000/4_0_0/$graphql
Go to Body and select GraphQL
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