"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.labOrderSigned = void 0;
const lodash_1 = require("lodash");
exports.labOrderSigned = {
    type: 'resource_updated',
    key: 'lab_order.signed',
    action_key: 'createLabOrder',
    description: 'Wait for lab order to be signed',
    resource_id: {
        type: 'extension_data_point',
        key: 'labOrderId',
    },
    evaluate: (input) => {
        const payload = input;
        const { data: labOrder, action } = payload;
        return (action === 'saved' &&
            payload.resource === 'lab_orders' &&
            !(0, lodash_1.isNil)(labOrder.signed_by) &&
            !(0, lodash_1.isNil)(labOrder.signed_date));
    },
    extractResourceId: (input) => {
        const payload = input;
        return payload.data.id;
    },
};
//# sourceMappingURL=labOrderSigned.js.map