yeshijie %!s(int64=7) %!d(string=hai) anos
pai
achega
09be624182

+ 66 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -78,6 +78,72 @@ public class PatientHealthIndexService extends BaseService {
    @Autowired
    private DoctorHealthStandardDao doctorHealthStandardDao;
    /**
     * 获取居民标准预警值
     * @param type
     * @param patientCode
     * @return
     */
    public JSONObject getealthStandard(Integer type,String patientCode){
        //血糖校验
        JSONObject json = new JSONObject();
        if (type == 1) {
            // 血糖记录,查询患者血糖预警值
            PatientHealthStandard standard = patientHealthStandardDao.findByPatientType(patientCode, 1);
            Double maxValueBefore = SystemConf.HEALTH_STANDARD_ST_MAX_BEFORE;
            Double minValueBefore = SystemConf.HEALTH_STANDARD_ST_MIN_BEFORE;
            Double maxValueAfter = SystemConf.HEALTH_STANDARD_ST_MAX_AFTER;
            Double minValueAfter = SystemConf.HEALTH_STANDARD_ST_MIN_AFTER;
            if (standard != null) {
                if (standard.getMaxValue1() > 0) {
                    maxValueBefore = standard.getMaxValue1();
                }
                if (standard.getMinValue1() > 0) {
                    minValueBefore = standard.getMinValue1();
                }
                if (standard.getMaxValue2() > 0) {
                    maxValueAfter = standard.getMaxValue2();
                }
                if (standard.getMinValue2() > 0) {
                    minValueAfter = standard.getMinValue2();
                }
            }
            json.put("maxValueAfter",maxValueAfter);
            json.put("maxValueBefore",maxValueBefore);
            json.put("minValueBefore",minValueBefore);
            json.put("minValueAfter",minValueAfter);
        }
        //血压校验
        else if (type == 2) {
            // 血压记录,查询患者血压预警值
            PatientHealthStandard standard = patientHealthStandardDao.findByPatientType(patientCode, 2);
            Double maxValueSSY = SystemConf.HEALTH_STANDARD_SSY_MAX;
            Double minValueSSY = SystemConf.HEALTH_STANDARD_SSY_MIN;
            Double maxValueSZY = SystemConf.HEALTH_STANDARD_SZY_MAX;
            Double minValueSZY = SystemConf.HEALTH_STANDARD_SZY_MIN;
            if (standard != null) {
                if (standard.getMaxValue1() > 0) {
                    maxValueSSY = standard.getMaxValue1();
                }
                if (standard.getMinValue1() > 0) {
                    minValueSSY = standard.getMinValue1();
                }
                if (standard.getMaxValue2() > 0) {
                    maxValueSZY = standard.getMaxValue2();
                }
                if (standard.getMinValue2() > 0) {
                    minValueSZY = standard.getMinValue2();
                }
            }
            json.put("minValueSZY",minValueSZY);
            json.put("maxValueSZY",maxValueSZY);
            json.put("minValueSSY",minValueSSY);
            json.put("maxValueSSY",maxValueSSY);
        }
        return json;
    }
    //更改接口(包括手动记录的修改和所有的删除)

+ 19 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.device.PatientHealthTime;
import com.yihu.wlyy.repository.deviece.PatientHealthTimeDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -44,6 +45,8 @@ public class PatientDeviceController extends BaseController {
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private HttpClientUtil HttpClientUtil;
    @Autowired
    private PatientHealthIndexService patientHealthIndexService;
    @Value("${yihu.yihu_OpenPlatform_url}")
    private String url;
@ -56,6 +59,22 @@ public class PatientDeviceController extends BaseController {
    private ObjectMapper objectMapper = new ObjectMapper();
    @ApiOperation("获取居民标准体征预警值")
    @RequestMapping(value = "getDeviceStandard", method = RequestMethod.GET)
    @ResponseBody
    public String getDeviceStandard(@ApiParam(name = "type", value = "类型1血糖,2血压", defaultValue = "1")
                                    @RequestParam(value = "type", required = true) Integer type){
        try {
            JSONObject json = patientHealthIndexService.getealthStandard(type,getRepUID());
//            JSONObject json = patientHealthIndexService.getealthStandard(type,"55714b6358984348a4d37e1de328ae45");
            return write(200,"获取成功","data",json);
        } catch (Exception ex) {
            error(ex);
            return error(-1,"获取失败");
        }
    }
    /**
     * 设置及修改血糖仪时间段