import request from '@/utils/request'

// 获取住院信息初期数据列表
export function getInit(query) {
  return request({
    url: '/inpatient-manage/init',
    method: 'get',
    params: query
  })
}

// 获取住院信息 分页显示
// export function getAdmissionPage(query) {
//   return request({
//     url: '/inpatient-manage/admission-page',
//     method: 'get',
//     params: query
//   })
// }
// 获取住院信息 分页显示 新
export function getAdmissionPage(query) {
  return request({
    url: '/inhospital-charge/register/register-info',
    method: 'get',
    params: query
  })
}

// 住院无档登记
export function addAdmissionInfo(data) {
  return request({
    url: '/inpatient-manage/admission-information',
    method: 'post',
    data: data
  })
}

// 住院登记
export function admissionInfo(data) {
  return request({
    url: '/inpatient-manage/admission-information',
    method: 'put',
    data: data
  })
}

/**
 * 获取科室下拉列表
 */
export function getOrgList() {
  return request({
    url: '/base-data-manage/organization/organization',
    method: 'get',
  })
}

/**
 * 查询病区下拉列表
 */
export function wardList() {
  return request({
    url: '/app-common/ward-list',
    method: 'get'
  })
}

/**
 * 获取诊断基础下拉数据
 */
export function diagnosisInit() {
  return request({
    url: '/doctor-station/diagnosis/init',
    method: 'get',
  })
}

// 查询患者相关
export function patientlLists() {
  return request({
    url: '/patient-manage/information/init',
    method: 'get'
  })
}

// 查询患者相关
export function doctorList(id) {
  return request({
    url: '/inpatient-manage/doctor-list?orgId=' + id,
    method: 'get'
  })
}

// 查询患者相关
export function getPatientInfo(id, statusEnum) {
  return request({
    url: `/inpatient-manage/admission-one?id=${id}&statusEnum=${statusEnum}`,
    method: 'get'
  })
}


// 获取患者基础信息
export function getPatientBasicInfo(patientId) {
  return request({
    url: `/inhospital-charge/register/patient-info?patientId=${patientId}`,
    method: 'get'
  })
}

// 获取患者入院信息
export function getInHospitalInfo(encounterId) {
  return request({
    url: `/inhospital-charge/register/in-hospital-info?encounterId=${encounterId}`,
    method: 'get'
  })
}

// 获取病区床位信息
export function getBedInfo(wardBusNo) {
  return request({
    url: `/inhospital-charge/register/beds-num?wardBusNo=${wardBusNo}`,
    method: 'get'
  })
}

// 住院登记
export function registerInHospital(data) {
  return request({
    url: '/inhospital-charge/register/by-cashier',
    method: 'post',
    data: data
  })
}

// 无档登记
export function noFilesRegister(data) {
  return request({
    url: '/inhospital-charge/register/no-files',
    method: 'post',
    data: data
  })
}

// 表单初始化
export function patientFormInit() {
  return request({
    url: '/patient-manage/information/init',
    method: 'get'
  })
}

// 合同
export function getContractList() {
  return request({
    url: '/app-common/contract-list',
    method: 'get',
  })
}

/**
 * 获取诊断定义列表
 */
export function getDiagnosisDefinitionList(queryParams) {
  return request({
    url: '/doctor-station/diagnosis/condition-definition-metadata',
    method: 'get',
    params: queryParams
  })
}