import request from '@/utils/request'

// 查询医院信息列表
export function hospitalPage (query) {
  return request({
    url: '/info/hospital/page',
    method: 'get',
    params: query
  })
}
// 获得省市区三级数据
export function cnAreaTree (query) {
  return request({
    url: `/base/cnArea/tree-lbs`,
    method: 'get',
    params: query
  })
}
// 新增医院信息
export function hospitalAdd (data) {
  return request({
    url: `/info/hospital/add`,
    method: 'post',
    data
  })
}
// 修改医院信息
export function hospitalEdit (data) {
  return request({
    url: `/info/hospital/edit`,
    method: 'post',
    data
  })
}
// 获取医院信息详细信息
export function hospitalInfo (id) {
  return request({
    url: `/info/hospital/info/${id}`,
    method: 'get',
  })
}
// 根据坐标获取位置详情信息
export function getLocation (location) {
  return request({
    url: `/base/cnArea/get-address/${location}`,
    method: 'get',
  })
}
export function getAddress (address) {
  return request({
    url: `/base/cnArea/get-address/${address}`,
    method: 'get',
  })
}
// 修改医院上下架状态
export function updateRackStatus (data) {
  return request({
    url: `/info/hospital/updateRackStatus`,
    method: 'post',
    data
  })
}
// 删除医院信息
export function hospitalDel (ids) {
  return request({
    url: `/info/hospital/del/${ids}`,
    method: 'post',
  })
}
// 查询医院科室信息列表
export function hospitalDepartmentPage (query) {
  return request({
    url: `/info/hospitalDepartment/page`,
    method: 'get',
    params: query
  })
}
// 新增医院科室信息
export function hospitalDepartmentAdd (data) {
  return request({
    url: `/info/hospitalDepartment/add`,
    method: 'post',
    data
  })
}
// 获取医院科室信息详细信息
export function hospitalDepartmentInfo (id) {
  return request({
    url: `/info/hospitalDepartment/info/${id}`,
    method: 'get',
  })
}
// 修改医院科室信息
export function hospitalDepartmentEdit (data) {
  return request({
    url: `/info/hospitalDepartment/edit`,
    method: 'post',
    data
  })
}
// 修改医院科室上下架状态
export function hospitalDepartmentUpdateRackStatus (data) {
  return request({
    url: `/info/hospitalDepartment/updateRackStatus`,
    method: 'post',
    data
  })
}
// 删除医院科室信息
export function hospitalDepartmentDel (ids) {
  return request({
    url: `/info/hospitalDepartment/del/${ids}`,
    method: 'post',
  })
}
// 查询医院信息下拉列表
export function hospitalSimpleList (query) {
  return request({
    url: `/info/hospital/simpleList`,
    method: 'get',
    params: query
  })
}
// 获取二维码
export function getQrCode (data) {
  return request({
    url: `/info/hospital/getQrCode`,
    method: 'post',
    data
  })
}
// 获取可关联的科室列表
export function hospitalDepartmentRelList (query) {
  return request({
    url: `/info/hospitalDepartment/relList`,
    method: 'get',
    params: query
  })
}
// 获取科室列表简略信息
export function hospitalDepartmentSimpleList (query) {
  return request({
    url: `/info/hospitalDepartment/simpleList`,
    method: 'get',
    params: query
  })
}