tmp
This commit is contained in:
@@ -105,6 +105,10 @@ class HandlerEscortRecord {
|
|||||||
if (!record.userId) {
|
if (!record.userId) {
|
||||||
return ResponseUtil.badRequest(ctx, "缺少患者信息");
|
return ResponseUtil.badRequest(ctx, "缺少患者信息");
|
||||||
}
|
}
|
||||||
|
// 订单必须关联就诊人:patient 是下单当刻的快照,healthProfileId 才是关联
|
||||||
|
if (!record.healthProfileId) {
|
||||||
|
return ResponseUtil.badRequest(ctx, "缺少就诊人档案ID");
|
||||||
|
}
|
||||||
|
|
||||||
const newRecord = await DBModel.EscortRecord.createRecord(HandlerEscortRecord.pickFields(record));
|
const newRecord = await DBModel.EscortRecord.createRecord(HandlerEscortRecord.pickFields(record));
|
||||||
return ResponseUtil.success(ctx, { record: newRecord }, "创建成功");
|
return ResponseUtil.success(ctx, { record: newRecord }, "创建成功");
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import mongoose from "mongoose";
|
|||||||
*
|
*
|
||||||
* 用于记录和管理陪诊服务全流程数据,包含以下主要分类:
|
* 用于记录和管理陪诊服务全流程数据,包含以下主要分类:
|
||||||
* - 基础信息:userId(订单提交用户)、healthProfileId(关联健康档案ID)
|
* - 基础信息:userId(订单提交用户)、healthProfileId(关联健康档案ID)
|
||||||
* - 患者信息:patient(姓名、电话、性别、出生年月、身份证号)
|
* - 患者信息:patient(名单字段快照:姓名、电话、性别、出生年月)
|
||||||
* - 陪诊服务:escort(服务ID、服务名称)
|
* - 陪诊服务:escort(服务ID、服务名称)
|
||||||
* - 就诊信息:hospital(医院省份、名称、地址、科室、医生、病历号)
|
* - 就诊信息:hospital(医院省份、名称、地址、科室、医生、病历号)
|
||||||
* - 时间安排:schedule(预约时间、开始时间、结束时间、时长)
|
* - 时间安排:schedule(预约时间、开始时间、结束时间、时长)
|
||||||
@@ -32,7 +32,7 @@ const EscortRecordSchema = mongoose.Schema(
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联健康档案ID(可为空)
|
* 关联健康档案ID(下单必填:订单必须关联就诊人)
|
||||||
* @type {ObjectId}
|
* @type {ObjectId}
|
||||||
* @ref health_profile
|
* @ref health_profile
|
||||||
*/
|
*/
|
||||||
@@ -44,16 +44,16 @@ const EscortRecordSchema = mongoose.Schema(
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 患者信息 - 就诊患者的基本信息
|
* 患者信息 - 下单当刻从健康档案拷贝的「名单字段」快照(仅姓名/电话/性别/出生年月)。
|
||||||
|
* 档案可随时编辑或删除,历史订单至少需要认出"是谁、怎么联系",故名单快照与 healthProfileId 并存:
|
||||||
|
* 展示时以档案最新数据为准,档案缺失时回落到这份快照。
|
||||||
|
* 体征(身高/体重)与证件号不进快照——它们只有详情页兜底在用,详情页本来就实时拉档案
|
||||||
*/
|
*/
|
||||||
patient: {
|
patient: {
|
||||||
name: { type: String, default: "", comment: "患者姓名" },
|
name: { type: String, default: "", comment: "患者姓名" },
|
||||||
mobile: { type: String, default: "", index: true, comment: "患者联系电话" },
|
mobile: { type: String, default: "", index: true, comment: "患者联系电话" },
|
||||||
sex: { type: String, enum: ["male", "female"], comment: "患者性别" },
|
sex: { type: String, enum: ["male", "female"], comment: "患者性别" },
|
||||||
birth: { type: String, default: "", comment: "患者出生年月(YYYY-MM-DD)" },
|
birth: { type: String, default: "", comment: "患者出生年月(YYYY-MM-DD)" },
|
||||||
weight: { type: Number, default: 0, comment: "患者体重(kg)" },
|
|
||||||
height: { type: Number, default: 0, comment: "患者身高(cm)" },
|
|
||||||
idnumber: { type: String, default: "", comment: "患者身份证号" },
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user