Explorar el Código

获取心率波动和呼吸频率

xiaoyunquan hace 2 años
padre
commit
30543297aa

+ 32 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/DoctorDeviceController.java

@ -9,6 +9,7 @@ import com.yihu.jw.care.service.common.PermissionService;
import com.yihu.jw.care.service.contacts.ContactsService;
import com.yihu.jw.care.service.device.DeviceManageService;
import com.yihu.jw.care.service.device.PatientDeviceService;
import com.yihu.jw.care.service.device.PatientHealthIndexService;
import com.yihu.jw.care.useragent.UserAgent;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.entity.patient.BaseDeviceRepairEntity;
@ -22,10 +23,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@ -51,6 +49,8 @@ public class DoctorDeviceController extends BaseController {
	private ContactsService contactsService;
	@Autowired
	UserAgent userAgent;
	@Autowired
	private PatientHealthIndexService healthIndexService;
	private ObjectMapper  objectMapper=new ObjectMapper();
@ -314,4 +314,32 @@ public class DoctorDeviceController extends BaseController {
		}
	}
	@GetMapping(value = "getHealthIndexInfoWithAvg")
	@ApiOperation("获取居民心率波动和呼吸频率--带平均值(医生端)")
	public String getHealthIndexInfoWithAvg(@ApiParam(name="patient",value="患者代码",defaultValue = "eb0b478fbe9245428ecf63cd7517206f")
											@RequestParam(value="patient",required = false) String patient,
											@ApiParam(name="type",value="健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温,7呼吸)",defaultValue = "1")
											@RequestParam(value="type",required = true) Integer type,
											@ApiParam(name="gi_type",value="就餐类型",defaultValue = "0")
											@RequestParam(value = "gi_type",required = false,defaultValue = "0") Integer gi_type,
											@ApiParam(name="begin",value="开始时间",defaultValue = "2021-10-20 00:00:00")
											@RequestParam(value="begin",required = true) String begin,
											@ApiParam(name="end",value="结束时间",defaultValue = "2021-10-21 00:00:00")
											@RequestParam(value="end",required = true) String end,
											@ApiParam(name = "deviceSn",required = false)
											@RequestParam(value = "deviceSn",required = false) String deviceSn){
		try {
			//医生端登录鉴权
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("doctorId",permissionService.getUID());
			if (permissionService.noPermission(1, jsonObject)) {
				return error(-1,"该操作没有权限");
			}
			return write(200,"查询成功","data",healthIndexService.findChartByPatientWithAvg(patient,type,gi_type,begin,end,deviceSn));
		}catch (Exception e){
			return errorResult(e);
		}
	}
}

+ 31 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -15,9 +15,7 @@ import com.yihu.jw.entity.care.device.BaseSleepPlan;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.entity.ServiceException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -27,10 +25,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
@ -62,6 +57,8 @@ public class PatientDeviceController extends BaseController {
    DeviceManageService deviceManageService;
    @Autowired
    PermissionService permissionService;
    @Autowired
    private PatientHealthIndexService healthIndexService;
@ -522,4 +519,32 @@ public class PatientDeviceController extends BaseController {
        }
    }
    @GetMapping(value = "getHealthIndexInfoWithAvg")
    @ApiOperation("获取居民心率波动和呼吸频率--带平均值(居民端)")
    public String getHealthIndexInfoWithAvg(@ApiParam(name="patient",value="患者代码",defaultValue = "eb0b478fbe9245428ecf63cd7517206f")
                                            @RequestParam(value="patient",required = false) String patient,
                                            @ApiParam(name="type",value="健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温,7呼吸)",defaultValue = "1")
                                            @RequestParam(value="type",required = true) Integer type,
                                            @ApiParam(name="gi_type",value="就餐类型",defaultValue = "0")
                                            @RequestParam(value = "gi_type",required = false,defaultValue = "0") Integer gi_type,
                                            @ApiParam(name="begin",value="开始时间",defaultValue = "2021-10-20 00:00:00")
                                            @RequestParam(value="begin",required = true) String begin,
                                            @ApiParam(name="end",value="结束时间",defaultValue = "2021-10-21 00:00:00")
                                            @RequestParam(value="end",required = true) String end,
                                            @ApiParam(name = "deviceSn",required = false)
                                            @RequestParam(value = "deviceSn",required = false) String deviceSn){
        try {
            //居民端登录鉴权
            com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
            jsonObject.put("patient",permissionService.getUID());
            if (permissionService.noPermission(1, jsonObject)) {
                return write(-1,"该操作没有权限");
            }
            return write(200,"查询成功","data",healthIndexService.findChartByPatientWithAvg(patient,type,gi_type,begin,end,deviceSn));
        }catch (Exception e){
            return errorResult(e);
        }
    }
}