diff --git a/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml b/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml index 2648be2..c8b149d 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml @@ -223,9 +223,7 @@ select id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,foll and next_time = #{nextTime,jdbcType=TIMESTAMP} - - and ifdel = #{ifdel,jdbcType=INTEGER} - + and ifdel =0 and ifclose = #{ifclose,jdbcType=INTEGER} @@ -286,6 +284,7 @@ select id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,foll and baby_id = #{babyId,jdbcType=VARCHAR} + and ifdel = 0 diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java index 7e2db59..aed68ea 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java @@ -500,8 +500,8 @@ public class FollowUpController extends BaseController { @TokenRequired public BaseResponse addBabyPatientExtendEarFollowUp(@Valid BabyPatientExtendEarFollowUp obj, HttpServletRequest request) { - // BaseResponse basResp = validata(obj); - // if (basResp.getErrorcode() != 0) return basResp; + BaseResponse basResp = validata(obj); + if (basResp.getErrorcode() != 0) return basResp; //获取当前登录用户ID LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); if (loginState == null) { @@ -536,37 +536,37 @@ public class FollowUpController extends BaseController { return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入随访时间"); } - if (obj.getFollowAddr() == null) {//随访地址 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入随访地址"); - } - - if (obj.getMarkTime() == null) {//确诊时间 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入确诊时间"); - } - if (obj.getMarkResult() == null) {//确诊结果 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入确诊结果"); - } - if (obj.getMarkDetail() == null) {//确诊详情 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入确诊详情"); - } - if (obj.getFollowInfo() == null) {//随访记录 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入随访记录"); - } - if (obj.getGuideOpinion() == null) {//指导意见 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入指导意见"); - } - if (obj.getFollowDoctorName() == null) {//随访医生名称 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入医生名称"); - } + // if (obj.getFollowAddr() == null) {//随访地址 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入随访地址"); + // } + // + // if (obj.getMarkTime() == null) {//确诊时间 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入确诊时间"); + // } + // if (obj.getMarkResult() == null) {//确诊结果 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入确诊结果"); + // } + // if (obj.getMarkDetail() == null) {//确诊详情 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入确诊详情"); + // } + // if (obj.getFollowInfo() == null) {//随访记录 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入随访记录"); + // } + // if (obj.getGuideOpinion() == null) {//指导意见 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入指导意见"); + // } + // if (obj.getFollowDoctorName() == null) {//随访医生名称 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入医生名称"); + // } if (obj.getFollowDoctorId() == null) {//随访医生ID return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入随访医生ID"); } - if (obj.getNextTime() == null) {//预约复查时间 - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入预约复查时间"); - } - if (obj.getHospitalId() == null) {//医院ID - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入医院ID"); - } + // if (obj.getNextTime() == null) {//预约复查时间 + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入预约复查时间"); + // } + // if (obj.getHospitalId() == null) {//医院ID + // return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入医院ID"); + // } return baseResp; } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java index 5a7c295..d7760ba 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java @@ -17,10 +17,7 @@ import com.lyms.platform.operate.web.request.HearDiaManageRequest; import com.lyms.platform.operate.web.result.HearDiagnManageListResult; import com.lyms.platform.operate.web.result.HearingDiagnoseListResult; import com.lyms.platform.permission.model.*; -import com.lyms.platform.permission.service.BabyPatientExtendEarHearingDiagnoseService; -import com.lyms.platform.permission.service.BabyPatientExtendEarScreenService; -import com.lyms.platform.permission.service.ChildrenPersonService; -import com.lyms.platform.permission.service.UsersService; +import com.lyms.platform.permission.service.*; import com.lyms.platform.pojo.BabyModel; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; @@ -53,8 +50,84 @@ public class HearDiagnManageController extends BaseController { private ChildrenPersonService childrenPersonService; @Autowired private BabyService babyService; + //儿童听诊记录 @Autowired private BabyPatientExtendEarHearingDiagnoseService hearingDiagnoseService; + //儿童听力随访 + @Autowired + private BabyPatientExtendEarFollowUpService babyPatientExtendEarFollowUpService; + + /** + * 获取儿童听筛记录 + * + * @return + */ + @RequestMapping(method = RequestMethod.GET, value = "/getHistoryList") + @ResponseBody + @TokenRequired + public BaseResponse getHistoryList(String babyId, HttpServletRequest request) { + //获取当前登录用户ID + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); + if (loginState == null) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录"); + } +//当前登录人医院Id + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); + BabyPatientExtendEarScreenQuery earScreenQuery = new BabyPatientExtendEarScreenQuery(); + earScreenQuery.setBabyId(babyId); + //儿童听筛记录 + List earScreenList = screenService.queryBabyPatientExtendEarScreen(earScreenQuery); + BabyPatientExtendEarHearingDiagnoseQuery hearingDiagnoseQuery = new BabyPatientExtendEarHearingDiagnoseQuery(); + hearingDiagnoseQuery.setBabyId(babyId); + hearingDiagnoseQuery.setIfdel(0); + //儿童听力诊断记录 + List hearingDiagnoseList = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnose(hearingDiagnoseQuery); + BabyPatientExtendEarFollowUpQuery earFollowUpQuery = new BabyPatientExtendEarFollowUpQuery(); + earFollowUpQuery.setBabyId(babyId); + //儿童听力随访记录 + List earFollowUpList = babyPatientExtendEarFollowUpService.queryBabyPatientExtendEarFollowUpByBaby(earFollowUpQuery); + + List> resultList = new ArrayList<>(); + for(BabyPatientExtendEarScreen es:earScreenList){ + Map fuMap = new HashMap<>(); + fuMap.put("hospitalId",es.getCheckHospitalId()); + fuMap.put("id",es.getId()); + fuMap.put("type","1"); + if(es.getScreenType() == 1){//1=初筛 2=复筛 + fuMap.put("name","初筛"); + }else if(es.getScreenType() == 2){//1=初筛 2=复筛 + fuMap.put("name","复筛"); + } + fuMap.put("time",DateUtil.getyyyy_MM_dd(es.getScreenDate())); + resultList.add(fuMap); + } + + for(BabyPatientExtendEarHearingDiagnose hd:hearingDiagnoseList){ + Map fuMap = new HashMap<>(); + fuMap.put("hospitalId",hd.getHospitalId()); + fuMap.put("id",hd.getId()); + fuMap.put("name","诊断"); + fuMap.put("type","2"); + fuMap.put("time",DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime())); + resultList.add(fuMap); + } + for(BabyPatientExtendEarFollowUp fu:earFollowUpList){ + Map fuMap = new HashMap<>(); + fuMap.put("hospitalId",fu.getHospitalId()); + fuMap.put("id",fu.getId()); + fuMap.put("name","随访"); + fuMap.put("type","3"); + if(fu.getIfclose() == 1){//0-未结案,1-结案 + fuMap.put("close","结案"); + } + fuMap.put("time",DateUtil.getyyyy_MM_dd(fu.getFollowTime())); + resultList.add(fuMap); + } + BaseResponse response = new BaseResponse(); + response.setObject(resultList); + response.setErrorcode(ErrorCodeConstants.SUCCESS); + return response; + } /** * 获取确诊儿童列表(听力诊断表,当前医院的确诊的数据) @@ -130,10 +203,20 @@ public class HearDiagnManageController extends BaseController { if (users != null) { hea.setDoctorName(users.getName() == null ? "-" : users.getName()); } + BabyModel babyModel = babyService.getOneBabyById(hd.getBabyId()); + if (babyModel != null) { + hea.setBabyName(babyModel.getName()); + hea.setBabyId(hd.getBabyId()); + hea.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname())); + hea.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone())); + hea.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone())); + hea.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); + hea.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); + hea.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); + } hea.setHdTime(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime()))); if (hd.getHighFactor() != null) { String hf[] = hd.getHighFactor().split(","); - // List> highRiskEnums = new ArrayList<>(); StringBuffer hrSb = new StringBuffer(); for (int b = 0; b < hf.length; b++) { if (StringUtils.isNotEmpty(hf[b])) { @@ -150,7 +233,6 @@ public class HearDiagnManageController extends BaseController { //确诊结果 if (hd.getConfirmResult() != null) { String cr[] = hd.getConfirmResult().split(","); - // List> hdEnums = new ArrayList<>(); StringBuffer hdSb = new StringBuffer(); for (int b = 0; b < cr.length; b++) { if (StringUtils.isNotEmpty(cr[b])) { @@ -168,7 +250,12 @@ public class HearDiagnManageController extends BaseController { } BaseListResponse result = new BaseListResponse(); result.setData(hdList); - result.setPageInfo(query.getPageInfo()); + PageInfo pageInfo = new PageInfo(); + pageInfo.setLimit(hdReq.getLimit()); + pageInfo.setPage(hdReq.getPage()); + pageInfo.setCount(query.getCount()); + + result.setPageInfo(pageInfo); return result; } @@ -203,12 +290,12 @@ public class HearDiagnManageController extends BaseController { query.setEndBirthday(model.getBirthEndTime()); } List babyIds = new ArrayList<>(); - List childrenPersonList = childrenPersonService.queryChildrenPerson(query); - if (CollectionUtils.isNotEmpty(childrenPersonList)) { - for (ChildrenPerson cp : childrenPersonList) { - //获取babyid,还未表还未增加 - } - } + // List childrenPersonList = childrenPersonService.queryChildrenPerson(query); + // if (CollectionUtils.isNotEmpty(childrenPersonList)) { + // for (ChildrenPerson cp : childrenPersonList) { + // //获取babyid,还未表还未增加 + // } + // } BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery(); @@ -261,6 +348,8 @@ public class HearDiagnManageController extends BaseController { hdQuery.setBabyId(babyId); //根据babyId查询听力诊断,如果有数据则已诊断 int count = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnoseCount(hdQuery); + hdm.setSecrType("复诊"); + hdm.setSecrResult("未通过"); if(count>0){//儿童在医院里做过听力诊断记录,标记为已诊断 hdm.setStatus("已诊断"); alrScreens.add(hdm); @@ -269,32 +358,39 @@ public class HearDiagnManageController extends BaseController { notScreens.add(hdm); } hearDiagnManageListResults.add(hdm); - } }else{ return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); } BaseListResponse result = new BaseListResponse(); PageInfo pageInfo = new PageInfo(); - // 1-已诊断、2-待诊断、3-全部 - if(model.getStatus() == 1){ - for (int i = (model.getPage() - 1) * model.getLimit(); (i < alrScreens.size() && i < model.getLimit()); i++) { - hdmResult.add(alrScreens.get(i)); - } - pageInfo.setCount(alrScreens.size()); - result.setData(hdmResult); - }else if(model.getStatus() == 2){ - for (int i = (model.getPage() - 1) * model.getLimit(); (i < notScreens.size() && i < model.getLimit()); i++) { - hdmResult.add(notScreens.get(i)); - } - pageInfo.setCount(alrScreens.size()); - result.setData(hdmResult); - }else{ + if(model.getStatus()==null){ for (int i = (model.getPage() - 1) * model.getLimit(); (i < hearDiagnManageListResults.size() && i < model.getLimit()); i++) { - hdmResult.add(notScreens.get(i)); + hdmResult.add(hearDiagnManageListResults.get(i)); } - pageInfo.setCount(alrScreens.size()); + pageInfo.setCount(hearDiagnManageListResults.size()); result.setData(hdmResult); + }else { + // 1-已诊断、2-待诊断 + if (model.getStatus() == 1) { + for (int i = (model.getPage() - 1) * model.getLimit(); (i < alrScreens.size() && i < model.getLimit()); i++) { + hdmResult.add(alrScreens.get(i)); + } + pageInfo.setCount(alrScreens.size()); + result.setData(hdmResult); + } else if (model.getStatus() == 2) { + for (int i = (model.getPage() - 1) * model.getLimit(); (i < notScreens.size() && i < model.getLimit()); i++) { + hdmResult.add(notScreens.get(i)); + } + pageInfo.setCount(notScreens.size()); + result.setData(hdmResult); + } else { + for (int i = (model.getPage() - 1) * model.getLimit(); (i < hearDiagnManageListResults.size() && i < model.getLimit()); i++) { + hdmResult.add(hearDiagnManageListResults.get(i)); + } + pageInfo.setCount(hearDiagnManageListResults.size()); + result.setData(hdmResult); + } } pageInfo.setLimit(model.getLimit()); @@ -303,4 +399,80 @@ public class HearDiagnManageController extends BaseController { result.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功"); return result; } + + + /** + * 获取听力可疑儿童列表(听力筛查表,当前医院的复诊未通过的数据) + * + * @param request + * @return + */ + @RequestMapping(method = RequestMethod.GET, value = "/getAllDiagList") + @ResponseBody + @TokenRequired + public BaseResponse getAllDiagList(HearDiaManageRequest model, HttpServletRequest request) { + //获取当前登录用户ID + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); + if (loginState == null) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录"); + } +//当前登录人医院Id + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); + BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery(); + //检测医生ID + if (model.getDiagnDoctorId() != null) { + screenQuery.setCheckDoctorId(model.getDiagnDoctorId()); + } + screenQuery.setCheckHospitalId(hospitalId); + //查询全部数据 + List earScreens = screenService.notAuscultationBabyPatientExtendEarScreen(screenQuery); + //要返回的数据 + List hdmResult = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(earScreens)) { + for (BabyPatientExtendEarScreen es : earScreens) { + HearDiagnManageListResult hdm = new HearDiagnManageListResult(); + hdm.setId(es.getId()); + String docotorId = es.getCheckDoctorId(); + Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId)); + if (users != null) { + hdm.setDoctorName(users.getName() == null ? "-" : users.getName()); + } + hdm.setSecrTime(DateUtil.getyyyy_MM_dd(es.getScreenDate())); + BabyModel babyModel = babyService.getOneBabyById(es.getBabyId()); + if (babyModel != null) { + hdm.setBabyName(babyModel.getName()); + hdm.setBabyId(es.getBabyId()); + hdm.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname())); + hdm.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone())); + hdm.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone())); + hdm.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); + hdm.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); + hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); + } + String babyId = es.getBabyId(); + BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery(); + hdQuery.setBabyId(babyId); + //根据babyId查询听力诊断,如果有数据则已诊断 + int count = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnoseCount(hdQuery); + hdm.setSecrType("复诊"); + hdm.setSecrResult("未通过"); + if (count > 0) {//儿童在医院里做过听力诊断记录,标记为已诊断 + hdm.setStatus("已诊断"); + } else { + hdm.setStatus("未诊断"); + } + hdmResult.add(hdm); + } + BaseListResponse result = new BaseListResponse(); + PageInfo pageInfo = new PageInfo(); + pageInfo.setCount(hdmResult.size()); + pageInfo.setLimit(model.getLimit()); + pageInfo.setPage(model.getPage()); + result.setPageInfo(pageInfo); + result.setData(hdmResult); + return result; + } else { + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); + } + } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HearDiagnManageListResult.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HearDiagnManageListResult.java index 058e8eb..0dcc0ec 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HearDiagnManageListResult.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HearDiagnManageListResult.java @@ -24,6 +24,10 @@ public class HearDiagnManageListResult { private String secrTime; //性别 private String sex; + //筛查类型 + private String secrType; + //筛查结果 + private String secrResult; //状态 private String status; //医生名称 @@ -33,6 +37,22 @@ public class HearDiagnManageListResult { //母亲加密联系方式 private String mommnyEncryptPhone; + public String getSecrType() { + return secrType; + } + + public void setSecrType(String secrType) { + this.secrType = secrType; + } + + public String getSecrResult() { + return secrResult; + } + + public void setSecrResult(String secrResult) { + this.secrResult = secrResult; + } + public String getId() { return id; }