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

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

View File

@ -423,16 +423,17 @@
</div>
</template>
<script>
import {
dicomUploadInProgress,
batchVerifyStudyAllowUpload,
} from '@/api/trials'
import { dicomUploadInProgress } from '@/api/trials'
import {
preArchiveDicomStudy,
addOrUpdateArchiveTaskStudy,
} from '@/api/load.js'
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 cornerstone from 'cornerstone-core'
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
@ -503,6 +504,7 @@ export default {
isClose: false,
trialId: null,
subjectVisitId: null,
errStudyUidList: [],
}
},
created() {
@ -553,6 +555,7 @@ export default {
item.UploadStudyList.forEach((data) => {
data.SopInstanceUidList &&
this.SopInstanceUidList.push(...data.SopInstanceUidList)
data.VisitTaskId = item.VisitTaskId
this.UploadStudyList.push(data)
})
}
@ -611,6 +614,25 @@ export default {
this.modelList = item[list]
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) {
this.VisitTaskId = id
@ -623,11 +645,13 @@ export default {
return this.$message.warning(
this.$t('trials:uploadDicomList:message:maxFileSize')
)
let StudyInstanceUidList = []
for (let i = 0; i < checkFiles.length; i++) {
let item = checkFiles[i]
var dicom = await parseDicom(item, 'StudyInstanceUid')
let has = true,
has2 = false
has2 = false,
has3 = false
if (!this.VisitTaskId) {
has = this.StudyInstanceUidList.some(
(item) => item.StudyInstanceUid === dicom.StudyInstanceUid
@ -639,15 +663,44 @@ export default {
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
checkFiles.splice(i, 1)
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) {
this.$confirm(this.$t('upload:dicom:confirmMessage:hasNotStudyUid'), {
type: 'warning',
@ -656,6 +709,7 @@ export default {
cancelButtonText: this.$t('common:button:cancel'),
})
}
var scope = this
scope.scanState = ''
scope.isScan = false
@ -1132,8 +1186,8 @@ export default {
Record.FileCount++
} else {
let path = `/${params.trialId}/Image/${
params.trialSiteId
}/${params.subjectId}/${params.subjectVisitId}/${
params.subjectId
}/${params.subjectVisitId}/${
dicomInfo.visitTaskId
}/${scope.getGuid(
dicomInfo.studyUid +

View File

@ -135,8 +135,10 @@
<!--预览--->
<el-button
circle
:disabled="scope.row.UploadedFileCount <= 0"
icon="el-icon-view"
:title="$t('upload:nonedicom:button:preview')"
@click.stop="handlePreviewNoneDicomFiles(scope.row)"
/>
<!--上传--->
<el-button
@ -334,6 +336,7 @@ import {
} from '@/api/load.js'
import { preArchiveStudy, uploadNoneDicomFile } from '@/api/trials'
import store from '@/store'
import { getToken } from '@/utils/auth'
let defaultSearchData = () => {
return {
SubjectId: null,
@ -377,6 +380,7 @@ export default {
btnLoading: false,
currentRow: {},
studyMonitorId: null,
open: null,
}
},
watch: {
@ -534,10 +538,22 @@ export default {
//
previewFile(row) {
// window.open(row.FullFilePath, '_blank')
this.imgObj.url = row.FullFilePath
this.imgObj.url = row.FullFilePath || row.Path
this.imgObj.loading = 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) {
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 bytesTime = timeList.find(item => time - item < 1000);
if (bytesTime) {
bytesReceivedPerSecond[bytesTime] += fileInformation.file.size * percentage;
bytesReceivedPerSecond[bytesTime] += fileInformation.file.size * (percentage - lastPercentage);
} else {
console.log("未查询到时间")
if (timeList.length > 0) {
bytesReceivedPerSecond[timeList[timeList.length - 1]] += fileInformation.file.size * percentage;
bytesReceivedPerSecond[timeList[timeList.length - 1]] += fileInformation.file.size * (percentage - lastPercentage);
} 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 bytesTime = timeList.find(item => time - item < 1000);
if (bytesTime) {
bytesReceivedPerSecond[bytesTime] += data.file.size * percentage;
bytesReceivedPerSecond[bytesTime] += data.file.size * (percentage - checkData[saveFileId]);
} else {
console.log("未查询到时间")
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 {
bytesReceivedPerSecond[time] = data.file.size * percentage;
bytesReceivedPerSecond[time] = data.file.size * (percentage - checkData[saveFileId]);
}
}
}
@ -136,6 +136,7 @@ function initPage() {
function setTimer() {
if (timer) return false;
timer = setInterval(() => {
console.log(Object.assign({}, bytesReceivedPerSecond))
let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b);
if (timeList.length > 0) {
let totalBytes = timeList.reduce((sum, bytes) => sum + bytesReceivedPerSecond[bytes], 0) / (5 * 1024);

View File

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