|
@@ -2,6 +2,17 @@ package com.diagbot.web;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
+import com.diagbot.dto.HisInquirysForDjDTO;
|
|
|
+import com.diagbot.facade.HospitalInfoFacade;
|
|
|
+import com.diagbot.facade.TranDiseaseIcdFacade;
|
|
|
+import com.diagbot.vo.*;
|
|
|
+import com.diagbot.yujian.model.InterfaceResponse;
|
|
|
+import com.diagbot.yujian.model.ReqBody;
|
|
|
+import com.diagbot.yujian.model.ReqHead;
|
|
|
+import com.diagbot.yujian.model.inquiryInfo.request.InquiryInfoRequest;
|
|
|
+import com.diagbot.yujian.model.inquiryInfo.response.InquiryResponseBody;
|
|
|
+import com.diagbot.yujian.util.JaxbUtil;
|
|
|
+import com.diagbot.yujian.webservicetest.WebServicesPortTypeProxy;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -11,10 +22,14 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.diagbot.annotation.SysLogger;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.facade.InquiryInfoFacade;
|
|
|
-import com.diagbot.vo.SaveInquiryToHisVO;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
|
+import java.rmi.RemoteException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 对接问诊信息控制器
|
|
@@ -31,16 +46,134 @@ public class InquiryInfoController {
|
|
|
|
|
|
@Autowired
|
|
|
private InquiryInfoFacade inquiryInfoFacade;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private HospitalInfoFacade hospitalInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private TranDiseaseIcdFacade diseaseIcdFacade;
|
|
|
@PostMapping("/saveInquiryToHis")
|
|
|
@SysLogger("saveInquiryToHis")
|
|
|
- public RespDTO<Boolean> saveInquiryToHis(@Valid @RequestBody SaveInquiryToHisVO saveInquiryToHisVO) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return RespDTO.onSuc(true);
|
|
|
+ public RespDTO<Boolean> saveInquiryToHis(@Valid @RequestBody SaveInquiryToHisVO saveInquiryToHisVO) throws RemoteException {
|
|
|
+ ReqHead head = new ReqHead();
|
|
|
+ head.setTranKey("ICSS_POST_DIS_EMR_LIS_PACS");
|
|
|
+ head.setTranType("ICSS_POST_DIS_EMR_LIS_PACS");
|
|
|
+ head.setStffNo(saveInquiryToHisVO.getDoctorId().toString());
|
|
|
+ head.setHospitalId(saveInquiryToHisVO.getHospitalId().toString());
|
|
|
+ head.setDepartId(saveInquiryToHisVO.getHospitalDeptId().toString());
|
|
|
+
|
|
|
+ InquiryInfoRequest request = new InquiryInfoRequest();
|
|
|
+ //数据格式转换
|
|
|
+ dataFormat(saveInquiryToHisVO, request);
|
|
|
+
|
|
|
+ ReqBody<InquiryInfoRequest> body = new ReqBody<InquiryInfoRequest>();
|
|
|
+ body.setHead(head);
|
|
|
+ body.setBody(request);
|
|
|
+
|
|
|
+ String reqXml = JaxbUtil.convertToXml(body);
|
|
|
+ System.out.println("请求Xml : " + reqXml);
|
|
|
+ WebServicesPortTypeProxy proxy = new WebServicesPortTypeProxy("http://118.31.73.190:8081/APP_Webservicesfuzl/service/WebServices");
|
|
|
+ String resXml = proxy.ICSS_POST_DIS_EMR_LIS_PACS(reqXml);
|
|
|
+ System.out.println("返回 Xml : " + resXml);
|
|
|
+
|
|
|
+ /*try {
|
|
|
+ //接口调用信息记录
|
|
|
+ HttpApi<InterfaceResponse> api = new HttpApi<InterfaceResponse>();
|
|
|
+ InterfaceInfoWrapper interfaces = new InterfaceInfoWrapper();
|
|
|
+ interfaces.setHospitalId(saveInquiryToHisVO.getHospitalId().toString());
|
|
|
+ interfaces.setDoctorNo(saveInquiryToHisVO.getDoctorId().toString());
|
|
|
+ interfaces.setDeptId(saveInquiryToHisVO.getHospitalDeptId().toString());
|
|
|
+ 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://127.0.0.1:8082/note-web/interfaces/record", interfaces, InterfaceResponse.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }*/
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加webservice访问寓健接口
|
|
|
+ */
|
|
|
+ InquiryResponseBody resBody = (InquiryResponseBody) JaxbUtil.converyToJavaBean(resXml, InquiryResponseBody.class);
|
|
|
+ String recordId = resBody.getData().getRecordId();
|
|
|
+ if(recordId!=null&&!"".equals(recordId)){
|
|
|
+ return RespDTO.onSuc(true);
|
|
|
+ }else{
|
|
|
+ return RespDTO.onSuc(false);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //数据格式转换
|
|
|
+ private void dataFormat(SaveInquiryToHisVO info, InquiryInfoRequest req) {
|
|
|
+ //1、病人流水号
|
|
|
+ req.setPatientId(info.getPatientId().toString());
|
|
|
+ //寓健需求参数
|
|
|
+ if (info.getFeeType() != null) {
|
|
|
+ req.setFeetype(info.getFeeType());
|
|
|
+ }
|
|
|
+ if (info.getHisCode() != null) {
|
|
|
+ req.setBrjzId(info.getHisCode());
|
|
|
+ }
|
|
|
+ if (info.getClinicNo() != null) {
|
|
|
+ req.setClinicno(info.getClinicNo());
|
|
|
+ }
|
|
|
+ if (info.getClinicTypeId() != null) {
|
|
|
+ req.setClinictypeid(info.getClinicTypeId());
|
|
|
+ }
|
|
|
+ if (info.getUserId() != null) {
|
|
|
+ req.setUserid(info.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ //诊断
|
|
|
+ String diagnose = info.getContentList().get(6);
|
|
|
+ //diagnose格式 上呼吸道感染(初诊);糖尿病(初诊); 分割成["上呼吸道感染(初诊)","糖尿病(初诊)",""]
|
|
|
+ String[] disease = diagnose.split(";");
|
|
|
+ //循环去掉(初诊)
|
|
|
+ for(int i = 0; i < disease.length; i ++){
|
|
|
+ if(disease[i]!=null && !"".equals(disease[i].trim())){
|
|
|
+ disease[i] = disease[i].substring(0, disease[i].indexOf("("));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //通过本地数据库的医院id获取医院编码
|
|
|
+ HospitalInfoVO hospitalInfoVO = new HospitalInfoVO();
|
|
|
+ hospitalInfoVO.setId(info.getHospitalId());
|
|
|
+ String code = hospitalInfoFacade.getHospitalInfo(hospitalInfoVO).get(0).getCode();
|
|
|
+ GetDiseaseIcdVO getDiseaseIcdVO = new GetDiseaseIcdVO();
|
|
|
+ getDiseaseIcdVO.setHospitalCode(code);
|
|
|
+ //诊断返回格式:疾病名称[icd];疾病名称[icd];...
|
|
|
+ StringBuffer icd = null;
|
|
|
+ for(int j = 0;j < disease.length; j ++){
|
|
|
+ if(disease[j]!=null && !"".equals(disease[j].trim())) {
|
|
|
+ getDiseaseIcdVO.setQuestions(disease[j]);
|
|
|
+ icd = new StringBuffer(diseaseIcdFacade.getDiseaseIcds(getDiseaseIcdVO).get(0).getIcd());
|
|
|
+ sb.append(disease[j] + "[" + icd + "]" + ";");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //主诉
|
|
|
+ req.setChiefComplaint(info.getContentList().get(0));
|
|
|
+ //现病史
|
|
|
+ req.setPresentHistory(info.getContentList().get(1));
|
|
|
+ //既往史
|
|
|
+ req.setPastHistory(info.getContentList().get(2));
|
|
|
+ //其他史
|
|
|
+ req.setOtherHistory(info.getContentList().get(2));
|
|
|
+ //查体
|
|
|
+ req.setSigns(info.getContentList().get(3));
|
|
|
+ //化验
|
|
|
+ req.setAssay(info.getContentList().get(4));
|
|
|
+ //辅检
|
|
|
+ req.setSiteAdvisor(info.getContentList().get(5));
|
|
|
+ //诊断
|
|
|
+ req.setDiagnosis(icd.toString());
|
|
|
+ //治疗
|
|
|
+ req.setTreatment(info.getContentList().get(7));
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/hisInquirysForDj")
|
|
|
@SysLogger("hisInquirysForDj")
|
|
|
public RespDTO<Object> hisInquirysForDj() {
|