import request from '@/utils/request'

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

export function getBLLineLesion(trialCode, subjectCode, tpCode) {
  return request({
    url: `/report/getBLLineLesion/${trialCode}/${subjectCode}/${tpCode}`,
    method: 'get'
  })
}

export function getVisitLineLesion(trialCode, subjectCode, visitNum, tpCode) {
  return request({
    url: `/report/getVisitLineLesion/${trialCode}/${subjectCode}/${visitNum}/${tpCode}`,
    method: 'get'
  })
}

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

export function submiteReport(tpId) {
  return request({
    url: `/report/submiteReport/${tpId}`,
    method: 'post'
  })
}

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

export function getStudyInfo(studyId) {
  return request({
    url: `/Study/item/${studyId}`,
    method: 'get'
  })
}
export function getSeriesList(url) {
  return request({
    url: url,
    method: 'get'
  })
}
export function getInstanceList(seriesId) {
  return request({
    url: `/instance/list/id/${seriesId}`,
    method: 'get'
  })
}
export function getImageLabelList(tpCode) {
  return request({
    url: `/study/getImageLabelList/${tpCode}`,
    method: 'get'
  })
}
export function getRelationVisitList(visitNum, tpCode) {
  return request({
    url: `/study/getRelationVisitList/${visitNum}/${tpCode}`,
    method: 'get'
  })
}
export function getAllRelationStudyList(studyId) {
  return request({
    url: `/study/getAllRelationStudyList/${studyId}`,
    method: 'get'
  })
}
export function getTrialListByReviewer(param) {
  return request({
    url: `/trial/getTrialListByReviewer`,
    method: 'post',
    data: param
  })
}

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

export function getHistoryVisitRsList(trialId, subjectId, visitNum, globalId, globalCode) {
  return request({
    url: `/globalReport/getHistoryVisitRsList/${trialId}/${subjectId}/${visitNum}/${globalId}/${globalCode}`,
    method: 'get'
  })
}

export function getHistoryGlobalRsList(trialId, subjectCode, visitNum, globalId) {
  return request({
    url: `/globalReport/getHistoryGlobalRsList/${trialId}/${subjectCode}/${visitNum}/${globalId}`,
    method: 'get'
  })
}

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

export function GetAdReport(adId) {
  return request({
    url: `/globalReport/getAdReport/${adId}`,
    method: 'get'
  })
}

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

export function getVisitStudyList(trialId, subjectVisitId, isReading) {
  return request({
    url: `/SubjectVisit/getVisitStudyList/${trialId}/${subjectVisitId}/${isReading}`,
    method: 'get'
  })
}

export function uploadPrintscreen(param, subjectId) {
  return request({
    url: `/Printscreen/UploadPrintscreen/${subjectId}`,
    method: 'post',
    data: param
  })
}

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

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

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