import request from '@/utils/request'

// 查询服药任务列表
export function listMedicationTask(query) {
  return request({
    url: '/health/medicationTask/list',
    method: 'get',
    params: query
  })
}

// 查询服药任务详细
export function getMedicationTask(id) {
  return request({
    url: '/health/medicationTask/' + id,
    method: 'get'
  })
}

// 删除服药任务
export function delMedicationTask(id) {
  return request({
    url: '/health/medicationTask/' + id,
    method: 'delete'
  })
}

// 确认服药
export function confirmMedication(id, confirmType, confirmTime) {
  return request({
    url: '/health/medicationTask/confirm/' + id,
    method: 'put',
    params: { confirmType, confirmTime }
  })
}

// 跳过服药
export function skipMedication(id, notes) {
  return request({
    url: '/health/medicationTask/skip/' + id,
    method: 'put',
    params: { notes }
  })
}

// 标记漏服
export function markMissed(id, notes) {
  return request({
    url: '/health/medicationTask/missed/' + id,
    method: 'put',
    params: { notes }
  })
}
