import request from '@/utils/request'

export function listPatient(query) {
  return request({
    url: '/pharmacy-manage/western-medicine-dispense/encounter-list',
    method: 'get',
    params: query
  })
}

export function devicePatientList(query) {
  return request({
    url: '/pharmacy-manage/device-dispense/encounter-list',
    method: 'get',
    params: query
  })
}

export function listInit(query) {
  return request({
    url: '/pharmacy-manage/western-medicine-dispense/init',
    method: 'get',
    params: query
  })
}

export function listWesternmedicine(query) {
  return request({
    url: '/pharmacy-manage/western-medicine-dispense/medicine-order',
    method: 'get',
    params: query
  })
}

export function updateMedicion(prescriptionList) {
    return request({
      url: '/pharmacy-manage/western-medicine-dispense/medicine-dispense',
      method: 'put',
      data: prescriptionList
    })
  }
export function prepareMedicion(data) {
    return request({
      url: '/pharmacy-manage/western-medicine-dispense/prepare',
      method: 'put',
      data: data
    })
  }

  
export function backMedicion(data) {
  return request({
    url: '/pharmacy-manage/western-medicine-dispense/medicine-cancel',
    method: 'put',
    data: data
  })
}
//扫码枪返回追溯码筛选
export function itemTraceNo(params) {
  return request({
    url: '/app-common/item-trace-no?traceNoList=' + params,
    method: 'get',
  })
}

/**
 * 耗材查询列表
 */
export function getReportRegisterInit(query) {
  return request({
    url: '/pharmacy-manage/device-dispense/device-order',
    method: 'get',
    params: query
  })
}

/**
 * 耗材发药
 */
export function deviceDispense(params) {
  return request({
    url: '/pharmacy-manage/device-dispense/device-dispense',
    method: 'put',
    data: params
  })
}

/**
 * 耗材作废
 */
export function deviceInvalid(data) {
  return request({
    url: '/pharmacy-manage/device-dispense/device-cancel',
    method: 'put',
    data: data
  })
}
