Browse Source

Merge branch 'dev' of huangzhanpeng/wlyy_management into dev

lyr 8 năm trước cách đây
mục cha
commit
1892054626

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/Patient.java

@ -45,6 +45,8 @@ public class Patient extends IdEntity implements Serializable {
	private Integer sex;
	// 手機號
	private String mobile;
	// (基卫)手機號
	private String mobileRemarks;
	// 聯繫電話
	private String phone;
	// 社保卡號
@ -334,4 +336,12 @@ public class Patient extends IdEntity implements Serializable {
	public void setLabelInfos(List<SignPatientLabelInfo> labelInfos) {
		this.labelInfos = labelInfos;
	}
	public String getMobileRemarks() {
		return mobileRemarks;
	}
	public void setMobileRemarks(String mobileRemarks) {
		this.mobileRemarks = mobileRemarks;
	}
}

+ 28 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/archives/PatientEventService.java

@ -55,6 +55,28 @@ public class PatientEventService {
        return re;
    }
    /**
     * 删除就诊事件
     */
    @Transactional
    public void deleteEvent(String id) throws Exception
    {
        Long eventId =Long.valueOf(id);
        PatientEvent event = patientEventDao.findOne(eventId);
        if(event!=null)
        {
            List<PatientEventImg> list = patientEventImgDao.findByEventId(eventId);
            if(list!=null && list.size()>0)
            {
                patientEventImgDao.delete(list);
            }
            patientEventDao.delete(event);
        }
        else{
            throw new Exception("不存在该就诊事件!");
        }
    }
    /**
     * 保存就诊事件详情
     */
@ -65,7 +87,12 @@ public class PatientEventService {
        PatientEvent event = new PatientEvent();
        if(!StringUtils.isEmpty(json.optString("id")))
        {
            event.setId(json.getLong("id"));
            //判断是否存在
            event =patientEventDao.findOne(json.getLong("id"));
            if(event==null)
            {
                throw new Exception("不存在该就诊事件!");
            }
        }
        else{
            event.setCreateTime(new Date());

+ 8 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/archives/PatientRecordService.java

@ -216,10 +216,11 @@ public class PatientRecordService {
        String response = jwSmjkService.getExamAndLabReport(patient.getSsc(), page, pageSize);     //【基卫接口】
        //获取app数据
        String sql = "select a.*,b.img_type as catalog,GROUP_CONCAT(b.img_label) as label from wlyy_patient_event a\n" +
                "left join wlyy_patient_event_img b on b.event_id=a.id and b.img_type in ('检查报告','检验报告')\n" +
                "where a.patient='" + patientCode + "'\n" +
                "group by b.img_type order by a.event_date desc";
        String sql = "select a.*,b.img_type as catalog,GROUP_CONCAT(b.img_label) as label \n" +
                "from wlyy_patient_event a,wlyy_patient_event_img b\n" +
                "where a.patient='"+patientCode+"' and b.event_id=a.id and b.img_type in ('检查报告','检验报告')  \n" +
                "group by b.event_id,b.img_type order by a.event_date desc";
        List<Map<String, Object>> appList = jdbcTemplate.queryForList(sql);
        if (!StringUtils.isEmpty(response)) {
@ -246,7 +247,7 @@ public class PatientRecordService {
                re.add(map);
            }
            //*******过滤
            //过滤
            for (Map<String, Object> item : appList) {
                Map<String, String> map = new HashMap<>();
                map.put("id", item.get("id").toString());
@ -269,7 +270,8 @@ public class PatientRecordService {
            //排序
            re = sortMapList(re, "eventDate", "DESC");
        } else {
        }
        else {
            for (Map<String, Object> item : appList) {
                Map<String, String> map = new HashMap<>();
                map.put("id", String.valueOf(item.get("id")));

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

@ -16,6 +16,7 @@ import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.task.FollowupUploadTask;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@ -67,6 +68,12 @@ public class FollowUpService extends BaseService {
			re.put("patientCode",patientCode);
			re.put("patientName",patient.getName());
			re.put("idcard",patient.getIdcard());
			String mobile = patient.getMobile();
			if(StringUtils.isEmpty(mobile))
			{
				mobile = patient.getMobileRemarks();
			}
			re.put("mobile", mobile);
			re.put("sex",String.valueOf(patient.getSex()));
			re.put("birthday",DateUtil.dateToStrLong(patient.getBirthday()));
			re.put("photo",patient.getPhoto());
@ -209,6 +216,25 @@ public class FollowUpService extends BaseService {
		}
	}
	/**
	 *编辑随访计划
	 */
	public void editFollowupPlan(String doctorCode,String id,String date,String followupType) throws Exception {
		Followup followup = followupDao.findOne(Long.valueOf(id));
		if(followup!=null)
		{
			followup.setFollowupDate(DateUtil.strToDate(date));
			followup.setFollowupType(followupType);
			followup.setCreater(doctorCode);
			followupDao.save(followup);
		}
		else{
			throw new Exception("not exit follow:"+id+".\r\n");
		}
	}
	/**
	 *开始随访记录
	 */

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

@ -95,6 +95,23 @@ public class DoctorFollowUpController extends BaseController {
		}
	}
	@ApiOperation("编辑随访计划")
	@RequestMapping(value = "/editFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	public String editFollowupPlan(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
								@RequestParam(value="id",required = true) String id,
								@ApiParam(name="date",value="随访时间",defaultValue = "2016-12-14 20:00:00")
								@RequestParam(value="date",required = true) String date,
								@ApiParam(name="followupType",value="随访方式【字典FOLLOWUP_WAY_DICT】",defaultValue = "12")
								@RequestParam(value="followupType",required = true) String followupType) {
		try {
			followUpService.editFollowupPlan(getUID(),id,date,followupType);
			return write(200, "编辑随访计划成功!");
		} catch (Exception e) {
			return invalidUserException(e, -1, "编辑随访计划失败!"+e.getMessage());
		}
	}
	@ApiOperation("开始随访记录")
	@RequestMapping(value = "/startFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)

+ 14 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -123,7 +123,7 @@ public class PatientArchivesController extends WeixinBaseController {
                                    @RequestParam(value="pageSize",required = true) String pageSize)
    {
        try {
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getUID(), page, pageSize);
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport("P20161008001", page, pageSize);
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {
@ -162,7 +162,20 @@ public class PatientArchivesController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/event/delete", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("删除就诊事件")
    public String deleteEvent(@ApiParam(name="event",value="就诊事件id",defaultValue = "")
                                  @RequestParam(value="event",required = true) String event)
    {
        try {
            patientEventService.deleteEvent(event);
            return write(200, "删除就诊事件成功!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "删除就诊事件失败!");
        }
    }
    @RequestMapping(value = "/event/uploadImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody