主动webservice模式编写
parent
df5716965a
commit
cc885adcb2
@ -0,0 +1,220 @@
|
|||||||
|
package com.docus.server.collect.basic.http;
|
||||||
|
|
||||||
|
import com.docus.core.util.DateUtil;
|
||||||
|
import com.docus.log.context.TrackContext;
|
||||||
|
import com.docus.server.record.pojo.dto.TBasicDTO;
|
||||||
|
import com.docus.server.ws.convert.IConverter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被动请求参数转化器
|
||||||
|
*
|
||||||
|
* @see com.docus.server.ws.impl.BasicServerImpl#setTBasic(String)
|
||||||
|
* @see com.docus.server.visitor.VisitorProcessor#beforeProcess(TrackContext)
|
||||||
|
*/
|
||||||
|
@Component("httpTBasicConverter")
|
||||||
|
public class HttpTBasicConverter implements IConverter<TBasicDTO> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TBasicDTO convert(String message, String group) {
|
||||||
|
// XmlUtil xml = XmlUtil.of(message);
|
||||||
|
// //id-消息流水号
|
||||||
|
// String serialId = null;
|
||||||
|
// Node serialIdNode = FlagEnum.INSERT.equals(methodName) ?
|
||||||
|
// xml.getNode("/PRPA_HIP0032/id/@extension") : xml.getNode("/PRPA_HIP0033/id/@extension");
|
||||||
|
// if (Func.isNotEmpty(serialIdNode)) {
|
||||||
|
// serialId = serialIdNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //接受方
|
||||||
|
// String receive = null;
|
||||||
|
// Node receiveNode = FlagEnum.INSERT.equals(methodName) ?
|
||||||
|
// xml.getNode("/PRPA_HIP0032/receiver/device/id/item/@extension") : xml.getNode("/PRPA_HIP0033/receiver/device/id/item/@extension");
|
||||||
|
// if (Func.isNotEmpty(receiveNode)) {
|
||||||
|
// receive = receiveNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //发送方
|
||||||
|
// String send = null;
|
||||||
|
// Node sendNode = xml.getNode("/PRPA_HIP0032/sender/device/id/item/@extension");
|
||||||
|
// if (Func.isNotEmpty(sendNode)) {
|
||||||
|
// send = sendNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //住院流水号
|
||||||
|
// String jzh = null;
|
||||||
|
// Node jzhNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension");
|
||||||
|
// if (Func.isNotEmpty(jzhNode)) {
|
||||||
|
// jzh = jzhNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //住院号标识
|
||||||
|
// String inpatientNo = null;
|
||||||
|
// Node inpatientNoNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension");
|
||||||
|
// if (Func.isNotEmpty(inpatientNoNode)) {
|
||||||
|
// inpatientNo = inpatientNoNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //住院次数[]
|
||||||
|
// String admissTimes = null;
|
||||||
|
// Node admissTimesNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value");
|
||||||
|
// if (Func.isNotEmpty(admissTimesNode)) {
|
||||||
|
// admissTimes = admissTimesNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //姓名
|
||||||
|
// String name = null;
|
||||||
|
// Node nameNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value");
|
||||||
|
// if (Func.isNotEmpty(nameNode)) {
|
||||||
|
// name = nameNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //入院日期时间
|
||||||
|
// String admissDate = null;
|
||||||
|
// Node admissDateNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value");
|
||||||
|
// if (Func.isNotEmpty(admissDateNode)) {
|
||||||
|
// admissDate = admissDateNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //出院日期时间
|
||||||
|
// String disDate = null;
|
||||||
|
// Node disDateNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value");
|
||||||
|
// if (Func.isNotEmpty(disDateNode)) {
|
||||||
|
// disDate = disDateNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //入院诊断科室名称[]
|
||||||
|
// String admissDeptName = null;
|
||||||
|
// Node admissDeptNameNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name");
|
||||||
|
// if (Func.isNotEmpty(admissDeptNameNode)) {
|
||||||
|
// admissDeptNameNode.getTextContent();
|
||||||
|
// }
|
||||||
|
// //出院诊断科室名称[]
|
||||||
|
// String disDeptName = null;
|
||||||
|
// Node disDeptNameNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name");
|
||||||
|
// if (Func.isNotEmpty(disDeptNameNode)) {
|
||||||
|
// disDeptName = disDeptNameNode.getTextContent();
|
||||||
|
// }
|
||||||
|
// //主治医师[]
|
||||||
|
// String attendingName = null;
|
||||||
|
// Node attendingNameNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name");
|
||||||
|
// if (Func.isNotEmpty(attendingNameNode)) {
|
||||||
|
// attendingName = attendingNameNode.getTextContent();
|
||||||
|
// }
|
||||||
|
// //年龄
|
||||||
|
// String age = null;
|
||||||
|
// Node ageNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/age[@unit='岁']/@value");
|
||||||
|
// if (Func.isNotEmpty(ageNode)) {
|
||||||
|
// age = ageNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //性别
|
||||||
|
// String sex = null;
|
||||||
|
// Node sexNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/administrativeGenderCode/@code");
|
||||||
|
// if (Func.isNotEmpty(sexNode)) {
|
||||||
|
// sex = sexNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //身份证号
|
||||||
|
// String idCard = null;
|
||||||
|
// Node idCardNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/id/item/@extension");
|
||||||
|
// if (Func.isNotEmpty(idCardNode)) {
|
||||||
|
// idCard = idCardNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //出院科室
|
||||||
|
// String disDept = null;
|
||||||
|
// Node disDeptCardNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/componentOf/encompassingEncounter/location/healthCareFacility/serviceProviderOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/id/@extension");
|
||||||
|
// if (Func.isNotEmpty(disDeptCardNode)) {
|
||||||
|
// disDept = disDeptCardNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //性别名称
|
||||||
|
// String sexName = null;
|
||||||
|
// Node sexNameNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/administrativeGenderCode/@displayName");
|
||||||
|
// if (Func.isNotEmpty(sexNameNode)) {
|
||||||
|
// sexName = sexNameNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //床位号
|
||||||
|
// String bedNum = null;
|
||||||
|
// Node bedNumNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/componentOf/encompassingEncounter/location/healthCareFacility/serviceProviderOrganization/asOrganizationPartOf/wholeOrganization/id/@extension");
|
||||||
|
// if (Func.isNotEmpty(bedNumNode)) {
|
||||||
|
// bedNum = bedNumNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //住院天数数[]
|
||||||
|
// String admissDays = null;
|
||||||
|
// Node admissDaysNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='天']/@value");
|
||||||
|
// if (Func.isNotEmpty(admissDaysNode)) {
|
||||||
|
// admissDays = admissDaysNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //是否死亡[]
|
||||||
|
// String isDead = null;
|
||||||
|
// Node isDeadNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院情况']/observation/value");
|
||||||
|
// if (Func.isNotEmpty(isDeadNode)) {
|
||||||
|
// isDead = isDeadNode.getTextContent();
|
||||||
|
// }
|
||||||
|
// //病区编号
|
||||||
|
// String wardCode = null;
|
||||||
|
// Node wardCodeNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/componentOf/encompassingEncounter/location/healthCareFacility/serviceProviderOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/id/@extension");
|
||||||
|
// if (Func.isNotEmpty(wardCodeNode)) {
|
||||||
|
// wardCode = wardCodeNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
// //病区名称
|
||||||
|
// String wardName = null;
|
||||||
|
// Node wardNameNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/componentOf/encompassingEncounter/location/healthCareFacility/serviceProviderOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/asOrganizationPartOf/wholeOrganization/name");
|
||||||
|
// if (Func.isNotEmpty(wardNameNode)) {
|
||||||
|
// wardName = wardNameNode.getTextContent();
|
||||||
|
// }
|
||||||
|
// //顺德人医第三方索引
|
||||||
|
// String sdryIndex = null;
|
||||||
|
// Node sdryIndexNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/id/item/@extension");
|
||||||
|
// if (Func.isNotEmpty(sdryIndexNode)) {
|
||||||
|
// sdryIndex = sdryIndexNode.getNodeValue();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //设置dto
|
||||||
|
// TBasicDTO dto = new TBasicDTO();
|
||||||
|
// dto.setSerialId(serialId);
|
||||||
|
// dto.setSend(send);
|
||||||
|
// dto.setReceive(receive);
|
||||||
|
// dto.setInpatientNo(inpatientNo);
|
||||||
|
// dto.setName(name);
|
||||||
|
// dto.setJzh(jzh);
|
||||||
|
// dto.setAdmissDeptName(admissDeptName);
|
||||||
|
// dto.setDisDeptName(disDeptName);
|
||||||
|
// dto.setAdmissDate(admissDate);
|
||||||
|
// dto.setDisDate(disDate);
|
||||||
|
// dto.setAdmissTimes(admissTimes);
|
||||||
|
// dto.setAttendingName(attendingName);
|
||||||
|
// dto.setAge(age);
|
||||||
|
// dto.setSex(sex);
|
||||||
|
// dto.setIdCard(idCard);
|
||||||
|
// dto.setDisDept(disDept);
|
||||||
|
// dto.setSexName(sexName);
|
||||||
|
// dto.setBedNum(bedNum);
|
||||||
|
// dto.setIsDead(isDead);
|
||||||
|
// dto.setAdmissDays(admissDays);
|
||||||
|
// dto.setWardCode(wardCode);
|
||||||
|
// dto.setWardName(wardName);
|
||||||
|
// dto.setSdryIndex(sdryIndex);
|
||||||
|
//
|
||||||
|
// dto.setParams(ParamsUtils.addParam("serialId", dto.getSerialId())
|
||||||
|
// .addParam("receive", dto.getReceive())
|
||||||
|
// .addParam("send", dto.getSend())
|
||||||
|
// .param());
|
||||||
|
|
||||||
|
|
||||||
|
TBasicDTO dto = new TBasicDTO();
|
||||||
|
dto.setSerialId("1212");
|
||||||
|
dto.setSend("1");
|
||||||
|
dto.setReceive("1");
|
||||||
|
dto.setInpatientNo("334");
|
||||||
|
dto.setName("1");
|
||||||
|
dto.setJzh("565");
|
||||||
|
dto.setAdmissDeptName("1");
|
||||||
|
dto.setDisDeptName("1");
|
||||||
|
dto.setAdmissDate(DateUtil.formatDateTime(DateUtil.now()));
|
||||||
|
dto.setDisDate(DateUtil.formatDateTime(DateUtil.now()));
|
||||||
|
dto.setAdmissTimes("3");
|
||||||
|
dto.setAttendingName("1");
|
||||||
|
dto.setAge("1");
|
||||||
|
dto.setSex("1");
|
||||||
|
dto.setIdCard("1");
|
||||||
|
dto.setDisDept("1");
|
||||||
|
dto.setSexName("1");
|
||||||
|
dto.setBedNum("1");
|
||||||
|
dto.setIsDead("1");
|
||||||
|
dto.setAdmissDays("1");
|
||||||
|
dto.setWardCode("1");
|
||||||
|
dto.setWardName("1");
|
||||||
|
dto.setSdryIndex("1");
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.docus.server.collect.dept.mq;
|
||||||
|
|
||||||
|
import com.docus.server.ws.IMqResult;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component("mqDeptResultImpl")
|
||||||
|
public class MqDeptResultImpl implements IMqResult {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void ok(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void fail(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.docus.server.collect.user.http;
|
||||||
|
|
||||||
|
import com.docus.server.sys.common.pojo.dto.UserDTO;
|
||||||
|
import com.docus.server.ws.convert.IConverter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被动ws和http转化器
|
||||||
|
*/
|
||||||
|
@Component("httpUserConverter")
|
||||||
|
public class HttpUserConverter implements IConverter<UserDTO> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDTO convert(String message, String group) {
|
||||||
|
// XmlUtil xmlParseUtil = XmlUtil.of(message);
|
||||||
|
// Node msgIdNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/id/@extension");
|
||||||
|
// Node receiverNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/receiver/device/id/item/@extension");
|
||||||
|
// Node operateTypeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/@operateType");
|
||||||
|
// Node employeeCodeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/EMPL_CODE/@value");
|
||||||
|
// Node employeeNameNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/EMPL_NAME/@value");
|
||||||
|
// Node deptCodeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/DEPT_CODE/@value");
|
||||||
|
// Node positionNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/POSI_NAME/@value");
|
||||||
|
// Node authorIdNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
|
||||||
|
// Node authorNameNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
|
||||||
|
// UserDTO userDTO = new UserDTO();
|
||||||
|
// userDTO.setDeptId(deptCodeNode.getNodeValue());
|
||||||
|
// userDTO.setReceiver(receiverNode.getNodeValue());
|
||||||
|
// userDTO.setOperateType(operateTypeNode.getNodeValue());
|
||||||
|
// userDTO.setUserName(employeeCodeNode.getNodeValue());
|
||||||
|
// userDTO.setName(employeeNameNode.getNodeValue());
|
||||||
|
// userDTO.setPosition(positionNode.getNodeValue());
|
||||||
|
// userDTO.setAuthorId(authorIdNode.getNodeValue());
|
||||||
|
// userDTO.setMessageId(msgIdNode.getNodeValue());
|
||||||
|
// userDTO.setAuthorName(authorNameNode.getNodeValue());
|
||||||
|
// userDTO.setRoleId(0L);
|
||||||
|
//
|
||||||
|
// userDTO.setParams(ParamsUtils.addParam("msg", "操作成功!")
|
||||||
|
// .addParam("msgId", userDTO.getMessageId())
|
||||||
|
// .addParam("receiver", userDTO.getReceiver())
|
||||||
|
// .param());
|
||||||
|
|
||||||
|
|
||||||
|
UserDTO userDTO = new UserDTO();
|
||||||
|
userDTO.setDeptId("1");
|
||||||
|
userDTO.setReceiver("2");
|
||||||
|
userDTO.setOperateType("3");
|
||||||
|
userDTO.setUserName("4");
|
||||||
|
userDTO.setName("5");
|
||||||
|
userDTO.setPosition("6");
|
||||||
|
userDTO.setAuthorId("7");
|
||||||
|
userDTO.setMessageId(UUID.randomUUID().toString());
|
||||||
|
userDTO.setAuthorName("9");
|
||||||
|
userDTO.setRoleId(0L);
|
||||||
|
|
||||||
|
// userDTO.setParams(ParamsUtils.addParam("msg", "操作成功!")
|
||||||
|
// .addParam("msgId", userDTO.getMessageId())
|
||||||
|
// .addParam("receiver", userDTO.getReceiver())
|
||||||
|
// .param());
|
||||||
|
|
||||||
|
|
||||||
|
return userDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.docus.server.collect.user.mq;
|
||||||
|
|
||||||
|
import com.docus.server.ws.IMqResult;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component("mqUserResultImpl")
|
||||||
|
public class MqUserResultImpl implements IMqResult {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void ok(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void fail(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
package com.docus.server.collect.mq;
|
|
||||||
|
|
||||||
public interface IMqCollectService {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,6 @@
|
|||||||
package com.docus.server.collect.mq.user;
|
package com.docus.server.collect.mq;
|
||||||
|
|
||||||
import com.docus.server.collect.mq.IMqCollectService;
|
public interface IUserMqCollectService {
|
||||||
|
|
||||||
public interface IMqUserCollectService extends IMqCollectService {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.docus.server.ws;
|
||||||
|
|
||||||
|
public interface IMqResult extends IResult<Void> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue