|
@ -127,7 +127,7 @@ class Search extends BaseModel{
|
|
modelUtil.emitData(self.eventEmitter, data);
|
|
modelUtil.emitData(self.eventEmitter, data);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
if(type==2){
|
|
|
|
|
|
if(type==3){
|
|
searchRepo.searchPatientPM(userId, keyword, function (err, chats) {
|
|
searchRepo.searchPatientPM(userId, keyword, function (err, chats) {
|
|
if (err) {
|
|
if (err) {
|
|
log.error("Search patient on private messages failed: ", err);
|
|
log.error("Search patient on private messages failed: ", err);
|
|
@ -152,7 +152,7 @@ class Search extends BaseModel{
|
|
modelUtil.emitData(self.eventEmitter, data);
|
|
modelUtil.emitData(self.eventEmitter, data);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
if(type==3){
|
|
|
|
|
|
if(type==2){
|
|
searchRepo.searchGroupPatients(userId, keyword, function (err, groups) {
|
|
searchRepo.searchGroupPatients(userId, keyword, function (err, groups) {
|
|
if (err) {
|
|
if (err) {
|
|
modelUtil.emitDbError(self.eventEmitter, "Search talk group failed", err);
|
|
modelUtil.emitDbError(self.eventEmitter, "Search talk group failed", err);
|
|
@ -186,7 +186,7 @@ class Search extends BaseModel{
|
|
searchRepo.searchPatientPMList(userId, keyword,groupId,type, function (err, chats) {
|
|
searchRepo.searchPatientPMList(userId, keyword,groupId,type, function (err, chats) {
|
|
var data = [];
|
|
var data = [];
|
|
if (err) {
|
|
if (err) {
|
|
log.error("Search patient on private messages failed: ", err);
|
|
|
|
|
|
log.error("Search searchPatientPMList on private messages failed: ", err);
|
|
res.status(500).send({message: "Search patient on private messages failed."});
|
|
res.status(500).send({message: "Search patient on private messages failed."});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@ -226,7 +226,7 @@ class Search extends BaseModel{
|
|
data.doctors.push({
|
|
data.doctors.push({
|
|
code: doctor.code,
|
|
code: doctor.code,
|
|
name: doctor.name,
|
|
name: doctor.name,
|
|
hospitalName:doctor.name,
|
|
|
|
|
|
hospitalName:doctor.hospital_name,
|
|
sex: doctor.sex,
|
|
sex: doctor.sex,
|
|
avatar: doctor.photo === null ? "" : doctor.photo
|
|
avatar: doctor.photo === null ? "" : doctor.photo
|
|
});
|
|
});
|
|
@ -246,6 +246,7 @@ class Search extends BaseModel{
|
|
code: t.code,
|
|
code: t.code,
|
|
name: t.name,
|
|
name: t.name,
|
|
members: t.con,
|
|
members: t.con,
|
|
|
|
groupType:t.group_type
|
|
};
|
|
};
|
|
data.groups.push(group);
|
|
data.groups.push(group);
|
|
}
|
|
}
|
|
@ -264,7 +265,8 @@ class Search extends BaseModel{
|
|
amount: t.amount,
|
|
amount: t.amount,
|
|
content:t.content,
|
|
content:t.content,
|
|
type:t.type,
|
|
type:t.type,
|
|
msg_id:t.msg_id
|
|
|
|
|
|
msg_id:t.msg_id,
|
|
|
|
groupType:t.group_type
|
|
|
|
|
|
};
|
|
};
|
|
data.content.push(message);
|
|
data.content.push(message);
|
|
@ -309,6 +311,7 @@ class Search extends BaseModel{
|
|
code: t.code,
|
|
code: t.code,
|
|
name: t.name,
|
|
name: t.name,
|
|
members: t.con,
|
|
members: t.con,
|
|
|
|
groupType:t.group_type
|
|
};
|
|
};
|
|
data.push(group);
|
|
data.push(group);
|
|
}
|
|
}
|
|
@ -329,8 +332,8 @@ class Search extends BaseModel{
|
|
amount: t.amount,
|
|
amount: t.amount,
|
|
content:t.content,
|
|
content:t.content,
|
|
type:t.type,
|
|
type:t.type,
|
|
msg_id:t.msg_id
|
|
|
|
|
|
|
|
|
|
msg_id:t.msg_id,
|
|
|
|
groupType:t.group_type
|
|
};
|
|
};
|
|
data.push(message);
|
|
data.push(message);
|
|
}
|
|
}
|
|
@ -360,7 +363,8 @@ class Search extends BaseModel{
|
|
code: doctor.code,
|
|
code: doctor.code,
|
|
name: doctor.name,
|
|
name: doctor.name,
|
|
content:doctor.content,
|
|
content:doctor.content,
|
|
msg_id:t.msg_id
|
|
|
|
|
|
msg_id:t.msg_id,
|
|
|
|
groupType:t.group_type
|
|
});
|
|
});
|
|
}
|
|
}
|
|
modelUtil.emitData(self.eventEmitter, data);
|
|
modelUtil.emitData(self.eventEmitter, data);
|