| | |
| | | this.orgname == "第一人民医院吴山院区" |
| | | ); |
| | | }, |
| | | // 第一人民医院三个院区:及时率按 及时完成/需随访 计算 |
| | | isDiyiRenmin() { |
| | | return ( |
| | | this.orgname == "第一人民医院湖滨院区" || |
| | | this.orgname == "第一人民医院吴山院区" || |
| | | this.orgname == "第一人民医院城东院区" |
| | | ); |
| | | }, |
| | | }, |
| | | methods: { |
| | | loadData() { |
| | |
| | | const rate = ((need - timeout) / need) * 100; |
| | | return (rate < 0 ? 0 : rate).toFixed(2) + "%"; |
| | | }, |
| | | // 及时率展示文案:目标医院前端计算,其他用后端 rate 字段 |
| | | // 计算及时率(第一人民医院三院区):及时完成 / 需随访 |
| | | calculateTimelyRateByCompletion(timelyFollowUp, needFollowUp) { |
| | | const timely = Number(timelyFollowUp) || 0; |
| | | const need = Number(needFollowUp) || 0; |
| | | if (need <= 0) { |
| | | return "0.00%"; |
| | | } |
| | | const rate = (timely / need) * 100; |
| | | return (rate < 0 ? 0 : rate).toFixed(2) + "%"; |
| | | }, |
| | | // 及时率展示文案:第一人民医院三院区前端按及时完成/需随访,目标医院按(需随访-超时)/需随访,其他用后端 rate 字段 |
| | | getTimelyRateText(row) { |
| | | if (this.isDiyiRenmin) { |
| | | return this.calculateTimelyRateByCompletion( |
| | | row.timelyFollowUp, |
| | | row.needFollowUp |
| | | ); |
| | | } |
| | | if (this.isTargetHospital) { |
| | | return this.calculateTimelyRate( |
| | | row.needFollowUp, |
| | |
| | | sums[index] = "0.00%"; |
| | | } |
| | | } else if (column.property === "rate") { |
| | | if (this.isTargetHospital) { |
| | | if (this.isDiyiRenmin) { |
| | | const totalTimely = data.reduce( |
| | | (sum, item) => sum + (Number(item.timelyFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | const totalNeed = data.reduce( |
| | | (sum, item) => sum + (Number(item.needFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | sums[index] = this.calculateTimelyRateByCompletion( |
| | | totalTimely, |
| | | totalNeed |
| | | ); |
| | | } else if (this.isTargetHospital) { |
| | | const totalNeed = data.reduce( |
| | | (sum, item) => sum + (Number(item.needFollowUp) || 0), |
| | | 0 |
| | |
| | | "el-tooltip", |
| | | { |
| | | props: { |
| | | content: this.isTargetHospital |
| | | content: this.isDiyiRenmin |
| | | ? "及时率=及时完成/需随访" |
| | | : this.isTargetHospital |
| | | ? "及时率=(需随访-人工规定时间内没打过电话)/需随访" |
| | | : "(出院时间+任务周期)小于完成时间即为超时;(需随访-超时)/需随访", |
| | | placement: "top", |
| | |
| | | sums[index] = "0.00%"; |
| | | } |
| | | } else if (column.property === "rate") { |
| | | if (this.isTargetHospital) { |
| | | if (this.isDiyiRenmin) { |
| | | const totalTimely = data.reduce( |
| | | (sum, item) => sum + (Number(item.timelyFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | const totalNeed = data.reduce( |
| | | (sum, item) => sum + (Number(item.needFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | sums[index] = this.calculateTimelyRateByCompletion( |
| | | totalTimely, |
| | | totalNeed |
| | | ); |
| | | } else if (this.isTargetHospital) { |
| | | const totalNeed = data.reduce( |
| | | (sum, item) => sum + (Number(item.needFollowUp) || 0), |
| | | 0 |
| | |
| | | : "0.00%" |
| | | ); |
| | | |
| | | // 及时率(目标医院计算,其他取 rate 平均) |
| | | // 及时率(第一人民医院三院区按及时完成/需随访,目标医院计算,其他取 rate 平均) |
| | | if (showTimelyRate) { |
| | | if (graded) { |
| | | if (this.isDiyiRenmin) { |
| | | const totalTimely = data.reduce( |
| | | (s, r) => s + (Number(r.timelyFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | const totalNeed = data.reduce( |
| | | (s, r) => s + (Number(r.needFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | sums.push( |
| | | this.calculateTimelyRateByCompletion(totalTimely, totalNeed) |
| | | ); |
| | | } else if (graded) { |
| | | const totalNeed = data.reduce( |
| | | (s, r) => s + (Number(r.needFollowUp) || 0), |
| | | 0 |
| | |
| | | summaries[followUpRateIdx] = (avgFollowUpRate * 100).toFixed(2) + "%"; |
| | | } |
| | | |
| | | // 及时率计算:目标医院 (需随访-人工超时)/需随访,其他取后端 rate 平均 |
| | | if (graded) { |
| | | // 及时率计算:第一人民医院三院区按及时完成/需随访,目标医院 (需随访-人工超时)/需随访,其他取后端 rate 平均 |
| | | if (this.isDiyiRenmin) { |
| | | const totalTimely = this.tableData.reduce( |
| | | (sum, item) => sum + (Number(item.timelyFollowUp) || 0), |
| | | 0 |
| | | ); |
| | | summaries[timelyRateIdx] = this.calculateTimelyRateByCompletion( |
| | | totalTimely, |
| | | totalNeed |
| | | ); |
| | | } else if (graded) { |
| | | const totalTimeout = this.tableData.reduce( |
| | | (sum, item) => sum + (Number(item.manualCallTimeout) || 0), |
| | | 0 |