Index: ssts-web/src/main/webapp/disinfectsystem/config/gyey/spring/applicationContext-his-gyey.xml =================================================================== diff -u -r36709 -r37104 --- ssts-web/src/main/webapp/disinfectsystem/config/gyey/spring/applicationContext-his-gyey.xml (.../applicationContext-his-gyey.xml) (revision 36709) +++ ssts-web/src/main/webapp/disinfectsystem/config/gyey/spring/applicationContext-his-gyey.xml (.../applicationContext-his-gyey.xml) (revision 37104) @@ -107,7 +107,7 @@ - + Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gyey/FindPatientInfoByTreatmentNumDaoImpl.java =================================================================== diff -u -r34411 -r37104 --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gyey/FindPatientInfoByTreatmentNumDaoImpl.java (.../FindPatientInfoByTreatmentNumDaoImpl.java) (revision 34411) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gyey/FindPatientInfoByTreatmentNumDaoImpl.java (.../FindPatientInfoByTreatmentNumDaoImpl.java) (revision 37104) @@ -20,12 +20,14 @@ String inputXml = WebServiceClientHelper.buildInputString(DatasyncConstant.UserTypeMZ, treatmentNum); logger.info("门诊号信息查询服务接口地址:" + DatasyncConstant.PatientInfoQueryWebserviceAddress); logger.info("门诊号查询接口请求信息:" + inputXml); - String result; - result = WebServiceClientHelper.doPostSoap1_2(DatasyncConstant.PatientInfoQueryWebserviceAddress, inputXml); - //result = "0成功戴*芬Y311991-12-08 00:00:00.000 360733********41211867*****208800789520自费江西省赣州市*****元110118679*****8监护人455344213广州医科大学附属第二医院14****4043103疼痛科(门)003052万丽"; + String result = WebServiceClientHelper.doPostSoap1_2(DatasyncConstant.PatientInfoQueryWebserviceAddress, inputXml); + /*String result = "0成功" + + "戴*芬Y311991-12-08 00:00:00.000 360733********41211867*****208800789520自费江西省赣州市*****元110118679*****8监护人455344213广州医科大学附属第二医院14****4043103疼痛科(门)003052万丽" + + "戴*芬Y311991-12-08 00:00:00.000 360733********41211867*****208800789520自费江西省赣州市*****元110118679*****8监护人455344213广州医科大学附属第二医院14****4043103疼痛科(门)003052万丽" + + "";*/ logger.info("门诊号查询接口返回信息:" + result); //解析xml获取患者手术单信息 - PatientInfoVO[] patientInfoVOs = WebServiceClientHelper.getPatientInfoByXML(result); + PatientInfoVO[] patientInfoVOs = WebServiceClientHelper.getPatientInfoByXML(DatasyncConstant.UserTypeMZ, result); return patientInfoVOs; } catch (Exception e) { logger.error("查询失败" + e); Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gyey/WebServiceClientHelper.java =================================================================== diff -u -r34433 -r37104 --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gyey/WebServiceClientHelper.java (.../WebServiceClientHelper.java) (revision 34433) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/gyey/WebServiceClientHelper.java (.../WebServiceClientHelper.java) (revision 37104) @@ -1,10 +1,13 @@ package com.forgon.disinfectsystem.datasynchronization.dao.gyey; import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; @@ -68,7 +71,7 @@ * @param responce * @return */ - public static PatientInfoVO[] getPatientInfoByXML(String responce) { + public static PatientInfoVO[] getPatientInfoByXML(String useType, String responce) { if(StringUtils.isBlank(responce)){ return null; } @@ -81,38 +84,63 @@ responce = responce.substring(beginIndex, endIndex + "".length()); PatientInfoVO[] patientInfoVOArray = null; + List patientInfoVOList = new ArrayList(); JSONObject documentElementJsonObject = (JSONObject)CssdUtils.xml2JsonCommon(responce); if(documentElementJsonObject != null){ String code = documentElementJsonObject.optString("resultCode"); if(DatasyncConstant.ResultCodeSuccess.equals(code)){ Object patientInfoObj = documentElementJsonObject.opt("userList"); - JSONObject patientInfo = null; + JSONArray patientInfoArray = new JSONArray(); //body下节点可能会有多个userList节点,所以需要判断 if(patientInfoObj instanceof JSONObject){ - patientInfo = (JSONObject)patientInfoObj; + JSONObject patientInfo = (JSONObject)patientInfoObj; + patientInfoArray.add(patientInfo); }else if(patientInfoObj instanceof JSONArray){ - patientInfo = ((JSONArray)patientInfoObj).optJSONObject(0); + patientInfoArray = ((JSONArray)patientInfoObj); } - if(patientInfo == null){ + if(patientInfoArray == null || patientInfoArray.size() == 0){ return null; } - String tNumber = patientInfo.optString("hospitalNumber"); - String patientName = patientInfo.optString("name"); - String patientAge = patientInfo.optString("age"); - String patientSex = patientInfo.optString("sex"); - String patientIDCard = patientInfo.optString("idNumber"); - String doctorName = patientInfo.optString("F_YSXM"); - - PatientInfoVO vo = new PatientInfoVO(); - vo.setPatientNumber(tNumber); - vo.setHospitalNumber(vo.getPatientNumber()); - vo.setPatientName(patientName); - vo.setPatientAge(patientAge == null ? "" : patientAge.replace("Y", "").replace("y", "")); - vo.setPatientSex(patientSex); - vo.setPatientIDCard(patientIDCard); - vo.setDoctorName(doctorName); - - patientInfoVOArray = new PatientInfoVO[] { vo }; + for (int i=0;i 0成功戴*芬Y311991-12-08 00:00:00.000 360733********41211867*****208800789520自费江西省赣州市*****元110118679*****8监护人455344213广州医科大学附属第二医院14****4043103疼痛科(门)003052万丽"; + String result = WebServiceClientHelper.doPostSoap1_2(DatasyncConstant.PatientInfoQueryWebserviceAddress, inputXml); + /*String result = "0成功" + + "戴*芬Y311991-12-08 00:00:00.000 360733********41211867*****208800789520自费江西省赣州市*****元110118679*****8监护人455344213广州医科大学附属第二医院14****4043103疼痛科(门)003052万丽" + + "戴*芬Y311991-12-08 00:00:00.000 360733********41211867*****208800789520自费江西省赣州市*****元110118679*****8监护人455344213广州医科大学附属第二医院14****4043103疼痛科(门)003052万丽" + + "";*/ logger.info("住院号查询接口返回信息:" + result); //解析xml获取患者手术单信息 - PatientInfoVO[] patientInfoVOs = WebServiceClientHelper.getPatientInfoByXML(result); + PatientInfoVO[] patientInfoVOs = WebServiceClientHelper.getPatientInfoByXML(DatasyncConstant.UserTypeZY, result); return patientInfoVOs; } catch (Exception e) { logger.error("查询失败" + e); Index: ssts-web/src/main/webapp/disinfectsystem/config/gyey/interfaces/mybatis/FindPatientInfoByHospitalNumMapper.xml =================================================================== diff -u -r27973 -r37104 --- ssts-web/src/main/webapp/disinfectsystem/config/gyey/interfaces/mybatis/FindPatientInfoByHospitalNumMapper.xml (.../FindPatientInfoByHospitalNumMapper.xml) (revision 27973) +++ ssts-web/src/main/webapp/disinfectsystem/config/gyey/interfaces/mybatis/FindPatientInfoByHospitalNumMapper.xml (.../FindPatientInfoByHospitalNumMapper.xml) (revision 37104) @@ -8,12 +8,17 @@