diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index 9ba0d3e..b229cf9 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -420,10 +420,30 @@ public class PatientController { lymsPatientService.saveOrUpdate(patient2); } + //确定patient后查询病例信息 + LymsPcase pcase=new LymsPcase(); + pcase.setPid(patient2.getId()); + List pcases = lymsPcaseService.list(Wrappers.query(pcase)); + //判断是否孕妇 + int flag = 0; + for(LymsPcase pcase1 : pcases){ + LymsIllness illness = new LymsIllness(); + illness.setPcid(pcase1.getPcid()); + List illnesses= lymsIllnessService.list(Wrappers.query(illness)); + for(LymsIllness illness1 : illnesses){ + if(CommonUtil.isPregnantByIllName(illness1.getIname())){ + flag = 1; + } + } + + } + + patient.setPpasswd(null); map.put("patient", patient2); map.put("token", jwt); - map.put("pcaseSize", pcaseSize); + map.put("pcaseSize", pcases.size()); + map.put("isPregnant",flag); baseResponse.setErrorcode(0); baseResponse.setObject(map); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/CommonUtil.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/CommonUtil.java new file mode 100644 index 0000000..d44b229 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/CommonUtil.java @@ -0,0 +1,27 @@ +package com.lyms.talkonlineweb.util; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class CommonUtil { + + static String regex = "孕\\d{1,2}周|已分娩"; + /** + * 通过病名判断是否是孕妇 + * @param illName + * @return + */ + public static boolean isPregnantByIllName(String illName){ + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(illName); + if(matcher.find()){ + return true; + } + return false; + } + + public static void main(String[] args) { + System.out.println(isPregnantByIllName("孕,高血压")); + } + +}