"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "mergePatientHandler", {
    enumerable: true,
    get: function() {
        return mergePatientHandler;
    }
});
const _expressasynchandler = /*#__PURE__*/ _interop_require_default(require("express-async-handler"));
const _mergePatient = require("./mergePatient");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const mergePatientHandler = (0, _expressasynchandler.default)(async (req, res)=>{
    req.checkPermission('write', 'Patient');
    const { body, store } = req;
    const { keepPatientId, unwantedPatientId } = body;
    const result = await (0, _mergePatient.mergePatient)(store.models, keepPatientId, unwantedPatientId);
    res.send(result);
});

//# sourceMappingURL=index.js.map