Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/bjcyzxyyy/DatasyncConstant.java =================================================================== diff -u -r36711 -r36716 --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/bjcyzxyyy/DatasyncConstant.java (.../DatasyncConstant.java) (revision 36711) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/bjcyzxyyy/DatasyncConstant.java (.../DatasyncConstant.java) (revision 36716) @@ -19,5 +19,15 @@ * 获取用户信息的方法名称(入参) */ public final static String OP_USER = "cssd_user"; + + /** + * 获取门诊患者信息的方法名称 + */ + public final static String OP_CLINICNUMBER = "cssd_clinicnumber"; + + /** + * 获取住院患者信息的方法名称 + */ + public final static String OP_HOSPITALNUMBER = "cssd_hospitalnumber"; } Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/bjcyzxyyy/FindPatientInfoByTreatmentNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/bjcyzxyyy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/bjcyzxyyy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 36716) @@ -0,0 +1,155 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.bjcyzxyyy; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.log4j.Logger; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Node; +import org.dom4j.XPath; + +import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByTreatmentNumDao; +import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; + +/** + * 根据诊疗号查询病人信息(北京朝阳中西医结合急诊抢救医院) + */ +public class FindPatientInfoByTreatmentNumDaoImpl implements + FindPatientInfoByTreatmentNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByTreatmentNumDaoImpl.class); + + @Override + public PatientInfoVO[] findPatientInfoByTreatmentNum(String clinicNumber) { + try { + String soapXml = WebServiceClientHelper.buildInputStr(DatasyncConstant.OP_CLINICNUMBER, clinicNumber); + logger.info("门诊病人信息同步接口请求信息:" + soapXml); + String address = DatasyncConstant.WEBSERVICE_ADDRESS + "?op=" + DatasyncConstant.OP_CLINICNUMBER; + String result = WebServiceClientHelper.doPostSoap1_2(address, soapXml); + /*String result = "" + + "" + + "8714532" + + "4830422" + + "黄婷婷" + + "999" + + "" + + "110103198112091565" + + "候晓晓" + + "宫内节育器放置术(上环)" + + "2023-07-11 08:44:49" + + "妇科门诊" + + "妇科门诊" + + "" + + "备注" + + "" + + "";*/ + logger.info("门诊病人信息同步接口返回信息:" + result); + int startIndex = result.indexOf(""); + if(startIndex == -1){ + logger.info("门诊病人接口返回信息没有标签!"); + return null; + } + int endIndex = result.indexOf(""); + if(endIndex == -1 || endIndex < startIndex){ + logger.info("门诊病人接口返回信息没有标签"); + return null; + } + String xmlString = result.substring(startIndex + "".length(), endIndex); + if(StringUtils.isBlank(xmlString)){ + logger.info("门诊病人接口返回信息为空!" + xmlString); + return null; + } + xmlString = "" + xmlString + ""; + Document document = DocumentHelper.parseText(xmlString); + String itemXpath = "/d_cssd_clinicnumber/d_cssd_clinicnumber_row"; // 返回结果可能存在多条门诊病人信息 + XPath xpath = document.createXPath(itemXpath); + @SuppressWarnings("unchecked") + List nodeList = xpath.selectNodes(document, xpath); + if(CollectionUtils.isNotEmpty(nodeList)){ + List patientInfoVOList = new ArrayList(); + for (int i = 1; i <= nodeList.size(); i++) { + String msgXpath = "/d_cssd_clinicnumber/d_cssd_clinicnumber_row[" + i + "]"; + // 住院号 + String clinicNumberXpath = msgXpath + "/clinicnumber"; + // 当前住院流水号 + String serialNumberXpath = msgXpath + "/serialnumber"; + // 病人姓名 + String patientNameXpath = msgXpath + "/patientname"; + // 病人年龄 + String patientAgeXpath = msgXpath + "/patientage"; + // 病人性别 + String patientSexXpath = msgXpath + "/patientsex"; + // 病人身份证号 + String patientIDCardXpath = msgXpath + "/patientidcard"; + // 医生姓名 + String doctorNameXpath = msgXpath + "/doctorname"; + // 手术名称 + String operationXpath = msgXpath + "/operation"; + // 手术时间 + String operationTimeXpath = msgXpath + "/operationtime"; + // 病人所属病区 + String patientAreaXpath = msgXpath + "/patientarea"; + // 病室 + String roomNumberXpath = msgXpath + "/roomnumber"; + // 病人床位号 + String bedNumberXpath = msgXpath + "/bednumber"; + // 备注 + String remarkXpath = msgXpath + "/remark"; + + String clinicNum = WebServiceClientHelper.processDataByXpath(document, clinicNumberXpath); + String serialNumber = WebServiceClientHelper.processDataByXpath(document, serialNumberXpath); + String patientName = WebServiceClientHelper.processDataByXpath(document, patientNameXpath); + String patientAge = WebServiceClientHelper.processDataByXpath(document, patientAgeXpath); + String patientSex = WebServiceClientHelper.processDataByXpath(document, patientSexXpath); + String patientIDCard = WebServiceClientHelper.processDataByXpath(document, patientIDCardXpath); + String doctorName = WebServiceClientHelper.processDataByXpath(document, doctorNameXpath); + String operation = WebServiceClientHelper.processDataByXpath(document, operationXpath); + String operationTime = WebServiceClientHelper.processDataByXpath(document, operationTimeXpath); + String patientArea = WebServiceClientHelper.processDataByXpath(document, patientAreaXpath); + String roomNumber = WebServiceClientHelper.processDataByXpath(document, roomNumberXpath); + String bedNumber = WebServiceClientHelper.processDataByXpath(document, bedNumberXpath); + String remark = WebServiceClientHelper.processDataByXpath(document, remarkXpath); + + PatientInfoVO patientInfoVO = new PatientInfoVO(); + patientInfoVO.setClinicNumber(clinicNum); + patientInfoVO.setSerialNumber(serialNumber); + patientInfoVO.setPatientName(patientName); + patientInfoVO.setPatientAge(patientAge); + patientInfoVO.setPatientSex(patientSex); + patientInfoVO.setPatientIDCard(patientIDCard); + patientInfoVO.setDoctorName(doctorName); + patientInfoVO.setOperation(operation); + patientInfoVO.setOperationTime(operationTime); + patientInfoVO.setPatientArea(patientArea); + patientInfoVO.setRoomNumber(roomNumber); + patientInfoVO.setBedNumber(bedNumber); + patientInfoVO.setRemark(remark); + + patientInfoVOList.add(patientInfoVO); + } + if (CollectionUtils.isNotEmpty(patientInfoVOList)) { + PatientInfoVO patientInfoVO = patientInfoVOList.get(0); + logger.debug("完成门诊病人信息解析,病人门诊号为:" + patientInfoVO.getHospitalNumber()); + PatientInfoVO[] patientInfoArray = new PatientInfoVO[patientInfoVOList.size()]; + for(int i=0;i" + + "" + + "069758" + + "1" + + "任伟利" + + "43" + + "" + + "110103197801070634" + + "刘医生" + + "左臀部、左小腿肢体骨与软组织肿瘤切除术" + + "2021-03-03 08:00:00" + + "骨肿瘤科三区病房" + + "骨肿瘤科三区病房" + + "80" + + "肾功能不全" + + "" + + "" + + "069758" + + "2" + + "任伟利" + + "45" + + "" + + "110103197801070634" + + "郑雪燕" + + "左足清创、坏死趾体截除术" + + "2023-09-05 08:00:00" + + "骨三科病房" + + "骨三科病房" + + "30" + + "肾功能不全" + + "" + + "";*/ + logger.info("病人信息同步接口返回信息:" + result); + int startIndex = result.indexOf(""); + if(startIndex == -1){ + logger.info("住院病人接口返回信息没有标签!"); + return null; + } + int endIndex = result.indexOf(""); + if(endIndex == -1 || endIndex < startIndex){ + logger.info("住院病人接口返回信息没有标签"); + return null; + } + String xmlString = result.substring(startIndex + "".length(), endIndex); + if(StringUtils.isBlank(xmlString)){ + logger.info("住院病人接口返回信息为空!" + xmlString); + return null; + } + xmlString = "" + xmlString + ""; + Document document = DocumentHelper.parseText(xmlString); + String itemXpath = "/d_cssd_hospitalnumber/d_cssd_hospitalnumber_row"; // 返回结果可能存在多条住院病人信息 + XPath xpath = document.createXPath(itemXpath); + @SuppressWarnings("unchecked") + List nodeList = xpath.selectNodes(document, xpath); + if(CollectionUtils.isNotEmpty(nodeList)){ + List patientInfoVOList = new ArrayList(); + for (int i = 1; i <= nodeList.size(); i++) { + String msgXpath = "/d_cssd_hospitalnumber/d_cssd_hospitalnumber_row[" + i + "]"; + // 住院号 + String hospitalNumberXpath = msgXpath + "/hospitalnumber"; + // 当前住院流水号 + String serialNumberXpath = msgXpath + "/searialnumber"; + // 病人姓名 + String patientNameXpath = msgXpath + "/patientname"; + // 病人年龄 + String patientAgeXpath = msgXpath + "/patientage"; + // 病人性别 + String patientSexXpath = msgXpath + "/patientsex"; + // 病人身份证号 + String patientIDCardXpath = msgXpath + "/patientidcard"; + // 医生姓名 + String doctorNameXpath = msgXpath + "/doctorname"; + // 手术名称 + String operationXpath = msgXpath + "/operation"; + // 手术时间 + String operationTimeXpath = msgXpath + "/operationtime"; + // 病人所属病区 + String patientAreaXpath = msgXpath + "/patientarea"; + // 病室 + String roomNumberXpath = msgXpath + "/roomnumber"; + // 病人床位号 + String bedNumberXpath = msgXpath + "/bednumber"; + // 备注 + String remarkXpath = msgXpath + "/remark"; + + String hospitalNumber = WebServiceClientHelper.processDataByXpath(document, hospitalNumberXpath); + String serialNumber = WebServiceClientHelper.processDataByXpath(document, serialNumberXpath); + String patientName = WebServiceClientHelper.processDataByXpath(document, patientNameXpath); + String patientAge = WebServiceClientHelper.processDataByXpath(document, patientAgeXpath); + String patientSex = WebServiceClientHelper.processDataByXpath(document, patientSexXpath); + String patientIDCard = WebServiceClientHelper.processDataByXpath(document, patientIDCardXpath); + String doctorName = WebServiceClientHelper.processDataByXpath(document, doctorNameXpath); + String operation = WebServiceClientHelper.processDataByXpath(document, operationXpath); + String operationTime = WebServiceClientHelper.processDataByXpath(document, operationTimeXpath); + String patientArea = WebServiceClientHelper.processDataByXpath(document, patientAreaXpath); + String roomNumber = WebServiceClientHelper.processDataByXpath(document, roomNumberXpath); + String bedNumber = WebServiceClientHelper.processDataByXpath(document, bedNumberXpath); + String remark = WebServiceClientHelper.processDataByXpath(document, remarkXpath); + + PatientInfoVO patientInfoVO = new PatientInfoVO(); + patientInfoVO.setHospitalNumber(hospitalNumber); + patientInfoVO.setSerialNumber(serialNumber); + patientInfoVO.setPatientName(patientName); + patientInfoVO.setPatientAge(patientAge); + patientInfoVO.setPatientSex(patientSex); + patientInfoVO.setPatientIDCard(patientIDCard); + patientInfoVO.setDoctorName(doctorName); + patientInfoVO.setOperation(operation); + patientInfoVO.setOperationTime(operationTime); + patientInfoVO.setPatientArea(patientArea); + patientInfoVO.setRoomNumber(roomNumber); + patientInfoVO.setBedNumber(bedNumber); + patientInfoVO.setRemark(remark); + + patientInfoVOList.add(patientInfoVO); + } + if (CollectionUtils.isNotEmpty(patientInfoVOList)) { + PatientInfoVO patientInfoVO = patientInfoVOList.get(0); + logger.debug("完成住院病人信息解析,病人住院号为:" + patientInfoVO.getHospitalNumber()); + PatientInfoVO[] patientInfoArray = new PatientInfoVO[patientInfoVOList.size()]; + for(int i=0;i"); }else if(StringUtils.equals(function, DatasyncConstant.OP_USER)){ inputSb.append(""); + }else if(StringUtils.equals(function, DatasyncConstant.OP_CLINICNUMBER)){ + inputSb.append(""); + inputSb.append("" + value + ""); + inputSb.append(""); + }else if(StringUtils.equals(function, DatasyncConstant.OP_HOSPITALNUMBER)){ + inputSb.append(""); + inputSb.append("" + value + ""); + inputSb.append(""); }else{ throw new RuntimeException("参数异常!"); } Index: ssts-web/src/main/webapp/disinfectsystem/config/bjcyzxyyy/spring/HIS.xml =================================================================== diff -u -r36711 -r36716 --- ssts-web/src/main/webapp/disinfectsystem/config/bjcyzxyyy/spring/HIS.xml (.../HIS.xml) (revision 36711) +++ ssts-web/src/main/webapp/disinfectsystem/config/bjcyzxyyy/spring/HIS.xml (.../HIS.xml) (revision 36716) @@ -49,28 +49,10 @@ - - - - - - - - - - + + - - - - - - - - - - + + \ No newline at end of file