Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kickoff import #47

Merged
merged 4 commits into from
Jul 2, 2024
Merged

Kickoff import #47

merged 4 commits into from
Jul 2, 2024

Conversation

lmd59
Copy link
Contributor

@lmd59 lmd59 commented Jun 28, 2024

Summary

Creates a new endpoint on the bulk-export-server to kickoff $import against a specified endpoint on an import server

New behavior

Server now supports endpoint: POST [fhir base]/bulkstatus/[client id]/kickoff-import

Code changes

  • Update README to describe new endpoint
  • Update package.json to make axios play nice with jest
  • Add new endpoint to app.js and bulkstatus.service.js, including pulling data from the existing bulk status to create the import manifest, appropriate error handling, and appropriate pass-through of headers
  • Pull gatherParams out of export.service.js into its own shared serviceUtils

Testing guidance

  • npm run check
  • Start bulk-export-server on port 3001 (and change to port 3001 for both environment variables)
  • Start deqm-test-server (on default port 3000, make sure you have the latest with the new $import workflow)
  • The Insomnia collection below has a basic set of requests that go through the workflow as follows:
    • Do an $export request on bulk-export-server
    • Check the status of that request at the bulk-export-server bulkstatus endpoint (from the $export response content-location header)
    • Add /kickoff-import to the end of the bulkstatus request and use that endpoint to do a POST with a receiver parameter in the body. Example:
      { "resourceType": "Parameters", "parameter": [ { "name": "receiver", "valueString": "http://localhost:3000/4_0_1/$import" } ] }
    • Check the status of the $import request using the deqm-test-server bulkstatus endpoint (from the kickoff-import response content location header)
    • Repeat this workflow for other export options and for error options to make sure the kickoff-import responses makes sense

kickoff-import-insomnia.json

Copy link

github-actions bot commented Jun 28, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.58% (-4% 🔻)
503/693
🟡 Branches
60% (-2.58% 🔻)
180/300
🟡 Functions
71.3% (-4.14% 🔻)
77/108
🟡 Lines
72.83% (-4.07% 🔻)
496/681
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / serviceUtils.js
94.44% 80% 100% 94.44%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / export.service.js
85% (-0.9% 🔻)
79.27% (-0.17% 🔻)
93.75% (-0.69% 🔻)
84.67% (-0.95% 🔻)
🟢
... / mongo.controller.js
91.07% (-3.57% 🔻)
85.71%
78.57% (-7.14% 🔻)
91.07% (-3.57% 🔻)
🟡
... / bulkstatus.service.js
63.64% (-33.92% 🔻)
63.33% (-23.03% 🔻)
66.67% (-33.33% 🔻)
63.64% (-33.92% 🔻)
🟢
... / group.service.js
95.65% (-0.9% 🔻)
83.33% (-4.17% 🔻)
100%
95.65% (-0.9% 🔻)
🔴
... / bundleUtils.js
12.5% (-6.73% 🔻)
0%
0% (-28.57% 🔻)
13.04% (-6.96% 🔻)

Test suite run success

78 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from 614dbe8

Copy link
Collaborator

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment! I think we can wait to think about unit testing for this when we do the unit testing task for the bulk-export-server.

README.md Outdated
@@ -144,6 +144,16 @@ Alternatively, a POST request (`POST [fhir base]/$export`) can be sent. The expo

For more information on the export endpoints, read this documentation on the [Export Request Flow](https://hl7.org/fhir/uv/bulkdata/export/index.html#request-flow).

#### Bulk Status

This server supports the bulk status endpoint in support of the [Export Request Flow](https://hl7.org/fhir/uv/bulkdata/export/index.html#request-flow).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link does not appear to be working for me

Copy link
Collaborator

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@elsaperelli elsaperelli merged commit dd47085 into main Jul 2, 2024
4 checks passed
@elsaperelli elsaperelli deleted the kickoff-import branch July 2, 2024 19:55
@lmd59 lmd59 mentioned this pull request Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants