Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/FindPatientInfoByHospitalNumDaoImpl.java
===================================================================
diff -u
--- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/FindPatientInfoByHospitalNumDaoImpl.java (revision 0)
+++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/FindPatientInfoByHospitalNumDaoImpl.java (revision 31511)
@@ -0,0 +1,141 @@
+package com.forgon.disinfectsystem.datasynchronization.dao.gzthzlyy;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.Date;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+
+import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByHospitalNumDao;
+import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO;
+import com.forgon.tools.date.DateTools;
+
+/**
+ * 广州泰和肿瘤医院根据住院号查询病人信息GZTHZL-8
+ * @author ZhouPeiMian
+ * @since 2021-06-17
+ */
+public class FindPatientInfoByHospitalNumDaoImpl implements
+ FindPatientInfoByHospitalNumDao {
+
+ Logger logger = Logger.getLogger(FindPatientInfoByHospitalNumDaoImpl.class);
+
+ @Override
+ public PatientInfoVO[] findPatientInfoByHospitalNum(String hospitalNum) {
+ try {
+ logger.info("住院病人信息同步接口地址:" + DatasyncConstant.WebserviceAddress);
+ String message = "" + hospitalNum + "
";
+ logger.info("住院病人信息同步接口请求信息message:" + message);
+ String result = WebServiceClientHelper.axisInvokeWebservice(DatasyncConstant.WebserviceAddress, DatasyncConstant.DHCC_ActionName_HospitalNumber, message);
+ //String result = "10000111放疗131岁女内镜中心2021-04-0800:00:00放疗科放疗科病区普通1床]]>";
+ 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 hospitalNumberXpath = "/PAPatInfo/hospitalNumber";
+ String serialNumberXpath = "/PAPatInfo/serialNumber";
+ String patientNameXpath = "/PAPatInfo/patientName";
+ String patientAgeXpath = "/PAPatInfo/patientAge";
+ String patientSexXpath = "/PAPatInfo/patientSex";
+ String patientIDCardXpath = "/PAPatInfo/patientIDCard";
+ String doctorNameXpath = "/PAPatInfo/doctorName";
+ String operationXpath = "/PAPatInfo/operation";
+ String operationTimeXpath = "/PAPatInfo/operationTime";
+ String patientAreaXpath = "/PAPatInfo/patientArea";
+ String roomNumberXpath = "/PAPatInfo/roomNumber";
+ String bedNumberXpath = "/PAPatInfo/bedNumber";
+ String washHandNurseXpath = "/PAPatInfo/washHandNurse";
+ String circuitNurseXpath = "/PAPatInfo/circuitNurse";
+ String opRoomIdXpath = "/PAPatInfo/opRoomId";
+ String remarkXpath = "/PAPatInfo/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 washHandNurse = WebServiceClientHelper.processDataByXpath(document, washHandNurseXpath);
+ // 巡回护士
+ String circuitNurse = WebServiceClientHelper.processDataByXpath(document, circuitNurseXpath);
+ // 手术间
+ String opRoomId = WebServiceClientHelper.processDataByXpath(document, opRoomIdXpath);
+ // 备注
+ 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);
+ Date operationTimeDate = DateTools.coverStrToDate(operationTime, "yyyy-MM-ddHH:mm:ss");
+ operationTime = DateTools.getFormatDateStr(operationTimeDate, DateTools.COMMON_DATE_HMS);
+ patientInfoVO.setOperationTime(operationTime);
+ patientInfoVO.setPatientArea(patientArea);
+ patientInfoVO.setRoomNumber(roomNumber);
+ patientInfoVO.setBedNumber(bedNumber);
+ patientInfoVO.setRemark(remark);
+ patientInfoVO.setWashHandNurse(washHandNurse);
+ patientInfoVO.setCircuitNurse(circuitNurse);
+ patientInfoVO.setOpRoomId(opRoomId);
+
+ PatientInfoVO[] patientInfoArray = {patientInfoVO};
+ logger.info("完成解析住院病人信息,姓名为:" + patientInfoVO.getPatientName());
+ return patientInfoArray;
+
+ } catch (Exception e) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ String exception = baos.toString();
+ logger.error("根据病人住院号查询病人信息失败" + exception);
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public PatientInfoVO[] findPatientInfoByHospitalNumBeforeOperation(String hospitalNum) {
+ return findPatientInfoByHospitalNum(hospitalNum);
+ }
+
+}
Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/DatasyncConstant.java
===================================================================
diff -u
--- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/DatasyncConstant.java (revision 0)
+++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/DatasyncConstant.java (revision 31511)
@@ -0,0 +1,35 @@
+package com.forgon.disinfectsystem.datasynchronization.dao.gzthzlyy;
+
+/**
+ * 广州泰和肿瘤医院相关常量GZTHZL-8
+ * @author ZhouPeiMian
+ * @since 2021-06-17
+ */
+public class DatasyncConstant {
+
+ /**
+ * 接口地址
+ */
+ public final static String WebserviceAddress = "http://10.17.0.5/csp/hsb/DHC.Published.PUB0015.BS.PUB0015.cls";
+
+ /**
+ * 按诊疗号查询病人信息的接口方法名(作为输入参数)
+ */
+ public static String DHCC_ActionName_ClinicNumber = "MES0117";
+
+ /**
+ * 按住院号查询病人信息的接口方法名(作为输入参数)
+ */
+ public static String DHCC_ActionName_HospitalNumber = "MES0118";
+
+ /**
+ * 科室信息的接口方法名(作为输入参数)
+ */
+ public static String DHCC_ActionName_OrgUnit = "MES0123";
+
+ /**
+ * 人员信息的接口方法名(作为输入参数)
+ */
+ public static String DHCC_ActionName_User = "MES0124";
+
+}
Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/SyncOrgUnitAndUserDaoImpl.java
===================================================================
diff -u
--- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/SyncOrgUnitAndUserDaoImpl.java (revision 0)
+++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/SyncOrgUnitAndUserDaoImpl.java (revision 31511)
@@ -0,0 +1,274 @@
+package com.forgon.disinfectsystem.datasynchronization.dao.gzthzlyy;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import net.sf.json.JSONObject;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang.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.SyncOrgUnitAndUserDao;
+import com.forgon.disinfectsystem.datasynchronization.model.OrgUnitVo;
+import com.forgon.disinfectsystem.datasynchronization.model.UserVo;
+
+/**
+ * 广州泰和肿瘤医院查询his系统科室与人员信息GZTHZL-8
+ * @author ZhouPeiMian
+ * @since 2021-06-17
+ */
+public class SyncOrgUnitAndUserDaoImpl implements SyncOrgUnitAndUserDao {
+
+ Logger logger = Logger.getLogger(SyncOrgUnitAndUserDaoImpl.class);
+
+ /**
+ * 查询his系统人员信息
+ */
+ @Override
+ public UserVo[] getAllUser() {
+ UserVo[] userVoArray = null;
+ List userVoList = new ArrayList();
+ List tempUserVoList = new ArrayList();
+ try{
+
+ int page = 1;
+ do{
+ tempUserVoList = searchUserVo(page);
+ if(CollectionUtils.isEmpty(tempUserVoList) || page == Integer.MAX_VALUE){
+ break;
+ }
+ userVoList.addAll(tempUserVoList);
+ page++;
+ }while(true);
+ logger.info("通过接口查询到" + page + "页人员信息,人员总数:" + userVoList.size());
+ if(CollectionUtils.isNotEmpty(userVoList)){
+ List codingList = new ArrayList();
+ List delRepeatVoList = new ArrayList();
+ for (UserVo userVo : userVoList) {
+ String coding = userVo.getCoding();
+ if(codingList.contains(coding)){
+ continue;
+ }
+ codingList.add(coding);
+ delRepeatVoList.add(userVo);
+ }
+ userVoArray = new UserVo[delRepeatVoList.size()];
+ delRepeatVoList.toArray(userVoArray);
+ logger.info("实际同步人员总数(根据人员编码CTCP_Code去重):" + delRepeatVoList.size());
+ }else{
+ throw new RuntimeException("未找到人员数据...");
+ }
+ }catch(Exception e){
+ logger.error("查询his人员信息失败:" + e);
+ }
+
+ return userVoArray;
+ }
+
+ /**
+ * 根据页码查询用户信息
+ * @param page
+ * @return
+ * @throws Exception
+ */
+ private List searchUserVo(int page) throws Exception {
+ List userVoList = new ArrayList();
+
+ String message = page + "";
+ logger.info("用户信息接口请求信息:" + message);
+ String result = WebServiceClientHelper.axisInvokeWebservice(DatasyncConstant.WebserviceAddress, DatasyncConstant.DHCC_ActionName_User, message);
+ //String result = "0000212502泰和肿瘤测试用户212CT_CareProv1无DHSZHYYZY";
+
+ 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 = "/CT_CareProvList/CT_CareProv"; // 返回结果可能存在多条住院病人信息
+ XPath xpath = document.createXPath(itemXpath);
+ @SuppressWarnings("unchecked")
+ List nodeList = xpath.selectNodes(document, xpath);
+ if(CollectionUtils.isNotEmpty(nodeList)){
+ for(int i=1;i<=nodeList.size();i++){
+ String msgXpath = "/CT_CareProvList/CT_CareProv[" + i + "]";
+ // 用户编码
+ String codingXpath = msgXpath + "/CTCP_Code";
+ // 用户名称
+ String nameXpath = msgXpath + "/CTCP_Desc";
+ // 用户所属科室编码
+ String orgUnitCodingXpath = msgXpath + "/CTCP_DeptCode";
+
+ String coding = WebServiceClientHelper.processDataByXpath(document, codingXpath);
+ String name = WebServiceClientHelper.processDataByXpath(document, nameXpath);
+ String orgUnitCoding = WebServiceClientHelper.processDataByXpath(document, orgUnitCodingXpath);
+ UserVo userVo = new UserVo();
+ userVo.setCoding(coding);
+ userVo.setName(name);
+ userVo.setOrgUnitCoding(orgUnitCoding);
+
+ //如果人员工号或名称为空,则忽略该条数据
+ if(StringUtils.isBlank(userVo.getName()) || StringUtils.isBlank(userVo.getCoding())){
+ logger.info("人员工号或名称为空!");
+ continue;
+ }
+ userVoList.add(userVo);
+ }
+ }
+ logger.info("第" + page + "页一共同步到" + userVoList.size() + "个用户!");
+ return userVoList;
+ }
+
+
+ /**
+ * 查询his系统科室信息
+ */
+ @Override
+ public OrgUnitVo[] getAllOrgUnit() {
+ OrgUnitVo[] orgUnitVoArray = null;
+ List orgUnitVoList = new ArrayList();
+ List tempOrgUnitVoList = new ArrayList();
+ try{
+ int page = 1;
+ do{
+ tempOrgUnitVoList = searchOrgUnitVo(page);
+ if(CollectionUtils.isEmpty(tempOrgUnitVoList) || page == Integer.MAX_VALUE){
+ break;
+ }
+ orgUnitVoList.addAll(tempOrgUnitVoList);
+ page++;
+ }while(true);
+ logger.info("通过接口查询到" + page + "页科室信息,科室总数:" + orgUnitVoList.size());
+ if(CollectionUtils.isNotEmpty(orgUnitVoList)){
+ List codingList = new ArrayList();
+ List delRepeatVoList = new ArrayList();
+ for (OrgUnitVo orgUnitVo : orgUnitVoList) {
+ String coding = orgUnitVo.getCoding();
+ if(codingList.contains(coding)){
+ continue;
+ }
+ codingList.add(coding);
+ delRepeatVoList.add(orgUnitVo);
+ }
+ orgUnitVoArray = new OrgUnitVo[delRepeatVoList.size()];
+ delRepeatVoList.toArray(orgUnitVoArray);
+ logger.info("实际同步科室总数(根据科室编码CTD_Code去重):" + delRepeatVoList.size());
+ }else{
+ throw new RuntimeException("未找到科室数据...");
+ }
+ }catch(Exception e){
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ String exception = baos.toString();
+ logger.error("获取科室信息失败" + exception);
+ e.printStackTrace();
+ }
+ return orgUnitVoArray;
+ }
+
+ /**
+ * 根据页码查询科室信息
+ * @param page
+ * @return
+ * @throws Exception
+ */
+ private List searchOrgUnitVo(int page) throws Exception {
+ List orgUnitVoList = new ArrayList();
+
+ String message = page + "";
+ logger.info("科室信息接口请求信息:" + message);
+ String result = WebServiceClientHelper.axisInvokeWebservice(DatasyncConstant.WebserviceAddress, DatasyncConstant.DHCC_ActionName_OrgUnit, message);
+
+ //String result = "00002212泰和肿瘤测试科室CT_Dept1无DHSZHYYZY";
+ 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 = "/CT_DeptList/CT_Dept"; // 返回结果可能存在多条住院病人信息
+ XPath xpath = document.createXPath(itemXpath);
+ @SuppressWarnings("unchecked")
+ List nodeList = xpath.selectNodes(document, xpath);
+ if(CollectionUtils.isNotEmpty(nodeList)){
+ for(int i=1;i<=nodeList.size();i++){
+ String msgXpath = "/CT_DeptList/CT_Dept[" + i + "]";
+ // 科室编码
+ String codingXpath = msgXpath + "/CTD_Code";
+ // 科室名称
+ String nameXpath = msgXpath + "/CTD_Desc";
+ // 科室上级科室编码
+ String orgUnitCodingXpath = msgXpath + "/CTD_ParentDeptCode";
+
+ String coding = WebServiceClientHelper.processDataByXpath(document, codingXpath);
+ String name = WebServiceClientHelper.processDataByXpath(document, nameXpath);
+ String orgUnitCoding = WebServiceClientHelper.processDataByXpath(document, orgUnitCodingXpath);
+ OrgUnitVo orgVo = new OrgUnitVo();
+ orgVo.setCoding(coding );
+ orgVo.setName(name);
+ orgVo.setParentCoding(orgUnitCoding);
+
+ //科室编码与上级科室编码相同时,默认其上级科室编码为空
+ if(StringUtils.equals(orgVo.getCoding(), orgVo.getParentCoding())){
+ orgVo.setParentCoding(null);
+ }
+ //如果科室编码或名称为空,则忽略该条数据
+ if(StringUtils.isBlank(orgVo.getCoding()) || StringUtils.isBlank(orgVo.getName())){
+ continue;
+ }
+ orgUnitVoList.add(orgVo);
+ }
+ }
+ logger.info("第" + page + "页一共同步到" + orgUnitVoList.size() + "个科室!");
+ return orgUnitVoList;
+ }
+
+ @Override
+ public OrgUnitVo[] paramToOrgUnitVos(String param) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public UserVo[] paramToUserVos(String param) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public JSONObject buttjoinResponse(Boolean success, String message,
+ String param) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/FindPatientInfoByTreatmentNumDaoImpl.java
===================================================================
diff -u
--- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 0)
+++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 31511)
@@ -0,0 +1,123 @@
+package com.forgon.disinfectsystem.datasynchronization.dao.gzthzlyy;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+
+import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByTreatmentNumDao;
+import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO;
+
+/**
+ * 广州泰和肿瘤医院根据门诊号查询病人信息GZTHZL-8
+ * @author ZhouPeiMian
+ * @since 2021-06-17
+ */
+public class FindPatientInfoByTreatmentNumDaoImpl implements
+ FindPatientInfoByTreatmentNumDao {
+
+ Logger logger = Logger.getLogger(FindPatientInfoByTreatmentNumDaoImpl.class);
+
+ @Override
+ public PatientInfoVO[] findPatientInfoByTreatmentNum(String clinicNumber) {
+ try {
+ logger.info("门诊病人信息同步接口地址:" + DatasyncConstant.WebserviceAddress);
+ String message = "" + clinicNumber + "
";
+ logger.info("门诊病人信息同步接口请求信息:" + message);
+ String result = WebServiceClientHelper.axisInvokeWebservice(DatasyncConstant.WebserviceAddress, DatasyncConstant.DHCC_ActionName_ClinicNumber, message);
+ //String result = "OP0000000903OP0000000903测试0022女护照张镇宇";
+ 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 clinicNumberXpath = "/PAPatInfo/clinicNumber";
+ String serialNumberXpath = "/PAPatInfo/serialNumber";
+ String patientNameXpath = "/PAPatInfo/patientName";
+ String patientAgeXpath = "/PAPatInfo/patientAge";
+ String patientSexXpath = "/PAPatInfo/patientSex";
+ String patientIDCardXpath = "/PAPatInfo/patientIDCard";
+ String doctorNameXpath = "/PAPatInfo/doctorName";
+ String operationXpath = "/PAPatInfo/operation";
+ String operationTimeXpath = "/PAPatInfo/operationTime";
+ String patientAreaXpath = "/PAPatInfo/patientArea";
+ String roomNumberXpath = "/PAPatInfo/roomNumber";
+ String bedNumberXpath = "/PAPatInfo/bedNumber";
+ String remarkXpath = "/PAPatInfo/remark";
+
+ // 住院号
+ clinicNumber = 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(clinicNumber);
+ 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);
+
+ PatientInfoVO[] patientInfoArray = {patientInfoVO};
+ logger.info("完成门诊病人信息解析,病人姓名为:" + patientInfoVO.getPatientName());
+ return patientInfoArray;
+
+ } catch (Exception e) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ String exception = baos.toString();
+ logger.error("根据病人门诊号查询病人信息失败" + exception);
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+}
Index: ssts-web/src/main/webapp/disinfectsystem/config/gzthzlyy/spring/HIS.xml
===================================================================
diff -u -r31410 -r31511
--- ssts-web/src/main/webapp/disinfectsystem/config/gzthzlyy/spring/HIS.xml (.../HIS.xml) (revision 31410)
+++ ssts-web/src/main/webapp/disinfectsystem/config/gzthzlyy/spring/HIS.xml (.../HIS.xml) (revision 31511)
@@ -48,7 +48,7 @@
-->
-
+
+
+
+
+
+
+
+
+
Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/WebServiceClientHelper.java
===================================================================
diff -u
--- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/WebServiceClientHelper.java (revision 0)
+++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gzthzlyy/WebServiceClientHelper.java (revision 31511)
@@ -0,0 +1,89 @@
+package com.forgon.disinfectsystem.datasynchronization.dao.gzthzlyy;
+
+import javax.xml.namespace.QName;
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.Node;
+import org.dom4j.XPath;
+
+/**
+ * 广州泰和肿瘤医院接口帮助类GZTHZL-8
+ * @author ZhouPeiMian
+ * @since 2021-06-17
+ */
+public class WebServiceClientHelper {
+
+ public static Logger logger = Logger.getLogger(WebServiceClientHelper.class);
+
+ /**
+ * axis调用webservice
+ * @param endpoint //WSDL的地址
+ * @param action
+ * @param message
+ * @return
+ * @throws Exception
+ */
+ public static String axisInvokeWebservice(String endpoint, String action, String message) throws Exception {
+ //字符集
+ String encodingStyle = "utf-8";
+ //命名空间,在WSDL中对应的标签是:targetNamespace
+ String targetNamespace = "http://www.dhcc.com.cn";
+ //具体方法的调用URI,在WSDL中对应的标签是:
+ String soapActionURI = "http://www.dhcc.com.cn/DHC.Published.PUB0015.BS.PUB0015.HIPManagerServer";
+ //具体调用的方法名,在WSDL中对应的标签是:
+ String method = "HIPManagerServer";
+
+ //调用接口的参数的名字
+ String[] paramNames = {"action","message"};
+ //调用接口的参数的值
+ String param1 = action;
+
+ String param2 = message;
+
+ logger.info("action : " + param1);
+ logger.info("message : " + param2);
+
+ Service service = new Service();
+ Call call = (Call) service.createCall();
+ //call.setTimeout(new Integer(20000)); //设置超时时间
+ call.setSOAPActionURI(soapActionURI);
+ call.setTargetEndpointAddress(new java.net.URL(endpoint)); //设置目标接口的地址
+ call.setEncodingStyle(encodingStyle);//设置传入服务端的字符集格式如utf-8等
+ call.setOperationName(new QName(targetNamespace, method));// 具体调用的方法名,可以由接口提供方告诉你,也可以自己从WSDL中找
+ call.setUseSOAPAction(true);
+ call.addParameter(paramNames[0],
+ org.apache.axis.encoding.XMLType.XSD_STRING,
+ javax.xml.rpc.ParameterMode.IN);// 接口的参数
+ call.addParameter(paramNames[1],
+ org.apache.axis.encoding.XMLType.XSD_STRING,
+ javax.xml.rpc.ParameterMode.IN);// 接口的参数
+ call.setReturnClass(java.lang.String.class); //返回字符串类型
+ // 给方法传递参数,并且调用方法 ,如果无参,则new Obe
+ String result = (String)call.invoke(new String[] {param1, param2});
+ // 打印返回值
+ logger.info("result is " + result);
+ return result;
+ }
+
+ /**
+ * 根据document和Xpath表达式解析数据
+ * @param document
+ * @param nameSpaceURIMap
+ * @param xpathExp
+ * @return
+ */
+ public static String processDataByXpath(Document document, String xpathExp) {
+ if ((StringUtils.isNotBlank(xpathExp)) && (document != null)) {
+ XPath xpath = document.createXPath(xpathExp);
+ Node node = xpath.selectSingleNode(document);
+ if (node != null) {
+ return node.getStringValue();
+ }
+ }
+ return null;
+ }
+
+}