import request from '@/utils/request'


// 查询处方列表
export function listPrescribe(query) {

  return request({
    url: '/his/prescribe/list',
    method: 'get',
    params: query
  })
}

/**
 * 确认处方
 * @param payload
 * @returns {*}
 */
export function confirmPrescribe(payload) {

  return request({
    url: '/his/prescribe/confirmPrescribe',
    method: 'post',
    params: payload
  })
}

/**
 * 拒方
 * @param payload
 * @returns {*}
 */
export function handleReject(payload) {

  return request({
    url: '/his/prescribe/handleReject',
    method: 'put',
    data: payload
  })
}

// 查询处方详细
export function getPrescribe(prescribeId) {
  return request({
    url: '/his/prescribe/' + prescribeId,
    method: 'get'
  })
}

// 查询处方药品详情
export function getPrescribeDrug(prescribeId) {
  return request({
    url: '/his/prescribe/Drug/' + prescribeId,
    method: 'get'
  })
}

// 查看身份证
export function queryIdCard(orderId) {
  return request({
    url: '/his/prescribe/queryIdCard/' + orderId,
    method: 'get'
  })
}

// 新增处方
export function addPrescribe(data) {
  return request({
    url: '/his/prescribe',
    method: 'post',
    data: data
  })
}

// 修改处方
export function updatePrescribe(data) {
  return request({
    url: '/his/prescribe',
    method: 'put',
    data: data
  })
}

// 删除处方
export function delPrescribe(prescribeId) {
  return request({
    url: '/his/prescribe/' + prescribeId,
    method: 'delete'
  })
}

// 导出处方
export function exportPrescribe(query) {
  return request({
    url: '/his/prescribe/export',
    method: 'get',
    params: query
  })
}

// 导出医疗信息反馈单
export function exportMessageFeedback(query) {
  return request({
    url: '/his/prescribe/messageFeedbackExport',
    method: 'get',
    params: query
  })
}
// 查询常用语列表
export function getPrescribeCommonList(params) {
  return request({
    url: '/app/prescribe/common/getPrescribeCommonList',
    method: 'get',
    params: params
  })
}


// 查询处方审核记录
export function recordList(prescribeId) {
  return request({
    url: '/his/prescribe/recordList/' + prescribeId,
    method: 'get'
  })
}

//拒方数量统计
export function rejectCount(data) {
  return request({
    url: '/his/prescribe/rejectCount',
    method: 'post',
    data: data
  })
}
