|
@@ -40,6 +40,7 @@ import org.apache.http.util.EntityUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
import springfox.documentation.spring.web.json.Json;
|
|
@@ -81,6 +82,7 @@ public class PatientInfoDjFacade extends PatientInfoServiceImpl {
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 对接-页面顶部病人医生科室信息——查询
|
|
|
*
|
|
@@ -391,6 +393,7 @@ public class PatientInfoDjFacade extends PatientInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 对接---获取挂号信息
|
|
|
* 某一时刻患者只可能在一家医院,所以获取到的挂号信息只能是当前医院的,当出现江干的大小医院情况时可采用2种:
|
|
@@ -403,19 +406,49 @@ public class PatientInfoDjFacade extends PatientInfoServiceImpl {
|
|
|
private List<RegisterInfoDTO> getRegisterInfo(SignInVO signInVO) {
|
|
|
List<RegisterInfoDTO> registerInfoDTOS = new ArrayList<>();
|
|
|
//调用第三方的url
|
|
|
- String url = "http://192.168.2.241:1234/a/a";
|
|
|
+ String url = "http://172.17.220.121:27772/cdyzone/rest/CDYZone.APPCON.BS.RestService";
|
|
|
//调用第三方的入参并得到返回的出参
|
|
|
- String json = doPostJson(url,JSONObject.toJSONString(signInVO));
|
|
|
+ String json = doPostJson(url, JSONObject.toJSONString(signInVO));
|
|
|
+ System.out.println("返回的JSON-------------" + json);
|
|
|
//把返回的参数转换成需要的格式
|
|
|
- RespDTO respDTO = JSONObject.parseObject(json,RespDTO.class);
|
|
|
- if (respDTO.code.equals("0")){
|
|
|
- List<SignInDTO> signInDTOS= JSONObject.parseArray(JSONObject.toJSONString(respDTO.data),SignInDTO.class);
|
|
|
+ RespDTO respDTO = JSONObject.parseObject(json, RespDTO.class);
|
|
|
+ if (respDTO.code.equals("0")) {
|
|
|
+ List<SignlnsDTO> signInDTOS = JSONObject.parseArray(JSONObject.toJSONString(respDTO.data), SignlnsDTO.class);
|
|
|
signInDTOS.forEach(signInDTO -> {
|
|
|
+ //病人信息
|
|
|
+ PatientInfo patientInfo = new PatientInfo();
|
|
|
+ patientInfo.setCode(!signInDTO.getPatientCode().isEmpty() ? signInDTO.getPatientCode() : "");
|
|
|
+ patientInfo.setHospitalCode(!signInDTO.getHospitalCode().isEmpty() ? signInDTO.getHospitalCode() : "");
|
|
|
+ patientInfo.setSex(Integer.valueOf(!signInDTO.getSex().isEmpty() ? signInDTO.getSex() : ""));
|
|
|
+ patientInfo.setName(!signInDTO.getPatientName().isEmpty() ? signInDTO.getPatientName() : "");
|
|
|
+ patientInfo.setBirthday(DateUtil.parseDate(!signInDTO.getBirthday().isEmpty() ? signInDTO.getBirthday() : ""));
|
|
|
+ patientInfo.setIdentityNum(!signInDTO.getIdentityNum().isEmpty() ? signInDTO.getIdentityNum() : "");
|
|
|
+ //医生信息
|
|
|
+ DoctorInfo doctorInfo = new DoctorInfo();
|
|
|
+ doctorInfo.setHospitalCode(!signInDTO.getHospitalCode().isEmpty() ? signInDTO.getHospitalCode() : "");
|
|
|
+ doctorInfo.setHospitalDeptCode(!signInDTO.getHospitalDeptCode().isEmpty() ? signInDTO.getHospitalDeptCode() : "");
|
|
|
+ doctorInfo.setSex(Integer.valueOf(!signInDTO.getSex().isEmpty() ? signInDTO.getSex() : ""));
|
|
|
+ doctorInfo.setName(!signInDTO.getDoctorName().isEmpty() ? signInDTO.getDoctorName() : "");
|
|
|
+ doctorInfo.setCode(!signInDTO.getDoctorCode().isEmpty() ? signInDTO.getDoctorCode() : "");
|
|
|
+ //病人详情
|
|
|
+ List<RegisterInfoDetailDTO> detail = new ArrayList<>();
|
|
|
+ RegisterInfoDetailDTO registerInfoDetailDTO = new RegisterInfoDetailDTO();
|
|
|
+ registerInfoDetailDTO.setDoctorInfo(doctorInfo);
|
|
|
+ registerInfoDetailDTO.setRecordTime(!signInDTO.getRecordTime().isEmpty()?signInDTO.getRecordTime():"");
|
|
|
+ registerInfoDetailDTO.setRegisterNum(!signInDTO.getRegisterNum().isEmpty() ? signInDTO.getRegisterNum() : "");
|
|
|
+ registerInfoDetailDTO.setHospitalDeptName(!signInDTO.getHospitalDeptName().isEmpty() ? signInDTO.getHospitalDeptName() : "");
|
|
|
+ registerInfoDetailDTO.setRecordId(!signInDTO.getRecordId().isEmpty() ? signInDTO.getRecordId() : "");
|
|
|
+ registerInfoDetailDTO.setRegisterNum(!signInDTO.getRegisterNum().isEmpty() ? signInDTO.getRegisterNum() : "");
|
|
|
+ registerInfoDetailDTO.setHospitalDeptCode(!signInDTO.getHospitalDeptCode().isEmpty() ? signInDTO.getHospitalDeptCode() : "");
|
|
|
+ detail.add(registerInfoDetailDTO);
|
|
|
+ //医院挂号信息
|
|
|
RegisterInfoDTO registerInfoDTO = new RegisterInfoDTO();
|
|
|
- PatientInfo patientInfo =new PatientInfo();
|
|
|
- BeanUtil.copyProperties(signInDTO,patientInfo);
|
|
|
- BeanUtil.copyProperties(signInDTO,registerInfoDTO);
|
|
|
+ registerInfoDTO.setHospitalCode(!signInDTO.getHospitalCode().isEmpty() ? signInDTO.getHospitalCode() : "");
|
|
|
+ registerInfoDTO.setHospitalName(!signInDTO.getHospitalName().isEmpty() ? signInDTO.getHospitalName() : "");
|
|
|
+ registerInfoDTO.setSonHospitalCode(!signInDTO.getHospitalCode().isEmpty() ? signInDTO.getHospitalCode() : "");
|
|
|
+ registerInfoDTO.setSonHospitalName(!signInDTO.getHospitalName().isEmpty() ? signInDTO.getHospitalName() : "");
|
|
|
registerInfoDTO.setPatientInfo(patientInfo);
|
|
|
+ registerInfoDTO.setDetail(detail);
|
|
|
registerInfoDTOS.add(registerInfoDTO);
|
|
|
});
|
|
|
}
|
|
@@ -424,6 +457,7 @@ public class PatientInfoDjFacade extends PatientInfoServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 调用
|
|
|
+ *
|
|
|
* @param url
|
|
|
* @param json
|
|
|
* @return
|