|
@@ -1,12 +1,19 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
-
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
+import com.diagbot.yujian.model.ReqBody;
|
|
|
+import com.diagbot.yujian.model.ReqHead;
|
|
|
+import com.diagbot.yujian.model.patientInfo.request.PatientInfoRequest;
|
|
|
+import com.diagbot.yujian.model.patientInfo.response.PatientInfoResponseBody;
|
|
|
+import com.diagbot.yujian.webservicetest.WebServicesPortTypeProxy;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-
|
|
|
import com.diagbot.dto.GetTopPatientInfoDTO;
|
|
|
import com.diagbot.dto.PatientInfoDTO;
|
|
|
import com.diagbot.entity.PatientInfo;
|
|
@@ -95,6 +102,7 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
|
|
|
* @return 病人信息
|
|
|
*/
|
|
|
public PatientInfoDTO getHisPatientInfo(@RequestBody PatientInfoVO patientInfoVO) throws ParseException {
|
|
|
+
|
|
|
//请求交易头head
|
|
|
ReqHead head = new ReqHead();
|
|
|
head.setTranType("ICSS_GET_PATIENT");
|
|
@@ -112,55 +120,65 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
|
|
|
|
|
|
String reqXml = JaxbUtil.convertToXml(body);
|
|
|
System.out.println("请求Xml : " + reqXml);
|
|
|
- PhisLtfzzdService ps = new PhisLtfzzdServiceService().getPhisLtfzzdServicePort();
|
|
|
- String resXml = ps.icssGETPATIENT(reqXml);
|
|
|
+ WebServicesPortTypeProxy proxy = new WebServicesPortTypeProxy("http://118.31.73.190:8081/APP_Webservicesfuzl/service/WebServices");
|
|
|
+ String resXml=proxy.ICSS_GET_PATIENT(reqXml);
|
|
|
System.out.println("返回 Xml : " + resXml);
|
|
|
|
|
|
- /*try {
|
|
|
- //接口调用信息记录
|
|
|
- HttpApi<InterfaceResponse> api = new HttpApi<InterfaceResponse>();
|
|
|
- InterfaceInfoWrapper interfaces = new InterfaceInfoWrapper();
|
|
|
- interfaces.setHospitalId(patientInfoVO.getHospitalCode());
|
|
|
- interfaces.setDoctorNo(patientInfoVO.getDoctorCode());
|
|
|
- interfaces.setDeptId(patientInfoVO.getDeptNo());
|
|
|
- interfaces.setName("创业患者信息获取接口");
|
|
|
- interfaces.setParamIn(reqXml);
|
|
|
- interfaces.setParamOut(resXml);
|
|
|
- interfaces.setTransTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
- interfaces.setRemark("江干区中医院创业");
|
|
|
- api.doPost("http://localhost:8082/note-web/interfaces/record", interfaces, InterfaceResponse.class);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }*/
|
|
|
+ /*try {
|
|
|
+ //接口调用信息记录
|
|
|
+ HttpApi<InterfaceResponse> api = new HttpApi<InterfaceResponse>();
|
|
|
+ InterfaceInfoWrapper interfaces = new InterfaceInfoWrapper();
|
|
|
+ interfaces.setHospitalId(patient.getHospitalCode());
|
|
|
+ interfaces.setDoctorNo(patient.getDoctorCode());
|
|
|
+ interfaces.setName("创业保存接口");
|
|
|
+ interfaces.setParamIn(reqXml);
|
|
|
+ interfaces.setParamOut(resXml);
|
|
|
+ interfaces.setTransTime(new Date().toString());
|
|
|
+ api.doPost(InitConfig.get("save.interfaces.record.url"), interfaces, InterfaceResponse.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }*/
|
|
|
|
|
|
//将返回的xml格式的数据拆包
|
|
|
- PatientInfoResponseBody resBody = JaxbUtil.converyToJavaBean(resXml, PatientInfoResponseBody.class);
|
|
|
+ PatientInfoResponseBody resBody = (PatientInfoResponseBody) JaxbUtil.converyToJavaBean(resXml,
|
|
|
+ PatientInfoResponseBody.class);
|
|
|
|
|
|
- PatientInfoDTO patientInfo = new PatientInfoDTO();
|
|
|
+ PatientInfo patientInfo = new PatientInfo();
|
|
|
if(resBody!=null){
|
|
|
if(resBody.getRet()==0){
|
|
|
HISPatient hISPatien = resBody.getData();
|
|
|
- patientInfo.setCode(patientInfoVO.getPatientCode());
|
|
|
+ patientInfo.setId(Long.parseLong(patient.getHisCode()));
|
|
|
patientInfo.setName(hISPatien.getPatName());
|
|
|
- patientInfo.setSex(Integer.parseInt(hISPatien.getPatSex()));
|
|
|
+ patientInfo.setSex(hISPatien.getPatSex());
|
|
|
if (hISPatien.getPatBirthday() != null) {
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ SimpleDateFormat sdf=new SimpleDateFormat("yyyy-mm-dd");//小写的mm表示的是分钟
|
|
|
patientInfo.setBirthday(sdf.parse(hISPatien.getPatBirthday()));
|
|
|
}
|
|
|
- //patientInfo.setIdType("");
|
|
|
+ patientInfo.setHisCode(patient.getHisCode());
|
|
|
+ if((hISPatien.getNatureId()).equals("3")){
|
|
|
+ patientInfo.setNatureId("2");
|
|
|
+ }else{
|
|
|
+ patientInfo.setNatureId(hISPatien.getNatureId());
|
|
|
+ }
|
|
|
patientInfo.setIdNo(hISPatien.getPatIdentityNum());
|
|
|
patientInfo.setAddress(hISPatien.getPatFamAddress());
|
|
|
- patientInfo.setPhone(hISPatien.getPatPhone());
|
|
|
- patientInfo.setIdentityNum(hISPatien.getPatIdentityNum());
|
|
|
patientInfo.setPostcode(hISPatien.getPatPostcode());
|
|
|
- patientInfo.setContacts(hISPatien.getPatContacts());
|
|
|
patientInfo.setContactPhone(hISPatien.getPatContactPhone());
|
|
|
+ patientInfo.setContacts(hISPatien.getPatContacts());
|
|
|
+ patientInfo.setPhone(hISPatien.getPatPhone());
|
|
|
patientInfo.setWorkUnit(hISPatien.getPatWorkUnit());
|
|
|
patientInfo.setOperation(hISPatien.getPatOperation());
|
|
|
patientInfo.setCountry(hISPatien.getPatCountry());
|
|
|
patientInfo.setNationality(hISPatien.getPatNationality());
|
|
|
- //patientInfo.setMatrimony(0);//婚姻状况:0未婚,1已婚,2未知
|
|
|
- //patientInfo.setRemark("");
|
|
|
+ patientInfo.setMatrimony(hISPatien.getPatMatrimony());
|
|
|
+ patientInfo.setHisPrevious(hISPatien.getPatHisPrevious());
|
|
|
+ patientInfo.setHisAllergic(hISPatien.getPatHisAllergic());
|
|
|
+ patientInfo.setHisFamily(hISPatien.getPatHisFamily());
|
|
|
+ patientInfo.setRecordDate(hISPatien.getPatRecordDate());
|
|
|
+ patientInfo.setMemGrade(hISPatien.getPatMemGrade());
|
|
|
+ patientInfo.setCardNum(hISPatien.getPatCardNum());
|
|
|
+ patientInfo.setFeeId(hISPatien.getFeeId());
|
|
|
+
|
|
|
return patientInfo;
|
|
|
}
|
|
|
return null;
|