import request from '/@/utils/request';

export function Add(params: any) {
	return request({
		url: '/client/info/add',
		method: 'post',
		data: params,
	});
}
export function update(params: any) {
	return request({
		url: '/client/info/update',
		method: 'post',
		data: params,
	});
}
export function updateReportTemplate(params: string) {
	return request({
		url: '/client/info/updateReportTemplate',
		method: 'post',
		data: params,
	});
}
export function deleteId(params: string) {
	return request({
		url: '/client/info/delete',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		data: params,
	});
}
export function publicClient(params: string) {
	return request({
		url: '/client/info/list/public',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		data: params,
	});
}

export function list(params: object) {
	return request({
		url: '/client/info/list',
		method: 'post',
		params,
	});
}
export function listUsers(params: object) {
	return request({
		url: '/client/info/listUsers',
		method: 'post',
		params,
	});
}
export function standardList(params: object) {
	return request({
		url: '/staff/schedule/standard/list',
		method: 'post',
		params,
	});
}
export function standardSave(params: object) {
	return request({
		url: '/staff/schedule/standard/save',
		method: 'post',
		data: params,
	});
}
export function doSelectSummary(params: object) {
	return request({
		url: '/staff/schedule/doSelectSummary',
		method: 'post',
		data: params,
	});
}

/**
 * HIS自定义的维护菜单数据来源
 * @returns
 */
export function listHisTypesApi() {
	return request({
		url: '/client/info/listHisTypes',
		method: 'post',
	});
}

/**
 * 同步HIS系统医护人员
 * @param clientCode
 * @returns
 */
export function synchronousHisMedicalStaffApi(clientCode: string) {
	return request({
		url: '/his/staff/syncHisStaff',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode: clientCode },
	});
}

/**
 * 同步HIS系统科室
 * @param clientCode
 * @returns
 */
export function synchronousHisDepartmentApi(clientCode: string) {
	return request({
		url: '/his/dept/syncHisDept',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode: clientCode },
	});
}

/**
 * 同步药物用法
 * @param clientCode
 * @returns
 */
export function syncUseMethodsApi(clientCode: string) {
	return request({
		url: '/his/syncUseMethods',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}

/**
 * 同步使用频率
 * @param clientCode
 * @returns
 */
export function syncUseFreqencyAPi(clientCode: string) {
	return request({
		url: '/his/syncUseFreqency',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode: clientCode },
	});
}

/**
 * 同步药物
 * @param clientCode
 * @returns
 */
export function synchronousMedicationApi(clientCode: string) {
	return request({
		url: '/his/syncDrugs',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}

/**
 * "同步收费项目字典
 * @param clientCode
 * @returns
 */
export function syncChargeItemsApi(clientCode: string) {
	return request({
		url: '/his/syncChargeItems',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}

/**
 * 同步收费菜单
 * @param clientCode
 * @returns
 */
export function synchronizeBillingMenuApi(clientCode: string) {
	return request({
		url: '/his/syncCombo',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}

/**
 * HIS诊断字典同步
 * @param clientCode
 * @returns
 */
export function doSyncApi(clientCode: string) {
	return request({
		url: '/his/diagnose/sync/doSync',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}

/**
 * HIS药房同步
 * @param clientCode
 * @returns
 */
export function pharmacyApi(clientCode: string) {
	return request({
		url: '/his/pharmacy/sync',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}

/**
 * 同步报销方式
 * @param clientCode
 * @returns
 */
export function syncBxfsAPi(clientCode: string) {
	return request({
		url: '/his/syncHisBxfs',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}
export function getCityWeather(params: any) {
	return request({
		url: 'https://restapi.amap.com/v3/weather/weatherInfo',
		method: 'get',
		data: params,
	});
}

/**
 * 同步药物单位
 * @param clientCode
 * @returns
 */
export function syncDrugUnitsAPi(clientCode: string) {
	return request({
		url: '/his/syncDrugUnits',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
		params: { clientCode },
	});
}