import request from '@/utils/request';

/**
 * 获取患者列表
 */
export function getList (queryParams) {
  return request ({
    url: '/outpatient-manage/treatment/encounter-list',
    method: 'get',
    params: queryParams,
  });
}

/**
 * 诊疗列表
 */
export function getDisposalList (encounterId, serviceCategory) {
  return request ({
    url: '/outpatient-manage/treatment/treatment-list?encounterId=' +
      encounterId +
      (serviceCategory ? '&serviceCategory=' + serviceCategory : ''),
    method: 'get',
  });
}

/**
 * 执行列表
 */
export function getExecuteList (queryParams) {
  return request ({
    url: '/outpatient-manage/treatment/execute-list',
    method: 'get',
    params: queryParams,
  });
}

/**
 * 初始化
 */
export function init () {
  return request ({
    url: '/outpatient-manage/treatment/init',
    method: 'get',
  });
}

/**
 * 执行
 */
export function execute (data) {
  return request ({
    url: '/outpatient-manage/treatment/perform',
    method: 'put',
    data: data,
  });
}

/**
 * 取消
 */
export function cancel (data) {
  return request ({
    url: '/outpatient-manage/treatment/cancel-perform',
    method: 'put',
    data: data,
  });
}

/**
 * 获取执行记录
 */
export function getPerformRecord (params) {
  return request ({
    url: '/outpatient-manage/treatment/perform-record',
    method: 'get',
    params: params,
  });
}

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

export function printBloodCode (query) {
  return request ({
    url: '/outpatient-manage/treatment/blood-transfusion-patch',
    method: 'get',
    params: query,
  });
}
