Skip to content

Commit

Permalink
fix: incorrect countDocuments collection in history
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Oct 23, 2021
1 parent 789b435 commit 8a7cb9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/FHIRApiService/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = async function(req, res, resourceType) {
let operationOutcomeNotFound = handleError['not-found'](`id->"${id}" in resource "${resourceType}" not found`);
return doRes(404, operationOutcomeNotFound);
}
let count = await mongodb.Patient_history.countDocuments({
let count = await mongodb[`${resourceType}_history`].countDocuments({
id: id
});
let bundle = createBundle(req, docs, count, paginationSkip, paginationLimit, resourceType, {
Expand Down

0 comments on commit 8a7cb9b

Please sign in to comment.