From b8bb77b1377f0a51831810e1c561440b1801615e Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Sat, 19 Apr 2025 18:28:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E4=BC=A0=E5=85=AC?= =?UTF-8?q?=E5=8D=AB=E4=BD=93=E6=A3=80=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E4=BB=A5=E5=8F=8A=E5=AF=B9=E5=A4=96=E6=9A=B4=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InspectPatientController.java | 122 +++++++++++++----- .../InspectPatientitemsService.java | 4 + .../InspectPatientitemsServiceImpl.java | 15 +++ .../src/main/resources/application.yaml | 3 + 4 files changed, 114 insertions(+), 30 deletions(-) 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 5543337..999fb4d 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 @@ -734,6 +734,7 @@ public class InspectPatientController { } return success(true); } + @GetMapping("/PushJYPatientInfo") @Operation(summary = "回传体检相关信息") public CommonResult PushJYPatientInfo(@RequestParam("medicalSn") String medicalSn) throws JsonProcessingException { @@ -754,17 +755,14 @@ public class InspectPatientController { //先添加基本信息 patientJYInfoVO.setPatientname(patientDO.getPName()); patientJYInfoVO.setIdcard(patientDO.getCardId()); - if(patientDO.getMedicalDateTime()!=null) - { + if (patientDO.getMedicalDateTime() != null) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); patientJYInfoVO.setExamindate(patientDO.getMedicalDateTime().format(formatter)); } //心电图信息 - InspectPacsDataDO ecg = pacsDataService.getPacsDataByCode(medicalSn,"ecg"); - if(ecg!=null) - { - if(ecg.getData()!=null) - { + InspectPacsDataDO ecg = pacsDataService.getPacsDataByCode(medicalSn, "ecg"); + if (ecg != null) { + if (ecg.getData() != null) { patientJYInfoVO.setElectrokardiagramtypeid(1); patientJYInfoVO.setElectrocardiogramimg(ecg.getData()); } @@ -812,25 +810,34 @@ public class InspectPatientController { } break; case "PRO"://尿常规尿蛋白 - if (result.getItemValue() != null) - { + if (result.getItemValue() != null) { patientJYInfoVO.setUrineprotein(result.getItemValue()); } break; case "GLU"://尿常规尿糖 - if (result.getItemValue() != null) + if(barCode.equals(patientDO.getShqx())) { - patientJYInfoVO.setUrinesugar(result.getItemValue()); + if (result.getItemValue() != null) { + if (NumberUtils.isNumeric(result.getItemValue())) { + double value = Double.parseDouble(result.getItemValue()); + patientJYInfoVO.setFastplasmaglucoseml(value); + } + } } - case "KET"://尿常规尿酮体 - if (result.getItemValue() != null) + else { + if (result.getItemValue() != null) { + patientJYInfoVO.setUrinesugar(result.getItemValue()); + } + } + break; + case "KET"://尿常规尿酮体 + if (result.getItemValue() != null) { patientJYInfoVO.setUnrineketone(result.getItemValue()); } break; case "BLD"://尿常规潜血 - if (result.getItemValue() != null) - { + if (result.getItemValue() != null) { patientJYInfoVO.setUnrineoccultblood(result.getItemValue()); } break; @@ -874,6 +881,53 @@ public class InspectPatientController { } } break; + case "AST"://谷丙转氨酶 + if (result.getItemValue() != null) { + if (NumberUtils.isNumeric(result.getItemValue())) { + double value = Double.parseDouble(result.getItemValue()); + patientJYInfoVO.setSgpt(value); + } + } + break; + case "UREA"://尿素 + if (result.getItemValue() != null) { + if (NumberUtils.isNumeric(result.getItemValue())) { + double value = Double.parseDouble(result.getItemValue()); + patientJYInfoVO.setBun(value); + } + } + break; + case "ALT"://谷草转氨酶 + if (result.getItemValue() != null) { + if (NumberUtils.isNumeric(result.getItemValue())) { + double value = Double.parseDouble(result.getItemValue()); + patientJYInfoVO.setSgot(value); + } + } + break; + case "TBLL": + if(barCode.equals(patientDO.getShqx())) + { + if (result.getItemValue() != null) { + if (NumberUtils.isNumeric(result.getItemValue())) { + double value = Double.parseDouble(result.getItemValue()); + patientJYInfoVO.setTotalbilirubin(value); + } + } + } + break; + case "CREA": + if(barCode.equals(patientDO.getShqx())) + { + if (result.getItemValue() != null) { + if (NumberUtils.isNumeric(result.getItemValue())) { + double value = Double.parseDouble(result.getItemValue()); + patientJYInfoVO.setSerumcreatinine(value); + } + } + } + break; + } } @@ -890,7 +944,11 @@ public class InspectPatientController { } } } - + //添加超声数据 + String usitemresult = patientitemsService.GetItemResult(medicalSn, "US001"); + if (usitemresult != null&&usitemresult!="") { + patientJYInfoVO.setBultrasound(usitemresult); + } //获取配置项地址 ConfigDO configDO = configService.getConfigByKey("url.tjhc"); // 发送 POST 请求 @@ -915,9 +973,10 @@ public class InspectPatientController { responseLogVO1.setIdcard(patientDO.getCardId()); responseLogVO1.setJson(response); applylogService.createApplylog(responseLogVO1); + } else { + return success(true, "未查询到患者样本码"); } - } return success(true); } @@ -960,8 +1019,8 @@ public class InspectPatientController { InspectPatientitemsSaveReqVO saveReqVO = new InspectPatientitemsSaveReqVO(); saveReqVO.setMedicalSn(medicalSn); saveReqVO.setItemCode("US001"); - saveReqVO.setExamDescription(examDescription.replace('\n',' ')); - saveReqVO.setItemResult(diagResults.replace('\n',' ')); + saveReqVO.setExamDescription(examDescription.replace('\n', ' ')); + saveReqVO.setItemResult(diagResults.replace('\n', ' ')); patientitemsService.updateitemUSinference(saveReqVO); } @@ -1465,13 +1524,14 @@ public class InspectPatientController { } return success(inspectApiInfoVO); } + @GetMapping("/updatePatientSupplement") @Operation(summary = "更新公卫患者扩展信息") - public CommonResult updatePatientSupplement(@RequestParam("medicalSn") String medicalSn,@RequestParam("idCard") String idCard) throws JsonProcessingException { + public CommonResult updatePatientSupplement(@RequestParam("medicalSn") String medicalSn, @RequestParam("idCard") String idCard) throws JsonProcessingException { ConfigDO config = configService.getConfigByKey("url.patientinfo"); String url = config.getValue(); - PatientSupplementVO patientSupplementVO = new PatientSupplementVO(); + PatientSupplementVO patientSupplementVO = new PatientSupplementVO(); patientSupplementVO.setMedicalSn(medicalSn); if (url != null) { String response = HttpUtils.post(url + "?" + "idCard=" + idCard); @@ -1502,7 +1562,7 @@ public class InspectPatientController { if (dataMap.get("pulflag") != null) { patientSupplementVO.setPulflag(dataMap.get("pulflag").toString()); } - patientService. updatePatientsupplement(patientSupplementVO); + patientService.updatePatientsupplement(patientSupplementVO); } else { return success("没有查询到相关信息"); } @@ -1511,6 +1571,7 @@ public class InspectPatientController { return success(true); } + @PutMapping("/syncPatientZyInfo") @Operation(summary = "同步中医体质结果项") public CommonResult syncPatientZyInfo(@RequestParam("medicalSn") String medicalSn, @RequestParam("cardId") String cardId) throws JsonProcessingException { @@ -1829,15 +1890,16 @@ public class InspectPatientController { return success(barcodeInfoVO); } + @GetMapping("/getworkload") @Operation(summary = "根据日期获取卫生院体检统计") public CommonResult> getWorkload(@RequestParam("dates") @DateTimeFormat(pattern = "yyyy-MM-dd") List dates) { // 获取指定日期范围内的所有患者补充信息 List supplements = patientService.getPatientSupplementsByDates(dates); - + // 使用Map来存储统计结果,key为卫生院名称+行政村名称 Map statisticsMap = new HashMap<>(); - + // 遍历所有补充信息进行统计 for (PatientSupplementVO supplement : supplements) { String key = supplement.getOrgname() + "_" + supplement.getDistrictname(); @@ -1853,7 +1915,7 @@ public class InspectPatientController { vo.setSum(0); return vo; }); - + // 统计各项数量 if ("1".equals(supplement.getOldmanflag())) { statistics.setOldmanflag(statistics.getOldmanflag() + 1); @@ -1870,13 +1932,13 @@ public class InspectPatientController { if ("1".equals(supplement.getPulflag())) { statistics.setPulflag(statistics.getPulflag() + 1); } - + // 计算总数 - statistics.setSum(statistics.getOldmanflag() + statistics.getHtnflag() + - statistics.getDiaflag() + statistics.getSmiflag() + - statistics.getPulflag()); + statistics.setSum(statistics.getOldmanflag() + statistics.getHtnflag() + + statistics.getDiaflag() + statistics.getSmiflag() + + statistics.getPulflag()); } - + // 将Map转换为List并返回 return success(new ArrayList<>(statisticsMap.values())); } diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsService.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsService.java index 4e3903a..17f57b7 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsService.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsService.java @@ -70,6 +70,10 @@ public interface InspectPatientitemsService { * 根据体检编号和项目编号查询指定项目 * */ String Getanalyse(String medicalSn, String itemCode); + /* + * 根据体检编号和项目编号查询所得 + * */ + String GetItemResult(String medicalSn, String itemCode); /* * 根据体检编号和项目编号更新结论和所见 diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsServiceImpl.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsServiceImpl.java index 74ff385..35af67e 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsServiceImpl.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatientitems/InspectPatientitemsServiceImpl.java @@ -135,6 +135,21 @@ public class InspectPatientitemsServiceImpl implements InspectPatientitemsServic } return msg; } + @Override + public String GetItemResult(String medicalSn, String itemCode) + { + String msg=""; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("medicalSn", medicalSn); + queryWrapper.eq("itemCode", itemCode); + InspectPatientitemsDO patientitemsDO= patientitemsMapper.selectOne(queryWrapper); + if(patientitemsDO!=null) + { + msg = patientitemsDO.getItemResult(); + } + return msg; + } + private void validatePatientitemsExists(Integer id) { if (patientitemsMapper.selectById(id) == null) { diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 9bec30f..ee67e86 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -233,6 +233,7 @@ yudao: - /admin-api/inspect/patient/getUSTj #同步超声 - /admin-api/inspect/patient/generateReport # pdf生成 - /admin-api/inspect/patient/updatePatientSupplement #公卫患者信息补充扩展 + - /admin-api/inspect/patient/PushJYPatientInfo #回传公卫体检信息 websocket: enable: true # websocket的开关 path: /infra/ws # 路径 @@ -281,6 +282,7 @@ yudao: - /admin-api/inspect/patient/getUSTj #同步超声 - /admin-api/inspect/patient/generateReport # pdf生成存放 - /admin-api/inspect/patient/updatePatientSupplement #公卫患者信息补充扩展 + - /admin-api/inspect/patient/PushJYPatientInfo #回传公卫体检信息 - /adminInspect/admin-api/inspect/department/getList - /adminInspect/admin-api/inspect/patient/getUSPatientInfo - /adminInspect/admin-api/system/captcha/get @@ -296,6 +298,7 @@ yudao: - /adminInspect/admin-api/inspect/patient/getUSTj #同步超声 - /adminInspect/admin-api/inspect/patient/generateReport #pdf生成存放 - /adminInspect/admin-api/inspect/patient/updatePatientSupplement #公卫患者信息补充扩展 + - /adminInspect/admin-api/inspect/patient/PushJYPatientInfo #回传公卫体检信息 ignore-tables: - system_tenant - system_tenant_package