import request from '/@/utils/request';
import { AxiosPromise } from 'axios';
import type { IRevisitrecordSave, IRevisitrecordListRes, IRevisitrecord } from './types';
import type { ICommonListParams } from '../common.type';


/**
 * 保存复诊记录
 * @param data 
 * @returns 
 */
export function revisitrRecordSaveApi(data: IRevisitrecordSave) {
    return request({
		url: '/revisit/record/save',
		method: 'post',
		data,
	});
}


/**
 * 获取复诊记录列表
 * @param params 
 * @returns 
 */
export function revisitrRecordListApi(params: ICommonListParams) :AxiosPromise<IRevisitrecordListRes> {
    return request({
		url: '/revisit/record/list',
		method: 'post',
		params,
	});
}

/**
 * 删除复诊记录
 * @param id 
 * @returns 
 */
export function revisitrRecordDelApi(id: number) {
    return request({
        url: '/revisit/record/delete',
		method: 'post',
		params: { id }
    })
}

/**
 * 根据code获取复诊记录详情
 * @param code 
 * @returns 
 */
export function revisitrRecordDetailByCodeApi(code: string) :AxiosPromise<IRevisitrecord> {
    return request({
        url: '/revisit/record/detail2',
		method: 'post',
		params: { code }
    })
}