import request from '@/utils/request'

// 查询病人列表
export function listPatient(query) {
  return request({
    url: '/store/patient/list',
    method: 'get',
    params: query
  })
}

// 查询病人详细
export function getPatient(patientId) {
  return request({
    url: '/store/patient/' + patientId,
    method: 'get'
  })
}
// 查询病人详细
export function getPatientByUserId(userId) {
  return request({
    url: '/store/patient/getPatient/' + userId,
    method: 'get'
  })
}

// 新增病人
export function addPatient(data) {
  return request({
    url: '/store/patient',
    method: 'post',
    data: data
  })
}

// 修改病人
export function updatePatient(data) {
  return request({
    url: '/store/patient',
    method: 'put',
    data: data
  })
}

// 删除病人
export function delPatient(patientId) {
  return request({
    url: '/his/patient/' + patientId,
    method: 'delete'
  })
}

// 导出病人
export function exportPatient(query) {
  return request({
    url: '/store/patient/export',
    method: 'get',
    params: query
  })
}