liubing 3 years ago
parent
commit
20754f61e2

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/DevicePatientHealthIndexDao.java

@ -58,7 +58,7 @@ public interface DevicePatientHealthIndexDao
	@Query(value = "select DATE_FORMAT(a.record_date,'%Y-%m-%d') from wlyy_patient_health_index a where a.user = ?1 and a.type=?2 and a.record_date >= ?3 and a.record_date <= ?4 and a.del = '1' group by DATE_FORMAT(a.record_date,'%Y-%m-%d') order by DATE_FORMAT(a.record_date,'%Y-%m-%d') desc limit ?5 ,?6",nativeQuery = true)
	List<String> findDateList(String patient, int type, Date start, Date end, int currentSize, int pageSize);
	
	@Query(value= " select * from wlyy_patient_health_index where type in (1,2) and record_date BETWEEN ?1 AND ?2  AND user in (select p.code from wlyy.wlyy_patient p INNER JOIN wlyy.wlyy_sign_family s on s.patient = p.code RIGHT JOIN wlyy.wlyy_sign_patient_label_info sp on sp.patient = p.code where  s.status > 0 AND s.admin_team_code = ?3 and (s.doctor = ?4 or s.doctor_health =?4) and sp.status = 1 and sp.label_type = 3 and (sp.label = 1 or sp.label = 2))",nativeQuery = true)
	@Query(value= " select * from wlyy_patient_health_index where type in (1,2) and record_date BETWEEN ?1 AND ?2  AND user in (select p.code from wlyy.wlyy_patient p INNER JOIN wlyy.wlyy_sign_family s on s.patient = p.code RIGHT JOIN wlyy_sign_patient_label_info sp on sp.patient = p.code where  s.status > 0 AND s.admin_team_code = ?3 and (s.doctor = ?4 or s.doctor_health =?4) and sp.status = 1 and sp.label_type = 3 and (sp.label = 1 or sp.label = 2))",nativeQuery = true)
	List<DevicePatientHealthIndex> findByTeamcodeAndRecordDate(Date start, Date end, String teamcode, String doctorcode);
	@Query(value="select * from wlyy_patient_health_index where user = ?1 and type = ?2 ORDER BY record_date desc limit 0 ,5",nativeQuery = true)

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

@ -174,7 +174,7 @@ public class PatientDeviceController extends BaseController {
    public ListEnvelop patientDeviceListByTopic(@ApiParam(name = "patient", value = "patient", defaultValue = "patient")
                                                @RequestParam(value = "patient", required = true) String patient,
                                                @ApiParam(name = "topic", value = "专题CODE;preventLost防走失,preventFall防跌倒", defaultValue = "preventLost")
                                                @RequestParam(value = "topic", required = true) String topic) {
                                                @RequestParam(value = "topic", required = false) String topic) {
        try {
            return ListEnvelop.getSuccess("查询成功",  patientDeviceService.patientDeviceListByTopic(patient,topic));
        } catch (Exception ex) {

+ 13 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -187,6 +187,19 @@ public class SignEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "servicePackageBypatient")
    @ApiOperation(value = "获取患者所有服务包")
    public ObjEnvelop servicePackageBypatient (
            @ApiParam(name = "patient", value = "patient", required = true)
            @RequestParam(value = "patient") String patient) throws Exception {
        try{
            return ObjEnvelop.getSuccess("查询成功",servicePackageService.servicePackageBypatient(patient));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @PostMapping(value = "servicePackageSign")
    @ApiOperation(value = "分配服务包-签约")
    @ObserverRequired

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

@ -0,0 +1,40 @@
package com.yihu.jw.care.endpoint.third.platForm;
import com.yihu.jw.care.service.third.PatientInfoPlatFormService;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
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;
/**
 * Created by Bing on 2021/6/16.
 * 管理端pc端 居民详情大屏
 */
@RestController
@RequestMapping(value = "/cloudCare/noLogin/patientInfoForm")
@Api(description = "管理端pc端 居民详情大屏")
public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PatientInfoPlatFormService patientInfoPlatFormService;
    @GetMapping(value = "getPatientInfo")
    @ApiParam("获取居民")
    public ObjEnvelop getPatientInfo(@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.getPatientInfo(patient,patientType));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("获取失败");
        }
    }
}

+ 12 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java

@ -480,11 +480,21 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    }
    /**
     * 根据服务专题获取服务项目
     * 获取患者签约服务包
     * @param patient
     * @param topicType
     * @return
     */
    public List<Map<String, Object>> servicePackageBypatient(String patient)
    {
       String sql="select  DISTINCT pack.*,CASE WHEN pack.type=1 THEN '养老服务' WHEN pack.type=2 THEN '医疗服务'\n" +
                "WHEN pack.type=3 THEN '安防监护' WHEN pack.type=4 THEN '慢病管理' ELSE pack.type\n" +
                "END as 'typeName' from base_service_package_record re, base_service_package_item item,base_service_package pack  \n" +
                "where re.service_package_id = item.service_package_id and item.service_package_id = pack.id and pack.del=1  and re.sign_id in (\n" +
                "select rd.id from base_service_package_sign_record rd  where rd.patient='"+patient+"' and rd.status=1) ";
        List<Map<String,Object>> resultSql = jdbcTemplate.queryForList(sql);
        return resultSql;
    }
    public List<Map<String, Object>> servicePackageByTopicType(String patient, String topicType)
    {
        String sql="\n" +

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

@ -0,0 +1,132 @@
package com.yihu.jw.care.service.third;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.sign.ServicePackageService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.IdCardUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
/**
 * Created by Bing on 2021/6/16.
 */
@Service
public class PatientInfoPlatFormService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private ServicePackageService servicePackageService;
    /**
     * 老人--基本信息
     * @param patient
     * @param patientType
     * @return
     */
    public JSONObject getPatientInfo(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);
            }
            //标签类型
//            tmp.put("")
        }
        return null;
    }
    /**
     * 老人--获取签约服务
     * @param patient
     * @return
     */
    public JSONObject getSignService(String patient){
        return null;
    }
    /**
     * 老人/新生儿--获取健康设备
     * @param patient
     * @return
     */
    public JSONObject getDevices(String patient,Integer patientType){
        return null;
    }
    /**
     * 老人/新生儿--获取就诊事件  暂无
     * @param patient
     * @return
     */
    public JSONObject getPatientEvent(String patient,Integer patientType){
        return null;
    }
    /**
     * 老人/新生儿--患病情况 暂无
     * @param patient
     * @param patientType
     * @return
     */
    public JSONObject getIllnessInfo(String patient,Integer patientType){
        return null;
    }
    /**
     * 老人/新生儿--服务工单列表
     * @param patient
     * @param patientType
     * @return
     */
    public JSONObject getServiceOrder(String patient,Integer patientType){
        return null;
    }
    /**
     * 老人/新生儿-- 体征信息
     * 老人:血糖、血压、身高体重、心率
     * 新生儿:体温
     * @param patient
     * @param patientType
     * @return
     */
    public JSONObject getHealthIndexInfo(String patient,Integer patientType){
        return null;
    }
    /**
     * 老人-- 安防监护信息
     * @param patient
     * @return
     */
    public JSONObject getPatientMonitoringInfo(String patient){
        return null;
    }
    /**
     * 新生儿-- 入院监护 暂无
     * @param patient
     * @return
     */
    public JSONObject getMonitoringInfo(String patient){
        return null;
    }
}

+ 1 - 1
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/YsDeviceService.java

@ -139,7 +139,7 @@ public class YsDeviceService {
                    jsonObject.put("patientPhone",patientDO.getMobile());
                    jsonObject.put("serveDesc","疑似跌倒!");
                    jsonObject.put("hospital",sqlResult.get(0).get("org_code"));
                    jsonObject.put("serveAddress",deviceDO.getAddress());
                    jsonObject.put("serveAddress",deviceDO.getSosAddress());
                    jsonObject.put("serveLat",lat);
                    jsonObject.put("serveLon",lon);
                    jsonObject.put("topicItem","preventFall");