import request from '@/utils/request'

// 查询体检报告分页列表
export function listReport(query) {
  return request({
    url: '/admin/medical/report/page',
    method: 'get',
    params: query
  })
}

// 查询体检报告详细
export function getReport(reportId) {
  return request({
    url: '/admin/medical/report/' + reportId,
    method: 'get'
  })
}

// 根据用户ID查询体检报告列表
export function listReportByUser(userId) {
  return request({
    url: '/admin/medical/report/listByUser/' + userId,
    method: 'get'
  })
}

// 根据用户ID和体检日期查询体检报告
export function getReportByUserAndDate(userId, examDate) {
  return request({
    url: '/admin/medical/report/getByUserAndDate',
    method: 'get',
    params: {
      userId: userId,
      examDate: examDate
    }
  })
}

// 新增体检报告
export function addReport(data) {
  return request({
    url: '/admin/medical/report/add',
    method: 'post',
    data: data
  })
}

// 修改体检报告
export function updateReport(data) {
  return request({
    url: '/admin/medical/report/update',
    method: 'put',
    data: data
  })
}

// 删除体检报告
export function delReport(reportId) {
  return request({
    url: '/admin/medical/report/' + reportId,
    method: 'delete'
  })
}
