awslabs / fhir-works-on-aws-routing

The routing implementation of the FHIR Works on AWS framework. Finding the correct component to handle the HTTP FHIR request
Apache License 2.0
31 stars 26 forks source link

feat: add Batch support #162

Closed ssvegaraju closed 2 years ago

ssvegaraju commented 2 years ago

Issue #, if available:

Description of changes: Added logic to parse requests made to the root URL with a Batch request. Contains logic to validate the bundle according to https://www.hl7.org/fhir/http.html#brules, and adds unit tests for batch. This PR is in draft until the persistence changes are released and updated on the interface package.

We use a limit of 750 requests per bundle for the following reason: Lambda has a payload limit of 6MB. Taking an average request size of 4KB, this gives us that 6MB/4KB = 1500 requests. To give some leeway, we divide by half to get 750.

TESTING: tested through deployment and querying for various different bundle configurations such as:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov-commenter commented 2 years ago

Codecov Report

Merging #162 (61c83f2) into mainline (1108326) will increase coverage by 0.17%. The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##           mainline     #162      +/-   ##
============================================
+ Coverage     75.76%   75.93%   +0.17%     
============================================
  Files            47       47              
  Lines          1366     1384      +18     
  Branches        284      296      +12     
============================================
+ Hits           1035     1051      +16     
- Misses          331      333       +2     
Impacted Files Coverage Δ
src/router/bundle/bundleParser.ts 98.37% <80.00%> (-0.53%) :arrow_down:
src/router/bundle/bundleGenerator.ts 94.11% <87.50%> (-1.44%) :arrow_down:
src/router/bundle/bundleHandler.ts 91.66% <100.00%> (+1.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1108326...61c83f2. Read the comment docs.