|
|
|
@ -31,7 +31,6 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
@Override
|
|
|
|
|
public String deptModify(String receiveUser) {
|
|
|
|
|
log.info("新增/修改科室数据:{}", receiveUser);
|
|
|
|
|
boolean registerResult = false;
|
|
|
|
|
DeptDto deptDto;
|
|
|
|
|
String msgId = "";
|
|
|
|
|
String receiver = "";
|
|
|
|
@ -39,37 +38,22 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
deptDto = strToDeptDto(receiveUser);
|
|
|
|
|
msgId = deptDto.getMessageId();
|
|
|
|
|
receiver = deptDto.getReceiver();
|
|
|
|
|
} catch (BaseException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return failedMessage(e.getMessage(), msgId, receiver);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return failedMessage("消息解析失败!", msgId, receiver);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
String operateType = deptDto.getOperateType();
|
|
|
|
|
String delType = "D";
|
|
|
|
|
// 判断操作类型
|
|
|
|
|
if (Func.isNotEmpty(operateType) && operateType.contains(delType)) {
|
|
|
|
|
registerResult = powerDeptService.delDeptByDeptCode(deptDto.getDeptCode());
|
|
|
|
|
powerDeptService.delDeptByDeptCode(deptDto.getDeptCode());
|
|
|
|
|
} else {
|
|
|
|
|
registerResult = powerDeptService.register(deptDto);
|
|
|
|
|
powerDeptService.register(deptDto);
|
|
|
|
|
}
|
|
|
|
|
return successMessage("操作成功!", msgId, receiver);
|
|
|
|
|
} catch (BaseException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return failedMessage(e.getMessage(), msgId, receiver);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return failedMessage("系统出错啦!", msgId, receiver);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (registerResult) {
|
|
|
|
|
return successMessage("操作成功!", msgId, receiver);
|
|
|
|
|
}
|
|
|
|
|
return failedMessage("系统出错啦!", msgId, receiver);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -80,21 +64,23 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
* @return UserDto
|
|
|
|
|
*/
|
|
|
|
|
public DeptDto strToDeptDto(String receiveUser) {
|
|
|
|
|
DeptDto deptDto = new DeptDto();
|
|
|
|
|
|
|
|
|
|
XmlUtil xmlParseUtil = XmlUtil.of(receiveUser);
|
|
|
|
|
Node msgIdNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/id/@extension");
|
|
|
|
|
deptDto.setMessageId(msgIdNode.getNodeValue());
|
|
|
|
|
Node receiverNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/receiver/device/id/item/@extension");
|
|
|
|
|
deptDto.setReceiver(receiverNode.getNodeValue());
|
|
|
|
|
Node operateTypeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/@operateType");
|
|
|
|
|
deptDto.setOperateType(operateTypeNode.getNodeValue());
|
|
|
|
|
Node deptCodeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/DEPT_CODE/@value");
|
|
|
|
|
deptDto.setDeptCode(deptCodeNode.getNodeValue());
|
|
|
|
|
Node deptNameNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/DEPT_NAME/@value");
|
|
|
|
|
deptDto.setDeptName(deptNameNode.getNodeValue());
|
|
|
|
|
Node authorIdNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
|
|
|
|
|
deptDto.setAuthorId(authorIdNode.getNodeValue());
|
|
|
|
|
Node authorNameNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
|
|
|
|
|
|
|
|
|
|
DeptDto deptDto = new DeptDto();
|
|
|
|
|
deptDto.setMessageId(msgIdNode.getNodeValue());
|
|
|
|
|
deptDto.setReceiver(receiverNode.getNodeValue());
|
|
|
|
|
deptDto.setOperateType(operateTypeNode.getNodeValue());
|
|
|
|
|
deptDto.setDeptCode(deptCodeNode.getNodeValue());
|
|
|
|
|
deptDto.setDeptName(deptNameNode.getNodeValue());
|
|
|
|
|
deptDto.setAuthorId(authorIdNode.getNodeValue());
|
|
|
|
|
deptDto.setAuthorName(authorNameNode.getNodeValue());
|
|
|
|
|
return deptDto;
|
|
|
|
|
}
|
|
|
|
@ -110,8 +96,8 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
return "<MCCI_IN000002UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:hl7-org:v3\" xsi:schemaLocation=\"urn:hl7-org:v3\n" +
|
|
|
|
|
"file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI\n" +
|
|
|
|
|
"_IN000002UV01.xsd\">\n" +
|
|
|
|
|
"\t<id extension=\""+IdUtil.standardUUID()+"\"/>\n" +
|
|
|
|
|
"\t<creationTime value=\""+createTime+"\"/>\n" +
|
|
|
|
|
"\t<id extension=\"" + IdUtil.standardUUID() + "\"/>\n" +
|
|
|
|
|
"\t<creationTime value=\"" + createTime + "\"/>\n" +
|
|
|
|
|
"\t<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>\n" +
|
|
|
|
|
"\t<processingCode code=\"P\"/>\n" +
|
|
|
|
|
"\t<processingModeCode/>\n" +
|
|
|
|
@ -126,16 +112,16 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
"\t<sender typeCode=\"SND\">\n" +
|
|
|
|
|
"\t\t<device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
|
|
|
|
|
"\t\t\t<id>\n" +
|
|
|
|
|
"\t\t\t\t<item extension=\""+receiver+"\"/>\n" +
|
|
|
|
|
"\t\t\t\t<item extension=\"" + receiver + "\"/>\n" +
|
|
|
|
|
"\t\t\t</id>\n" +
|
|
|
|
|
"\t\t</device>\n" +
|
|
|
|
|
"\t</sender>\n" +
|
|
|
|
|
"\t<acknowledgement typeCode=\"AA\">\n" +
|
|
|
|
|
"\t\t<targetMessage>\n" +
|
|
|
|
|
"\t\t\t<id extension=\""+msgId+"\"/>\n" +
|
|
|
|
|
"\t\t\t<id extension=\"" + msgId + "\"/>\n" +
|
|
|
|
|
"\t\t</targetMessage>\n" +
|
|
|
|
|
"\t\t<acknowledgementDetail>\n" +
|
|
|
|
|
"\t\t\t<text value=\""+message+"\"/>\n" +
|
|
|
|
|
"\t\t\t<text value=\"" + message + "\"/>\n" +
|
|
|
|
|
"\t\t</acknowledgementDetail>\n" +
|
|
|
|
|
"\t</acknowledgement>\n" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
@ -152,8 +138,8 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
return "<RCMR_IN000030UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:hl7-org:v3\" xsi:schemaLocation=\"urn:hl7-org:v3\n" +
|
|
|
|
|
"file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/RCMR\n" +
|
|
|
|
|
"_IN000030UV01.xsd\">\n" +
|
|
|
|
|
"\t<id extension=\""+IdUtil.standardUUID()+"\"/>\n" +
|
|
|
|
|
"\t<creationTime value=\""+createTime+"\"/>\n" +
|
|
|
|
|
"\t<id extension=\"" + IdUtil.standardUUID() + "\"/>\n" +
|
|
|
|
|
"\t<creationTime value=\"" + createTime + "\"/>\n" +
|
|
|
|
|
"\t<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"RCMR_IN000030UV01\"/>\n" +
|
|
|
|
|
"\t<processingCode code=\"P\"/>\n" +
|
|
|
|
|
"\t<processingModeCode/>\n" +
|
|
|
|
@ -168,16 +154,16 @@ public class DeptServerImpl implements IDeptServer {
|
|
|
|
|
"\t<sender typeCode=\"SND\">\n" +
|
|
|
|
|
"\t\t<device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
|
|
|
|
|
"\t\t\t<id>\n" +
|
|
|
|
|
"\t\t\t\t<item extension=\""+receiver+"\"/>\n" +
|
|
|
|
|
"\t\t\t\t<item extension=\"" + receiver + "\"/>\n" +
|
|
|
|
|
"\t\t\t</id>\n" +
|
|
|
|
|
"\t\t</device>\n" +
|
|
|
|
|
"\t</sender>\n" +
|
|
|
|
|
"\t<acknowledgement typeCode=\"AE\">\n" +
|
|
|
|
|
"\t\t<targetMessage>\n" +
|
|
|
|
|
"\t\t\t<id extension=\""+msgId+"\"/>\n" +
|
|
|
|
|
"\t\t\t<id extension=\"" + msgId + "\"/>\n" +
|
|
|
|
|
"\t\t</targetMessage>\n" +
|
|
|
|
|
"\t\t<acknowledgementDetail>\n" +
|
|
|
|
|
"\t\t\t<text value=\""+message+"\"/>\n" +
|
|
|
|
|
"\t\t\t<text value=\"" + message + "\"/>\n" +
|
|
|
|
|
"\t\t</acknowledgementDetail>\n" +
|
|
|
|
|
"\t</acknowledgement>\n" +
|
|
|
|
|
"</RCMR_IN000030UV01>\n";
|
|
|
|
|