import request from '/@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 
 * @returns 新增病情名称
 */
export function save(data:object) {
	return request({
		url: '/patient/disease/info/save',
		method: 'post',
        data
	});
}
/**
 * 
 * @returns 新增病情名称
 */
export function saveItem(data:object) {
	return request({
		url: '/patient/disease/info/record/save',
		method: 'post',
        data
	});
}
/**
* @returns 删除本日记录
*/
export function deleteItem(params:object) {
   return request({
	   url: '/patient/disease/info/record/delete',
	   method: 'post',
	   headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
		params,
   });
}
/**
 * 
 * @param params 
 * @returns 查询是否有历史没有解决的名称
 */
export function detailByDiseaseTypeName(params: object){
	return request({
		url: '/patient/disease/info/detailByDiseaseTypeName',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
/**
 * 
 * @param params 
 * @returns 查询是否有历史没有解决的名称
 */
export function list(params: object){
	return request({
		url: '/patient/disease/info/list',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
export function noResolvedCount(){
	return request({
		url: '/patient/disease/info/noResolvedCount',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
	});
}
/**
 * 
 * @param data 
 * @returns 同步带入过往记录
 */
export function useHistoryData(params: object){
	return request({
		url: '/patient/disease/info/useHistoryData',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params
	})
}
export function updateHistoryRecord(params: object){
	return request({
		url: '/patient/disease/info/record/updateHistoryRecord',
		method: 'post',
		data:params
	})
}
export function deleteMingxiId(params: object) {
	return request({
		url: '/patient/disease/info/record/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
export function listUpdateLog(params: object) {
	return request({
		url: '/patient/disease/info/record/log/listUpdateLog',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
export function listDiseaseUpdateLog(params: object) {
	return request({
		url: '/patient/disease/info/record/log/listDiseaseUpdateLog',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}


// 删除问题
export function deleteId(params: object) {
	return request({
		url: '/patient/disease/info/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}

export function todayData(params: object) {
	return request({
		url: '/patient/disease/info/record/todayData',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
// 获取明细
export function Itemslist(params: object) {
	return request({
		url: '/patient/disease/info/record/list',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
export function addList(data:object){
	return request({
		url: '/patient/diagnose/history/addList',
		method: 'post',
		data
	})
}
export function update(data:object){
	return request({
		url: '/patient/disease/info/update',
		method: 'post',
		data
	})
}

export function deletePId(params: string) {
	return request({
		url: '/patient/diagnose/history/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}

/**
 * 获取患者诊断
 * @param params 
 * @param string 
 * @param patientCode 
 * @returns 
 */
export function getDiagnoseByPatientCode(params: { patientCode: string }): AxiosPromise<string[]> {
	return request({
		url: '/patient/diagnose/history/getDiagnoseByPatientCode',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}