import request from '@/utils/request';

// 获取病区下拉选
export function getPractitionerWard (queryParams) {
  return request ({
    url: '/app-common/practitioner-ward',
    method: 'get',
    params: queryParams,
  });
}

// 住院汇总发药单左侧
export function getFromSummaryList (queryParams) {
  return request ({
    url: 'pharmacy-manage/summary-dispense-medicine/from_summary-list',
    method: 'get',
    params: queryParams,
  });
}

// 住院汇总发药单右侧
export function getFromDetailList (queryParams) {
  return request ({
    url: 'pharmacy-manage/summary-dispense-medicine/from-list',
    method: 'get',
    params: queryParams,
  });
}

// 明细左侧
export function getEncounterList (queryParams) {
  return request ({
    url: '/pharmacy-manage/summary-dispense-medicine/encounter-list',
    method: 'get',
    params: queryParams,
  });
}
//明细 右侧
export function getMedicationSummaryDetail (queryParams) {
  return request ({
    url: '/pharmacy-manage/summary-dispense-medicine/medication_summary-list',
    method: 'get',
    params: queryParams,
  });
}
//以下是组件的接口

/**
 * 获取住院患者列表
 */
export function getPatientList (queryParams) {
  return request ({
    url: '/nurse-station/advice-process/inpatient',
    method: 'get',
    params: queryParams,
  });
}

/**
 * 获取当前登录人管理病区
 */
export function getWardList (queryParams) {
  return request ({
    url: '/app-common/practitioner-ward',
    method: 'get',
    params: queryParams,
  });
}

/**
 * 获取当前选中患者全部医嘱
 */
export function getPrescriptionList (queryParams) {
  return request ({
    url: '/nurse-station/advice-process/inpatient-advice',
    method: 'get',
    params: queryParams,
  });
}

/**
 * 执行医嘱
 */
export function adviceExecute (data) {
  return request ({
    url: '/nurse-station/advice-process/advice-execute',
    method: 'post',
    data: data,
  });
}

/**
 * 取消执行医嘱
 */
export function adviceCancel (data) {
  return request ({
    url: '/nurse-station/advice-process/advice-cancel',
    method: 'post',
    data: data,
  });
}

/**
 * 明细发药
 * 
 */
export function totalSendDrug (data) {
  return request ({
    url: '/pharmacy-manage/summary-dispense-medicine/summary-dispense-medicine',
    method: 'put',
    data: data,
  });
}
/**
 * 明细退药
 */
export function totalReturnDrug (data) {
  return request ({
    url: '/pharmacy-manage/summary-dispense-medicine/medicine-return',
    method: 'put',
    data: data,
  });
}
