import request from '@/utils/request'

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

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

export function deleteTaskAllocationRule(taskAllocationRuleId) {
  return request({
    url: `/TaskAllocationRule/deleteTaskAllocationRule/${taskAllocationRuleId}`,
    method: 'delete'
  })
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

export function deleteTaskMedicalReviewRule(taskMedicalReviewRuleId) {
  return request({
    url: `/TaskMedicalReviewRule/deleteTaskMedicalReviewRule/${taskMedicalReviewRuleId}`,
    method: 'delete'
  })
}

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

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

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

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

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

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

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

export function deleteTaskConsistentRule(taskConsistentRuleId) {
  return request({
    url: `/TaskConsistentRule/deleteTaskConsistentRule/${taskConsistentRuleId}`,
    method: 'delete'
  })
}

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

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

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

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

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

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

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

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

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

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

export function getReReadingOrBackInfluenceTaskList(taskId, isReReading, applyId) {
  return request({
    url: applyId ? `/VisitTask/getReReadingOrBackInfluenceTaskList/${taskId}/${isReReading}?applyId=${applyId}` : `/VisitTask/getReReadingOrBackInfluenceTaskList/${taskId}/${isReReading}`,
    method: 'get'
  })
}

export function PMSetTaskBack(trialId, taskId) {
  return request({
    url: `/VisitTask/PMSetTaskBack/${trialId}/${taskId}`,
    method: 'put'
  })
}

export function confirmReReading(params) {
  return request({
    url: `/Inspection/VisitTask/ConfirmReReading`,
    method: 'post',
    data: params
  })
}

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

export function getDoctorPlanAllocationRuleList(params) {
  return request({
    url: `/TaskAllocationRule/getDoctorPlanAllocationRuleList?TrialId=${params.TrialId}`,
    method: 'get'
  })
}

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

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

export function getDoctorSubjectStat(TrialId, TrialReadingCriterionId) {
  return request({
    url: `/VisitTask/getDoctorSubjectStat?TrialId=${TrialId}&TrialReadingCriterionId=${TrialReadingCriterionId}`,
    method: 'get'
  })
}

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

export function getTrialSiteCodeSelect(TrialId) {
  return request({
    url: `/TrialMaintenance/getTrialSiteCodeSelect?TrialId=${TrialId}`,
    method: 'get'
  })
}

export function getSubjectAssignedDoctorList(SubjectId, TrialReadingCriterionId) {
  return request({
    url: `/VisitTask/getSubjectAssignedDoctorList?SubjectId=${SubjectId}&TrialReadingCriterionId=${TrialReadingCriterionId}`,
    method: 'get'
  })
}

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

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

export function getSubjectCancelDoctorHistoryList(SubjectId) {
  return request({
    url: `/TaskAllocationRule/getSubjectCancelDoctorHistoryList?SubjectId=${SubjectId}`,
    method: 'get'
  })
}

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

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

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

export function updateTrialReviewerState(params) {
  return request({
    url: `/DoctorWorkload/updateTrialReviewerState`,
    method: 'put',
    data: params
  })
}

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

export function getDicomAndNoneDicomStudyList(param) {
  return request({
    url: `/UltrasonicDicom/getDicomAndNoneDicomStudyList?VisiTaskId=${param.Id}`,
    method: 'get',
  })
}

export function getStudyModalityList(param) {
  return request({
    url: `/UltrasonicDicom/getStudyModalityList?VisiTaskId=${param.Id}`,
    method: 'get',
  })
}

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