1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 'use strict';
- module.exports = app => {
- const mongoose = app.mongoose;
- const Schema = mongoose.Schema;
- const VisitSchema = new Schema({
- userid: {
- type: Schema.Types.ObjectId,
- ref: 'sysUser',
- },
- // userName: { type: String }, // 探访员
- dept1: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept2: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept3: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept4: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- dept5: {
- type: Schema.Types.ObjectId,
- ref: 'sysDept',
- },
- fid: { type: Schema.Types.ObjectId }, // 戶Id
- infoId: { type: Schema.Types.ObjectId }, // 老人Id
- oldIdNumber: { type: String }, // 老人身份证
- visitMessage: { type: String }, // 探访信息visitMessage
- visitLocation: { type: String }, // 探访位置(暂用一个字段) visitLocation
- visitPhoto: { type: String }, // 探访照片
- visitTime: { type: Date, default: Date.now }, // 探访时间
- oldInfo: { type: String }, // 老人信息
- lat: { type: String }, // 纬度
- lng: { type: String }, // 经度
- health: { type: String }, // 健康
- mind: { type: String }, // 精神
- security: { type: String }, // 安全
- hygiene: { type: String }, // 卫生
- live: { type: String }, // 居住
- demand: { type: String }, // 需求 ( 探访信息)
- infoOldType: { type: Array }, // 老年人类别
- infoOldAbility: { type: String }, // 老年人能力状况
- infoDemand: { type: Array }, // 关爱服务需求
- urgency: { type: String }, // 紧急程度
- });
- VisitSchema.index({ dept1: -1 }, { background: true, name: 'visit_dept1_-1' });
- return mongoose.model('Visit', VisitSchema, 'visit');
- };
|