浏览代码

服务类型

trick9191 7 年之前
父节点
当前提交
e8463dbc76

+ 89 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -69,6 +69,8 @@ public class SignPatientLabelInfoService extends BaseService {
    @Autowired
    SignPatientLabelDao labelDao;
    @Autowired
    SignPatientLabelInfoDao signPatientLabelInfoDao;
    @Autowired
    SignFamilyRenewDao signFamilyRenewDao;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ -1206,6 +1208,92 @@ public class SignPatientLabelInfoService extends BaseService {
        return 1;
    }
    /**
     * 1.3.5取缔setPatientLabels
     * 设置患者标签
     * @param patient 患者code
     * @param health 健康情况
     * @param disease 疾病类型
     * @param custom 自定义标签
     * @return
     */
    public int setPatientLabelInfos(String patient, String health, String disease, String custom){
        Patient p = patientDao.findByCode(patient);
        if (p == null) {
            return 0;
        }
        //存储健康情况,不可为空
        if(StringUtils.isNotBlank(health)){
            //删除居民所有标签信息
            String deleteSql = "DELETE FROM wlyy_sign_patient_label_info WHERE patient='"+patient+"'";
            jdbcTemplate.execute(deleteSql);
            //存储健康情况标签
            String[] healthArr = health.split(",");
            for(int i=0;i<healthArr.length;i++){
                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(healthArr[i],"2");
                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                }else{
                    return -1;
                }
                signPatientLabelInfo.setPatient(patient);
                signPatientLabelInfo.setPname(p.getName());
                signPatientLabelInfo.setLabel(healthArr[i]);
                signPatientLabelInfo.setStatus(1);
                signPatientLabelInfo.setLabelType("2");
                signPatientLabelInfo.setCzrq(new Date());
                //保存存储健康情况
                labelInfoDao.save(signPatientLabelInfo);
            }
        }else{
            return -2;
        }
        //保存疾病类型
        if(StringUtils.isNotBlank(disease)){
            String[] diseaseArr = disease.split(",");
            for(int i=0;i<diseaseArr.length;i++){
                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(diseaseArr[i],"3");
                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                }else{
                    return -1;
                }
                signPatientLabelInfo.setPatient(patient);
                signPatientLabelInfo.setPname(p.getName());
                signPatientLabelInfo.setLabel(diseaseArr[i]);
                signPatientLabelInfo.setStatus(1);
                signPatientLabelInfo.setLabelType("3");
                signPatientLabelInfo.setCzrq(new Date());
                //保存居民疾病类型
                labelInfoDao.save(signPatientLabelInfo);
            }
        }
        //保存自定义标签
        if(StringUtils.isNotBlank(custom)){
            String[] customArr = custom.split(",");
            for(int i=0;i<customArr.length;i++){
                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(customArr[i],"4");
                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                }else{
                    return -1;
                }
                signPatientLabelInfo.setPatient(patient);
                signPatientLabelInfo.setPname(p.getName());
                signPatientLabelInfo.setLabel(customArr[i]);
                signPatientLabelInfo.setLabelType("4");
                signPatientLabelInfo.setStatus(1);
                signPatientLabelInfo.setCzrq(new Date());
                //保存居民疾病类型
                labelInfoDao.save(signPatientLabelInfo);
            }
        }
        return 1;
    }
    /**
     * 设置患者标签
     *
@ -1217,6 +1305,7 @@ public class SignPatientLabelInfoService extends BaseService {
     * @param custom      自定义标签
     * @return
     */
    @Deprecated
    public int setPatientLabels(String patient, String idcard, String patientName, String health, String disease, String custom, String doctor, String caller) {
        Patient p = patientDao.findByCode(patient);

+ 3 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1069,8 +1069,7 @@ public class FamilyContractService extends BaseService {
        doctorTeamDoctor.save(wlyyDoctorTeamPatient);
        // 患者标签设置
        if (!(labelInfoService.setPatientLabels(patient.getCode(), patient.getIdcard(),
                patient.getName(), healthLabel, disease, customLabel, sf.getDoctor(), signDoctorCode) == 1)) {
        if (!(labelInfoService.setPatientLabelInfos(patient.getCode(),healthLabel, disease, customLabel) == 1)) {
            throw new Exception("patient sign label settting error:" + patient.getIdcard());
        }
@ -1407,8 +1406,8 @@ public class FamilyContractService extends BaseService {
        }
        // 患者标签设置
        if (!(labelInfoService.setPatientLabels(p.getCode(), p.getIdcard(),
                p.getName(), healthLabel, disease, customLabel, sf.getDoctor(), caller) == 1)) {
        if (!(labelInfoService.setPatientLabelInfos(p.getCode(),
                healthLabel, disease, customLabel) == 1)) {
            throw new Exception("patient sign label settting error:" + p.getIdcard());
        }

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -1444,7 +1444,8 @@ public class SignWebService extends BaseService {
                        setSevId(renew,sevId);
                        //1.3.3.2新增需求
                        //设置居民标签
                        signPatientLabelInfoService.setPatientLabels(renew.getPatient(), renew.getIdcard(),"", health, disease, custom, renew.getDoctor(), renew.getDoctor());
                        //signPatientLabelInfoService.setPatientLabels(renew.getPatient(), renew.getIdcard(),"", health, disease, custom, renew.getDoctor(), renew.getDoctor());
                        signPatientLabelInfoService.setPatientLabelInfos(renew.getPatient(), health, disease, custom);
                        //1.3.3.2设置可修改健康管理师
                        if(StringUtils.isNotBlank(healthDoctor)){
                            updateHealthDoctor(renew,healthDoctor);

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -376,7 +376,8 @@ public class SignPatientLabelInfoController extends BaseController {
                return error(-1, "健康情况标签不能为空");
            }
            //xh1D201703150222
            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, getUID(), getUID());
            //int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, getUID(), getUID());
            int result = labelInfoService.setPatientLabelInfos(patient,health, disease, custom);
//            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, "xh1D201703150222", "xh1D201703150222");
            if (result == 0) {