瀏覽代碼

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing 3 年之前
父節點
當前提交
7313f3c019

+ 18 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java

@ -26,10 +26,7 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
@ -131,6 +128,19 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getPatientInfoNew")
    @ApiOperation("获取居民详情页")
    public ObjEnvelop getPatientInfoNew(@ApiParam(name="patient",value = "居民id",required = true)
                                     @RequestParam(value = "patient")String patient,
                                     @ApiParam(name="patientType",value="患者类型 1老人 2 新生儿")
                                     @RequestParam(name = "patientType",required = false,defaultValue = "1")Integer patientType){
        try {
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientInfoNew(patient,patientType));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "getPatientEvent")
    @ApiOperation("获取就诊事件")
    public ObjEnvelop getPatientEvent(@ApiParam(name="patient",value = "居民id",required = true)
@ -211,9 +221,11 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getPatientMonitoringInfo")
    @ApiOperation("获取居民安监护信息")
    public String getHealthIndexInfo(@ApiParam(name="patient",value="患者代码",defaultValue = "808080eb7917a3be017918a979380055")
                                     @RequestParam(value="patient",required = true) String patient){
                                     @RequestParam(value="patient",required = true) String patient,
                                     @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = false)
                                     @RequestParam(value = "topicItem",required = false) String topicItem){
        try {
            return baseController.write (200,"查询成功","data",patientInfoPlatFormService.getPatientMonitoringInfo(patient));
            return baseController.write (200,"查询成功","data",securityMonitoringOrderService.patientMonitoringInfo(patient,topicItem));
        }catch (Exception e){
            return baseController.errorResult(e);
        }

+ 59 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -142,6 +142,65 @@ public class PatientInfoPlatFormService {
        return null;
    }
    /**
     * 老人--基本信息
     * @param patient
     * @param patientType 1老人 2新生儿
     * @return
     */
    public JSONObject getPatientInfoNew(String patient,Integer patientType){
        JSONObject result = new JSONObject();
        JSONObject tmp = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
            tmp.put("name",patientDO.getName());
            tmp.put("sex",patientDO.getSex());
            tmp.put("address",patientDO.getAddress());
            tmp.put("address",patientDO.getAddress());
            tmp.put("patient",patientDO.getId());
            String idcard = patientDO.getIdcard();
            if (StringUtils.isNotBlank(idcard)){
                Integer age = IdCardUtil.getAgeForIdcard(idcard);
                tmp.put("age",age);
            }else {
                tmp.put("age",null);
            }
            //标签类型
            List<String> labelList = new ArrayList<>();
            Integer sex = patientDO.getSex();
            String sexName = sex!=null?(1==sex?"男性":"女性"):"未知";
            labelList.add(sexName);
            List<WlyyPatientLabelDO> labelDOS = patientLabelDao.findByPatient(patient);
            List<String> labeltmp = labelDOS.stream().map(WlyyPatientLabelDO::getLabelName).collect(Collectors.toList());
            labelList.addAll(labeltmp);
            tmp.put("patientLabel",labelList);
            result.put("patientInfo",tmp);//基本信息
            result.put("patientDevices",getDevices(patient,patientType));//健康设备
            if (1==patientType){
                result.put("signService",getSignService(patient));//签约服务
//                result.put("MonitoringInfo",getPatientMonitoringInfo(patient));//安防监护信息调用另外一个接口
            }
            if (2==patientType){
                result.put("entranceOrgList",getEntranceOrgList(patient));//入园机构列表(报名且录取机构)
                result.put("MonitoringInfo",getMonitoringInfo(patient)); //新生儿入院信息
            }
            //能力评估
            try{
                CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordService.findAssessmentByPatientId(patient);
                result.put("capAssRecordDO",recordDO);
            }catch (Exception e){
                e.printStackTrace();
            }
            //能力状况
            BaseCapacityLabelDO capacityLabelDO = capacityLabelDao.findByPatient(patient);
            result.put("capacityLabelDO",capacityLabelDO);
            return result;
        }
        return null;
    }
    /**
     * 老人--获取签约服务
     * @param patient