| | |
| | | Optional.ofNullable(patientPerson.get("id")).map(id -> (Map<String, Object>) id).map(id -> (List<?>) id.get("item")).filter(items -> !items.isEmpty()).map(items -> (Map<String, Object>) items.get(1)).map(item -> (String) item.get("extension")).ifPresent(appointment::setMedicalCard); |
| | | }); |
| | | |
| | | // 设置科室和病区信息 |
| | | Optional.ofNullable(encounter.get("location")).map(location -> (Map<String, Object>) location).map(location -> (Map<String, Object>) location.get("serviceDeliveryLocation")).map(location -> (Map<String, Object>) location.get("serviceProviderOrganization")).ifPresent(org -> { |
| | | // 设置科室代码和名称 |
| | | Optional.ofNullable(org.get("id")).map(id -> (Map<String, Object>) id).map(id -> (Map<String, Object>) id.get("item")).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatDeptCode); |
| | | |
| | | Optional.ofNullable(org.get("name")).map(name -> (Map<String, Object>) name).map(name -> (Map<String, Object>) name.get("item")).map(item -> (Map<String, Object>) item.get("part")).map(part -> (String) part.get("value")).ifPresent(appointment::setPatDeptDesc); |
| | | |
| | | // 设置病区代码和名称 |
| | | Optional.ofNullable(org.get("asOrganizationPartOf")).map(wardOrg -> (Map<String, Object>) wardOrg).map(wardOrg -> (Map<String, Object>) wardOrg.get("wholeOrganization")).ifPresent(wardOrg -> { |
| | | Optional.ofNullable(wardOrg.get("id")).map(id -> (Map<String, Object>) id).map(id -> (Map<String, Object>) id.get("item")).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatWardCode); |
| | | |
| | | Optional.ofNullable(wardOrg.get("name")).map(name -> (Map<String, Object>) name).map(name -> (Map<String, Object>) name.get("item")).map(item -> (Map<String, Object>) item.get("part")).map(part -> (String) part.get("value")).ifPresent(appointment::setPatWardDesc); |
| | | }); |
| | | }); |
| | | |
| | | // 设置支付状态 |
| | | 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("zdy")).map(zdy -> { |
| | | Object payStatus = zdy.get("PayStatus"); |
| | |
| | | appointment.setBookCheckType(Integer.valueOf(HisCheckNameEnum.getByName(checkName))); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 设置科室和病区信息 |
| | | Optional.ofNullable(encounter.get("location")).map(location -> (Map<String, Object>) location).map(location -> (Map<String, Object>) location.get("serviceDeliveryLocation")).map(location -> (Map<String, Object>) location.get("serviceProviderOrganization")).ifPresent(org -> { |
| | | // 设置科室代码和名称 |
| | | Optional.ofNullable(org.get("id")).map(id -> (Map<String, Object>) id).map(id -> (Map<String, Object>) id.get("item")).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatDeptCode); |
| | | |
| | | Optional.ofNullable(org.get("name")).map(name -> (Map<String, Object>) name).map(name -> (Map<String, Object>) name.get("item")).map(item -> (Map<String, Object>) item.get("part")).map(part -> (String) part.get("value")).ifPresent(appointment::setPatDeptDesc); |
| | | |
| | | // 设置病区代码和名称 |
| | | Optional.ofNullable(org.get("asOrganizationPartOf")).map(wardOrg -> (Map<String, Object>) wardOrg).map(wardOrg -> (Map<String, Object>) wardOrg.get("wholeOrganization")).ifPresent(wardOrg -> { |
| | | Optional.ofNullable(wardOrg.get("id")).map(id -> (Map<String, Object>) id).map(id -> (Map<String, Object>) id.get("item")).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatWardCode); |
| | | if (appointment.getPatSrc() != null && appointment.getPatSrc() == 4) { |
| | | //体检就这一个科室 |
| | | appointment.setPatDeptDesc("健康管理中心"); |
| | | } else { |
| | | Optional.ofNullable(wardOrg.get("name")).map(name -> (Map<String, Object>) name).map(name -> (Map<String, Object>) name.get("item")).map(item -> (Map<String, Object>) item.get("part")).map(part -> (String) part.get("value")).ifPresent(appointment::setPatWardDesc); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | |
| | | // 将AppointmentDO转换为AppointmentSaveReqVO并保存 |
| | |
| | | * 从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 |