diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java index 42c6335..ebb6c3a 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java @@ -87,7 +87,7 @@ public class AntexDoctorStatistController extends BaseController { } //获取患者信息 - List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, doctorId, number); + List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, doctorId); //结果数据集合 Map resultInfo = new HashMap<>(); @@ -116,7 +116,7 @@ public class AntexDoctorStatistController extends BaseController { } } if (CollectionUtils.isNotEmpty(patientIds)) { - getAllPatientList(patientIds, resultInfo); + getAllPatientList(patientIds, resultInfo,loginState.getId()); } @@ -169,7 +169,11 @@ public class AntexDoctorStatistController extends BaseController { } //获取患者全部检测数据 - public void getAllPatientList(List patientId, Map resultInfo) { + public void getAllPatientList(List patientId, Map resultInfo,Integer userId) { + + //根据当前登录人获取医院id + String hospital = autoMatchFacade.getHospitalId(userId); + //根据patientId集合查询产检表、产检复查表,获取医生id、patientId列表 AntExChuQuery antExChuQuery = new AntExChuQuery(); //患者集合 @@ -194,9 +198,26 @@ public class AntexDoctorStatistController extends BaseController { } doctorPatient.setCheckTimeStr(DateUtil.getyyyy_MM_dd(doctorPatient.getCheckTime())); } + + //复诊:本院id+医生Id + Map hostNum = new HashMap<>(); + //添加复诊结果 for (AntenatalExaminationModel aec : antenatalExaminationModels) { AntextDoctorPatient doctorPatient = resultInfo.get(aec.getParentId()); + if(aec.getHospitalId().equals(hospital)){//如果医院id相同, + if(hostNum.containsKey(aec.getId())){//则当次数大于已经记录次数时进行加加,同一医院只有一次初检,所以初检不做处理 + int num = hostNum.get(aec.getId()); + num++; + if(num>doctorPatient.getCjNum()){ + doctorPatient.setCjNum(num); + } + hostNum.put(aec.getId(),num); + }else{ + hostNum.put(aec.getId(),1); + } + } + doctorPatient.setAllCjNum(doctorPatient.getAllCjNum() + 1); if (aec.getCheckDate().after(doctorPatient.getCheckTime())) { doctorPatient.setCheckTime(aec.getCheckDate()); @@ -207,7 +228,7 @@ public class AntexDoctorStatistController extends BaseController { } - public List getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth, String doctorId, Integer number) { + public List getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth, String doctorId) { //根据当前登录人获取医院id String hospital = autoMatchFacade.getHospitalId(userId); @@ -293,6 +314,23 @@ public class AntexDoctorStatistController extends BaseController { adp.setDoctorId(aec.getCheckDoctor()); adp.setpId(aec.getParentId()); adp.setCheckTime(aec.getCheckDate()); + Patients patients = patientsMap.get(aec.getParentId()); + if (patients.getType() == 1) {//孕妇 + //计算孕周 + adp.setcDueWeek(com.lyms.platform.common.utils.StringUtils.dueWeek(DateUtil.daysBetween(patients.getLastMenses(), new Date()))); + adp.setDueFmDate(patients.getDueDate()); + adp.setDueFmDateStr(DateUtil.getyyyy_MM_dd(patients.getDueDate())); + } else if (patients.getType() == 3) {//3-产妇 + adp.setcDueWeek("已分娩"); + adp.setDueFmDate(patients.getFmDate()); + adp.setDueFmDateStr(DateUtil.getyyyy_MM_dd(patients.getFmDate())); + } + adp.setpName(patients.getUsername()); + //高危因数 + adp.setRiskFactors(commonService.resloveFactor(patients.getRiskFactorId())); + //高危等级颜色 + adp.setRiskLevelId(commonService.findRiskLevel(patients.getRiskLevelId())); + antextDoctorPatient.add(adp); } @@ -317,7 +355,7 @@ public class AntexDoctorStatistController extends BaseController { LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); //获取患者信息 - List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, null, null); + List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, null); Map adr1 = new HashMap<>(); //医生ID+患者ID 用与医生对于产检人数 + 总人数:患者ID