import { requestClient } from '#/api/request';

const prefix = 'transfer-prescription/';

/**
 * 获取转诊详情
 * @param id 转诊ID
 */
export async function getTransferPrescriptionDetailApi(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 根据挂号ID获取转诊信息
 * @param registerId 挂号ID
 */
export async function getTransferPrescriptionByRegisterApi(registerId: number) {
  return requestClient.get<any>(`${prefix}get-by-register`, { params: { register_id: registerId } });
}

/**
 * 确认转诊
 * @param id 转诊ID
 */
export async function confirmTransferPrescriptionApi(id: number) {
  return requestClient.post<any>(`${prefix}confirm`, { id });
}

/**
 * 一键导入处方到在线问诊
 * @param id 转诊ID
 * @param registerId 挂号ID
 */
export async function importTransferPrescriptionApi(id: number, registerId: number) {
  return requestClient.post<any>(`${prefix}import`, { id, register_id: registerId });
}
