| | |
| | | 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; |
| | |
| | | //设置检查类型 |
| | | // 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))); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 将AppointmentDO转换为AppointmentSaveReqVO并保存 |
| | | AppointmentSaveReqVO saveReqVO = BeanUtils.toBean(appointment, AppointmentSaveReqVO.class); |
| | |
| | | * 从dataMap中提取encounter数据 |
| | | */ |
| | | 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 |