Commit 16b49549bb2b9f1c79b970342b2a246cb3142c64
1 parent
0201639d20
Exists in
master
and in
6 other branches
高危等级查询
Showing 1 changed file with 178 additions and 49 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
16b4954
| ... | ... | @@ -4871,79 +4871,208 @@ |
| 4871 | 4871 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
| 4872 | 4872 | if (CollectionUtils.isNotEmpty(list)) { |
| 4873 | 4873 | Patients patients = list.get(0); |
| 4874 | - | |
| 4875 | - HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getPid(), false); | |
| 4876 | 4874 | AntExQuery antExQuery = new AntExQuery(); |
| 4877 | 4875 | antExQuery.setYn(YnEnums.YES.getId()); |
| 4878 | 4876 | antExQuery.setPid(patients.getPid()); |
| 4879 | 4877 | antExQuery.setStart(DateUtil.addMonth(new Date(), -12)); |
| 4880 | - // 姓名: VARCHAR2 | |
| 4881 | - // 证件号: VARCHAR2 | |
| 4882 | - // 就诊卡号:VARCHAR2 | |
| 4883 | - // 高危因素:VARCHAR2 | |
| 4884 | - // 产检医生:VARCHAR2 | |
| 4885 | - // 产检孕周:VARCHAR2 | |
| 4886 | 4878 | |
| 4887 | - Element nameElement = riskElement.addElement("username"); | |
| 4879 | + Element baseElement = riskElement.addElement("baseInfo"); | |
| 4880 | + | |
| 4881 | + Element nameElement = baseElement.addElement("username"); | |
| 4888 | 4882 | nameElement.addText(patients.getUsername()); |
| 4889 | 4883 | |
| 4890 | - Element cardNoElement = riskElement.addElement("cardNo"); | |
| 4884 | + Element cardNoElement = baseElement.addElement("cardNo"); | |
| 4891 | 4885 | cardNoElement.addText(patients.getCardNo()); |
| 4892 | 4886 | |
| 4893 | - Element vcCardNoElement = riskElement.addElement("vcCardNo"); | |
| 4887 | + Element vcCardNoElement = baseElement.addElement("vcCardNo"); | |
| 4894 | 4888 | vcCardNoElement.addText(patients.getVcCardNo()); |
| 4895 | 4889 | |
| 4896 | - String checkDoctor = ""; | |
| 4897 | - if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId()) && FunvCommonUtil.isNumeric(patients.getLastCheckEmployeeId())) { | |
| 4898 | - Users users = usersService.getUsers(Integer.parseInt(patients.getLastCheckEmployeeId())); | |
| 4899 | - if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
| 4900 | - checkDoctor = users.getName(); | |
| 4890 | + | |
| 4891 | + Element birthdayElement = baseElement.addElement("birthday"); | |
| 4892 | + birthdayElement.addText(DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + Element phoneElement = baseElement.addElement("phone"); | |
| 4896 | + phoneElement.addText(patients.getPhone()); | |
| 4897 | + | |
| 4898 | + Element ageElement = baseElement.addElement("age"); | |
| 4899 | + ageElement.addText(DateUtil.getAge(patients.getBirth(),new Date())+""); | |
| 4900 | + | |
| 4901 | + Element dueDateElement = baseElement.addElement("dueDate"); | |
| 4902 | + dueDateElement.addText(DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 4903 | + | |
| 4904 | + //初诊记录 | |
| 4905 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 4906 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 4907 | + antExChuQuery.setParentId(patients.getId()); | |
| 4908 | + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 4909 | + if (CollectionUtils.isNotEmpty(antExChuModels)) { | |
| 4910 | + AntExChuModel an = antExChuModels.get(0); | |
| 4911 | + | |
| 4912 | + Element checkElement = riskElement.addElement("check"); | |
| 4913 | + | |
| 4914 | + String checkDoctor = ""; | |
| 4915 | + if (StringUtils.isNotEmpty(an.getProdDoctor()) && FunvCommonUtil.isNumeric(an.getProdDoctor())) { | |
| 4916 | + Users users = usersService.getUsers(Integer.parseInt(an.getProdDoctor())); | |
| 4917 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
| 4918 | + checkDoctor = users.getName(); | |
| 4919 | + } | |
| 4901 | 4920 | } |
| 4902 | - } | |
| 4903 | 4921 | |
| 4904 | - Element checkDoctorElement = riskElement.addElement("checkDoctor"); | |
| 4905 | - checkDoctorElement.addText(checkDoctor); | |
| 4922 | + Element checkDoctorElement = checkElement.addElement("checkDoctor"); | |
| 4923 | + checkDoctorElement.addText(checkDoctor); | |
| 4906 | 4924 | |
| 4907 | 4925 | |
| 4908 | - Element checkWeekElement = riskElement.addElement("checkWeek"); | |
| 4909 | - checkWeekElement.addText(patients.getLastCTime() == null ? "" : DateUtil.getWeekDesc(patients.getLastMenses(), patients.getLastCTime())); | |
| 4926 | + Element checkWeekElement = checkElement.addElement("checkWeek"); | |
| 4927 | + checkWeekElement.addText(an.getCheckTime() == null ? "" : DateUtil.getWeekDesc(patients.getLastMenses(), an.getCheckTime())); | |
| 4910 | 4928 | |
| 4929 | + Element checkDateElement = checkElement.addElement("checkDate"); | |
| 4930 | + checkDateElement.addText(DateUtil.getyyyy_MM_dd(an.getCheckTime())); | |
| 4911 | 4931 | |
| 4912 | - List riskList = highScoreResult.getHighRisk(); | |
| 4913 | - if (CollectionUtils.isNotEmpty(riskList)) | |
| 4914 | - { | |
| 4915 | - for (int i = 0 ;i < riskList.size() ; i++) | |
| 4932 | + | |
| 4933 | + String hospital = ""; | |
| 4934 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(an.getHospitalId())) { | |
| 4935 | + Organization organization = organizationService.getOrganization(Integer.parseInt(an.getHospitalId())); | |
| 4936 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
| 4937 | + hospital = organization.getName(); | |
| 4938 | + } | |
| 4939 | + } | |
| 4940 | + Element checkHospitalElement = checkElement.addElement("checkHospital"); | |
| 4941 | + checkHospitalElement.addText(hospital); | |
| 4942 | + | |
| 4943 | + Element nextCheckDateElement = checkElement.addElement("nextCheckDate"); | |
| 4944 | + nextCheckDateElement.addText(an.getNextCheckTime() == null ? "" : DateUtil.getyyyy_MM_dd(an.getNextCheckTime())); | |
| 4945 | + | |
| 4946 | + Map map = new HashMap(); | |
| 4947 | + //处理高危因素 | |
| 4948 | + getRisk(an.getHighrisk(), an.getOtherHighRisk(), map); | |
| 4949 | + | |
| 4950 | + List riskList = (List)map.get("highRisk"); | |
| 4951 | + if (CollectionUtils.isNotEmpty(riskList)) | |
| 4916 | 4952 | { |
| 4917 | - Map<String, String> rmap = (Map<String, String>) riskList.get(i); | |
| 4918 | - String color = rmap.get("color"); | |
| 4919 | - if ("risk_green".equals(color)) | |
| 4953 | + for (int i = 0 ;i < riskList.size() ; i++) | |
| 4920 | 4954 | { |
| 4921 | - color = "绿色"; | |
| 4955 | + Map<String, String> rmap = (Map<String, String>) riskList.get(i); | |
| 4956 | + String color = rmap.get("color"); | |
| 4957 | + if ("risk_green".equals(color)) | |
| 4958 | + { | |
| 4959 | + color = "绿色"; | |
| 4960 | + } | |
| 4961 | + else if ("risk_orange".equals(color)) | |
| 4962 | + { | |
| 4963 | + color = "橙色"; | |
| 4964 | + } | |
| 4965 | + else if ("risk_yellow".equals(color)) | |
| 4966 | + { | |
| 4967 | + color = "黄色"; | |
| 4968 | + } | |
| 4969 | + else if ("risk_red".equals(color)) | |
| 4970 | + { | |
| 4971 | + color = "红色"; | |
| 4972 | + } | |
| 4973 | + else if ("risk_purple".equals(color)) | |
| 4974 | + { | |
| 4975 | + color = "紫色"; | |
| 4976 | + } | |
| 4977 | + Element riskFactorElement = checkElement.addElement("riskFactor"); | |
| 4978 | + | |
| 4979 | + String name = rmap.get("name"); | |
| 4980 | + Element nElement = riskFactorElement.addElement("riskName"); | |
| 4981 | + nElement.addText(name); | |
| 4982 | + | |
| 4983 | + Element colorElement = riskFactorElement.addElement("color"); | |
| 4984 | + colorElement.addText(color); | |
| 4922 | 4985 | } |
| 4923 | - else if ("risk_orange".equals(color)) | |
| 4924 | - { | |
| 4925 | - color = "橙色"; | |
| 4986 | + } | |
| 4987 | + | |
| 4988 | + } | |
| 4989 | + | |
| 4990 | + AntExQuery exQuery = new AntExQuery(); | |
| 4991 | + exQuery.setParentId(patients.getId()); | |
| 4992 | + exQuery.setYn(YnEnums.YES.getId()); | |
| 4993 | + List<AntenatalExaminationModel> anmodels = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, | |
| 4994 | + "created")); | |
| 4995 | + if (CollectionUtils.isNotEmpty(anmodels)) { | |
| 4996 | + | |
| 4997 | + for ( AntenatalExaminationModel ae : anmodels) | |
| 4998 | + | |
| 4999 | + { | |
| 5000 | + Element checkElement = riskElement.addElement("check"); | |
| 5001 | + | |
| 5002 | + String checkDoctor = ""; | |
| 5003 | + if (StringUtils.isNotEmpty(ae.getCheckDoctor()) && FunvCommonUtil.isNumeric(ae.getCheckDoctor())) { | |
| 5004 | + Users users = usersService.getUsers(Integer.parseInt(ae.getCheckDoctor())); | |
| 5005 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
| 5006 | + checkDoctor = users.getName(); | |
| 5007 | + } | |
| 4926 | 5008 | } |
| 4927 | - else if ("risk_yellow".equals(color)) | |
| 4928 | - { | |
| 4929 | - color = "黄色"; | |
| 5009 | + | |
| 5010 | + Element checkDoctorElement = checkElement.addElement("checkDoctor"); | |
| 5011 | + checkDoctorElement.addText(checkDoctor); | |
| 5012 | + | |
| 5013 | + | |
| 5014 | + Element checkWeekElement = checkElement.addElement("checkWeek"); | |
| 5015 | + checkWeekElement.addText(ae.getCheckDate() == null ? "" : DateUtil.getWeekDesc(patients.getLastMenses(), ae.getCheckDate())); | |
| 5016 | + | |
| 5017 | + Element checkDateElement = checkElement.addElement("checkDate"); | |
| 5018 | + checkDateElement.addText(DateUtil.getyyyy_MM_dd(ae.getCheckDate())); | |
| 5019 | + | |
| 5020 | + | |
| 5021 | + String hospital = ""; | |
| 5022 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(ae.getHospitalId())) { | |
| 5023 | + Organization organization = organizationService.getOrganization(Integer.parseInt(ae.getHospitalId())); | |
| 5024 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
| 5025 | + hospital = organization.getName(); | |
| 5026 | + } | |
| 4930 | 5027 | } |
| 4931 | - else if ("risk_red".equals(color)) | |
| 5028 | + Element checkHospitalElement = checkElement.addElement("checkHospital"); | |
| 5029 | + checkHospitalElement.addText(hospital); | |
| 5030 | + | |
| 5031 | + Element nextCheckDateElement = checkElement.addElement("nextCheckDate"); | |
| 5032 | + nextCheckDateElement.addText(ae.getNextCheckTime() == null ? "" : DateUtil.getyyyy_MM_dd(ae.getNextCheckTime())); | |
| 5033 | + | |
| 5034 | + | |
| 5035 | + Map map = new HashMap(); | |
| 5036 | + //处理高危因素 | |
| 5037 | + getRisk(ae.getRiskFactor(), ae.getOtherRisk(), map); | |
| 5038 | + | |
| 5039 | + List riskList = (List)map.get("highRisk"); | |
| 5040 | + if (CollectionUtils.isNotEmpty(riskList)) | |
| 4932 | 5041 | { |
| 4933 | - color = "红色"; | |
| 4934 | - } | |
| 4935 | - else if ("risk_purple".equals(color)) | |
| 4936 | - { | |
| 4937 | - color = "紫色"; | |
| 4938 | - } | |
| 4939 | - Element riskFactorElement = riskElement.addElement("riskFactor"); | |
| 5042 | + for (int i = 0 ;i < riskList.size() ; i++) | |
| 5043 | + { | |
| 5044 | + Map<String, String> rmap = (Map<String, String>) riskList.get(i); | |
| 5045 | + String color = rmap.get("color"); | |
| 5046 | + if ("risk_green".equals(color)) | |
| 5047 | + { | |
| 5048 | + color = "绿色"; | |
| 5049 | + } | |
| 5050 | + else if ("risk_orange".equals(color)) | |
| 5051 | + { | |
| 5052 | + color = "橙色"; | |
| 5053 | + } | |
| 5054 | + else if ("risk_yellow".equals(color)) | |
| 5055 | + { | |
| 5056 | + color = "黄色"; | |
| 5057 | + } | |
| 5058 | + else if ("risk_red".equals(color)) | |
| 5059 | + { | |
| 5060 | + color = "红色"; | |
| 5061 | + } | |
| 5062 | + else if ("risk_purple".equals(color)) | |
| 5063 | + { | |
| 5064 | + color = "紫色"; | |
| 5065 | + } | |
| 5066 | + Element riskFactorElement = checkElement.addElement("riskFactor"); | |
| 4940 | 5067 | |
| 4941 | - String name = rmap.get("name"); | |
| 4942 | - Element nElement = riskFactorElement.addElement("riskName"); | |
| 4943 | - nElement.addText(name); | |
| 5068 | + String name = rmap.get("name"); | |
| 5069 | + Element nElement = riskFactorElement.addElement("riskName"); | |
| 5070 | + nElement.addText(name); | |
| 4944 | 5071 | |
| 4945 | - Element colorElement = riskFactorElement.addElement("color"); | |
| 4946 | - colorElement.addText(color); | |
| 5072 | + Element colorElement = riskFactorElement.addElement("color"); | |
| 5073 | + colorElement.addText(color); | |
| 5074 | + } | |
| 5075 | + } | |
| 4947 | 5076 | } |
| 4948 | 5077 | } |
| 4949 | 5078 | } |