From 883184785059ee74adc31bd02ecf45735b5a1638 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Mon, 9 Sep 2024 13:21:48 +0800 Subject: [PATCH] =?UTF-8?q?OCT=E6=A0=87=E5=87=86=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/reading.js | 20 ++- .../dicoms/components/IVUS/QuestionForm.vue | 66 +------- .../dicoms/components/IVUS/QuestionList.vue | 6 +- .../dicoms/components/OCT/QuestionForm.vue | 153 +++++++----------- .../dicoms/components/OCT/QuestionList.vue | 39 ++++- 5 files changed, 108 insertions(+), 176 deletions(-) diff --git a/src/store/modules/reading.js b/src/store/modules/reading.js index 8166845b..7c11814a 100644 --- a/src/store/modules/reading.js +++ b/src/store/modules/reading.js @@ -51,15 +51,31 @@ function getQuestions(questions) { // ivus answerObj.area1 = getQuestionAnswer(item.TableQuestions.Questions, 1001, answerObj) answerObj.area2 = getQuestionAnswer(item.TableQuestions.Questions, 1002, answerObj) - var v = getQuestionAnswer(item.TableQuestions.Questions, 1003, answerObj) + const v = getQuestionAnswer(item.TableQuestions.Questions, 1003, answerObj) answerObj.diff = v answerObj.saveTypeEnum = isNaN(parseFloat(v)) ? 1 : 2 + } else if (criterionType === 20) { + // oct + if (item.LesionType === 101) { + answerObj.l1 = getQuestionAnswer(item.TableQuestions.Questions, 1011, answerObj) + answerObj.l2 = getQuestionAnswer(item.TableQuestions.Questions, 1012, answerObj) + answerObj.l3 = getQuestionAnswer(item.TableQuestions.Questions, 1013, answerObj) + const min = getQuestionAnswer(item.TableQuestions.Questions, 1014, answerObj) + answerObj.min = min + const mean = getQuestionAnswer(item.TableQuestions.Questions, 1015, answerObj) + answerObj.mean = mean + answerObj.saveTypeEnum = (isNaN(parseFloat(min)) || isNaN(parseFloat(mean))) ? 1 : 2 + } else if (item.LesionType === 103) { + const angle = getQuestionAnswer(item.TableQuestions.Questions, 1016, answerObj) + answerObj.angle = angle + answerObj.saveTypeEnum = isNaN(parseFloat(angle)) ? 1 : 2 + } } else { answerObj.lesionPart = getQuestionAnswer(item.TableQuestions.Questions, 8, answerObj) answerObj.loctation = getQuestionAnswer(item.TableQuestions.Questions, 6, answerObj) answerObj.lesionLength = getQuestionAnswer(item.TableQuestions.Questions, 0, answerObj) answerObj.lesionShort = getQuestionAnswer(item.TableQuestions.Questions, 1, answerObj) - var isLymphLesion = getQuestionAnswer(item.TableQuestions.Questions, 2, answerObj) + let isLymphLesion = getQuestionAnswer(item.TableQuestions.Questions, 2, answerObj) isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null answerObj.isLymphLesion = isLymphLesion answerObj.lesionState = getQuestionAnswer(item.TableQuestions.Questions, 7, answerObj) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionForm.vue b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionForm.vue index f1b9b099..167aaa2b 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionForm.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionForm.vue @@ -18,30 +18,6 @@ - - { - if (val) { - // 判断是否超过该病灶类型个数的最大值 - var idx = this.tableQuestions.findIndex(item => item.LesionType === v) - if (idx > -1 && !!this.tableQuestions[idx].MaxQuestionCount && this.tableQuestions[idx].MaxQuestionCount <= this.tableQuestions[idx].TableQuestions.Answers.length) { - let msg = this.$t('trials:reading:warnning:msg14') - // msg = msg.replace('xxx', this.tableQuestions[idx].QuestionName) - msg = msg.replace('xxx', this.tableQuestions[idx].MaxQuestionCount) - this.$confirm(msg, { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType) - return - } - - var arr = [] - this.questionForm[this.getQuestionId(1001)] = '' - this.questionForm[this.getQuestionId(1002)] = '' - this.questionForm[this.getQuestionId(1003)] = '' - this.questions.forEach(item => { - item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : '' - arr.push(item) - }) - var type = null - if (this.questionForm.RowId) { - type = 1 - } else { - type = 0 - } - DicomEvent.$emit('changeLesionType', { questionForm: arr, oldLesionType: this.lesionType, newLesionType: v, rowIndex: this.questionForm.RowIndex, questionId: this.parentQsId, measureData: this.questionForm.MeasureData, type, rowId: this.questionForm.RowId }) - } else { - this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType) - } - }) - }, deleteLesionInfo() { return new Promise((resolve, reject) => { const loading = this.$loading({ fullscreen: true }) @@ -390,7 +328,7 @@ export default { }, calculate(qsMarkArr, type) { var num = 0 - for (let i = 0; i< qsMarkArr.length; i++) { + for (let i = 0; i < qsMarkArr.length; i++) { const mark = qsMarkArr[i] const v = this.questionForm[this.getQuestionId(mark)] if (isNaN(parseFloat(v))) { @@ -407,7 +345,7 @@ export default { } } } - + return num === null ? num : num.toFixed(this.digitPlaces) }, limitBlur(qId, valueType) { diff --git a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue index b4f44a10..66d8530c 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue @@ -75,13 +75,13 @@
-
+
{{ item.TableQuestions.Answers[i].area1 }}m㎡
-
+
{{ item.TableQuestions.Answers[i].area2 }}m㎡
-
+
{{ item.TableQuestions.Answers[i].diff }}m㎡
diff --git a/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionForm.vue b/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionForm.vue index 854448c4..9babf325 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionForm.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionForm.vue @@ -18,30 +18,6 @@
- - - + @@ -315,96 +291,65 @@ export default { return '' } }, - async lesionTypeChange(v) { - this.$emit('determineExistsUnsavedLession', async val => { - if (val) { - // 判断是否超过该病灶类型个数的最大值 - var idx = this.tableQuestions.findIndex(item => item.LesionType === v) - if (idx > -1 && !!this.tableQuestions[idx].MaxQuestionCount && this.tableQuestions[idx].MaxQuestionCount <= this.tableQuestions[idx].TableQuestions.Answers.length) { - let msg = this.$t('trials:reading:warnning:msg14') - // msg = msg.replace('xxx', this.tableQuestions[idx].QuestionName) - msg = msg.replace('xxx', this.tableQuestions[idx].MaxQuestionCount) - this.$confirm(msg, { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType) - return - } - - var arr = [] - this.questionForm[this.getQuestionId(1001)] = '' - this.questionForm[this.getQuestionId(1002)] = '' - this.questionForm[this.getQuestionId(1003)] = '' - this.questions.forEach(item => { - item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : '' - arr.push(item) - }) - var type = null - if (this.questionForm.RowId) { - type = 1 - } else { - type = 0 - } - DicomEvent.$emit('changeLesionType', { questionForm: arr, oldLesionType: this.lesionType, newLesionType: v, rowIndex: this.questionForm.RowIndex, questionId: this.parentQsId, measureData: this.questionForm.MeasureData, type, rowId: this.questionForm.RowId }) - } else { - this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType) - } - }) - }, - deleteLesionInfo() { - return new Promise((resolve, reject) => { - const loading = this.$loading({ fullscreen: true }) - var param = { - visitTaskId: this.visitTaskId, - questionId: this.parentQsId, - rowId: this.questionForm.RowId - } - deleteReadingRowAnswer(param) - .then(async res => { - if (res.IsSuccess) { - DicomEvent.$emit('getReportInfo', true) - } - loading.close() - resolve() - }).catch(() => { - loading.close() - reject() - }) - }) - }, async formItemChange(v, question) { if (this.questionForm.RowId) { this.$set(this.questionForm, 'saveTypeEnum', 1) } else { this.$set(this.questionForm, 'saveTypeEnum', 0) } - if (question.QuestionMark === 1001 || question.QuestionMark === 1002) { - this.questionForm[this.getQuestionId(1003)] = this.calculate([1001, 1002], '-') + if (question.QuestionMark === 1011 || question.QuestionMark === 1012 || question.QuestionMark === 1013) { + // 最小值 + this.questionForm[this.getQuestionId(1014)] = this.calculate([1011, 1012, 1013], 'min') + // 平均值 + this.questionForm[this.getQuestionId(1015)] = this.calculate([1011, 1012, 1013], 'avg') } - this.$emit('resetQuestions', { saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) + let l1, l2, l3, min, mean, angle + if (this.lesionType === 101) { + l1 = this.getQuestionVal(1011) + l2 = this.getQuestionVal(1012) + l3 = this.getQuestionVal(1013) + min = this.getQuestionVal(1014) + mean = this.getQuestionVal(1015) + } else if (this.lesionType === 103) { + angle = this.getQuestionVal(1016) + } + this.$emit('resetQuestions', { l1, l2, l3, min, mean, angle, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) }, calculate(qsMarkArr, type) { var num = 0 - qsMarkArr.map((qsmark, i) => { + const arr = [] + for (let i = 0; i < qsMarkArr.length; i++) { + const mark = qsMarkArr[i] + let v = this.questionForm[this.getQuestionId(mark)] + if (isNaN(parseFloat(v))) { + num = null + break + } + v = parseFloat(v) if (i === 0) { - const v = this.questionForm[this.getQuestionId(qsmark)] - num = isNaN(parseFloat(v)) ? 0 : parseFloat(v) + num = v + arr.push(v) } else { - const v = this.questionForm[this.getQuestionId(qsmark)] switch (type) { - case '-': - num -= isNaN(parseFloat(v)) ? 0 : parseFloat(v) + case 'min': + num = num > v ? v : num + break + case 'avg': + arr.push(v) + if (arr.length === qsMarkArr.length) { + num = arr.reduce((acc, curr) => { + return acc + curr + }, 0) / arr.length + } break } } - }) - return parseFloat(num).toFixed(this.digitPlaces) + } + + return num === null ? num : num.toFixed(this.digitPlaces) }, limitBlur(qId, valueType) { - const value = isNaN(parseFloat(this.questionForm[qId])) ? null : parseFloat(this.questionForm[qId]) - if (value === null) return + const value = this.questionForm[qId] if (valueType === 0) { this.$set(this.questionForm, qId, parseInt(value)) } else if (valueType === 3) { @@ -494,7 +439,17 @@ export default { this.$set(this.questionForm, 'saveTypeEnum', 2) this.originalQuestionForm = { ...this.questionForm } this.$set(this.questionForm, 'RowId', res.Result.RowId) - this.$emit('resetQuestions', { saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) + let l1, l2, l3, min, mean, angle + if (this.lesionType === 101) { + l1 = this.getQuestionVal(1011) + l2 = this.getQuestionVal(1012) + l3 = this.getQuestionVal(1013) + min = this.getQuestionVal(1014) + mean = this.getQuestionVal(1015) + } else if (this.lesionType === 103) { + angle = this.getQuestionVal(1016) + } + this.$emit('resetQuestions', { l1, l2, l3, min, mean, angle, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) this.$emit('close') DicomEvent.$emit('refreshQuestions') diff --git a/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue index 25e613c2..3ca1d668 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue @@ -73,6 +73,19 @@ +
+
+
+ min: {{ item.TableQuestions.Answers[i].min }}μm +
+
+ mean: {{ item.TableQuestions.Answers[i].mean }}μm +
+
+ {{ item.TableQuestions.Answers[i].angle }}° +
+
+
@@ -91,7 +104,6 @@ :reading-task-state="readingTaskState" :is-base-line-task="isBaseLineTask" @getReadingQuestionAndAnswer="getReadingQuestionAndAnswer" - @determineExistsUnsavedLession="determineExistsUnsavedLession" @resetQuestions="resetQuestions" @close="close" /> @@ -349,7 +361,15 @@ export default { if (item.Type === 'table' && item.Id === obj.questionId) { var idx = item.TableQuestions.Answers.findIndex(i => i.RowIndex === obj.rowIndex) item.TableQuestions.Answers[idx].saveTypeEnum = obj.saveTypeEnum - + if (item.LesionType === 101) { + item.TableQuestions.Answers[idx].l1 = obj.l1 + item.TableQuestions.Answers[idx].l2 = obj.l2 + item.TableQuestions.Answers[idx].l3 = obj.l3 + item.TableQuestions.Answers[idx].min = obj.min + item.TableQuestions.Answers[idx].mean = obj.mean + } else if (item.LesionType === 103) { + item.TableQuestions.Answers[idx].angle = obj.angle + } for (const i in obj.anwsers) { item.TableQuestions.Answers[idx][i] = String(obj.anwsers[i]) } @@ -364,8 +384,14 @@ export default { if (item.Type === 'table' && item.TableQuestions && item.TableQuestions.Answers.length > 0) { item.TableQuestions.Answers.forEach(answerObj => { if (answerObj.RowId) { - var diffVal = this.getQuestionAnswer(item.TableQuestions.Questions, 1003, answerObj) - this.$set(answerObj, 'saveTypeEnum', isNaN(parseFloat(diffVal)) ? 1 : 2) + if (item.LesionType === 101) { + var min = this.getQuestionAnswer(item.TableQuestions.Questions, 1014, answerObj) + var mean = this.getQuestionAnswer(item.TableQuestions.Questions, 1015, answerObj) + this.$set(answerObj, 'saveTypeEnum', (isNaN(parseFloat(min)) || isNaN(parseFloat(mean))) ? 1 : 2) + } else if (item.LesionType === 103) { + var angle = this.getQuestionAnswer(item.TableQuestions.Questions, 1016, answerObj) + this.$set(answerObj, 'saveTypeEnum', isNaN(parseFloat(angle)) ? 1 : 2) + } } else { this.$set(answerObj, 'saveTypeEnum', 0) } @@ -497,10 +523,6 @@ export default { return 0 } }, - determineExistsUnsavedLession(callback) { - callback(true) - return - }, getLesionName(orderMark, rowIndex) { var lessionName = '' var rowIndexArr = rowIndex.split('.') @@ -623,6 +645,7 @@ export default { async close(questionsObj) { if (questionsObj) { this.getReadingQuestionAndAnswer(questionsObj.visitTaskId) + this.refreshQuestions() } this.activeItem.activeRowIndex = null this.activeItem.activeCollapseId = null