import request from '/@/utils/request';
import type { ICommonListParams } from '../common.type';
import type { IPatientHemoMedSchemeListReponse } from './types/index.type';
import {  AxiosPromise } from 'axios';

export function savePatientScheme(params: string) {
	return request({
		url: '/patient/vs/hemo/med/scheme/savePatientScheme',
		method: 'post',
		data: params,
	});
}
export function savePatientSchemeDetail(params: string) {
	return request({
		url: '/patient/vs/hemo/med/scheme/savePatientSchemeDetail',
		method: 'post',
		data: params,
	});
}
export function listPatSchedulesInTemplate(params: object) {
	return request({
		url: '/hemo/med/schedule/template/listPatSchedulesInTemplate',
		method: 'post',
		data: params,
	});
}

/**
 * 获取患者透析方案列表
 * @param params 
 * @returns 
 */
export function list(params: ICommonListParams) :AxiosPromise<IPatientHemoMedSchemeListReponse> {
    return request({
		url: '/patient/vs/hemo/med/scheme/list',
		method: 'post',
		headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
		params
    })
}
export function deleteId(params: string) {
	return request({
		url: '/patient/vs/hemo/med/scheme/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}


/**
 * 透析处方修改记录查询
 * @param schemeCode 
 * @returns 
 */
export function listBySchemeCodeApi (schemeCode: string) {
	return request({
		url: '/adjust/scheme/history/listBySchemeCode',
		method: 'post',
		headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params: { schemeCode }
	})
}


/**
 * 修改透析处方修改记录
 * @param data 
 * @returns 
 */
export function listBySchemeCodeUpdateApi(data: any) {
	return request({
		url: '/adjust/scheme/history/update',
		method: 'post',
		data
	})
}

