diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java index c928e2f..3eb4fa3 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java @@ -61,4 +61,22 @@ public class NumberUtils { return NumberUtil.mul(values); } + /** + * 检查给定的字符串是否为数值类型 + * + * @param value 要检查的字符串 + * @return 如果字符串为数值类型,则返回 true;否则返回 false + */ + public static boolean isNumeric(String value) { + if (value == null || value.isEmpty()) { + return false; + } + try { + Double.parseDouble(value); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java index f5dfb95..ef55dcb 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstant import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.http.HttpUtils; import cn.iocoder.yudao.framework.common.util.io.FileUtils; +import cn.iocoder.yudao.framework.common.util.number.NumberUtils; import cn.iocoder.yudao.framework.common.util.string.StrUtils; import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO; import cn.iocoder.yudao.module.infra.service.config.ConfigService; @@ -640,7 +641,79 @@ public class InspectPatientController { } inspectPacs.setItem(sb.toString()); } + //解析尿常规异常项 + if (type.equals("NCG")) { + if (reportData.getResultsAll() != null && reportData.getResultsAll().size() > 0) { + StringBuilder ncgsb = new StringBuilder(); + // 获取 results 数组并遍历 + List results = reportData.getResultsAll(); + for (ResultItem result : results) { + switch (result.getItemCode()) { + case "WBC": + case "NIT": + if (result.getItemValue() != null && result.getItemValue().contains("+")) { + ncgsb.append("【" + result.getItemName() + ":" + "该项异常,值为:" +result.getItemValue()+ "】" + "\n"); + } + break; + case "URO": + if (result.getItemValue() != null && !result.getItemValue().contains("Normal")) { + ncgsb.append("【" + result.getItemName() + ":" + "该项异常,值为:" +result.getItemValue()+ "】" + "\n"); + } + break; + case "PRO": + case "BLD": + case "BIL": + case "KET": + case "GLU": + if (result.getItemValue() != null && !result.getItemValue().contains("+")) { + ncgsb.append("【" + result.getItemName() + ":" + "该项异常,值为:" +result.getItemValue()+ "】" + "\n"); + } + break; + case "PH": + if (result.getItemValue() != null) { + if(NumberUtils.isNumeric(result.getItemValue())) + { + double ph = Double.parseDouble(result.getItemValue()); + if(ph<5.0 || ph>8.0) + { + ncgsb.append("【" + result.getItemName() + ":" + "该项异常,值为:" +result.getItemValue()+ "】" + "\n"); + } + } + } + break; + case "SG": + if (result.getItemValue() != null) { + if(NumberUtils.isNumeric(result.getItemValue())) + { + double sg = Double.parseDouble(result.getItemValue()); + if(sg<1.015 || sg>1.025) + { + ncgsb.append("【" + result.getItemName() + ":" + "该项异常,值为:" +result.getItemValue()+ "】" + "\n"); + } + } + } + break; + case "VC": + if (result.getItemValue() != null) { + if(NumberUtils.isNumeric(result.getItemValue())) + { + double vc = Double.parseDouble(result.getItemValue()); + if( vc>10) + { + ncgsb.append("【" + result.getItemName() + ":" + "该项异常,值为:" +result.getItemValue()+ "】" + "\n"); + } + } + } + break; + + + } + + } + inspectPacs.setItem(ncgsb.toString()); + } + } pacsDataService.createPacsData(inspectPacs); } @@ -672,12 +745,11 @@ public class InspectPatientController { // 获取 pdfurl 和 pname String pdfurl = (String) dataMap.get("pdfurl"); String pname = (String) dataMap.get("pname"); - String examDescription=""; - String diagResults=""; - if(dataMap.get("examDescription")!=null&&dataMap.get("diagResults")!=null) - { - examDescription = (String) dataMap.get("examDescription"); - diagResults = (String) dataMap.get("diagResults"); + String examDescription = ""; + String diagResults = ""; + if (dataMap.get("examDescription") != null && dataMap.get("diagResults") != null) { + examDescription = (String) dataMap.get("examDescription"); + diagResults = (String) dataMap.get("diagResults"); } // 检查 pdfurl 和 pname 是否为空 @@ -690,8 +762,7 @@ public class InspectPatientController { pacsDataService.createPacsData(inspectPacs); } //更新超声所见所得 - if(examDescription!=null&&!examDescription.isEmpty()&&diagResults!=null&&!diagResults.isEmpty()) - { + if (examDescription != null && !examDescription.isEmpty() && diagResults != null && !diagResults.isEmpty()) { InspectPatientitemsSaveReqVO saveReqVO = new InspectPatientitemsSaveReqVO(); saveReqVO.setMedicalSn(medicalSn); saveReqVO.setItemCode("US001"); @@ -1447,6 +1518,7 @@ public class InspectPatientController { patientService.updateMedicalDateTime(medicalSn, medicalDateTime); return success(true); } + @GetMapping("/GetbarcodeInfo") @Operation(summary = "获取样本码信息") public CommonResult GetbarcodeInfo(@RequestParam("medicalSn") String medicalSn) { @@ -1456,8 +1528,7 @@ public class InspectPatientController { if (patientDO == null) { return success("未找到该患者信息"); } - if(patientDO.getNcgcode()==null || patientDO.getXcgcode()==null|| patientDO.getShqx()==null) - { + if (patientDO.getNcgcode() == null || patientDO.getXcgcode() == null || patientDO.getShqx() == null) { return success("条码不存在"); } BarcodeInfoVO barcodeInfoVO = new BarcodeInfoVO();