Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/operationschedule/zsyy/OperationScheduleWebService.java =================================================================== diff -u -r15334 -r16368 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/operationschedule/zsyy/OperationScheduleWebService.java (.../OperationScheduleWebService.java) (revision 15334) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/operationschedule/zsyy/OperationScheduleWebService.java (.../OperationScheduleWebService.java) (revision 16368) @@ -1,13 +1,29 @@ package com.forgon.disinfectsystem.webservice.operationschedule.zsyy; +import javax.jws.WebParam; import javax.jws.WebService; +import javax.jws.WebParam.Mode; +import javax.jws.soap.SOAPBinding; +import net.sf.json.JSONObject; +import net.sf.json.xml.XMLSerializer; + +import org.apache.commons.lang.StringUtils; + +import com.forgon.directory.model.BarcodeDevice; +import com.forgon.directory.model.OrgUnit; +import com.forgon.serialnumber.model.SerialNum; +import com.forgon.tools.GB2Alpha; +import com.forgon.tools.GB2WB; +import com.forgon.treenode.model.THTreeNode; + /** * 中大附一手术排班webserivce接口定义 * @author shuyongfu * @since 2016-09-07 */ @WebService +@SOAPBinding(style=SOAPBinding.Style.RPC) public interface OperationScheduleWebService { /** @@ -17,5 +33,7 @@ * @param xmlData 数据 * @return */ - public String submitData(String logonName,String password,String xmlData); + public String submitData(String xmlData); + + public String deal_dept(@WebParam(name="xmlmsg",mode=Mode.IN) String xmlmsg); } Index: ssts-web/src/main/resources/config/zsyy/mybatis/FindPatientInfoByHospitalNumMapper.xml =================================================================== diff -u -r15114 -r16368 --- ssts-web/src/main/resources/config/zsyy/mybatis/FindPatientInfoByHospitalNumMapper.xml (.../FindPatientInfoByHospitalNumMapper.xml) (revision 15114) +++ ssts-web/src/main/resources/config/zsyy/mybatis/FindPatientInfoByHospitalNumMapper.xml (.../FindPatientInfoByHospitalNumMapper.xml) (revision 16368) @@ -7,16 +7,22 @@ Index: ssts-userecord/src/main/java/com/forgon/disinfectsystem/operationSchedule/service/OperationScheduleManagerImpl.java =================================================================== diff -u -r15334 -r16368 --- ssts-userecord/src/main/java/com/forgon/disinfectsystem/operationSchedule/service/OperationScheduleManagerImpl.java (.../OperationScheduleManagerImpl.java) (revision 15334) +++ ssts-userecord/src/main/java/com/forgon/disinfectsystem/operationSchedule/service/OperationScheduleManagerImpl.java (.../OperationScheduleManagerImpl.java) (revision 16368) @@ -1,10 +1,37 @@ package com.forgon.disinfectsystem.operationSchedule.service; +import java.text.ParseException; +import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang.StringUtils; + import jxl.common.Logger; +import com.forgon.Constants; +import com.forgon.directory.acegi.tools.AcegiHelper; +import com.forgon.directory.model.OrgUnit; +import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; +import com.forgon.disinfectsystem.entity.basedatamanager.operationNameManager.OperationUseTousseItem; +import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig; +import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseDefinition; +import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; +import com.forgon.disinfectsystem.entity.operationreservation.OperationReservation; +import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.entity.useRecord.OperationSchedule; +import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseDefinitionManager; +import com.forgon.serialnumber.model.SerialNum; +import com.forgon.serialnumber.service.SerialNumManager; +import com.forgon.tools.GB2Alpha; +import com.forgon.tools.GB2WB; +import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; /** @@ -18,16 +45,154 @@ private Logger logger = Logger.getLogger(this.getClass()); private ObjectDao objectDao; + + private SupplyRoomConfigManager supplyRoomConfigManager; + + private SerialNumManager serialNumManager; + + private TousseDefinitionManager tousseDefinitionManager; public void setObjectDao(ObjectDao objectDao) { this.objectDao = objectDao; } + + public void setSupplyRoomConfigManager( + SupplyRoomConfigManager supplyRoomConfigManager) { + this.supplyRoomConfigManager = supplyRoomConfigManager; + } + public SupplyRoomConfigManager getSupplyRoomConfigManager() { + return supplyRoomConfigManager; + } + + public void setTousseDefinitionManager( + TousseDefinitionManager tousseDefinitionManager) { + this.tousseDefinitionManager = tousseDefinitionManager; + } + + public void setSerialNumManager(SerialNumManager serialNumManager) { + this.serialNumManager = serialNumManager; + } + /** * 手术排班新增与更新方法 * @param operationSchedule */ public void saveOrUpdate(OperationSchedule operationSchedule) { + objectDao.saveOrUpdate(operationSchedule); + saveOperationReservationByOperationSchedule(operationSchedule); + } + + private void saveOperationReservationByOperationSchedule(OperationSchedule operationSchedule){ + + OperationReservation operationReservation = new OperationReservation(); + operationReservation.setOperationName(operationSchedule.getOperation()); + operationReservation.setOperatingRoom(operationSchedule.getOperatingRoomName()); + operationReservation.setDoctors(operationSchedule.getSurgeon()); + + String operationDepart = "手术室"; + OrgUnit operationOrgUnit = (OrgUnit)objectDao.getBySql(OrgUnit.class.getSimpleName(), "where name='" + operationDepart + "'"); + operationReservation.setDepart(operationDepart); + operationReservation.setDepartCoding(operationOrgUnit.getOrgUnitCoding()); + operationReservation.setSettleAccountsDepart(operationDepart); + operationReservation.setSettleAccountsDepartCoding(operationOrgUnit.getOrgUnitCoding()); + + if (StringUtils.isNotBlank(operationSchedule.getScheduledDateTime())) { + try { + Date operationTime = Constants.SIMPLEDATEFORMAT_YYYYMMDDHHMMSS.parse(operationSchedule.getScheduledDateTime()); + operationReservation.setOperationTime(operationTime); + } catch (ParseException e) { + try { + Date operationTime = Constants.SIMPLEDATEFORMAT_YYYYMMDDHHMM.parse(operationSchedule.getScheduledDateTime()); + operationReservation.setOperationTime(operationTime); + } catch (ParseException e1) { + try { + Date operationTime = Constants.SIMPLEDATEFORMAT_YYYYMMDD.parse(operationSchedule.getScheduledDateTime()); + operationReservation.setOperationTime(operationTime); + } catch (ParseException e2) { + + } + } + } + } + if(operationReservation.getApplicationTime() == null){ + operationReservation.setApplicationTime(new Date()); + } + operationReservation.setApplicant("接口推送"); + operationReservation.setSubmitTime(new Date()); + operationReservation.setCommittedStatus(true); + + SupplyRoomConfig firstSupplyRoomConfig = supplyRoomConfigManager.getFirstSupplyRoomConfig(); + operationReservation.setHandleDepart(firstSupplyRoomConfig.getOrgUnitCoding()); + operationReservation.setHandleDepartCoding(firstSupplyRoomConfig.getOrgUnitName()); + operationReservation.setRemark("接口推送"); + operationReservation.setSpelling(GB2Alpha.string2Alpha(operationDepart)); + operationReservation.setWbCode(GB2WB.getWBCode(operationDepart)); + operationReservation.setRecyclingStatus(null); + operationReservation.setDeliverStatus(InvoicePlan.DELIVERSTATUS_AWAITDELIVER); + operationReservation.setType(InvoicePlan.TYPE_OPERATION_RESERVATION_APPLICATION); + operationReservation.setIncludeInvoiceItems(InvoicePlan.SIGNED_TRUE); + if(StringUtils.isBlank(operationReservation.getSerialNumber())){ + operationReservation.setSerialNumber(serialNumManager + .getSerialNumberStr(SerialNum.TYPE_RECYCLINGAPPLICATION)); + } + Map toDeleteMap = new HashMap(); + List oldItems = operationReservation.getApplicationItems(); + if(oldItems != null){ + for (TousseItem tousseItem : oldItems) { + toDeleteMap.put(tousseItem.getId(), tousseItem); + } + } + + List operationUseTousseItemList = + objectDao.findByHql("from OperationUseTousseItem where operationNameId=(select id from OperationName where operationName='"+ operationSchedule.getOperation() +"')"); + List tousseItems = new ArrayList(); + for (int i = 0; CollectionUtils.isNotEmpty(operationUseTousseItemList) && i < operationUseTousseItemList.size(); i++) { + OperationUseTousseItem operationUseTousseItem = operationUseTousseItemList.get(i); + Long tousseDefinitionId = operationUseTousseItem.getTousseDefinitionId(); + if(!DatabaseUtil.isPoIdValid(tousseDefinitionId)){ + //throw new RuntimeException("参数错误!"); + continue; + } + String name = operationUseTousseItem.getName(); + Integer amount = operationUseTousseItem.getAmount(); + if(amount <= 0){ + //throw new RuntimeException(name + ",数量必须大于0!"); + continue; + } + TousseItem tousseItem = new TousseItem(); + TousseDefinition td = tousseDefinitionManager.getTousseDefinitionById(tousseDefinitionId); + if (td == null) { + //throw new RuntimeException(name + ",定义已不存在!"); + continue; + } + String tousseType = td.getTousseType(); + if (!TousseDefinition.PACKAGE_TYPE_INSIDE.equals(tousseType) + && !TousseDefinition.PACKAGE_TYPE_DRESSING.equals(tousseType)) { + //throw new RuntimeException("暂不支持【" + tousseType + "】类型的器械包!"); + continue; + } + tousseItem.setAmount(amount); + tousseItem.setTousseName(name); + tousseItem.setTousseDefinitionId(tousseDefinitionId); + Double price = td.getPrice() == null ? 0d : td.getPrice(); + tousseItem.setPrice(price); + tousseItem.setRowPrice(price * amount); + tousseItem.setDiposable(Constants.STR_NO); + tousseItem.setTousseType(tousseType); + tousseItem.setInvoicePlan(operationReservation); + tousseItems.add(tousseItem); + } + operationReservation.setApplicationItems(tousseItems); + + objectDao.saveOrUpdate(operationReservation); + } + + /** + * 手术排班新增与更新方法 + * @param operationSchedule + */ + /*public void saveOrUpdate(OperationSchedule operationSchedule) { if(OperationSchedule.OPERATIONTYPE_UPDATE.equalsIgnoreCase(operationSchedule.getOperateType())){ OperationSchedule oldOperationSchedule = (OperationSchedule)objectDao.getByProperty(OperationSchedule.class.getSimpleName(), "itemId", operationSchedule.getItemId()); @@ -93,6 +258,6 @@ }else{ objectDao.saveOrUpdate(operationSchedule); } - } + }*/ } Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/operationschedule/zsyy/OperationScheduleWebServiceImpl.java =================================================================== diff -u -r15334 -r16368 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/operationschedule/zsyy/OperationScheduleWebServiceImpl.java (.../OperationScheduleWebServiceImpl.java) (revision 15334) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/operationschedule/zsyy/OperationScheduleWebServiceImpl.java (.../OperationScheduleWebServiceImpl.java) (revision 16368) @@ -7,26 +7,42 @@ import java.util.List; import java.util.Map; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebParam.Mode; import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.Style; +import javax.xml.ws.BindingType; -import org.apache.commons.lang.StringUtils; - import net.sf.json.JSONArray; import net.sf.json.JSONObject; import net.sf.json.xml.XMLSerializer; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import com.forgon.directory.model.BarcodeDevice; +import com.forgon.directory.model.OrgUnit; import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.entity.useRecord.OperationSchedule; import com.forgon.disinfectsystem.operationSchedule.service.OperationScheduleManager; +import com.forgon.serialnumber.model.SerialNum; +import com.forgon.tools.Constants; +import com.forgon.tools.GB2Alpha; +import com.forgon.tools.GB2WB; import com.forgon.tools.date.DateTools; +import com.forgon.treenode.model.THTreeNode; import com.google.gson.JsonObject; +import com.oracle.xmlns.internal.webservices.jaxws_databinding.WebParamMode; /** * 中大附一手术排班webserivce接口实现 * @author shuyongfu * @since 2016-09-07 */ @WebService(endpointInterface = "com.forgon.disinfectsystem.webservice.operationschedule.zsyy.OperationScheduleWebService", serviceName = "/operationScheduleWebService") +@SOAPBinding(style=SOAPBinding.Style.RPC) public class OperationScheduleWebServiceImpl implements OperationScheduleWebService { private JsonObject config; @@ -42,39 +58,244 @@ this.operationScheduleManager = operationScheduleManager; } + private final Logger logger = Logger.getLogger(this.getClass()); + //接口是否在运行中,防止重复调用 static boolean running = false; /** * 手术排班接口调用提交 - * @param logonName 用户名 - * @param password 密码 - * @param xmlData 数据 - * @return + * --@param logonName 用户名 暂时放这里 + * --@param password 密码 + * @param xmlData 参数数据,格式如下: + * + + 2.16.840.1.113883.4.487.2.1 + 2.16.840.1.113883.4.487.2.1.34 + 20140909130101 + OperationPatientInfo + MN20140909000009 + Normal + 1.0.0 + + + + + + 住院号 + 病人姓名 + 性别 + 出生日期 + 身份证号 + 手术名称 + 手术间 + 手术医生 + 手术时间 + 巡回护士 + 洗手护士 + + + ]]> + + + * @return xml格式文本,具体如下: + * + + 2.16.840.1.113883.4.487.2.1.34 + 2.16.840.1.113883.4.487.2.1 + 20140909130103 + OperationPatientInfo + MN20140909000009 + 0 + + Normal + 1.0.0 + + + + + 住院号 + 手术名称 + 手术时间 + 成功为0,失败为1 + + + ]]> + + + */ - public String submitData(String logonName,String password,String xmlData){ - Map resultMap = null; - String resultXml = null; + public String submitData(String xmlData){ + JSONObject resultJsonObject = null; + String resultXml = ""; if(running){ - resultMap = new HashMap(); - resultMap.put("errorCode","9999"); - resultMap.put("errorMessage","接口正在运行中,请稍候再调用!"); + resultXml += ""; + resultXml += "5001"; + resultXml += "接口正在运行中,请稍候再调用!"; + resultXml += ""; }else{ running = true; - resultMap = processData(xmlData); + try{ + resultJsonObject = processOperationPatientData(xmlData); + }catch(Exception e){ + e.printStackTrace(); + } running = false; + resultXml += ""; + JSONObject responseJSONObject = resultJsonObject.optJSONObject("Response"); + JSONObject responseHeaderJSONObject = responseJSONObject.optJSONObject("responseHeader"); + + resultXml += ""; + resultXml += ""+ responseHeaderJSONObject.optString("sender") +""; + resultXml += ""+ responseHeaderJSONObject.optString("receiver") +""; + resultXml += ""+ responseHeaderJSONObject.optString("sendTime") +""; + resultXml += ""+ responseHeaderJSONObject.optString("msgType") +""; + resultXml += ""+ responseHeaderJSONObject.optString("msgId") +""; + resultXml += ""+ responseHeaderJSONObject.optString("errorMessage") +""; + resultXml += ""+ responseHeaderJSONObject.optString("msgPriority") +""; + resultXml += ""+ responseHeaderJSONObject.optString("msgVersion") +""; + resultXml += ""; + + JSONObject responseBodyJSONObject = responseJSONObject.optJSONObject("responseBody"); + JSONArray operationJSONArray = responseBodyJSONObject.optJSONArray("List"); + resultXml += ""; + + for(int i = 0;operationJSONArray != null && i < operationJSONArray.size();i++){ + JSONObject operationJSONObject = operationJSONArray.optJSONObject(i); + resultXml += ""; + resultXml += ""+ operationJSONObject.optString("PATIENT_ID") +""; + resultXml += ""+ operationJSONObject.optString("OPERATION") +""; + resultXml += ""+ operationJSONObject.optString("SCHEDULED_DATE_TIME") +""; + resultXml += ""+ operationJSONObject.optString("RESULT") +""; + resultXml += ""; + } + + resultXml += ""; } - resultXml = "" + resultMap.get("errorCode") - +"" + resultMap.get("errorMessage") - +""; return resultXml; } /** * 处理手术排班数据 * @param xmlData */ - private Map processData(String xmlData){ + private JSONObject processOperationPatientData(String xmlData){ + JSONObject requestParamterJsonObject = null; + JSONObject resultJsonObject = new JSONObject(); + + JSONObject responseHeaderJsonObject = new JSONObject(); + JSONObject responseBodyJsonObject = new JSONObject(); + JSONArray operationJsonArray = new JSONArray(); + try{ + XMLSerializer xmlSerializer = new XMLSerializer(); + requestParamterJsonObject = (JSONObject)xmlSerializer.read(xmlData); + }catch(Exception e){ + responseHeaderJsonObject.put("errorCode","1000"); + responseHeaderJsonObject.put("errorMessage","消息格式错误"); + } + if(requestParamterJsonObject != null){ + + JSONObject requestHeaderJsonObject = requestParamterJsonObject.optJSONObject("requestHeader"); + responseHeaderJsonObject.put("sender", requestHeaderJsonObject.opt("sender")); + responseHeaderJsonObject.put("receiver", requestHeaderJsonObject.opt("receiver")); + responseHeaderJsonObject.put("sendTime", requestHeaderJsonObject.opt("sendTime")); + responseHeaderJsonObject.put("msgType", requestHeaderJsonObject.opt("msgType")); + responseHeaderJsonObject.put("msgId", requestHeaderJsonObject.opt("msgId")); + responseHeaderJsonObject.put("msgPriority", requestHeaderJsonObject.opt("msgPriority")); + responseHeaderJsonObject.put("msgVersion", requestHeaderJsonObject.opt("msgVersion")); + + JSONArray requestBodyListJsonArray = requestParamterJsonObject.optJSONArray("requestBody"); + Object operationPatientInfoObject = requestBodyListJsonArray.optJSONObject(0).opt("OperationPatientInfo"); + + JSONArray operationPatientInfoJsonArray = new JSONArray(); + if(operationPatientInfoObject instanceof JSONObject){ + operationPatientInfoJsonArray.add(operationPatientInfoObject); + }else if(operationPatientInfoObject instanceof JSONArray){ + operationPatientInfoJsonArray = (JSONArray)operationPatientInfoObject; + } + List list = new ArrayList(); + for(int i = 0;i < operationPatientInfoJsonArray.size();i++){ + JSONObject operationPatientInfoJsonObject = operationPatientInfoJsonArray.optJSONObject(i); + Object patientId = operationPatientInfoJsonObject.opt("PATIENT_ID");//住院号 + Object name = operationPatientInfoJsonObject.opt("NAME");//名称 + Object sexCode = operationPatientInfoJsonObject.opt("SEX_CODE");//性别 + Object birthday = operationPatientInfoJsonObject.opt("BIRTHDAY");//出生日期 + Object idenNo = operationPatientInfoJsonObject.opt("IDENNO");//身份证号 + Object operation = operationPatientInfoJsonObject.opt("OPERATION");//手术名称 + Object operatingRoomName = operationPatientInfoJsonObject.opt("OPERATING_ROOM_NAME");//手术间 + Object surgeon = operationPatientInfoJsonObject.opt("SURGEON");//手术医生 + Object scheduledDateTime = operationPatientInfoJsonObject.opt("SCHEDULED_DATE_TIME");//手术时间 + Object firstSupplyNurse = operationPatientInfoJsonObject.opt("FIRST_SUPPLY_NURSE");//巡回护士 + Object firstOperationNurse = operationPatientInfoJsonObject.opt("FIRST_OPERATION_NURSE");//洗手护士 + + + /*************************/ + + OperationSchedule operationSchedule = new OperationSchedule(); + operationSchedule.setSaveDate(new Date()); + operationSchedule.setLastModifyDate(operationSchedule.getSaveDate()); + operationSchedule.setPatientId(patientId instanceof String ? (String)patientId : null); + operationSchedule.setName(name instanceof String ? (String)name : null); + operationSchedule.setSexCode(sexCode instanceof String ? (String)sexCode : null); + String birthdayStr = birthday instanceof String ? (String)birthday : null; + Date birthdayDate = null; + if(StringUtils.isNotBlank(birthdayStr)){ + birthdayDate = DateTools.parseDateIfNotEmpty(birthdayStr, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"), null); + if(birthdayDate == null){ + birthdayDate = DateTools.parseDateIfNotEmpty(birthdayStr, new SimpleDateFormat("yyyy-MM-dd"), null); + } + + if(birthdayDate == null){ + // + } + }else{ + // + } + operationSchedule.setBirthday(birthdayDate); + + operationSchedule.setIdenNo(idenNo instanceof String ? (String)idenNo : null); + operationSchedule.setOperation(operation instanceof String ? (String)operation : null); + operationSchedule.setOperatingRoomName(operatingRoomName instanceof String ? (String)operatingRoomName : null); + operationSchedule.setSurgeon(surgeon instanceof String ? (String)surgeon : null); + operationSchedule.setScheduledDateTime(scheduledDateTime instanceof String ? (String)scheduledDateTime : null); + operationSchedule.setFirstSupplyNurse(firstSupplyNurse instanceof String ? (String)firstSupplyNurse : null); + operationSchedule.setFirstOperationNurse(firstOperationNurse instanceof String ? (String)firstOperationNurse : null); + + list.add(operationSchedule); + } + + for(OperationSchedule operationSchedule : list){ + JSONObject responseOperationJsonObject = new JSONObject(); + responseOperationJsonObject.put("PATIENT_ID", operationSchedule.getPatientId()); + responseOperationJsonObject.put("OPERATION", operationSchedule.getOperation()); + responseOperationJsonObject.put("SCHEDULED_DATE_TIME", operationSchedule.getScheduledDateTime()); + try{ + operationScheduleManager.saveOrUpdate(operationSchedule); + responseOperationJsonObject.put("RESULT", "0"); + }catch(Exception e){ + e.printStackTrace(); + responseOperationJsonObject.put("RESULT", "1"); + } + operationJsonArray.add(responseOperationJsonObject); + } + + }else{ + responseHeaderJsonObject.put("errorCode","1000"); + responseHeaderJsonObject.put("errorMessage","消息格式错误"); + } + responseBodyJsonObject.put("List", operationJsonArray); + resultJsonObject.put("responseHeader", responseHeaderJsonObject); + resultJsonObject.put("responseBody", responseBodyJsonObject); + resultJsonObject.put("Response", resultJsonObject); + return resultJsonObject; + } + + /** + * 处理手术排班数据 + * @param xmlData + */ +/* private Map processData(String xmlData){ Map resultMap = new HashMap(); resultMap.put("errorCode","0"); resultMap.put("errorMessage",""); @@ -165,7 +386,7 @@ Object Ynurgent = operationScheduleJsonObject.opt("YNURGENT"); Object Ynvalid = operationScheduleJsonObject.opt("YNVALID"); - /*************************/ + *//*************************//* OperationSchedule operationSchedule = new OperationSchedule(); operationSchedule.setItemId(itemId instanceof String ? (String)itemId : null); @@ -344,7 +565,7 @@ //回调上海岱嘉平台的接口 try { - String result = CssdUtils.callWebService("", "", ""); + String result = CssdUtils.callWebService("http://localhost:4463/OPERATEIND01.asmx", "", Constants.CHARSET_UTF8); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -362,5 +583,11 @@ resultMap.put("errorMessage","消息格式错误"); } return resultMap; + }*/ + + @WebMethod(action = "deal_dept") + public String deal_dept(@WebParam(name="xmlmsg",mode=Mode.IN) String xmlmsg) { + logger.error("组织机构="+xmlmsg); + return "1数据操作结果"; } } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/useRecord/OperationSchedule.java =================================================================== diff -u -r15334 -r16368 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/useRecord/OperationSchedule.java (.../OperationSchedule.java) (revision 15334) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/useRecord/OperationSchedule.java (.../OperationSchedule.java) (revision 16368) @@ -51,330 +51,503 @@ public static final String DATASOURCE_MANURAL = "手工添加"; /** - * 消息ID - */ - private String itemId; - - /** * 类型 ADD、UPDATE */ private String operateType; public static final String OPERATIONTYPE_ADD = "ADD"; public static final String OPERATIONTYPE_UPDATE = "UPDATE"; /** - * 手术序列号 OPERATIONNO + * 住院号PATIENT_ID */ - private String operationNo; + private String patientId; + + /** + * 患者姓名 NAME + */ + private String name; /** - * 住院流水号/门诊号 CLINIC_CODE + * 出生日期 BIRTHDAY */ - private String clinicCode; + private Date birthday; /** - * 病案号/病历号 PATIENT_NO + * 性别 SEX_CODE */ - private String patientNo; + private String sexCode; /** - * 1 门诊/2 住院 PASOURCE + * IDENNO>身份证号 */ - private String pasource; + private String idenNo; /** - * 患者姓名 NAME + * OPERATION > 手术名称 */ - private String name; + private String operation; /** - * 性别 SEX_CODE + * OPERATING_ROOM_NAME > 手术间 */ - private String sexCode; + private String operatingRoomName; /** - * 出生日期 BIRTHDAY + * SURGEON > 手术医生 */ - private Date birthday; + private String surgeon; /** - * 预交金 PREPAY_COST + * SCHEDULED_DATE_TIME > 手术时间 */ - private Double prepayCost; + private String scheduledDateTime; /** - * 住院科室 DEPT_CODE + * FIRST_SUPPLY_NURSE > 巡回护士 */ - private String deptCode; + private String firstSupplyNurse; /** - * 病床号 BED_NO + * FIRST_OPERATION_NURSE > 洗手护士 */ + private String firstOperationNurse; + + @Id + @GeneratedValue(strategy=GenerationType.AUTO) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getSaveDate() { + return saveDate; + } + + public void setSaveDate(Date saveDate) { + this.saveDate = saveDate; + } + + public Date getLastModifyDate() { + return lastModifyDate; + } + + public void setLastModifyDate(Date lastModifyDate) { + this.lastModifyDate = lastModifyDate; + } + + public String getDataSource() { + return dataSource; + } + + public void setDataSource(String dataSource) { + this.dataSource = dataSource; + } + + public String getOperateType() { + return operateType; + } + + public void setOperateType(String operateType) { + this.operateType = operateType; + } + + public String getPatientId() { + return patientId; + } + + public void setPatientId(String patientId) { + this.patientId = patientId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getSexCode() { + return sexCode; + } + + public void setSexCode(String sexCode) { + this.sexCode = sexCode; + } + + public String getIdenNo() { + return idenNo; + } + + public void setIdenNo(String idenNo) { + this.idenNo = idenNo; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getOperatingRoomName() { + return operatingRoomName; + } + + public void setOperatingRoomName(String operatingRoomName) { + this.operatingRoomName = operatingRoomName; + } + + public String getSurgeon() { + return surgeon; + } + + public void setSurgeon(String surgeon) { + this.surgeon = surgeon; + } + + public String getScheduledDateTime() { + return scheduledDateTime; + } + + public void setScheduledDateTime(String scheduledDateTime) { + this.scheduledDateTime = scheduledDateTime; + } + + public String getFirstSupplyNurse() { + return firstSupplyNurse; + } + + public void setFirstSupplyNurse(String firstSupplyNurse) { + this.firstSupplyNurse = firstSupplyNurse; + } + + public String getFirstOperationNurse() { + return firstOperationNurse; + } + + public void setFirstOperationNurse(String firstOperationNurse) { + this.firstOperationNurse = firstOperationNurse; + } + + + +/* + *//** + * 消息ID + *//* + private String itemId; + + *//** + * 手术序列号 OPERATIONNO + *//* + private String operationNo; + + *//** + * 住院流水号/门诊号 CLINIC_CODE + *//* + private String clinicCode; + + *//** + * 病案号/病历号 PATIENT_NO + *//* + private String patientNo; + + *//** + * 1 门诊/2 住院 PASOURCE + *//* + private String pasource; + + *//** + * 预交金 PREPAY_COST + *//* + private Double prepayCost; + + *//** + * 住院科室 DEPT_CODE + *//* + private String deptCode; + + *//** + * 病床号 BED_NO + *//* private String bedNo; - /** + *//** * 患者血型 BLOOD_CODE - */ + *//* private String bloodCode; - /** + *//** * 手术诊断 DIAGNOSE - */ + *//* private String diagnose; - /** + *//** * 手术分类,1 普通/2急诊/3 感染 OPS_KIND - */ + *//* private String opsKind; - /** + *//** * 手术医生编码 OPS_DOCD - */ + *//* private String opsDocd; - /** + *//** * 指导医生编码 GUI_DOCD - */ + *//* private String guiDocd; - /** + *//** * 病房号 SICK_ROOM - */ + *//* private String sickRoom; - /** + *//** * 预约时间 PRE_DATE - */ + *//* private Date preDate; - /** + *//** * 预定用时 DURATION - */ + *//* private String duration; - /** + *//** * 麻醉类型 ANES_TYPE - */ + *//* private String anesType; - /** + *//** * 助手数 HELPER_NUM - */ + *//* private Integer helperNum; - /** + *//** * 洗手护士数 WASH_NURSE - */ + *//* private Integer washNurse; - /** + *//** * 随台护士数 ACCO_NURSE - */ + *//* private Integer accoNurse; - /** + *//** * 巡回护士数 PREP_NURSE - */ + *//* private Integer prepNurse; - /** + *//** * 执行科室 EXEC_DEPT - */ + *//* private String execDept; - /** + *//** * 1 普通 2 加台 3 点台 4 加急台 CONSOLE_TYPE - */ + *//* private String consoleType; - /** + *//** * 申请医生编码 APPLY_DOCD - */ + *//* private String applyDocd; - /** + *//** * 申请科室编码 APPLY_DPCD - */ + *//* private String applyDpcd; - /** + *//** * 申请时间 APPLY_DATE - */ + *//* private Date applyDate; - /** + *//** * 申请备注 APPLY_NOTE - */ + *//* private String applyNote; - /** + *//** * 审批医生编码 APPR_DOCD - */ + *//* private String apprDocd; - /** + *//** * 审批时间 APPR_DATE - */ + *//* private Date apprDate; - /** + *//** * 审批备注 APPR_NOTE - */ + *//* private String apprNote; - /** + *//** * 麻醉医生编码 ANES_DOCD - */ + *//* private String anesDocd; - /** + *//** * 手术规模 DEGREE - */ + *//* private String degree; - /** + *//** * 切口类型 INCI_TYPE - */ + *//* private String inciType; - /** + *//** * 1 有菌 0 无菌 YNGERM - */ + *//* private String yngerm; - /** + *//** * 1 幕上 2 幕下 SCREENUP - */ + *//* private String screeNup; - /** + *//** * 手术台 CONSOLE_CODE - */ + *//* private String consoleCode; - /** + *//** * 接患者时间 RECEPT_DATE - */ + *//* private Date receptDate; - /** + *//** * 是否允许医生查看安排结果 1 允许 2 不允许 BLOOD_TYPE - */ + *//* private String bloodType; - /** + *//** * 血量 BLOOD_NUM - */ + *//* private Double bloodNum; - /** + *//** * 用血单位 BLOOD_UNIT - */ + *//* private String bloodUnit; - /** + *//** * 手术注意事项 OPS_NOTE - */ + *//* private String opsNote; - /** + *//** * 麻醉注意事项 ANE_NOTE - */ + *//* private String aneNote; - /** + *//** * 1 手术申请 2 手术审批 3 手术安排 4 手术完成 EXECSTATUS - */ + *//* private String execstatus; - /** + *//** * 0 未做手术/1 已做手术 YNFINISHED - */ + *//* private String ynfinished; - /** + *//** * 0 未麻醉/1 已麻醉 YNANESTH - */ + *//* private String ynanesth; - /** + *//** * 签字家属 FOLK - */ + *//* private String folk; - /** + *//** * 家属关系 RELA_CODE - */ + *//* private String relaCode; - /** + *//** * 家属意见 FOLK_COMMENT - */ + *//* private String folkComment; - /** + *//** * 加急手术,1 是/0 否 YNURGENT - */ + *//* private String ynurgent; - /** + *//** * 是否已经计费 , 1 未收费,0 已计费 YNCHANGE - */ + *//* private String ynchange; - /** + *//** * 1 重症/0 否 YNHEAVY - */ + *//* private String ynheavy; - /** + *//** * 1 特殊手术/0 否 YNSPECIAL - */ + *//* private String ynspecial; - /** + *//** * 操作员 OPER_CODE - */ + *//* private String operCode; - /** + *//** * 操作时间 OPER_DATE - */ + *//* private Date operDate; - /** + *//** * 1 有效/0 无效YNVALID - */ + *//* private String ynvalid; - /** + *//** * 1 合并/0 否 YNUNITE - */ + *//* private String ynunite; - /** + *//** * 合并后手术序列号 UNITE_NO - */ + *//* private String uniteNo; - /** + *//** * 是否需要随台护士 0 是/1 否 ISNEEDACCO - */ + *//* private String isNeedAcco; - /** + *//** * 是否需要巡回护士 0 是/1 否 ISNEEDPREP - */ + *//* private String isNeedPrep; - /** + *//** * 房间号 ROOM_ID - */ + *//* private String roomId; - /** + *//** * 手术医生科室编码(医生可能会发生转科,所以此处记录当时医生科室) DOC_DPCD - */ + *//* private String docDpcd; @Id @@ -930,5 +1103,5 @@ public void setDocDpcd(String docDpcd) { this.docDpcd = docDpcd; } - + */ } Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/service/DataSynchronizationManagerImpl.java =================================================================== diff -u -r15209 -r16368 --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/service/DataSynchronizationManagerImpl.java (.../DataSynchronizationManagerImpl.java) (revision 15209) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/service/DataSynchronizationManagerImpl.java (.../DataSynchronizationManagerImpl.java) (revision 16368) @@ -27,6 +27,7 @@ import com.forgon.directory.model.OrgUserRelation; import com.forgon.directory.service.OrgUnitManager; import com.forgon.disinfectsystem.basedatamanager.supplier.service.SupplierManager; +import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByHospitalNumDao; import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByTreatmentNumDao; import com.forgon.disinfectsystem.datasynchronization.dao.SyncOrgUnitAndUserDao; @@ -110,6 +111,11 @@ if(findPatientInfoByHospitalNumDao == null){ return null; } + //住院号前缀,中大附一住院号有前缀 + String hospitalNumberPrefix = CssdUtils.getSystemSetConfigByName("hospitalNumberPrefix"); + if(StringUtils.isNotBlank(hospitalNum) && StringUtils.isNotBlank(hospitalNumberPrefix) && hospitalNum.startsWith(hospitalNumberPrefix)){ + hospitalNum = hospitalNum.replaceFirst(hospitalNumberPrefix, ""); + } return findPatientInfoByHospitalNumDao.findPatientInfoByHospitalNum(hospitalNum); } @@ -118,6 +124,11 @@ if(findPatientInfoByTreatmentNumDao == null){ return null; } + //诊疗号前缀,中大附一诊疗号有前缀 + String clinicNumberPrefix = CssdUtils.getSystemSetConfigByName("clinicNumberPrefix"); + if(StringUtils.isNotBlank(treatmentNum) && StringUtils.isNotBlank(clinicNumberPrefix) && treatmentNum.startsWith(clinicNumberPrefix)){ + treatmentNum = treatmentNum.replaceFirst(clinicNumberPrefix, ""); + } return findPatientInfoByTreatmentNumDao.findPatientInfoByTreatmentNum(treatmentNum); } @@ -234,6 +245,7 @@ } long count = 0; + //循环his接口的科室数据集 for(OrgUnitVo vo : allVos){ OrgUnit orgUnit = (OrgUnit) orgUnitManager.getOrgUnitByCode(vo.coding); if(orgUnit != null && !更新交集数据) continue; //不是交集并且用户不希望更新交集 @@ -263,9 +275,16 @@ orgUnit.setSpelling(GB2Alpha.string2Alpha(vo.name)); orgUnit.setWbCode(GB2WB.getWBCode(vo.name)); + //如果科室编码与其父编码相同,则此科室的数据需要被忽略 + if(StringUtils.equals(vo.coding, vo.parentCoding)){ + logger.error("科室同步时:名称为" + vo.getName() + "的科室其编码与父编码相同,都为" + vo.coding + ",该科室同步必须过滤掉."); + continue; + } + THTreeNode parent = orgUnitManager.getOrgUnitByCode(vo.parentCoding); - if(parent == null) + if(parent == null){ parent = orgUnitManager.getOrgUnitByCode(默认父节点的编码); + } orgUnit.setParent(parent); orgUnitManager.saveOrUpdata(orgUnit); //保存更新操作