Skip to main content

eCW Adapter

Need help? Contact us:

The ECW adapter is designed to provide a template for getting started with FHIR eCW integrations. It leverages the ECW Library to:

  1. Authenticate with the eCW server via OAuth2.0 (JWT)

  2. Perform various interactions against the eCW server including create, read and search.

This component can be customized and adapter according to your workflow needs.

How to use it:

STEP 1: Login or sign up for the eCW development platform to access the Sandbox and create an app called "Iguana"

Refer to Set up your ECW Sandbox for the sign up process, creating an app and gathering the authentication details needed for the eCW Adapter.

STEP 2: Import the eCW Adapter component in IguanaX

See Create a Component if this is your first time!

STEP 3: Configure the ClientId, PrivateKey and KID custom fields and click Edit to open the Translator

Ender the ClientId, PrivateKey certificate path, and Kid from your JWKS key.

Using the information provided, the component will run through the authentication workflow and store the returned access token and expiry time in an encrypted file for use on subsequent API requests.

STEP 4: View and modify the examples for creating and searching for a patient on the eCW Server

Use the provided SamplePatient.json to load a FHIR patient resource. Alternatively, you can explore the FHIR Profiling Tool to generate a template resource you can use to populate with data of your own.

 -- Load a sample patient   
local F = io.open(iguana.projectRoot()..'SamplePatient.json','rb')
local RawPatient = F:read("*a")
F:close()
local NewPatient = json.parse{data=RawPatient}

Set live=true to invoke the creation interaction.

-- Create the new patient. Set live = true to run from within the Translator   
E:create{resource = 'Patient',parameters=NewPatient,live=true}

-- Retrieve available parameters
local SearchTable = E:parameters(E.capabilities.Patient.name)
-- Set parameter values
SearchTable.family = 'Lufhir'
SearchTable.given = 'Sakiko'
SearchTable.birthdate = '1994-07-22'
-- Search for a patient
local Status, R = E:search{resource="Patient",parameters=SearchTable,live=true}

Note: the eCW provided sandbox may not have create patient permissions. The following read and search below can be used for eCW provided patient data:

-- Read data from a specific patient   
local Status, R = E:readResource{
resource = "Patient",
id = "Lt2IFR5Ah76n4d8TFP5gBFKDGSQZQMMCduhAZRmKPQY",
live = true
}

-- Retrieve available parameters
local SearchTable = E:parameters(E.capabilities.Patient.name)
-- Set parameter values
SearchTable.family = 'Reese'
SearchTable.given = 'John'
SearchTable.birthdate = '1980-01-01'
SearchTable.gender = 'male'
-- Search for a patient
local Status, R = E:search{resource="Patient",parameters=SearchTable,live=true}