import request from '@/utils/request'

/**
 * 获取门诊患者信息列表
 * 复用门诊挂号的API来查询患者信息
 */
export const getOutpatientRegistrationList = (params) => {
  // 调用门诊挂号的API获取患者信息
  return request({
    url: '/api/outpatient/registration/list',
    method: 'get',
    params
  })
}

/**
 * 根据ID获取患者详情
 */
export const getPatientById = (id) => {
  return request({
    url: `/api/outpatient/registration/${id}`,
    method: 'get'
  })
}

/**
 * 根据条件查询患者信息
 * 复用门诊挂号API进行查询
 */
export const getPatientList = (params) => {
  // 复用门诊挂号的API
  return request({
    url: '/api/outpatient/registration/list',
    method: 'get',
    params
  })
}

/**
 * 根据门诊号码获取患者详细信息
 */
export const getPatientByOutpatientNo = (outpatientNo) => {
  return request({
    url: '/api/outpatient/registration/list',
    method: 'get',
    params: { identifierNo: outpatientNo }
  })
}