import request from '@/utils/request'
import requestDownload from '@/utils/request-download'

export function getTrialList(param) {
  return request({
    url: '/trial/getTrialList',
    method: 'post',
    data: param
  })
}

export function getTrialSelect(param) {
  return request({
    url: '/trial/getTrialSelect',
    method: 'get'
  })
}

export function getTrialInfo(trialId) {
  return request({
    url: `/trial/getTrialInfoAndLockState/${trialId}`,
    method: 'get'
  })
}

export function abandonTrial(trialId, IsDeleted) {
  return request({
    url: `/TrialConfig/abandonTrial/${trialId}/${IsDeleted}`,
    method: 'put'
  })
}

export function ifTrialCanOngoing(trialId) {
  return request({
    url: `/TrialConfig/ifTrialCanOngoing/${trialId}`,
    method: 'get'
  })
}

export function addOrUpdateTrial(param) {
  return request({
    url: '/trial/addOrUpdateTrial',
    method: 'post',
    data: param
  })
}

export function updateTrialStatus(trialId, statusStr) {
  return request({
    url: `/trial/updateTrialStatus/${trialId}/${statusStr}`,
    method: 'post'
  })
}

export function uploadReviewerAckSOW(trialId, param) {
  return request({
    url: `/doctorWorkload/uploadReviewerAckSOW/${trialId}`,
    method: 'post',
    data: param
  })
}

export function deleteReviewerAckSOW(trialId, doctorId, attachmentId) {
  return request({
    url: `/doctorWorkload/deleteReviewerAckSOW/${trialId}/${doctorId}/${attachmentId}`,
    method: 'delete'
  })
}

export function getTrialInfoAndMaxTrialState(trialId) {
  return request({
    url: `/trial/getTrialInfoAndMaxTrialState/${trialId}`,
    method: 'get'
  })
}

export function getSelectionReviewerList(param) {
  return request({
    url: `/doctorList/getSelectionReviewerList`,
    method: 'post',
    data: param
  })
}

export function selectReviewers(trialId, doctorIdArray) {
  return request({
    url: `/enroll/selectReviewers/${trialId}`,
    method: 'post',
    data: doctorIdArray
  })
}

export function getSubmissionOrApprovalReviewerList(param) {
  return request({
    url: `/doctorList/getSubmissionOrApprovalReviewerList`,
    method: 'post',
    data: param
  })
}

export function submitReviewer(trialId, doctorIdArray, commitState) {
  return request({
    url: `/enroll/submitReviewer/${trialId}/${commitState}`,
    method: 'post',
    data: doctorIdArray
  })
}

export function downloadResume(trialId, language, doctorIdArray) {
  return request({
    url: `/enroll/downloadResume/${trialId}/${language}`,
    method: 'post',
    data: doctorIdArray
  })
}

export function approveReviewer(trialId, doctorIdArray, auditState) {
  return request({
    url: `/enroll/approveReviewer/${trialId}/${auditState}`,
    method: 'post',
    data: doctorIdArray
  })
}

export function getConfirmationReviewerList(param) {
  return request({
    url: `/doctorList/getConfirmationReviewerList`,
    method: 'post',
    data: param
  })
}

export function confirmReviewer(params) {
  return request({
    url: `/enroll/confirmReviewer`,
    method: 'post',
    data: params
  })
}

export function getTrialEnrollmentWorkloadStats(param) {
  return request({
    url: '/doctorWorkload/getTrialEnrollmentWorkloadStats',
    method: 'post',
    data: param
  })
}

export function getDoctorWorkLoadList(param) {
  return request({
    url: `/doctorWorkload/getEnrollmentWorkloadStatsDetail`,
    method: 'post',
    data: param
  })
}

export function getReviewerWorkLoadListDetail(param) {
  return request({
    url: `/doctorWorkload/getReviewerWorkLoadListDetail`,
    method: 'post',
    data: param
  })
}

export function existWorkLoad(param) {
  return request({
    url: `/doctorWorkload/workloadExist`,
    method: 'post',
    data: param
  })
}

export function workLoadAddOrUpdate(param) {
  return request({
    url: `/doctorWorkload/workLoadAddOrUpdate`,
    method: 'post',
    data: param
  })
}

export function getTrialExpeditedState(trialId) {
  return request({
    url: `/Trial/getTrialExpeditedState/${trialId}`,
    method: 'get'
  })
}

export function deleteWorkLoad(id, trialId) {
  return request({
    url: `/doctorWorkload/deleteWorkLoad/${id}/${trialId}`,
    method: 'delete'
  })
}

export function getMaintenanceList(param) {
  return request({
    url: `/trialMaintenance/getMaintenanceUserList`,
    method: 'post',
    data: param
  })
}

export function getUserSelectionList(userTypeId, institutionId) {
  return request({
    url: `/trialMaintenance/getUserSelectionList/${userTypeId}/${institutionId}`,
    method: 'get'
  })
}

export function AddOrUpdateMaintenanceUser(param) {
  return request({
    url: `/trialMaintenance/AddOrUpdateMaintenanceUser`,
    method: 'post',
    data: param
  })
}

export function deleteMaintenanceUser(id, trialId, isDelete) {
  return request({
    url: `/trialMaintenance/deleteMaintenanceUser/${id}/${trialId}/${isDelete}`,
    method: 'delete'
  })
}

export function getSiteCRCList(param) {
  return request({
    url: `/trialMaintenance/getSiteCRCList`,
    method: 'post',
    data: param
  })
}

export function getInstitutionList(typeId) {
  return request({
    url: `/institution/getInstitutionList/${typeId}`,
    method: 'get'
  })
}

export function addOrUpdateSiteCRC(param) {
  return request({
    url: `/trialMaintenance/addOrUpdateSiteCRC`,
    method: 'post',
    data: param
  })
}

export function deleteSiteCRC(id, trialId, isDelete) {
  return request({
    url: `/trialMaintenance/deleteSiteCRC/${id}/${trialId}/${isDelete}`,
    method: 'delete'
  })
}

export function getTrialSiteCRCList(trialId, siteId) {
  return request({
    url: `/trialMaintenance/getTrialSiteCRCList/${trialId}/${siteId}`,
    method: 'get'
  })
}

export function trialUserListExport(param) {
  return requestDownload({
    url: `/ExcelExport/trialUserListExport`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

export function trialSiteUserListExport(param) {
  return requestDownload({
    url: `/ExcelExport/trialSiteUserListExport`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

export function trialSiteUserSummaryListExport(param) {
  return requestDownload({
    url: `/ExcelExport/trialSiteUserSummaryListExport`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

export function getVisitStageList(trialId) {
  return request({
    url: `/visitPlan/getVisitStageList/${trialId}`,
    method: 'get'
  })
}

export function addOrUpdateVisitStage(param) {
  return request({
    url: `/visitPlan/addOrUpdateVisitStage`,
    method: 'post',
    data: param
  })
}

export function deleteVisitStage(id, trialId) {
  return request({
    url: `/visitPlan/deleteVisitStage/${id}/${trialId}`,
    method: 'delete'
  })
}

export function getAcquisitionSpecificationList(trialId) {
  return request({
    url: `/specification/getSpecificationList/${trialId}`,
    method: 'get'
  })
}

export function addOrUpdateAcquisitionSpecification(param) {
  return request({
    url: `/specification/addOrUpdateSpecification`,
    method: 'post',
    data: param
  })
}

export function uploadTrialFile(file, type, trialId, config = {}) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `/TrialConfig/uploadTrialFile/${trialId}/${type}`,
    method: 'post',
    data: formData,
    ...config
  })
}

export function deleteAcquisitionSpecification(id, trialId) {
  return request({
    url: `/specification/deleteSpecification/${id}/${trialId}`,
    method: 'delete'
  })
}

export function getTrialVisitStageSelect(trialId) {
  return request({
    url: `/visitPlan/getTrialVisitStageSelect/${trialId}`,
    method: 'get'
  })
}

export function getTrialVisitSelect(trialId) {
  return request({
    url: `/visitPlan/getTrialVisitSelect/${trialId}`,
    method: 'get'
  })
}

export function getSubjectList(param) {
  return request({
    url: `/subject/getSubjectList`,
    method: 'post',
    data: param
  })
}

export function getTrialSiteSelect(trialId) {
  return request({
    url: `/trialMaintenance/getTrialSiteSelect/${trialId}`,
    method: 'get'
  })
}

export function getSubjectListBySiteId(siteId, trialId) {
  return request({
    url: `/subject/getSubjectListBySiteId/${siteId}/${trialId}`,
    method: 'get'
  })
}

export function getSubjectVisitSelectList(trialId, siteId, subjectId) {
  return request({
    url: `/subjectVisit/getSubjectVisitSelectList/${trialId}/${siteId}/${subjectId}`,
    method: 'get'
  })
}

export function addOrUpdateSubject(param) {
  return request({
    url: `/subject/addOrUpdateSubject`,
    method: 'post',
    data: param
  })
}

export function deleteSubject(trialId, id) {
  return request({
    url: `/subject/deleteSubject/${trialId}/${id}`,
    method: 'delete'
  })
}

export function getStudyStatList(trialId, subjectId, siteId) {
  return request({
    url: `/study/getStudyStatList/${trialId}/${subjectId}/${siteId}`,
    method: 'get'
  })
}

export function getStudyList(param) {
  return request({
    url: `/study/getStudyList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateStudy(param) {
  return request({
    url: `/study/addOrUpdateStudy`,
    method: 'post',
    data: param
  })
}

export function deleteStudy(id, trialId) {
  return request({
    url: `/study/deleteStudy/${id}/${trialId}`,
    method: 'delete'
  })
}

export function getSubjectVisitList(trialId, subjectId) {
  return request({
    url: `/subjectVisit/getSubjectVisitList/${trialId}/${subjectId}`,
    method: 'get'
  })
}

export function addOrUpdateSubjectVisit(param) {
  return request({
    url: `/subjectVisit/addOrUpdateSV`,
    method: 'post',
    data: param
  })
}
export function deleteSubjectVisit(trialId, id) {
  return request({
    url: `/subjectVisit/deleteSV/${trialId}/${id}`,
    method: 'delete'
  })
}

export function updateStudyBinding(param) {
  return request({
    url: `/study/updateStudyBinding`,
    method: 'post',
    data: param
  })
}

export function getQaTemplateSelectList() {
  return request({
    url: `/QATemplate/GetQaTemplateSelectList`,
    method: 'get'
  })
}

export function getQaTemplateItemsById(qaTemplateId) {
  return request({
    url: `/QATemplate/GetQaTemplateItemsById/${qaTemplateId}`,
    method: 'get'
  })
}

export function getQARecordList(studyId) {
  return request({
    url: `/QARecord/GetQARecordList/${studyId}`,
    method: 'get'
  })
}
export function getHistoryTemplateItemHasNoteList(qaRecordId) {
  return request({
    url: `/QARecord/GetHistoryTemplateItemHasNoteList/${qaRecordId}`,
    method: 'get'
  })
}

export function addOrUpdateQARecord(param, trialId) {
  return request({
    url: `/QARecord/AddOrUpdateQARecord/${trialId}`,
    method: 'post',
    data: param
  })
}

export function deleteQARecord(qaQARecordId, trialId) {
  return request({
    url: `/QARecord/DeleteQARecord/${qaQARecordId}/${trialId}`,
    method: 'delete'
  })
}

export function getQaRecordDialogList(qaRecordId) {
  return request({
    url: `/QARecord/GetQaRecordDialogList/${qaRecordId}`,
    method: 'get'
  })
}

export function addQAReply(param, trialId) {
  return request({
    url: `/QARecord/AddQAReply/${trialId}`,
    method: 'post',
    data: param
  })
}

export function deleteQAReplay(qaReplyId, trialId) {
  return request({
    url: `/QARecord/DeleteQAReply/${qaReplyId}/${trialId}`,
    method: 'delete'
  })
}

export function getReviewerList(trialId) {
  return request({
    url: `/study/GetReviewerList/${trialId}`,
    method: 'get'
  })
}

export function studyDistribution(param) {
  return request({
    url: `/study/studyDistribution`,
    method: 'post',
    data: param
  })
}

export function updateStudyStatus(param, trialId) {
  return request({
    url: `/study/updateStudyStatus/${trialId}`,
    method: 'post',
    data: param
  })
}

export function getStudyStatusDetailList(studyId) {
  return request({
    url: `/study/getStudyStatusDetailList/${studyId}`,
    method: 'get'
  })
}

export function getQANoticeList(studyId) {
  return request({
    url: `/study/getQANoticeList/${studyId}`,
    method: 'get'
  })
}

export function editStudyReviewer(param) {
  return request({
    url: `/study/editStudyReviewer`,
    method: 'post',
    data: param
  })
}

export function getDistributeStudyList(param) {
  return request({
    url: `/study/getDistributeStudyList`,
    method: 'post',
    data: param
  })
}

export function getWorkloadTPList(param) {
  return request({
    url: `/workloadDistribution/getWorkloadTPList`,
    method: 'post',
    data: param
  })
}

export function distributeTP(param) {
  return request({
    url: `/workloadDistribution/DistributeTP`,
    method: 'post',
    data: param
  })
}

export function updateDistributeTP(tpId, reviewerId, studyId) {
  return request({
    url: `/workloadDistribution/UpdateDistributeTP/${tpId}/${reviewerId}/${studyId}`,
    method: 'post'
  })
}

export function getWorkloadADList(param) {
  return request({
    url: `/workloadDistribution/getWorkloadADList`,
    method: 'post',
    data: param
  })
}

export function distributeAD(param) {
  return request({
    url: `/workloadDistribution/distributeAD`,
    method: 'post',
    data: param
  })
}

export function updateDistributeAD(tpId, reviewerId) {
  return request({
    url: `/workloadDistribution/updateDistributeAD/${tpId}/${reviewerId}`,
    method: 'post'

  })
}

export function getWorkloadGlobalList(param) {
  return request({
    url: `/workloadDistribution/getWorkloadGlobalList`,
    method: 'post',
    data: param
  })
}

export function distributeGlobal(param) {
  return request({
    url: `/workloadDistribution/distributeGlobal`,
    method: 'post',
    data: param
  })
}

export function updateDistributeGlobal(tpId, reviewerId, subjectId, visitNum) {
  return request({
    url: `/workloadDistribution/updateDistributeGlobal/${tpId}/${reviewerId}/${subjectId}/${visitNum}`,
    method: 'post'
  })
}

export function getWorkloadDetailList(workloadId) {
  return request({
    url: `/workloadDistribution/GetWorkloadDetailList/${workloadId}`,
    method: 'get'
  })
}

export function getWorkloadList(param) {
  return request({
    url: `/reading/getWorkloadList`,
    method: 'post',
    data: param
  })
}

export function updateReviewerReadingType(trialId, doctorId, reviewerReadingType) {
  return request({
    url: `/doctorWorkload/updateReviewerReadingType/${trialId}/${doctorId}/${reviewerReadingType}`,
    method: 'post'
  })
}

export function dicomAnonymize(studyId, trialId) {
  return request({
    url: `/study/dicomAnonymize/${studyId}/${trialId}`,
    method: 'post'
  })
}

export function verifyStudyAllowUpload(trialId, studyInstanceUid, abandonStudyId) {
  var url = ''
  if (abandonStudyId) {
    url = `/study/verifyStudyAllowUpload/${trialId}/${studyInstanceUid}/${abandonStudyId}`
  } else {
    url = `/study/verifyStudyAllowUpload/${trialId}/${studyInstanceUid}`
  }
  return request({
    url: url,
    method: 'get'
  })
}

export function batchVerifyStudyAllowUpload(param) {
  return request({
    url: `/study/verifyStudyAllowUpload`,
    method: 'post',
    data: param
  })
}

export function VerifySignature(userName, password) {
  return request({
    url: `/user/VerifySignature/${userName}/${password}`,
    method: 'get'
  })
}

export function getSeriesList(studyId) {
  return request({
    url: `/series/list/${studyId}`,
    method: 'get'
  })
}

export function getVisitList(param) {
  return request({
    url: `/subjectVisit/getVisitList`,
    method: 'post',
    data: param
  })
}

export function forwardStudy(studyId, trialId) {
  return request({
    url: `/study/forwardStudy/${studyId}/${trialId}`,
    method: 'get'
  })
}
export function deleteTrial(trialId) {
  return request({
    url: `/trial/deleteTrial/${trialId}`,
    method: 'delete'
  })
}

export function getTrialUserScreeningList(param) {
  return request({
    url: `/trialMaintenance/getTrialUserScreeningList`,
    method: 'post',
    data: param
  })
}

export function addTrialUsers(param) {
  return request({
    url: `/trialMaintenance/addTrialUsers`,
    method: 'post',
    data: param
  })
}

export function updateTrialUser(param) {
  return request({
    url: `/trialMaintenance/updateTrialUser`,
    method: 'put',
    data: param
  })
}

export function getSiteCRCSimpleList(param) {
  return request({
    url: `/trialMaintenance/getSiteCRCSimpleList`,
    method: 'post',
    data: param
  })
}

export function getTrialSiteScreeningList(param) {
  return request({
    url: `/trialMaintenance/getTrialSiteScreeningList`,
    method: 'post',
    data: param
  })
}

export function addTrialSites(param) {
  return request({
    url: `/trialMaintenance/addTrialSites`,
    method: 'post',
    data: param
  })
}

export function getSiteCRCScreeningList(param) {
  return request({
    url: `/trialMaintenance/getSiteCRCScreeningList`,
    method: 'post',
    data: param
  })
}

export function assignSiteCRC(param) {
  return request({
    url: `/trialMaintenance/assignSiteCRC`,
    method: 'post',
    data: param
  })
}

export function editTrialSite(param) {
  return request({
    url: `/TrialMaintenance/editTrialSite`,
    method: 'put',
    data: param
  })
}

export function deleteTrialSite(id, trialId) {
  return request({
    url: `/trialMaintenance/deleteTrialSite/${id}/${trialId}`,
    method: 'delete'
  })
}

export function getTrialVisitPlanConfirmed(trialId) {
  return request({
    url: `/trial/getTrialVisitPlanConfirmed/${trialId}`,
    method: 'get'
  })
}

export function getTrialQATemplateList(params) {
  return request({
    url: `/TrialQATemplate/GetTrialQATemplateList`,
    method: 'post',
    data: params
  })
}

export function getSystemQATemplateList(modalityId) {
  return request({
    url: `/TrialQATemplate/GetSystemQATemplateList/${modalityId}`,
    method: 'get'
  })
}

export function getTemplateItemInitList(params) {
  return request({
    url: `/TrialQATemplate/GetTemplateItemInitList`,
    method: 'post',
    data: params
  })
}

export function addOrUpdateTrialQATemplate(params) {
  return request({
    url: `/TrialQATemplate/AddOrUpdateTrialQATemplate`,
    method: 'post',
    data: params
  })
}

export function deleteTrialQATemplate(qaTrialTemplateId, trialId) {
  return request({
    url: `/TrialQATemplate/DeleteTrialQATemplate/${qaTrialTemplateId}/${trialId}`,
    method: 'delete'
  })
}

export function deleteTrialQATemplateItem(templateItemId) {
  return request({
    url: `/TrialQATemplate/deleteTrialQATemplateItem/${templateItemId}`,
    method: 'delete'
  })
}

export function getAuditList(params) {
  return request({
    url: `/log/getAuditList`,
    method: 'post',
    data: params
  })
}

export function getOptUserList(trialId) {
  return request({
    url: `/log/getOptUserList/${trialId}`,
    method: 'get'
  })
}

export function getTrialModalityList(trialId) {
  return request({
    url: `/trial/getTrialModalityList/${trialId}`,
    method: 'get'
  })
}

export function enrollBackOrOut(trialId, doctorId, optType, outEnrollTime) {
  return request({
    url: `/enroll/enrollBackOrOut/${trialId}/${doctorId}/${optType}`,
    method: 'post',
    params: outEnrollTime ? { outEnrollTime: outEnrollTime } : {}
  })
}

export function uploadDTF(trialId, siteId, subjectId, subjectVisitId, studyId, file, config = {}) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `/file/UploadDTF/${trialId}/${siteId}/${subjectId}/${subjectVisitId}/${studyId}`,
    method: 'post',
    data: formData,
    ...config
  })
}

export function getStudyDTFList(trialId, studyId) {
  return request({
    url: `/StudyDTF/getStudyDtfList/${trialId}/${studyId}`,
    method: 'get'
  })
}

export function deleteStudyDTF(trialId, studyDTFId) {
  return request({
    url: `/StudyDTF/deleteStudyDTF/${trialId}/${studyDTFId}`,
    method: 'delete'
  })
}

export function getTrialConfigInfo(trialId) {
  return request({
    url: `/TrialConfig/getTrialConfigInfo/${trialId}`,
    method: 'get'
  })
}

export function configTrial(param) {
  return request({
    url: `/TrialConfig/configTrial`,
    method: 'post',
    data: param
  })
}

export function getQuestionTypeList(trialId) {
  return request({
    url: `/TrialQATemplate/getQuestionTypeList/${trialId}`,
    method: 'get'
  })
}

export function getTrialQCQuestionConfigureList(param) {
  return request({
    url: `/TrialQCQuestionConfigure/getTrialQCQuestionConfigureList`,
    method: 'post',
    data: param
  })
}

export function deleteTrialQCQuestionConfigure(trialId, id) {
  return request({
    url: `/TrialQCQuestionConfigure/deleteTrialQCQuestionConfigure/${trialId}/${id}`,
    method: 'delete'
  })
}

export function batchAddTrialQCQuestionConfigure(trialId, param) {
  return request({
    url: `/TrialQCQuestionConfigure/batchAddTrialQCQuestionConfigure/${trialId}`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateTrialQCQuestionConfigure(param) {
  return request({
    url: `/TrialQCQuestionConfigure/addOrUpdateTrialQCQuestionConfigure`,
    method: 'post',
    data: param
  })
}

export function takeOrReleaseQCTask(trialId, subjectVisitId, obtainOrCancel) {
  return request({
    url: `/QCOperation/obtainOrCancelQCTask/${trialId}/${subjectVisitId}/${obtainOrCancel}`,
    method: 'put'
  })
}
export function replaceQCTaskActionUser(trialId, subjectVisitId) {
  return request({
    url: `/QCOperation/replaceQCTaskActionUser/${trialId}/${subjectVisitId}`,
    method: 'put'
  })
}

export function verifyReuploadIsCanJump(trialId, qcChallengeId) {
  return request({
    url: `/QCOperation/verifyReuploadIsCanJump/${trialId}/${qcChallengeId}`,
    method: 'get'
  })
}

export function currentUserCanQC(subjectVisitId,) {
  return request({
    url: `/SubjectVisit/currentUserCanQC/${subjectVisitId}`,
    method: 'post'
  })
}

export function updateSubjectVisitState(trialId, subjectVisitId, postVisitState) {
  return request({
    url: `/SubjectVisit/updateSubjectVisitState/${trialId}/${subjectVisitId}/${postVisitState}`,
    method: 'post'
  })
}

export function getCRCVisitList(param) {
  return request({
    url: `/QCList/getCRCVisitList`,
    method: 'post',
    data: param
  })
}

export function verifyCRCRequestToQC(param) {
  return request({
    url: `/QCOperation/verifyCRCRequestToQC`,
    method: 'post',
    data: param
  })
}
export function cRCBulkRequestToQC(param) {
  return request({
    url: `/QCOperation/cRCRequestToQC`,
    method: 'post',
    data: param
  })
}

export function getCRCChallengeList(param) {
  return request({
    url: `/QCList/getCRCChallengeList`,
    method: 'post',
    data: param
  })
}

export function getQCVisitList(param) {
  return request({
    url: `/QCList/getQCVisitList`,
    method: 'post',
    data: param
  })
}

export function getQCChallengeList(param) {
  return request({
    url: `/QCList/getQCChallengeList`,
    method: 'post',
    data: param
  })
}

export function getVisitQCInfo(subjectVisitId, trialQCProcess, currentQCType) {
  return request({
    url: `/QCList/getVisitQCInfo/${subjectVisitId}/${trialQCProcess}/${currentQCType}`,
    method: 'get'
  })
}

export function getQCQuestionAnswerList(trialId, subjectVisitId, trialQCProcess, currentQCType) {
  return request({
    url: `/QCList/getQCQuestionAnswerList/${trialId}/${subjectVisitId}/${trialQCProcess}/${currentQCType}`,
    method: 'get'
  })
}

export function getQCQuestionAnswer(param) {
  return request({
    url: `/QCList/getQCQuestionAnswer`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateQCQuestionAnswerList(trialId, subjectVisitId, trialQCProcess, currentQCType, param) {
  return request({
    url: `/QCOperation/addOrUpdateQCQuestionAnswerList/${trialId}/${subjectVisitId}/${trialQCProcess}/${currentQCType}`,
    method: 'post',
    data: param
  })
}

export function setSeriesStatus(trialId, subjectVisitId, studyId, seriesId, state) {
  return request({
    url: `/QCOperation/setSeriesState/${trialId}/${subjectVisitId}/${studyId}/${seriesId}/${state}`,
    method: 'put'
  })
}

export function getVisitQCStudyAndSeriesList(subjectVisitId) {
  return request({
    url: `/QCList/getVisitQCStudyAndSeriesList/${subjectVisitId}`,
    method: 'get'
  })
}

export function addOrUpdateQCChallenge(trialId, trialQCProcess, currentQCType, param) {
  return request({
    url: `/QCOperation/addOrUpdateQCChallenge/${trialId}/${trialQCProcess}/${currentQCType}`,
    method: 'post',
    data: param
  })
}

export function getHistoryChallengeList(subjectVisitId, trialQCProcess, currentQCType) {
  return request({
    url: `/QCList/getHistoryChallengeList/${subjectVisitId}/${trialQCProcess}/${currentQCType}`,
    method: 'get'
  })
}

export function getQCChallengeDialogList(qaChallengeId) {
  return request({
    url: `/QCList/getQCChallengeDialogList/${qaChallengeId}`,
    method: 'get'
  })
}

export function addQCChallengeReply(trialId, param) {
  return request({
    url: `/QCOperation/addQCChallengeReply/${trialId}`,
    method: 'post',
    data: param
  })
}

export function qCCheckPassedOrFailed(trialId, subjectVisitId, signCodeId, auditState) {
  return request({
    url: `/QCOperation/qCPassedOrFailed/${trialId}/${subjectVisitId}/${signCodeId}/${auditState}`,
    method: 'post'
  })
}

export function closeQCChallenge(param) {
  return request({
    url: `/QCOperation/closeQCChallenge`,
    method: 'put',
    data: param
  })
}

export function getSubjectVisitUploadedStudyList(subjectVisitId) {
  return request({
    url: `/QCList/getSubjectVisitUploadedStudyList/${subjectVisitId}`,
    method: 'get'
  })
}

export function deleteStudyList(trialId, subjectVisitId, param) {
  return request({
    url: `/QCOperation/deleteStudyList/${trialId}/${subjectVisitId}`,
    method: 'post',
    data: param
  })
}

export function updateModality(trialId, param) {
  return request({
    url: `/QCOperation/updateModality/${trialId}`,
    method: 'post',
    data: param
  })
}

export function getConsistencyVerificationList(param) {
  return request({
    url: `/QCList/getConsistencyVerificationList`,
    method: 'post',
    data: param
  })
}

export function getCheckChallengeDialogList(subjectVisitId) {
  return request({
    url: `/QCList/getCheckChallengeDialogList/${subjectVisitId}`,
    method: 'get'
  })
}

export function addCheckChallengeReply(trialId, param) {
  return request({
    url: `/QCOperation/addCheckChallengeReply/${trialId}`,
    method: 'post',
    data: param
  })
}

export function closeCheckChallenge(trialId, param) {
  return request({
    url: `/QCOperation/closeCheckChallenge/${trialId}`,
    method: 'put',
    data: param
  })
}

export function setCheckPass(trialId, param) {
  return request({
    url: `/QCOperation/setCheckPass/${trialId}`,
    method: 'put',
    data: param
  })
}

export function checkBack(trialId, signId, subjectVisitId) {
  return request({
    url: `/QCOperation/checkBack/${trialId}/${signId}/${subjectVisitId}`,
    method: 'put'
  })
}

export function cRCRequstCheckBack(trialId, subjectVisitId) {
  return request({
    url: `/QCOperation/cRCRequstCheckBack/${trialId}/${subjectVisitId}`,
    method: 'put'
  })
}

export function getCRCVisitChallengeAndDialog(subjectVisitId, trialQCProcess) {
  return request({
    url: `/QCList/getCRCVisitChallengeAndDialog/${subjectVisitId}/${trialQCProcess}`,
    method: 'get'
  })
}

export function uploadVisitCheckExcel(trialId, file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `/QCOperation/UploadVisitCheckExcel/${trialId}`,
    method: 'post',
    data: formData
  })
}

export function getSubjectClinicalData(subjectVisitId) {
  return request({
    url: `/ClinicalData/getSubjectVisitClinicalData/${subjectVisitId}`,
    method: 'get'
  })
}

export function uploadVisitClinicalData(trialId, subjectVisitId, file) {
  return request({
    url: `/ClinicalData/uploadVisitClinicalData/${trialId}/${subjectVisitId}`,
    method: 'post',
    data: file
  })
}

export function addOrUpdatePreviousHistory(trialId, param) {
  return request({
    url: `/ClinicalData/addOrUpdatePreviousHistory/${trialId}`,
    method: 'post',
    data: param
  })
}

export function deletePreviousHistory(trialId, subjectVisitId, previousHistoryId) {
  return request({
    url: `/ClinicalData/deletePreviousHistory/${trialId}/${subjectVisitId}/${previousHistoryId}`,
    method: 'delete'
  })
}

export function addOrUpdatePreviousOther(trialId, param) {
  return request({
    url: `/ClinicalData/addOrUpdatePreviousOther/${trialId}`,
    method: 'post',
    data: param
  })
}

export function deletePreviousOther(trialId, subjectVisitId, previousOtherId) {
  return request({
    url: `/ClinicalData/deletePreviousOther/${trialId}/${subjectVisitId}/${previousOtherId}`,
    method: 'delete'
  })
}

export function addOrUpdatePreviousSurgery(trialId, param) {
  return request({
    url: `/ClinicalData/addOrUpdatePreviousSurgery/${trialId}`,
    method: 'post',
    data: param
  })
}

export function deletePreviousSurgery(trialId, subjectVisitId, id) {
  return request({
    url: `/ClinicalData/deletePreviousSurgery/${trialId}/${subjectVisitId}/${id}`,
    method: 'delete'
  })
}

export function deletePreviousPDF(trialId, subjectVisitId, id) {
  return request({
    url: `/ClinicalData/deletePreviousPDF/${trialId}/${subjectVisitId}/${id}`,
    method: 'delete'
  })
}

export function signClinicalData(trialId, subjectVisitId) {
  return request({
    url: `/ClinicalData/signClinicalData/${trialId}/${subjectVisitId}`,
    method: 'put'
  })
}

export function setNeedReupload(trialId, subjectVisitId, qaChallengeId) {
  return request({
    url: `/QCOperation/setNeedReupload/${trialId}/${subjectVisitId}/${qaChallengeId}`,
    method: 'put'
  })
}

export function cRCRequestReUpload(trialId, subjectVisitId, qaChallengeId) {
  return request({
    url: `/QCOperation/cRCRequestReUpload/${trialId}/${subjectVisitId}/${qaChallengeId}`,
    method: 'put'
  })
}

export function setVisitUrgent(trialId, subjectVisitId, setOrCancel) {
  return request({
    url: `/QCOperation/setVisitUrgent/${trialId}/${subjectVisitId}/${setOrCancel}`,
    method: 'put'
  })
}

export function getQCChallengeCreatorList(trialId) {
  return request({
    url: `/QCList/getQCChallengeCreatorList/${trialId}`,
    method: 'get'
  })
}

export function updateSubjectAndSVInfo(trialId, param) {
  return request({
    url: `/QCOperation/updateSubjectAndSVInfo/${trialId}`,
    method: 'put',
    data: param
  })
}
export function getSubjectVisitSelectOptions(subjectId) {
  return request({
    url: `/QCList/getSubjectVisitSelectList/${subjectId}`,
    method: 'get'
  })
}

export function verifyCanQCPassedOrFailed(trialId, subjectvisitId) {
  return request({
    url: `/QCOperation/verifyCanQCPassedOrFailed/${trialId}/${subjectvisitId}`,
    method: 'get'
  })
}

export function setReuploadFinished(param) {
  return request({
    url: `/QCOperation/setReuploadFinished`,
    method: 'post',
    data: param
  })
}

export function getForwardList(param) {
  return request({
    url: `/QCList/getForwardList`,
    method: 'post',
    data: param
  })
}

export function getNoneDicomStudyList(subjectVisitId, sudyId = '') {
  return request({
    url: `/NoneDicomStudy/getNoneDicomStudyList?subjectVisitId=${subjectVisitId}&nonedicomStudyId=${sudyId}`,
    method: 'get'
  })
}

export function addOrUpdateNoneDicomStudy(param) {
  return request({
    url: `/NoneDicomStudy/addOrUpdateNoneDicomStudy`,
    method: 'post',
    data: param
  })
}

export function deleteNoneDicomStudy(trialId, subjectVisitId, id) {
  return request({
    url: `/NoneDicomStudy/deleteNoneDicomStudy/${trialId}/${subjectVisitId}/${id}`,
    method: 'delete'
  })
}

export function getNoneDicomStudyFileList(nonDicomStudyId) {
  return request({
    url: `/NoneDicomStudy/getNoneDicomStudyFileList/${nonDicomStudyId}`,
    method: 'get'
  })
}

export function getVisitNoneDicomStudyFileList(subjectVisitId) {
  return request({
    url: `/NoneDicomStudy/getVisitNoneDicomStudyFileList/${subjectVisitId}`,
    method: 'get'
  })
}

// export function uploadNoneDicomFile(trialId, subjectVisitId, nonDicomStudyId, fileData, studyMonitorId) {
//   return request({
//     url: `/NoneDicomStudy/uploadNoneDicomFile/${trialId}/${subjectVisitId}/${nonDicomStudyId}/${studyMonitorId}`,
//     method: 'post',
//     data: fileData
//   })
// }

export function uploadNoneDicomFile(params) {
  return request({
    url: `/NoneDicomStudy/uploadNoneDicomFile`,
    method: 'post',
    data: params
  })
}

export function deleteNoneDicomStudyFile(trialId, subjectVisitId, id) {
  return request({
    url: `/NoneDicomStudy/deleteNoneDicomStudyFile/${trialId}/${subjectVisitId}/${id}`,
    method: 'delete'
  })
}

export function getGenerateTrialCodeDic() {
  return request({
    url: `/Dictionary/getGenerateTrialCodeDic`,
    method: 'get'
  })
}

export function getQCParticipantList(trialId) {
  return request({
    url: `/QCList/getQCParticipantList/${trialId}`,
    method: 'get'
  })
}

export function getUserTypeList(type) {
  return request({
    url: `/UserTypeRole/getUserTypeList${type ? '/' + type : ''}`,
    method: 'get'
  })
}

export function confirmTrialVisitPlan(trialId) {
  return request({
    url: `/VisitPlan/confirmTrialVisitPlan/${trialId}`,
    method: 'post'
  })
}
export function getInfluenceHistoryList(trialId) {
  return request({
    url: `/VisitPlan/getInfluenceHistoryList/${trialId}`,
    method: 'get'
  })
}
export function downloadInflunceStudyList(id) {
  return requestDownload({
    url: `/VisitPlan/downloadInflunceStudyList/${id}`,
    method: 'get',
    responseType: 'blob'
  })
}

export function getTrialSiteSurveyList(param) {
  return request({
    url: `/TrialSiteSurvey/getTrialSiteSurveyList`,
    method: 'post',
    data: param
  })
}

export function trialSiteSurveyUserList(param) {
  return request({
    url: `/TrialSiteSurvey/trialSiteSurveyUserList`,
    method: 'post',
    data: param
  })
}
export function sendInviteEmails(param) {
  return request({
    url: `/TrialSiteSurvey/sendInviteEmail`,
    method: 'post',
    data: param
  })
}

export function sendSiteSurveyUserJoinEmail(param) {
  return request({
    url: `/TrialSiteSurvey/sendSiteSurveyUserJoinEmail`,
    method: 'post',
    data: param
  })
}

export function abandonSiteSurvey(trialId, trialSiteSurveyId) {
  return request({
    url: `/TrialSiteSurvey/abandonSiteSurvey/${trialId}/${trialSiteSurveyId}`,
    method: 'put'
  })
}

export function getTrialDocumentList(param) {
  return request({
    url: `/TrialDocument/getTrialDocumentList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateTrialDocument(param) {
  return request({
    url: `/TrialDocument/addOrUpdateTrialDocument`,
    method: 'post',
    data: param
  })
}
export function deleteTrialDocument(trialId, id) {
  return request({
    url: `/TrialDocument/deleteTrialDocument/${trialId}/${id}`,
    method: 'delete'
  })
}

export function userConfirm(param) {
  return request({
    url: `/TrialDocument/userConfirm`,
    method: 'post',
    data: param
  })
}

export function setFirstViewDocumentTime(trialId, trialDocumentId, isSystemDoc) {
  return request({
    url: `/TrialDocument/setFirstViewDocumentTime/${trialId}/${trialDocumentId}/${isSystemDoc}`,
    method: 'put'
  })
}

export function setSystemDocFirstViewTime(documentId) {
  return request({
    url: `/TrialDocument/setSystemDocFirstViewTime/${documentId}`,
    method: 'put'
  })
}

export function uploadTrialDoc(trialId, file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `/TrialDocument/UploadTrialDoc/${trialId}`,
    method: 'post',
    data: formData
  })
}

export function getTrialDocuments(trialId) {
  return request({
    url: `/TrialDocument/getTrialDocumentList/${trialId}`,
    method: 'get'
  })
}

export function addSystemDocuments(trialId, param) {
  return request({
    url: `/TrialDocument/addSystemDocuments/${trialId}`,
    method: 'post',
    data: param
  })
}

export function getTrialUserTypeList() {
  return request({
    url: `/UserTypeRole/getTrialUserTypeList`,
    method: 'get'
  })
}

export function getUserDocumentList(param) {
  return request({
    url: `/TrialDocument/getUserDocumentList`,
    method: 'post',
    data: param
  })
}

export function getDocumentConfirmList(param) {
  return request({
    url: `/TrialDocument/getDocumentConfirmList`,
    method: 'post',
    data: param
  })
}
export function getTrialUserSelect(trialId) {
  return request({
    url: `/TrialDocument/getTrialUserSelect/${trialId}`,
    method: 'get'
  })
}

export function getTrialDocAndSystemDocType(trialId) {
  return request({
    url: `/TrialDocument/getTrialDocAndSystemDocType/${trialId}`,
    method: 'get'
  })
}

export function updateSubjectStatus(param) {
  return request({
    url: `/Subject/updateSubjectStatus`,
    method: 'put',
    data: param
  })
}

export function userAbandonDoc(documentId, isSystemDoc) {
  return request({
    url: `/TrialDocument/userAbandonDoc/${documentId}/${isSystemDoc}`,
    method: 'put'
  })
}

export function verifyQCCanAddChallenge(trialId, subjectVisitId, currentQCType) {
  return request({
    url: `/QCOperation/VerifyQCCanAddChallenge/${trialId}/${subjectVisitId}/${currentQCType}`,
    method: 'get'
  })
}

export function setSubjectVisitUrgent(trialId, subjectVisitId, isUrgent) {
  return request({
    url: `/SubjectVisit/SetSubjectVisitUrgent/${trialId}/${subjectVisitId}/${isUrgent}`,
    method: 'put'
  })
}

export function configTrialBasicInfo(param) {
  return request({
    url: `/TrialConfig/configTrialBasicInfo`,
    method: 'put',
    data: param
  })
}

export function configTrialProcessInfo(param) {
  return request({
    url: `/TrialConfig/configTrialProcessInfo`,
    method: 'put',
    data: param
  })
}
export function configTrialUrgentInfo(param) {
  return request({
    url: `/TrialConfig/configTrialUrgentInfo`,
    method: 'put',
    data: param
  })
}

export function getTrialQCQuestionSelectList(param) {
  return request({
    url: `/TrialQCQuestionConfigure/getTrialQCQuestionSelectList`,
    method: 'post',
    data: param
  })
}
export function getSignText(signCode) {
  return request({
    url: `/TrialConfig/getSignText/${signCode}`,
    method: 'get'
  })
}
export function verifySignature(param) {
  return request({
    url: `/TrialConfig/verifySignature`,
    method: 'post',
    data: param
  })
}

export function confirmQCQuestion(trialId) {
  return request({
    url: `/TrialConfig/confirmQCQuestion/${trialId}`,
    method: 'put'
  })
}

export function updateTrialState(trialId, trialStatusStr, reason) {
  return request({
    url: `/TrialConfig/updateTrialState/${trialId}/${trialStatusStr}/${reason}`,
    method: 'put'
  })
}

export function trialConfigSignatureConfirm(param) {
  return request({
    url: `/TrialConfig/trialConfigSignatureConfirm`,
    method: 'post',
    data: param
  })
}

export function getUserIsHaveDocumentNeedSign(trialId) {
  return request({
    url: `/TrialDocument/getUserIsHaveDocumentNeedSign/${trialId}`,
    method: 'get'
  })
}

export function getDicomAndNoneDicomStudyList(param) {
  return request({
    url: `/study/getDicomAndNoneDicomStudyList`,
    method: 'post',
    data: param
  })
}

export function getTrialExternalUserList(param) {
  return request({
    url: `/TrialExternalUser/getTrialExternalUserList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateTrialExternalUser(param) {
  return request({
    url: `/TrialExternalUser/addOrUpdateTrialExternalUser`,
    method: 'post',
    data: param
  })
}

export function verifyUserIsCanAddOrUpdate(param) {
  return request({
    url: `/TrialExternalUser/verifyUserIsCanAddOrUpdate`,
    method: 'post',
    data: param
  })
}

export function sendInviteEmail(param) {
  return request({
    url: `/TrialExternalUser/sendInviteEmail`,
    method: 'post',
    data: param
  })
}

export function deleteTrialExternalUser(id) {
  return request({
    url: `/TrialExternalUser/deleteTrialExternalUser/${id}`,
    method: 'delete'
  })
}
export function getBasicStat() {
  return request({
    url: `/PersonalWorkstation/getBasicStat`,
    method: 'get'
  })
}

export function getTrialDocStatList(param) {
  return request({
    url: `/PersonalWorkstation/getTrialDocStatList`,
    method: 'post',
    data: param
  })
}

export function getSiteSurveyApprovalList(param) {
  return request({
    url: `/PersonalWorkstation/getSiteSurveyApprovalList`,
    method: 'post',
    data: param
  })
}

export function getWaitSignSysDocList(param) {
  return request({
    url: `/SystemDocument/getWaitSignSysDocList`,
    method: 'post',
    data: param
  })
}

export function forwardSVDicomImage(trialId, param) {
  return request({
    url: `/QCOperation/forwardSVDicomImage/${trialId}`,
    method: 'post',
    data: param
  })
}

export function getDicomAndNoneDicomStudyMonitorList(param) {
  return request({
    url: `/Study/getDicomAndNoneDicomStudyMonitorList`,
    method: 'post',
    data: param
  })
}

export function isQCCanOpt(subjectVisitId) {
  return request({
    url: `/QCOperation/isQCCanOpt?subjectVisitId=${subjectVisitId}`,
    method: 'get'
  })
}

export function rejectCheckBack(trialId, subjectVisitId) {
  return request({
    url: `/QCOperation/rejectCheckBack/${trialId}/${subjectVisitId}`,
    method: 'put'
  })
}

export function sendExternalUserJoinEmail(param) {
  return request({
    url: `/TrialExternalUser/sendExternalUserJoinEmail`,
    method: 'post',
    data: param
  })
}

export function getReadModuleList(param) {
  return request({
    url: `/ReadModule/getReadModuleList`,
    method: 'post',
    data: param
  })
}

export function getReadingPeriodSetList(param) {
  return request({
    url: `/ReadingPeriodSet/getReadingPeriodSetList`,
    method: 'post',
    data: param
  })
}
export function addOrUpdateReadingPeriodSet(param) {
  return request({
    url: `/ReadingPeriodSet/addOrUpdateReadingPeriodSet`,
    method: 'post',
    data: param
  })
}
export function deleteReadingPeriodSet(id) {
  return request({
    url: `/ReadingPeriodSet/deleteReadingPeriodSet/${id}`,
    method: 'delete'
  })
}
export function getClinicalDataList(param) {
  return request({
    url: `/ClinicalData/getClinicalDataList`,
    method: 'post',
    data: param
  })
}

export function uploadClinicalDataFile(trialId, id, isVisit, file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `/ClinicalData/UploadClinicalData/${trialId}/${id}/${isVisit}`,
    method: 'post',
    data: formData
  })
}

// export function addOrUpdateReadingPreviousPDF(param) {
//   return request({
//     url: `/PreviousPDF/addOrUpdateReadingPreviousPDF`,
//     method: 'post',
//     data: param
//   })
// }

// export function getPreviousPDFList(param) {
//   return request({
//     url: `/PreviousPDF/getPreviousPDFList`,
//     method: 'post',
//     data: param
//   })
// }

export function getReadingClinicalDataList(param) {
  return request({
    url: `/ReadingClinicalData/getReadingClinicalDataList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateReadingClinicalData(param) {
  return request({
    url: `/ReadingClinicalData/addOrUpdateReadingClinicalData`,
    method: 'post',
    data: param
  })
}

export function deleteReadingClinicalData(id) {
  return request({
    url: `/ReadingClinicalData/deleteReadingClinicalData/${id}`,
    method: 'delete'
  })
}

export function deleteReadingClinicalDataPDF(id) {
  return request({
    url: `/ReadingClinicalData/deleteReadingClinicalDataPDF/${id}`,
    method: 'delete'
  })
}

export function ReadClinicalDataSign(param) {
  return request({
    url: `/Inspection/ReadClinicalData/ReadClinicalDataSign`,
    method: 'post',
    data: param
  })
}
export function uploadClinicalData(trialId, subjectId, readingId, param) {
  return request({
    url: `/ClinicalData/UploadClinicalData/${trialId}/${subjectId}/${readingId}`,
    method: 'post',
    data: param
  })
}
export function setReadingPeriodSetEffect(param) {
  return request({
    url: `/ReadingPeriodSet/setReadingPeriodSetEffect`,
    method: 'put',
    data: param
  })
}
export function deleteReadModule(id) {
  return request({
    url: `/ReadModule/deleteReadModule/${id}`,
    method: 'delete'
  })
}
export function addReadModule(param) {
  return request({
    url: `/ReadModule/addReadModule`,
    method: 'post',
    data: param
  })
}
export function getPreviewTheReadingList(param) {
  return request({
    url: `/ReadingPeriodSet/getPreviewTheReadingList`,
    method: 'post',
    data: param
  })
}

export function getPreviewTheReadingPlanList(param) {
  return request({
    url: `/ReadingPeriodSet/getPreviewTheReadingPlanList`,
    method: 'post',
    data: param
  })
}

export function generateReadingTask(param) {
  return request({
    url: `/ReadingPeriodSet/generateReadingTask`,
    method: 'post',
    data: param
  })
}

export function getSubjectReadVisitList(id, subjectId, TrialReadingCriterionId) {
  return request({
    url: `/ReadModule/getSubjectReadVisitList?ReadingSetType=${id}&SubjectId=${subjectId}&TrialReadingCriterionId=${TrialReadingCriterionId}`,
    method: 'get'
  })
}

export function getReadModule(param) {
  return request({
    url: `/ReadModule/getReadModule`,
    method: 'post',
    data: param
  })
}

export function getVisitTaskList(param) {
  return request({
    url: `/VisitTask/getVisitTaskList`,
    method: 'post',
    data: param
  })
}

export function getReadingVisitList(param) {
  return request({
    url: `/ReadingPeriodSet/getReadingVisitList`,
    method: 'post',
    data: param
  })
}

export function getTrialClinicalDataTrialSetList(param) {
  return request({
    url: `/ClinicalDataSet/getTrialClinicalDataTrialSetList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateClinicalDataTrialSet(param) {
  return request({
    url: `/ClinicalDataSet/addOrUpdateClinicalDataTrialSet`,
    method: 'post',
    data: param
  })
}

export function deleteClinicalTrialSetData(id) {
  return request({
    url: `/ClinicalDataSet/deleteClinicalTrialSetData/${id}`,
    method: 'delete'
  })
}

export function setClinicalDataCheckd(param) {
  return request({
    url: `/ClinicalDataSet/setClinicalDataCheckd`,
    method: 'post',
    data: param
  })
}

export function getTrialClinicalDataSelect(param) {
  return request({
    url: `/ReadingClinicalData/getTrialClinicalDataSelect`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateReadingQuestionCriterionTrial(param) {
  return request({
    url: `/ReadingQuestion/addOrUpdateReadingQuestionCriterionTrial`,
    method: 'post',
    data: param
  })
}

export function getReadingQuestionCriterionTrialList(param) {
  return request({
    url: `/ReadingQuestion/getReadingQuestionCriterionTrialList`,
    method: 'post',
    data: param
  })
}

export function deleteReadingQuestionCriterionTrial(id) {
  return request({
    url: `/ReadingQuestion/deleteReadingQuestionCriterionTrial/${id}`,
    method: 'delete'
  })
}

export function getReadingQuestionTrialList(param) {
  return request({
    url: `/ReadingQuestion/getReadingQuestionTrialList`,
    method: 'post',
    data: param
  })
}
export function deleteReadingQuestionTrial(id) {
  return request({
    url: `/ReadingQuestion/deleteReadingQuestionTrial/${id}`,
    method: 'delete'
  })
}

export function addOrUpdateReadingQuestionTrial(param) {
  return request({
    url: `/ReadingQuestion/addOrUpdateReadingQuestionTrial`,
    method: 'post',
    data: param
  })
}

export function getTrialCriterionOtherQuestion(param) {
  return request({
    url: `/ReadingQuestion/getTrialCriterionOtherQuestion`,
    method: 'post',
    data: param
  })
}

export function getIRUnReadSubjectTaskList(param) {
  return request({
    url: `/VisitTask/getIRUnReadSubjectTaskList`,
    method: 'post',
    data: param
  })
}

export function setTrialReadingQuestionCriterionIsIsCompleteConfig(param) {
  return request({
    url: `/ReadingQuestion/setTrialReadingQuestionCriterionIsIsCompleteConfig`,
    method: 'post',
    data: param
  })
}

export function getTrialGroupNameList(param) {
  return request({
    url: `/ReadingQuestion/getTrialGroupNameList`,
    method: 'post',
    data: param
  })
}

export function getIRHaveReadTaskList(param) {
  return request({
    url: `/VisitTask/getIRHaveReadTaskList`,
    method: 'post',
    data: param
  })
}

export function getIRReReadingTaskList(param) {
  return request({
    url: `/VisitTask/getIRReReadingTaskList`,
    method: 'post',
    data: param
  })
}

export function getReadingImageFile(param) {
  return request({
    url: `/ReadingImageTask/getReadingImageFile`,
    method: 'post',
    data: param
  })
}

export function getTrialConfirmCriterionList(param) {
  return request({
    url: `/ReadingImageTask/getTrialConfirmCriterionList`,
    method: 'post',
    data: param
  })
}

export function getTrialReadingQuestion(param) {
  return request({
    url: `/ReadingImageTask/getTrialReadingQuestion`,
    method: 'post',
    data: param
  })
}

export function submitVisitTaskQuestionsInDto(param) {
  return request({
    url: `/Inspection/ReadingImageTask/SubmitVisitTaskQuestions`,
    method: 'post',
    data: param
  })
}

export function saveVisitTaskQuestions(param) {
  return request({
    url: `/ReadingImageTask/saveVisitTaskQuestions`,
    method: 'post',
    data: param
  })
}

export function getJudgeReadingInfo(param) {
  return request({
    url: `/ReadingImageTask/getJudgeReadingInfo`,
    method: 'post',
    data: param
  })
}

export function saveJudgeVisitTaskResult(param) {
  return request({
    url: `/ReadingImageTask/SaveJudgeVisitTaskResult`,
    method: 'post',
    data: param
  })
}

export function submitJudgeVisitTaskResult(param) {
  return request({
    url: `/Inspection/ReadingImageTask/SubmitJudgeVisitTaskResult`,
    method: 'post',
    data: param
  })
}

export function getReadingPastResultList(param) {
  return request({
    url: `/ReadingImageTask/getReadingPastResultList`,
    method: 'post',
    data: param
  })
}
export function uploadClinicalTemplate(file, trialId) {
  const formData = new FormData()
  formData.append('file', file)

  return request({
    url: trialId ? `/ClinicalData/UploadClinicalTemplate?trialId=${trialId}` : `/ClinicalData/UploadClinicalTemplate`,
    method: 'post',
    data: formData
  })
}

export function getCRCClinicalData(param) {
  return request({
    url: `/ReadingClinicalData/getCRCClinicalData`,
    method: 'post',
    data: param
  })
}

export function DownloadTrialClinicalFile(clinicalDataTrialSetId) {
  return requestDownload({
    url: `/CommonDocument/DownloadTrialClinicalFile?clinicalDataTrialSetId=${clinicalDataTrialSetId}`,
    method: 'get',
    responseType: 'blob'
  })
}

export function getMIMMedicalReviewTaskList(param) {
  return request({
    url: `/TaskMedicalReview/getMIMMedicalReviewTaskList`,
    method: 'post',
    data: param
  })
}

export function getReadingMedicineTrialQuestionList(param) {
  return request({
    url: `/ReadingMedicineQuestion/getReadingMedicineTrialQuestionList`,
    method: 'post',
    data: param
  })
}
export function addTrialDataFromSystem(param) {
  return request({
    url: `/ReadingMedicineQuestion/addTrialDataFromSystem`,
    method: 'post',
    data: param
  })
}
export function getReadingMedicineTrialOtherQuestion(param) {
  return request({
    url: `/ReadingMedicineQuestion/getReadingMedicineTrialOtherQuestion`,
    method: 'post',
    data: param
  })
}
export function addOrUpdateReadingMedicineTrialQuestion(param) {
  return request({
    url: `/ReadingMedicineQuestion/addOrUpdateReadingMedicineTrialQuestion`,
    method: 'post',
    data: param
  })
}

export function deleteReadingMedicineTrialQuestion(param) {
  return request({
    url: `/ReadingMedicineQuestion/deleteReadingMedicineTrialQuestion`,
    method: 'post',
    data: param
  })
}
export function getReadingOrTaskClinicalDataList(param) {
  return request({
    url: `/ReadingClinicalData/getReadingOrTaskClinicalDataList`,
    method: 'post',
    data: param
  })
}
export function getMedicineQuestionPreview(param) {
  return request({
    url: `/ReadingMedicineQuestion/getMedicineQuestionPreview`,
    method: 'post',
    data: param
  })
}

export function confirmReadingMedicineQuestion(param) {
  return request({
    url: `/Inspection/ReadingMedicineQuestion/ConfirmReadingMedicineQuestion`,
    method: 'post',
    data: param
  })
}

export function getMedicalReviewReadingTask(param) {
  return request({
    url: `/ReadingMedicalReview/getMedicalReviewReadingTask`,
    method: 'post',
    data: param
  })
}

export function saveMedicineQuestion(param) {
  return request({
    url: `/ReadingMedicalReview/saveMedicineQuestion`,
    method: 'post',
    data: param
  })
}
export function saveMedicalReviewInfo(param) {
  return request({
    url: `/ReadingMedicalReview/saveMedicalReviewInfo`,
    method: 'post',
    data: param
  })
}

export function UploadMedicalReviewImage(trialId, taskMedicalReviewId, param) {
  return request({
    url: `/TaskMedicalReview/UploadMedicalReviewImage/${trialId}/${taskMedicalReviewId}`,
    method: 'post',
    data: param
  })
}
export function FinishMedicalReview(param) {
  return request({
    url: `/Inspection/ReadingMedicalReview/FinishMedicalReview`,
    method: 'post',
    data: param
  })
}

export function getMedicalReviewDialog(param) {
  return request({
    url: `/ReadingMedicalReview/getMedicalReviewDialog`,
    method: 'post',
    data: param
  })
}
export function sendMedicalReviewDialog(param) {
  return request({
    url: `/ReadingMedicalReview/sendMedicalReviewDialog`,
    method: 'post',
    data: param
  })
}
export function iRConfirmMedicalReview(param) {
  return request({
    url: `/ReadingMedicalReview/iRConfirmMedicalReview`,
    method: 'post',
    data: param
  })
}
export function getIRMedicalFeedbackList(param) {
  return request({
    url: `/ReadingMedicalReview/getIRMedicalFeedbackList`,
    method: 'post',
    data: param
  })
}
export function closedMedicalReviewDialog(param) {
  return request({
    url: `/ReadingMedicalReview/closedMedicalReviewDialog`,
    method: 'post',
    data: param
  })
}

export function iRSendMedicalReviewDialog(param) {
  return request({
    url: `/ReadingMedicalReview/iRSendMedicalReviewDialog`,
    method: 'post',
    data: param
  })
}

export function getNextTask(param) {
  return request({
    url: `/ReadingImageTask/getNextTask`,
    method: 'post',
    data: param
  })
}

export function setEnrollReadingCategory(param) {
  return request({
    url: `/DoctorWorkload/setEnrollReadingCategory`,
    method: 'post',
    data: param
  })
}
export function uploadJudgeTaskImage(trialId, visitTaskId, param) {
  return request({
    url: `/VisitTask/UploadJudgeTaskImage/${trialId}/${visitTaskId}`,
    method: 'post',
    data: param
  })
}

export function getCriterionReadingInfo(param) {
  return request({
    url: `/TrialConfig/getCriterionReadingInfo`,
    method: 'post',
    data: param
  })
}

export function setCriterionReadingInfo(param) {
  return request({
    url: `/TrialConfig/setCriterionReadingInfo`,
    method: 'post',
    data: param
  })
}

export function getTrialCriterionList(trialId, isHaveSigned) {
  return request({
    url: isHaveSigned === false ? `/VisitTask/getTrialCriterionList?TrialId=${trialId}&isHaveSigned=${isHaveSigned}` : `/VisitTask/getTrialCriterionList?TrialId=${trialId}`,
    method: 'get'
  })
}
export function getTrialCriterionList2(trialId, isHaveSigned) {
  return request({
    url: isHaveSigned === false ? `/VisitTask/getTrialCriterionList?TrialId=${trialId}&IsAutoCreate=${isHaveSigned}` : `/VisitTask/getTrialCriterionList?TrialId=${trialId}`,
    method: 'get'
  })
}

export function addOrUpdateReadingCriterionPage(param) {
  return request({
    url: `/ReadingQuestion/addOrUpdateReadingCriterionPage`,
    method: 'post',
    data: param
  })
}

export function setTrialReadingCriterion(param) {
  return request({
    url: `/TrialConfig/setTrialReadingCriterion`,
    method: 'post',
    data: param
  })
}

export function getTrialReadingCriterionInfo(param) {
  return request({
    url: `/TrialConfig/getTrialReadingCriterionInfo`,
    method: 'post',
    data: param
  })
}

export function getReadingCriterionPageList(param) {
  return request({
    url: `/TrialConfig/getReadingCriterionPageList`,
    method: 'post',
    data: param
  })
}

export function deleteReadingCriterionPage(id) {
  return request({
    url: `/ReadingQuestion/deleteReadingCriterionPage/${id}`,
    method: 'delete'
  })
}
export function trialReadingInfoSign(param) {
  return request({
    url: `/Inspection/configTrialBasicInfo/TrialReadingInfoSign`,
    method: 'post',
    data: param
  })
}

export function getGlobalReadingInfo(param) {
  return request({
    url: `/ReadingImageTask/getGlobalReadingInfo`,
    method: 'post',
    data: param
  })
}

export function saveGlobalReadingInfo(param) {
  return request({
    url: `/ReadingImageTask/saveGlobalReadingInfo`,
    method: 'post',
    data: param
  })
}

export function getHistoryGlobalInfo(param) {
  return request({
    url: `/ReadingImageTask/getHistoryGlobalInfo`,
    method: 'post',
    data: param
  })
}

export function submitGlobalReadingInfo(param) {
  return request({
    url: `/Inspection/ReadingImageTask/SubmitGlobalReadingInfo`,
    method: 'post',
    data: param
  })
}

export function trialReadingInfoSignVerify(param) {
  return request({
    url: `/TrialConfig/trialReadingInfoSignVerify`,
    method: 'post',
    data: param
  })
}

export function getOncologySet(param) {
  return request({
    url: `/TrialConfig/getOncologySet`,
    method: 'post',
    data: param
  })
}

export function setOncologySet(param) {
  return request({
    url: `/TrialConfig/setOncologySet`,
    method: 'post',
    data: param
  })
}

export function getOncologyReadingInfo(param) {
  return request({
    url: `/ReadingImageTask/getOncologyReadingInfo`,
    method: 'post',
    data: param
  })
}

export function setOncologyReadingInfo(param) {
  return request({
    url: `/ReadingImageTask/setOncologyReadingInfo`,
    method: 'post',
    data: param
  })
}

export function submitOncologyReadingInfo(param) {
  return request({
    url: `/Inspection/ReadingImageTask/SubmitOncologyReadingInfo`,
    method: 'post',
    data: param
  })
}

export function uploadReadingAnswerImage(trialId, visitTaskId, param) {
  return request({
    url: `/VisitTask/UploadReadingAnswerImage/${trialId}/${visitTaskId}`,
    method: 'post',
    data: param
  })
}

export function verifyeCriterionNeedSynchronize(param) {
  return request({
    url: `/ReadingQuestion/verifyeCriterionNeedSynchronize`,
    method: 'post',
    data: param
  })
}

export function synchronizeCriterion(param) {
  return request({
    url: `/ReadingQuestion/synchronizeCriterion`,
    method: 'post',
    data: param
  })
}

export function getReadingTableQuestionSystemList(param) {
  return request({
    url: `/ReadingQuestion/getReadingTableQuestionSystemList`,
    method: 'post',
    data: param
  })
}
export function deleteReadingTableQuestionSystem(id) {
  return request({
    url: `/ReadingQuestion/deleteReadingTableQuestionSystem/${id}`,
    method: 'delete'
  })
}

export function addOrUpdateReadingTableQuestionSystem(param) {
  return request({
    url: `/ReadingQuestion/addOrUpdateReadingTableQuestionSystem`,
    method: 'post',
    data: param
  })
}

export function getReadingTableOtherQuestionSystem(param) {
  return request({
    url: `/ReadingQuestion/getReadingTableOtherQuestionSystem`,
    method: 'post',
    data: param
  })
}

export function verifyReadingMedicineQuestion(param) {
  return request({
    url: `/ReadingMedicineQuestion/verifyReadingMedicineQuestion`,
    method: 'post',
    data: param
  })
}

export function verifyTrialConfigSignatureConfirm(param) {
  return request({
    url: `/TrialConfig/verifyTrialConfigSignatureConfirm`,
    method: 'post',
    data: param
  })
}

export function getTrialOrganList(param) {
  return request({
    url: `/OrganInfo/getTrialOrganList`,
    method: 'post',
    data: param
  })
}

export function getTrialCheckOrganList(param) {
  return request({
    url: `/OrganInfo/getTrialCheckOrganList`,
    method: 'post',
    data: param
  })
}

export function deleteTrialOrganInfo(id) {
  return request({
    url: `/OrganInfo/deleteTrialOrganInfo/${id}`,
    method: 'delete'
  })
}

export function batchAddTrialOrgan(param) {
  return request({
    url: `/OrganInfo/batchAddTrialOrgan`,
    method: 'post',
    data: param
  })
}

export function getSystemCriterionList() {
  return request({
    url: `/ReadingQuestion/getSystemCriterionList`,
    method: 'post'
  })
}

export function synchronizeSystemOrganToTrial(param) {
  return request({
    url: `/OrganInfo/synchronizeSystemOrganToTrial`,
    method: 'post',
    data: param
  })
}

export function setOrganIsEnable(param) {
  return request({
    url: `/OrganInfo/setOrganIsEnable`,
    method: 'post',
    data: param
  })
}

export function getCriterionLesionType(param) {
  return request({
    url: `/OrganInfo/getCriterionLesionType`,
    method: 'post',
    data: param
  })
}

export function getReadingTableQuestionTrialList(param) {
  return request({
    url: `/ReadingQuestion/getReadingTableQuestionTrialList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateReadingTableQuestionTrial(param) {
  return request({
    url: `/ReadingQuestion/addOrUpdateReadingTableQuestionTrial`,
    method: 'post',
    data: param
  })
}

export function deleteReadingTableQuestionTrial(id) {
  return request({
    url: `/ReadingQuestion/deleteReadingTableQuestionTrial/${id}`,
    method: 'delete'
  })
}

export function getReadingTableOtherQuestionTrial(param) {
  return request({
    url: `/ReadingQuestion/getReadingTableOtherQuestionTrial`,
    method: 'post',
    data: param
  })
}

export function getRelatedVisitTask(param) {
  return request({
    url: `/ReadingImageTask/getRelatedVisitTask`,
    method: 'post',
    data: param
  })
}

export function getReadingQuestionAndAnswer(param) {
  return request({
    url: `/ReadingImageTask/getReadingQuestionAndAnswer`,
    method: 'post',
    data: param
  })
}

export function submitTableQuestion(param) {
  return request({
    url: `/ReadingImageTask/submitTableQuestion`,
    method: 'post',
    data: param
  })
}

export function getTableAnswerRowInfoList(visitTaskId) {
  return request({
    url: `/ReadingImageTask/getTableAnswerRowInfoList?visitTaskId=${visitTaskId}`,
    method: 'get'
  })
}

export function getReadingReportEvaluation(param) {
  return request({
    url: `/ReadingImageTask/getReadingReportEvaluation`,
    method: 'post',
    data: param
  })
}

export function submitDicomVisitTask(param) {
  return request({
    url: `/Inspection/ReadingImageTask/SubmitDicomVisitTask`,
    method: 'post',
    data: param
  })
}

export function getDicomReadingQuestionAnswer(param) {
  return request({
    url: `/ReadingImageTask/getDicomReadingQuestionAnswer`,
    method: 'post',
    data: param
  })
}

export function changeDicomReadingQuestionAnswer(param) {
  return request({
    url: `/ReadingImageTask/changeDicomReadingQuestionAnswer`,
    method: 'post',
    data: param
  })
}
export function changeReportAnswer(param) {
  return request({
    url: `/ReadingImageTask/changeReportAnswer`,
    method: 'post',
    data: param
  })
}
export function saveImageQuality(param) {
  return request({
    url: `/ReadingImageTask/saveImageQuality`,
    method: 'post',
    data: param
  })
}
export function deleteReadingRowAnswer(param) {
  return request({
    url: `/ReadingImageTask/deleteReadingRowAnswer`,
    method: 'post',
    data: param
  })
}

export function verifyVisitTaskQuestions(param) {
  return request({
    url: `/ReadingImageTask/verifyVisitTaskQuestions`,
    method: 'post',
    data: param
  })
}
export function getSystemCriterionSelectList() {
  return request({
    url: `/ReadingQuestion/getSystemCriterionSelectList`,
    method: 'post'
  })
}

export function splitLesion(param) {
  return request({
    url: `/ReadingImageTask/splitLesion`,
    method: 'post',
    data: param
  })
}
export function getReadingTool(param) {
  return request({
    url: `/ReadingImageTask/getReadingTool`,
    method: 'post',
    data: param
  })
}

export function getTrialCriterionSelectList(param) {
  return request({
    url: `/ClinicalDataSet/getTrialCriterionSelectList`,
    method: 'post',
    data: param
  })
}

export function setGlobalReadingInfo(param) {
  return request({
    url: `/TrialConfig/setGlobalReadingInfo`,
    method: 'post',
    data: param
  })
}

export function getTrialConfigGlobalReadingInfo(param) {
  return request({
    url: `/TrialConfig/getGlobalReadingInfo`,
    method: 'post',
    data: param
  })
}

export function asyncTrialCriterionDictionary(param) {
  return request({
    url: `/TrialConfig/asyncTrialCriterionDictionary`,
    method: 'post',
    data: param
  })
}

export function getTrialEmailNoticeConfigList(param) {
  return request({
    url: `/TrialEmailNoticeConfig/getTrialEmailNoticeConfigList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateTrialEmailNoticeConfig(param) {
  return request({
    url: `/TrialEmailNoticeConfig/addOrUpdateTrialEmailNoticeConfig`,
    method: 'post',
    data: param
  })
}

export function getTrialUserTypeSelectList(trialId) {
  return request({
    url: `/TrialEmailNoticeConfig/getTrialUserTypeSelectList?trialId=${trialId}`,
    method: 'get'
  })
}

export function resetTrialCriterionAsyncState(TrialReadingCriterionId) {
  return request({
    url: `/ReadingQuestion/resetTrialCriterionAsyncState?TrialReadingCriterionId=${TrialReadingCriterionId}`,
    method: 'post'
  })
}

export function getReadingVisitStudyList(trialId, sujectVisitId, visitTaskId) {
  return request({
    url: `/SubjectVisit/getReadingVisitStudyList`,
    method: 'post',
    data: {
      trialId,
      sujectVisitId,
      visitTaskId
    }
  })
}
// 获取关键序列
export function getKeySeries(data) {
  return request({
    url: `/SubjectVisit/getKeySeries`,
    method: 'post',
    data
  })
}
export function localFilePreview(relativePath) {
  return request({
    url: `/Common/LocalFilePreview?relativePath=${relativePath}`,
    method: 'get'
  })
}

export function getReadingOrganList(param) {
  return request({
    url: `/OrganInfo/getReadingOrganList`,
    method: 'post',
    data: param
  })
}

export function getCalculateQuestions(param) {
  return request({
    url: `/ReadingQuestion/getCalculateQuestions`,
    method: 'post',
    data: param
  })
}

export function getCalculateTableQuestions(param) {
  return request({
    url: `/ReadingQuestion/getCalculateTableQuestions`,
    method: 'post',
    data: param
  })
}

export function readClinicalData(param) {
  return request({
    url: `/ReadingImageTask/readClinicalData`,
    method: 'post',
    data: param
  })
}

export function getCustomQuestionPreview(param) {
  return request({
    url: `/ReadingQuestion/getCustomQuestionPreview`,
    method: 'post',
    data: param
  })
}
export function getCustomTableQuestionPreview(param) {
  return request({
    url: `/ReadingQuestion/GetCustomTableQuestionPreview`,
    method: 'post',
    data: param
  })
}

export function verifyReadingRestTime(param) {
  return request({
    url: `/ReadingImageTask/verifyReadingRestTime`,
    method: 'post',
    data: param
  })
}

export function getInstanceList(seriesId) {
  return request({
    url: `/Instance/list/${seriesId}`,
    method: 'get'
  })
}

export function getQuestionCalculateRelation(param) {
  return request({
    url: `/ReadingQuestion/getQuestionCalculateRelation`,
    method: 'post',
    data: param
  })
}

export function getCustomTableQuestionAnswer(param) {
  return request({
    url: `/ReadingImageTask/getCustomTableQuestionAnswer`,
    method: 'post',
    data: param
  })
}

export function verifyDefaultQuestionBeAnswer(param) {
  return request({
    url: `/ReadingImageTask/verifyDefaultQuestionBeAnswer`,
    method: 'post',
    data: param
  })
}

export function updateVisitBlindName(param) {
  return request({
    url: `/VisitPlan/updateVisitBlindName`,
    method: 'put',
    data: param
  })
}

export function getNextMedicalReviewTask(param) {
  return request({
    url: `/TaskMedicalReview/getNextMedicalReviewTask`,
    method: 'post',
    data: param
  })
}

export function batchSubmitGlobalReadingInfo(param) {
  return request({
    url: `/ReadingImageTask/batchSubmitGlobalReadingInfo`,
    method: 'post',
    data: param
  })
}

export function aIRReReading(param) {
  return request({
    url: `/VisitTask/aIRReReading`,
    method: 'post',
    data: param
  })
}

export function changeCalculationAnswer(param) {
  return request({
    url: `/ReadingImageTask/changeCalculationAnswer`,
    method: 'post',
    data: param
  })
}

export function getTrialEmail(param) {
  return request({
    url: `/TrialEmailNoticeConfig/getTrialEmail`,
    method: 'post',
    data: param
  })
}

export function setTrialEmail(param) {
  return request({
    url: `/TrialEmailNoticeConfig/setTrialEmail`,
    method: 'post',
    data: param
  })
}

export function setTaskUrgent(param) {
  return request({
    url: `/VisitTask/setTaskUrgent`,
    method: 'post',
    data: param
  })
}

export function getNextQCInfo(param) {
  return request({
    url: `/QCList/getNextQCInfo`,
    method: 'post',
    data: param
  })
}

export function manualGenerateEmailFile(param) {
  return request({
    url: `/TrialEmailNoticeConfig/manualGenerateEmailFile`,
    method: 'post',
    data: param
  })
}

export function manualSendEmail(param) {
  return request({
    url: `/TrialEmailNoticeConfig/manualSendEmail?VisitTaskId=${param.VisitTaskId}&SendFileRelativePath=${param.SendFileRelativePath}`,
    method: 'put'
  })
}

export function preArchiveStudy(param) {
  return request({
    url: `/Study/preArchiveStudy`,
    method: 'post',
    data: param
  })
}

export function preArchiveDicomStudy(param) {
  return request({
    url: `/Study/preArchiveDicomStudy`,
    method: 'post',
    data: param
  })
}

export function getTrialCriterionAdditionalAssessmentOptionList(TrialReadingCriterionId) {
  return request({
    url: `/TrialConfig/getTrialCriterionAdditionalAssessmentOptionList?TrialReadingCriterionId=${TrialReadingCriterionId}`,
    method: 'get'
  })
}

export function setTrialCriterionAdditionalAssessment(param) {
  return request({
    url: `/TrialConfig/setTrialCriterionAdditionalAssessment`,
    method: 'post',
    data: param
  })
}
export function getTaskAdditionalQuestion(param) {
  return request({
    url: `/ReadingImageTask/getTaskAdditionalQuestion`,
    method: 'post',
    data: param
  })
}

export function submitTaskAdditionalQuestion(param) {
  return request({
    url: `/ReadingImageTask/submitTaskAdditionalQuestion`,
    method: 'post',
    data: param
  })
}

export function getSubjectCriteriaEvaluationList(param) {
  return request({
    url: `/SubjectCriteriaEvaluation/getSubjectCriteriaEvaluationList`,
    method: 'post',
    data: param
  })
}

export function addOrUpdateArchiveStudy(param) {
  return request({
    url: `/Study/addOrUpdateArchiveStudy`,
    method: 'post',
    data: param
  })
}

export function getManualList(param) {
  return request({
    url: `/ReadingImageTask/getManualList`,
    method: 'post',
    data: param
  })
}

export function dicomUploadInProgress(param) {
  return request({
    url: `/Study/dicomUploadInProgress?TrialId=${param.trialId}&StudyInstanceUid=${param.studyInstanceUid}`,
    method: 'get'
  })
}

export function getCanChangeReadVisitList(param) {
  return request({
    url: `/ReadModule/getCanChangeReadVisitList`,
    method: 'post',
    data: param
  })
}

export function changeCutOffVisit(param) {
  return request({
    url: `/ReadModule/changeCutOffVisit`,
    method: 'post',
    data: param
  })
}

export function batchDeteteCriterionMedicineQuestion(param) {
  return request({
    url: `/ReadingMedicineQuestion/batchDeteteCriterionMedicineQuestion`,
    method: 'post',
    data: param
  })
}

export function getTrialToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getTrialToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getTrialUserToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getTrialUserToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getCheckToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getCheckToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getImageClinicalDataToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getImageClinicalDataToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getCRCSubjectClinicalList(param) {
  return request({
    url: `/ClinicalAnswer/getCRCSubjectClinicalList`,
    method: 'post',
    data: param
  })
}

export function getTrialClinicalQuestionPreview(param) {
  return request({
    url: `/ClinicalQuestion/getTrialClinicalQuestionPreview`,
    method: 'post',
    data: param
  })
}

export function submitClinicalForm(param) {
  return request({
    url: `/ClinicalAnswer/submitClinicalForm`,
    method: 'post',
    data: param
  })
}
export function getReReadingApplyToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getReReadingApplyToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function deleteClinicalForm(param) {
  return request({
    url: `/ClinicalAnswer/deleteClinicalForm`,
    method: 'post',
    data: param
  })
}
export function getPM_ReviewerSelectToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getPM_ReviewerSelectToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getCRCConfirmList(param) {
  return request({
    url: `/ClinicalAnswer/getCRCConfirmList`,
    method: 'post',
    data: param
  })
}
export function getSPM_ReviewerSelectToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getSPM_ReviewerSelectToBeDoneList`,
    method: 'post',
    data: param
  })
}


export function getSPMReReadingApprovalToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getSPMReReadingApprovalToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getCRCImageQuestionToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getCRCImageQuestionToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getImageCheckQuestionToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getImageCheckQuestionToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getImageReUploadToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getImageReUploadToBeDoneList`,
    method: 'post',
    data: param
  })
}
export function getImageSubmittedToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getImageSubmittedToBeDoneList`,
    method: 'post',
    data: param
  })
}
export function getImageQualityToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getImageQualityToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getQCImageQuestionToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getQCImageQuestionToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getIRImageReadingToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getIRImageReadingToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getIRMedicalCommentsToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getIRMedicalCommentsToBeDoneList`,
    method: 'post',
    data: param
  })
}
export function getMIMMedicalCommentsToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getMIMMedicalCommentsToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getImageClinicalDataToBeConfirmList(param) {
  return request({
    url: `/PersonalWorkstation/GetImageClinicalDataToBeConfirmList`,
    method: 'post',
    data: param
  })
}


export function getCRCBeConfirmList(param) {
  return request({
    url: `/ClinicalAnswer/getCRCBeConfirmList`,
    method: 'post',
    data: param
  })
}

export function cRCCancelConfirmClinical(param) {
  return request({
    url: `/Inspection/ClinicalAnswer/cRCCancelConfirmClinical`,
    method: 'post',
    data: param
  })
}

export function cRCConfirmClinical(param) {
  return request({
    url: `/Inspection/ClinicalAnswer/cRCConfirmClinical`,
    method: 'post',
    data: param
  })
}

export function getClinicalTableList(param) {
  return request({
    url: `/ClinicalAnswer/getClinicalTableList`,
    method: 'post',
    data: param
  })
}

export function getClinicalDateList(param) {
  return request({
    url: `/ClinicalAnswer/getClinicalDateList`,
    method: 'post',
    data: param
  })
}

export function CRCSignClinicalData(param) {
  return request({
    url: `/Inspection/ClinicalAnswer/CRCSignClinicalData`,
    method: 'post',
    data: param
  })
}

export function getPMClinicalDataToBeDoneList(param) {
  return request({
    url: `/PersonalWorkstation/getPMClinicalDataToBeDoneList`,
    method: 'post',
    data: param
  })
}

export function getPMConfirmList(param) {
  return request({
    url: `/ClinicalAnswer/getPMConfirmList`,
    method: 'post',
    data: param
  })
}

export function PMConfirmClinical(param) {
  return request({
    url: `/Inspection/ClinicalAnswer/PMConfirmClinical`,
    method: 'post',
    data: param
  })
}

export function SubmitClinicalFormAndSign(param) {
  return request({
    url: `/Inspection/ClinicalAnswer/SubmitClinicalFormAndSign`,
    method: 'post',
    data: param
  })
}

export function getSystemClinicalQuestionPreview(param) {
  return request({
    url: `/ClinicalQuestion/getSystemClinicalQuestionPreview`,
    method: 'post',
    data: param
  })
}

export function getTrialSiteSurveySelectList(param) {
  return request({
    url: `/TrialSiteSurvey/getTrialSiteSurveySelectList`,
    method: 'post',
    data: param
  })
}

export function deleteCustomTag(id) {
  return request({
    url: `/ReadingImageTask/deleteCustomTag/${id}`,
    method: 'post',
  })
}

export function uploadTrialSiteSurveyUser(trialId, baseUrl, routeUrl, param) {
  return request({
    url: `/TrialSiteSurvey/UploadTrialSiteSurveyUser?trialId=${trialId}&baseUrl=${baseUrl}&routeUrl=${routeUrl}`,
    method: 'post',
    data: param
  })
}

export function addClinicalDataDialog(visiTaskId, content) {
  return request({
    url: `/VisitTask/addClinicalDataDialog?visiTaskId=${visiTaskId}&content=${content}`,
    method: 'post'
  })
}

export function getClinicalDataDialog(visiTaskId) {
  return request({
    url: `/VisitTask/getClinicalDataDialog?visiTaskId=${visiTaskId}`,
    method: 'get'
  })
}

export function collectNextIQCQuality(param) {
  return request({
    url: `/QCOperation/collectNextIQCQuality`,
    method: 'post',
    data: param
  })
}

export function getNextIQCQuality(param) {
  return request({
    url: `/QCOperation/getNextIQCQuality`,
    method: 'post',
    data: param
  })
}

// 新增或编辑项目
export function addOrUpdateTrialHir(param) {
  return request({
    url: `/Patient/addOrUpdateTrial`,
    method: 'post',
    data: param
  })
}

// 获取项目列表项目
export function getTrialListHir(param) {
  return request({
    url: `/Patient/getTrialList`,
    method: 'post',
    data: param
  })
}

// 获取项目详情
export function getTrialInfoHir(id) {
  return request({
    url: `/Patient/getTrialInfo/${id}`,
    method: 'get',
  })
}

// 修改受试者信息
export function addOrUpdateSubjectHir(data) {
  return request({
    url: `/Patient/addOrUpdateSubject`,
    method: 'post',
    data
  })
}

// 获取患者序列信息
export function getPatientSeriesList(scpStudyId) {
  return request({
    url: `/Patient/getPatientSeriesList?scpStudyId=${scpStudyId}`,
    method: 'get'
  })
}

// 获取系统已确认标准
export function getSystemConfirmedCreiterionList() {
  return request({
    url: `/Patient/getSystemConfirmedCreiterionList`,
    method: 'get'
  })
}

// 获取项目授权信息
export function getTrialAuthorizationInfo(params) {
  return request({
    url: `/Patient/getTrialAuthorizationInfo`,
    method: 'get',
    params
  })
}

// 获取激活码信息
export function getActivationCodeInfo(params) {
  return request({
    url: `/Patient/getActivationCodeInfo`,
    method: 'get',
    params
  })
}

// 获取项目授权码
export function getTrialAuthorizationCode(data) {
  return request({
    url: `/Patient/getTrialAuthorizationCode`,
    method: 'post',
    data
  })
}

// 获取项目激活码
export function getTrialActivationCode(data) {
  return request({
    url: `/Patient/getTrialActivationCode`,
    method: 'post',
    data
  })
}

// 设置项目授权信息
export function activateTrial(params) {
  return request({
    url: `/Patient/activateTrial`,
    method: 'put',
    params
  })
}

// 获取项目授权码信息
export function getAuthorizationCodeInfo(params) {
  return request({
    url: `/Patient/getAuthorizationCodeInfo`,
    method: 'get',
    params
  })
}

// 获取下载信息
export function getDownloadSubjectVisitStudyInfo(params) {
  return request({
    url: `/Patient/getDownloadSubjectVisitStudyInfo`,
    method: 'get',
    params
  })
}
// 下载成功回调
export function downloadImageSuccess(params) {
  return request({
    url: `/Patient/downloadImageSuccess`,
    method: 'get',
    params
  })
}
export function saveTaskQuestion(saveQuestionType, param) {
  return request({
    url: `/SaveTaskQuestion/${saveQuestionType}`,
    method: 'post',
    data: param
  })
}
//  项目添加角色修改权限
export function updateTrialUserRole(data) {
  return request({
    url: `/TrialMaintenance/updateTrialUserRole`,
    method: 'put',
    data
  })
}
//  阅片任务退回
export function visitImageBack(data) {
  return request({
    url: `/Patient/visitImageBack`,
    method: 'put',
    data
  })
}
//  访视影像下载
export function VisitImageDownload(data) {
  return requestDownload({
    url: `/download/VisitImageDownload`,
    method: 'post',
    responseType: 'blob',
    data
  })
}
//  临床数据下载
export function ClinicalDataDownload(data) {
  return requestDownload({
    url: `/download/ClinicalDataDownload`,
    method: 'post',
    responseType: 'blob',
    data
  })
}