Enhanced MRI-PDFF标准更改
parent
7ef1cafeff
commit
29a6870fb5
|
|
@ -821,7 +821,7 @@ const actions = {
|
|||
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||
var measureData = state.visitTaskList[index].MeasureData
|
||||
const criterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
if (criterionType === 21 || criterionType === 22) {
|
||||
if (criterionType === 21) {
|
||||
const i = measureData.findIndex(item => item.QuestionId === obj.questionId && item.OrderMarkName === obj.orderMarkName)
|
||||
if (i > -1) {
|
||||
if (measureData[i].FristAddTaskId) {
|
||||
|
|
|
|||
|
|
@ -1223,7 +1223,7 @@ export default {
|
|||
} else if (toolName === 'Probe' && (parseInt(localStorage.getItem('CriterionType')) === 21)) {
|
||||
cornerstoneTools.addToolForElement(element, ProbeTool, { configuration: { fixedRadius: 5, handleRadius: true, drawHandlesOnHover: true, hideHandlesIfMoving: true, digits: this.digitPlaces } })
|
||||
} else if (toolName === 'Probe' && parseInt(localStorage.getItem('CriterionType')) === 22) {
|
||||
cornerstoneTools.addToolForElement(element, ProbeTool, { configuration: { fixedRadius: 5, unit: 'mm', handleRadius: true, drawHandlesOnHover: true, hideHandlesIfMoving: true, digits: this.digitPlaces } })
|
||||
cornerstoneTools.addToolForElement(element, ProbeTool, { configuration: { fixedRadius: 12, unit: 'mm', handleRadius: true, drawHandlesOnHover: true, hideHandlesIfMoving: true, digits: this.digitPlaces } })
|
||||
} else {
|
||||
cornerstoneTools.addToolForElement(element, apiTool)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="base-dialog-body">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<h3 v-if="questionName" style="color: #ddd;padding: 5px 0px;margin: 0;">
|
||||
<!-- {{ lesionName }} -->
|
||||
{{ lesionName }}
|
||||
</h3>
|
||||
<!-- 关闭 -->
|
||||
<div>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<!-- 输入框 -->
|
||||
<template
|
||||
v-if="(qs.Type === 'input' || qs.Type === 'number') && (qs.QuestionMark === 1101 || qs.QuestionMark === 1102 || qs.QuestionMark === 1103 || qs.QuestionMark === 1107)">
|
||||
v-if="(qs.Type === 'input' || qs.Type === 'number') && (qs.QuestionMark === 1104)">
|
||||
<div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;">
|
||||
<el-input v-model="questionForm[qs.Id]" disabled style="width: 100px;">
|
||||
<template v-if="qs.Unit" slot="append">
|
||||
|
|
@ -36,26 +36,28 @@
|
|||
{{ $t('trials:MRIPDFF:button:measure') }}
|
||||
</el-button>
|
||||
<!-- 清除标记 -->
|
||||
<el-button v-if="getAnnotationStatus(qs) && readingTaskState !== 2" size="mini" type="text"
|
||||
<!-- <el-button v-if="getAnnotationStatus(qs) && readingTaskState !== 2" size="mini" type="text"
|
||||
style="margin-left: 0px" @click="removeAnnotation(qs)">
|
||||
{{ $t('trials:MRIPDFF:button:clear') }}
|
||||
</el-button> -->
|
||||
<el-button v-if="questionForm.MeasureData && readingTaskState !== 2" size="mini" type="text" @click="handleDeleteMeasureData">
|
||||
{{ $t('trials:reading:button:removeMark') }}
|
||||
</el-button>
|
||||
<!-- 返回 -->
|
||||
<el-button v-if="questionForm[qs.Id]" size="mini" type="text" style="margin-left: 0px"
|
||||
<!-- <el-button v-if="questionForm[qs.Id]" size="mini" type="text" style="margin-left: 0px"
|
||||
@click="locateAnnotation(qs)">
|
||||
{{ $t('trials:MRIPDFF:button:return') }}
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="questionForm[isMeasurableId] && parseInt(questionForm[isMeasurableId]) === 1 && questionForm[qs.Id] && readingTaskState !== 2"
|
||||
size="mini" type="text" style="margin-left: 0px" @click="saveAnnotation(qs)">
|
||||
<!-- 未保存 -->
|
||||
<el-tooltip v-if="getAnnotationSaveEnum(qs) === 0" class="item" effect="dark"
|
||||
:content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</el-tooltip>
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="qs.Type === 'input' || qs.Type === 'number'">
|
||||
|
|
@ -138,6 +140,10 @@
|
|||
|
||||
<div v-if="isCurrentTask && readingTaskState < 2" class="base-dialog-footer"
|
||||
style="text-align:right;margin-top:10px;">
|
||||
<!-- 清除标记 -->
|
||||
<!-- <el-button v-if="questionForm.MeasureData" size="mini" @click="handleDeleteMeasureData">
|
||||
{{ $t('trials:reading:button:removeMark') }}
|
||||
</el-button> -->
|
||||
<!-- 保存 -->
|
||||
<el-button size="mini" @click="handleSave">
|
||||
{{ $t('common:button:save') }}
|
||||
|
|
@ -214,10 +220,8 @@ export default {
|
|||
lesionMark: '',
|
||||
activeQuestionId: '',
|
||||
activeQuestionMark: '',
|
||||
markList: [],
|
||||
digitPlaces: 2,
|
||||
isMeasurableId: '',
|
||||
isExitsMarks: false,
|
||||
isDisabledMeasurableRadio: false,
|
||||
liverSeg: ''
|
||||
}
|
||||
|
|
@ -241,6 +245,7 @@ export default {
|
|||
async initForm() {
|
||||
this.isRender = false
|
||||
this.isMeasurableId = this.getQuestionId(1105)
|
||||
this.isDisabledMeasurableRadio = false
|
||||
// const loading = this.$loading({ fullscreen: true })
|
||||
this.questions.forEach(item => {
|
||||
if (this.answers.hasOwnProperty(item.Id)) {
|
||||
|
|
@ -256,67 +261,65 @@ export default {
|
|||
this.$set(this.questionForm, 'MeasureData', this.answers.MeasureData ? JSON.parse(this.answers.MeasureData) : '')
|
||||
this.$set(this.questionForm, 'RowIndex', this.answers.RowIndex ? this.answers.RowIndex : '')
|
||||
this.$set(this.questionForm, 'RowId', this.answers.RowId ? this.answers.RowId : '')
|
||||
// 如果存在标记且是否可测量为否,则将是否可测量更改为是
|
||||
this.toolType = this.questionForm.MeasureData ? this.questionForm.MeasureData.type : ''
|
||||
this.currentMarkTool = this.questionForm.MeasureData ? this.questionForm.MeasureData.type : this.answers.MarkTool
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
const mean = this.getQuestionVal(1104)
|
||||
if (this.isCurrentTask && this.readingTaskState < 2) {
|
||||
const arr = JSON.parse(this.answers.TableQuestionMarkList)
|
||||
const isExitsMarks = arr.findIndex(i => i.MeasureData) > -1
|
||||
if (isExitsMarks && parseInt(this.questionForm[this.isMeasurableId]) === 0) {
|
||||
this.$set(this.questionForm, this.isMeasurableId, 1)
|
||||
if (this.answers.MeasureData) {
|
||||
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1 ) {
|
||||
this.isDisabledMeasurableRadio = true
|
||||
} else if (!isNaN(parseInt(isMeasurable)) && parseInt(this.questionForm[this.isMeasurableId]) === 0) {
|
||||
// 如果存在标记且是否可测量为否,则将是否可测量更改为是
|
||||
this.$set(this.questionForm, this.isMeasurableId, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
// saveTypeEnum 0:未保存过(新建病灶);1:已保存,信息不完整(随访初始化病灶/分裂病灶,通过状态判断);2:已保存,信息完整
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
const mean = this.getQuestionVal(1104)
|
||||
if (this.questionForm.saveTypeEnum !== 1 && this.isCurrentTask && this.readingTaskState < 2) {
|
||||
this.$set(this.questionForm, 'saveTypeEnum', parseInt(isMeasurable) === 1 && isNaN(parseFloat(mean)) ? 1 : 2)
|
||||
}
|
||||
this.lesionName = this.getLesionInfo(this.orderMark, this.rowIndex)
|
||||
this.lesionMark = this.getLesionName(this.orderMark, 1101)
|
||||
this.lesionMark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
|
||||
this.originalQuestionForm = { ...this.questionForm }
|
||||
this.markList = []
|
||||
this.isExitsMarks = false
|
||||
this.isDisabledMeasurableRadio = false
|
||||
|
||||
|
||||
const seg = this.getQuestionVal(1106)
|
||||
this.liverSeg = this.$fd('LiverSegmentation', seg)
|
||||
if (this.answers.TableQuestionMarkList) {
|
||||
const arr = JSON.parse(this.answers.TableQuestionMarkList)
|
||||
arr.map(i => {
|
||||
if (i.MeasureData) {
|
||||
this.isExitsMarks = true
|
||||
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1 && this.isCurrentTask && this.readingTaskState < 2) {
|
||||
this.isDisabledMeasurableRadio = true
|
||||
}
|
||||
i.MeasureData = JSON.parse(i.MeasureData)
|
||||
}
|
||||
this.markList.push({ tableQuestionId: i.TableQuestionId, measureData: i, saveEnum: 1 })
|
||||
})
|
||||
}
|
||||
|
||||
const newMean = this.getMean()
|
||||
if (newMean !== mean) {
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, newMean || '')
|
||||
}
|
||||
if (this.questionForm.saveTypeEnum === 1 && this.isCurrentTask && this.readingTaskState < 2) {
|
||||
this.setQuestions()
|
||||
}
|
||||
this.isRender = true
|
||||
// loading.close()
|
||||
},
|
||||
getLesionName(orderMark, questionMark) {
|
||||
// 根据肝脏分段枚举和第一次(或第二次或第三次)测量问题标识定义标记名称
|
||||
// I II III IV V VI VII VIII
|
||||
// L-I-01 L-I-02 L-I-03
|
||||
// L-II-01 L-II-02 L-II-03
|
||||
const segArr = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII']
|
||||
let lessionName = ''
|
||||
const segmentId = this.getQuestionId(1106)
|
||||
let segmentVal = this.answers[segmentId]
|
||||
segmentVal = segmentVal ? parseInt(segmentVal) : null
|
||||
if (segmentVal) {
|
||||
const i = questionMark === 1101 ? '01' : questionMark === 1102 ? '02' : questionMark === 1103 ? '03' : questionMark === 1107 ? '04' : ''
|
||||
lessionName = `${orderMark}-${segArr[segmentVal - 1]}-${i}`
|
||||
// getLesionName(orderMark) {
|
||||
// // 根据肝脏分段枚举和第一次(或第二次或第三次)测量问题标识定义标记名称
|
||||
// // I II III IV V VI VII VIII
|
||||
// // L-I-01 L-I-02 L-I-03
|
||||
// // L-II-01 L-II-02 L-II-03
|
||||
// const segArr = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII']
|
||||
// let lessionName = ''
|
||||
// const segmentId = this.getQuestionId(1106)
|
||||
// let segmentVal = this.answers[segmentId]
|
||||
// segmentVal = segmentVal ? parseInt(segmentVal) : null
|
||||
// if (segmentVal) {
|
||||
|
||||
// lessionName = `${orderMark}-${segArr[segmentVal - 1]}`
|
||||
// }
|
||||
// return lessionName
|
||||
// },
|
||||
getLesionName(orderMark, rowIndex) {
|
||||
var lessionName = ''
|
||||
var rowIndexArr = rowIndex.split('.')
|
||||
var x = parseInt(rowIndexArr[0])
|
||||
var y = parseInt(rowIndexArr[1])
|
||||
if (y > 0) {
|
||||
y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32)
|
||||
lessionName = `${orderMark}${String(x).padStart(2, '0')}${y}`
|
||||
} else {
|
||||
lessionName = `${orderMark}${String(x).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
return lessionName
|
||||
},
|
||||
getLesionInfo(orderMark, rowIndex) {
|
||||
|
|
@ -345,54 +348,27 @@ export default {
|
|||
},
|
||||
async formItemChange(v, qs) {
|
||||
// 维护平均值、是否可测量等信息
|
||||
// 1101 -- 第一次测量 1102 -- 第二次测量 1103 -- 第三次测量 1107 -- 第四次测量
|
||||
// 1104 -- MRI-PDFF 1105 -- 是否可测量
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 1)
|
||||
const mean = this.getQuestionVal(1104)
|
||||
if (qs.QuestionMark === 1101 || qs.QuestionMark === 1102 || qs.QuestionMark === 1103 || qs.QuestionMark === 1107) {
|
||||
const newMean = this.getMean()
|
||||
if (newMean !== mean) {
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, newMean || '')
|
||||
}
|
||||
} else if (qs.QuestionMark === 1105) {
|
||||
if (qs.QuestionMark === 1105) {
|
||||
if (!v) {
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, 'NE')
|
||||
} else {
|
||||
const mean = this.getMean()
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, mean)
|
||||
}
|
||||
}
|
||||
this.setQuestions()
|
||||
},
|
||||
getMean() {
|
||||
let mean = null
|
||||
let isMeasurable = this.getQuestionVal(1105)
|
||||
isMeasurable = !isNaN(parseInt(isMeasurable)) ? parseInt(isMeasurable) : null
|
||||
const l1 = this.getQuestionVal(1101)
|
||||
const l2 = this.getQuestionVal(1102)
|
||||
const l3 = this.getQuestionVal(1103)
|
||||
const l4 = this.getQuestionVal(1107)
|
||||
if (isMeasurable && !isNaN(parseFloat(l1)) && !isNaN(parseFloat(l2)) && !isNaN(parseFloat(l3)) && !isNaN(parseFloat(l4))) {
|
||||
const sum = l1 + l2 + l3 + l4
|
||||
mean = sum / 4
|
||||
return parseFloat(mean.toFixed(this.digitPlaces))
|
||||
} else if (isMeasurable === 0) {
|
||||
return 'NE'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
setMeasureData(measureData, isInit = false) {
|
||||
return new Promise(resolve => {
|
||||
if (!measureData || (measureData && measureData.tableQuestionId !== this.activeQuestionId)) {
|
||||
if (!measureData) {
|
||||
resolve()
|
||||
}
|
||||
var data = {}
|
||||
let data = {}
|
||||
// 创建标记
|
||||
if (!measureData.data.remark) {
|
||||
// 维护标记信息
|
||||
measureData.data.remark = this.getLesionName(this.orderMark, this.activeQuestionMark)
|
||||
measureData.data.remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
|
||||
}
|
||||
// const val = measureData.data.cachedStats.mean / 10
|
||||
let val = parseFloat(measureData?.data?.cachedStats?.mean)
|
||||
|
|
@ -407,6 +383,7 @@ export default {
|
|||
this.$set(this.questionForm, measureData.tableQuestionId, val.toFixed(this.digitPlaces))
|
||||
data = {
|
||||
Id: '',
|
||||
IsDicomReading: true,
|
||||
StudyId: measureData.studyId,
|
||||
InstanceId: measureData.instanceId,
|
||||
SeriesId: measureData.seriesId,
|
||||
|
|
@ -417,223 +394,32 @@ export default {
|
|||
VisitTaskId: this.visitTaskId,
|
||||
NumberOfFrames: isNaN(parseInt(measureData.frame)) ? 0 : measureData.frame,
|
||||
frame: isNaN(parseInt(measureData.frame)) ? 0 : measureData.frame,
|
||||
OrderMarkName: measureData.data.remark,
|
||||
TableQuestionId: measureData.tableQuestionId
|
||||
OrderMarkName: measureData.data.remark
|
||||
}
|
||||
store.dispatch('reading/addMeasuredData', { visitTaskId: this.visitTaskId, data: data })
|
||||
let mean = this.getQuestionVal(1104)
|
||||
const newMean = this.getMean()
|
||||
if (newMean !== mean) {
|
||||
mean = newMean
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, newMean || '')
|
||||
}
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
DicomEvent.$emit('refreshStudyListMeasureData')
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === measureData.tableQuestionId)
|
||||
if (i === -1) {
|
||||
this.markList.push({ tableQuestionId: measureData.tableQuestionId, measureData: data, saveEnum: 0 })
|
||||
} else {
|
||||
this.markList[i].saveEnum = 0
|
||||
this.markList[i].measureData = data
|
||||
}
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
|
||||
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1) {
|
||||
this.isDisabledMeasurableRadio = true
|
||||
}
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 1)
|
||||
this.$set(this.questionForm, 'MeasureData', measureData)
|
||||
this.setQuestions()
|
||||
resolve()
|
||||
})
|
||||
},
|
||||
addAnnotation(qs) {
|
||||
// 判断是否有测量数据未保存
|
||||
const i = this.markList.findIndex(i => i.saveEnum === 0)
|
||||
if (i > -1 && this.markList[i].measureData && this.markList[i].measureData.MeasureData) {
|
||||
this.$alert(this.$t('trials:MRIPDFF:message:message3'))
|
||||
// this.$message.warning(this.$t('trials:MRIPDFF:message:message3'))
|
||||
return
|
||||
}
|
||||
const orderMarkName = this.getLesionName(this.orderMark, qs.QuestionMark)
|
||||
const orderMarkName = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
|
||||
this.activeQuestionId = qs.Id
|
||||
this.activeQuestionMark = qs.QuestionMark
|
||||
DicomEvent.$emit('addAnnotation', { question: qs, locateInfo: { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: orderMarkName, lesionType: null, markTool: 'Probe', readingTaskState: this.readingTaskState, isMarked: true } })
|
||||
},
|
||||
getAnnotationSaveEnum(qs) {
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === qs.Id)
|
||||
if (i > -1) {
|
||||
return this.markList[i].saveEnum
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
},
|
||||
getAnnotationStatus(qs) {
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === qs.Id)
|
||||
if (i > -1 && this.markList[i].measureData && this.markList[i].measureData.MeasureData) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
getIsExitsMarks() {
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1) {
|
||||
return this.markList.findIndex(i => i.measureData && i.measureData.MeasureData) > -1
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
async removeAnnotation(qs) {
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === qs.Id)
|
||||
DicomEvent.$emit('imageLocation', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.markList[i].measureData.OrderMarkName, lesionType: null, markTool: 'Probe', readingTaskState: this.readingTaskState, isMarked: true })
|
||||
// 是否确认清除标记?
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:reading:warnning:msg47'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
|
||||
const measureData = Object.assign({}, this.markList[i].measureData)
|
||||
if (measureData.Id) {
|
||||
await deleteSingleTableQuestionMark({ Id: measureData.Id }, 11)
|
||||
}
|
||||
// 移除缓存中的measureData
|
||||
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: measureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: measureData.OrderMarkName })
|
||||
DicomEvent.$emit('getMeasureData')
|
||||
this.markList[i].measureData = null
|
||||
this.markList[i].saveEnum = 0
|
||||
// 清除测量值、清除平均值
|
||||
this.$set(this.questionForm, this.markList[i].tableQuestionId, '')
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, '')
|
||||
this.isDisabledMeasurableRadio = this.getIsExitsMarks()
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 1)
|
||||
this.setQuestions()
|
||||
},
|
||||
locateAnnotation(qs) {
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === qs.Id)
|
||||
const measureData = this.markList[i].measureData
|
||||
// 定位
|
||||
var markTool = 'Probe'
|
||||
var readingTaskState = this.readingTaskState
|
||||
var isMarked = !!measureData
|
||||
DicomEvent.$emit('imageLocation', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: measureData.OrderMarkName, lesionType: null, markTool, readingTaskState, isMarked })
|
||||
},
|
||||
setQuestions() {
|
||||
const mean = this.getQuestionVal(1104)
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
this.$emit('resetQuestions', { mean, isMeasurable, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
},
|
||||
async saveAnnotation(qs) {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
try {
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === qs.Id)
|
||||
let params = {}
|
||||
if (i > -1 && this.markList[i].measureData && this.markList[i].measureData.MeasureData) {
|
||||
const measureData = this.markList[i].measureData.MeasureData
|
||||
const tableQuestionId = this.markList[i].tableQuestionId
|
||||
if (this.questionForm[tableQuestionId] > 100) {
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:MRIPDFF:message:message4'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
}
|
||||
// 上传截图
|
||||
|
||||
DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: measureData.OrderMarkName, lesionType: null, isMarked: !!measureData }, async val => {
|
||||
params = Object.assign({}, this.markList[i].measureData)
|
||||
if (val) {
|
||||
const pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
|
||||
params.PicturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
|
||||
}
|
||||
|
||||
params.Answer = this.questionForm[tableQuestionId]
|
||||
params.MeasureData = JSON.stringify(this.markList[i].measureData.MeasureData)
|
||||
loading.close()
|
||||
this.saveTableQuestionInfo(params, qs)
|
||||
})
|
||||
} else {
|
||||
params = {
|
||||
Answer: '',
|
||||
VisitTaskId: this.visitTaskId,
|
||||
QuestionId: this.parentQsId,
|
||||
InstanceId: '',
|
||||
SeriesId: '',
|
||||
StudyId: '',
|
||||
MarkTool: '',
|
||||
PicturePath: '',
|
||||
NumberOfFrames: 0,
|
||||
MeasureData: '',
|
||||
QuestionType: 0,
|
||||
OrderMarkName: '',
|
||||
RowId: this.questionForm.RowId,
|
||||
TableQuestionId: qs.Id,
|
||||
RowIndex: this.questionForm.RowIndex
|
||||
}
|
||||
loading.close()
|
||||
this.saveTableQuestionInfo(params, qs)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
},
|
||||
async saveTableQuestionInfo(params, qs) {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
try {
|
||||
const res = await saveTableQuestionMark(params, 11)
|
||||
if (res.IsSuccess) {
|
||||
// 保存后设置保存状态
|
||||
const i = this.markList.findIndex(i => i.tableQuestionId === qs.Id)
|
||||
this.markList[i].saveEnum = 1
|
||||
// 保存病灶
|
||||
const j = this.markList.findIndex(i => !(i.saveEnum === 1 && i.measureData && i.measureData.MeasureData))
|
||||
if (j === -1) {
|
||||
const answers = []
|
||||
const reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/)
|
||||
for (const k in this.questionForm) {
|
||||
if (reg.test(k)) {
|
||||
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
|
||||
answers.push({ tableQuestionId: k, answer: this.questionForm[k] })
|
||||
}
|
||||
}
|
||||
}
|
||||
const params = {
|
||||
questionId: this.parentQsId,
|
||||
rowId: this.questionForm.RowId,
|
||||
rowIndex: this.answers.RowIndex,
|
||||
visitTaskId: this.visitTaskId,
|
||||
trialId: this.trialId,
|
||||
answerList: answers,
|
||||
isDicomReading: true
|
||||
}
|
||||
const res = await submitTaskRowInfo(params, 11)
|
||||
if (res.IsSuccess) {
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 2)
|
||||
this.originalQuestionForm = { ...this.questionForm }
|
||||
this.$set(this.questionForm, 'RowId', res.Result.RowId)
|
||||
this.setQuestions()
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
}
|
||||
}
|
||||
// 保存成功
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
// 刷新表格、刷新标记信息
|
||||
this.$emit('getReadingQuestionAndAnswer')
|
||||
DicomEvent.$emit('setMeasuredToolsPassive')
|
||||
loading.close()
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
},
|
||||
returnFloat(num) {
|
||||
if (num) return
|
||||
var value = Math.round(parseFloat(num) * 100) / 100
|
||||
|
|
@ -702,94 +488,134 @@ export default {
|
|||
// 生成Blob对象(文件对象)
|
||||
return new Blob([bytesCode], { type: imgtype })
|
||||
},
|
||||
// async handleDeleteMeasureData() {
|
||||
// // 是否确认清除标记?
|
||||
// const confirm = await this.$confirm(
|
||||
// this.$t('trials:reading:warnning:msg47'),
|
||||
// {
|
||||
// type: 'warning',
|
||||
// distinguishCancelAndClose: true
|
||||
// }
|
||||
// )
|
||||
// if (confirm !== 'confirm') return
|
||||
// // 重置MRI-PDFF
|
||||
// var mripdffId = this.getQuestionId(1104)
|
||||
// this.$set(this.questionForm, mripdffId, '')
|
||||
// if (this.questionForm.RowId) {
|
||||
// this.$set(this.questionForm, 'saveTypeEnum', 1)
|
||||
// } else {
|
||||
// this.$set(this.questionForm, 'saveTypeEnum', 0)
|
||||
// }
|
||||
// await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex })
|
||||
// DicomEvent.$emit('getMeasureData')
|
||||
|
||||
// if (!this.questionForm.IsDicomReading) {
|
||||
// DicomEvent.$emit('removeNoneDicomMeasureData', this.questionForm.MeasureData)
|
||||
// }
|
||||
// this.$set(this.questionForm, 'IsDicomReading', true)
|
||||
|
||||
// this.$set(this.questionForm, 'MeasureData', '')
|
||||
|
||||
|
||||
// const mean = this.getQuestionVal(1104)
|
||||
// const isMeasurable = this.getQuestionVal(1105)
|
||||
// this.$emit('resetQuestions', { mean, isMeasurable, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
|
||||
// DicomEvent.$emit('refreshStudyListMeasureData')
|
||||
// },
|
||||
|
||||
async handleDeleteMeasureData() {
|
||||
// 是否确认清除标记?
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:reading:warnning:msg47'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
let isMeasurable = this.getQuestionVal(1105)
|
||||
// 重置MRI-PDFF
|
||||
let mripdffId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, mripdffId, '')
|
||||
if (this.questionForm.RowId) {
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 1)
|
||||
} else {
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 0)
|
||||
}
|
||||
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex })
|
||||
DicomEvent.$emit('getMeasureData')
|
||||
|
||||
this.$set(this.questionForm, 'IsDicomReading', true)
|
||||
|
||||
this.$set(this.questionForm, 'MeasureData', '')
|
||||
let anwsers = Object.assign({}, this.questionForm)
|
||||
this.$emit('resetQuestions', { mean: '', isMeasurable, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: anwsers })
|
||||
DicomEvent.$emit('refreshStudyListMeasureData')
|
||||
},
|
||||
async handleSave() {
|
||||
try {
|
||||
const valid = await this.$refs.measurementForm.validate()
|
||||
if (!valid) return
|
||||
if (parseInt(this.questionForm[this.isMeasurableId]) === 1) {
|
||||
// 检验是否有标记为保存
|
||||
const i = this.markList.findIndex(i => i.saveEnum === 0)
|
||||
if (i > -1) {
|
||||
// 请先保存标注信息!
|
||||
this.$alert(this.$t('trials:MRIPDFF:message:message1'))
|
||||
// this.$message.warning(this.$t('trials:MRIPDFF:message:message1'))
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// 不可测量时,清空测量值,平均值
|
||||
// '是否确认不可测量?'
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:MRIPDFF:message:message2'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
const l1Id = this.getQuestionId(1101)
|
||||
this.$set(this.questionForm, l1Id, '')
|
||||
const l2Id = this.getQuestionId(1102)
|
||||
this.$set(this.questionForm, l2Id, '')
|
||||
const l3Id = this.getQuestionId(1103)
|
||||
this.$set(this.questionForm, l3Id, '')
|
||||
const l4Id = this.getQuestionId(1107)
|
||||
this.$set(this.questionForm, l4Id, '')
|
||||
const meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, 'NE')
|
||||
}
|
||||
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
let measureData = this.questionForm.MeasureData
|
||||
if (parseInt(this.questionForm[this.isMeasurableId]) === 0 && measureData) {
|
||||
await deleteTableQuestionMark({ rowId: this.questionForm.RowId }, 11)
|
||||
}
|
||||
DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType, isMarked: !!measureData }, async val => {
|
||||
try {
|
||||
let picturePath = ''
|
||||
if (val && measureData && this.questionForm.IsDicomReading) {
|
||||
let pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
|
||||
|
||||
try {
|
||||
// let isResetMarks = this.markList.findIndex(i=>i.measureData && i.measureData.MeasureData) > -1 ? true : false
|
||||
if (parseInt(this.questionForm[this.isMeasurableId]) === 0 && this.isExitsMarks) {
|
||||
await deleteTableQuestionMark({ rowId: this.questionForm.RowId }, 11)
|
||||
this.markList.forEach(i => {
|
||||
if (i.measureData && i.measureData.MeasureData) {
|
||||
i.measureData = ''
|
||||
}
|
||||
})
|
||||
this.isExitsMarks = false
|
||||
}
|
||||
var answers = []
|
||||
var reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/)
|
||||
for (const k in this.questionForm) {
|
||||
if (reg.test(k)) {
|
||||
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
|
||||
answers.push({ tableQuestionId: k, answer: this.questionForm[k] })
|
||||
picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
|
||||
}
|
||||
let answers = []
|
||||
let reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/)
|
||||
for (const k in this.questionForm) {
|
||||
if (reg.test(k)) {
|
||||
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
|
||||
answers.push({ tableQuestionId: k, answer: this.questionForm[k] })
|
||||
}
|
||||
}
|
||||
}
|
||||
let params = {
|
||||
questionId: this.parentQsId,
|
||||
rowId: this.questionForm.RowId,
|
||||
rowIndex: this.answers.RowIndex,
|
||||
visitTaskId: this.visitTaskId,
|
||||
trialId: this.trialId,
|
||||
measureData: measureData ? JSON.stringify(measureData) : '',
|
||||
answerList: answers,
|
||||
isDicomReading: true,
|
||||
studyId: measureData ? this.questionForm.MeasureData.studyId : '',
|
||||
seriesId: measureData ? this.questionForm.MeasureData.seriesId : '',
|
||||
instanceId: measureData ? this.questionForm.MeasureData.instanceId : '',
|
||||
numberOfFrames: measureData && !isNaN(parseInt(this.questionForm.MeasureData.frame)) ? parseInt(this.questionForm.MeasureData.frame) : 0,
|
||||
picturePath: picturePath,
|
||||
markTool: measureData ? measureData.type : ''
|
||||
}
|
||||
const res = await submitTaskRowInfo(params, 11)
|
||||
if (res.IsSuccess) {
|
||||
// 保存成功!
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.currentMarkTool = measureData ? measureData.type : ''
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 2)
|
||||
this.originalQuestionForm = { ...this.questionForm }
|
||||
this.$set(this.questionForm, 'RowId', res.Result.RowId)
|
||||
this.setQuestions()
|
||||
this.$emit('close')
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
DicomEvent.$emit('setMeasuredToolsPassive')
|
||||
// await store.dispatch('reading/refreshMeasuredData', this.visitTaskId)
|
||||
// DicomEvent.$emit('getMeasureData')
|
||||
this.$emit('getReadingQuestionAndAnswer')
|
||||
}
|
||||
loading.close()
|
||||
} catch(e) {
|
||||
loading.close()
|
||||
}
|
||||
|
||||
var params = {
|
||||
questionId: this.parentQsId,
|
||||
rowId: this.questionForm.RowId,
|
||||
rowIndex: this.answers.RowIndex,
|
||||
visitTaskId: this.visitTaskId,
|
||||
trialId: this.trialId,
|
||||
answerList: answers,
|
||||
isDicomReading: true
|
||||
}
|
||||
const res = await submitTaskRowInfo(params, 11)
|
||||
if (res.IsSuccess) {
|
||||
// 保存成功!
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 2)
|
||||
this.originalQuestionForm = { ...this.questionForm }
|
||||
this.$set(this.questionForm, 'RowId', res.Result.RowId)
|
||||
this.setQuestions()
|
||||
this.$emit('close')
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
DicomEvent.$emit('setMeasuredToolsPassive')
|
||||
// await store.dispatch('reading/refreshMeasuredData', this.visitTaskId)
|
||||
// DicomEvent.$emit('getMeasureData')
|
||||
this.$emit('getReadingQuestionAndAnswer')
|
||||
}
|
||||
loading.close()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue