// import request from '../jsIndex'
import request from "../../request.js"


// 济南
// 预约
export function screenOrder(data) {
	return request({
		url: '/nurseApplet/screening/record/save',
		data: data,
		method: 'post',
		header: {
			region: uni.getStorageSync('region'),
		}
	})
}

// 获取当前预约详情
export function getScreening(registerId) {
	return request({
		url: `/screening/getScreening/${registerId}`,
		method: 'GET'
	})
}

// 取消预约
export function cancelOrder(screeningId) {
	return request({
		url: `/screening/cancel/${screeningId}`,
		method: 'GET'
	})
}

// 保存血压
export function saveBP(data) {
	return request({
		url: '/health/saveBP',
		data: data,
			method: 'post'
	})
}

// 保存血糖
export function saveBG(data) {
	return request({
		url: '/health/saveBG',
		data: data,
		method: 'post'
	})
}

// 绑定设备
export function jnBindDevice(data) { //bindDevice
	return request({
		url: '/bind/bindDevice',
		data: data,
		method: 'post'
	})
}

// 查询绑定设备
export function getbindDeviceList(registerId) {
	return request({
		url: `/bind/findList/${registerId}`,
		method: 'get'
	})
}
// 解绑设备
export function deleteDevice(data) {
	return request({
		url: `/bind/del/${data.registerId}/${data.sn}`,
		method: 'get'
	})
}

// 激活服务
export function activateServe(data) {
	return request({
		url: '/resident/activatePackage',
		data: data,
		method: 'post'
	})
}
// 是否已激活服务
export function whetherActivate(registerId) {
	return request({
		url: `/resident/getByResident/${registerId}`,
		method: 'get'
	})
}
// 获取最新的处方记录
export function newPrescription(registerId) {
	return request({
		url: `/prescriptionRecord/getLastRecord/${registerId}`,
		method: 'get'
	})
}
// 查询处方记录
export function prescriptionRecord(registerId) {
	return request({
		url: `/prescriptionRecord/getByResident/${registerId}`,
		method: 'get'
	})
}
// 查询处方详情
export function prescriptionDetail(recordId) {
	return request({
		url: `/preRecordDetail/getByRecord/${recordId}`,
		method: 'get'
	})
}
// 获取筛查结果列表
export function screeningResultList(registerId) {
	return request({
		url: `/screening/record?registerId=${registerId}`,
		method: 'get'
	})
}
// 获取最新的筛查结果
export function lastScreeningResult(registerId) {
	return request({
		url: `/screening/last/${registerId}`,
		method: 'get'
	})
}
// 获取筛查结果详情
export function screeningResultDetail(screeningId) {
	return request({
		url: `/screening/detail/${screeningId}`,
		method: 'get'
	})
}
// 每日健康 添加饮食
export function addDiet(data) {
	return request({
		url: '/health/saveDiet',
		data: data,
		method: 'post'
	})
}
// 每日健康 添加运动
export function addSport(data) {
	return request({
		url: '/health/saveSport',
		data: data,
		method: 'get'
	})
}
// 每日健康 添加用药
export function addMedication(data) {
	return request.post({
		url: '/health/saveMedication',
		data: data
	})
}
// 获取每日健康记录
export function getEverydayHealthRecord(data) {
	return request.get({
		url: `/health/getInfo/${data.registerId}/${data.date}`
	})
}
// 获取某天饮食记录
export function getDietOfDayHealthRecord(data) {
	return request.get({
		url: `/health/getDietOfDay/${data.registerId}/${data.date}`
	})
}
// 获取某天运动记录
export function getSportOfDayHealthRecord(data) {
	return request.get({
		url: `/health/getSportOfDay/${data.registerId}/${data.date}`
	})
}
// 获取某天用药记录
export function getMedicationOfDayHealthRecord(data) {
	return request.get({
		url: `/health/getMedicationOfDay/${data.registerId}/${data.date}`
	})
}
// 获取筛查结果 图片
export function getScreeningResultPic(fileId) {
	return request.get({
		url: `/system/file/view/${fileId}`
	})
}
// 修改用户信息
export function changeUserInfo(data) {
	return request.post({
		url: '/register/update',
		data: data
	})
}
// 获取机构列表
export function getDeptList(hospitalName,cardNo) {
	return request({
		url: `/nurseApplet/hospital/getList?hospitalName=${hospitalName}&cardNo=${cardNo}`,
		method: 'get',
		header: {
			region: uni.getStorageSync('region'),
		}
	})
}
// 获取筛查项目列表
export function getProlist(data) {
	return request({
		url: '/nurseApplet/screening/project/list',
		data: data,
		method: 'get',
		header: {
			region: uni.getStorageSync('region'),
		}
	})
}
// 获取预约列表
export function getOrderList(data) {
	return request.get({
		url: '/screening/list',
		data: data
	})
}
// 获取最后一次血糖记录
export function getLastBgRecord(registerId) {
	return request.get({
		url: `/health/getLastBG/${registerId}`,
	})
}
// 获取最后一次血压 心率 记录
export function getLastBpAndHrRecord(registerId) {
	return request.get({
		url: `/health/getLastBP/${registerId}`,
	})
}
// 获取复诊记录时间轴
export function getSubsequentVisitTime(identity) {
	return request.get({
		url: `/performance/timelineList/${identity}`,
	})
}
// 获取复诊记录详情
export function getSubsequentVisitDetail(perRecordId) {
	return request.get({
		url: `/performance/getDetail/${perRecordId}`,
	})
}
// 推送筛查项目跳转查询推荐详情
export function getScreeningDetail(assessRecordId) {
	return request.get({
		url: `/screening/getInfo/${assessRecordId}`,
	})
}
// end