Commit fef6c9feb5e5a95e138f4725f417ef3a2e379a1e

Authored by yangfei
1 parent 34ba2fb593

听力诊断模块

Showing 7 changed files with 442 additions and 2 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarHearingDiagnose.java View file @ fef6c9f
1 1 package com.lyms.platform.permission.model;
2 2  
  3 +import com.lyms.platform.common.dao.BaseQuery;
  4 +
3 5 import java.util.Date;
4 6  
5   -public class BabyPatientExtendEarHearingDiagnose {
  7 +public class BabyPatientExtendEarHearingDiagnose extends BaseQuery{
6 8  
7 9 /**
8 10 * 主键
platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarHearingDiagnose.xml View file @ fef6c9f
... ... @@ -803,6 +803,87 @@
803 803 <include refid="BabyPatientExtendEarHearingDiagnoseCondition"/>
804 804 </select>
805 805  
  806 + <select id="getHdAndScreenCount" resultType="int"
  807 + parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarHearingDiagnoseQuery">
  808 + select count(1) from (
  809 + select hd.id,hd.baby_id,max(hd.diagnose_time) diagnose_time,hd.high_factor,hd.confirm_result,hd.diagn_doctor_id,diagn_result,isconfirm,diagn_hand_sugge
  810 + from baby_patient_extend_ear_hearing_diagnose hd
  811 + <where>
  812 +
  813 + <if test="diagnoseStartTime!=null">
  814 + AND
  815 + <![CDATA[
  816 + DATEDIFF(#{diagnoseStartTime},hd.diagnose_time) <=0
  817 + ]]>
  818 + </if>
  819 + <if test="diagnoseEndTime!=null">
  820 + and
  821 + <![CDATA[
  822 + DATEDIFF(#{diagnoseEndTime},hd.diagnose_time) >=0
  823 + ]]>
  824 + </if>
  825 + <if test="diagnDoctorId!=null">
  826 + and
  827 + hd.diagn_doctor_id = #{diagnDoctorId}
  828 + </if>
  829 + <if test="diagnNextStartTime!=null">
  830 + and
  831 + <![CDATA[
  832 + DATEDIFF(#{diagnNextStartTime},hd.diagn_next_time)<=0
  833 + ]]>
  834 + </if>
  835 + <if test="diagnNextEndTime!=null">
  836 + AND
  837 + <![CDATA[
  838 + DATEDIFF(#{diagnNextEndTime},hd.diagn_next_time) >=0
  839 + ]]>
  840 + </if>
  841 + <if test="isconfirm!=null">
  842 + AND
  843 + hd.isconfirm = #{isconfirm}
  844 + </if>
  845 + <if test="isconfirm!=null">
  846 + and
  847 + hd.confirm_result like concat("%",#{confirmResult},"%")
  848 + </if>
  849 + <if test="confirmStartTime!=null">
  850 + and
  851 + <![CDATA[
  852 + DATEDIFF(#{confirmStartTime},hd.confirm_time)<=0
  853 + ]]>
  854 + </if>
  855 + <if test="confirmEndTime!=null">
  856 + AND
  857 + <![CDATA[
  858 + DATEDIFF(#{confirmEndTime},hd.confirm_time) >=0
  859 + ]]>
  860 + </if>
  861 +
  862 + <if test="babyIds!=null">
  863 + and baby_id in (
  864 + <foreach item="babyId" collection="babyIds" separator="," >
  865 + #{babyId}
  866 + </foreach>
  867 + )
  868 + </if>
  869 +
  870 + <if test="confirmResult != null and confirmResult != ''">
  871 + and confirm_result like concat("%,",#{confirmResult,jdbcType=VARCHAR},",%")
  872 + </if>
  873 +
  874 + <if test="confirmResults!=null">
  875 + and (
  876 + <foreach item="cfrs" collection="confirmResults" separator=" or ">
  877 + confirm_result like concat("%",#{cfrs,jdbcType=VARCHAR},"%")
  878 + </foreach>
  879 + )
  880 + </if>
  881 + group by baby_id
  882 + )a
  883 + </where>
  884 + </select>
  885 +
  886 +
806 887 <select id="getHdAndScreen" resultMap="BabyPatientExtendEarHearingDiagnoseResultMap"
807 888 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarHearingDiagnoseQuery">
808 889 select hd.id,hd.baby_id,max(hd.diagnose_time) diagnose_time,hd.high_factor,hd.confirm_result,hd.diagn_doctor_id,diagn_result,isconfirm,diagn_hand_sugge
... ... @@ -879,6 +960,7 @@
879 960 </if>
880 961 group by baby_id
881 962 </where>
  963 + <include refid="orderAndLimit"/>
882 964 </select>
883 965  
884 966 </mapper>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java View file @ fef6c9f
... ... @@ -237,6 +237,7 @@
237 237 query.setFollowUpStartTime(fur.getFollowUpStartTime());
238 238 query.setFollowUpEndTime(fur.getFollowUpEndTime());
239 239 query.setFollowDoctorId(fur.getFollowDoctorId());
  240 + query.setIfdel(0);
240 241  
241 242 //如果查询号不为空,根据查询号查询儿童档案表,获取儿童档案Id
242 243 if (fur.getKeyWord() != null) {//关键字:姓名、联系方式、就诊卡 查询babyId
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java View file @ fef6c9f
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.platform.common.annotation.TokenRequired;
  4 +import com.lyms.platform.common.base.BaseController;
  5 +import com.lyms.platform.common.base.LoginContext;
  6 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  7 +import com.lyms.platform.common.enums.ConfirmedEnums;
  8 +import com.lyms.platform.common.enums.HighRiskEnum;
  9 +import com.lyms.platform.common.result.BaseListResponse;
  10 +import com.lyms.platform.common.result.BaseResponse;
  11 +import com.lyms.platform.common.utils.DateUtil;
  12 +import com.lyms.platform.operate.web.facade.AutoMatchFacade;
  13 +import com.lyms.platform.operate.web.request.HearDiaManageRequest;
  14 +import com.lyms.platform.operate.web.result.HearingDiagnoseListResult;
  15 +import com.lyms.platform.permission.model.BabyPatientExtendEarHearingDiagnose;
  16 +import com.lyms.platform.permission.model.BabyPatientExtendEarHearingDiagnoseQuery;
  17 +import com.lyms.platform.permission.model.Users;
  18 +import com.lyms.platform.permission.service.BabyPatientExtendEarHearingDiagnoseService;
  19 +import com.lyms.platform.permission.service.UsersService;
  20 +import org.apache.commons.lang.StringUtils;
  21 +import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.stereotype.Controller;
  23 +import org.springframework.web.bind.annotation.RequestMapping;
  24 +import org.springframework.web.bind.annotation.RequestMethod;
  25 +import org.springframework.web.bind.annotation.ResponseBody;
  26 +
  27 +import javax.servlet.http.HttpServletRequest;
  28 +import java.util.ArrayList;
  29 +import java.util.HashMap;
  30 +import java.util.List;
  31 +import java.util.Map;
  32 +
  33 +/**
  34 + * @auther yangfei
  35 + * @createTime 2017年07月26日 15时56分
  36 + * @discription 儿童听力管理
  37 + */
  38 +@Controller
  39 +@RequestMapping("hearDiaManage")
  40 +public class HearDiagnManageController extends BaseController {
  41 + @Autowired
  42 + private BabyPatientExtendEarHearingDiagnoseService hearingDiagnoseService;
  43 + @Autowired
  44 + private AutoMatchFacade autoMatchFacade;
  45 + @Autowired
  46 + private UsersService usersService;
  47 +
  48 + /**
  49 + * 获取确诊儿童列表(听力诊断表,当前医院的确诊的数据)
  50 + *
  51 + * @return
  52 + */
  53 + @RequestMapping(method = RequestMethod.GET, value = "/getConfirmDiagList")
  54 + @ResponseBody
  55 + @TokenRequired
  56 + public BaseResponse getConfirmDiagList(HearDiaManageRequest hdReq, HttpServletRequest request) {
  57 + //获取当前登录用户ID
  58 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  59 + if (loginState == null) {
  60 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
  61 + }
  62 +//当前登录人医院Id
  63 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  64 +
  65 + BabyPatientExtendEarHearingDiagnoseQuery query = new BabyPatientExtendEarHearingDiagnoseQuery();
  66 +
  67 + query.setHospitalId(hospitalId);
  68 + if (hdReq.getDiagnDoctorId() != null) {//诊断医生
  69 + query.setDiagnDoctorId(hdReq.getDiagnDoctorId());
  70 + }
  71 +
  72 + if (hdReq.getConfirmStartTime() != null) {//确诊开始时间
  73 + query.setConfirmStartTime(hdReq.getConfirmStartTime());
  74 + }
  75 +
  76 + if (hdReq.getConfirmEndTime() != null) {//确诊结束时间
  77 + query.setConfirmEndTime(hdReq.getConfirmEndTime());
  78 + }
  79 + //设置确诊
  80 + query.setIsconfirm(1);
  81 + if (hdReq.getConfirmDegree() != null) {//模糊查询确诊结果
  82 + List<String> cfList = new ArrayList<>();
  83 + if (hdReq.getConfirmDegree() == 1) {//轻度
  84 + cfList.add(",1,");
  85 + cfList.add(",2,");
  86 + cfList.add(",3,");
  87 + } else if (hdReq.getConfirmDegree() == 2) {//中度
  88 + cfList.add(",4,");
  89 + cfList.add(",5,");
  90 + cfList.add(",6,");
  91 + } else if (hdReq.getConfirmDegree() == 3) {//重度
  92 + cfList.add(",7,");
  93 + cfList.add(",8,");
  94 + cfList.add(",9,");
  95 + cfList.add(",10,");
  96 + cfList.add(",11,");
  97 + cfList.add(",12,");
  98 + } else if (hdReq.getConfirmDegree() == 4) {//极重度
  99 + cfList.add(",13,");
  100 + cfList.add(",14,");
  101 + cfList.add(",15,");
  102 + }
  103 + query.setConfirmResults(cfList.toArray(new String[cfList.size()]));
  104 + }
  105 + query.setSort("diagnose_time");
  106 + query.setNeed("1");
  107 +
  108 + List<BabyPatientExtendEarHearingDiagnose> hearingDiagnoseList = hearingDiagnoseService.getHdAndScreen(query);
  109 +
  110 + List<HearingDiagnoseListResult> hdList = new ArrayList<>();
  111 +
  112 + for(BabyPatientExtendEarHearingDiagnose hd :hearingDiagnoseList ){
  113 + HearingDiagnoseListResult hea = new HearingDiagnoseListResult();
  114 + hea.setIsconfirm(hd.getIsconfirm() == null ? "未确诊" : hd.getIsconfirm() == 0 ? "未确诊" : "已确诊");
  115 + hea.setId(hd.getId());
  116 + hea.setDiagnoseTime(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime()));
  117 + String docotorId = hd.getDiagnDoctorId();
  118 + Users users = usersService.getUsers(Integer.parseInt(docotorId==null?"0":docotorId));
  119 + if (users != null) {
  120 + hea.setDoctorName(users.getName() == null ? "-" : users.getName());
  121 + }
  122 + hea.setHdTime(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime())));
  123 + if (hd.getHighFactor() != null) {
  124 + String hf[] = hd.getHighFactor().split(",");
  125 + // List<Map<Integer, String>> highRiskEnums = new ArrayList<>();
  126 + StringBuffer hrSb = new StringBuffer();
  127 + for (int b = 0; b < hf.length; b++) {
  128 + if (StringUtils.isNotEmpty(hf[b])) {
  129 + Map<Integer, String> map = new HashMap<>();
  130 + String title = HighRiskEnum.getTitle(Integer.parseInt(hf[b]));
  131 + map.put(Integer.parseInt(hf[b]), title);
  132 + // highRiskEnums.add(map);
  133 + hrSb.append(title+",");
  134 + }
  135 + }
  136 + // hea.setHighRiskEnums(highRiskEnums);
  137 + hea.setHighRiskEnums(hrSb.toString());
  138 + }
  139 + //确诊结果
  140 + if (hd.getConfirmResult() != null) {
  141 + String cr[] = hd.getConfirmResult().split(",");
  142 + // List<Map<Integer, String>> hdEnums = new ArrayList<>();
  143 + StringBuffer hdSb = new StringBuffer();
  144 + for (int b = 0; b < cr.length; b++) {
  145 + if (StringUtils.isNotEmpty(cr[b])) {
  146 + Map<Integer, String> map = new HashMap<>();
  147 + String title = ConfirmedEnums.getTitle(Integer.parseInt(cr[b]));
  148 + map.put(Integer.parseInt(cr[b]), title);
  149 + // hdEnums.add(map);
  150 + hdSb.append(title+",");
  151 + }
  152 + }
  153 + // hea.setDiagnResult(hdEnums);
  154 + hea.setDiagnResult(hdSb.toString());
  155 + }
  156 + hdList.add(hea);
  157 + }
  158 + BaseListResponse result = new BaseListResponse();
  159 + result.setData(hdList);
  160 + result.setPageInfo(query.getPageInfo());
  161 + return result;
  162 + }
  163 +
  164 + /**
  165 + * 获取听力可疑儿童列表(听力筛查表,当前医院的复诊未通过的数据)
  166 + *
  167 + * @param request
  168 + * @return
  169 + */
  170 + @RequestMapping(method = RequestMethod.GET, value = "/getSuspDiagList")
  171 + @ResponseBody
  172 + @TokenRequired
  173 + public BaseResponse getSuspDiagList(HearDiaManageRequest model, HttpServletRequest request) {
  174 + //获取当前登录用户ID
  175 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  176 + if (loginState == null) {
  177 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
  178 + }
  179 +//当前登录人医院Id
  180 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  181 + return null;
  182 + }
  183 +
  184 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearingDiagnoseController.java View file @ fef6c9f
... ... @@ -391,7 +391,6 @@
391 391 cfList.add(",7,");
392 392 cfList.add(",8,");
393 393 cfList.add(",9,");
394   - } else if (hdReq.getConfirmDegree() == 3) {//重度
395 394 cfList.add(",10,");
396 395 cfList.add(",11,");
397 396 cfList.add(",12,");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HearDiaManageRequest.java View file @ fef6c9f
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * @auther yangfei
  7 + * @createTime 2017年07月26日 16时26分
  8 + * @discription
  9 + */
  10 +public class HearDiaManageRequest extends BasePageQueryRequest{
  11 + /**
  12 + * 确诊开始时间
  13 + */
  14 + private Date confirmStartTime;
  15 + /**
  16 + * 确诊结束时间
  17 + */
  18 + private Date confirmEndTime;
  19 +
  20 + /**
  21 + * 出生日期开始时间
  22 + */
  23 + private Date birthStartTime;
  24 + /**
  25 + * 出生日期结束时间
  26 + */
  27 + private Date birthEndTime;
  28 + /**
  29 + * 确诊结果 0-全部,1-轻度耳聋,2-中度耳聋,3-重度耳聋,4-极重耳聋
  30 + */
  31 + private Integer confirmResult;
  32 + /**
  33 + * 确诊程度 0-全部,1-轻度,2-中度,3-重度,4-极重
  34 + */
  35 + private Integer confirmDegree;
  36 +
  37 + /**
  38 + * 诊断医生
  39 + */
  40 + private String diagnDoctorId;
  41 + /**
  42 + * 查询号:姓名、联系方式、就诊卡
  43 + */
  44 + private String keyWord;
  45 +
  46 + /**
  47 + * 听筛开始时间
  48 + */
  49 + private Date secrStartTime;
  50 + /**
  51 + * 听筛结束时间
  52 + */
  53 + private Date secrEndTime;
  54 + /**
  55 + * 状态 1-已诊断、2-待诊断、3-全部
  56 + */
  57 + private Integer status;
  58 +
  59 + /**
  60 + * 诊断开始时间
  61 + */
  62 + private Date diagnoseStartTime;
  63 + /**
  64 + * 诊断结束时间
  65 + */
  66 + private Date diagnoseEndTime;
  67 +
  68 + public Date getConfirmStartTime() {
  69 + return confirmStartTime;
  70 + }
  71 +
  72 + public void setConfirmStartTime(Date confirmStartTime) {
  73 + this.confirmStartTime = confirmStartTime;
  74 + }
  75 +
  76 + public Date getConfirmEndTime() {
  77 + return confirmEndTime;
  78 + }
  79 +
  80 + public void setConfirmEndTime(Date confirmEndTime) {
  81 + this.confirmEndTime = confirmEndTime;
  82 + }
  83 +
  84 + public Date getBirthStartTime() {
  85 + return birthStartTime;
  86 + }
  87 +
  88 + public void setBirthStartTime(Date birthStartTime) {
  89 + this.birthStartTime = birthStartTime;
  90 + }
  91 +
  92 + public Date getBirthEndTime() {
  93 + return birthEndTime;
  94 + }
  95 +
  96 + public void setBirthEndTime(Date birthEndTime) {
  97 + this.birthEndTime = birthEndTime;
  98 + }
  99 +
  100 + public Integer getConfirmResult() {
  101 + return confirmResult;
  102 + }
  103 +
  104 + public void setConfirmResult(Integer confirmResult) {
  105 + this.confirmResult = confirmResult;
  106 + }
  107 +
  108 + public Integer getConfirmDegree() {
  109 + return confirmDegree;
  110 + }
  111 +
  112 + public void setConfirmDegree(Integer confirmDegree) {
  113 + this.confirmDegree = confirmDegree;
  114 + }
  115 +
  116 + public String getDiagnDoctorId() {
  117 + return diagnDoctorId;
  118 + }
  119 +
  120 + public void setDiagnDoctorId(String diagnDoctorId) {
  121 + this.diagnDoctorId = diagnDoctorId;
  122 + }
  123 +
  124 + public String getKeyWord() {
  125 + return keyWord;
  126 + }
  127 +
  128 + public void setKeyWord(String keyWord) {
  129 + this.keyWord = keyWord;
  130 + }
  131 +
  132 + public Date getSecrStartTime() {
  133 + return secrStartTime;
  134 + }
  135 +
  136 + public void setSecrStartTime(Date secrStartTime) {
  137 + this.secrStartTime = secrStartTime;
  138 + }
  139 +
  140 + public Date getSecrEndTime() {
  141 + return secrEndTime;
  142 + }
  143 +
  144 + public void setSecrEndTime(Date secrEndTime) {
  145 + this.secrEndTime = secrEndTime;
  146 + }
  147 +
  148 + public Integer getStatus() {
  149 + return status;
  150 + }
  151 +
  152 + public void setStatus(Integer status) {
  153 + this.status = status;
  154 + }
  155 +
  156 + public Date getDiagnoseStartTime() {
  157 + return diagnoseStartTime;
  158 + }
  159 +
  160 + public void setDiagnoseStartTime(Date diagnoseStartTime) {
  161 + this.diagnoseStartTime = diagnoseStartTime;
  162 + }
  163 +
  164 + public Date getDiagnoseEndTime() {
  165 + return diagnoseEndTime;
  166 + }
  167 +
  168 + public void setDiagnoseEndTime(Date diagnoseEndTime) {
  169 + this.diagnoseEndTime = diagnoseEndTime;
  170 + }
  171 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HearingDiagnoseRequest.java View file @ fef6c9f
... ... @@ -63,6 +63,7 @@
63 63 private Date confirmEndTime;
64 64  
65 65  
  66 +
66 67 public String getDiagnDoctorId() {
67 68 return diagnDoctorId;
68 69 }