import request from '/@/utils/request';
import { AxiosPromise } from 'axios';
import type { IRevisitrRecordTemp, IRevisitrRecordTempListRes } from './types';
import type { ICommonListParams } from '../common.type';


/**
 * 保存病情描述模板
 * @param data 
 * @returns 
 */
export function revisitrRecordTempSaveApi(data: IRevisitrRecordTemp) {
    return request({
		url: '/revisit/record/template/save',
		method: 'post',
		data,
	}); 
}

/**
 * 获取病情描述模板列表
 * @param parmas 
 * @returns 
 */
export function revisitrRecordTempListApi(params: ICommonListParams): AxiosPromise<IRevisitrRecordTempListRes> {
    return request({
		url: '/revisit/record/template/list',
		method: 'post',
		params
	}); 
}

/**
 * 删除病情描述模板
 * @param id 
 * @returns 
 */
export function revisitrRecordTempDelApi(id: number) {
    return request({
		url: '/revisit/record/template/delete',
		method: 'post',
		params: { id }
	}); 
}


/**
 * 根据code获取病情描述模板详情
 * @param code 
 * @returns 
 */
export function revisitrRecordTempDetailByCodeApi(code: string) :AxiosPromise<IRevisitrRecordTemp> {
	return request({
		url: '/revisit/record/template/detail2',
		method: 'post',
		params: { code }
	})
}
