Browse Source

Merge branch 'dev' of huangwenjie/patient-co-management into dev

chenweida 7 years ago
parent
commit
a37d003c0c

+ 44 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
@ -23,6 +24,7 @@ import com.yihu.wlyy.repository.consult.ConsultTeamLogDao;
import com.yihu.wlyy.repository.doctor.DoctorPatientDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
import com.yihu.wlyy.repository.followup.FollowUpDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
@ -33,6 +35,7 @@ import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionLogService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.service.third.jw.ZyDictService;
import com.yihu.wlyy.task.PushMsgTask;
@ -135,6 +138,10 @@ public class ConsultTeamService extends ConsultService {
    private PresModeAdapter presModeAdapter;
    @Autowired
    private ZyDictService zyDictService;
    @Autowired
    private PatientService patientService;
    @Autowired
    private FollowUpDao followupDao;
    //健康问题 高血压
    private static final String gxy = "HP0093";
    //健康问题 糖尿病
@ -1008,7 +1015,14 @@ public class ConsultTeamService extends ConsultService {
            ct.setDoctorName(doctor.getName());
            // 设置患者信息
            ct.setPatient(patient);
            ct.setSymptoms(type==1?"高血压":"糖尿病");
            if(1 == type){
                ct.setSymptoms("高血压");
            }else if(2 == type){
                ct.setSymptoms("糖尿病");
            }else if(3 == type){
                ct.setSymptoms("高血压,糖尿病");
            }else{}
            
            // 设置患者姓名
            ct.setName(p.getName());
            // 设置患者生日
@ -1068,6 +1082,35 @@ public class ConsultTeamService extends ConsultService {
            // 添加咨询转发记录
            // 添加医生咨询日志
            addLogs(ct);
    
            Patient patientObj = patientDao.findByCode(patient);
            
            //9、添加续方的随访记录
            Followup followup = new Followup();
            followup.setFollowupDate(new Date());
            followup.setFollowupPlanDate(new Date());
            followup.setDoctorCode(doctorCode);
            followup.setDoctorName(doctor.getName());
            followup.setOrgCode(doctor.getHospital());
            followup.setOrgName(doctor.getHospitalName());
            followup.setPatientCode(patient);
            followup.setPatientName(patientObj.getName());
            followup.setIdcard(patientObj.getIdcard());
            followup.setFollowupType(String.valueOf(type));
            if(2 == doctor.getLevel()){//全科
                followup.setFollowupClass("22");
            }else if(3 == doctor.getLevel()){//健管
                followup.setFollowupClass("10");
            }
            followup.setDataFrom("2");//数据来源 1基卫 2APP
            followup.setStatus("3");     //状态 0取消 1已完成 2未开始 3进行中
            followup.setCreateTime(new Date());
            followup.setCreater(doctorCode);
            followup.setAdminTeamCode(signFamily.getAdminTeamId());
            followup.setSignType(2);
            //保存质询code
            followup.setSignCode(patientService.getSignCodeByPatient(patient));
            followupDao.save(followup);
            return 1;
        }

+ 10 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -294,7 +294,7 @@ public class FollowUpService extends BaseService {
                        followup.put("followupClassName", "高血压");
                    }else if(objArr[4].toString().equals("2")){
                        followup.put("followupClassName", "糖尿病");
                    }else if(objArr[4].toString().equals("1,2")){
                    }else if(objArr[4].toString().equals("3")){
                        followup.put("followupClassName", "高血压,糖尿病");
                    }else{}
                }
@ -424,7 +424,7 @@ public class FollowUpService extends BaseService {
    /**
     * 开始随访记录
     */
    public void startFollowup(String id, String date, String followupType, String followupClass, String followupManagerStatus,String plandate) throws Exception {
    public void startFollowup(String id, String date, String followupType, String followupClass, String followupManagerStatus,String plandate,String prescriptioncode) throws Exception {
        Followup followup = followupDao.findOne(Long.valueOf(id));
        if (followup != null) {
            followup.setFollowupDate(DateUtil.strToDate(date));
@ -462,6 +462,7 @@ public class FollowUpService extends BaseService {
            followup.setFollowupClass(followupClass);
            followup.setFollowupManagerStatus(followupManagerStatus);
            followup.setStatus("3");  //状态 0取消 1已完成 2未开始 3进行中
            followup.setPrescriptionCode(prescriptioncode);
            followupDao.save(followup);
        } else {
@ -472,7 +473,7 @@ public class FollowUpService extends BaseService {
    /**
     * 新增临时随访记录(返回ID)
     */
    public String addFollowup(String doctorCode, String patientCode, String date, String followupType, String followupClass, String followupManagerStatus,String plandate) throws Exception {
    public String addFollowup(String doctorCode, String patientCode, String date, String followupType, String followupClass, String followupManagerStatus,String plandate,String prescriptioncode) throws Exception {
        String re = "";
        //获取医生信息
@ -508,13 +509,18 @@ public class FollowUpService extends BaseService {
        followup.setFollowupClass(followupClass);
        followup.setFollowupManagerStatus(followupManagerStatus);
        followup.setDataFrom("2");//数据来源 1基卫 2APP
        followup.setStatus("3");     //状态 0取消 1已完成 2未开始 3进行中
        followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
        followup.setCreateTime(new Date());
        followup.setCreater(doctorCode);
        followup.setAdminTeamCode(signFamily.getAdminTeamId());
        followup.setSignType(2);
        //保存质询code
        followup.setSignCode(patientService.getSignCodeByPatient(patientCode));
        
        //如果有填入续方CODE,则添加续方关联--huangwenjie.2017.11.02
        if(StringUtils.isNotBlank(prescriptioncode)){
            followup.setPrescriptionCode(prescriptioncode);
        }
        //计划下次随访时间--ysj.2017.10.26
        if(StringUtils.isNoneBlank(plandate)){

+ 10 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java

@ -166,14 +166,16 @@ public class DoctorFollowUpController extends BaseController {
                                @RequestParam(value = "date", required = true) String date,
                                @ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
                                @RequestParam(value = "followupType", required = true) String followupType,
                                @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病】", defaultValue = "1")
                                @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病,3高糖】", defaultValue = "1")
                                @RequestParam(value = "followupClass", required = true) String followupClass,
                                @ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
                                @RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
                                @ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                                @RequestParam(value = "plandate", required = false) String plandate) {
                                @RequestParam(value = "plandate", required = false) String plandate,
                                @ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "续方CODE")
                                    @RequestParam(value = "prescriptioncode", required = false) String prescriptioncode) {
        try {
            followUpService.startFollowup(id, date, followupType, followupClass, followupManagerStatus,plandate);
            followUpService.startFollowup(id, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode);
            return write(200, "开始随访记录成功!");
        } catch (Exception e) {
@ -192,14 +194,16 @@ public class DoctorFollowUpController extends BaseController {
                              @RequestParam(value = "date", required = true) String date,
                              @ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
                              @RequestParam(value = "followupType", required = true) String followupType,
                              @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病】", defaultValue = "1")
                              @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病 3高糖】", defaultValue = "1")
                              @RequestParam(value = "followupClass", required = true) String followupClass,
                              @ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
                              @RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
                              @ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                              @RequestParam(value = "plandate", required = false) String plandate) {
                              @RequestParam(value = "plandate", required = false) String plandate,
                              @ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "续方CODE")
                                  @RequestParam(value = "prescriptioncode", required = false) String prescriptioncode) {
        try {
            String response = followUpService.addFollowup(getUID(), patient, date, followupType, followupClass, followupManagerStatus,plandate);
            String response = followUpService.addFollowup(getUID(), patient, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode);
            return write(200, "新增临时随访记录成功!", "data", response);
        } catch (Exception e) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -991,7 +991,7 @@ public class ConsultController extends WeixinBaseController {
                                         @RequestParam(value = "jwCode", required = true) String jwCode,
                                         @ApiParam(name = "doctor", value = "咨询医生(开方医生、审核医生)", defaultValue = "86225d1365e711e69f7c005056850d66")
                                         @RequestParam(value = "doctor", required = true) String doctor,
                                         @ApiParam(name = "type", value = "咨询类型(1、高血压-续方咨询;2、糖尿病-续方咨询)", defaultValue = "1")
                                         @ApiParam(name = "type", value = "咨询类型(1、高血压-续方咨询;2、糖尿病-续方咨询,3、高糖-续方咨询)", defaultValue = "1")
                                         @RequestParam(value = "type", required = true) Integer type,
                                         @ApiParam(name = "adminTeamId", value = "签约行政团队id", defaultValue = "224")
                                         @RequestParam(value = "adminTeamId", required = true) Long adminTeamId,