Exams.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * @Author: fuyu
  3. * @Date: 2021-03-22 19:10:00
  4. * @LastEditors: fuyu
  5. * @LastEditTime: 2021-03-25 13:05:31
  6. * @FilePath: /202103/code/sql_merge/src/dao_old/Exams.js
  7. */
  8. const Sequelize = require('sequelize');
  9. import sequelize from './db/sequelize';
  10. /**
  11. * 患者信息
  12. */
  13. // primaryKey: true
  14. // defaultValue: null
  15. const Exams = sequelize.define('exams', {
  16. id: {type: Sequelize.STRING(255), allowNull: false, primaryKey: true}, // id,
  17. institution_id: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // institution_id, 医院id
  18. name: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // name, 患者姓名
  19. phone: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // phone, 患者手机号
  20. card_num: {type: Sequelize.STRING(50), allowNull: true, defaultValue: null}, // card_num, 患者身份证
  21. patient_num: {type: Sequelize.STRING(100), allowNull: true, defaultValue: null}, // patient_num, 病历号
  22. patient_id: {type: Sequelize.STRING(32), allowNull: true, defaultValue: null}, // patient_id, 患者key
  23. accession_num: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // accession_num, 检查号
  24. hopitalized_no: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // hopitalized_no, 住院号
  25. bed_no: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // bed_no, 病床号
  26. studyid: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // studyid, 检查id
  27. studyuid: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // studyuid, studyuid
  28. study_id: {type: Sequelize.STRING(100), allowNull: true, defaultValue: null}, // study_id, 检查key
  29. exam_class: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // exam_class, 检查类别
  30. exam_project: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // exam_project, 检查项目
  31. exam_datetime: {type: Sequelize.STRING(100), allowNull: true, defaultValue: null}, // exam_datetime, 检查时间
  32. exam_status: {type: Sequelize.INTEGER(10), allowNull: true, defaultValue: 1}, // exam_status, 检查状态\r\n1 登记\r\n2 登记完成\r\n3 影像到达\r\n7 写报告\r\n8 审核报告\r\n9 确认报告
  33. report_result: {type: Sequelize.STRING(10), allowNull: true, defaultValue: null}, // report_result, 检查结果 1阴性 2阳性
  34. report_status: {type: Sequelize.STRING(50), allowNull: true, defaultValue: null}, // report_status, 远程诊断状态\r\n2 保存完善病例资料\r\n3 完善病例资料保存继续\r\n4 选择医院发起申请\r\n5 驳回申请\r\n6 接收申请\r\n7 写报告\r\n8 审核报告\r\n9 最终完成报告\r\n11 撤回报告\r\n10 确认报告
  35. pay_status: {type: Sequelize.STRING(10), allowNull: true, defaultValue: '0'}, // pay_status, 支付状态 0未支付 1已支付
  36. status: {type: Sequelize.STRING(255), allowNull: true, defaultValue: '1'}, // status, 删除状态 0 禁用 1 正常
  37. urgent: {type: Sequelize.STRING(255), allowNull: true, defaultValue: '0'}, // urgent, 是否急诊 0 否 1是
  38. severe: {type: Sequelize.STRING(255), allowNull: true, defaultValue: '0'}, // severe, 重症标识 0 否 1 是
  39. film_type: {type: Sequelize.STRING(255), allowNull: true, defaultValue: '2'}, // film_type, 胶片属性:0 未定义 1传统胶片 2电子胶片
  40. clin_symp: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // clin_symp, 症状
  41. del_datetime: {type: Sequelize.DATE, allowNull: true, defaultValue: null}, // del_datetime, 删除时间
  42. del_doctor_id: {type: Sequelize.STRING(50), allowNull: true, defaultValue: null}, // del_doctor_id, 删除医师ID
  43. del_doctor_name: {type: Sequelize.STRING(100), allowNull: true, defaultValue: null}, // del_doctor_name, 删除医师姓名
  44. patient_area: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // patient_area, 病区
  45. sex: {type: Sequelize.STRING(32), allowNull: true, defaultValue: null}, // sex, 患者性别
  46. age: {type: Sequelize.STRING(32), allowNull: true, defaultValue: null}, // age, 患者年龄
  47. birthday: {type: Sequelize.STRING(32), allowNull: true, defaultValue: null}, // birthday, 患者生日
  48. exam_sub_class: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // exam_sub_class, 检查子类
  49. body_part: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // body_part, 检查部位
  50. device_name: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // device_name, 设备名称
  51. application_department: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // application_department, 申请科室
  52. application_doctor: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // application_doctor, 申请医生
  53. clin_diag: {type: Sequelize.STRING(1000), allowNull: true, defaultValue: null}, // clin_diag, 临床诊断
  54. out_patient: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // out_patient, 门诊号
  55. ext: {type: Sequelize.JSON, allowNull: true, defaultValue: null}, // ext,
  56. delivery_doctor: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // delivery_doctor, 送诊医生
  57. push_api: {type: Sequelize.STRING(255), allowNull: true, defaultValue: null}, // push_api, 0 推送失败 1推送成功
  58. api_message: {type: Sequelize.STRING(500), allowNull: true, defaultValue: null}, // api_message 失败返回信息
  59. flag: {type: Sequelize.INTEGER(11), allowNull: false, defaultValue: 0}, // flag 标识
  60. }, {
  61. freezeTableName: true,
  62. charset: 'utf8',
  63. indexes:[
  64. {fields : ['institution_id', 'flag']},
  65. {fields : ['createdAt']}
  66. ],
  67. });
  68. Exams.sync({ force: false }).then(function() {});
  69. export default Exams;