import { AxiosPromise } from 'axios';
import request from '/@/utils/request';
import { IBodyStatePreInfo } from '/@/views/dialysis/dialysisForm/type';
import type { IComminList, ICommonListParams } from '../common.type';


interface IBodyStatePreInfoList extends Omit<IComminList, 'list'> {
	list: IBodyStatePreInfo[];
}

export function Add(params: string) {
	return request({
		url: '/patient/hemo/med/body/state/pre/add',
		method: 'post',
		data: params,
	});
}
export function update(params: string) {
	return request({
		url: '/patient/hemo/med/body/state/pre/update',
		method: 'post',
		data: params,
	});
}
export function deleteId(params: string) {
	return request({
		url: '/patient/hemo/med/body/state/pre/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}
export function list(params: ICommonListParams) :AxiosPromise<IBodyStatePreInfoList>{
    return request({
		url: '/patient/hemo/med/body/state/pre/list',
		method: 'post',
		headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
		params
    })
}

/**
 * 导出小结至病程记录
 * @param recordCode 
 * @returns 
 */
export function outputToDiseaseProgressRecordApi(recordCode: string, role: 'nurse' | 'doctor') {
	return request({
		url: '/patient/hemo/med/finish/outputToDiseaseProgressRecord',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		params: {
			recordCode,
			role
		}
	})
}
/**
 * 导出小结至病程记录
 * @param recordCode 
 * transferMode 0:普通输出 1:sse流式输出
 * @returns 
 */
export function getAIResultForRecordSummary(recordCode: string,isRebuild:number,transferMode:number) {
	return request({
		url: '/patient/hemo/med/record/getAIResultForRecordSummary',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		params: {
			recordCode,
			isRebuild,
			transferMode
		}
	})
}

