// 模拟伦理审查数据
|
const mockEthicsReviewData = [
|
{
|
id: 1,
|
hospitalNo: "D202312001",
|
donorName: "张三",
|
gender: "0",
|
age: 45,
|
diagnosis: "脑外伤",
|
ethicsConclusion: "reviewing",
|
ethicsOpinion: "该病例符合器官捐献伦理审查基本要求,建议提交专家委员会审议",
|
reviewTime: "2023-12-01 14:30:00",
|
judgmentDoctor: "王医生",
|
judgmentDescription: "经过多次脑死亡判定,符合脑死亡临床诊断标准",
|
registrant: "李协调员",
|
registrationTime: "2023-12-01 15:00:00",
|
createTime: "2023-12-01 10:00:00"
|
},
|
{
|
id: 2,
|
hospitalNo: "D202312002",
|
donorName: "李四",
|
gender: "1",
|
age: 38,
|
diagnosis: "心脏骤停",
|
ethicsConclusion: "approved",
|
ethicsOpinion: "家属意愿明确,医疗程序合规,同意进行器官捐献",
|
reviewTime: "2023-12-02 09:15:00",
|
judgmentDoctor: "刘医生",
|
judgmentDescription: "心死亡判定,心电图呈直线,无自主呼吸",
|
registrant: "张协调员",
|
registrationTime: "2023-12-02 10:00:00",
|
createTime: "2023-12-02 08:30:00"
|
}
|
];
|
|
// 模拟专家审查数据
|
const mockExpertReviewData = [
|
{
|
id: 1,
|
ethicsReviewId: 1,
|
expertName: "张教授",
|
isChief: false,
|
reviewStatus: "submitted",
|
expertConclusion: "approved",
|
expertOpinion: "病例资料完整,符合伦理审查要求",
|
reviewTime: "2023-12-01 16:30:00"
|
},
|
{
|
id: 2,
|
ethicsReviewId: 1,
|
expertName: "李教授",
|
isChief: false,
|
reviewStatus: "submitted",
|
expertConclusion: "approved",
|
expertOpinion: "捐献流程规范,同意审查",
|
reviewTime: "2023-12-01 17:20:00"
|
},
|
{
|
id: 19,
|
ethicsReviewId: 1,
|
expertName: "赵主任",
|
isChief: true,
|
reviewStatus: "applying",
|
expertConclusion: "",
|
expertOpinion: "",
|
reviewTime: ""
|
}
|
];
|
|
// 模拟附件数据
|
const mockAttachmentData = [
|
{
|
id: 1,
|
ethicsReviewId: 1,
|
fileName: "伦理审查申请表.pdf",
|
fileSize: 2048576,
|
uploadTime: "2023-12-01 09:30:00",
|
uploader: "张医生",
|
fileUrl: "/attachments/ethics_application_1.pdf"
|
},
|
{
|
id: 2,
|
ethicsReviewId: 1,
|
fileName: "专家评审意见汇总.docx",
|
fileSize: 512345,
|
uploadTime: "2023-12-01 14:20:00",
|
uploader: "李医生",
|
fileUrl: "/attachments/expert_review_1.docx"
|
}
|
];
|
|
// 模拟API响应延迟
|
const delay = (ms = 500) => new Promise(resolve => setTimeout(resolve, ms));
|
|
// 查询伦理审查列表
|
export const listEthicsReview = async (queryParams = {}) => {
|
await delay();
|
|
const {
|
pageNum = 1,
|
pageSize = 10,
|
hospitalNo,
|
donorName,
|
ethicsConclusion,
|
reviewTimeRange = []
|
} = queryParams;
|
|
// 过滤数据
|
let filteredData = mockEthicsReviewData.filter(item => {
|
let match = true;
|
|
if (hospitalNo && !item.hospitalNo.includes(hospitalNo)) {
|
match = false;
|
}
|
|
if (donorName && !item.donorName.includes(donorName)) {
|
match = false;
|
}
|
|
if (ethicsConclusion && item.ethicsConclusion !== ethicsConclusion) {
|
match = false;
|
}
|
|
if (reviewTimeRange.length === 2) {
|
const reviewTime = new Date(item.reviewTime);
|
const startTime = new Date(reviewTimeRange[0]);
|
const endTime = new Date(reviewTimeRange[1]);
|
endTime.setDate(endTime.getDate() + 1);
|
|
if (reviewTime < startTime || reviewTime >= endTime) {
|
match = false;
|
}
|
}
|
|
return match;
|
});
|
|
// 分页
|
const startIndex = (pageNum - 1) * pageSize;
|
const endIndex = startIndex + parseInt(pageSize);
|
const paginatedData = filteredData.slice(startIndex, endIndex);
|
|
return {
|
code: 200,
|
message: "success",
|
data: {
|
rows: paginatedData,
|
total: filteredData.length,
|
pageNum: parseInt(pageNum),
|
pageSize: parseInt(pageSize)
|
}
|
};
|
};
|
|
// 获取伦理审查详细信息
|
export const getEthicsReviewDetail = async (id) => {
|
await delay();
|
|
const detail = mockEthicsReviewData.find(item => item.id == id);
|
|
if (detail) {
|
return {
|
code: 200,
|
message: "success",
|
data: detail
|
};
|
} else {
|
return {
|
code: 404,
|
message: "伦理审查记录不存在"
|
};
|
}
|
};
|
|
// 新增伦理审查
|
export const addEthicsReview = async (data) => {
|
await delay();
|
|
const newId = Math.max(...mockEthicsReviewData.map(item => item.id), 0) + 1;
|
const hospitalNo = `D${new Date().getFullYear()}${String(new Date().getMonth() + 1).padStart(2, '0')}${String(newId).padStart(3, '0')}`;
|
|
const newRecord = {
|
...data,
|
id: newId,
|
hospitalNo,
|
registrationTime: new Date().toISOString().replace('T', ' ').substring(0, 19),
|
createTime: new Date().toISOString().replace('T', ' ').substring(0, 19)
|
};
|
|
mockEthicsReviewData.unshift(newRecord);
|
|
return {
|
code: 200,
|
message: "新增成功",
|
data: newRecord
|
};
|
};
|
|
// 修改伦理审查
|
export const updateEthicsReview = async (data) => {
|
await delay();
|
|
const index = mockEthicsReviewData.findIndex(item => item.id == data.id);
|
|
if (index !== -1) {
|
mockEthicsReviewData[index] = {
|
...mockEthicsReviewData[index],
|
...data,
|
updateTime: new Date().toISOString().replace('T', ' ').substring(0, 19)
|
};
|
|
return {
|
code: 200,
|
message: "修改成功",
|
data: mockEthicsReviewData[index]
|
};
|
} else {
|
return {
|
code: 404,
|
message: "伦理审查记录不存在"
|
};
|
}
|
};
|
|
// 删除伦理审查
|
export const delEthicsReview = async (ids) => {
|
await delay();
|
|
const idArray = Array.isArray(ids) ? ids : [ids];
|
|
idArray.forEach(id => {
|
const index = mockEthicsReviewData.findIndex(item => item.id == id);
|
if (index !== -1) {
|
mockEthicsReviewData.splice(index, 1);
|
}
|
});
|
|
return {
|
code: 200,
|
message: "删除成功"
|
};
|
};
|
|
// 结束伦理审查
|
export const endEthicsReview = async (id) => {
|
await delay();
|
|
const index = mockEthicsReviewData.findIndex(item => item.id == id);
|
|
if (index !== -1) {
|
mockEthicsReviewData[index].ethicsConclusion = 'terminated';
|
mockEthicsReviewData[index].reviewTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
return {
|
code: 200,
|
message: "审查已结束",
|
data: mockEthicsReviewData[index]
|
};
|
} else {
|
return {
|
code: 404,
|
message: "伦理审查记录不存在"
|
};
|
}
|
};
|
|
// 导出伦理审查
|
export const exportEthicsReview = async (queryParams) => {
|
await delay(1000);
|
|
const { data } = await listEthicsReview(queryParams);
|
|
return {
|
code: 200,
|
message: "导出成功",
|
data: {
|
fileName: `伦理审查数据_${new Date().getTime()}.xlsx`,
|
downloadUrl: "/api/export/ethicsReview"
|
}
|
};
|
};
|
|
// 获取专家审查列表
|
export const getExpertReviews = async (ethicsReviewId) => {
|
await delay();
|
|
const reviews = mockExpertReviewData.filter(item => item.ethicsReviewId == ethicsReviewId);
|
|
return {
|
code: 200,
|
message: "success",
|
data: reviews
|
};
|
};
|
|
// 发送专家审查
|
export const sendExpertReview = async (data) => {
|
await delay(1500);
|
|
const { ethicsReviewId, expertIds, content } = data;
|
|
// 模拟发送短信给专家
|
expertIds.forEach(expertId => {
|
const expert = mockExpertReviewData.find(item => item.id === expertId);
|
if (expert) {
|
expert.reviewStatus = 'submitted';
|
expert.reviewTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
}
|
});
|
|
return {
|
code: 200,
|
message: "专家审查邀请发送成功",
|
data: {
|
sentCount: expertIds.length,
|
content: content
|
}
|
};
|
};
|
|
// 获取附件列表
|
export const getAttachments = async (ethicsReviewId) => {
|
await delay();
|
|
const attachments = mockAttachmentData.filter(item => item.ethicsReviewId == ethicsReviewId);
|
|
return {
|
code: 200,
|
message: "success",
|
data: attachments
|
};
|
};
|
|
// 上传附件
|
export const uploadAttachment = async (formData) => {
|
await delay(2000);
|
|
const newAttachment = {
|
id: Math.max(...mockAttachmentData.map(item => item.id), 0) + 1,
|
ethicsReviewId: parseInt(formData.get('ethicsReviewId')),
|
fileName: `附件_${new Date().getTime()}.pdf`,
|
fileSize: 1024000,
|
uploadTime: new Date().toISOString().replace('T', ' ').substring(0, 19),
|
uploader: "当前用户",
|
fileUrl: `/attachments/ethics_${formData.get('ethicsReviewId')}_${new Date().getTime()}.pdf`
|
};
|
|
mockAttachmentData.push(newAttachment);
|
|
return {
|
code: 200,
|
message: "上传成功",
|
data: newAttachment
|
};
|
};
|
|
// 删除附件
|
export const deleteAttachment = async (attachmentId) => {
|
await delay();
|
|
const index = mockAttachmentData.findIndex(item => item.id == attachmentId);
|
|
if (index !== -1) {
|
mockAttachmentData.splice(index, 1);
|
|
return {
|
code: 200,
|
message: "删除成功"
|
};
|
} else {
|
return {
|
code: 404,
|
message: "附件不存在"
|
};
|
}
|
};
|
|
export default {
|
listEthicsReview,
|
getEthicsReviewDetail,
|
addEthicsReview,
|
updateEthicsReview,
|
delEthicsReview,
|
endEthicsReview,
|
exportEthicsReview,
|
getExpertReviews,
|
sendExpertReview,
|
getAttachments,
|
uploadAttachment,
|
deleteAttachment
|
};
|