Skip to content

Commit

Permalink
feat: initial version of orchestration HTTP service qe-collaborative-…
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-francis committed Apr 30, 2024
1 parent 055de87 commit 1bd9184
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
# the end point receives data as files and text in POST method
# ------------------------------------------------------------------------
# * requires the `vscode-httpyac` Visual Studio Code extension
# * `adamraichu.zip-viewer` Visual Studio Code extension is desirable for viewing the emitted zip files
# * requires a `.env` file with HOST, PORT, INGRESS_FILE_PATH, EGRESS_FILE_PATH defined
# * the below Deno command will get the HTTP orch server up and running
# * deno run -A ./src/ahc-hrsn-elt/screening/orch-http-service.ts --port 8088 --host 0.0.0.0 --shinny-fhir-url "https://40lafnwsw7.execute-api.us-east-1.amazonaws.com/dev/processingAgent=QE" --session-artifacts-home /HTTP
# * this service has 2 endpoints /orchestrate.zip(emits the response as a zip) & /orchestrate.json(emits the response as a json)

###

@contentType = multipart/form-data; boundary=form-boundary
# @openWith adamraichu.zip-viewer
@hostName = {{$dotenv HOST}}
@port = {{$dotenv PORT}}
@ingressFilePath = {{$dotenv INGRESS_FILE_PATH}}
@egressFilePath = {{$dotenv EGRESS_FILE_PATH}}

POST http://{{hostName}}:{{port}}/orchestrate.zip HTTP/1.1
Content-Type: {{contentType}}
Content-Type: multipart/form-data; boundary=form-boundary
{{
const { equal } = require('assert');
test('status code 200', () => {
Expand Down Expand Up @@ -52,14 +53,13 @@ Content-Type: application/zip

###

@contentType = multipart/form-data; boundary=form-boundary
@hostName = {{$dotenv HOST}}
@port = {{$dotenv PORT}}
@ingressFilePath = {{$dotenv INGRESS_FILE_PATH}}
@egressFilePath = {{$dotenv EGRESS_FILE_PATH}}
@egressFilePath = {{$dotenv EGRESS_FILE_PATH}}

POST http://{{hostName}}:{{port}}/orchestrate.json HTTP/1.1
Content-Type: {{contentType}}
Content-Type: multipart/form-data; boundary=form-boundary
{{
const { equal } = require('assert');
test('status code 200', () => {
Expand All @@ -69,7 +69,7 @@ Content-Type: {{contentType}}
equal(response.contentType.contentType, 'application/json; charset=UTF-8');
});
test('check version', () => {
equal(JSON.parse(response.body).version, '0.16.2');
equal(JSON.parse(response.body).version, '0.17.1');
});
}}

Expand Down Expand Up @@ -98,14 +98,14 @@ Content-Type: application/zip

###

@contentType = multipart/form-data; boundary=form-boundary
# @openWith adamraichu.zip-viewer
@hostName = {{$dotenv HOST}}
@port = {{$dotenv PORT}}
@ingressFilePath = {{$dotenv INGRESS_FILE_PATH}}
@egressFilePath = {{$dotenv EGRESS_FILE_PATH}}

POST http://{{hostName}}:{{port}}/orchestrate.zip HTTP/1.1
Content-Type: {{contentType}}
Content-Type: multipart/form-data; boundary=form-boundary
{{
const { equal } = require('assert');
test('status code 200', () => {
Expand Down Expand Up @@ -152,14 +152,14 @@ Content-Type: text/csv

###

@contentType = multipart/form-data; boundary=form-boundary
# @openWith adamraichu.zip-viewer
@hostName = {{$dotenv HOST}}
@port = {{$dotenv PORT}}
@ingressFilePath = {{$dotenv INGRESS_FILE_PATH}}
@egressFilePath = {{$dotenv EGRESS_FILE_PATH}}

POST http://{{hostName}}:{{port}}/orchestrate.zip HTTP/1.1
Content-Type: {{contentType}}
Content-Type: multipart/form-data; boundary=form-boundary
{{
const { equal } = require('assert');
test('status code 200', () => {
Expand Down Expand Up @@ -193,3 +193,63 @@ Content-Type: text/csv
--form-boundary--

>>! {{egressFilePath}}egress-tx.zip


###

# @openWith adamraichu.zip-viewer
@hostName = {{$dotenv HOST}}
@port = {{$dotenv PORT}}
@ingressFilePath = {{$dotenv INGRESS_FILE_PATH}}
@egressFilePath = {{$dotenv EGRESS_FILE_PATH}}

POST http://{{hostName}}:{{port}}/orchestrate.zip HTTP/1.1
Content-Type: multipart/form-data; boundary=form-boundary
{{
const { equal } = require('assert');
test('status code 200', () => {
equal(response.statusCode, 200);
});
test.hasResponseBody();
test('Check content-type', () => {
equal(response.contentType.contentType, 'application/zip');
});
}}


--form-boundary
Content-Disposition: form-data; name="qe";

healthelink
--form-boundary
Content-Disposition: form-data; name="submit-shin-ny";

yes
--form-boundary
Content-Disposition: form-data; name="file"; filename="INGRESS_CSV_1.zip"
Content-Type: application/zip

< {{ingressFilePath}}INGRESS_CSV_1.zip
--form-boundary
Content-Disposition: form-data; name="file"; filename="INGRESS_CSV_2.zip"
Content-Type: application/zip

< {{ingressFilePath}}INGRESS_CSV_2.zip
--form-boundary
Content-Disposition: form-data; name="file"; filename="INGRESS_CSV_3.zip"
Content-Type: application/zip

< {{ingressFilePath}}INGRESS_CSV_3.zip
--form-boundary
Content-Disposition: form-data; name="file"; filename="INGRESS_CSV_4.zip"
Content-Type: application/zip

< {{ingressFilePath}}INGRESS_CSV_4.zip
--form-boundary
Content-Disposition: form-data; name="file"; filename="INGRESS_CSV_5.zip"
Content-Type: application/zip

< {{ingressFilePath}}INGRESS_CSV_5.zip
--form-boundary--

>>! {{egressFilePath}}egress-tx.zip
Loading

0 comments on commit 1bd9184

Please sign in to comment.