import request from '/@/utils/request';
import { AxiosPromise } from 'axios';
import type { ICommonListParams } from '/@/api/common.type';
import type { IMedFinishList, IMedFinish } from './types/patient_hemo_med_finish.type';

export function Add(params: Object) {
	return request({
		url: '/patient/hemo/med/finish/add',
		method: 'post',
		data: params,
	});
}
export function update(params: Object) {
	return request({
		url: '/patient/hemo/med/finish/update',
		method: 'post',
		data: params,
	});
}
export function deleteId(params: string) {
	return request({
		url: '/patient/hemo/med/finish/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}

/**
 * 获取患者透后小结
 * @param params 
 * @returns 
 */
export function list(params: ICommonListParams) : AxiosPromise<IMedFinishList> {
    return request({
		url: '/patient/hemo/med/finish/list',
		method: 'post',
		headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
		params
    })
}

/**
 * 保存透后小结
 * @param data 
 * @returns 
 */
export function saveMedFinishApi(data: Partial<IMedFinish>) {
	return request({
		url: '/patient/hemo/med/finish/save',
		method: 'post',
		data,
	})
}