| | |
| | | String action = "S0405"; |
| | | ApplicationTemplate app = new ApplicationTemplate(); |
| | | String statusName = AppointmentTypeEnum.getByType(appointment.getStatus()); |
| | | String message = app.getXML( |
| | | appointment.getApplyNo(), |
| | | appointment.getStatus(), |
| | | statusName, |
| | | null, |
| | | appointment.getPatDeptCode(), |
| | | appointment.getPatDeptDesc(), |
| | | appointment.getPatWardCode(), |
| | | appointment.getPatWardDesc(), |
| | | appointment.getPatBedNo(), |
| | | appointment.getEpisodeId(), |
| | | String.valueOf(appointment.getBookSrc()), |
| | | appointment.getPatId(), |
| | | appointment.getPatName() |
| | | ); |
| | | String message = app.getXML(appointment.getApplyNo(), appointment.getStatus(), statusName, null, appointment.getPatDeptCode(), appointment.getPatDeptDesc(), appointment.getPatWardCode(), appointment.getPatWardDesc(), appointment.getPatBedNo(), appointment.getEpisodeId(), String.valueOf(appointment.getBookSrc()), appointment.getPatId(), appointment.getPatName()); |
| | | |
| | | try { |
| | | String response = webServiceClient.callJHFWTYRK(action, "", message); |
| | |
| | | @Override |
| | | public List<AppointmentDO> queryAndCreateAppointmentByPatId(String patCode) { |
| | | // 从医院平台查询 |
| | | List<AppointmentDO> appointmentExtermalList = getAppointmentExtermal(patCode); |
| | | List<AppointmentDO> appointmentExtermalList = appointmentMapper.getCurrentCode(patCode); |
| | | |
| | | for (int appointmentIndex = 0; appointmentIndex < appointmentExtermalList.size(); appointmentIndex++) { |
| | | AppointmentDO appointmentExtermal = appointmentExtermalList.get(appointmentIndex); |
| | |
| | | |
| | | Optional.ofNullable(encounter.get("location")).map(location -> (Map<String, Object>) location).map(location -> (Map<String, Object>) location.get("serviceDeliveryLocation")).map(serviceDeliveryLocation -> (Map<String, Object>) serviceDeliveryLocation.get("location")).map(location -> (Map<String, Object>) location.get("id")).map(id -> (Map<String, Object>) id.get("item")).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatBedNo); |
| | | |
| | | 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 ISDN = zdy.get("ISDN"); |
| | | if (ISDN != null) { |
| | | return ISDN.toString(); |
| | | } |
| | | return null; |
| | | }).ifPresent(appointment::setTolerance); |
| | | |
| | | // 设置患者来源类型 |
| | | Optional.ofNullable(encounter.get("code")).map(code -> (Map<String, Object>) code).map(code -> (String) code.get("code")).map(Integer::parseInt).ifPresent(appointment::setPatSrc); |
| | |
| | | Optional.ofNullable(encounter.get("subject")).map(subject -> (Map<String, Object>) subject).map(subject -> (Map<String, Object>) subject.get("patient")).map(patient -> (Map<String, Object>) patient.get("patientPerson")).ifPresent(patientPerson -> { |
| | | // 设置患者ID |
| | | Optional.ofNullable(encounter.get("subject")).map(subject -> (Map<String, Object>) subject).map(subject -> (Map<String, Object>) subject.get("patient")).map(patient -> (Map<String, Object>) patient.get("id")).map(id -> (Map<String, Object>) id).map(id -> (List<?>) id.get("item")).filter(items -> items.size() > 1).map(items -> (Map<String, Object>) items.get(1)).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatId); |
| | | |
| | | // 设置患者门诊号 |
| | | Optional.ofNullable(encounter.get("subject")).map(subject -> (Map<String, Object>) subject).map(subject -> (Map<String, Object>) subject.get("patient")).map(patient -> (Map<String, Object>) patient.get("id")).map(id -> (Map<String, Object>) id).map(id -> (List<?>) id.get("item")).filter(items -> items.size() > 1).map(items -> (Map<String, Object>) items.get(2)).map(item -> (String) item.get("extension")).ifPresent(appointment::setOutpatientNo); |
| | | |
| | | // 设置患者住院号 |
| | | Optional.ofNullable(encounter.get("subject")).map(subject -> (Map<String, Object>) subject).map(subject -> (Map<String, Object>) subject.get("patient")).map(patient -> (Map<String, Object>) patient.get("id")).map(id -> (Map<String, Object>) id).map(id -> (List<?>) id.get("item")).filter(items -> items.size() > 1).map(items -> (Map<String, Object>) items.get(2)).map(item -> (String) item.get("extension")).ifPresent(appointment::setHospitalNo); |
| | | |
| | | // 设置患者姓名 |
| | | Optional.ofNullable(patientPerson.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::setPatName); |
| | |
| | | |
| | | // 设置患者身份证号 |
| | | 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(0)).map(item -> (String) item.get("extension")).ifPresent(appointment::setPatIdentityId); |
| | | |
| | | //患者医保卡 |
| | | 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); |
| | | }); |
| | | |
| | | // 设置科室和病区信息 |