Skip to content

sravanthi-12/ecr-fhir-receiver-lambda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ecr-fhir-receiver-lambda

ECR FHIR receiver Lambda function

Prerequisites:

  1. Java 8 or Higher
  2. AWS SDK - STS or Eclipse
  3. AWS Account
  4. Maven 3.3.x
  5. GIT

Clone the Repository

Clone the repository using the below command in command prompt

git clone https://github.com/drajer-health/ecr-fhir-receiver-lambda.git

Create Build:

Import Project as Maven Project Build ECR FHIR Receiver AWS Lambda Service:

Navigate to ecr-fhir-receiver-lambda directory ..../ and run Maven build to build lambda jar file.

$ mvn clean install

This will generate a war file under target/ecr-fhir-receiver-lambda.jar.

Deploy eCR FHIR Receiver Lambda:

Login to your AWS Account

  1. Click on Services then select Lambda

  2. Click on Create Function

  3. Select "Author from Scratch" option

  4. Enter:

Function Name: ecrFHIRReceiverLambda
Runtime: Java 8 on Amazon Linux 1 or any other Java runtimes
Permissions: Create a new role with basic Lambda permissions or select your organization specific security

  1. Click on "Create Function"

At this point Lambda function would be created, navigate to the newly created function and configure the lambda function and environment variable.

  1. Under the "Code" tab select "Upload from"

  2. Select .zip or .jar file option

  3. Click upload and navigate to your local workspace target folder and select ecr-fhir-receiver-lambda.jar and click "Save"

  4. Click on "Edit" on "Runtime Settings"

  5. Enter below value for Handler

com.drajer.ecr.receiver.lambda.ECRFHIRReceiverLambdaFunctionHandler

  1. Click "Save"

  2. Click on "Configuration" tab and then "Environment Variables"

  3. Click on "Edit" to add new environment variable

  4. Click on "Add new environment variable"

  5. Enter

Key: HTTP_POST_URL
Value: <<THIS SHOULD BE YOUR FHIR SERVER URL FOR THE REQUEST TO BE FORWARDED>>

Optional Test the Lambda Function

  1. Click on "Test" tab

  2. Use the test/resource/ecrFHIRReceiverTestData.json data to test newly created Lambda Function

At this point Lambda function is configured and ready to use, next step is to configure API Gateway

Configuring API Gateway

  1. Click on Services and search for "API Gateway"

  2. Click on "Create New"

  3. Click on "Build" on Rest API option

  4. Enter

Choose Protocol: REST
Create New API: New API
Settings:
	API Name: $process-message
	Description: eCR FHIR Receiver Lambda function to forward ecr data to FHIR service
	EndPoint Type: Regional or based on your organizational needs

  1. Click Create API

  2. Click on "Actions -> Create Resource"

  3. Enter

Resource Name*: $process-message
Resource Path*: $process-message

  1. Click "Create Resource"

  2. Select $process-message and then click "Actions -> Create Method"

  3. Select "ANY" and click on tick mark

  4. Enter

	Integration Type: Lambda Function
	Use Lambda Proxy Integration: Checked 
	Lambda Function: ecrFHIRReceiverLambda

  1. Click "Save"

  2. Click "Ok" to add permissions for lambda and API gateway

  3. Click "Actions -> Deploy API"

  4. Select "Deployment Stage"

  5. Enter

	Stage Name*: dev
	Stage Description: Development Environment
	Deployment Description: Development Environment

  1. Click "Deploy"

  2. API Gateway is configured !!!!

NOTE: Make a note of API Gateway end point and use ECRFHIRReceiverLambdaHttpClient.java to run the test

About

ECR FHIR receiver Lambda function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%