From f9e2a4ddfe0dac6707a3bfe64476209b2925b1fb Mon Sep 17 00:00:00 2001 From: cfl Date: Wed, 18 Oct 2023 14:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=98=AF=E5=90=A6=E5=AD=95=E5=A6=87=E6=A0=87?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PatientController.java | 22 +++++++++++++++++- .../com/lyms/talkonlineweb/util/CommonUtil.java | 27 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/CommonUtil.java 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("孕,高血压")); + } + +} -- 1.8.3.1