@ai-ecom/medusa-plugin-patient-record
Version:
A plugin for patient record
160 lines (159 loc) • 9.7 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExaminationResultType = exports.ExaminationResultStatus = exports.ExaminationResult = void 0;
var _initializerDefineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/initializerDefineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));
var _initializerWarningHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/initializerWarningHelper"));
var _typeorm = require("typeorm");
var _medusa = require("@medusajs/medusa");
var _medusaPluginService = require("@ai-ecom/medusa-plugin-service");
var _utils = require("@medusajs/utils");
var _examinationResultTitle = require("./examination-result-title");
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _dec26, _dec27, _dec28, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
var ExaminationResultStatus = exports.ExaminationResultStatus = /*#__PURE__*/function (ExaminationResultStatus) {
ExaminationResultStatus["PENDING"] = "pending";
ExaminationResultStatus["IN_PROGRESS"] = "in_progress";
ExaminationResultStatus["COMPLETED"] = "completed";
ExaminationResultStatus["CANCELLED"] = "cancelled";
ExaminationResultStatus["FAILED"] = "failed";
ExaminationResultStatus["PASSED"] = "passed";
ExaminationResultStatus["NOT_STARTED"] = "not_started";
return ExaminationResultStatus;
}({});
var ExaminationResultType = exports.ExaminationResultType = /*#__PURE__*/function (ExaminationResultType) {
ExaminationResultType["BLOOD_ANALYTE"] = "blood_analyte";
ExaminationResultType["MEDIA_RESULT"] = "media_result";
ExaminationResultType["PHYSICAL_MEASUREMENT"] = "physical_measurement";
return ExaminationResultType;
}({});
var ExaminationResult = exports.ExaminationResult = (_dec = (0, _typeorm.Entity)(), _dec2 = (0, _typeorm.Column)({
type: "date"
}), _dec3 = Reflect.metadata("design:type", typeof Date === "undefined" ? Object : Date), _dec4 = (0, _typeorm.Column)({
type: "varchar"
}), _dec5 = Reflect.metadata("design:type", String), _dec6 = (0, _typeorm.Column)({
type: "varchar"
}), _dec7 = Reflect.metadata("design:type", String), _dec8 = (0, _typeorm.Column)({
type: "varchar",
nullable: false
}), _dec9 = Reflect.metadata("design:type", String), _dec10 = (0, _typeorm.ManyToOne)(function () {
return _medusaPluginService.Customer;
}), _dec11 = (0, _typeorm.JoinColumn)({
name: "customer_id"
}), _dec12 = Reflect.metadata("design:type", typeof _medusaPluginService.Customer === "undefined" ? Object : _medusaPluginService.Customer), _dec13 = (0, _typeorm.Column)({
type: "enum",
"enum": ExaminationResultStatus,
nullable: false
}), _dec14 = Reflect.metadata("design:type", typeof ExaminationResultStatus === "undefined" ? Object : ExaminationResultStatus), _dec15 = (0, _typeorm.Column)({
type: "enum",
"enum": ExaminationResultType,
nullable: false
}), _dec16 = Reflect.metadata("design:type", typeof ExaminationResultType === "undefined" ? Object : ExaminationResultType), _dec17 = (0, _typeorm.Column)({
type: "varchar",
nullable: true
}), _dec18 = Reflect.metadata("design:type", String), _dec19 = (0, _typeorm.ManyToOne)(function () {
return _examinationResultTitle.ExaminationResultTitle;
}, function (examination_result_title) {
return examination_result_title.examination_results;
}), _dec20 = (0, _typeorm.JoinColumn)({
name: "examination_result_title_id"
}), _dec21 = Reflect.metadata("design:type", typeof _examinationResultTitle.ExaminationResultTitle === "undefined" ? Object : _examinationResultTitle.ExaminationResultTitle), _dec22 = (0, _typeorm.Column)({
type: "timestamp with time zone",
nullable: true
}), _dec23 = Reflect.metadata("design:type", typeof Date === "undefined" ? Object : Date), _dec24 = (0, _typeorm.Column)({
type: "timestamp with time zone",
nullable: true
}), _dec25 = Reflect.metadata("design:type", typeof Date === "undefined" ? Object : Date), _dec26 = (0, _typeorm.BeforeInsert)(), _dec27 = Reflect.metadata("design:type", Function), _dec28 = Reflect.metadata("design:paramtypes", []), _dec(_class = (_class2 = /*#__PURE__*/function (_SoftDeletableEntity) {
function ExaminationResult() {
var _this;
(0, _classCallCheck2["default"])(this, ExaminationResult);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _callSuper(this, ExaminationResult, [].concat(args));
(0, _initializerDefineProperty2["default"])(_this, "date", _descriptor, _this);
(0, _initializerDefineProperty2["default"])(_this, "reference_id", _descriptor2, _this);
(0, _initializerDefineProperty2["default"])(_this, "appointment_id", _descriptor3, _this);
(0, _initializerDefineProperty2["default"])(_this, "customer_id", _descriptor4, _this);
(0, _initializerDefineProperty2["default"])(_this, "customer", _descriptor5, _this);
(0, _initializerDefineProperty2["default"])(_this, "status", _descriptor6, _this);
(0, _initializerDefineProperty2["default"])(_this, "type", _descriptor7, _this);
(0, _initializerDefineProperty2["default"])(_this, "examination_result_title_id", _descriptor8, _this);
(0, _initializerDefineProperty2["default"])(_this, "title", _descriptor9, _this);
(0, _initializerDefineProperty2["default"])(_this, "order_entry_date", _descriptor10, _this);
(0, _initializerDefineProperty2["default"])(_this, "lab_result_datetime", _descriptor11, _this);
return _this;
}
(0, _inherits2["default"])(ExaminationResult, _SoftDeletableEntity);
return (0, _createClass2["default"])(ExaminationResult, [{
key: "beforeInsert",
value: function beforeInsert() {
this.id = (0, _utils.generateEntityId)(this.id, "examination_result");
}
}]);
}(_medusa.SoftDeletableEntity), (_descriptor = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "date", [_dec2, _dec3], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor2 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "reference_id", [_dec4, _dec5], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor3 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "appointment_id", [_dec6, _dec7], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor4 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "customer_id", [_dec8, _dec9], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor5 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "customer", [_dec10, _dec11, _dec12], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor6 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "status", [_dec13, _dec14], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor7 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "type", [_dec15, _dec16], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor8 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "examination_result_title_id", [_dec17, _dec18], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor9 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "title", [_dec19, _dec20, _dec21], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor10 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "order_entry_date", [_dec22, _dec23], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), _descriptor11 = (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "lab_result_datetime", [_dec24, _dec25], {
configurable: true,
enumerable: true,
writable: true,
initializer: null
}), (0, _applyDecoratedDescriptor2["default"])(_class2.prototype, "beforeInsert", [_dec26, _dec27, _dec28], Object.getOwnPropertyDescriptor(_class2.prototype, "beforeInsert"), _class2.prototype)), _class2)) || _class);