ir上传dicom校验
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-06 11:03:05 +08:00
parent e52378d5d4
commit f6b90c4c05
6 changed files with 105 additions and 17 deletions

View File

@ -72,3 +72,11 @@ export function getIRUploadTaskNoneDicomStudyList(data) {
data data
}) })
} }
// 校验上传影像
export function verifyIRStudyAllowUpload(data) {
return request({
url: '/DownloadAndUpload/verifyIRStudyAllowUpload',
method: 'post',
data
})
}

View File

@ -423,16 +423,17 @@
</div> </div>
</template> </template>
<script> <script>
import { import { dicomUploadInProgress } from '@/api/trials'
dicomUploadInProgress,
batchVerifyStudyAllowUpload,
} from '@/api/trials'
import { import {
preArchiveDicomStudy, preArchiveDicomStudy,
addOrUpdateArchiveTaskStudy, addOrUpdateArchiveTaskStudy,
} from '@/api/load.js' } from '@/api/load.js'
import studyView from './study-view.vue' import studyView from './study-view.vue'
import { getSubjectImageUploadList, deleteTaskStudy } from '@/api/load.js' import {
getSubjectImageUploadList,
deleteTaskStudy,
verifyIRStudyAllowUpload,
} from '@/api/load.js'
import * as dicomParser from 'dicom-parser' import * as dicomParser from 'dicom-parser'
import * as cornerstone from 'cornerstone-core' import * as cornerstone from 'cornerstone-core'
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader' import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
@ -503,6 +504,7 @@ export default {
isClose: false, isClose: false,
trialId: null, trialId: null,
subjectVisitId: null, subjectVisitId: null,
errStudyUidList: [],
} }
}, },
created() { created() {
@ -553,6 +555,7 @@ export default {
item.UploadStudyList.forEach((data) => { item.UploadStudyList.forEach((data) => {
data.SopInstanceUidList && data.SopInstanceUidList &&
this.SopInstanceUidList.push(...data.SopInstanceUidList) this.SopInstanceUidList.push(...data.SopInstanceUidList)
data.VisitTaskId = item.VisitTaskId
this.UploadStudyList.push(data) this.UploadStudyList.push(data)
}) })
} }
@ -611,6 +614,25 @@ export default {
this.modelList = item[list] this.modelList = item[list]
this.model_cfg.visible = true this.model_cfg.visible = true
}, },
//
async verifyIRStudyAllowUpload(list) {
try {
let data = {
StudyInstanceUidList: list || [],
TrialId: this.$route.query.trialId,
SubjectCode: this.SubjectCode,
SubjectId: this.SubjectId,
}
let res = await verifyIRStudyAllowUpload(data)
if (res.IsSuccess) {
return res.Result
}
return false
} catch (err) {
console.log(err)
return false
}
},
// //
async beginScanFiles(e, id = null) { async beginScanFiles(e, id = null) {
this.VisitTaskId = id this.VisitTaskId = id
@ -623,11 +645,13 @@ export default {
return this.$message.warning( return this.$message.warning(
this.$t('trials:uploadDicomList:message:maxFileSize') this.$t('trials:uploadDicomList:message:maxFileSize')
) )
let StudyInstanceUidList = []
for (let i = 0; i < checkFiles.length; i++) { for (let i = 0; i < checkFiles.length; i++) {
let item = checkFiles[i] let item = checkFiles[i]
var dicom = await parseDicom(item, 'StudyInstanceUid') var dicom = await parseDicom(item, 'StudyInstanceUid')
let has = true, let has = true,
has2 = false has2 = false,
has3 = false
if (!this.VisitTaskId) { if (!this.VisitTaskId) {
has = this.StudyInstanceUidList.some( has = this.StudyInstanceUidList.some(
(item) => item.StudyInstanceUid === dicom.StudyInstanceUid (item) => item.StudyInstanceUid === dicom.StudyInstanceUid
@ -639,15 +663,44 @@ export default {
item.VisitTaskId !== this.VisitTaskId item.VisitTaskId !== this.VisitTaskId
) )
}) })
has3 = this.UploadStudyList.some((item) => {
return (
item.StudyInstanceUid === dicom.StudyInstanceUid &&
item.VisitTaskId !== this.VisitTaskId
)
})
} }
if (!has || has2) { if (!has || has2 || has3) {
this.hasOtherStudy = true this.hasOtherStudy = true
checkFiles.splice(i, 1) checkFiles.splice(i, 1)
i-- i--
} else {
if (!~StudyInstanceUidList.indexOf(dicom.StudyInstanceUid)) {
StudyInstanceUidList.push(dicom.StudyInstanceUid)
}
}
}
this.errStudyUidList = []
let res = await this.verifyIRStudyAllowUpload(StudyInstanceUidList)
if (res) {
res.forEach((item) => {
if (!item.IsAllowUpload && !item.IsAllowReUpload) {
this.errStudyUidList.push(item.StudyInstanceUid)
}
})
}
if (this.errStudyUidList && this.errStudyUidList.length > 0) {
for (let i = 0; i < checkFiles.length; i++) {
let item = checkFiles[i]
var dicom = await parseDicom(item, 'StudyInstanceUid')
if (!!~this.errStudyUidList.indexOf(dicom.StudyInstanceUid)) {
this.hasOtherStudy = true
checkFiles.splice(i, 1)
i--
}
} }
} }
if (this.hasOtherStudy) { if (this.hasOtherStudy) {
this.$confirm(this.$t('upload:dicom:confirmMessage:hasNotStudyUid'), { this.$confirm(this.$t('upload:dicom:confirmMessage:hasNotStudyUid'), {
type: 'warning', type: 'warning',
@ -656,6 +709,7 @@ export default {
cancelButtonText: this.$t('common:button:cancel'), cancelButtonText: this.$t('common:button:cancel'),
}) })
} }
var scope = this var scope = this
scope.scanState = '' scope.scanState = ''
scope.isScan = false scope.isScan = false
@ -1132,8 +1186,8 @@ export default {
Record.FileCount++ Record.FileCount++
} else { } else {
let path = `/${params.trialId}/Image/${ let path = `/${params.trialId}/Image/${
params.trialSiteId params.subjectId
}/${params.subjectId}/${params.subjectVisitId}/${ }/${params.subjectVisitId}/${
dicomInfo.visitTaskId dicomInfo.visitTaskId
}/${scope.getGuid( }/${scope.getGuid(
dicomInfo.studyUid + dicomInfo.studyUid +

View File

@ -135,8 +135,10 @@
<!--预览---> <!--预览--->
<el-button <el-button
circle circle
:disabled="scope.row.UploadedFileCount <= 0"
icon="el-icon-view" icon="el-icon-view"
:title="$t('upload:nonedicom:button:preview')" :title="$t('upload:nonedicom:button:preview')"
@click.stop="handlePreviewNoneDicomFiles(scope.row)"
/> />
<!--上传---> <!--上传--->
<el-button <el-button
@ -334,6 +336,7 @@ import {
} from '@/api/load.js' } from '@/api/load.js'
import { preArchiveStudy, uploadNoneDicomFile } from '@/api/trials' import { preArchiveStudy, uploadNoneDicomFile } from '@/api/trials'
import store from '@/store' import store from '@/store'
import { getToken } from '@/utils/auth'
let defaultSearchData = () => { let defaultSearchData = () => {
return { return {
SubjectId: null, SubjectId: null,
@ -377,6 +380,7 @@ export default {
btnLoading: false, btnLoading: false,
currentRow: {}, currentRow: {},
studyMonitorId: null, studyMonitorId: null,
open: null,
} }
}, },
watch: { watch: {
@ -534,10 +538,22 @@ export default {
// //
previewFile(row) { previewFile(row) {
// window.open(row.FullFilePath, '_blank') // window.open(row.FullFilePath, '_blank')
this.imgObj.url = row.FullFilePath this.imgObj.url = row.FullFilePath || row.Path
this.imgObj.loading = true this.imgObj.loading = true
this.imgObj.visible = true this.imgObj.visible = true
}, },
// Dicom
handlePreviewNoneDicomFiles(row) {
if (this.open) {
this.open.close()
}
let trialId = this.$route.query.trialId
var token = getToken()
const routeData = this.$router.resolve({
path: `/showNoneDicoms?trialId=${trialId}&subjectVisitId=${row.SourceSubjectVisitId}&studyId=${row.Id}&TokenKey=${token}`,
})
this.open = window.open(routeData.href, '_blank')
},
// //
async remove(item) { async remove(item) {
try { try {

View File

@ -126,13 +126,13 @@ async function uploadFile({ s3, fileInformation, uploadId, bucket, changeStatus,
let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b); let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b);
let bytesTime = timeList.find(item => time - item < 1000); let bytesTime = timeList.find(item => time - item < 1000);
if (bytesTime) { if (bytesTime) {
bytesReceivedPerSecond[bytesTime] += fileInformation.file.size * percentage; bytesReceivedPerSecond[bytesTime] += fileInformation.file.size * (percentage - lastPercentage);
} else { } else {
console.log("未查询到时间") console.log("未查询到时间")
if (timeList.length > 0) { if (timeList.length > 0) {
bytesReceivedPerSecond[timeList[timeList.length - 1]] += fileInformation.file.size * percentage; bytesReceivedPerSecond[timeList[timeList.length - 1]] += fileInformation.file.size * (percentage - lastPercentage);
} else { } else {
bytesReceivedPerSecond[time] = fileInformation.file.size * percentage; bytesReceivedPerSecond[time] = fileInformation.file.size * (percentage - lastPercentage);
} }
} }
} }

View File

@ -57,13 +57,13 @@ async function multipartUpload(OSSclient, partSize, saveFileId, uploadFile, data
let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b); let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b);
let bytesTime = timeList.find(item => time - item < 1000); let bytesTime = timeList.find(item => time - item < 1000);
if (bytesTime) { if (bytesTime) {
bytesReceivedPerSecond[bytesTime] += data.file.size * percentage; bytesReceivedPerSecond[bytesTime] += data.file.size * (percentage - checkData[saveFileId]);
} else { } else {
console.log("未查询到时间") console.log("未查询到时间")
if (timeList.length > 0) { if (timeList.length > 0) {
bytesReceivedPerSecond[timeList[timeList.length - 1]] += data.file.size * percentage; bytesReceivedPerSecond[timeList[timeList.length - 1]] += data.file.size * (percentage - checkData[saveFileId]);
} else { } else {
bytesReceivedPerSecond[time] = data.file.size * percentage; bytesReceivedPerSecond[time] = data.file.size * (percentage - checkData[saveFileId]);
} }
} }
} }
@ -136,6 +136,7 @@ function initPage() {
function setTimer() { function setTimer() {
if (timer) return false; if (timer) return false;
timer = setInterval(() => { timer = setInterval(() => {
console.log(Object.assign({}, bytesReceivedPerSecond))
let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b); let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b);
if (timeList.length > 0) { if (timeList.length > 0) {
let totalBytes = timeList.reduce((sum, bytes) => sum + bytesReceivedPerSecond[bytes], 0) / (5 * 1024); let totalBytes = timeList.reduce((sum, bytes) => sum + bytesReceivedPerSecond[bytes], 0) / (5 * 1024);

View File

@ -657,6 +657,13 @@
:criterion="trialCriterion" :criterion="trialCriterion"
:status="uploadStatus" :status="uploadStatus"
/> --> /> -->
<upload-dicom-and-nonedicom
v-if="uploadImageVisible"
:SubjectId="uploadSubjectId"
:SubjectCode="uploadSubjectCode"
:Criterion="uploadTrialCriterion"
:visible.sync="uploadImageVisible"
/>
<download-dicom-and-nonedicom <download-dicom-and-nonedicom
v-if="downloadImageVisible" v-if="downloadImageVisible"
:SubjectId="uploadSubjectId" :SubjectId="uploadSubjectId"
@ -688,6 +695,7 @@ import { mapGetters } from 'vuex'
import store from '@/store' import store from '@/store'
import { getDoctorShortcutKey, getUserWLTemplateList } from '@/api/user' import { getDoctorShortcutKey, getUserWLTemplateList } from '@/api/user'
import uploadImage from '@/components/uploadImage' import uploadImage from '@/components/uploadImage'
import uploadDicomAndNonedicom from '@/components/uploadDicomAndNonedicom'
import downloadDicomAndNonedicom from '@/components/downloadDicomAndNonedicom' import downloadDicomAndNonedicom from '@/components/downloadDicomAndNonedicom'
import { getCriterionReadingInfo } from '@/api/trials' import { getCriterionReadingInfo } from '@/api/trials'
export default { export default {
@ -702,6 +710,7 @@ export default {
MeasurementList, MeasurementList,
'upload-image': uploadImage, 'upload-image': uploadImage,
'download-dicom-and-nonedicom': downloadDicomAndNonedicom, 'download-dicom-and-nonedicom': downloadDicomAndNonedicom,
'upload-dicom-and-nonedicom': uploadDicomAndNonedicom,
}, },
props: { props: {
isExistsClinicalData: { isExistsClinicalData: {