PCWG标准更改

uat_us
caiyiling 2024-07-17 18:11:00 +08:00
parent 39a0c8163f
commit af586a1187
3 changed files with 319 additions and 179 deletions

View File

@ -484,8 +484,8 @@ export default {
const lesionPart = this.getQuestionVal(8) const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6) const lesionOrgan = this.getQuestionVal(6)
const lesionState = Number(this.getQuestionVal(7)) const lesionState = this.getQuestionVal(7)
const lesionNum = Number(this.getQuestionVal(11)) const lesionNum = this.getQuestionVal(11)
this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
}, },
@ -547,8 +547,8 @@ export default {
this.$set(this.questionForm, 'MeasureData', measureData) this.$set(this.questionForm, 'MeasureData', measureData)
const lesionPart = this.getQuestionVal(8) const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6) const lesionOrgan = this.getQuestionVal(6)
const lesionState = Number(this.getQuestionVal(7)) const lesionState = this.getQuestionVal(7)
const lesionNum = Number(this.getQuestionVal(11)) const lesionNum = this.getQuestionVal(11)
this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
this.toolType = measureData.type this.toolType = measureData.type
@ -572,10 +572,15 @@ export default {
} }
}, },
getQuestionVal(questionMark) { getQuestionVal(questionMark) {
var idx = this.questions.findIndex(i => i.QuestionMark === questionMark) const idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
if (idx > -1) { if (idx > -1) {
var questionId = this.questions[idx].Id const questionId = this.questions[idx].Id
return this.questionForm[questionId] const answer = this.questionForm[questionId]
if (isNaN(parseFloat(answer))) {
return answer
} else {
return parseFloat(answer)
}
} else { } else {
return '' return ''
} }
@ -619,78 +624,79 @@ export default {
// Blob // Blob
return new Blob([bytesCode], { type: imgtype }) return new Blob([bytesCode], { type: imgtype })
}, },
handleSave() { async handleSave() {
this.$refs.measurementForm.validate(async valid => { const valid = await this.$refs.measurementForm.validate()
if (!valid) return if (!valid) return
var lesionState = this.getQuestionVal(7) var lesionState = this.getQuestionVal(7)
var measureData = this.questionForm.MeasureData var measureData = this.questionForm.MeasureData
// 线 // 线
if (!this.isBaseLineTask) { if (!this.isBaseLineTask) {
// 2 // 2
// 使2 // 使2
if (this.lesionType === 2 && lesionState === 2) { if (this.lesionType === 2 && lesionState === 2) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) { if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg2'), { this.$confirm(this.$t('trials:readingPGWC:warnning:msg2'), {
type: 'warning', type: 'warning',
showCancelButton: false, showCancelButton: false,
callback: action => {} callback: action => {}
}) })
loading.close() loading.close()
return return
}
}
// 3
// 使2
if (this.lesionType === 3 && lesionState === 2) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg3'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
// 使3
if (this.lesionType === 3 && lesionState === 3) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg4'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
// 使1
if (this.lesionType === 3 && lesionState === 1) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg5'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
// 4
if (this.lesionType === 3 && lesionState === 4) {
if (measureData) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg6'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} }
} }
const loading = this.$loading({ fullscreen: true }) // 3
DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType, isMarked: !!measureData }, async val => { // 使2
if (this.lesionType === 3 && lesionState === 2) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg3'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
// 使3
if (this.lesionType === 3 && lesionState === 3) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg4'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
// 使1
if (this.lesionType === 3 && lesionState === 1) {
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg5'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
// 4
if (this.lesionType === 3 && lesionState === 4) {
if (measureData) {
this.$confirm(this.$t('trials:readingPGWC:warnning:msg6'), {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
const loading = this.$loading({ fullscreen: true })
DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType, isMarked: !!measureData }, async val => {
try {
var picturePath = '' var picturePath = ''
if (val && measureData) { if (val && measureData) {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val) var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
@ -724,106 +730,115 @@ export default {
organInfoId: this.questionForm.OrganInfoId, organInfoId: this.questionForm.OrganInfoId,
markTool: measureData ? measureData.type : '' markTool: measureData ? measureData.type : ''
} }
submitTableQuestion(params).then(async res => {
try {
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.currentMarkTool = measureData ? measureData.type : ''
this.$set(this.questionForm, 'saveTypeEnum', 2)
this.originalQuestionForm = { ...this.questionForm }
loading.close()
var isLymphLesion = this.getQuestionVal(2)
isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null
var lesionOrgan = this.getQuestionVal(6)
this.$set(this.questionForm, 'RowId', res.Result.RowId)
const lesionPart = this.getQuestionVal(8)
const lesionState = Number(this.getQuestionVal(7))
const lesionNum = Number(this.getQuestionVal(11))
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, saveTypeEnum: this.questionForm.saveTypeEnum, lesionState, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) const res = await submitTableQuestion(params)
DicomEvent.$emit('getMeasureData') if (res.IsSuccess) {
this.$emit('close') this.$message.success(this.$t('common:message:savedSuccessfully'))
DicomEvent.$emit('getReportInfo', true) this.currentMarkTool = measureData ? measureData.type : ''
DicomEvent.$emit('setMeasuredToolsPassive') this.$set(this.questionForm, 'saveTypeEnum', 2)
} catch (e) { this.originalQuestionForm = { ...this.questionForm }
console.log(e)
}
}).catch(() => { loading.close() })
})
})
},
handleDeleteMeasureData() {
this.$confirm(this.$t('trials:reading:warnning:msg47'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(async() => {
if (this.questionForm.RowId) {
this.$set(this.questionForm, 'saveTypeEnum', 1)
} else {
this.$set(this.questionForm, 'saveTypeEnum', 0)
}
var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark })
DicomEvent.$emit('getMeasureData')
const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6)
const lesionState = Number(this.getQuestionVal(7))
const lesionNum = Number(this.getQuestionVal(11))
this.$set(this.questionForm, 'MeasureData', '') var isLymphLesion = this.getQuestionVal(2)
let anwsers = null isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null
if (this.answers.measureObj) { var lesionOrgan = this.getQuestionVal(6)
anwsers = Object.assign({ measureObj: '' }, this.questionForm) this.$set(this.questionForm, 'RowId', res.Result.RowId)
} else { const lesionPart = this.getQuestionVal(8)
anwsers = Object.assign({}, this.questionForm) const lesionState = this.getQuestionVal(7)
} const lesionNum = this.getQuestionVal(11)
this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: anwsers })
DicomEvent.$emit('refreshStudyListMeasureData')
})
.catch(() => {})
},
handleDelete() {
this.$confirm(this.$t('trials:reading:warnning:msg48'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(async() => {
if (this.questionForm.RowId) {
const loading = this.$loading({ fullscreen: true })
var param = {
visitTaskId: this.visitTaskId,
questionId: this.parentQsId,
rowId: this.questionForm.RowId
}
deleteReadingRowAnswer(param)
.then(async res => {
loading.close()
if (res.IsSuccess) {
if (this.questionForm.MeasureData) {
var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark })
}
DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
DicomEvent.$emit('getReportInfo', true)
this.$message.success(this.$t('common:message:deletedSuccessfully'))
loading.close()
}
}).catch(() => { loading.close() })
} else {
const loading = this.$loading({ fullscreen: true })
//
if (this.questionForm.MeasureData) {
var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark })
}
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, saveTypeEnum: this.questionForm.saveTypeEnum, lesionState, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
DicomEvent.$emit('getMeasureData') DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId }) this.$emit('close')
DicomEvent.$emit('refreshStudyListMeasureData') DicomEvent.$emit('getReportInfo', true)
DicomEvent.$emit('setMeasuredToolsPassive')
loading.close() loading.close()
} }
}) } catch (e) {
console.log(e)
loading.close()
}
})
},
async handleDeleteMeasureData() {
//
const confirm = await this.$confirm(
this.$t('trials:reading:warnning:msg47'),
{
type: 'warning',
distinguishCancelAndClose: true
}
)
if (confirm !== 'confirm') return
if (this.questionForm.RowId) {
this.$set(this.questionForm, 'saveTypeEnum', 1)
} else {
this.$set(this.questionForm, 'saveTypeEnum', 0)
}
var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark })
DicomEvent.$emit('getMeasureData')
const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6)
const lesionState = this.getQuestionVal(7)
const lesionNum = this.getQuestionVal(11)
this.$set(this.questionForm, 'MeasureData', '')
let anwsers = null
if (this.answers.measureObj) {
anwsers = Object.assign({ measureObj: '' }, this.questionForm)
} else {
anwsers = Object.assign({}, this.questionForm)
}
this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: anwsers })
DicomEvent.$emit('refreshStudyListMeasureData')
},
async handleDelete() {
//
const loading = this.$loading({ fullscreen: true })
try {
const confirm = await this.$confirm(
this.$t('trials:reading:warnning:msg48'),
{
type: 'warning',
distinguishCancelAndClose: true
}
)
if (confirm !== 'confirm') return
if (this.questionForm.RowId) {
var param = {
visitTaskId: this.visitTaskId,
questionId: this.parentQsId,
rowId: this.questionForm.RowId
}
const res = await deleteReadingRowAnswer(param)
if (res.IsSuccess) {
if (this.questionForm.MeasureData) {
const remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark })
}
DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
DicomEvent.$emit('getReportInfo', true)
this.$message.success(this.$t('common:message:deletedSuccessfully'))
}
loading.close()
} else {
//
if (this.questionForm.MeasureData) {
const remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark })
}
DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
DicomEvent.$emit('refreshStudyListMeasureData')
loading.close()
}
} catch (e) {
console.log(e)
loading.close()
}
}, },
handleClose() { handleClose() {
if (!this.questionForm.RowId) { if (!this.questionForm.RowId) {
@ -866,7 +881,7 @@ export default {
this.$set(this.questionForm, stateId, 4) this.$set(this.questionForm, stateId, 4)
const lesionPart = this.getQuestionVal(8) const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6) const lesionOrgan = this.getQuestionVal(6)
const lesionState = !isNaN(parseInt(this.getQuestionVal(7))) ? parseInt(this.getQuestionVal(7)) : '' const lesionState = this.getQuestionVal(7)
this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
} }
} }

View File

@ -2,10 +2,20 @@
<div class="measurement-wrapper" :style="{'height':height+10+'px'}"> <div class="measurement-wrapper" :style="{'height':height+10+'px'}">
<div class="container" :style="{'height':height+'px'}"> <div class="container" :style="{'height':height+'px'}">
<h3 v-if="isReadingShowSubjectInfo" style="color: #ddd;padding: 5px 0px;margin: 0;"> <div class="basic-info">
<span v-if="subjectCode">{{ subjectCode }} </span> <h3 v-if="isReadingShowSubjectInfo">
<span style="margin-left:5px;">{{ taskBlindName }}</span> <span v-if="subjectCode">{{ subjectCode }} </span>
</h3> <span style="margin-left:5px;">{{ taskBlindName }}</span>
</h3>
<div v-if="readingTaskState < 2">
<el-tooltip class="item" effect="dark" :content="$t('trials:dicomReading:message:confirmReset')" placement="bottom">
<i
class="el-icon-refresh-left"
@click="resetMeasuredData"
/>
</el-tooltip>
</div>
</div>
<!-- 非测量问题 --> <!-- 非测量问题 -->
<div class="lesions"> <div class="lesions">
<Questions <Questions
@ -101,6 +111,7 @@
</template> </template>
<script> <script>
import { resetReadingTask } from '@/api/reading'
import DicomEvent from './../DicomEvent' import DicomEvent from './../DicomEvent'
import Questions from './../Questions' import Questions from './../Questions'
import QuestionForm from './QuestionForm' import QuestionForm from './QuestionForm'
@ -688,6 +699,99 @@ export default {
this.activeItem.activeRowIndex = null this.activeItem.activeRowIndex = null
this.activeItem.activeCollapseId = null this.activeItem.activeCollapseId = null
this.activeName = '' this.activeName = ''
},
getECRFQuestions(obj) {
this.$refs['ecrf'].getQuestions(obj.visitTaskId)
},
async resetMeasuredData() {
try {
const confirm = await this.$confirm(
this.$t('trials:dicomReading:message:confirmReset1'),
this.$t('trials:dicomReading:message:confirmReset2'),
{
type: 'warning',
distinguishCancelAndClose: true
}
)
if (confirm !== 'confirm') return
this.loading = true
const res = await resetReadingTask({ visitTaskId: this.visitTaskId })
this.loading = false
if (res.IsSuccess) {
//
this.activeName = ''
this.activeItem.activeRowIndex = null
this.activeItem.activeCollapseId = null
await this.getReadingQuestionAndAnswer(this.visitTaskId)
this.$refs['ecrf'].resetQSForm()
DicomEvent.$emit('getMeasureData')
DicomEvent.$emit('getReportInfo', true)
DicomEvent.$emit('refreshStudyListMeasureData')
}
} catch (e) {
this.loading = false
console.log(e)
}
},
receiveMsg(event) {
if (event.data.type === 'isCanActiveNoneDicomTool') {
this.getUnSaveTarget()
var obj = {}
if (this.unSaveTargets.length > 0) {
var rowIndex = String(this.unSaveTargets[0].rowIndex)
var questionId = this.unSaveTargets[0].questionId
const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
if (rowIndex === this.activeItem.activeRowIndex && questionId === this.activeItem.activeCollapseId && !this.$refs[refName][0].questionForm.MeasureData) {
//
// questions.findIndex(i => i.QuestionMark === questionMark)
var lesionType = this.$refs[refName][0].questionForm.LesionType
if (lesionType === 0) {
// ''
obj = { isCanActiveTool: false, lesionName: '', reason: this.$t('trials:reading:warnning:msg18') }
} else {
obj = { isCanActiveTool: true, lesionName: this.$refs[refName][0].lesionMark, reason: '', toolName: event.data.toolName }
}
} else {
let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', this.unSaveTargets[0].lessionName)
obj = { isCanActiveTool: false, lesionName: '', reason: msg }
}
} else {
if (this.activeItem.activeCollapseId) {
//
const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
const lesionType = this.$refs[refName][0].questionForm.LesionType
if (lesionType === 0) {
//
obj = { isCanActiveTool: false, lesionName: '', reason: this.$t('trials:reading:warnning:msg18') }
} else {
obj = { isCanActiveTool: true, lesionName: this.$refs[refName][0].lesionMark, reason: '', toolName: event.data.toolName }
}
} else {
// /
var qsObj = null
var lesionName = ''
if (this.isBaseLineTask) {
const idx = this.tableQuestions.findIndex(item => item.LesionType === 1)
if (idx > -1) {
qsObj = this.tableQuestions[idx]
}
} else {
const idx = this.tableQuestions.findIndex(item => item.LesionType === 2)
if (idx > -1) {
qsObj = this.tableQuestions[idx]
}
}
var maxIndex = this.getMaxRowIndex(qsObj.TableQuestions.Answers)
lesionName = `${qsObj.OrderMark}${String(maxIndex + 1).padStart(2, '0')}`
obj = { isCanActiveTool: true, lesionName: lesionName, reason: '', toolName: event.data.toolName }
}
}
DicomEvent.$emit('isCanActiveNoneDicomTool', obj)
} else if (event.data.type === 'setMeasurement') {
this.setMeasuredData(event.data.data)
}
} }
} }
} }
@ -700,6 +804,22 @@ export default {
.container{ .container{
padding: 10px; padding: 10px;
.basic-info{
display: flex;
justify-content: space-between;
align-items: center;
h3{
color: #ddd;
padding: 5px 0px;
margin: 0;
}
i{
color: #fff;
font-size: 22px;
font-weight: bold;
cursor: pointer;
}
}
} }
.title{ .title{
padding: 5px; padding: 5px;

View File

@ -672,10 +672,15 @@ export default {
} }
}, },
getQuestionVal(questionMark) { getQuestionVal(questionMark) {
var idx = this.questions.findIndex(i => i.QuestionMark === questionMark) const idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
if (idx > -1) { if (idx > -1) {
var questionId = this.questions[idx].Id const questionId = this.questions[idx].Id
return this.questionForm[questionId] const answer = this.questionForm[questionId]
if (isNaN(parseFloat(answer))) {
return answer
} else {
return parseFloat(answer)
}
} else { } else {
return '' return ''
} }