import request from '@/utils/request'

// 查询医疗指标分页列表
export function listIndicator(query) {
  return request({
    url: '/admin/medical/indicator/page',
    method: 'get',
    params: query
  })
}

// 查询所有启用的指标
export function listAllEnabled() {
  return request({
    url: '/admin/medical/indicator/listEnabled',
    method: 'get'
  })
}

// 根据分类查询指标
export function listByCategory(category) {
  return request({
    url: '/admin/medical/indicator/listByCategory',
    method: 'get',
    params: { category }
  })
}

// 查询医疗指标详细
export function getIndicator(indicatorId) {
  return request({
    url: '/admin/medical/indicator/' + indicatorId,
    method: 'get'
  })
}

// 新增医疗指标
export function addIndicator(data) {
  return request({
    url: '/admin/medical/indicator/add',
    method: 'post',
    data: data
  })
}

// 修改医疗指标
export function updateIndicator(data) {
  return request({
    url: '/admin/medical/indicator/update',
    method: 'put',
    data: data
  })
}

// 删除医疗指标
export function delIndicator(indicatorId) {
  return request({
    url: '/admin/medical/indicator/' + indicatorId,
    method: 'delete'
  })
}
