Commit bf9a882b06dcd442cbfb7d8e2f0e471910d70cd8

Authored by yangfei
1 parent 34177792a8

听力诊断模块

Showing 5 changed files with 516 additions and 16 deletions

platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml View file @ bf9a882
... ... @@ -287,10 +287,5 @@
287 287 and ifdel = 0
288 288 </where>
289 289 </select>
290   -
291   -
292   -
293   -
294   -
295 290 </mapper>
platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarHearingDiagnose.xml View file @ bf9a882
... ... @@ -818,7 +818,7 @@
818 818 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
819 819 from baby_patient_extend_ear_hearing_diagnose hd
820 820 <where>
821   -
  821 + 1 = 1
822 822 <if test="diagnoseStartTime!=null">
823 823 AND
824 824 <![CDATA[
... ... @@ -851,7 +851,7 @@
851 851 AND
852 852 hd.isconfirm = #{isconfirm}
853 853 </if>
854   - <if test="isconfirm!=null">
  854 + <if test="confirmResult!=null">
855 855 and
856 856 hd.confirm_result like concat("%",#{confirmResult},"%")
857 857 </if>
858 858  
... ... @@ -887,9 +887,9 @@
887 887 </foreach>
888 888 )
889 889 </if>
890   - group by baby_id
891   - )a
892 890 </where>
  891 + group by baby_id
  892 + )a
893 893 </select>
894 894  
895 895  
... ... @@ -898,7 +898,7 @@
898 898 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
899 899 from baby_patient_extend_ear_hearing_diagnose hd
900 900 <where>
901   -
  901 + 1=1
902 902 <if test="diagnoseStartTime!=null">
903 903 AND
904 904 <![CDATA[
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java View file @ bf9a882
... ... @@ -16,9 +16,11 @@
16 16 import com.lyms.platform.operate.web.request.HearDiaManageRequest;
17 17 import com.lyms.platform.operate.web.result.HearDiagnManageListResult;
18 18 import com.lyms.platform.operate.web.result.HearingDiagnoseListResult;
  19 +import com.lyms.platform.operate.web.utils.ResponseUtil;
19 20 import com.lyms.platform.permission.model.*;
20 21 import com.lyms.platform.permission.service.*;
21 22 import com.lyms.platform.pojo.BabyModel;
  23 +import com.lyms.platform.query.BabyModelQuery;
22 24 import org.apache.commons.collections.CollectionUtils;
23 25 import org.apache.commons.lang.StringUtils;
24 26 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -28,6 +30,7 @@
28 30 import org.springframework.web.bind.annotation.ResponseBody;
29 31  
30 32 import javax.servlet.http.HttpServletRequest;
  33 +import javax.servlet.http.HttpServletResponse;
31 34 import java.util.*;
32 35  
33 36 /**
... ... @@ -130,6 +133,158 @@
130 133 }
131 134  
132 135 /**
  136 + * 导出确诊儿童列表(听力诊断表,当前医院的确诊的数据)
  137 + *
  138 + * @return
  139 + */
  140 + @RequestMapping(method = RequestMethod.GET, value = "/extConfirmDiagList")
  141 + @ResponseBody
  142 + @TokenRequired
  143 + public void extConfirmDiagList(HearDiaManageRequest hdReq, HttpServletRequest request, HttpServletResponse resp) {
  144 + //获取当前登录用户ID
  145 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  146 + if (loginState == null) {
  147 + return ;
  148 + }
  149 + //当前登录人医院Id
  150 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  151 +
  152 + BabyPatientExtendEarHearingDiagnoseQuery query = new BabyPatientExtendEarHearingDiagnoseQuery();
  153 +
  154 + query.setHospitalId(hospitalId);
  155 + if (hdReq.getDiagnDoctorId() != null) {//诊断医生
  156 + query.setDiagnDoctorId(hdReq.getDiagnDoctorId());
  157 + }
  158 +
  159 + if (hdReq.getConfirmStartTime() != null) {//确诊开始时间
  160 + query.setConfirmStartTime(hdReq.getConfirmStartTime());
  161 + }
  162 +
  163 + if (hdReq.getConfirmEndTime() != null) {//确诊结束时间
  164 + query.setConfirmEndTime(hdReq.getConfirmEndTime());
  165 + }
  166 + //设置确诊
  167 + query.setIsconfirm(1);
  168 + if (hdReq.getConfirmDegree() != null) {//模糊查询确诊结果
  169 + List<String> cfList = new ArrayList<>();
  170 + if (hdReq.getConfirmDegree() == 1) {//轻度
  171 + cfList.add(",1,");
  172 + cfList.add(",2,");
  173 + cfList.add(",3,");
  174 + } else if (hdReq.getConfirmDegree() == 2) {//中度
  175 + cfList.add(",4,");
  176 + cfList.add(",5,");
  177 + cfList.add(",6,");
  178 + } else if (hdReq.getConfirmDegree() == 3) {//重度
  179 + cfList.add(",7,");
  180 + cfList.add(",8,");
  181 + cfList.add(",9,");
  182 + cfList.add(",10,");
  183 + cfList.add(",11,");
  184 + cfList.add(",12,");
  185 + } else if (hdReq.getConfirmDegree() == 4) {//极重度
  186 + cfList.add(",13,");
  187 + cfList.add(",14,");
  188 + cfList.add(",15,");
  189 + }
  190 + query.setConfirmResults(cfList.toArray(new String[cfList.size()]));
  191 + }
  192 + query.setSort("diagnose_time");
  193 +
  194 + List<BabyPatientExtendEarHearingDiagnose> hearingDiagnoseList = hearingDiagnoseService.getHdAndScreen(query);
  195 +
  196 + List<HearingDiagnoseListResult> hdList = new ArrayList<>();
  197 +
  198 + for (BabyPatientExtendEarHearingDiagnose hd : hearingDiagnoseList) {
  199 + HearingDiagnoseListResult hea = new HearingDiagnoseListResult();
  200 + hea.setIsconfirm(hd.getIsconfirm() == null ? "未确诊" : hd.getIsconfirm() == 0 ? "未确诊" : "已确诊");
  201 + hea.setId(hd.getId());
  202 + hea.setDiagnoseTime(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime()));
  203 + String docotorId = hd.getDiagnDoctorId();
  204 + Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId));
  205 + if (users != null) {
  206 + hea.setDoctorName(users.getName() == null ? "-" : users.getName());
  207 + }
  208 + BabyModel babyModel = babyService.getOneBabyById(hd.getBabyId());
  209 + if (babyModel != null) {
  210 + hea.setBabyName(babyModel.getName());
  211 + hea.setBabyId(hd.getBabyId());
  212 + hea.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname()));
  213 + hea.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone()));
  214 + hea.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone()));
  215 + hea.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date()));
  216 + hea.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth())));
  217 + hea.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex())));
  218 + }
  219 + hea.setHdTime(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime())));
  220 + if (hd.getHighFactor() != null) {
  221 + String hf[] = hd.getHighFactor().split(",");
  222 + StringBuffer hrSb = new StringBuffer();
  223 + for (int b = 0; b < hf.length; b++) {
  224 + if (StringUtils.isNotEmpty(hf[b])) {
  225 + Map<Integer, String> map = new HashMap<>();
  226 + String title = HighRiskEnum.getTitle(Integer.parseInt(hf[b]));
  227 + map.put(Integer.parseInt(hf[b]), title);
  228 + // highRiskEnums.add(map);
  229 + hrSb.append(title + ",");
  230 + }
  231 + }
  232 + // hea.setHighRiskEnums(highRiskEnums);
  233 + hea.setHighRiskEnums(hrSb.toString());
  234 + }
  235 + //确诊结果
  236 + if (hd.getConfirmResult() != null) {
  237 + String cr[] = hd.getConfirmResult().split(",");
  238 + StringBuffer hdSb = new StringBuffer();
  239 + for (int b = 0; b < cr.length; b++) {
  240 + if (StringUtils.isNotEmpty(cr[b])) {
  241 + Map<Integer, String> map = new HashMap<>();
  242 + String title = ConfirmedEnums.getTitle(Integer.parseInt(cr[b]));
  243 + map.put(Integer.parseInt(cr[b]), title);
  244 + // hdEnums.add(map);
  245 + hdSb.append(title + ",");
  246 + }
  247 + }
  248 + // hea.setDiagnResult(hdEnums);
  249 + hea.setDiagnResult(hdSb.toString());
  250 + }
  251 + hdList.add(hea);
  252 + }
  253 +
  254 + Map<String, String> cnames = new LinkedHashMap<>();
  255 + cnames.put("id", "#");
  256 + cnames.put("babyName", "儿童姓名");
  257 + cnames.put("mommyName", "母亲姓名");
  258 + cnames.put("monthAge", "月龄");
  259 + cnames.put("birthday", "出生日期");
  260 + cnames.put("screenType", "诊断日期");
  261 + cnames.put("sex", "性别");
  262 + cnames.put("highRiskEnums", "高危因素");
  263 + cnames.put("diagnResult", "确诊结果");
  264 + cnames.put("doctorName", "诊断医生");
  265 + cnames.put("mommnyPhone", "联系电话");
  266 +
  267 + List<Map<String, Object>> results = new ArrayList<>();
  268 + for (int i =0;i<hdList.size();i++) {
  269 + HearingDiagnoseListResult ch = hdList.get(i);
  270 + Map<String, Object> result = new LinkedHashMap<>();
  271 + result.put("id", i + 1);
  272 + result.put("babyName", ch.getBabyName());
  273 + result.put("mommyName", ch.getMommyName());
  274 + result.put("monthAge", ch.getMonthAge());
  275 + result.put("birthday", ch.getBirthday());
  276 + result.put("hdTime", ch.getHdTime());
  277 + result.put("sex", ch.getSex());
  278 + result.put("highRiskEnums", ch.getHighRiskEnums());
  279 + result.put("diagnResult", ch.getDiagnResult());
  280 + result.put("doctorName", ch.getDoctorName());
  281 + result.put("mommnyPhone", ch.getMommnyPhone());
  282 + results.add(result);
  283 + }
  284 + ResponseUtil.responseExcel(cnames,results, resp);
  285 + }
  286 +
  287 + /**
133 288 * 获取确诊儿童列表(听力诊断表,当前医院的确诊的数据)
134 289 *
135 290 * @return
... ... @@ -360,7 +515,7 @@
360 515 hearDiagnManageListResults.add(hdm);
361 516 }
362 517 }else{
363   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据");
  518 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有数据");
364 519 }
365 520 BaseListResponse result = new BaseListResponse();
366 521 PageInfo pageInfo = new PageInfo();
367 522  
368 523  
... ... @@ -400,8 +555,256 @@
400 555 return result;
401 556 }
402 557  
  558 + /**
  559 + * 导出获取听力可疑儿童列表(听力筛查表,当前医院的复诊未通过的数据)
  560 + *
  561 + * @param request
  562 + * @return
  563 + */
  564 + @RequestMapping(method = RequestMethod.GET, value = "/extSuspDiagList")
  565 + @ResponseBody
  566 + @TokenRequired
  567 + public void extSuspDiagList(HearDiaManageRequest model, HttpServletRequest request, HttpServletResponse resp) {
  568 + //获取当前登录用户ID
  569 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  570 + if (loginState == null) {
  571 + return ;
  572 + }
  573 +//当前登录人医院Id
  574 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
403 575  
  576 + ChildrenPersonQuery query = new ChildrenPersonQuery();
  577 + if (StringUtils.isNotEmpty(model.getKeyWord())) {//查询号不为空
  578 + query.setKeyWord(model.getKeyWord());
  579 + }
  580 +
  581 + if (model.getBirthStartTime() != null) {//儿童出生开始日期
  582 + query.setStartBirthday(model.getBirthStartTime());
  583 + }
  584 +
  585 + if (model.getBirthEndTime() != null) {//儿童出生结束日期
  586 + query.setEndBirthday(model.getBirthEndTime());
  587 + }
  588 + List<String> babyIds = new ArrayList<>();
  589 + // List<ChildrenPerson> childrenPersonList = childrenPersonService.queryChildrenPerson(query);
  590 + // if (CollectionUtils.isNotEmpty(childrenPersonList)) {
  591 + // for (ChildrenPerson cp : childrenPersonList) {
  592 + // //获取babyid,还未表还未增加
  593 + // }
  594 + // }
  595 +
  596 +
  597 + BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery();
  598 + //听筛开始时间
  599 + if (model.getSecrStartTime() != null) {
  600 + screenQuery.setScreenStartDate(model.getSecrStartTime());
  601 + }
  602 + //开始结束时间
  603 + if (model.getSecrEndTime() != null) {
  604 + screenQuery.setScreenEndDate(model.getSecrEndTime());
  605 + }
  606 + //检测医生ID
  607 + if (model.getDiagnDoctorId() != null) {
  608 + screenQuery.setCheckDoctorId(model.getDiagnDoctorId());
  609 + }
  610 + //查询全部数据
  611 + List<BabyPatientExtendEarScreen> earScreens = screenService.dubiousScreen(screenQuery);
  612 +
  613 + //已诊断数据
  614 + List<HearDiagnManageListResult> alrScreens = new ArrayList<>();
  615 + //未诊断数据
  616 + List<HearDiagnManageListResult> notScreens = new ArrayList<>();
  617 + //全部数据
  618 + List<HearDiagnManageListResult> hearDiagnManageListResults = new ArrayList<>();
  619 + //要返回的数据
  620 + List<HearDiagnManageListResult> hdmResult = new ArrayList<>();
  621 + if (CollectionUtils.isNotEmpty(earScreens)) {
  622 + for (BabyPatientExtendEarScreen es : earScreens) {
  623 + HearDiagnManageListResult hdm = new HearDiagnManageListResult();
  624 + hdm.setId(es.getId());
  625 + String docotorId = es.getCheckDoctorId();
  626 + Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId));
  627 + if (users != null) {
  628 + hdm.setDoctorName(users.getName() == null ? "-" : users.getName());
  629 + }
  630 + hdm.setSecrTime(DateUtil.getyyyy_MM_dd(es.getScreenDate()));
  631 + BabyModel babyModel = babyService.getOneBabyById(es.getBabyId());
  632 + if (babyModel != null) {
  633 + hdm.setBabyName(babyModel.getName());
  634 + hdm.setBabyId(es.getBabyId());
  635 + hdm.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname()));
  636 + hdm.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone()));
  637 + hdm.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone()));
  638 + hdm.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date()));
  639 + hdm.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth())));
  640 + hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex())));
  641 + }
  642 + String babyId = es.getBabyId();
  643 + BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery();
  644 + hdQuery.setBabyId(babyId);
  645 + //根据babyId查询听力诊断,如果有数据则已诊断
  646 + int count = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnoseCount(hdQuery);
  647 + hdm.setSecrType("复诊");
  648 + hdm.setSecrResult("未通过");
  649 + if(count>0){//儿童在医院里做过听力诊断记录,标记为已诊断
  650 + hdm.setStatus("已诊断");
  651 + alrScreens.add(hdm);
  652 + }else{
  653 + hdm.setStatus("未诊断");
  654 + notScreens.add(hdm);
  655 + }
  656 + hearDiagnManageListResults.add(hdm);
  657 + }
  658 + }else{
  659 + return ;
  660 + }
  661 + if(model.getStatus()==null){
  662 + hdmResult.addAll(hearDiagnManageListResults);
  663 + }else {
  664 + // 1-已诊断、2-待诊断
  665 + if (model.getStatus() == 1) {
  666 + hdmResult.addAll(alrScreens);
  667 + } else if (model.getStatus() == 2) {
  668 + hdmResult.addAll(notScreens);
  669 + } else {
  670 + hdmResult.addAll(hearDiagnManageListResults);
  671 + }
  672 + }
  673 +
  674 + Map<String, String> cnames = new LinkedHashMap<>();
  675 + cnames.put("id", "#");
  676 + cnames.put("babyName", "儿童姓名");
  677 + cnames.put("mommyName", "母亲姓名");
  678 + cnames.put("monthAge", "月龄");
  679 + cnames.put("birthday", "出生日期");
  680 + cnames.put("highRiskEnums", "高危因素");
  681 + cnames.put("secrTime", "筛查日期");
  682 + cnames.put("sex", "性别");
  683 + cnames.put("secrType", "筛查类型");
  684 + cnames.put("secrResult", "筛查结果");
  685 + cnames.put("status", "状态");
  686 + cnames.put("doctorName", "筛查医生");
  687 + cnames.put("mommnyPhone", "联系电话");
  688 +
  689 + List<Map<String, Object>> results = new ArrayList<>();
  690 + for (int i =0;i<hdmResult.size();i++) {
  691 + HearDiagnManageListResult ch = hdmResult.get(i);
  692 + Map<String, Object> result = new LinkedHashMap<>();
  693 + result.put("id", i + 1);
  694 + result.put("babyName", ch.getBabyName());
  695 + result.put("mommyName", ch.getMommyName());
  696 + result.put("monthAge", ch.getMonthAge());
  697 + result.put("birthday", ch.getBirthday());
  698 + result.put("highRiskEnums", ch.getHighRiskEnums());
  699 + result.put("secrTime", ch.getSecrTime());
  700 + result.put("sex", ch.getSex());
  701 + result.put("secrType", ch.getSecrType());
  702 + result.put("secrResult", ch.getSecrResult());
  703 + result.put("status", ch.getStatus());
  704 + result.put("doctorName", ch.getDoctorName());
  705 + result.put("mommnyPhone", ch.getMommnyPhone());
  706 + results.add(result);
  707 + }
  708 + ResponseUtil.responseExcel(cnames,results, resp);
  709 +
  710 + }
  711 +
  712 +
404 713 /**
  714 + * 导出听力可疑儿童列表(听力筛查表,当前医院的复诊未通过的数据)
  715 + *
  716 + * @param request
  717 + * @return
  718 + */
  719 + @RequestMapping(method = RequestMethod.GET, value = "/extAllDiagList")
  720 + @ResponseBody
  721 + @TokenRequired
  722 + public void extAllDiagList(HearDiaManageRequest model, HttpServletRequest request,HttpServletResponse resp) {
  723 + //获取当前登录用户ID
  724 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  725 + if (loginState == null) {
  726 + return ;
  727 + }
  728 +//当前登录人医院Id
  729 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  730 + BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery();
  731 + //检测医生ID
  732 + if (model.getDiagnDoctorId() != null) {
  733 + screenQuery.setCheckDoctorId(model.getDiagnDoctorId());
  734 + }
  735 + screenQuery.setCheckHospitalId(hospitalId);
  736 + List<BabyPatientExtendEarScreen> earScreens = screenService.notAuscultationBabyPatientExtendEarScreen(screenQuery);
  737 + //查询全部数据
  738 + List<HearDiagnManageListResult> hdmResult = new ArrayList<>();
  739 + if (CollectionUtils.isNotEmpty(earScreens)) {
  740 + for (BabyPatientExtendEarScreen es : earScreens) {
  741 + HearDiagnManageListResult hdm = new HearDiagnManageListResult();
  742 + hdm.setId(es.getId());
  743 + String docotorId = es.getCheckDoctorId();
  744 + Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId));
  745 + if (users != null) {
  746 + hdm.setDoctorName(users.getName() == null ? "-" : users.getName());
  747 + }
  748 + hdm.setSecrTime(DateUtil.getyyyy_MM_dd(es.getScreenDate()));
  749 + BabyModel babyModel = babyService.getOneBabyById(es.getBabyId());
  750 + if (babyModel != null) {
  751 + hdm.setBabyName(babyModel.getName());
  752 + hdm.setBabyId(es.getBabyId());
  753 + hdm.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname()));
  754 + hdm.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone()));
  755 + hdm.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone()));
  756 + hdm.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date()));
  757 + hdm.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth())));
  758 + hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex())));
  759 + }
  760 + String babyId = es.getBabyId();
  761 + BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery();
  762 + hdQuery.setBabyId(babyId);
  763 + //根据babyId查询听力诊断,如果有数据则已诊断
  764 + int count = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnoseCount(hdQuery);
  765 + hdm.setSecrType("复诊");
  766 + hdm.setSecrResult("未通过");
  767 + if (count > 0) {//儿童在医院里做过听力诊断记录,标记为已诊断
  768 + hdm.setStatus("已诊断");
  769 + } else {
  770 + hdm.setStatus("未诊断");
  771 + }
  772 + hdmResult.add(hdm);
  773 + }
  774 +
  775 + Map<String, String> cnames = new LinkedHashMap<>();
  776 + cnames.put("id", "#");
  777 + cnames.put("babyName", "儿童姓名");
  778 + cnames.put("mommyName", "母亲姓名");
  779 + cnames.put("monthAge", "月龄");
  780 + cnames.put("birthday", "出生日期");
  781 + cnames.put("highRiskEnums", "高危因素");
  782 + cnames.put("secrTime", "筛查日期");
  783 + cnames.put("sex", "性别");
  784 + cnames.put("doctorName", "筛查医生");
  785 + cnames.put("mommnyPhone", "联系电话");
  786 +
  787 + List<Map<String, Object>> results = new ArrayList<>();
  788 + for (int i =0;i<hdmResult.size();i++) {
  789 + HearDiagnManageListResult ch = hdmResult.get(i);
  790 + Map<String, Object> result = new LinkedHashMap<>();
  791 + result.put("id", i + 1);
  792 + result.put("babyName", ch.getBabyName());
  793 + result.put("mommyName", ch.getMommyName());
  794 + result.put("monthAge", ch.getMonthAge());
  795 + result.put("birthday", ch.getBirthday());
  796 + result.put("highRiskEnums", ch.getHighRiskEnums());
  797 + result.put("secrTime", ch.getSecrTime());
  798 + result.put("sex", ch.getSex());
  799 + result.put("doctorName", ch.getDoctorName());
  800 + result.put("mommnyPhone", ch.getMommnyPhone());
  801 + results.add(result);
  802 + }
  803 + ResponseUtil.responseExcel(cnames,results, resp);
  804 + }
  805 + }
  806 +
  807 + /**
405 808 * 获取听力可疑儿童列表(听力筛查表,当前医院的复诊未通过的数据)
406 809 *
407 810 * @param request
... ... @@ -418,6 +821,82 @@
418 821 }
419 822 //当前登录人医院Id
420 823 String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  824 +
  825 + BabyModelQuery babyQuery = new BabyModelQuery();
  826 +
  827 + Date currentDate = DateUtil.formatDate(new Date());
  828 + if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getBirth()) && model.getMonthAgeStart() != null && model.getMonthAgeEnd() != null)
  829 + {
  830 +
  831 + Date start = DateUtil.addMonth(currentDate, -model.getMonthAgeStart());
  832 + String birthStr = model.getBirth();
  833 + String[] dates = birthStr.split(" - ");
  834 +
  835 + if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime())
  836 + {
  837 + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1]));
  838 + }
  839 + else
  840 + {
  841 + babyQuery.setBirthEnd(start);
  842 + }
  843 +
  844 + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -model.getMonthAgeEnd() - 1), 1);
  845 +
  846 + if (DateUtil.parseYMD(dates[0]).getTime() < end.getTime())
  847 + {
  848 + babyQuery.setBirthStart(end);
  849 + }
  850 + else
  851 + {
  852 + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0]));
  853 + }
  854 + }
  855 + else if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getBirth()) && model.getMonthAgeStart() != null )
  856 + {
  857 +
  858 + Date start = DateUtil.addMonth(currentDate, -model.getMonthAgeStart());
  859 + String birthStr = model.getBirth();
  860 + String[] dates = birthStr.split(" - ");
  861 +
  862 + if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime())
  863 + {
  864 + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1]));
  865 + }
  866 + else
  867 + {
  868 + babyQuery.setBirthEnd(start);
  869 + }
  870 +
  871 + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0]));
  872 +
  873 + }
  874 + else if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getBirth()))
  875 + {
  876 + String birthStr = model.getBirth();
  877 + String[] dates = birthStr.split(" - ");
  878 + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0]));
  879 + babyQuery.setBirthEnd(new Date(DateUtil.parseYMD(dates[1]).getTime()+24*60*60*1000 -1 ));
  880 + }
  881 + else if (model.getMonthAgeStart() != null && model.getMonthAgeEnd() != null)
  882 + {
  883 + Date start = DateUtil.addMonth(currentDate, -model.getMonthAgeStart());
  884 + babyQuery.setBirthEnd(start);
  885 +
  886 + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -model.getMonthAgeEnd() - 1), 1);
  887 + babyQuery.setBirthStart(end);
  888 + }
  889 + else if (model.getMonthAgeStart() != null)
  890 + {
  891 + Date start = DateUtil.addMonth(currentDate, -model.getMonthAgeStart());
  892 + babyQuery.setBirthEnd(start);
  893 + }
  894 + else if (model.getMonthAgeEnd() != null)
  895 + {
  896 + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -model.getMonthAgeEnd() - 1), 1);
  897 + babyQuery.setBirthStart(end);
  898 + }
  899 +
421 900 BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery();
422 901 //检测医生ID
423 902 if (model.getDiagnDoctorId() != null) {
... ... @@ -472,7 +951,7 @@
472 951 result.setData(hdmResult);
473 952 return result;
474 953 } else {
475   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据");
  954 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有数据");
476 955 }
477 956 }
478 957 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ bf9a882
... ... @@ -5,7 +5,6 @@
5 5 import com.lyms.hospitalapi.qhdfy.QhdfyHisService;
6 6 import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService;
7 7 import com.lyms.hospitalapi.v2.HisService;
8   -import com.lyms.platform.beans.*;
9 8 import com.lyms.platform.biz.service.*;
10 9 import com.lyms.platform.common.constants.ErrorCodeConstants;
11 10 import com.lyms.platform.common.dao.operator.MongoQuery;
... ... @@ -15,8 +14,6 @@
15 14 import com.lyms.platform.common.result.BaseResponse;
16 15 import com.lyms.platform.common.utils.*;
17 16 import com.lyms.platform.operate.web.request.*;
18   -import com.lyms.platform.operate.web.request.MessageListRequest;
19   -import com.lyms.platform.operate.web.request.MessageRequest;
20 17 import com.lyms.platform.operate.web.result.*;
21 18 import com.lyms.platform.operate.web.utils.BabyListTask;
22 19 import com.lyms.platform.operate.web.utils.GrowthCountTask;
... ... @@ -2103,7 +2100,6 @@
2103 2100 if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime())
2104 2101 {
2105 2102 babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1]));
2106   -
2107 2103 }
2108 2104 else
2109 2105 {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HearDiaManageRequest.java View file @ bf9a882
... ... @@ -64,6 +64,36 @@
64 64 * 诊断结束时间
65 65 */
66 66 private Date diagnoseEndTime;
  67 + //生日
  68 + private String birth;
  69 + //开始月龄
  70 + private Integer monthAgeStart;
  71 + //结束月龄
  72 + private Integer monthAgeEnd;
  73 +
  74 + public String getBirth() {
  75 + return birth;
  76 + }
  77 +
  78 + public void setBirth(String birth) {
  79 + this.birth = birth;
  80 + }
  81 +
  82 + public Integer getMonthAgeStart() {
  83 + return monthAgeStart;
  84 + }
  85 +
  86 + public void setMonthAgeStart(Integer monthAgeStart) {
  87 + this.monthAgeStart = monthAgeStart;
  88 + }
  89 +
  90 + public Integer getMonthAgeEnd() {
  91 + return monthAgeEnd;
  92 + }
  93 +
  94 + public void setMonthAgeEnd(Integer monthAgeEnd) {
  95 + this.monthAgeEnd = monthAgeEnd;
  96 + }
67 97  
68 98 public Date getConfirmStartTime() {
69 99 return confirmStartTime;