From 3d1344ca6f0613bf3726d2c40d35f3928f82a910 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期一, 15 九月 2025 18:15:27 +0800 Subject: [PATCH] 代码提交 --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java index fb98ade..cdd312e 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java @@ -13,6 +13,7 @@ import cn.lihu.jh.module.ecg.dal.mysql.appointment.AppointmentMapper; import cn.lihu.jh.module.ecg.enums.AppointmentTypeEnum; import cn.lihu.jh.module.ecg.enums.HisCheckCodeEnum; +import cn.lihu.jh.module.ecg.enums.HisCheckNameEnum; import cn.lihu.jh.module.ecg.feign.RemoteDataService; import cn.lihu.jh.module.ecg.service.config.EcgConfigService; import cn.lihu.jh.module.ecg.service.devrent.ApplicationTemplate; @@ -466,8 +467,17 @@ //璁剧疆妫�鏌ョ被鍨� // String checkType = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("code")).map(code -> (String) code.get("code")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL)); String checkType = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("code")).map(code -> (String) code.get("code")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL)); - if (checkType != null || checkType != "") - appointment.setBookCheckType(Integer.valueOf(HisCheckCodeEnum.getByCode(checkType.substring(1)))); + String checkName = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("code")).map(code -> (Map<String, Object>) code.get("displayName")).map(displayName -> (String) displayName.get("value")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL)); + if (appointment.getPatSrc() != null && appointment.getPatSrc() != 4) { + if (checkType != null || checkType != "") + appointment.setBookCheckType(Integer.valueOf(HisCheckCodeEnum.getByCode(checkType.substring(1)))); + } else if (appointment.getPatSrc() != null && appointment.getPatSrc() == 4) { + if (StringUtils.isNotEmpty(checkName)) { + checkName = checkName.replaceAll("\\s+", ""); + appointment.setBookCheckType(Integer.valueOf(HisCheckNameEnum.getByName(checkName))); + } + } + // 灏咥ppointmentDO杞崲涓篈ppointmentSaveReqVO骞朵繚瀛� AppointmentSaveReqVO saveReqVO = BeanUtils.toBean(appointment, AppointmentSaveReqVO.class); @@ -618,7 +628,12 @@ * 浠巇ataMap涓彁鍙杄ncounter鏁版嵁 */ private Map<String, Object> extractEncounter(Map<String, Object> dataMap) { - return Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("componentOf1")).map(componentOf1 -> (Map<String, Object>) componentOf1.get("encounter")).orElse(null); + return Optional.ofNullable(dataMap.get("controlActProcess")) + .map(controlActProcess -> (Map<String, Object>) controlActProcess) + .map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")) + .map(subject -> (Map<String, Object>) subject.get("observationRequest")) + .map(observationRequest -> (Map<String, Object>) observationRequest.get("componentOf1")) + .map(componentOf1 -> (Map<String, Object>) componentOf1.get("encounter")).orElse(null); } @Override @@ -699,16 +714,21 @@ Map<String, Object> component2 = (Map<String, Object>) placerGroup.get("component2"); Map<String, Object> observationRequest = (Map<String, Object>) component2.get("observationRequest"); Map<String, Object> id = (Map<String, Object>) observationRequest.get("id"); - String applyNo = String.valueOf(id.get("extension")); + Map<String, Object> item = (Map<String, Object>) id.get("item"); + String applyNo = (String) item.get("extension"); //鑾峰彇status Map<String, Object> component1 = (Map<String, Object>) observationRequest.get("component1"); Map<String, Object> processStep = (Map<String, Object>) component1.get("processStep"); Map<String, Object> codeMap = (Map<String, Object>) processStep.get("code"); String status = String.valueOf(codeMap.get("code")); - + Date date = null; + if (status.equals("3")) { + //璁板綍鐧昏鏃堕棿 + date = new Date(); + } //鐘舵�佹洿鏂� - Integer i = appointmentMapper.updateStatusByApplyNo(applyNo, status, null); + Integer i = appointmentMapper.updateStatusByApplyNo(applyNo, status, date); log.info("鐢宠鍗曠櫥璁癮pplyNo:{},鐘舵�乻tatus:{},鏇存柊缁撴灉锛歿}", applyNo, status, i); } -- Gitblit v1.9.3