Skip to content

Commit

Permalink
added sucesscounts for every ndjson file to ALL OK response
Browse files Browse the repository at this point in the history
  • Loading branch information
hossenlopp committed Aug 30, 2024
1 parent ce12e5d commit b15ec18
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/services/bulkstatus.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,35 @@ async function checkBulkStatus(req, res) {
}
]
});
// create success counts for every file
for (const parameter of bulkStatus.importManifest.parameter) {
if (parameter.name === 'input') {
const url = parameter.part.find(p => p.name === 'url');

Check warning on line 184 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 184 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 184 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
const ndjsonStatus = await getNdjsonFileStatus(clientId, url.valueUrl);

Check warning on line 185 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
if (ndjsonStatus?.successCount) {
const successCountResult = {
name: 'outcome',
part: [
{ name: 'associatedInputUrl', valueUrl: url.valueUrl },
{
name: 'operationOutcome',
resource: {
resourceType: 'OperationOutcome',
issue: [
{
severity: 'information',
code: 'informational',
details: { text: `Successfully processed ${ndjsonStatus.successCount} rows.` }
}
]
}
}
]
};

Check warning on line 205 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
response.entry[0].resource.parameter.push(successCountResult);

Check warning on line 206 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 207 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 207 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 208 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}
}

return response;
Expand Down

0 comments on commit b15ec18

Please sign in to comment.