import request from '../../utils/request'

export function getHistories() {
  return request({
    url: '/adverseEvent/getHistories',
    method: 'get',
  })
}

export function submitNewReport(data) {
  return request({
    url: '/adverseEvent/submitNewReport',
    method: 'post',
    data,
  })
}

export function getReportDetail(pid, level) {
  return request({
    url: '/adverseEvent/getReportDetail',
    method: 'get',
    params: { pid, level },
  })
}

export function getReportsForDept() {
  return request({
    url: '/adverseEvent/getReportsForDept',
    method: 'get',
  })
}

export function submitModifiedReport(data) {
  return request({
    url: '/adverseEvent/modifyReport',
    method: 'post',
    data,
  })
}

export function updateDeptHandled(data) {
  return request({
    url: '/adverseEvent/updateDeptHandled',
    method: 'post',
    data,
  })
}

export function getAllDepts() {
  return request({
    url: '/adverseEvent/getAllDepts',
    method: 'get',
  })
}

export function updateFinalHandled(data) {
  return request({
    url: '/adverseEvent/updateFinalHandled',
    method: 'post',
    data,
  })
}

export function updateDeleted(pid) {
  return request({
    url: '/adverseEvent/updateDeleted',
    method: 'get',
    params: { pid },
  })
}

export function getAllReports(data) {
  return request({
    url: '/adverseEvent/getAllReports',
    method: 'post',
    data,
  })
}

export function updatePrinted(pid) {
  return request({
    url: '/adverseEvent/updatePrinted',
    method: 'get',
    params: { pid },
  })
}
